📄 gamemisc.java
字号:
* QUAKED misc_easterchick (1 .5 0) (-32 -32 0) (32 32 32) */ static EntThinkAdapter misc_easterchick_think = new EntThinkAdapter() { public String getID() { return "misc_easterchick_think";} public boolean think(edict_t self) { if (++self.s.frame < 247) self.nextthink = GameBase.level.time + Defines.FRAMETIME; else { self.s.frame = 208; self.nextthink = GameBase.level.time + Defines.FRAMETIME; } return true; } }; /* * QUAKED misc_easterchick2 (1 .5 0) (-32 -32 0) (32 32 32) */ static EntThinkAdapter misc_easterchick2_think = new EntThinkAdapter() { public String getID() { return "misc_easterchick2_think";} public boolean think(edict_t self) { if (++self.s.frame < 287) self.nextthink = GameBase.level.time + Defines.FRAMETIME; else { self.s.frame = 248; self.nextthink = GameBase.level.time + Defines.FRAMETIME; } return true; } }; /* * QUAKED monster_commander_body (1 .5 0) (-32 -32 0) (32 32 48) Not really * a monster, this is the Tank Commander's decapitated body. There should be * a item_commander_head that has this as it's target. */ public static EntThinkAdapter commander_body_think = new EntThinkAdapter() { public String getID() { return "commander_body_think";} public boolean think(edict_t self) { if (++self.s.frame < 24) self.nextthink = GameBase.level.time + Defines.FRAMETIME; else self.nextthink = 0; if (self.s.frame == 22) GameBase.gi.sound(self, Defines.CHAN_BODY, GameBase.gi .soundindex("tank/thud.wav"), 1, Defines.ATTN_NORM, 0); return true; } }; public static EntUseAdapter commander_body_use = new EntUseAdapter() { public String getID() { return "commander_body_use";} public void use(edict_t self, edict_t other, edict_t activator) { self.think = commander_body_think; self.nextthink = GameBase.level.time + Defines.FRAMETIME; GameBase.gi.sound(self, Defines.CHAN_BODY, GameBase.gi .soundindex("tank/pain.wav"), 1, Defines.ATTN_NORM, 0); } }; public static EntThinkAdapter commander_body_drop = new EntThinkAdapter() { public String getID() { return "commander_body_group";} public boolean think(edict_t self) { self.movetype = Defines.MOVETYPE_TOSS; self.s.origin[2] += 2; return true; } }; /* * QUAKED misc_banner (1 .5 0) (-4 -4 -4) (4 4 4) The origin is the bottom * of the banner. The banner is 128 tall. */ static EntThinkAdapter misc_banner_think = new EntThinkAdapter() { public String getID() { return "misc_banner_think";} public boolean think(edict_t ent) { ent.s.frame = (ent.s.frame + 1) % 16; ent.nextthink = GameBase.level.time + Defines.FRAMETIME; return true; } }; /* * QUAKED misc_deadsoldier (1 .5 0) (-16 -16 0) (16 16 16) ON_BACK * ON_STOMACH BACK_DECAP FETAL_POS SIT_DECAP IMPALED This is the dead player * model. Comes in 6 exciting different poses! */ static EntDieAdapter misc_deadsoldier_die = new EntDieAdapter() { public String getID() { return "misc_deadsoldier_die";} public void die(edict_t self, edict_t inflictor, edict_t attacker, int damage, float[] point) { int n; if (self.health > -80) return; GameBase.gi.sound(self, Defines.CHAN_BODY, GameBase.gi .soundindex("misc/udeath.wav"), 1, Defines.ATTN_NORM, 0); for (n = 0; n < 4; n++) ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, Defines.GIB_ORGANIC); ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, Defines.GIB_ORGANIC); } }; /* * QUAKED misc_viper (1 .5 0) (-16 -16 0) (16 16 32) This is the Viper for * the flyby bombing. It is trigger_spawned, so you must have something use * it for it to show up. There must be a path for it to follow once it is * activated. * * "speed" How fast the Viper should fly */ static EntUseAdapter misc_viper_use = new EntUseAdapter() { public String getID() { return "misc_viper_use";} public void use(edict_t self, edict_t other, edict_t activator) { self.svflags &= ~Defines.SVF_NOCLIENT; self.use = GameFunc.train_use; GameFunc.train_use.use(self, other, activator); } }; /* * QUAKED misc_viper_bomb (1 0 0) (-8 -8 -8) (8 8 8) "dmg" how much boom * should the bomb make? */ static EntTouchAdapter misc_viper_bomb_touch = new EntTouchAdapter() { public String getID() { return "misc_viper_bomb_touch";} public void touch(edict_t self, edict_t other, cplane_t plane, csurface_t surf) { GameUtil.G_UseTargets(self, self.activator); self.s.origin[2] = self.absmin[2] + 1; GameCombat.T_RadiusDamage(self, self, self.dmg, null, self.dmg + 40, Defines.MOD_BOMB); BecomeExplosion2(self); } }; static EntThinkAdapter misc_viper_bomb_prethink = new EntThinkAdapter() { public String getID() { return "misc_viper_bomb_prethink";} public boolean think(edict_t self) { float[] v = { 0, 0, 0 }; float diff; self.groundentity = null; diff = self.timestamp - GameBase.level.time; if (diff < -1.0) diff = -1.0f; Math3D.VectorScale(self.moveinfo.dir, 1.0f + diff, v); v[2] = diff; diff = self.s.angles[2]; Math3D.vectoangles(v, self.s.angles); self.s.angles[2] = diff + 10; return true; } }; static EntUseAdapter misc_viper_bomb_use = new EntUseAdapter() { public String getID() { return "misc_viper_bomb_use";} public void use(edict_t self, edict_t other, edict_t activator) { edict_t viper = null; self.solid = Defines.SOLID_BBOX; self.svflags &= ~Defines.SVF_NOCLIENT; self.s.effects |= Defines.EF_ROCKET; self.use = null; self.movetype = Defines.MOVETYPE_TOSS; self.prethink = misc_viper_bomb_prethink; self.touch = misc_viper_bomb_touch; self.activator = activator; EdictIterator es = null; es = GameBase.G_Find(es, GameBase.findByClass, "misc_viper"); if (es != null) viper = es.o; Math3D.VectorScale(viper.moveinfo.dir, viper.moveinfo.speed, self.velocity); self.timestamp = GameBase.level.time; Math3D.VectorCopy(viper.moveinfo.dir, self.moveinfo.dir); } }; /* * QUAKED misc_strogg_ship (1 .5 0) (-16 -16 0) (16 16 32) This is a Storgg * ship for the flybys. It is trigger_spawned, so you must have something * use it for it to show up. There must be a path for it to follow once it * is activated. * * "speed" How fast it should fly */ static EntUseAdapter misc_strogg_ship_use = new EntUseAdapter() { public String getID() { return "misc_strogg_ship_use";} public void use(edict_t self, edict_t other, edict_t activator) { self.svflags &= ~Defines.SVF_NOCLIENT; self.use = GameFunc.train_use; GameFunc.train_use.use(self, other, activator); } }; /* * QUAKED misc_satellite_dish (1 .5 0) (-64 -64 0) (64 64 128) */ static EntThinkAdapter misc_satellite_dish_think = new EntThinkAdapter() { public String getID() { return "misc_satellite_dish_think";} public boolean think(edict_t self) { self.s.frame++; if (self.s.frame < 38) self.nextthink = GameBase.level.time + Defines.FRAMETIME; return true; } }; static EntUseAdapter misc_satellite_dish_use = new EntUseAdapter() { public String getID() { return "misc_satellite_dish_use";} public void use(edict_t self, edict_t other, edict_t activator) { self.s.frame = 0; self.think = misc_satellite_dish_think; self.nextthink = GameBase.level.time + Defines.FRAMETIME; } }; /* * QUAKED target_string (0 0 1) (-8 -8 -8) (8 8 8) */ static EntUseAdapter target_string_use = new EntUseAdapter() { public String getID() { return "target_string_use";} public void use(edict_t self, edict_t other, edict_t activator) { edict_t e; int n, l; char c; l = self.message.length(); for (e = self.teammaster; e != null; e = e.teamchain) { if (e.count == 0) continue; n = e.count - 1; if (n >= l) { e.s.frame = 12; continue; } c = self.message.charAt(n); if (c >= '0' && c <= '9') e.s.frame = c - '0'; else if (c == '-') e.s.frame = 10; else if (c == ':') e.s.frame = 11; else e.s.frame = 12; } } }; /* * QUAKED func_clock (0 0 1) (-8 -8 -8) (8 8 8) TIMER_UP TIMER_DOWN * START_OFF MULTI_USE target a target_string with this * * The default is to be a time of day clock * * TIMER_UP and TIMER_DOWN run for "count" seconds and the fire "pathtarget" * If START_OFF, this entity must be used before it starts * * "style" 0 "xx" 1 "xx:xx" 2 "xx:xx:xx" */ public static final int CLOCK_MESSAGE_SIZE = 16; public static EntThinkAdapter func_clock_think = new EntThinkAdapter() { public String getID() { return "func_clock_think";} public boolean think(edict_t self) { if (null == self.enemy) { EdictIterator es = null; es = GameBase.G_Find(es, GameBase.findByTarget, self.target); if (es != null) self.enemy = es.o; if (self.enemy == null) return true; } if ((self.spawnflags & 1) != 0) { func_clock_format_countdown(self); self.health++; } else if ((self.spawnflags & 2) != 0) { func_clock_format_countdown(self); self.health--; } else { Calendar c = Calendar.getInstance(); self.message = "" + c.get(Calendar.HOUR_OF_DAY) + ":" + c.get(Calendar.MINUTE) + ":" + c.get(Calendar.SECOND); /* * struct tm * ltime; time_t gmtime; * * time(& gmtime); ltime = localtime(& gmtime); * Com_sprintf(self.message, CLOCK_MESSAGE_SIZE, "%2i:%2i:%2i", * ltime.tm_hour, ltime.tm_min, ltime.tm_sec); if * (self.message[3] == ' ') self.message[3] = '0'; if * (self.message[6] == ' ') self.message[6] = '0'; */ } self.enemy.message = self.message; self.enemy.use.use(self.enemy, self, self); if (((self.spawnflags & 1) != 0 && (self.health > self.wait)) || ((self.spawnflags & 2) != 0 && (self.health < self.wait))) { if (self.pathtarget != null) { String savetarget; String savemessage; savetarget = self.target; savemessage = self.message; self.target = self.pathtarget; self.message = null; GameUtil.G_UseTargets(self, self.activator); self.target = savetarget; self.message = savemessage; } if (0 == (self.spawnflags & 8)) return true; func_clock_reset(self); if ((self.spawnflags & 4) != 0) return true; } self.nextthink = GameBase.level.time + 1; return true; } }; public static EntUseAdapter func_clock_use = new EntUseAdapter() { public String getID() { return "func_clock_use";} public void use(edict_t self, edict_t other, edict_t activator) { if (0 == (self.spawnflags & 8)) self.use = null; if (self.activator != nul
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -