diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 19 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 21 | ||||
-rw-r--r-- | src/game/bg_public.h | 6 | ||||
-rw-r--r-- | src/game/g_active.c | 22 | ||||
-rw-r--r-- | src/game/g_client.c | 8 | ||||
-rw-r--r-- | src/game/g_cmds.c | 11 | ||||
-rw-r--r-- | src/game/g_local.h | 1 | ||||
-rw-r--r-- | src/game/g_weapon.c | 17 |
8 files changed, 58 insertions, 47 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 02db5993..59c76e3a 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -5445,6 +5445,25 @@ qboolean BG_PlayerCanChangeWeapon( playerState_t *ps ) } /* +================= +BG_PlayerPoisonCloudTime +================= +*/ +int BG_PlayerPoisonCloudTime( playerState_t *ps ) +{ + int time = LEVEL1_PCLOUD_TIME; + + if( BG_InventoryContainsUpgrade( UP_BATTLESUIT, ps->stats ) ) + time -= BSUIT_PCLOUD_PROTECTION; + if( BG_InventoryContainsUpgrade( UP_HELMET, ps->stats ) ) + time -= HELMET_PCLOUD_PROTECTION; + if( BG_InventoryContainsUpgrade( UP_LIGHTARMOUR, ps->stats ) ) + time -= LIGHTARMOUR_PCLOUD_PROTECTION; + + return time; +} + +/* =============== atof_neg diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index e041ba26..f1c1d116 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -393,7 +393,7 @@ static float PM_CmdScale( usercmd_t *cmd ) else modifier *= CREEP_MODIFIER; } - if( pm->ps->stats[ STAT_STATE ] & SS_POISONCLOUDED ) + if( pm->ps->eFlags & EF_POISONCLOUDED ) { if( BG_InventoryContainsUpgrade( UP_LIGHTARMOUR, pm->ps->stats ) || BG_InventoryContainsUpgrade( UP_BATTLESUIT, pm->ps->stats ) ) @@ -853,14 +853,14 @@ static qboolean PM_CheckDodge( void ) pm->ps->stats[ STAT_STATE ] &= ~SS_SPEEDBOOST; // Reasons why we can't start a dodge or sprint - if( !( pm->cmd.buttons & BUTTON_DODGE ) || - pm->ps->pm_type != PM_NORMAL || - ( pm->ps->pm_flags & PMF_CROUCH_HELD ) || - pm->ps->stats[ STAT_STAMINA ] < 0 ) + if( pm->ps->pm_type != PM_NORMAL || pm->ps->stats[ STAT_STAMINA ] < 0 || + ( pm->ps->pm_flags & PMF_CROUCH_HELD ) ) return qfalse; // Start a sprint instead of forward leaps - if( pm->cmd.forwardmove > 0 ) + if( pm->cmd.forwardmove > 0 && + ( ( pm->cmd.buttons & BUTTON_DODGE ) || + ( pm->ps->persistant[ PERS_STATE ] & PS_ALWAYSSPRINT ) ) ) { if( pm->cmd.buttons & BUTTON_WALKING ) return qfalse; @@ -870,7 +870,8 @@ static qboolean PM_CheckDodge( void ) // Reasons why we can't start a dodge only if( pm->ps->pm_flags & ( PMF_TIME_LAND | PMF_CHARGE ) || - pm->ps->groundEntityNum == ENTITYNUM_NONE ) + pm->ps->groundEntityNum == ENTITYNUM_NONE || + !( pm->cmd.buttons & BUTTON_DODGE ) ) return qfalse; // Dodge direction specified with movement keys @@ -3508,12 +3509,6 @@ void PmoveSingle( pmove_t *pmove ) if( abs( pm->cmd.forwardmove ) > 64 || abs( pm->cmd.rightmove ) > 64 ) pm->cmd.buttons &= ~BUTTON_WALKING; - // set the talk balloon flag - if( pm->cmd.buttons & BUTTON_TALK ) - pm->ps->eFlags |= EF_TALK; - else - pm->ps->eFlags &= ~EF_TALK; - // set the firing flag for continuous beam weapons if( !(pm->ps->pm_flags & PMF_RESPAWNED) && pm->ps->pm_type != PM_INTERMISSION && ( pm->cmd.buttons & BUTTON_ATTACK ) && diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 54101188..64ce67d5 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -243,7 +243,7 @@ typedef enum #define SS_HOVELING 0x00000100 #define SS_BOOSTED 0x00000200 #define SS_SLOWLOCKED 0x00000400 -#define SS_POISONCLOUDED 0x00000800 +//#define SS_POISONCLOUDED 0x00000800 // unused #define SS_CHARGING 0x00001000 #define SS_HEALING_ACTIVE 0x00002000 // medkit for Humans, creep for Aliens #define SS_HEALING_2X 0x00004000 // double healing rate (for HUD) @@ -276,6 +276,7 @@ typedef enum #define PS_WALLCLIMBINGFOLLOW 0x00000001 #define PS_WALLCLIMBINGTOGGLE 0x00000002 #define PS_NONSEGMODEL 0x00000004 +#define PS_ALWAYSSPRINT 0x00000008 // entityState_t->eFlags #define EF_DEAD 0x00000001 // don't draw a foe marker over players with EF_DEAD @@ -291,7 +292,7 @@ typedef enum #define EF_FIRING2 0x00000400 // alt fire #define EF_FIRING3 0x00000800 // third fire #define EF_MOVER_STOP 0x00001000 // will push otherwise -#define EF_TALK 0x00002000 // draw a talk balloon +#define EF_POISONCLOUDED 0x00002000 // player hit with basilisk gas #define EF_CONNECTION 0x00004000 // draw a connection trouble sprite #define EF_VOTED 0x00008000 // already cast a vote #define EF_TEAMVOTED 0x00010000 // already cast a vote @@ -1131,6 +1132,7 @@ void BG_PositionBuildableRelativeToPlayer( const playerState_t *ps, vec3_t outOrigin, vec3_t outAngles, trace_t *tr ); int BG_GetValueOfPlayer( playerState_t *ps ); qboolean BG_PlayerCanChangeWeapon( playerState_t *ps ); +int BG_PlayerPoisonCloudTime( playerState_t *ps ); int BG_FindValueOfBuildable( int bclass ); int BG_FindBuildNumForName( char *name ); diff --git a/src/game/g_active.c b/src/game/g_active.c index 74cb28e2..9faa2c33 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -705,7 +705,6 @@ void ClientTimerActions( gentity_t *ent, int msec ) { client->time1000 -= 1000; - //client is poisoned if( client->ps.stats[ STAT_STATE ] & SS_POISONED ) { @@ -837,7 +836,6 @@ ClientIntermissionThink */ void ClientIntermissionThink( gclient_t *client ) { - client->ps.eFlags &= ~EF_TALK; client->ps.eFlags &= ~EF_FIRING; client->ps.eFlags &= ~EF_FIRING2; @@ -1415,21 +1413,11 @@ void ClientThink_real( gentity_t *ent ) level.time - client->boostedTime >= BOOST_TIME ) client->ps.stats[ STAT_STATE ] &= ~SS_BOOSTED; - if( client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED ) - { - int timeLeft = LEVEL1_PCLOUD_TIME - - ( level.time - client->lastPoisonCloudedTime ); - - if( BG_InventoryContainsUpgrade( UP_BATTLESUIT, client->ps.stats ) ) - timeLeft -= BSUIT_PCLOUD_PROTECTION; - if( BG_InventoryContainsUpgrade( UP_HELMET, client->ps.stats ) ) - timeLeft -= HELMET_PCLOUD_PROTECTION; - if( BG_InventoryContainsUpgrade( UP_LIGHTARMOUR, client->ps.stats ) ) - timeLeft -= LIGHTARMOUR_PCLOUD_PROTECTION; - - if( timeLeft <= 0 ) - client->ps.stats[ STAT_STATE ] &= ~SS_POISONCLOUDED; - } + // Check if poison cloud has worn off + if( ( client->ps.eFlags & EF_POISONCLOUDED ) && + BG_PlayerPoisonCloudTime( &client->ps ) - level.time + + client->lastPoisonCloudedTime <= 0 ) + client->ps.eFlags &= ~EF_POISONCLOUDED; if( client->ps.stats[ STAT_STATE ] & SS_POISONED && client->lastPoisonTime + ALIEN_POISON_TIME < level.time ) diff --git a/src/game/g_client.c b/src/game/g_client.c index 9298eb55..621a0261 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1110,6 +1110,14 @@ void ClientUserinfoChanged( int clientNum ) else client->ps.persistant[ PERS_STATE ] &= ~PS_WALLCLIMBINGTOGGLE; + // always sprint + s = Info_ValueForKey( userinfo, "cg_alwaysSprint" ); + + if( atoi( s ) ) + client->ps.persistant[ PERS_STATE ] |= PS_ALWAYSSPRINT; + else + client->ps.persistant[ PERS_STATE ] &= ~PS_ALWAYSSPRINT; + // teamInfo s = Info_ValueForKey( userinfo, "teamoverlay" ); diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 0a0d7343..98e23ba3 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -554,9 +554,6 @@ void G_LeaveTeam( gentity_t *self ) if( ent->client && ent->client->pers.connected == CON_CONNECTED ) { // cure poison - if( ent->client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED && - ent->client->lastPoisonCloudedClient == self ) - ent->client->ps.stats[ STAT_STATE ] &= ~SS_POISONCLOUDED; if( ent->client->ps.stats[ STAT_STATE ] & SS_POISONED && ent->client->lastPoisonClient == self ) ent->client->ps.stats[ STAT_STATE ] &= ~SS_POISONED; @@ -2865,9 +2862,13 @@ static void Cmd_Ignore_f( gentity_t *ent ) Cmd_Test_f ================= */ -void Cmd_Test_f( gentity_t *ent ) +void Cmd_Test_f( gentity_t *humanPlayer ) { - G_CloseMenus( ent - g_entities ); + humanPlayer->client->ps.eFlags |= EF_POISONCLOUDED; + humanPlayer->client->lastPoisonCloudedTime = level.time; + + trap_SendServerCommand( humanPlayer->client->ps.clientNum, + "poisoncloud" ); } /* diff --git a/src/game/g_local.h b/src/game/g_local.h index 6071a26f..66196ed4 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -450,7 +450,6 @@ struct gclient_s int poisonImmunityTime; gentity_t *lastPoisonClient; int lastPoisonCloudedTime; - gentity_t *lastPoisonCloudedClient; int grabExpiryTime; int lastLockTime; int lastSlowTime; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 5230d982..c78e6ec6 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -1105,22 +1105,21 @@ void poisonCloud( gentity_t *ent ) { humanPlayer = &g_entities[ entityList[ i ] ]; - if( humanPlayer->client && humanPlayer->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( humanPlayer->client && + humanPlayer->client->pers.teamSelection == PTE_HUMANS ) { - trap_Trace( &tr, muzzle, NULL, NULL, humanPlayer->s.origin, humanPlayer->s.number, MASK_SHOT ); + trap_Trace( &tr, muzzle, NULL, NULL, humanPlayer->s.origin, + humanPlayer->s.number, CONTENTS_SOLID ); //can't see target from here if( tr.entityNum == ENTITYNUM_WORLD ) continue; - if( !( humanPlayer->client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED ) ) - { - humanPlayer->client->ps.stats[ STAT_STATE ] |= SS_POISONCLOUDED; - humanPlayer->client->lastPoisonCloudedTime = level.time; - humanPlayer->client->lastPoisonCloudedClient = ent; + humanPlayer->client->ps.eFlags |= EF_POISONCLOUDED; + humanPlayer->client->lastPoisonCloudedTime = level.time; - trap_SendServerCommand( humanPlayer->client->ps.clientNum, "poisoncloud" ); - } + trap_SendServerCommand( humanPlayer->client->ps.clientNum, + "poisoncloud" ); } } G_UnlaggedOff( ); |