Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11556/src/jake2/game Modified Files: game_import_t.java M_Brain.java M_Flash.java M_Boss32.java M_Gunner.java GameSave.java M_Mutant.java edict_t.java M_Boss2.java M_Float.java M_Flyer.java M_Hover.java M_Actor.java Cmd.java M_Chick.java GameWeapon.java M_Tank.java Fire.java M_Berserk.java PlayerView.java M_Medic.java Info.java GameTarget.java PlayerHud.java GameMisc.java GamePWeapon.java M_Player.java M_Insane.java PlayerTrail.java M_Soldier.java pmove_t.java GameFunc.java gitem_t.java M_Supertank.java M_Boss3.java GameBase.java GameSpawn.java PlayerClientAdapters.java GameTurret.java GameSVCmds.java GameUtil.java M_Parasite.java M_Gladiator.java GameTrigger.java PlayerClient.java game_locals_t.java Monster.java M_Flipper.java M_Infantry.java GameAI.java M_Boss31.java Removed Files: GameTurretAdapters.java GameTargetAdapters.java GameTriggerAdapters.java GameAIAdapters.java GameWeaponAdapters.java M_Rider.java GameUtilAdapters.java GameFuncAdapters.java Game.java M_SoldierAdapters.java GameMiscAdapters.java MonsterAdapters.java GameSpawnAdapters.java Log Message: major refactoring in game, server and client package Index: M_Insane.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/M_Insane.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** M_Insane.java 8 Jul 2004 15:58:44 -0000 1.2 --- M_Insane.java 22 Sep 2004 19:22:03 -0000 1.3 *************** *** 1,959 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of [...2216 lines suppressed...] ! ! if ((self.spawnflags & 16) != 0) // Stand Ground ! self.monsterinfo.aiflags |= Defines.AI_STAND_GROUND; ! ! self.monsterinfo.currentmove = insane_move_stand_normal; ! ! self.monsterinfo.scale = MODEL_SCALE; ! if ((self.spawnflags & 8) != 0) // Crucified ? ! { ! Math3D.VectorSet(self.mins, -16, 0, 0); ! Math3D.VectorSet(self.maxs, 16, 8, 32); ! self.flags |= Defines.FL_NO_KNOCKBACK; ! GameAI.flymonster_start.think(self); ! } else { ! GameAI.walkmonster_start.think(self); ! self.s.skinnum = Lib.rand() % 3; ! } ! } ! } \ No newline at end of file Index: M_Soldier.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/M_Soldier.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** M_Soldier.java 8 Jul 2004 15:58:44 -0000 1.2 --- M_Soldier.java 22 Sep 2004 19:22:04 -0000 1.3 *************** *** 1,1159 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of [...3355 lines suppressed...] ! self.monsterinfo.currentmove = soldier_move_duck; ! else ! self.monsterinfo.currentmove = soldier_move_attack3; ! return; ! } ! ! if (GameBase.skill.value >= 2) { ! if (r > 0.66) ! self.monsterinfo.currentmove = soldier_move_duck; ! else ! self.monsterinfo.currentmove = soldier_move_attack3; ! return; ! } ! ! self.monsterinfo.currentmove = soldier_move_attack3; ! } ! }; ! ! } \ No newline at end of file Index: Info.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Info.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Info.java 10 Sep 2004 19:02:54 -0000 1.3 --- Info.java 22 Sep 2004 19:22:03 -0000 1.4 *************** *** 1,263 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ ! // Created on 27.12.2003 by RST. ! // $Id$ ! package jake2.game; ! import java.util.StringTokenizer; ! import jake2.*; ! import jake2.client.*; ! import jake2.qcommon.*; ! import jake2.render.*; ! import jake2.server.*; ! public class Info extends PlayerView { ! public static String Info_ValueForKey(String s, String key) { ! ! StringTokenizer tk = new StringTokenizer(s, "\\"); ! while (tk.hasMoreTokens()) { ! String key1 = tk.nextToken(); ! ! if (!tk.hasMoreTokens()) { ! Com.Printf("MISSING VALUE\n"); ! return s; ! } ! String value1 = tk.nextToken(); ! if (key.equals(key1)) ! return value1; ! } ! ! return ""; ! } ! /**TODO RST: DANGEROUS port, returns the modified userinfo string, was pointer-pointer manipulation first*/ ! public static String Info_SetValueForKey1(String s, String key, String value) { ! if (value == null || value.length() == 0) ! return s; ! if (key.indexOf('\\') != -1 || value.indexOf('\\') != -1) { ! Com.Printf("Can't use keys or values with a \\\n"); ! return s; ! } ! if (key.indexOf(';') != -1) { ! Com.Printf("Can't use keys or values with a semicolon\n"); ! return s; ! } ! if (key.indexOf('"') != -1 || value.indexOf('"') != -1) { ! Com.Printf("Can't use keys or values with a \"\n"); ! return s; ! } ! if (key.length() > MAX_INFO_KEY - 1 || value.length() > MAX_INFO_KEY - 1) { ! Com.Printf("Keys and values must be < 64 characters.\n"); ! return s; ! } ! StringBuffer sb = new StringBuffer(Info_RemoveKey1(s, key)); ! ! if (sb.length() + 2 + key.length() + value.length() > Defines.MAX_INFO_STRING){ ! ! ! Com.Printf("Info string length exceeded\n"); ! return s; ! } ! ! sb.append('\\').append(key).append('\\').append(value); ! ! return sb.toString(); ! } ! ! ! /** TODO RST: DANGEROUS port, returns now the modified userinfo string.*/ ! public static String Info_RemoveKey1(String s, String key) { ! StringBuffer sb = new StringBuffer(512); ! if (key.indexOf('\\') != -1) { ! Com.Printf("Can't use a key with a \\\n"); ! return s; ! } ! StringTokenizer tk = new StringTokenizer(s, "\\"); ! while (tk.hasMoreTokens()) { ! String key1 = tk.nextToken(); ! ! if (!tk.hasMoreTokens()) { ! Com.Printf("MISSING VALUE\n"); ! return s; ! } ! String value1 = tk.nextToken(); ! if (!key.equals(key1)) ! sb.append('\\').append(key1).append('\\').append(value1); ! } ! return sb.toString(); ! //some old code follows ! /* ! char * start; ! char pkey[512]; ! char value[512]; ! char * o; ! ! if (key.indexOf('\\')!=-1) { ! Com.Printf ("Can't use a key with a \\\n"); ! return s; ! } ! ! while () { ! start = s; ! if (* s == '\\') ! s++; ! o = pkey; ! while (* s != '\\') { ! if (!* s) ! return; ! * o++ = * s++; ! } ! * o = 0; ! s++; ! ! o = value; ! while (* s != '\\' && * s) { ! if (!* s) ! return; ! * o++ = * s++; ! } ! * o = 0; ! ! if (!strcmp(key, pkey)) { ! strcpy(start, s); // remove this part ! return; ! } ! ! if (!* s) ! return; ! } ! */ ! } ! /* ! ================== ! Info_Validate ! ! Some characters are illegal in info strings because they ! can mess up the server's parsing ! ================== ! */ ! public static boolean Info_Validate(String s) { ! if (s.indexOf('"') != -1) ! //return false; ! if (s.indexOf(';') != -1) ! return false; ! return true; ! } ! private static String fillspaces = " "; ! public static void Print(String s) { ! StringBuffer sb = new StringBuffer(512); ! StringTokenizer tk = new StringTokenizer(s, "\\"); ! while (tk.hasMoreTokens()) { ! String key1 = tk.nextToken(); ! if (!tk.hasMoreTokens()) { ! Com.Printf("MISSING VALUE\n"); ! return; ! } ! String value1 = tk.nextToken(); ! sb.append(key1); ! int len = key1.length(); ! if (len < 20) { ! sb.append(fillspaces.substring(len)); ! } ! ! sb.append('=').append(value1).append('\n'); ! } ! Com.Printf(sb.toString()); ! /* some old code follows ! ! char * o; ! int l; ! ! if (* s == '\\') ! s++; ! while (* s) { ! o = key; ! while (* s && * s != '\\') ! * o++ = * s++; ! ! l = o - key; ! if (l < 20) { ! memset(o, ' ', 20 - l); ! key[20] = 0; ! } ! else ! * o = 0; ! Com_Printf("%s", key); ! ! if (!* s) { ! Com_Printf("MISSING VALUE\n"); ! return; ! } ! ! o = value; ! s++; ! while (* s && * s != '\\') ! * o++ = * s++; ! * o = 0; ! ! if (* s) ! s++; ! Com_Printf("%s\n", value); ! } ! */ ! } ! public static void testintern(StringBuffer in) { ! in.setLength(0); ! in.append("123!"); ! } ! } --- 1,211 ---- /* ! * Copyright (C) 1997-2001 Id Software, Inc. ! * ! * This program is free software; you can redistribute it and/or modify it under ! * the terms of the GNU General Public License as published by the Free Software ! * Foundation; either version 2 of the License, or (at your option) any later ! * version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ! * FOR A PARTICULAR PURPOSE. ! * ! * See the GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! */ ! // Created on 27.12.2003 by RST. ! // $Id$ ! package jake2.game; ! import jake2.Defines; ! import jake2.qcommon.Com; ! import java.util.StringTokenizer; ! public class Info { ! public static String Info_ValueForKey(String s, String key) { ! StringTokenizer tk = new StringTokenizer(s, "\\"); ! while (tk.hasMoreTokens()) { ! String key1 = tk.nextToken(); ! if (!tk.hasMoreTokens()) { ! Com.Printf("MISSING VALUE\n"); ! return s; ! } ! String value1 = tk.nextToken(); ! if (key.equals(key1)) ! return value1; ! } ! return ""; ! } + /** + * TODO RST: DANGEROUS port, returns the modified userinfo string, was + * pointer-pointer manipulation first + */ + public static String Info_SetValueForKey1(String s, String key, String value) { ! if (value == null || value.length() == 0) ! return s; ! if (key.indexOf('\\') != -1 || value.indexOf('\\') != -1) { ! Com.Printf("Can't use keys or values with a \\\n"); ! return s; ! } ! if (key.indexOf(';') != -1) { ! Com.Printf("Can't use keys or values with a semicolon\n"); ! return s; ! } ! if (key.indexOf('"') != -1 || value.indexOf('"') != -1) { ! Com.Printf("Can't use keys or values with a \"\n"); ! return s; ! } ! if (key.length() > Defines.MAX_INFO_KEY - 1 ! || value.length() > Defines.MAX_INFO_KEY - 1) { ! Com.Printf("Keys and values must be < 64 characters.\n"); ! return s; ! } ! StringBuffer sb = new StringBuffer(Info_RemoveKey1(s, key)); ! if (sb.length() + 2 + key.length() + value.length() > Defines.MAX_INFO_STRING) { ! Com.Printf("Info string length exceeded\n"); ! return s; ! } ! sb.append('\\').append(key).append('\\').append(value); ! return sb.toString(); ! } ! /** TODO RST: DANGEROUS port, returns now the modified userinfo string. */ ! public static String Info_RemoveKey1(String s, String key) { ! StringBuffer sb = new StringBuffer(512); ! if (key.indexOf('\\') != -1) { ! Com.Printf("Can't use a key with a \\\n"); ! return s; ! } ! StringTokenizer tk = new StringTokenizer(s, "\\"); ! while (tk.hasMoreTokens()) { ! String key1 = tk.nextToken(); ! if (!tk.hasMoreTokens()) { ! Com.Printf("MISSING VALUE\n"); ! return s; ! } ! String value1 = tk.nextToken(); ! if (!key.equals(key1)) ! sb.append('\\').append(key1).append('\\').append(value1); ! } ! return sb.toString(); ! //some old code follows ! /* ! * char * start; char pkey[512]; char value[512]; char * o; ! * ! * if (key.indexOf('\\')!=-1) { Com.Printf ("Can't use a key with a ! * \\\n"); return s; } ! * ! * while () { start = s; if (* s == '\\') s++; o = pkey; while (* s != ! * '\\') { if (!* s) return; o++ = * s++; } o = 0; s++; ! * ! * o = value; while (* s != '\\' && * s) { if (!* s) return; o++ = * ! * s++; } o = 0; ! * ! * if (!strcmp(key, pkey)) { strcpy(start, s); // remove this part ! * return; } ! * ! * if (!* s) return; } ! */ ! } ! /* ! * ================== Info_Validate ! * ! * Some characters are illegal in info strings because they can mess up the ! * server's parsing ================== ! */ ! public static boolean Info_Validate(String s) { ! if (s.indexOf('"') != -1) ! //return false; ! if (s.indexOf(';') != -1) ! return false; ! return true; ! } + private static String fillspaces = " "; ! public static void Print(String s) { ! StringBuffer sb = new StringBuffer(512); ! StringTokenizer tk = new StringTokenizer(s, "\\"); ! while (tk.hasMoreTokens()) { ! String key1 = tk.nextToken(); ! if (!tk.hasMoreTokens()) { ! Com.Printf("MISSING VALUE\n"); ! return; ! } ! String value1 = tk.nextToken(); ! sb.append(key1); ! int len = key1.length(); ! if (len < 20) { ! sb.append(fillspaces.substring(len)); ! } ! sb.append('=').append(value1).append('\n'); ! } ! Com.Printf(sb.toString()); ! /* ! * some old code follows ! * ! * char * o; int l; ! * ! * if (* s == '\\') s++; while (* s) { o = key; while (* s && * s != ! * '\\') o++ = * s++; ! * ! * l = o - key; if (l < 20) { memset(o, ' ', 20 - l); key[20] = 0; } ! * else o = 0; Com_Printf("%s", key); ! * ! * if (!* s) { Com_Printf("MISSING VALUE\n"); return; } ! * ! * o = value; s++; while (* s && * s != '\\') o++ = * s++; o = 0; ! * ! * if (* s) s++; Com_Printf("%s\n", value); } ! */ ! } ! public static void testintern(StringBuffer in) { ! in.setLength(0); ! in.append("123!"); ! } ! } \ No newline at end of file Index: M_Parasite.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/M_Parasite.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** M_Parasite.java 8 Jul 2004 15:58:43 -0000 1.2 --- M_Parasite.java 22 Sep 2004 19:22:06 -0000 1.3 *************** *** 1,675 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of [...1488 lines suppressed...] ! ! static boolean parasite_drain_attack_ok(float[] start, float[] end) { ! float[] dir = { 0, 0, 0 }, angles = { 0, 0, 0 }; ! ! // check for max distance ! Math3D.VectorSubtract(start, end, dir); ! if (Math3D.VectorLength(dir) > 256) ! return false; ! ! // check for min/max pitch ! Math3D.vectoangles(dir, angles); ! if (angles[0] < -180) ! angles[0] += 360; ! if (Math.abs(angles[0]) > 30) ! return false; ! ! return true; ! } ! } \ No newline at end of file Index: M_Float.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/M_Float.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** M_Float.java 8 Jul 2004 15:58:44 -0000 1.2 --- M_Float.java 22 Sep 2004 19:22:01 -0000 1.3 *************** *** 1,1007 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of [...2191 lines suppressed...] ! 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); ! } ! } \ No newline at end of file --- M_Rider.java DELETED --- --- GameWeaponAdapters.java DELETED --- --- GameUtilAdapters.java DELETED --- Index: GameTrigger.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameTrigger.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GameTrigger.java 8 Jul 2004 15:58:44 -0000 1.2 --- GameTrigger.java 22 Sep 2004 19:22:06 -0000 1.3 *************** *** 1,25 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! ! See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! ! */ // Created on 27.12.2003 by RST. // $Id$ - package jake2.game; --- 1,24 ---- /* ! * Copyright (C) 1997-2001 Id Software, Inc. ! * ! * This program is free software; you can redistribute it and/or modify it under ! * the terms of the GNU General Public License as published by the Free Software ! * Foundation; either version 2 of the License, or (at your option) any later ! * version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ! * FOR A PARTICULAR PURPOSE. ! * ! * See the GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! */ // Created on 27.12.2003 by RST. // $Id$ package jake2.game; *************** *** 32,239 **** import jake2.util.Math3D; ! public class GameTrigger extends M_Player { ! public static void InitTrigger(edict_t self) { ! if (Math3D.VectorCompare(self.s.angles, vec3_origin) != 0) ! G_SetMovedir(self.s.angles, self.movedir); ! self.solid = SOLID_TRIGGER; ! self.movetype = MOVETYPE_NONE; ! gi.setmodel(self, self.model); ! self.svflags = SVF_NOCLIENT; ! } ! // the trigger was just activated ! // ent.activator should be set to the activator so it can be held through a delay ! // so wait for the delay time before firing ! public static void multi_trigger(edict_t ent) { ! if (ent.nextthink != 0) ! return; // already been triggered ! G_UseTargets(ent, ent.activator); ! if (ent.wait > 0) { ! ent.think = GameTriggerAdapters.multi_wait; ! ent.nextthink = level.time + ent.wait; ! } ! else { // we can't just remove (self) here, because this is a touch function ! // called while looping through area links... ! ent.touch = null; ! ent.nextthink = level.time + FRAMETIME; ! ent.think = GameUtilAdapters.G_FreeEdictA; ! } ! } ! public static void SP_trigger_multiple(edict_t ent) { ! if (ent.sounds == 1) ! ent.noise_index = gi.soundindex("misc/secret.wav"); ! else if (ent.sounds == 2) ! ent.noise_index = gi.soundindex("misc/talk.wav"); ! else if (ent.sounds == 3) ! ent.noise_index = gi.soundindex("misc/trigger1.wav"); ! if (ent.wait == 0) ! ent.wait = 0.2f; ! ! ent.touch = GameTriggerAdapters.Touch_Multi; ! ent.movetype = MOVETYPE_NONE; ! ent.svflags |= SVF_NOCLIENT; ! if ((ent.spawnflags & 4) != 0) { ! ent.solid = SOLID_NOT; ! ent.use = GameTriggerAdapters.trigger_enable; ! } ! else { ! ent.solid = SOLID_TRIGGER; ! ent.use = GameTriggerAdapters.Use_Multi; ! } ! if (0 == Math3D.VectorCompare(ent.s.angles, vec3_origin)) ! G_SetMovedir(ent.s.angles, ent.movedir); ! gi.setmodel(ent, ent.model); ! gi.linkentity(ent); ! } ! /*QUAKED trigger_once (.5 .5 .5) ? x x TRIGGERED ! Triggers once, then removes itself. ! You must set the key "target" to the name of another object in the level that has a matching "targetname". ! ! If TRIGGERED, this trigger must be triggered before it is live. ! ! sounds ! 1) secret ! 2) beep beep ! 3) large switch ! 4) ! ! "message" string to be displayed when triggered ! */ ! public static void SP_trigger_once(edict_t ent) { ! // make old maps work because I messed up on flag assignments here ! // triggered was on bit 1 when it should have been on bit 4 ! if ((ent.spawnflags & 1) != 0) { ! float[] v = { 0, 0, 0 }; ! VectorMA(ent.mins, 0.5f, ent.size, v); ! ent.spawnflags &= ~1; ! ent.spawnflags |= 4; ! gi.dprintf("fixed TRIGGERED flag on " + ent.classname + " at " + vtos(v) + "\n"); ! } ! ent.wait = -1; ! SP_trigger_multiple(ent); ! } ! public static void SP_trigger_relay(edict_t self) { ! self.use = GameTriggerAdapters.trigger_relay_use; ! } ! public static void SP_trigger_key(edict_t self) { ! if (st.item == null) { ! gi.dprintf("no key item for trigger_key at " + vtos(self.s.origin) + "\n"); ! return; ! } ! self.item = FindItemByClassname(st.item); ! if (null == self.item) { ! gi.dprintf("item " + st.item + " not found for trigger_key at " + vtos(self.s.origin) + "\n"); ! return; ! } ! if (self.target == null) { ! gi.dprintf(self.classname + " at " + vtos(self.s.origin) + " has no target\n"); ! return; ! } ! gi.soundindex("misc/keytry.wav"); ! gi.soundindex("misc/keyuse.wav"); ! self.use = GameTriggerAdapters.trigger_key_use; ! } ! public static void SP_trigger_counter(edict_t self) { ! self.wait = -1; ! if (0 == self.count) ! self.count = 2; ! self.use = GameTriggerAdapters.trigger_counter_use; ! } ! /* ! ============================================================================== ! ! trigger_always ! ! ============================================================================== ! */ ! /*QUAKED trigger_always (.5 .5 .5) (-8 -8 -8) (8 8 8) ! This trigger will always fire. It is activated by the world. ! */ ! public static void SP_trigger_always(edict_t ent) { ! // we must have some delay to make sure our use targets are present ! if (ent.delay < 0.2f) ! ent.delay = 0.2f; ! G_UseTargets(ent, ent); ! } ! /*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE ! Pushes the player ! "speed" defaults to 1000 ! */ ! public static void SP_trigger_push(edict_t self) { ! InitTrigger(self); ! GameTriggerAdapters.windsound = gi.soundindex("misc/windfly.wav"); ! self.touch = GameTriggerAdapters.trigger_push_touch; ! if (0 == self.speed) ! self.speed = 1000; ! gi.linkentity(self); ! } ! public static void SP_trigger_hurt(edict_t self) { ! InitTrigger(self); ! self.noise_index = gi.soundindex("world/electro.wav"); ! self.touch = GameTriggerAdapters.hurt_touch; ! if (0 == self.dmg) ! self.dmg = 5; ! if ((self.spawnflags & 1) != 0) ! self.solid = SOLID_NOT; ! else ! self.solid = SOLID_TRIGGER; ! if ((self.spawnflags & 2) != 0) ! self.use = GameTriggerAdapters.hurt_use; ! gi.linkentity(self); ! } ! public static void SP_trigger_gravity(edict_t self) { ! if (st.gravity == null) { ! gi.dprintf("trigger_gravity without gravity set at " + vtos(self.s.origin) + "\n"); ! G_FreeEdict(self); ! return; ! } ! InitTrigger(self); ! self.gravity = atoi(st.gravity); ! self.touch = GameTriggerAdapters.trigger_gravity_touch; ! } ! public static void SP_trigger_monsterjump(edict_t self) { ! if (0 == self.speed) ! self.speed = 200; ! if (0 == st.height) ! st.height = 200; ! if (self.s.angles[YAW] == 0) ! self.s.angles[YAW] = 360; ! InitTrigger(self); ! self.touch = GameTriggerAdapters.trigger_monsterjump_touch; ! self.movedir[2] = st.height; ! } ! } --- 31,595 ---- import jake2.util.Math3D; ! public class GameTrigger { ! public static void InitTrigger(edict_t self) { ! if (Math3D.VectorCompare(self.s.angles, Globals.vec3_origin) != 0) ! GameBase.G_SetMovedir(self.s.angles, self.movedir); ! self.solid = Defines.SOLID_TRIGGER; ! self.movetype = Defines.MOVETYPE_NONE; ! GameBase.gi.setmodel(self, self.model); ! self.svflags = Defines.SVF_NOCLIENT; ! } ! // the trigger was just activated ! // ent.activator should be set to the activator so it can be held through a ! // delay ! // so wait for the delay time before firing ! public static void multi_trigger(edict_t ent) { ! if (ent.nextthink != 0) ! return; // already been triggered ! GameUtil.G_UseTargets(ent, ent.activator); ! if (ent.wait > 0) { ! ent.think = GameTrigger.multi_wait; ! ent.nextthink = GameBase.level.time + ent.wait; ! } else { // we can't just remove (self) here, because this is a touch ! // function ! // called while looping through area links... ! ent.touch = null; ! ent.nextthink = GameBase.level.time + Defines.FRAMETIME; ! ent.think = GameUtil.G_FreeEdictA; ! } ! } ! public static void SP_trigger_multiple(edict_t ent) { ! if (ent.sounds == 1) ! ent.noise_index = GameBase.gi.soundindex("misc/secret.wav"); ! else if (ent.sounds == 2) ! ent.noise_index = GameBase.gi.soundindex("misc/talk.wav"); ! else if (ent.sounds == 3) ! ent.noise_index = GameBase.gi.soundindex("misc/trigger1.wav"); ! if (ent.wait == 0) ! ent.wait = 0.2f; ! ent.touch = GameTrigger.Touch_Multi; ! ent.movetype = Defines.MOVETYPE_NONE; ! ent.svflags |= Defines.SVF_NOCLIENT; ! if ((ent.spawnflags & 4) != 0) { ! ent.solid = Defines.SOLID_NOT; ! ent.use = GameTrigger.trigger_enable; ! } else { ! ent.solid = Defines.SOLID_TRIGGER; ! ent.use = GameTrigger.Use_Multi; ! } ! if (0 == Math3D.VectorCompare(ent.s.angles, Globals.vec3_origin)) ! GameBase.G_SetMovedir(ent.s.angles, ent.movedir); ! GameBase.gi.setmodel(ent, ent.model); ! GameBase.gi.linkentity(ent); ! } ! /* ! * QUAKED trigger_once (.5 .5 .5) ? x x TRIGGERED Triggers once, then ! * removes itself. You must set the key "target" to the name of another ! * object in the level that has a matching "targetname". ! * ! * If TRIGGERED, this trigger must be triggered before it is live. ! * ! * sounds 1) secret 2) beep beep 3) large switch 4) ! * ! * "message" string to be displayed when triggered ! */ ! public static void SP_trigger_once(edict_t ent) { ! // make old maps work because I messed up on flag assignments here ! // triggered was on bit 1 when it should have been on bit 4 ! if ((ent.spawnflags & 1) != 0) { ! float[] v = { 0, 0, 0 }; ! Math3D.VectorMA(ent.mins, 0.5f, ent.size, v); ! ent.spawnflags &= ~1; ! ent.spawnflags |= 4; ! GameBase.gi.dprintf("fixed TRIGGERED flag on " + ent.classname ! + " at " + Lib.vtos(v) + "\n"); ! } ! ent.wait = -1; ! SP_trigger_multiple(ent); ! } ! public static void SP_trigger_relay(edict_t self) { ! self.use = GameTrigger.trigger_relay_use; ! } ! public static void SP_trigger_key(edict_t self) { ! if (GameBase.st.item == null) { ! GameBase.gi.dprintf("no key item for trigger_key at " ! + Lib.vtos(self.s.origin) + "\n"); ! return; ! } ! self.item = GameUtil.FindItemByClassname(GameBase.st.item); ! if (null == self.item) { ! GameBase.gi.dprintf("item " + GameBase.st.item ! + " not found for trigger_key at " ! + Lib.vtos(self.s.origin) + "\n"); ! return; ! } ! if (self.target == null) { ! GameBase.gi.dprintf(self.classname + " at " ! + Lib.vtos(self.s.origin) + " has no target\n"); ! return; ! } ! GameBase.gi.soundindex("misc/keytry.wav"); ! GameBase.gi.soundindex("misc/keyuse.wav"); ! self.use = GameTrigger.trigger_key_use; ! } ! public static void SP_trigger_counter(edict_t self) { ! self.wait = -1; ! if (0 == self.count) ! self.count = 2; ! self.use = GameTrigger.trigger_counter_use; ! } ! /* ! * ============================================================================== ! * ! * trigger_always ! * ! * ============================================================================== ! */ ! /* ! * QUAKED trigger_always (.5 .5 .5) (-8 -8 -8) (8 8 8) This trigger will ! * always fire. It is activated by the world. ! */ ! public static void SP_trigger_always(edict_t ent) { ! // we must have some delay to make sure our use targets are present ! if (ent.delay < 0.2f) ! ent.delay = 0.2f; ! GameUtil.G_UseTargets(ent, ent); ! } ! /* ! * QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE Pushes the player "speed" ! * defaults to 1000 ! */ ! public static void SP_trigger_push(edict_t self) { ! InitTrigger(self); ! GameTrigger.windsound = GameBase.gi.soundindex("misc/windfly.wav"); ! self.touch = GameTrigger.trigger_push_touch; ! if (0 == self.speed) ! self.speed = 1000; ! GameBase.gi.linkentity(self); ! } ! public static void SP_trigger_hurt(edict_t self) { ! InitTrigger(self); ! self.noise_index = GameBase.gi.soundindex("world/electro.wav"); ! self.touch = GameTrigger.hurt_touch; ! if (0 == self.dmg) ! self.dmg = 5; ! if ((self.spawnflags & 1) != 0) ! self.solid = Defines.SOLID_NOT; ! else ! self.solid = Defines.SOLID_TRIGGER; ! if ((self.spawnflags & 2) != 0) ! self.use = GameTrigger.hurt_use; ! GameBase.gi.linkentity(self); ! } ! public static void SP_trigger_gravity(edict_t self) { ! if (GameBase.st.gravity == null) { ! GameBase.gi.dprintf("trigger_gravity without gravity set at " ! + Lib.vtos(self.s.origin) + "\n"); ! GameUtil.G_FreeEdict(self); ! return; ! } ! InitTrigger(self); ! self.gravity = Lib.atoi(GameBase.st.gravity); ! self.touch = GameTrigger.trigger_gravity_touch; ! } ! public static void SP_trigger_monsterjump(edict_t self) { ! if (0 == self.speed) ! self.speed = 200; ! if (0 == GameBase.st.height) ! GameBase.st.height = 200; ! if (self.s.angles[Defines.YAW] == 0) ! self.s.angles[Defines.YAW] = 360; ! InitTrigger(self); ! self.touch = GameTrigger.trigger_monsterjump_touch; ! self.movedir[2] = GameBase.st.height; ! } ! ! // the wait time has passed, so set back up for another activation ! public static EntThinkAdapter multi_wait = new EntThinkAdapter() { ! public boolean think(edict_t ent) { ! ! ent.nextthink = 0; ! return true; ! } ! }; ! ! static EntUseAdapter Use_Multi = new EntUseAdapter() { ! public void use(edict_t ent, edict_t other, edict_t activator) { ! ent.activator = activator; ! GameTrigger.multi_trigger(ent); ! } ! }; ! ! static EntTouchAdapter Touch_Multi = new EntTouchAdapter() { ! public void touch(edict_t self, edict_t other, cplane_t plane, ! csurface_t surf) { ! if (other.client != null) { ! if ((self.spawnflags & 2) != 0) ! return; ! } else if ((other.svflags & Defines.SVF_MONSTER) != 0) { ! if (0 == (self.spawnflags & 1)) ! return; ! } else ! return; ! ! if (0 == Math3D.VectorCompare(self.movedir, Globals.vec3_origin)) { ! float[] forward = { 0, 0, 0 }; ! ! Math3D.AngleVectors(other.s.angles, forward, null, null); ! if (Math3D.DotProduct(forward, self.movedir) < 0) ! return; ! } ! ! self.activator = other; ! GameTrigger.multi_trigger(self); ! } ! }; ! ! /* ! * QUAKED trigger_multiple (.5 .5 .5) ? MONSTER NOT_PLAYER TRIGGERED ! * Variable sized repeatable trigger. Must be targeted at one or more ! * entities. If "delay" is set, the trigger waits some time after activating ! * before firing. "wait" : Seconds between triggerings. (.2 default) sounds ! * 1) secret 2) beep beep 3) large switch 4) set "message" to text string ! */ ! static EntUseAdapter trigger_enable = new EntUseAdapter() { ! public void use(edict_t self, edict_t other, edict_t activator) { ! self.solid = Defines.SOLID_TRIGGER; ! self.use = Use_Multi; ! GameBase.gi.linkentity(self); ! } ! }; ! ! /* ! * QUAKED trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8) This fixed size ! * trigger cannot be touched, it can only be fired by other events. ! */ ! public static EntUseAdapter trigger_relay_use = new EntUseAdapter() { ! public void use(edict_t self, edict_t other, edict_t activator) { ! GameUtil.G_UseTargets(self, activator); ! } ! }; ! ! /* ! * ============================================================================== ! * ! * trigger_key ! * ! * ============================================================================== ! */ ! ! /* ! * QUAKED trigger_key (.5 .5 .5) (-8 -8 -8) (8 8 8) A relay trigger that ! * only fires it's targets if player has the proper key. Use "item" to ! * specify the required key, for example "key_data_cd" ! */ ! ! static EntUseAdapter trigger_key_use = new EntUseAdapter() { ! public void use(edict_t self, edict_t other, edict_t activator) { ! int index; ! ! if (self.item == null) ! return; ! if (activator.client == null) ! return; ! ! index = GameUtil.ITEM_INDEX(self.item); ! if (activator.client.pers.inventory[index] == 0) { ! if (GameBase.level.time < self.touch_debounce_time) ! return; ! self.touch_debounce_time = GameBase.level.time + 5.0f; ! GameBase.gi.centerprintf(activator, "You need the " ! + self.item.pickup_name); ! GameBase.gi ! .sound(activator, Defines.CHAN_AUTO, GameBase.gi ! .soundindex("misc/keytry.wav"), 1, ! Defines.ATTN_NORM, 0); ! return; ! } ! ! GameBase.gi.sound(activator, Defines.CHAN_AUTO, GameBase.gi ! .soundindex("misc/keyuse.wav"), 1, Defines.ATTN_NORM, 0); ! if (GameBase.coop.value != 0) { ! int player; ! edict_t ent; ! ! if (Lib.strcmp(self.item.classname, "key_power_cube") == 0) { ! int cube; ! ! for (cube = 0; cube < 8; cube++) ! if ((activator.client.pers.power_cubes & (1 << cube)) != 0) ! break; ! for (player = 1; player <= GameBase.game.maxclients; player++) { ! ent = GameBase.g_edicts[player]; ! if (!ent.inuse) ! continue; ! if (null == ent.client) ! continue; ! if ((ent.client.pers.power_cubes & (1 << cube)) != 0) { ! ent.client.pers.inventory[index]--; ! ent.client.pers.power_cubes &= ~(1 << cube); ! } ! } ! } else { ! for (player = 1; player <= GameBase.game.maxclients; player++) { ! ent = GameBase.g_edicts[player]; ! if (!ent.inuse) ! continue; ! if (ent.client == null) ! continue; ! ent.client.pers.inventory[index] = 0; ! } ! } ! } else { ! activator.client.pers.inventory[index]--; ! } ! ! GameUtil.G_UseTargets(self, activator); ! ! self.use = null; ! } ! }; ! ! /* ! * ============================================================================== ! * ! * trigger_counter ! * ! * ============================================================================== ! */ ! ! /* ! * QUAKED trigger_counter (.5 .5 .5) ? nomessage Acts as an intermediary for ! * an action that takes multiple inputs. ! * ! * If nomessage is not set, t will print "1 more.. " etc when triggered and ! * "sequence complete" when finished. ! * ! * After the counter has been triggered "count" times (default 2), it will ! * fire all of it's targets and remove itself. ! */ ! static EntUseAdapter trigger_counter_use = new EntUseAdapter() { ! ! public void use(edict_t self, edict_t other, edict_t activator) { ! if (self.count == 0) ! return; ! ! self.count--; ! ! if (self.count == 0) { ! if (0 == (self.spawnflags & 1)) { ! GameBase.gi.centerprintf(activator, self.count ! + " more to go..."); ! GameBase.gi.sound(activator, Defines.CHAN_AUTO, GameBase.gi ! .soundindex("misc/talk1.wav"), 1, ! Defines.ATTN_NORM, 0); ! } ! return; ! } ! ! if (0 == (self.spawnflags & 1)) { ! GameBase.gi.centerprintf(activator, "Sequence completed!"); ! GameBase.gi.sound(activator, Defines.CHAN_AUTO, GameBase.gi ! .soundindex("misc/talk1.wav"), 1, Defines.ATTN_NORM, 0); ! } ! self.activator = activator; ! GameTrigger.multi_trigger(self); ! } ! }; ! ! /* ! * ============================================================================== ! * ! * trigger_push ! * ! * ============================================================================== ! */ ! ! public static final int PUSH_ONCE = 1; ! ! public static int windsound; ! ! static EntTouchAdapter trigger_push_touch = new EntTouchAdapter() { ! public void touch(edict_t self, edict_t other, cplane_t plane, ! csurface_t surf) { ! if (Lib.strcmp(other.classname, "grenade") == 0) { ! Math3D.VectorScale(self.movedir, self.speed * 10, ! other.velocity); ! } else if (other.health > 0) { ! Math3D.VectorScale(self.movedir, self.speed * 10, ! other.velocity); ! ! if (other.client != null) { ! // don't take falling damage immediately from this ! Math3D.VectorCopy(other.velocity, other.client.oldvelocity); ! if (other.fly_sound_debounce_time < GameBase.level.time) { ! other.fly_sound_debounce_time = GameBase.level.time + 1.5f; ! GameBase.gi.sound(other, Defines.CHAN_AUTO, windsound, ! 1, Defines.ATTN_NORM, 0); ! } ! } ! } ! if ((self.spawnflags & PUSH_ONCE) != 0) ! GameUtil.G_FreeEdict(self); ! } ! }; ! ! /* ! * ============================================================================== ! * ! * trigger_hurt ! * ! * ============================================================================== ! */ ! ! /* ! * QUAKED trigger_hurt (.5 .5 .5) ? START_OFF TOGGLE SILENT NO_PROTECTION ! * SLOW Any entity that touches this will be hurt. ! * ! * It does dmg points of damage each server frame ! * ! * SILENT supresses playing the sound SLOW changes the damage rate to once ! * per second NO_PROTECTION *nothing* stops the damage ! * ! * "dmg" default 5 (whole numbers only) ! * ! */ ! static EntUseAdapter hurt_use = new EntUseAdapter() { ! ! public void use(edict_t self, edict_t other, edict_t activator) { ! if (self.solid == Defines.SOLID_NOT) ! self.solid = Defines.SOLID_TRIGGER; ! else ! self.solid = Defines.SOLID_NOT; ! GameBase.gi.linkentity(self); ! ! if (0 == (self.spawnflags & 2)) ! self.use = null; ! } ! }; ! ! static EntTouchAdapter hurt_touch = new EntTouchAdapter() { ! public void touch(edict_t self, edict_t other, cplane_t plane, ! csurface_t surf) { ! int dflags; ! ! if (other.takedamage == 0) ! return; ! ! if (self.timestamp > GameBase.level.time) ! return; ! ! if ((self.spawnflags & 16) != 0) ! self.timestamp = GameBase.level.time + 1; ! else ! self.timestamp = GameBase.level.time + Defines.FRAMETIME; ! ! if (0 == (self.spawnflags & 4)) { ! if ((GameBase.level.framenum % 10) == 0) ! GameBase.gi.sound(other, Defines.CHAN_AUTO, ! self.noise_index, 1, Defines.ATTN_NORM, 0); ! } ! ! if ((self.spawnflags & 8) != 0) ! dflags = Defines.DAMAGE_NO_PROTECTION; ! else ! dflags = 0; ! GameUtil.T_Damage(other, self, self, Globals.vec3_origin, ! other.s.origin, Globals.vec3_origin, self.dmg, self.dmg, ! dflags, Defines.MOD_TRIGGER_HURT); ! } ! }; ! ! /* ! * ============================================================================== ! * ! * trigger_gravity ! * ! * ============================================================================== ! */ ! ! /* ! * QUAKED trigger_gravity (.5 .5 .5) ? Changes the touching entites gravity ! * to the value of "gravity". 1.0 is standard gravity for the level. ! */ ! ! static EntTouchAdapter trigger_gravity_touch = new EntTouchAdapter() { ! ! public void touch(edict_t self, edict_t other, cplane_t plane, ! csurface_t surf) { ! other.gravity = self.gravity; ! } ! }; ! ! /* ! * ============================================================================== ! * ! * trigger_monsterjump ! * ! * ============================================================================== ! */ ! ! /* ! * QUAKED trigger_monsterjump (.5 .5 .5) ? Walking monsters that touch this ! * will jump in the direction of the trigger's angle "speed" default to 200, ! * the speed thrown forward "height" default to 200, the speed thrown ! * upwards ! */ ! ! static EntTouchAdapter trigger_monsterjump_touch = new EntTouchAdapter() { ! public void touch(edict_t self, edict_t other, cplane_t plane, ! csurface_t surf) { ! if ((other.flags & (Defines.FL_FLY | Defines.FL_SWIM)) != 0) ! return; ! if ((other.svflags & Defines.SVF_DEADMONSTER) != 0) ! return; ! if (0 == (other.svflags & Defines.SVF_MONSTER)) ! return; ! ! // set XY even if not on ground, so the jump will clear lips ! other.velocity[0] = self.movedir[0] * self.speed; ! other.velocity[1] = self.movedir[1] * self.speed; ! ! if (other.groundentity != null) ! return; ! ! other.groundentity = null; ! other.velocity[2] = self.movedir[2]; ! } ! }; ! } \ No newline at end of file Index: GameUtil.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameUtil.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GameUtil.java 12 Sep 2004 18:25:49 -0000 1.6 --- GameUtil.java 22 Sep 2004 19:22:05 -0000 1.7 *************** *** 1,27 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of [...3031 lines suppressed...] ! if ((null == activator.client) ! && 0 == (activator.monsterinfo.aiflags & Defines.AI_GOOD_GUY)) ! return; ! ! // delay reaction so if the monster is teleported, its sound is ! // still heard ! self.enemy = activator; ! GameUtil.FoundTarget(self); ! } ! }; ! ! static boolean enemy_vis; ! ! static boolean enemy_infront; ! ! static int enemy_range; ! ! static float enemy_yaw; ! } \ No newline at end of file Index: M_Chick.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/M_Chick.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** M_Chick.java 8 Jul 2004 15:58:44 -0000 1.2 --- M_Chick.java 22 Sep 2004 19:22:02 -0000 1.3 *************** *** 1,987 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of [...2261 lines suppressed...] ! self.pain = chick_pain; ! self.die = chick_die; ! ! self.monsterinfo.stand = chick_stand; ! self.monsterinfo.walk = chick_walk; ! self.monsterinfo.run = chick_run; ! self.monsterinfo.dodge = chick_dodge; ! self.monsterinfo.attack = chick_attack; ! self.monsterinfo.melee = chick_melee; ! self.monsterinfo.sight = chick_sight; ! ! GameBase.gi.linkentity(self); ! ! self.monsterinfo.currentmove = chick_move_stand; ! self.monsterinfo.scale = MODEL_SCALE; ! ! GameAI.walkmonster_start.think(self); ! } ! } \ No newline at end of file --- GameSpawnAdapters.java DELETED --- --- GameAIAdapters.java DELETED --- Index: PlayerView.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerView.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PlayerView.java 7 Jul 2004 19:59:24 -0000 1.1.1.1 --- PlayerView.java 22 Sep 2004 19:22:03 -0000 1.2 *************** *** 1,1054 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of [...2094 lines suppressed...] ! Math3D.VectorClear(ent.client.kick_angles); ! // if the scoreboard is up, update it ! if (ent.client.showscores && 0 == (GameBase.level.framenum & 31)) { ! PlayerHud.DeathmatchScoreboardMessage(ent, ent.enemy); ! GameBase.gi.unicast(ent, false); ! } ! } ! public static float xyspeed; ! public static float bobmove; ! public static int bobcycle; // odd cycles are right foot going forward ! public static float bobfracsin; // sin(bobfrac*M_PI)} ! ! private static int xxxi = 0; ! } \ No newline at end of file Index: M_Gladiator.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/M_Gladiator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** M_Gladiator.java 8 Jul 2004 15:58:44 -0000 1.2 --- M_Gladiator.java 22 Sep 2004 19:22:06 -0000 1.3 *************** *** 1,570 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of [...1180 lines suppressed...] ! self.die = gladiator_die; ! ! self.monsterinfo.stand = gladiator_stand; ! self.monsterinfo.walk = gladiator_walk; ! self.monsterinfo.run = gladiator_run; ! self.monsterinfo.dodge = null; ! self.monsterinfo.attack = gladiator_attack; ! self.monsterinfo.melee = gladiator_melee; ! self.monsterinfo.sight = gladiator_sight; ! self.monsterinfo.idle = gladiator_idle; ! self.monsterinfo.search = gladiator_search; ! ! GameBase.gi.linkentity(self); ! self.monsterinfo.currentmove = gladiator_move_stand; ! self.monsterinfo.scale = MODEL_SCALE; ! ! GameAI.walkmonster_start.think(self); ! } ! } \ No newline at end of file Index: M_Boss3.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/M_Boss3.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** M_Boss3.java 7 Jul 2004 19:59:09 -0000 1.1.1.1 --- M_Boss3.java 22 Sep 2004 19:22:05 -0000 1.2 *************** *** 1,76 **** /* ! Copyright (C) 1997-2001 Id Software, Inc. ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! ! See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! ! */ // Created on 13.11.2003 by RST. // $Id$ - package jake2.game; ! public class M_Boss3 extends M_Boss32 { ! static EntUseAdapter Use_Boss3 = new EntUseAdapter() { ! public void use(edict_t ent, edict_t other, edict_t activator) { ! gi.WriteByte(svc_temp_entity); ! gi.WriteByte(TE_BOSSTPORT); ! gi.WritePosition(ent.s.origin); ! gi.multicast(ent.s.origin, MULTICAST_PVS); ! G_FreeEdict(ent); ! } ! }; ! static EntThinkAdapter Think_Boss3Stand = new EntThinkAdapter() { ! public boolean think(edict_t ent) { ! if (ent.s.frame == FRAME_stand260) ! ent.s.frame = FRAME_stand201; ! else ! ent.s.frame++; ! ent.nextthink = level.time + FRAMETIME; ! return true; ! } ! }; ! /*QUAKED monster_boss3_stand (1 .5 0) (-32 -32 0) (32 32 90) ! ! Just stands and cycles in one place until targeted, then teleports away. ! */ ! static void SP_monster_boss3_stand(edict_t self) { ! if (deathmatch.value != 0) { ! G_FreeEdict(self); ! return; ! } ! self.movetype = MOVETYPE_STEP; ! self.solid = SOLID_BBOX; ! self.model = "models/monsters/boss3/rider/tris.md2"; ! self.s.modelindex = gi.modelindex(self.model); ! self.s.frame = FRAME_stand201; ! gi.soundindex("misc/bigtele.wav"); ! VectorSet(self.mins, -32, -32, 0); ! VectorSet(self.maxs, 32, 32, 90); ! self.use = Use_Boss3; ! self.think = Think_Boss3Stand; ! self.nextthink = level.time + FRAMETIME; ! gi.linkentity(self); ! } ! } --- 1,79 ---- /* ! * Copyright (C) 1997-2001 Id Software, Inc. ! * ! * This program is free software; you can redistribute it and/or modify it under ! * the terms of the GNU General Public License as published by the Free Software ! * Foundation; either version 2 of the License, or (at your option) any later ! * version. ! * ! * This program is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ! * FOR A PARTICULAR PURPOSE. ! * ! * See the GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License along with ! * this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! * Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! */ // Created on 13.11.2003 by RST. // $Id$ package jake2.game; ! import jake2.Defines; ! import jake2.util.Math3D; ! public class M_Boss3 { ! static EntUseAdapter Use_Boss3 = new EntUseAdapter() { ! public void use(edict_t ent, edict_t other, edict_t activator) { ! GameBase.gi.WriteByte(Defines.svc_temp_entity); ! GameBase.gi.WriteByte(Defines.TE_BOSSTPORT); ! GameBase.gi.WritePosition(ent.s.origin); ! GameBase.gi.multicast(ent.s.origin, Defines.MULTICAST_PVS); ! GameUtil.G_FreeEdict(ent); ! } ! }; ! static EntThinkAdapter Think_Boss3Stand = new EntThinkAdapter() { ! public boolean think(edict_t ent) { ! if (ent.s.frame == M_Boss32.FRAME_stand260) ! ent.s.frame = M_Boss32.FRAME_stand201; ! else ! ent.s.frame++; ! ent.nextthink = GameBase.level.time + Defines.FRAMETIME; ! return true; ! } ! }; ! /* ! * QUAKED monster_boss3_stand (1 .5 0) (-32 -32 0) (32 32 90) ! * ! * Just stands and cycles in one place until targeted, then teleports away. ! */ ! static void SP_monster_boss3_stand(edict_t self) { ! if (GameBase.deathmatch.value != 0) { ! GameUtil.G_FreeEdict(self); ! return; ! } ! self.movetype = Defines.MOVETYPE_STEP; ! self.solid = Defines.SOLID_BBOX; ! self.model = "models/monsters/boss3/rider/tris.md2"; ! self.s.modelindex = GameBase.gi.modelindex(self.model); ! self.s.frame = M_Boss32.FRAME_stand201; ! GameBase.gi.soundindex("misc/bigtele.wav"); ! Math3D.VectorSet(self.mins, -32, -32, 0); ! Math3D.VectorSet(self.maxs, 32, 32, 90); ! ! self.use = Use_Boss3; ! self.think = Think_Boss3Stand; ! self.nextthink = GameBase.level.time + Defines.FRAMETIME; ! GameBase.gi.linkentity(self); ! } ! } \ No newline at end of file Index: PlayerTrail.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerTrail.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PlayerTrail.java 7 Jul 2004... [truncated message content] |