From f9c64820ad26030864651661ac39dba3d770c85b Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 30 Jan 2005 23:43:53 +0000 Subject: * Slow release frags/credit * Possibly fixed human "you must be dead" spawning bug --- src/game/bg_pmove.c | 7 +++++-- src/game/g_active.c | 15 +++++++++++++++ src/game/g_buildable.c | 15 +++++++++++++++ src/game/g_client.c | 1 + src/game/g_cmds.c | 2 +- src/game/g_combat.c | 4 ---- src/game/tremulous.h | 4 ++++ 7 files changed, 41 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 7e7f7456..c1afd750 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2280,7 +2280,9 @@ static void PM_CheckDuck (void) } //TA: If the standing and crouching viewheights are the same the class can't crouch - if( ( pm->cmd.upmove < 0 ) && ( PCvh != PCcvh ) && pm->ps->pm_type != PM_JETPACK ) + if( ( pm->cmd.upmove < 0 ) && ( PCvh != PCcvh ) && + pm->ps->pm_type != PM_JETPACK && + !BG_InventoryContainsUpgrade( UP_BATTLESUIT, pm->ps->stats ) ) { // duck pm->ps->pm_flags |= PMF_DUCKED; @@ -3006,7 +3008,8 @@ static void PM_Weapon( void ) //FIXME: predicted angles miss a problem?? if( pm->ps->weapon == WP_CHAINGUN ) { - if( pm->ps->pm_flags & PMF_DUCKED ) + if( pm->ps->pm_flags & PMF_DUCKED || + BG_InventoryContainsUpgrade( UP_BATTLESUIT, pm->ps->stats ) ) { pm->ps->delta_angles[ PITCH ] -= ANGLE2SHORT( ( ( random() * 0.5 ) - 0.125 ) * ( 30 / (float)addTime ) ); pm->ps->delta_angles[ YAW ] -= ANGLE2SHORT( ( ( random() * 0.5 ) - 0.25 ) * ( 30.0 / (float)addTime ) ); diff --git a/src/game/g_active.c b/src/game/g_active.c index d8229500..49289ba8 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1304,6 +1304,21 @@ void ClientThink_real( gentity_t *ent ) ent->suicideTime = 0; } + // Give clients some credit periodically + if( ent->client->lastKillTime + FREEKILL_PERIOD < level.time ) + { + if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + { + G_AddCreditToClient( ent->client, FREEKILL_ALIEN ); + } + else if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + { + G_AddCreditToClient( ent->client, FREEKILL_HUMAN ); + } + + ent->client->lastKillTime = level.time; + } + // perform once-a-second actions ClientTimerActions( ent, msec ); } diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 38c493c8..a959e087 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1277,6 +1277,21 @@ void ADef_FireOnEnemy( gentity_t *self, int firespeed ) { float time = (float)i / 1000.0f; + if( i > 250 ) + { + G_Printf( "ADef_FireOnEnemy failed.\n" + " enemy location: %v\n" + " enemy accleration: %v\n" + " enemy jerk: %v\n" + " base location: %v\n", + self->enemy->s.pos.trBase, + self->enemy->acceleration, + self->enemy->jerk, + self->s.pos.trBase ); + + return; + } + VectorMA( self->enemy->s.pos.trBase, time, self->enemy->s.pos.trDelta, dirToTarget ); VectorMA( dirToTarget, time * time, halfAcceleration, dirToTarget ); diff --git a/src/game/g_client.c b/src/game/g_client.c index cbeafcb6..83d3e8e6 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1448,6 +1448,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles client->ps.pm_time = 100; client->respawnTime = level.time; + client->lastKillTime = level.time; client->inactivityTime = level.time + g_inactivity.integer * 1000; client->latched_buttons = 0; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index ac6e37e5..0aae2c70 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1246,7 +1246,7 @@ void Cmd_Class_f( gentity_t *ent ) else if( ent->client->pers.teamSelection == PTE_HUMANS ) { //humans cannot use this command whilst alive - if( ent->client->ps.stats[ STAT_PCLASS ] != PCL_NONE ) + if( ent->client->pers.classSelection != PCL_NONE ) { trap_SendServerCommand( ent-g_entities, va( "print \"You must be dead to use the class command\n\"" ) ); return; diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 3b42fd86..93b8c21c 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -357,9 +357,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int } } - // Add team bonuses - //Team_FragBonuses(self, inflictor, attacker); - Cmd_Score_f( self ); // show scores // send updated scores to any clients that are following this one, @@ -384,7 +381,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int self->takedamage = qtrue; // can still be gibbed self->s.weapon = WP_NONE; - /*self->s.powerups = 0;*/ //TA: class is encoded into powerups in trem self->r.contents = CONTENTS_CORPSE; self->s.angles[ PITCH ] = 0; diff --git a/src/game/tremulous.h b/src/game/tremulous.h index a053de4f..3265bded 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -545,3 +545,7 @@ #define HUMAN_MAX_CREDITS 2000 #define ALIEN_MAX_KILLS 9 #define ALIEN_MAX_SINGLE_KILLS 3 + +#define FREEKILL_PERIOD 180000 //msec +#define FREEKILL_ALIEN 1 +#define FREEKILL_HUMAN SOLDIER_VALUE -- cgit