📄 m_medic.java
字号:
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), 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), 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 medic_move_stand = new mmove_t(FRAME_wait1, FRAME_wait90, medic_frames_stand, null); static EntThinkAdapter medic_stand = new EntThinkAdapter() { public String getID(){ return "medic_stand"; } public boolean think(edict_t self) { self.monsterinfo.currentmove = medic_move_stand; return true; } }; static mframe_t medic_frames_walk[] = new mframe_t[] { new mframe_t(GameAI.ai_walk, 6.2f, null), new mframe_t(GameAI.ai_walk, 18.1f, null), new mframe_t(GameAI.ai_walk, 1, null), new mframe_t(GameAI.ai_walk, 9, null), new mframe_t(GameAI.ai_walk, 10, null), new mframe_t(GameAI.ai_walk, 9, null), new mframe_t(GameAI.ai_walk, 11, null), new mframe_t(GameAI.ai_walk, 11.6f, null), new mframe_t(GameAI.ai_walk, 2, null), new mframe_t(GameAI.ai_walk, 9.9f, null), new mframe_t(GameAI.ai_walk, 14, null), new mframe_t(GameAI.ai_walk, 9.3f, null) }; static mmove_t medic_move_walk = new mmove_t(FRAME_walk1, FRAME_walk12, medic_frames_walk, null); static EntThinkAdapter medic_walk = new EntThinkAdapter() { public String getID(){ return "medic_walk"; } public boolean think(edict_t self) { self.monsterinfo.currentmove = medic_move_walk; return true; } }; static mframe_t medic_frames_run[] = new mframe_t[] { new mframe_t(GameAI.ai_run, 18, null), new mframe_t(GameAI.ai_run, 22.5f, null), new mframe_t(GameAI.ai_run, 25.4f, null), new mframe_t(GameAI.ai_run, 23.4f, null), new mframe_t(GameAI.ai_run, 24, null), new mframe_t(GameAI.ai_run, 35.6f, null) }; static mmove_t medic_move_run = new mmove_t(FRAME_run1, FRAME_run6, medic_frames_run, null); static EntThinkAdapter medic_run = new EntThinkAdapter() { public String getID(){ return "medic_run"; } public boolean think(edict_t self) { if (0 == (self.monsterinfo.aiflags & Defines.AI_MEDIC)) { edict_t ent; ent = medic_FindDeadMonster(self); if (ent != null) { self.oldenemy = self.enemy; self.enemy = ent; self.enemy.owner = self; self.monsterinfo.aiflags |= Defines.AI_MEDIC; GameUtil.FoundTarget(self); return true; } } if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) self.monsterinfo.currentmove = medic_move_stand; else self.monsterinfo.currentmove = medic_move_run; return true; } }; static mframe_t medic_frames_pain1[] = new mframe_t[] { new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null) }; static mmove_t medic_move_pain1 = new mmove_t(FRAME_paina1, FRAME_paina8, medic_frames_pain1, medic_run); static mframe_t medic_frames_pain2[] = new mframe_t[] { new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null) }; static mmove_t medic_move_pain2 = new mmove_t(FRAME_painb1, FRAME_painb15, medic_frames_pain2, medic_run); static EntPainAdapter medic_pain = new EntPainAdapter() { public String getID(){ return "medic_pain"; } public void pain(edict_t self, edict_t other, float kick, int damage) { 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 if (Lib.random() < 0.5) { self.monsterinfo.currentmove = medic_move_pain1; GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain1, 1, Defines.ATTN_NORM, 0); } else { self.monsterinfo.currentmove = medic_move_pain2; GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain2, 1, Defines.ATTN_NORM, 0); } } }; static EntThinkAdapter medic_fire_blaster = new EntThinkAdapter() { public String getID(){ return "medic_fire_blaster"; } public boolean think(edict_t self) { float[] start = { 0, 0, 0 }; float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }; float[] end = { 0, 0, 0 }; float[] dir = { 0, 0, 0 }; int effect; if ((self.s.frame == FRAME_attack9) || (self.s.frame == FRAME_attack12)) effect = Defines.EF_BLASTER; else if ((self.s.frame == FRAME_attack19) || (self.s.frame == FRAME_attack22) || (self.s.frame == FRAME_attack25) || (self.s.frame == FRAME_attack28)) effect = Defines.EF_HYPERBLASTER; else effect = 0; Math3D.AngleVectors(self.s.angles, forward, right, null); Math3D.G_ProjectSource(self.s.origin, M_Flash.monster_flash_offset[Defines.MZ2_MEDIC_BLASTER_1], forward, right, start); Math3D.VectorCopy(self.enemy.s.origin, end); end[2] += self.enemy.viewheight; Math3D.VectorSubtract(end, start, dir); Monster.monster_fire_blaster(self, start, dir, 2, 1000, Defines.MZ2_MEDIC_BLASTER_1, effect); return true; } }; static EntThinkAdapter medic_dead = new EntThinkAdapter() { public String getID(){ return "medic_dead"; } 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; } }; static mframe_t medic_frames_death[] = new mframe_t[] { new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null) }; static mmove_t medic_move_death = new mmove_t(FRAME_death1, FRAME_death30, medic_frames_death, medic_dead); static EntDieAdapter medic_die = new EntDieAdapter() { public String getID(){ return "medic_die"; } public void die(edict_t self, edict_t inflictor, edict_t attacker, int damage, float[] point) { int n; // if we had a pending patient, free him up for another medic if ((self.enemy != null) && (self.enemy.owner == self)) self.enemy.owner = null; // check for gib if (self.health <= self.gib_health) { GameBase.gi .sound(self, Defines.CHAN_VOICE, GameBase.gi .soundindex("misc/udeath.wav"), 1, Defines.ATTN_NORM, 0); for (n = 0; n < 2; n++) GameMisc.ThrowGib(self, "models/objects/gibs/bone/tris.md2", damage, Defines.GIB_ORGANIC); for (n = 0; n < 4; n++) GameMisc.ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, Defines.GIB_ORGANIC); GameMisc.ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, Defines.GIB_ORGANIC); self.deadflag = Defines.DEAD_DEAD; return; } if (self.deadflag == Defines.DEAD_DEAD) return; // regular death GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_die, 1, Defines.ATTN_NORM, 0); self.deadflag = Defines.DEAD_DEAD; self.takedamage = Defines.DAMAGE_YES; self.monsterinfo.currentmove = medic_move_death; } }; static EntThinkAdapter medic_duck_down = new EntThinkAdapter() { public String getID(){ return "medic_duck_down"; } public boolean think(edict_t self) { if ((self.monsterinfo.aiflags & Defines.AI_DUCKED) != 0) return true; self.monsterinfo.aiflags |= Defines.AI_DUCKED; self.maxs[2] -= 32; self.takedamage = Defines.DAMAGE_YES; self.monsterinfo.pausetime = GameBase.level.time + 1; GameBase.gi.linkentity(self); return true; } }; static EntThinkAdapter medic_duck_hold = new EntThinkAdapter() { public String getID(){ return "medic_duck_hold"; } public boolean think(edict_t self) { if (GameBase.level.time >= self.monsterinfo.pausetime) self.monsterinfo.aiflags &= ~Defines.AI_HOLD_FRAME; else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -