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

📄 m_float.java

📁 Jake2是一个Java 3D游戏引擎.
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
            // WHAM (0, -45, 29.6) -- LOOP Starts            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),            new mframe_t(GameAI.ai_charge, 0, null),            //							-- LOOP Ends            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 floater_move_attack2 = new mmove_t(FRAME_attak201,            FRAME_attak225, floater_frames_attack2, floater_run);    static EntThinkAdapter floater_zap = new EntThinkAdapter() {    	public String getID() { return "floater_zap"; }        public boolean think(edict_t self) {            float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 };            float[] origin = { 0, 0, 0 };            float[] dir = { 0, 0, 0 };            float[] offset = { 0, 0, 0 };            Math3D.VectorSubtract(self.enemy.s.origin, self.s.origin, dir);            Math3D.AngleVectors(self.s.angles, forward, right, null);            //FIXME use a flash and replace these two lines with the commented            // one            Math3D.VectorSet(offset, 18.5f, -0.9f, 10f);            Math3D.G_ProjectSource(self.s.origin, offset, forward, right,                    origin);            //		G_ProjectSource (self.s.origin,            // monster_flash_offset[flash_number], forward, right, origin);            GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_attack2, 1,                    Defines.ATTN_NORM, 0);            //FIXME use the flash, Luke            GameBase.gi.WriteByte(Defines.svc_temp_entity);            GameBase.gi.WriteByte(Defines.TE_SPLASH);            GameBase.gi.WriteByte(32);            GameBase.gi.WritePosition(origin);            GameBase.gi.WriteDir(dir);            GameBase.gi.WriteByte(1); //sparks            GameBase.gi.multicast(origin, Defines.MULTICAST_PVS);            GameCombat.T_Damage(self.enemy, self, self, dir, self.enemy.s.origin,                    Globals.vec3_origin, 5 + Lib.rand() % 6, -10,                    Defines.DAMAGE_ENERGY, Defines.MOD_UNKNOWN);            return true;        }    };    static mframe_t floater_frames_attack3[] = 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, 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, floater_zap),            //								-- LOOP Starts            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),            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),            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),            new mframe_t(GameAI.ai_charge, 0, null),            new mframe_t(GameAI.ai_charge, 0, null),            //								-- LOOP Ends            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 floater_move_attack3 = new mmove_t(FRAME_attak301,            FRAME_attak334, floater_frames_attack3, floater_run);    static mframe_t floater_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) };    static EntThinkAdapter floater_dead = new EntThinkAdapter() {    	public String getID() { return "floater_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 floater_move_death = new mmove_t(FRAME_death01,            FRAME_death13, floater_frames_death, floater_dead);    static mframe_t floater_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) };    static mmove_t floater_move_pain1 = new mmove_t(FRAME_pain101,            FRAME_pain107, floater_frames_pain1, floater_run);    static mframe_t floater_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) };    static mmove_t floater_move_pain2 = new mmove_t(FRAME_pain201,            FRAME_pain208, floater_frames_pain2, floater_run);    static mframe_t floater_frames_pain3[] = 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) };    static mmove_t floater_move_pain3 = new mmove_t(FRAME_pain301,            FRAME_pain312, floater_frames_pain3, floater_run);    static mframe_t floater_frames_walk[] = new mframe_t[] {            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null),            new mframe_t(GameAI.ai_walk, 5, null) };    static mmove_t floater_move_walk = new mmove_t(FRAME_stand101,            FRAME_stand152, floater_frames_walk, null);    static mframe_t floater_frames_run[] = new mframe_t[] {            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null),            new mframe_t(GameAI.ai_run, 13, null) };    static mmove_t floater_move_run = new mmove_t(FRAME_stand101,            FRAME_stand152, floater_frames_run, null);    static EntThinkAdapter floater_walk = new EntThinkAdapter() {    	public String getID() { return "floater_walk"; }        public boolean think(edict_t self) {            self.monsterinfo.currentmove = floater_move_walk;            return true;        }    };    static EntThinkAdapter floater_attack = new EntThinkAdapter() {    	public String getID() { return "floater_attack"; }        public boolean think(edict_t self) {            self.monsterinfo.currentmove = floater_move_attack1;            return true;        }    };    static EntThinkAdapter floater_melee = new EntThinkAdapter() {    	public String getID() { return "floater_melee"; }        public boolean think(edict_t self) {            if (Lib.random() < 0.5)                self.monsterinfo.currentmove = floater_move_attack3;            else                self.monsterinfo.currentmove = floater_move_attack2;            return true;        }    };    static EntPainAdapter floater_pain = new EntPainAdapter() {    	public String getID() { return "floater_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() + 1) % 3;            if (n == 0) {                GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain1, 1,                        Defines.ATTN_NORM, 0);                self.monsterinfo.currentmove = floater_move_pain1;            } else {                GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain2, 1,                        Defines.ATTN_NORM, 0);                self.monsterinfo.currentmove = floater_move_pain2;            }            return;        }    };    static EntDieAdapter floater_die = new EntDieAdapter() {    	public String getID() { return "floater_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_death1, 1,                    Defines.ATTN_NORM, 0);            GameMisc.BecomeExplosion1(self);        }    };    /*     * QUAKED monster_floater (1 .5 0) (-16 -16 -24) (16 16 32) Ambush     * Trigger_Spawn Sight     */    public static void SP_monster_floater(edict_t self) {        if (GameBase.deathmatch.value != 0) {            GameUtil.G_FreeEdict(self);            return;        }        sound_attack2 = GameBase.gi.soundindex("floater/fltatck2.wav");        sound_attack3 = GameBase.gi.soundindex("floater/fltatck3.wav");        sound_death1 = GameBase.gi.soundindex("floater/fltdeth1.wav");        sound_idle = GameBase.gi.soundindex("floater/fltidle1.wav");        sound_pain1 = GameBase.gi.soundindex("floater/fltpain1.wav");        sound_pain2 = GameBase.gi.soundindex("floater/fltpain2.wav");        sound_sight = GameBase.gi.soundindex("floater/fltsght1.wav");        GameBase.gi.soundindex("floater/fltatck1.wav");        self.s.sound = GameBase.gi.soundindex("floater/fltsrch1.wav");        self.movetype = Defines.MOVETYPE_STEP;        self.solid = Defines.SOLID_BBOX;        self.s.modelindex = GameBase.gi                .modelindex("models/monsters/float/tris.md2");        Math3D.VectorSet(self.mins, -24, -24, -24);        Math3D.VectorSet(self.maxs, 24, 24, 32);        self.health = 200;        self.gib_health = -80;        self.mass = 300;        self.pain = floater_pain;        self.die = floater_die;        self.monsterinfo.stand = floater_stand;        self.monsterinfo.walk = floater_walk;        self.monsterinfo.run = floater_run;        //		self.monsterinfo.dodge = floater_dodge;        self.monsterinfo.attack = floater_attack;        self.monsterinfo.melee = floater_melee;        self.monsterinfo.sight = floater_sight;        self.monsterinfo.idle = floater_idle;        GameBase.gi.linkentity(self);        if (Lib.random() <= 0.5)            self.monsterinfo.currentmove = floater_move_stand1;        else            self.monsterinfo.currentmove = floater_move_stand2;        self.monsterinfo.scale = MODEL_SCALE;        GameAI.flymonster_start.think(self);    }}

⌨️ 快捷键说明

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