summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2001-09-15 18:45:39 +0000
committerTim Angus <tim@ngus.net>2001-09-15 18:45:39 +0000
commit1b02716b661584dddb150e6346aeed3934be418a (patch)
tree1733f8765c68cc1f28041fa4c86e828fab39b71c /src/game
parentcab6cb5c4a989b11e6f45b74f87d84a961235984 (diff)
Trapper tweaks
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_pmove.c10
-rw-r--r--src/game/bg_public.h2
-rw-r--r--src/game/g_client.c22
3 files changed, 32 insertions, 2 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index d9d66ceb..30d71fa9 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -336,6 +336,9 @@ static float PM_CmdScale( usercmd_t *cmd ) {
modifier *= (float)( pm->ps->stats[ STAT_STAMINA ] + 1000 ) / 500.0f;
}
+ if( pm->ps->pm_type == PM_GRABBED )
+ modifier = 0.0f;
+
if( !BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_CANJUMP ) )
cmd->upmove = 0;
@@ -466,6 +469,13 @@ static qboolean PM_CheckJump( void )
return qfalse;
}
+ //can't jump whilst grabbed
+ if( pm->ps->pm_type == PM_GRABBED )
+ {
+ pm->cmd.upmove = 0;
+ return qfalse;
+ }
+
// must wait for jump to be released
if ( pm->ps->pm_flags & PMF_JUMP_HELD ) {
// clear upmove so cmdscale doesn't lower running speed
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 6f8454c2..2195db13 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -139,8 +139,8 @@ typedef enum {
PM_NORMAL, // can accelerate and turn
PM_NOCLIP, // noclip movement
PM_SPECTATOR, // still run into walls
- PM_DEAD, // no acceleration or turning, but free falling
PM_GRABBED, // like dead, but for when the player is still live
+ PM_DEAD, // no acceleration or turning, but free falling
PM_FREEZE, // stuck in place with no control
PM_INTERMISSION, // no movement or status bar
PM_SPINTERMISSION // no movement or status bar
diff --git a/src/game/g_client.c b/src/game/g_client.c
index bf8a8af2..48e3842a 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -1287,7 +1287,8 @@ after the first ClientBegin, and after each respawn
Initializes all non-persistant parts of playerState
============
*/
-void ClientSpawn( gentity_t *ent, gentity_t *spawn ) {
+void ClientSpawn( gentity_t *ent, gentity_t *spawn )
+{
int index;
vec3_t spawn_origin, spawn_angles;
gclient_t *client;
@@ -1527,6 +1528,25 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn ) {
G_SetOrigin( ent, spawn_origin );
VectorCopy( spawn_origin, client->ps.origin );
+#define UP_VEL 150.0f
+#define F_VEL 50.0f
+
+ //give aliens some spawn velocity
+ if( client->ps.stats[ STAT_PTEAM ] == PTE_DROIDS )
+ {
+ if( spawnPoint->s.origin2[ 2 ] > 0.0f )
+ {
+ vec3_t forward, dir;
+
+ AngleVectors( spawn_angles, forward, NULL, NULL );
+ VectorScale( forward, F_VEL, forward );
+ VectorAdd( spawn->s.origin2, forward, dir );
+ VectorNormalize( dir );
+
+ VectorScale( dir, UP_VEL, client->ps.velocity );
+ }
+ }
+
// the respawned flag will be cleared after the attack and jump keys come up
client->ps.pm_flags |= PMF_RESPAWNED;