From f6daf5fab2d691a776fa0028e17e0c574af5dd02 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Fri, 20 Aug 2004 23:26:54 +0000 Subject: * Slowed lasgun down * Chimera lightning bug fixed and damage increased * Splashdamage on turrets increased * Dragoon barbs do more damage and regenerate * Kill command is cancellable * "buy ammo" now works with energy weapons * Dragoon weakened slightly * Humans speed increased * Reactor health increased * Base attack warning for spawns as well as reactor --- src/game/g_active.c | 21 +++++++++++++++++++++ src/game/g_buildable.c | 28 ++++++++++++---------------- src/game/g_cmds.c | 41 ++++++++++++++++++++++++++++++++++------- src/game/g_local.h | 4 +++- src/game/g_weapon.c | 1 + src/game/tremulous.h | 33 ++++++++++++++++----------------- 6 files changed, 87 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/game/g_active.c b/src/game/g_active.c index 91f513d6..8ba8723b 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -462,6 +462,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) client = ent->client; client->time100 += msec; client->time1000 += msec; + client->time10000 += msec; while ( client->time100 >= 100 ) { @@ -681,6 +682,25 @@ void ClientTimerActions( gentity_t *ent, int msec ) ent->health = client->ps.stats[ STAT_MAX_HEALTH ]; } } + + while( client->time10000 >= 10000 ) + { + client->time10000 -= 10000; + + if( client->ps.weapon == WP_DRAGOON_UPG ) + { + int ammo, maxAmmo; + + BG_FindAmmoForWeapon( WP_DRAGOON_UPG, &maxAmmo, NULL, NULL ); + BG_unpackAmmoArray( WP_DRAGOON_UPG, client->ps.ammo, client->ps.powerups, &ammo, NULL, NULL ); + + if( ammo < maxAmmo ) + { + ammo++; + BG_packAmmoArray( WP_DRAGOON_UPG, client->ps.ammo, client->ps.powerups, ammo, 0, 0 ); + } + } + } } /* @@ -1136,6 +1156,7 @@ void ClientThink_real( gentity_t *ent ) // NOTE: now copy the exact origin over otherwise clients can be snapped into solid VectorCopy( ent->client->ps.origin, ent->r.currentOrigin ); + VectorCopy( ent->client->ps.origin, ent->s.origin ); // touch other objects ClientImpacts( ent, &pm ); diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 40604f6d..54717b3b 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1479,20 +1479,6 @@ void HRpt_Use( gentity_t *self, gentity_t *other, gentity_t *activator ) if( BG_gotItem( UP_BATTPACK, ps->stats ) ) maxAmmo = (int)( (float)maxAmmo * BATTPACK_MODIFIER ); - -/* BG_unpackAmmoArray( weapon, ps->ammo, ps->powerups, &ammo, &clips, NULL ); - - if( ammo == maxAmmo && clips < maxClips ) - { - clips++; - ammo = 0; - } - - //add half max ammo - ammo += maxAmmo >> 1; - - if( ammo > maxAmmo ) - ammo = maxAmmo;*/ BG_packAmmoArray( weapon, ps->ammo, ps->powerups, maxAmmo, maxClips, maxClips ); @@ -1546,9 +1532,9 @@ void HReactor_Think( gentity_t *self ) //reactor under attack if( self->health < self->lastHealth && - level.time > self->dccAttackTimer && G_isDCC( ) ) + level.time > level.humanBaseAttackTimer && G_isDCC( ) ) { - self->dccAttackTimer = level.time + DCC_ATTACK_PERIOD; + level.humanBaseAttackTimer = level.time + DCC_ATTACK_PERIOD; G_BroadcastEvent( EV_DCC_ATTACK, 0 ); } @@ -2182,6 +2168,16 @@ void HSpawn_Think( gentity_t *self ) G_FreeEntity( ent ); //quietly remove } } + + //spawn under attack + if( self->health < self->lastHealth && + level.time > level.humanBaseAttackTimer && G_isDCC( ) ) + { + level.humanBaseAttackTimer = level.time + DCC_ATTACK_PERIOD; + G_BroadcastEvent( EV_DCC_ATTACK, 0 ); + } + + self->lastHealth = self->health; } self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex ); diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index f10177d7..8249eddb 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -421,8 +421,16 @@ void Cmd_Kill_f( gentity_t *ent ) } else { - trap_SendServerCommand( ent-g_entities, "print \"You will suicide in 10 seconds.\n\"" ); - ent->suicideTime = level.time + 10000; + if( ent->suicideTime == 0 ) + { + trap_SendServerCommand( ent-g_entities, "print \"You will suicide in 10 seconds.\n\"" ); + ent->suicideTime = level.time + 10000; + } + else if( ent->suicideTime > level.time ) + { + trap_SendServerCommand( ent-g_entities, "print \"Suicide cancelled.\n\"" ); + ent->suicideTime = 0; + } } } @@ -1442,6 +1450,7 @@ void Cmd_Buy_f( gentity_t *ent ) int i; int weapon, upgrade, numItems = 0; int quan, clips, maxClips; + qboolean buyingEnergyAmmo = qfalse; for( i = UP_NONE; i < UP_NUM_UPGRADES; i++ ) { @@ -1461,16 +1470,27 @@ void Cmd_Buy_f( gentity_t *ent ) if( ent->client->pers.teamSelection != PTE_HUMANS ) return; + weapon = BG_FindWeaponNumForName( s ); + upgrade = BG_FindUpgradeNumForName( s ); + + //special case to keep norf happy + if( weapon == WP_NONE && upgrade == UP_AMMO ) + { + //if we're buying ammo, there is a reactor/repeater in range and + //our current weapon uses energy + if( ( G_BuildableRange( ent->client->ps.origin, 100, BA_H_REACTOR ) || + G_BuildableRange( ent->client->ps.origin, 100, BA_H_REPEATER ) ) && + BG_FindUsesEnergyForWeapon( ent->client->ps.weapon ) ) + buyingEnergyAmmo = qtrue; + } + //no armoury nearby - if( !G_BuildableRange( ent->client->ps.origin, 100, BA_H_ARMOURY ) ) + if( !G_BuildableRange( ent->client->ps.origin, 100, BA_H_ARMOURY ) && !buyingEnergyAmmo ) { trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an armoury\n\"" ) ); return; } - weapon = BG_FindWeaponNumForName( s ); - upgrade = BG_FindUpgradeNumForName( s ); - if( weapon != WP_NONE ) { //already got this? @@ -1589,10 +1609,17 @@ void Cmd_Buy_f( gentity_t *ent ) if( upgrade == UP_AMMO ) { + qboolean weaponType; + for( i = WP_NONE; i < WP_NUM_WEAPONS; i++ ) { + if( buyingEnergyAmmo ) + weaponType = BG_FindUsesEnergyForWeapon( i ); + else + weaponType = !BG_FindUsesEnergyForWeapon( i ); + if( BG_gotWeapon( i, ent->client->ps.stats ) && - !BG_FindUsesEnergyForWeapon( i ) && + weaponType && !BG_FindInfinteAmmoForWeapon( i ) ) { BG_FindAmmoForWeapon( i, &quan, &clips, &maxClips ); diff --git a/src/game/g_local.h b/src/game/g_local.h index 4073e2e4..84acff1c 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -201,7 +201,6 @@ struct gentity_s int overmindAttackTimer; int overmindDyingTimer; int overmindSpawnsTimer; - int dccAttackTimer; int nextPhysicsTime; //TA: buildables don't need to check what they're sitting on // every single frame.. so only do it periodically int clientSpawnTime; //TA: the time until this spawn can spawn a client @@ -373,6 +372,7 @@ struct gclient_s //TA: two timers, one every 100 msecs, another every sec int time100; int time1000; + int time10000; char *areabits; @@ -562,6 +562,8 @@ typedef struct qboolean reactorPresent; qboolean overmindPresent; + int humanBaseAttackTimer; + pTeam_t lastWin; spawnQueue_t alienSpawnQueue; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 561606ef..dbcf33d2 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -933,6 +933,7 @@ void areaZapFire( gentity_t *ent ) VectorSubtract( ent->client->ps.origin, range, mins ); num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); + for( i = 0; i < num; i++ ) { enemy = &g_entities[ entityList[ i ] ]; diff --git a/src/game/tremulous.h b/src/game/tremulous.h index fa4c131e..2ba0dd50 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -60,8 +60,8 @@ #define CHIMERA_CLAW_WIDTH 12.0f #define CHIMERA_CLAW_REPEAT 500 #define CHIMERA_CLAW_U_REPEAT 400 -#define CHIMERA_AREAZAP_DMG ADM(75) -#define CHIMERA_AREAZAP_RANGE 200.0f +#define CHIMERA_AREAZAP_DMG ADM(200) +#define CHIMERA_AREAZAP_RANGE 300.0f #define CHIMERA_AREAZAP_REPEAT 1500 #define CHIMERA_WALLJUMP_MAXSPEED 1000.0f @@ -77,7 +77,7 @@ #define DRAGOON_POUNCE_UPG_SPEED 800 #define DRAGOON_POUNCE_SPEED_MOD 0.75f #define DRAGOON_POUNCE_TIME 700 -#define DRAGOON_BOUNCEBALL_DMG ADM(100) +#define DRAGOON_BOUNCEBALL_DMG ADM(150) #define DRAGOON_BOUNCEBALL_REPEAT 1000 #define DRAGOON_BOUNCEBALL_SPEED 1000.0f @@ -100,7 +100,6 @@ * ALIEN classes * * _SPEED - fraction of Q3A run speed the class can move - * _TTE - time in msec for the class to evolve to another * _REGEN - health per second regained * * ALIEN_HLTH_MODIFIER - overall health modifier for coarse tuning @@ -155,19 +154,19 @@ #define CHIMERA_UPG_REGEN 4 #define CHIMERA_UPG_COST 1 -#define DRAGOON_SPEED 1.2f +#define DRAGOON_SPEED 1.1f #define DRAGOON_VALUE AVM(500) -#define DRAGOON_HEALTH AHM(250) +#define DRAGOON_HEALTH AHM(200) #define DRAGOON_REGEN 5 #define DRAGOON_COST 1 -#define DRAGOON_UPG_SPEED 1.2f +#define DRAGOON_UPG_SPEED 1.1f #define DRAGOON_UPG_VALUE AVM(600) -#define DRAGOON_UPG_HEALTH AHM(300) +#define DRAGOON_UPG_HEALTH AHM(250) #define DRAGOON_UPG_REGEN 6 #define DRAGOON_UPG_COST 1 -#define BMOFO_SPEED 1.15f +#define BMOFO_SPEED 1.2f #define BMOFO_VALUE AVM(800) #define BMOFO_HEALTH AHM(400) #define BMOFO_REGEN 7 @@ -341,7 +340,7 @@ #define LASGUN_PRICE 250 #define LASGUN_AMMO 150 -#define LASGUN_REPEAT 150 +#define LASGUN_REPEAT 200 #define LASGUN_RELOAD 2000 #define LASGUN_DAMAGE HDM(10) @@ -466,9 +465,9 @@ #define MGTURRET_BP 8 #define MGTURRET_BT 10000 -#define MGTURRET_HEALTH HBHM(450) -#define MGTURRET_SPLASHDAMAGE 50 -#define MGTURRET_SPLASHRADIUS 100 +#define MGTURRET_HEALTH HBHM(400) +#define MGTURRET_SPLASHDAMAGE 200 +#define MGTURRET_SPLASHRADIUS 150 #define MGTURRET_ANGULARSPEED 6 //degrees/think ~= 200deg/sec #define MGTURRET_ACCURACYTOLERANCE MGTURRET_ANGULARSPEED / 1.5f //angular difference for turret to fire #define MGTURRET_VERTICALCAP 30 // +/- maximum pitch @@ -502,7 +501,7 @@ #define REACTOR_BP 0 #define REACTOR_BT 20000 -#define REACTOR_HEALTH HBHM(1250) +#define REACTOR_HEALTH HBHM(1500) #define REACTOR_SPLASHDAMAGE 200 #define REACTOR_SPLASHRADIUS 300 #define REACTOR_ATTACK_RANGE 100.0f @@ -523,9 +522,9 @@ */ #define HUMAN_SPRINT_MODIFIER 1.2f -#define HUMAN_JOG_MODIFIER 0.9f -#define HUMAN_BACK_MODIFIER 0.7f -#define HUMAN_SIDE_MODIFIER 0.8f +#define HUMAN_JOG_MODIFIER 1.0f +#define HUMAN_BACK_MODIFIER 0.8f +#define HUMAN_SIDE_MODIFIER 0.9f #define STAMINA_STOP_RESTORE 25 #define STAMINA_WALK_RESTORE 15 -- cgit