Beispiel #1
0
        public void pain(edict_t self, edict_t other, float kick, int damage) {
          int n;

          if (self.health < (self.max_health / 2)) self.s.skinnum = 1;

          if (GameBase.level.time < self.pain_debounce_time) return;

          self.pain_debounce_time = GameBase.level.time + 3;
          if (GameBase.skill.value == 3) return; // no pain anims in nightmare

          n = (Lib.rand() + 1) % 3;
          if (n == 0) {
            GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain1, 1, Defines.ATTN_NORM, 0);
            self.monsterinfo.currentmove = floater_move_pain1;
          } else {
            GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain2, 1, Defines.ATTN_NORM, 0);
            self.monsterinfo.currentmove = floater_move_pain2;
          }
          return;
        }
Beispiel #2
0
        public boolean think(edict_t self) {
          float[] forward = {0, 0, 0}, right = {0, 0, 0};
          float[] origin = {0, 0, 0};
          float[] dir = {0, 0, 0};
          float[] offset = {0, 0, 0};

          Math3D.VectorSubtract(self.enemy.s.origin, self.s.origin, dir);

          Math3D.AngleVectors(self.s.angles, forward, right, null);
          // FIXME use a flash and replace these two lines with the commented
          // one
          Math3D.VectorSet(offset, 18.5f, -0.9f, 10f);
          Math3D.G_ProjectSource(self.s.origin, offset, forward, right, origin);
          //		G_ProjectSource (self.s.origin,
          // monster_flash_offset[flash_number], forward, right, origin);

          GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_attack2, 1, Defines.ATTN_NORM, 0);

          // FIXME use the flash, Luke
          GameBase.gi.WriteByte(Defines.svc_temp_entity);
          GameBase.gi.WriteByte(Defines.TE_SPLASH);
          GameBase.gi.WriteByte(32);
          GameBase.gi.WritePosition(origin);
          GameBase.gi.WriteDir(dir);
          GameBase.gi.WriteByte(1); // sparks
          GameBase.gi.multicast(origin, Defines.MULTICAST_PVS);

          GameCombat.T_Damage(
              self.enemy,
              self,
              self,
              dir,
              self.enemy.s.origin,
              Globals.vec3_origin,
              5 + Lib.rand() % 6,
              -10,
              Defines.DAMAGE_ENERGY,
              Defines.MOD_UNKNOWN);
          return true;
        }
Beispiel #3
0
        public boolean think(edict_t self) {

          GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_attack3, 1, Defines.ATTN_NORM, 0);
          GameWeapon.fire_hit(self, aim, 5 + Lib.rand() % 6, -50);
          return true;
        }