📄 m_infantry.java
字号:
public final static int FRAME_death216 = 160; public final static int FRAME_death217 = 161; public final static int FRAME_death218 = 162; public final static int FRAME_death219 = 163; public final static int FRAME_death220 = 164; public final static int FRAME_death221 = 165; public final static int FRAME_death222 = 166; public final static int FRAME_death223 = 167; public final static int FRAME_death224 = 168; public final static int FRAME_death225 = 169; public final static int FRAME_death301 = 170; public final static int FRAME_death302 = 171; public final static int FRAME_death303 = 172; public final static int FRAME_death304 = 173; public final static int FRAME_death305 = 174; public final static int FRAME_death306 = 175; public final static int FRAME_death307 = 176; public final static int FRAME_death308 = 177; public final static int FRAME_death309 = 178; public final static int FRAME_block01 = 179; public final static int FRAME_block02 = 180; public final static int FRAME_block03 = 181; public final static int FRAME_block04 = 182; public final static int FRAME_block05 = 183; public final static int FRAME_attak101 = 184; public final static int FRAME_attak102 = 185; public final static int FRAME_attak103 = 186; public final static int FRAME_attak104 = 187; public final static int FRAME_attak105 = 188; public final static int FRAME_attak106 = 189; public final static int FRAME_attak107 = 190; public final static int FRAME_attak108 = 191; public final static int FRAME_attak109 = 192; public final static int FRAME_attak110 = 193; public final static int FRAME_attak111 = 194; public final static int FRAME_attak112 = 195; public final static int FRAME_attak113 = 196; public final static int FRAME_attak114 = 197; public final static int FRAME_attak115 = 198; public final static int FRAME_attak201 = 199; public final static int FRAME_attak202 = 200; public final static int FRAME_attak203 = 201; public final static int FRAME_attak204 = 202; public final static int FRAME_attak205 = 203; public final static int FRAME_attak206 = 204; public final static int FRAME_attak207 = 205; public final static int FRAME_attak208 = 206; public final static float MODEL_SCALE = 1.000000f; static int sound_pain1; static int sound_pain2; static int sound_die1; static int sound_die2; static int sound_gunshot; static int sound_weapon_cock; static int sound_punch_swing; static int sound_punch_hit; static int sound_sight; static int sound_search; static int sound_idle; static mframe_t infantry_frames_stand[] = new mframe_t[] { new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null) }; static mmove_t infantry_move_stand = new mmove_t(FRAME_stand50, FRAME_stand71, infantry_frames_stand, null); public static EntThinkAdapter infantry_stand = new EntThinkAdapter() { public String getID() { return "infantry_stand"; } public boolean think(edict_t self) { self.monsterinfo.currentmove = infantry_move_stand; return true; } }; static mframe_t infantry_frames_fidget[] = new mframe_t[] { new mframe_t(GameAI.ai_stand, 1, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 1, null), new mframe_t(GameAI.ai_stand, 3, null), new mframe_t(GameAI.ai_stand, 6, null), new mframe_t(GameAI.ai_stand, 3, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 1, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 1, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, -1, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 1, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, -2, null), new mframe_t(GameAI.ai_stand, 1, null), new mframe_t(GameAI.ai_stand, 1, null), new mframe_t(GameAI.ai_stand, 1, null), new mframe_t(GameAI.ai_stand, -1, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, -1, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, -1, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 1, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, -1, null), new mframe_t(GameAI.ai_stand, -1, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, -3, null), new mframe_t(GameAI.ai_stand, -2, null), new mframe_t(GameAI.ai_stand, -3, null), new mframe_t(GameAI.ai_stand, -3, null), new mframe_t(GameAI.ai_stand, -2, null) }; static mmove_t infantry_move_fidget = new mmove_t(FRAME_stand01, FRAME_stand49, infantry_frames_fidget, infantry_stand); static EntThinkAdapter infantry_fidget = new EntThinkAdapter() { public String getID() { return "infantry_fidget"; } public boolean think(edict_t self) { self.monsterinfo.currentmove = infantry_move_fidget; GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_idle, 1, Defines.ATTN_IDLE, 0); return true; } }; static mframe_t infantry_frames_walk[] = new mframe_t[] { new mframe_t(GameAI.ai_walk, 5, null), new mframe_t(GameAI.ai_walk, 4, null), new mframe_t(GameAI.ai_walk, 4, null), new mframe_t(GameAI.ai_walk, 5, null), new mframe_t(GameAI.ai_walk, 4, null), new mframe_t(GameAI.ai_walk, 5, null), new mframe_t(GameAI.ai_walk, 6, null), new mframe_t(GameAI.ai_walk, 4, null), new mframe_t(GameAI.ai_walk, 4, null), new mframe_t(GameAI.ai_walk, 4, null), new mframe_t(GameAI.ai_walk, 4, null), new mframe_t(GameAI.ai_walk, 5, null) }; static mmove_t infantry_move_walk = new mmove_t(FRAME_walk03, FRAME_walk14, infantry_frames_walk, null); static EntThinkAdapter infantry_walk = new EntThinkAdapter() { public String getID() { return "infantry_walk"; } public boolean think(edict_t self) { self.monsterinfo.currentmove = infantry_move_walk; return true; } }; static mframe_t infantry_frames_run[] = new mframe_t[] { new mframe_t(GameAI.ai_run, 10, null), new mframe_t(GameAI.ai_run, 20, null), new mframe_t(GameAI.ai_run, 5, null), new mframe_t(GameAI.ai_run, 7, null), new mframe_t(GameAI.ai_run, 30, null), new mframe_t(GameAI.ai_run, 35, null), new mframe_t(GameAI.ai_run, 2, null), new mframe_t(GameAI.ai_run, 6, null) }; static mmove_t infantry_move_run = new mmove_t(FRAME_run01, FRAME_run08, infantry_frames_run, null); static EntThinkAdapter infantry_run = new EntThinkAdapter() { public String getID() { return "infantry_run"; } public boolean think(edict_t self) { if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) self.monsterinfo.currentmove = infantry_move_stand; else self.monsterinfo.currentmove = infantry_move_run; return true; } }; static mframe_t infantry_frames_pain1[] = new mframe_t[] { new mframe_t(GameAI.ai_move, -3, null), new mframe_t(GameAI.ai_move, -2, null), new mframe_t(GameAI.ai_move, -1, null), new mframe_t(GameAI.ai_move, -2, null), new mframe_t(GameAI.ai_move, -1, null), new mframe_t(GameAI.ai_move, 1, null), new mframe_t(GameAI.ai_move, -1, null), new mframe_t(GameAI.ai_move, 1, null), new mframe_t(GameAI.ai_move, 6, null), new mframe_t(GameAI.ai_move, 2, null) }; static mmove_t infantry_move_pain1 = new mmove_t(FRAME_pain101, FRAME_pain110, infantry_frames_pain1, infantry_run); static mframe_t infantry_frames_pain2[] = new mframe_t[] { new mframe_t(GameAI.ai_move, -3, null), new mframe_t(GameAI.ai_move, -3, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, -1, null), new mframe_t(GameAI.ai_move, -2, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 2, null), new mframe_t(GameAI.ai_move, 5, null), new mframe_t(GameAI.ai_move, 2, null) }; static mmove_t infantry_move_pain2 = new mmove_t(FRAME_pain201, FRAME_pain210, infantry_frames_pain2, infantry_run); static EntPainAdapter infantry_pain = new EntPainAdapter() { public String getID() { return "infantry_pain"; } 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() % 2; if (n == 0) { self.monsterinfo.currentmove = infantry_move_pain1; GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain1, 1, Defines.ATTN_NORM, 0); } else { self.monsterinfo.currentmove = infantry_move_pain2; GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain2, 1, Defines.ATTN_NORM, 0); } } }; static float[] aimangles[] = { { 0.0f, 5.0f, 0.0f }, { 10.0f, 15.0f, 0.0f }, { 20.0f, 25.0f, 0.0f }, { 25.0f, 35.0f, 0.0f }, { 30.0f, 40.0f, 0.0f }, { 30.0f, 45.0f, 0.0f }, { 25.0f, 50.0f, 0.0f }, { 20.0f, 40.0f, 0.0f }, { 15.0f, 35.0f, 0.0f }, { 40.0f, 35.0f, 0.0f }, { 70.0f, 35.0f, 0.0f }, { 90.0f, 35.0f, 0.0f } }; static EntThinkAdapter InfantryMachineGun = new EntThinkAdapter() { public String getID() { return "InfantryMachineGun"; } public boolean think(edict_t self) { float[] start = { 0, 0, 0 }, target = { 0, 0, 0 }; float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }; float[] vec = { 0, 0, 0 }; int flash_number; if (self.s.frame == FRAME_attak111) { flash_number = Defines.MZ2_INFANTRY_MACHINEGUN_1; Math3D.AngleVectors(self.s.angles, forward, right, null); Math3D.G_ProjectSource(self.s.origin, M_Flash.monster_flash_offset[flash_number], forward, right, start); if (self.enemy != null) { Math3D.VectorMA(self.enemy.s.origin, -0.2f, self.enemy.velocity, target); target[2] += self.enemy.viewheight; Math3D.VectorSubtract(target, start, forward); Math3D.VectorNormalize(forward); } else { Math3D.AngleVectors(self.s.angles, forward, right, null); } } else { flash_number = Defines.MZ2_INFANTRY_MACHINEGUN_2 + (self.s.frame - FRAME_death211); Math3D.AngleVectors(self.s.angles, forward, right, null); Math3D.G_ProjectSource(self.s.origin, M_Flash.monster_flash_offset[flash_number], forward, right, start);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -