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

📄 m_flyer.java

📁 JAKE2用JAVA写的queck2的3D游戏开发引擎
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
            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 flyer_move_pain1 = new mmove_t(FRAME_pain101, FRAME_pain109,            flyer_frames_pain1, flyer_run);    static mframe_t flyer_frames_defense[] = 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),            // Hold this frame            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 flyer_move_defense = new mmove_t(FRAME_defens01,            FRAME_defens06, flyer_frames_defense, null);    static mframe_t flyer_frames_bankright[] = 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) };    static mmove_t flyer_move_bankright = new mmove_t(FRAME_bankr01,            FRAME_bankr07, flyer_frames_bankright, null);    static mframe_t flyer_frames_bankleft[] = 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) };    static mmove_t flyer_move_bankleft = new mmove_t(FRAME_bankl01,            FRAME_bankl07, flyer_frames_bankleft, null);    static EntThinkAdapter flyer_fireleft = new EntThinkAdapter() {    	public String getID() { return "flyer_fireleft"; }        public boolean think(edict_t self) {            flyer_fire(self, Defines.MZ2_FLYER_BLASTER_1);            return true;        }    };    static EntThinkAdapter flyer_fireright = new EntThinkAdapter() {    	public String getID() { return "flyer_fireright"; }        public boolean think(edict_t self) {            flyer_fire(self, Defines.MZ2_FLYER_BLASTER_2);            return true;        }    };    static mframe_t flyer_frames_attack2[] = new mframe_t[] {            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, -10, flyer_fireleft),            // left gun            new mframe_t(GameAI.ai_charge, -10, flyer_fireright), // right gun            new mframe_t(GameAI.ai_charge, -10, flyer_fireleft), // left gun            new mframe_t(GameAI.ai_charge, -10, flyer_fireright), // right gun            new mframe_t(GameAI.ai_charge, -10, flyer_fireleft), // left gun            new mframe_t(GameAI.ai_charge, -10, flyer_fireright), // right gun            new mframe_t(GameAI.ai_charge, -10, flyer_fireleft), // left gun            new mframe_t(GameAI.ai_charge, -10, flyer_fireright), // right gun            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null) };    static mmove_t flyer_move_attack2 = new mmove_t(FRAME_attak201,            FRAME_attak217, flyer_frames_attack2, flyer_run);    static EntThinkAdapter flyer_slash_left = new EntThinkAdapter() {    	public String getID() { return "flyer_slash_left"; }        public boolean think(edict_t self) {            float[] aim = { 0, 0, 0 };            Math3D.VectorSet(aim, Defines.MELEE_DISTANCE, self.mins[0], 0);            GameWeapon.fire_hit(self, aim, 5, 0);            GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_slash, 1,                    Defines.ATTN_NORM, 0);            return true;        }    };    static EntThinkAdapter flyer_slash_right = new EntThinkAdapter() {    	public String getID() { return "flyer_slash_right"; }        public boolean think(edict_t self) {            float[] aim = { 0, 0, 0 };            Math3D.VectorSet(aim, Defines.MELEE_DISTANCE, self.maxs[0], 0);            GameWeapon.fire_hit(self, aim, 5, 0);            GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_slash, 1,                    Defines.ATTN_NORM, 0);            return true;        }    };    static EntThinkAdapter flyer_loop_melee = new EntThinkAdapter() {    	public String getID() { return "flyer_loop_melee"; }        public boolean think(edict_t self) {            /*             * if (random() <= 0.5) self.monsterinfo.currentmove =             * flyer_move_attack1; else             */            self.monsterinfo.currentmove = flyer_move_loop_melee;            return true;        }    };    static mframe_t flyer_frames_start_melee[] = new mframe_t[] {            new mframe_t(GameAI.ai_charge, 0, flyer_pop_blades),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null) };    static mmove_t flyer_move_start_melee = new mmove_t(FRAME_attak101,            FRAME_attak106, flyer_frames_start_melee, flyer_loop_melee);    static mframe_t flyer_frames_end_melee[] = new mframe_t[] {            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null) };    static mmove_t flyer_move_end_melee = new mmove_t(FRAME_attak119,            FRAME_attak121, flyer_frames_end_melee, flyer_run);    static mframe_t flyer_frames_loop_melee[] = new mframe_t[] {            new mframe_t(GameAI.ai_charge, 0, null), // Loop Start            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, flyer_slash_left),            // Left Wing Strike            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, flyer_slash_right),            // Right Wing Strike            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null) // Loop Ends    };    static EntThinkAdapter flyer_check_melee = new EntThinkAdapter() {    	public String getID() { return "flyer_check_melee"; }        public boolean think(edict_t self) {            if (GameUtil.range(self, self.enemy) == Defines.RANGE_MELEE)                if (Lib.random() <= 0.8)                    self.monsterinfo.currentmove = flyer_move_loop_melee;                else                    self.monsterinfo.currentmove = flyer_move_end_melee;            else                self.monsterinfo.currentmove = flyer_move_end_melee;            return true;        }    };    static mmove_t flyer_move_loop_melee = new mmove_t(FRAME_attak107,            FRAME_attak118, flyer_frames_loop_melee, flyer_check_melee);    static EntThinkAdapter flyer_attack = new EntThinkAdapter() {    	public String getID() { return "flyer_attack"; }        public boolean think(edict_t self) {            /*             * if (random() <= 0.5) self.monsterinfo.currentmove =             * flyer_move_attack1; else             */            self.monsterinfo.currentmove = flyer_move_attack2;            return true;        }    };    static EntThinkAdapter flyer_setstart = new EntThinkAdapter() {    	public String getID() { return "flyer_setstart"; }        public boolean think(edict_t self) {            nextmove = ACTION_run;            self.monsterinfo.currentmove = flyer_move_start;            return true;        }    };    static EntThinkAdapter flyer_melee = new EntThinkAdapter() {    	public String getID() { return "flyer_melee"; }        public boolean think(edict_t self) {            //			flyer.nextmove = ACTION_attack1;            //	 self.monsterinfo.currentmove = flyer_move_stop;            self.monsterinfo.currentmove = flyer_move_start_melee;            return true;        }    };    static EntPainAdapter flyer_pain = new EntPainAdapter() {    	public String getID() { return "flyer_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() % 3;            if (n == 0) {                GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain1, 1,                        Defines.ATTN_NORM, 0);                self.monsterinfo.currentmove = flyer_move_pain1;            } else if (n == 1) {                GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain2, 1,                        Defines.ATTN_NORM, 0);                self.monsterinfo.currentmove = flyer_move_pain2;            } else {                GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain1, 1,                        Defines.ATTN_NORM, 0);                self.monsterinfo.currentmove = flyer_move_pain3;            }        }    };    static EntDieAdapter flyer_die = new EntDieAdapter() {    	public String getID() { return "flyer_die"; }        public void die(edict_t self, edict_t inflictor, edict_t attacker,                int damage, float[] point) {            GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_die, 1,                    Defines.ATTN_NORM, 0);            GameMisc.BecomeExplosion1(self);        }    };    static void flyer_fire(edict_t self, int flash_number) {        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_attak204)                || (self.s.frame == FRAME_attak207)                || (self.s.frame == FRAME_attak210))            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[flash_number], 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, flash_number,                effect);    }    /*     * QUAKED monster_flyer (1 .5 0) (-16 -16 -24) (16 16 32) Ambush     * Trigger_Spawn Sight     */    public static void SP_monster_flyer(edict_t self) {        if (GameBase.deathmatch.value != 0) {            GameUtil.G_FreeEdict(self);            return;        }        // fix a map bug in jail5.bsp        if (GameBase.level.mapname.equalsIgnoreCase("jail5")                && (self.s.origin[2] == -104)) {            self.targetname = self.target;            self.target = null;        }        sound_sight = GameBase.gi.soundindex("flyer/flysght1.wav");        sound_idle = GameBase.gi.soundindex("flyer/flysrch1.wav");        sound_pain1 = GameBase.gi.soundindex("flyer/flypain1.wav");        sound_pain2 = GameBase.gi.soundindex("flyer/flypain2.wav");        sound_slash = GameBase.gi.soundindex("flyer/flyatck2.wav");        sound_sproing = GameBase.gi.soundindex("flyer/flyatck1.wav");        sound_die = GameBase.gi.soundindex("flyer/flydeth1.wav");        GameBase.gi.soundindex("flyer/flyatck3.wav");        self.s.modelindex = GameBase.gi                .modelindex("models/monsters/flyer/tris.md2");        Math3D.VectorSet(self.mins, -16, -16, -24);        Math3D.VectorSet(self.maxs, 16, 16, 32);        self.movetype = Defines.MOVETYPE_STEP;        self.solid = Defines.SOLID_BBOX;        self.s.sound = GameBase.gi.soundindex("flyer/flyidle1.wav");        self.health = 50;        self.mass = 50;        self.pain = flyer_pain;        self.die = flyer_die;        self.monsterinfo.stand = flyer_stand;        self.monsterinfo.walk = flyer_walk;        self.monsterinfo.run = flyer_run;        self.monsterinfo.attack = flyer_attack;        self.monsterinfo.melee = flyer_melee;        self.monsterinfo.sight = flyer_sight;        self.monsterinfo.idle = flyer_idle;        GameBase.gi.linkentity(self);        self.monsterinfo.currentmove = flyer_move_stand;        self.monsterinfo.scale = MODEL_SCALE;        GameAI.flymonster_start.think(self);    }}

⌨️ 快捷键说明

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