aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbryan newbold <bnewbold@robocracy.org>2010-02-02 12:17:33 -0500
committerbryan newbold <bnewbold@robocracy.org>2010-02-02 12:17:33 -0500
commit8703d4e9325c896c0b489c63f96d42d8d79a31e3 (patch)
treebab3db64461f60bcd8693cd9a15ebae9b416c3f2
parent3a9cccd9785c394466594c857016d55dfdde560f (diff)
downloadioquake3-aero-8703d4e9325c896c0b489c63f96d42d8d79a31e3.tar.gz
ioquake3-aero-8703d4e9325c896c0b489c63f96d42d8d79a31e3.zip
AERO patch applied; this represents our progress at the end of GGJ
-rw-r--r--code/game/bg_pmove.c11
-rw-r--r--code/game/bg_public.h2
-rw-r--r--code/game/g_client.c13
-rw-r--r--code/game/g_cmds.c59
-rw-r--r--code/game/g_items.c33
-rw-r--r--code/game/g_misc.c3
-rw-r--r--code/game/g_missile.c2
7 files changed, 106 insertions, 17 deletions
diff --git a/code/game/bg_pmove.c b/code/game/bg_pmove.c
index f31222a..028b849 100644
--- a/code/game/bg_pmove.c
+++ b/code/game/bg_pmove.c
@@ -146,6 +146,7 @@ void PM_ClipVelocity( vec3_t in, vec3_t normal, vec3_t out, float overbounce ) {
float backoff;
float change;
int i;
+
backoff = DotProduct (in, normal);
@@ -159,6 +160,12 @@ void PM_ClipVelocity( vec3_t in, vec3_t normal, vec3_t out, float overbounce ) {
change = normal[i]*backoff;
out[i] = in[i] - change;
}
+ // wall detect code -bnewbold
+ if(backoff < -.1 && backoff > -2000.0 && in[2] == 0) {
+ // Com_Printf("HITTING: %f, %f, %f, %f\n", backoff, in[1], out[1], out[2]);
+ // if(backoff < -25.0 && backoff > -50.0) Com_Printf("TELEPORT!\n");
+ trap_SendConsoleCommand( EXEC_APPEND, "randomteleport\n" );
+ }
}
@@ -1808,6 +1815,8 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) {
// circularly clamp the angles with deltas
for (i=0 ; i<3 ; i++) {
+ //temp = cmd->angles[i] + ps->delta_angles[i];
+ // thirded for slowness... NOT -bnewbold
temp = cmd->angles[i] + ps->delta_angles[i];
if ( i == PITCH ) {
// don't let the player look up or down more than 90 degrees
@@ -1819,7 +1828,7 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) {
temp = -16000;
}
}
- ps->viewangles[i] = SHORT2ANGLE(temp);
+ ps->viewangles[i] = SHORT2ANGLE(temp); // TODO: track this down to slow pans -bnewbold
}
}
diff --git a/code/game/bg_public.h b/code/game/bg_public.h
index ad5ab39..fdb9433 100644
--- a/code/game/bg_public.h
+++ b/code/game/bg_public.h
@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// because games can change separately from the main system version, we need a
// second version that must match between game and cgame
-#define GAME_VERSION BASEGAME "-1"
+#define GAME_VERSION BASEGAME "-aero" // -bnewbold
#define DEFAULT_GRAVITY 800
#define GIB_HEALTH -40
diff --git a/code/game/g_client.c b/code/game/g_client.c
index 7160e31..c0b500f 100644
--- a/code/game/g_client.c
+++ b/code/game/g_client.c
@@ -497,14 +497,16 @@ respawn
================
*/
void respawn( gentity_t *ent ) {
- gentity_t *tent;
+ //gentity_t *tent;
+
+ // -bnewbold
CopyToBodyQue (ent);
ClientSpawn(ent);
- // add a teleportation effect
- tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_IN );
- tent->s.clientNum = ent->s.clientNum;
+ // add a teleportation effect // disabled -bnewbold
+ //tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_IN );
+ //tent->s.clientNum = ent->s.clientNum;
}
/*
@@ -1241,6 +1243,9 @@ void ClientSpawn(gentity_t *ent) {
// clear entity state values
BG_PlayerStateToEntityState( &client->ps, &ent->s, qtrue );
+
+ // Get going! -bnewbold
+ trap_SendConsoleCommand( EXEC_APPEND, "+forward\n" );
}
diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c
index 06df2db..a6a92fe 100644
--- a/code/game/g_cmds.c
+++ b/code/game/g_cmds.c
@@ -1680,6 +1680,65 @@ void ClientCommand( int clientNum ) {
Cmd_SetViewpos_f( ent );
else if (Q_stricmp (cmd, "stats") == 0)
Cmd_Stats_f( ent );
+ else if (Q_stricmp (cmd, "randomteleport") == 0)
+ Cmd_RandomTeleport_f( ent );
+ else if (Q_stricmp (cmd, "addpoint") == 0)
+ Cmd_AddPoint_f( ent );
+ else if (Q_stricmp (cmd, "doiframe") == 0)
+ Cmd_DoIframe_f( ent );
+ else if (Q_stricmp (cmd, "dobsod") == 0)
+ Cmd_DoBsod_f( ent );
else
trap_SendServerCommand( clientNum, va("print \"unknown cmd %s\n\"", cmd ) );
}
+
+/*
+=================
+Cmd_RandomTeleport_f
+=================
+*/
+void Cmd_RandomTeleport_f( gentity_t *ent ) {
+ // -bnewbold
+ vec3_t origin, angles;
+
+ char *msg; // message to player
+
+ // in this case, message is printed in the actual TeleportPlayer function...
+ SelectSpawnPoint( ent->client->ps.origin, origin, angles, qfalse );
+ TeleportPlayer( ent, origin, angles );
+ msg = "Randomly Teleported...\n";
+ //ent->client->ps.powerups[PW_INVIS] = level.time;
+
+ trap_SendServerCommand( ent-g_entities, va("print \"%s\"", msg));
+}
+
+
+/*
+=================
+Cmd_DoIframe_f
+=================
+*/
+void Cmd_DoIframe_f( gentity_t *ent ) {
+ // -bnewbold
+ G_Printf("###VIDEOHOOK:doiframe\n");
+}
+
+/*
+=================
+Cmd_AddPoint_f
+=================
+*/
+void Cmd_AddPoint_f( gentity_t *ent ) {
+ // -bnewbold
+ G_Printf("###VIDEOHOOK:addpoint\n");
+}
+
+/*
+=================
+Cmd_DoBsod_f
+=================
+*/
+void Cmd_DoBsod_f( gentity_t *ent ) {
+ // -bnewbold
+ G_Printf("###VIDEOHOOK:dobsod\n");
+}
diff --git a/code/game/g_items.c b/code/game/g_items.c
index 73b2552..06f8c00 100644
--- a/code/game/g_items.c
+++ b/code/game/g_items.c
@@ -51,12 +51,23 @@ int Pickup_Powerup( gentity_t *ent, gentity_t *other ) {
int i;
gclient_t *client;
- if ( !other->client->ps.powerups[ent->item->giTag] ) {
+ // don't do most of this; just send hook -bnewbold
+
+ switch(ent->item->giTag) {
+ case PW_QUAD:
+ trap_SendConsoleCommand( EXEC_APPEND, "dobsod\n" );
+ break;
+ case PW_HASTE:
+ trap_SendConsoleCommand( EXEC_APPEND, "doiframe\n" );
+ break;
+ }
+
+ //if ( !other->client->ps.powerups[ent->item->giTag] ) {
// round timing to seconds to make multiple powerup timers
// count in sync
- other->client->ps.powerups[ent->item->giTag] =
- level.time - ( level.time % 1000 );
- }
+ // other->client->ps.powerups[ent->item->giTag] =
+ // level.time - ( level.time % 1000 );
+ //}
if ( ent->count ) {
quantity = ent->count;
@@ -64,7 +75,7 @@ int Pickup_Powerup( gentity_t *ent, gentity_t *other ) {
quantity = ent->item->quantity;
}
- other->client->ps.powerups[ent->item->giTag] += quantity * 1000;
+ //other->client->ps.powerups[ent->item->giTag] += quantity * 1000;
// give any nearby players a "denied" anti-reward
for ( i = 0 ; i < level.maxclients ; i++ ) {
@@ -331,10 +342,12 @@ int Pickup_Armor( gentity_t *ent, gentity_t *other ) {
other->client->ps.stats[STAT_ARMOR] = upperBound;
}
#else
- other->client->ps.stats[STAT_ARMOR] += ent->item->quantity;
- if ( other->client->ps.stats[STAT_ARMOR] > other->client->ps.stats[STAT_MAX_HEALTH] * 2 ) {
- other->client->ps.stats[STAT_ARMOR] = other->client->ps.stats[STAT_MAX_HEALTH] * 2;
- }
+ // addpoint -bnewbold
+ trap_SendConsoleCommand( EXEC_APPEND, "addpoint\n" );
+ //other->client->ps.stats[STAT_ARMOR] += ent->item->quantity;
+ //if ( other->client->ps.stats[STAT_ARMOR] > other->client->ps.stats[STAT_MAX_HEALTH] * 2 ) {
+// other->client->ps.stats[STAT_ARMOR] = other->client->ps.stats[STAT_MAX_HEALTH] * 2;
+// }
#endif
return RESPAWN_ARMOR;
@@ -443,7 +456,7 @@ void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace) {
respawn = Pickup_Ammo(ent, other);
// predict = qfalse;
break;
- case IT_ARMOR:
+ case IT_ARMOR: // -bnewbold
respawn = Pickup_Armor(ent, other);
break;
case IT_HEALTH:
diff --git a/code/game/g_misc.c b/code/game/g_misc.c
index b736cfd..a2bdb95 100644
--- a/code/game/g_misc.c
+++ b/code/game/g_misc.c
@@ -79,6 +79,9 @@ TELEPORTERS
void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles ) {
gentity_t *tent;
+ // WRITE OUT HOOK HERE -bnewbold
+ G_Printf("###VIDEOHOOK:teleport\n");
+
// use temp events at source and destination to prevent the effect
// from getting dropped by a second player event
if ( player->client->sess.sessionTeam != TEAM_SPECTATOR ) {
diff --git a/code/game/g_missile.c b/code/game/g_missile.c
index fbf21e4..d54b5bc 100644
--- a/code/game/g_missile.c
+++ b/code/game/g_missile.c
@@ -666,7 +666,7 @@ gentity_t *fire_rocket (gentity_t *self, vec3_t start, vec3_t dir) {
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
- VectorScale( dir, 900, bolt->s.pos.trDelta );
+ VectorScale( dir, 350, bolt->s.pos.trDelta ); // default: 900 -bnewbold
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy (start, bolt->r.currentOrigin);