⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m_insane.java

📁 Jake2是一个Java 3D游戏引擎.
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
            else                self.monsterinfo.currentmove = insane_move_struggle_cross;            return true;        }    };    static EntThinkAdapter insane_walk = new EntThinkAdapter() {    	public String getID() { return "insane_walk"; }        public boolean think(edict_t self) {            if ((self.spawnflags & 16) != 0) // Hold Ground?                if (self.s.frame == FRAME_cr_pain10) {                    self.monsterinfo.currentmove = insane_move_down;                    return true;                }            if ((self.spawnflags & 4) != 0)                self.monsterinfo.currentmove = insane_move_crawl;            else if (Lib.random() <= 0.5)                self.monsterinfo.currentmove = insane_move_walk_normal;            else                self.monsterinfo.currentmove = insane_move_walk_insane;            return true;        }    };    static EntThinkAdapter insane_run = new EntThinkAdapter() {    	public String getID() { return "insane_run"; }        public boolean think(edict_t self) {            if ((self.spawnflags & 16) != 0) // Hold Ground?                if (self.s.frame == FRAME_cr_pain10) {                    self.monsterinfo.currentmove = insane_move_down;                    return true;                }            if ((self.spawnflags & 4) != 0) // Crawling?                self.monsterinfo.currentmove = insane_move_runcrawl;            else if (Lib.random() <= 0.5) // Else, mix it up                self.monsterinfo.currentmove = insane_move_run_normal;            else                self.monsterinfo.currentmove = insane_move_run_insane;            return true;        }    };    static EntPainAdapter insane_pain = new EntPainAdapter() {    	public String getID() { return "insane_pain"; }        public void pain(edict_t self, edict_t other, float kick, int damage) {            int l, r;            //	 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;            r = 1 + (Lib.rand() & 1);            if (self.health < 25)                l = 25;            else if (self.health < 50)                l = 50;            else if (self.health < 75)                l = 75;            else                l = 100;            GameBase.gi.sound(self, Defines.CHAN_VOICE, GameBase.gi                    .soundindex("player/male/pain" + l + "_" + r + ".wav"), 1,                    Defines.ATTN_IDLE, 0);            if (GameBase.skill.value == 3)                return; // no pain anims in nightmare            // Don't go into pain frames if crucified.            if ((self.spawnflags & 8) != 0) {                self.monsterinfo.currentmove = insane_move_struggle_cross;                return;            }            if (((self.s.frame >= FRAME_crawl1) && (self.s.frame <= FRAME_crawl9))                    || ((self.s.frame >= FRAME_stand99) && (self.s.frame <= FRAME_stand160))) {                self.monsterinfo.currentmove = insane_move_crawl_pain;            } else                self.monsterinfo.currentmove = insane_move_stand_pain;        }    };    static EntThinkAdapter insane_onground = new EntThinkAdapter() {    	public String getID() { return "insane_onground"; }        public boolean think(edict_t self) {            self.monsterinfo.currentmove = insane_move_down;            return true;        }    };    static EntThinkAdapter insane_checkdown = new EntThinkAdapter() {    	public String getID() { return "insane_checkdown"; }        public boolean think(edict_t self) {            //			if ( (self.s.frame == FRAME_stand94) || (self.s.frame ==            // FRAME_stand65) )            if ((self.spawnflags & 32) != 0) // Always stand                return true;            if (Lib.random() < 0.3)                if (Lib.random() < 0.5)                    self.monsterinfo.currentmove = insane_move_uptodown;                else                    self.monsterinfo.currentmove = insane_move_jumpdown;            return true;        }    };    static EntThinkAdapter insane_checkup = new EntThinkAdapter() {    	public String getID() { return "insane_checkup"; }        public boolean think(edict_t self) {            //			If Hold_Ground and Crawl are set            if ((self.spawnflags & 4) != 0 && (self.spawnflags & 16) != 0)                return true;            if (Lib.random() < 0.5)                self.monsterinfo.currentmove = insane_move_downtoup;            return true;        }    };    static EntThinkAdapter insane_stand = new EntThinkAdapter() {    	public String getID() { return "insane_stand"; }        public boolean think(edict_t self) {            if ((self.spawnflags & 8) != 0) // If crucified            {                self.monsterinfo.currentmove = insane_move_cross;                self.monsterinfo.aiflags |= Defines.AI_STAND_GROUND;            }            // If Hold_Ground and Crawl are set            else if ((self.spawnflags & 4) != 0 && (self.spawnflags & 16) != 0)                self.monsterinfo.currentmove = insane_move_down;            else if (Lib.random() < 0.5)                self.monsterinfo.currentmove = insane_move_stand_normal;            else                self.monsterinfo.currentmove = insane_move_stand_insane;            return true;        }    };    static EntThinkAdapter insane_dead = new EntThinkAdapter() {    	public String getID() { return "insane_dead"; }        public boolean think(edict_t self) {            if ((self.spawnflags & 8) != 0) {                self.flags |= Defines.FL_FLY;            } else {                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 EntDieAdapter insane_die = new EntDieAdapter() {    	public String getID() { return "insane_die"; }        public void die(edict_t self, edict_t inflictor, edict_t attacker,                int damage, float[] point) {            int n;            if (self.health <= self.gib_health) {                GameBase.gi                        .sound(self, Defines.CHAN_VOICE, GameBase.gi                                .soundindex("misc/udeath.wav"), 1,                                Defines.ATTN_IDLE, 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;            GameBase.gi.sound(self, Defines.CHAN_VOICE, GameBase.gi                    .soundindex("player/male/death" + ((Lib.rand() % 4) + 1)                            + ".wav"), 1, Defines.ATTN_IDLE, 0);            self.deadflag = Defines.DEAD_DEAD;            self.takedamage = Defines.DAMAGE_YES;            if ((self.spawnflags & 8) != 0) {                insane_dead.think(self);            } else {                if (((self.s.frame >= FRAME_crawl1) && (self.s.frame <= FRAME_crawl9))                        || ((self.s.frame >= FRAME_stand99) && (self.s.frame <= FRAME_stand160)))                    self.monsterinfo.currentmove = insane_move_crawl_death;                else                    self.monsterinfo.currentmove = insane_move_stand_death;            }        }    };    static mframe_t insane_frames_stand_normal[] = 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, insane_checkdown) };    static mmove_t insane_move_stand_normal = new mmove_t(FRAME_stand60,            FRAME_stand65, insane_frames_stand_normal, insane_stand);    static mframe_t insane_frames_stand_insane[] = new mframe_t[] {            new mframe_t(GameAI.ai_stand, 0, insane_shake),            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, insane_checkdown) };    static mmove_t insane_move_stand_insane = new mmove_t(FRAME_stand65,            FRAME_stand94, insane_frames_stand_insane, insane_stand);    static mframe_t insane_frames_uptodown[] = 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, insane_moan),            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, 2.7f, null),            new mframe_t(GameAI.ai_move, 4.1f, null),            new mframe_t(GameAI.ai_move, 6f, null),            new mframe_t(GameAI.ai_move, 7.6f, null),            new mframe_t(GameAI.ai_move, 3.6f, null),            new mframe_t(GameAI.ai_move, 0, null),            new mframe_t(GameAI.ai_move, 0, null),            new mframe_t(GameAI.ai_move, 0, insane_fist),            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, insane_fist),            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 insane_move_uptodown = new mmove_t(FRAME_stand1,            FRAME_stand40, insane_frames_uptodown, insane_onground);    static mframe_t insane_frames_downtoup[] = new mframe_t[] {            new mframe_t(GameAI.ai_move, -0.7f, null), // 41            new mframe_t(GameAI.ai_move, -1.2f, null), // 42            new mframe_t(GameAI.ai_move, -1.5f, null), // 43            new mframe_t(GameAI.ai_move, -4.5f, null), // 44            new mframe_t(GameAI.ai_move, -3.5f, null), // 45            new mframe_t(GameAI.ai_move, -0.2f, null), // 46            new mframe_t(GameAI.ai_move, 0, null), // 47            new mframe_t(GameAI.ai_move, -1.3f, null), // 48            new mframe_t(GameAI.ai_move, -3, null), // 49            new mframe_t(GameAI.ai_move, -2, null), // 50            new mframe_t(GameAI.ai_move, 0, null), // 51            new mframe_t(GameAI.ai_move, 0, null), // 52            new mframe_t(GameAI.ai_move, 0, null), // 53            new mframe_t(GameAI.ai_move, -3.3f, null), // 54            new mframe_t(GameAI.ai_move, -1.6f, null), // 55            new mframe_t(GameAI.ai_move, -0.3f, null), // 56            new mframe_t(GameAI.ai_move, 0, null), // 57            new mframe_t(GameAI.ai_move, 0, null), // 58            new mframe_t(GameAI.ai_move, 0, null) // 59    };    static mmove_t insane_move_downtoup = new mmove_t(FRAME_stand41,            FRAME_stand59, insane_frames_downtoup, insane_stand);    static mframe_t insane_frames_jumpdown[] = new mframe_t[] {            new mframe_t(GameAI.ai_move, 0.2f, null),            new mframe_t(GameAI.ai_move, 11.5f, null),            new mframe_t(GameAI.ai_move, 5.1f, null),            new mframe_t(GameAI.ai_move, 7.1f, null),            new mframe_t(GameAI.ai_move, 0, null) };    static mmove_t insane_move_jumpdown = new mmove_t(FRAME_stand96,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -