📄 m_brain.java
字号:
public final static int FRAME_stand19 = 180; public final static int FRAME_stand20 = 181; public final static int FRAME_stand21 = 182; public final static int FRAME_stand22 = 183; public final static int FRAME_stand23 = 184; public final static int FRAME_stand24 = 185; public final static int FRAME_stand25 = 186; public final static int FRAME_stand26 = 187; public final static int FRAME_stand27 = 188; public final static int FRAME_stand28 = 189; public final static int FRAME_stand29 = 190; public final static int FRAME_stand30 = 191; public final static int FRAME_stand31 = 192; public final static int FRAME_stand32 = 193; public final static int FRAME_stand33 = 194; public final static int FRAME_stand34 = 195; public final static int FRAME_stand35 = 196; public final static int FRAME_stand36 = 197; public final static int FRAME_stand37 = 198; public final static int FRAME_stand38 = 199; public final static int FRAME_stand39 = 200; public final static int FRAME_stand40 = 201; public final static int FRAME_stand41 = 202; public final static int FRAME_stand42 = 203; public final static int FRAME_stand43 = 204; public final static int FRAME_stand44 = 205; public final static int FRAME_stand45 = 206; public final static int FRAME_stand46 = 207; public final static int FRAME_stand47 = 208; public final static int FRAME_stand48 = 209; public final static int FRAME_stand49 = 210; public final static int FRAME_stand50 = 211; public final static int FRAME_stand51 = 212; public final static int FRAME_stand52 = 213; public final static int FRAME_stand53 = 214; public final static int FRAME_stand54 = 215; public final static int FRAME_stand55 = 216; public final static int FRAME_stand56 = 217; public final static int FRAME_stand57 = 218; public final static int FRAME_stand58 = 219; public final static int FRAME_stand59 = 220; public final static int FRAME_stand60 = 221; public final static float MODEL_SCALE = 1.000000f; static int sound_chest_open; static int sound_tentacles_extend; static int sound_tentacles_retract; static int sound_death; static int sound_idle1; static int sound_idle2; static int sound_idle3; static int sound_pain1; static int sound_pain2; static int sound_sight; static int sound_search; static int sound_melee1; static int sound_melee2; static int sound_melee3; static EntInteractAdapter brain_sight = new EntInteractAdapter() { public String getID() { return "brain_sight"; } public boolean interact(edict_t self, edict_t other) { GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_sight, 1, Defines.ATTN_NORM, 0); return true; } }; static EntThinkAdapter brain_search = new EntThinkAdapter() { public String getID() { return "brain_search"; } public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_search, 1, Defines.ATTN_NORM, 0); return true; } }; // // STAND // static mframe_t brain_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), 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 brain_move_stand = new mmove_t(FRAME_stand01, FRAME_stand30, brain_frames_stand, null); static EntThinkAdapter brain_stand = new EntThinkAdapter() { public String getID() { return "brain_stand"; } public boolean think(edict_t self) { self.monsterinfo.currentmove = brain_move_stand; return true; } }; // // IDLE // static mframe_t brain_frames_idle[] = 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), 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 brain_move_idle = new mmove_t(FRAME_stand31, FRAME_stand60, brain_frames_idle, brain_stand); static EntThinkAdapter brain_idle = new EntThinkAdapter() { public String getID() { return "brain_idle"; } public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_AUTO, sound_idle3, 1, Defines.ATTN_IDLE, 0); self.monsterinfo.currentmove = brain_move_idle; return true; } }; // // WALK // static mframe_t brain_frames_walk1[] = new mframe_t[] { new mframe_t(GameAI.ai_walk, 7, null), new mframe_t(GameAI.ai_walk, 2, null), new mframe_t(GameAI.ai_walk, 3, null), new mframe_t(GameAI.ai_walk, 3, null), new mframe_t(GameAI.ai_walk, 1, null), new mframe_t(GameAI.ai_walk, 0, null), new mframe_t(GameAI.ai_walk, 0, null), new mframe_t(GameAI.ai_walk, 9, null), new mframe_t(GameAI.ai_walk, -4, null), new mframe_t(GameAI.ai_walk, -1, null), new mframe_t(GameAI.ai_walk, 2, null) }; static mmove_t brain_move_walk1 = new mmove_t(FRAME_walk101, FRAME_walk111, brain_frames_walk1, null); // walk2 is FUBAR, do not use /* * # if 0 void brain_walk2_cycle(edict_t self) { if (random() > 0.1) * self.monsterinfo.nextframe= FRAME_walk220; } * * static mframe_t brain_frames_walk2[]= new mframe_t[] { new * mframe_t(ai_walk, 3, null), new mframe_t(ai_walk, -2, null), new * mframe_t(ai_walk, -4, null), new mframe_t(ai_walk, -3, null), new * mframe_t(ai_walk, 0, null), new mframe_t(ai_walk, 1, null), new * mframe_t(ai_walk, 12, null), new mframe_t(ai_walk, 0, null), new * mframe_t(ai_walk, -3, null), new mframe_t(ai_walk, 0, null), new * mframe_t(ai_walk, -2, null), new mframe_t(ai_walk, 0, null), new * mframe_t(ai_walk, 0, null), new mframe_t(ai_walk, 1, null), new * mframe_t(ai_walk, 0, null), new mframe_t(ai_walk, 0, null), new * mframe_t(ai_walk, 0, null), new mframe_t(ai_walk, 0, null), new * mframe_t(ai_walk, 0, null), new mframe_t(ai_walk, 10, null, // Cycle * Start) * * new mframe_t(ai_walk, -1, null), new mframe_t(ai_walk, 7, null), new * mframe_t(ai_walk, 0, null), new mframe_t(ai_walk, 3, null), new * mframe_t(ai_walk, -3, null), new mframe_t(ai_walk, 2, null), new * mframe_t(ai_walk, 4, null), new mframe_t(ai_walk, -3, null), new * mframe_t(ai_walk, 2, null), new mframe_t(ai_walk, 0, null), new * mframe_t(ai_walk, 4, brain_walk2_cycle), new mframe_t(ai_walk, -1, null), * new mframe_t(ai_walk, -1, null), new mframe_t(ai_walk, -8, null,) new * mframe_t(ai_walk, 0, null), new mframe_t(ai_walk, 1, null), new * mframe_t(ai_walk, 5, null), new mframe_t(ai_walk, 2, null), new * mframe_t(ai_walk, -1, null), new mframe_t(ai_walk, -5, null)}; static * mmove_t brain_move_walk2= new mmove_t(FRAME_walk201, FRAME_walk240, * brain_frames_walk2, null); * # endif */ static EntThinkAdapter brain_walk = new EntThinkAdapter() { public String getID() { return "brain_walk"; } public boolean think(edict_t self) { // if (random() <= 0.5) self.monsterinfo.currentmove = brain_move_walk1; // else // self.monsterinfo.currentmove = &brain_move_walk2; return true; } }; // // DUCK // static EntThinkAdapter brain_duck_down = new EntThinkAdapter() { public String getID() { return "brain_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; GameBase.gi.linkentity(self); return true; } }; static EntThinkAdapter brain_duck_hold = new EntThinkAdapter() { public String getID() { return "brain_duck_hold"; } public boolean think(edict_t self) { if (GameBase.level.time >= self.monsterinfo.pausetime) self.monsterinfo.aiflags &= ~Defines.AI_HOLD_FRAME; else self.monsterinfo.aiflags |= Defines.AI_HOLD_FRAME; return true; } }; static EntThinkAdapter brain_duck_up = new EntThinkAdapter() { public String getID() { return "brain_duck_up"; } public boolean think(edict_t self) { self.monsterinfo.aiflags &= ~Defines.AI_DUCKED; self.maxs[2] += 32; self.takedamage = Defines.DAMAGE_AIM; GameBase.gi.linkentity(self); return true; } }; static EntDodgeAdapter brain_dodge = new EntDodgeAdapter() { public String getID() { return "brain_dodge"; } public void dodge(edict_t self, edict_t attacker, float eta) { if (Lib.random() > 0.25) return; if (self.enemy == null) self.enemy = attacker; self.monsterinfo.pausetime = GameBase.level.time + eta + 0.5f; self.monsterinfo.currentmove = brain_move_duck; return; } }; static mframe_t brain_frames_death2[] = 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, 9, null), new mframe_t(GameAI.ai_move, 0, null) }; static EntThinkAdapter brain_dead = new EntThinkAdapter() { public String getID() { return "brain_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 mmove_t brain_move_death2 = new mmove_t(FRAME_death201, FRAME_death205, brain_frames_death2, brain_dead); static mframe_t brain_frames_death1[] = 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, -2, null), new mframe_t(GameAI.ai_move, 9, 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 brain_move_death1 = new mmove_t(FRAME_death101, FRAME_death118, brain_frames_death1, brain_dead);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -