diff options
-rw-r--r-- | src/cgame/cg_buildable.c | 22 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 16 | ||||
-rw-r--r-- | src/game/g_active.c | 9 | ||||
-rw-r--r-- | src/game/g_buildable.c | 13 | ||||
-rw-r--r-- | src/game/g_combat.c | 1 | ||||
-rw-r--r-- | src/game/g_local.h | 2 | ||||
-rw-r--r-- | src/game/g_weapon.c | 1 |
7 files changed, 41 insertions, 23 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index c34561d1..00c7bf68 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -932,15 +932,27 @@ void CG_Buildable( centity_t *cent ) break; } - if( cg.time - cent->muzzleFlashTime > MUZZLE_FLASH_TIME && es->eFlags & EF_FIRING ) + //weapon effects for turrets + if( es->eFlags & EF_FIRING ) { weaponInfo_t *weapon = &cg_weapons[ es->weapon ]; - - if( weapon->flashDlightColor[ 0 ] || weapon->flashDlightColor[ 1 ] || weapon->flashDlightColor[ 2 ] ) + + if( cg.time - cent->muzzleFlashTime > MUZZLE_FLASH_TIME || + BG_FindProjTypeForBuildable( es->modelindex ) == WP_TESLAGEN ) + { + if( weapon->flashDlightColor[ 0 ] || weapon->flashDlightColor[ 1 ] || weapon->flashDlightColor[ 2 ] ) + { + trap_R_AddLightToScene( cent->lerpOrigin, 300 + ( rand( ) & 31 ), weapon->flashDlightColor[ 0 ], + weapon->flashDlightColor[ 1 ], weapon->flashDlightColor[ 2 ] ); + } + } + + if( weapon->firingSound ) { - trap_R_AddLightToScene( cent->lerpOrigin, 300 + ( rand( ) & 31 ), weapon->flashDlightColor[ 0 ], - weapon->flashDlightColor[ 1 ], weapon->flashDlightColor[ 2 ] ); + trap_S_AddLoopingSound( es->number, cent->lerpOrigin, vec3_origin, weapon->firingSound ); } + else if( weapon->readySound ) + trap_S_AddLoopingSound( es->number, cent->lerpOrigin, vec3_origin, weapon->readySound ); } //smoke etc for damaged buildables diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 87f10a8d..7d8f38c5 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -111,12 +111,6 @@ static void CG_Obituary( entityState_t *ent ) case MOD_SLOWBLOB: message = "should have visited a medical station"; break; - case MOD_POISON: - message = "should have remembered the antitox"; - break; - case MOD_HYDRA_PCLOUD: //FIXME - message = "was gassed by a hydra"; - break; default: message = NULL; break; @@ -258,6 +252,16 @@ static void CG_Obituary( entityState_t *ent ) message2 = "'s big mofo"; break; + case MOD_POISON: + message = "should have used antitox against"; + message2 = "'s poison"; + break; + case MOD_HYDRA_PCLOUD: + message = "was gassed by"; + message2 = "'s hydra"; + break; + + case MOD_TELEFRAG: message = "tried to invade"; message2 = "'s personal space"; diff --git a/src/game/g_active.c b/src/game/g_active.c index 6d296b5a..fc4b4ea3 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -461,12 +461,12 @@ void ClientTimerActions( gentity_t *ent, int msec ) client->ps.stats[ STAT_STAMINA ] = MAX_STAMINA; } - //client is poisoned FIXME: set attacker parameter + //client is poisoned if( client->ps.stats[ STAT_STATE ] & SS_POISONED ) { int damage = ( level.time - client->lastPoisonTime ) / 1000; - G_Damage( ent, NULL, NULL, NULL, NULL, damage, 0, MOD_POISON ); + G_Damage( ent, client->lastPoisonClient, client->lastPoisonClient, NULL, NULL, damage, 0, MOD_POISON ); } //client is charging up for a pounce @@ -576,9 +576,10 @@ void ClientTimerActions( gentity_t *ent, int msec ) { client->time1000 -= 1000; - //client is poisoned FIXME: set attacker parameter + //client is poisoned if( client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED ) - G_Damage( ent, NULL, NULL, NULL, NULL, HYDRA_PCLOUD_DMG, 0, MOD_HYDRA_PCLOUD ); + G_Damage( ent, client->lastPoisonCloudedClient, client->lastPoisonCloudedClient, NULL, NULL, + HYDRA_PCLOUD_DMG, 0, MOD_HYDRA_PCLOUD ); //replenish alien health if( client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 0c103423..50c45950 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1741,22 +1741,19 @@ void HTeslaGen_Think( gentity_t *self ) self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex ); - //used for client side muzzle flashes - self->s.eFlags &= ~EF_FIRING; - //if not powered don't do anything and check again for power next think - if( !( self->powered = findPower( self ) ) ) + if( !( self->powered = findPower( self ) ) || !( self->dcced = findDCC( self ) ) ) { + self->s.eFlags &= ~EF_FIRING; self->nextthink = level.time + POWER_REFRESH_TIME; return; } - //find DCC - if( !( self->dcced = findDCC( self ) ) ) - return; - if( self->spawned && self->count < level.time ) { + //used to mark client side effects + self->s.eFlags &= ~EF_FIRING; + VectorSet( range, TESLAGEN_RANGE, TESLAGEN_RANGE, TESLAGEN_RANGE ); VectorAdd( self->s.origin, range, maxs ); VectorSubtract( self->s.origin, range, mins ); diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 2410821b..3372a7fc 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -986,6 +986,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, { targ->client->ps.stats[ STAT_STATE ] |= SS_POISONED; targ->client->lastPoisonTime = level.time; + targ->client->lastPoisonClient = attacker; } } } diff --git a/src/game/g_local.h b/src/game/g_local.h index 411bdde1..52ccc09f 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -353,7 +353,9 @@ struct gclient_s gentity_t *infestBody; //TA: body that is being infested. must be persistant int lastPoisonTime; + gentity_t *lastPoisonClient; int lastPoisonCloudedTime; + gentity_t *lastPoisonCloudedClient; int lastGrabTime; int lastLockTime; int lastSlowTime; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 4f737bc3..983d040c 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -660,6 +660,7 @@ void poisonCloud( gentity_t *ent ) { humanPlayer->client->ps.stats[ STAT_STATE ] |= SS_POISONCLOUDED; humanPlayer->client->lastPoisonCloudedTime = level.time; + humanPlayer->client->lastPoisonCloudedClient = ent; G_AddPredictableEvent( humanPlayer, EV_POISONCLOUD, 0 ); } } |