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

📄 m_hover.java

📁 JAKE2用JAVA写的queck2的3D游戏开发引擎
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
    public final static int FRAME_pain307 = 159;    public final static int FRAME_pain308 = 160;    public final static int FRAME_pain309 = 161;    public final static int FRAME_death101 = 162;    public final static int FRAME_death102 = 163;    public final static int FRAME_death103 = 164;    public final static int FRAME_death104 = 165;    public final static int FRAME_death105 = 166;    public final static int FRAME_death106 = 167;    public final static int FRAME_death107 = 168;    public final static int FRAME_death108 = 169;    public final static int FRAME_death109 = 170;    public final static int FRAME_death110 = 171;    public final static int FRAME_death111 = 172;    public final static int FRAME_backwd01 = 173;    public final static int FRAME_backwd02 = 174;    public final static int FRAME_backwd03 = 175;    public final static int FRAME_backwd04 = 176;    public final static int FRAME_backwd05 = 177;    public final static int FRAME_backwd06 = 178;    public final static int FRAME_backwd07 = 179;    public final static int FRAME_backwd08 = 180;    public final static int FRAME_backwd09 = 181;    public final static int FRAME_backwd10 = 182;    public final static int FRAME_backwd11 = 183;    public final static int FRAME_backwd12 = 184;    public final static int FRAME_backwd13 = 185;    public final static int FRAME_backwd14 = 186;    public final static int FRAME_backwd15 = 187;    public final static int FRAME_backwd16 = 188;    public final static int FRAME_backwd17 = 189;    public final static int FRAME_backwd18 = 190;    public final static int FRAME_backwd19 = 191;    public final static int FRAME_backwd20 = 192;    public final static int FRAME_backwd21 = 193;    public final static int FRAME_backwd22 = 194;    public final static int FRAME_backwd23 = 195;    public final static int FRAME_backwd24 = 196;    public final static int FRAME_attak101 = 197;    public final static int FRAME_attak102 = 198;    public final static int FRAME_attak103 = 199;    public final static int FRAME_attak104 = 200;    public final static int FRAME_attak105 = 201;    public final static int FRAME_attak106 = 202;    public final static int FRAME_attak107 = 203;    public final static int FRAME_attak108 = 204;    public final static float MODEL_SCALE = 1.000000f;    static int sound_pain1;    static int sound_pain2;    static int sound_death1;    static int sound_death2;    static int sound_sight;    static int sound_search1;    static int sound_search2;    static EntThinkAdapter hover_reattack = new EntThinkAdapter() {    	public String getID() { return "hover_reattack"; }        public boolean think(edict_t self) {            if (self.enemy.health > 0)                if (GameUtil.visible(self, self.enemy))                    if (Lib.random() <= 0.6) {                        self.monsterinfo.currentmove = hover_move_attack1;                        return true;                    }            self.monsterinfo.currentmove = hover_move_end_attack;            return true;        }    };    static EntThinkAdapter hover_fire_blaster = new EntThinkAdapter() {    	public String getID() { return "hover_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_attak104)                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_HOVER_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, 1, 1000,                    Defines.MZ2_HOVER_BLASTER_1, effect);            return true;        }    };    static EntThinkAdapter hover_stand = new EntThinkAdapter() {    	public String getID() { return "hover_stand"; }        public boolean think(edict_t self) {            self.monsterinfo.currentmove = hover_move_stand;            return true;        }    };    static EntThinkAdapter hover_run = new EntThinkAdapter() {    	public String getID() { return "hover_run"; }        public boolean think(edict_t self) {            if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0)                self.monsterinfo.currentmove = hover_move_stand;            else                self.monsterinfo.currentmove = hover_move_run;            return true;        }    };    static EntThinkAdapter hover_walk = new EntThinkAdapter() {    	public String getID() { return "hover_walk"; }        public boolean think(edict_t self) {            self.monsterinfo.currentmove = hover_move_walk;            return true;        }    };    static EntThinkAdapter hover_start_attack = new EntThinkAdapter() {    	public String getID() { return "hover_start_attack"; }        public boolean think(edict_t self) {            self.monsterinfo.currentmove = hover_move_start_attack;            return true;        }    };    static EntThinkAdapter hover_attack = new EntThinkAdapter() {    	public String getID() { return "hover_attack"; }        public boolean think(edict_t self) {            self.monsterinfo.currentmove = hover_move_attack1;            return true;        }    };    static EntPainAdapter hover_pain = new EntPainAdapter() {    	public String getID() { return "hover_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 (damage <= 25) {                if (Lib.random() < 0.5) {                    GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain1, 1,                            Defines.ATTN_NORM, 0);                    self.monsterinfo.currentmove = hover_move_pain3;                } else {                    GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain2, 1,                            Defines.ATTN_NORM, 0);                    self.monsterinfo.currentmove = hover_move_pain2;                }            } else {                GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain1, 1,                        Defines.ATTN_NORM, 0);                self.monsterinfo.currentmove = hover_move_pain1;            }        }    };    static EntThinkAdapter hover_deadthink = new EntThinkAdapter() {    	public String getID() { return "hover_deadthink"; }        public boolean think(edict_t self) {            if (null == self.groundentity                    && GameBase.level.time < self.timestamp) {                self.nextthink = GameBase.level.time + Defines.FRAMETIME;                return true;            }            GameMisc.BecomeExplosion1(self);            return true;        }    };    static EntThinkAdapter hover_dead = new EntThinkAdapter() {    	public String getID() { return "hover_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.think = hover_deadthink;            self.nextthink = GameBase.level.time + Defines.FRAMETIME;            self.timestamp = GameBase.level.time + 15;            GameBase.gi.linkentity(self);            return true;        }    };    static EntDieAdapter hover_die = new EntDieAdapter() {    	public String getID() { return "hover_die"; }        public void die(edict_t self, edict_t inflictor, edict_t attacker,                int damage, float[] point) {            int n;            //	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 < 2; n++)                    GameMisc.ThrowGib(self,                            "models/objects/gibs/sm_meat/tris.md2", damage,                            Defines.GIB_ORGANIC);                GameMisc.ThrowHead(self, "models/objects/gibs/sm_meat/tris.md2",                        damage, Defines.GIB_ORGANIC);                self.deadflag = Defines.DEAD_DEAD;                return;            }            if (self.deadflag == Defines.DEAD_DEAD)                return;            //	regular death            if (Lib.random() < 0.5)                GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_death1, 1,                        Defines.ATTN_NORM, 0);            else                GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_death2, 1,                        Defines.ATTN_NORM, 0);            self.deadflag = Defines.DEAD_DEAD;            self.takedamage = Defines.DAMAGE_YES;            self.monsterinfo.currentmove = hover_move_death1;        }    };    static EntInteractAdapter hover_sight = new EntInteractAdapter() {    	public String getID() { return "hover_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 hover_search = new EntThinkAdapter() {    	public String getID() { return "hover_search"; }        public boolean think(edict_t self) {            if (Lib.random() < 0.5)                GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_search1, 1,                        Defines.ATTN_NORM, 0);            else                GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_search2, 1,                        Defines.ATTN_NORM, 0);            return true;        }    };    static mframe_t hover_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 hover_move_stand = new mmove_t(FRAME_stand01, FRAME_stand30,            hover_frames_stand, null);    static mframe_t hover_frames_stop1[] = 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) };

⌨️ 快捷键说明

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