Beispiel #1
0
        public boolean think(edict_t self) {

          Math3D.VectorSet(self.mins, -16, -16, -24);
          Math3D.VectorSet(self.maxs, 16, 16, -8);
          self.movetype = Defines.MOVETYPE_TOSS;
          self.svflags |= Defines.SVF_DEADMONSTER;
          self.nextthink = 0;
          GameBase.gi.linkentity(self);
          return true;
        }
Beispiel #2
0
  /*
   * QUAKED monster_gladiator (1 .5 0) (-32 -32 -24) (32 32 64) Ambush
   * Trigger_Spawn Sight
   */
  public static void SP_monster_gladiator(edict_t self) {
    if (GameBase.deathmatch.value != 0) {
      GameUtil.G_FreeEdict(self);
      return;
    }

    sound_pain1 = GameBase.gi.soundindex("gladiator/pain.wav");
    sound_pain2 = GameBase.gi.soundindex("gladiator/gldpain2.wav");
    sound_die = GameBase.gi.soundindex("gladiator/glddeth2.wav");
    sound_gun = GameBase.gi.soundindex("gladiator/railgun.wav");
    sound_cleaver_swing = GameBase.gi.soundindex("gladiator/melee1.wav");
    sound_cleaver_hit = GameBase.gi.soundindex("gladiator/melee2.wav");
    sound_cleaver_miss = GameBase.gi.soundindex("gladiator/melee3.wav");
    sound_idle = GameBase.gi.soundindex("gladiator/gldidle1.wav");
    sound_search = GameBase.gi.soundindex("gladiator/gldsrch1.wav");
    sound_sight = GameBase.gi.soundindex("gladiator/sight.wav");

    self.movetype = Defines.MOVETYPE_STEP;
    self.solid = Defines.SOLID_BBOX;
    self.s.modelindex = GameBase.gi.modelindex("models/monsters/gladiatr/tris.md2");
    Math3D.VectorSet(self.mins, -32, -32, -24);
    Math3D.VectorSet(self.maxs, 32, 32, 64);

    self.health = 400;
    self.gib_health = -175;
    self.mass = 400;

    self.pain = gladiator_pain;
    self.die = gladiator_die;

    self.monsterinfo.stand = gladiator_stand;
    self.monsterinfo.walk = gladiator_walk;
    self.monsterinfo.run = gladiator_run;
    self.monsterinfo.dodge = null;
    self.monsterinfo.attack = gladiator_attack;
    self.monsterinfo.melee = gladiator_melee;
    self.monsterinfo.sight = gladiator_sight;
    self.monsterinfo.idle = gladiator_idle;
    self.monsterinfo.search = gladiator_search;

    GameBase.gi.linkentity(self);
    self.monsterinfo.currentmove = gladiator_move_stand;
    self.monsterinfo.scale = MODEL_SCALE;

    GameAI.walkmonster_start.think(self);
  }
Beispiel #3
0
        public boolean think(edict_t self) {

          float range;
          float[] v = {0, 0, 0};

          // a small safe zone
          Math3D.VectorSubtract(self.s.origin, self.enemy.s.origin, v);
          range = Math3D.VectorLength(v);
          if (range <= (Defines.MELEE_DISTANCE + 32)) return true;

          // charge up the railgun
          GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_gun, 1, Defines.ATTN_NORM, 0);
          Math3D.VectorCopy(self.enemy.s.origin, self.pos1);
          // save for aiming the shot
          self.pos1[2] += self.enemy.viewheight;
          self.monsterinfo.currentmove = gladiator_move_attack_gun;
          return true;
        }
Beispiel #4
0
        public boolean think(edict_t self) {

          float[] aim = {0, 0, 0};

          Math3D.VectorSet(aim, Defines.MELEE_DISTANCE, self.mins[0], -4);
          if (GameWeapon.fire_hit(self, aim, (20 + (Lib.rand() % 5)), 300))
            GameBase.gi.sound(self, Defines.CHAN_AUTO, sound_cleaver_hit, 1, Defines.ATTN_NORM, 0);
          else
            GameBase.gi.sound(self, Defines.CHAN_AUTO, sound_cleaver_miss, 1, Defines.ATTN_NORM, 0);
          return true;
        }
Beispiel #5
0
        public boolean think(edict_t self) {

          float[] start = {0, 0, 0};

          float[] dir = {0, 0, 0};
          float[] forward = {0, 0, 0}, right = {0, 0, 0};

          Math3D.AngleVectors(self.s.angles, forward, right, null);
          Math3D.G_ProjectSource(
              self.s.origin,
              M_Flash.monster_flash_offset[Defines.MZ2_GLADIATOR_RAILGUN_1],
              forward,
              right,
              start);

          // calc direction to where we targted
          Math3D.VectorSubtract(self.pos1, start, dir);
          Math3D.VectorNormalize(dir);

          Monster.monster_fire_railgun(self, start, dir, 50, 100, Defines.MZ2_GLADIATOR_RAILGUN_1);

          return true;
        }