summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_event.c28
-rw-r--r--src/cgame/cg_players.c10
-rw-r--r--src/game/bg_misc.c64
-rw-r--r--src/game/bg_public.h3
-rw-r--r--src/game/g_active.c9
-rw-r--r--src/game/g_buildable.c47
-rw-r--r--src/game/g_client.c125
-rw-r--r--src/game/g_cmds.c193
-rw-r--r--src/game/g_combat.c11
-rw-r--r--src/game/tremulous.h32
-rw-r--r--src/ui/ui_main.c123
11 files changed, 182 insertions, 463 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index 992db57c..abf703e3 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -292,13 +292,14 @@ void CG_PainEvent( centity_t *cent, int health )
cent->pe.painDirection ^= 1;
}
-
/*
-==============
-CG_Menu
-==============
+===============
+CG_SetUIVars
+
+Set some cvars used by the UI
+===============
*/
-void CG_Menu( int eventParm )
+void CG_SetUIVars( void )
{
int i;
char carriageCvar[ MAX_TOKEN_CHARS ];
@@ -321,7 +322,18 @@ void CG_Menu( int eventParm )
trap_Cvar_Set( "ui_carriage", carriageCvar );
trap_Cvar_Set( "ui_stages", va( "%d %d", cgs.alienStage, cgs.humanStage ) );
+}
+
+/*
+==============
+CG_Menu
+==============
+*/
+void CG_Menu( int eventParm )
+{
+ CG_SetUIVars( );
+
switch( eventParm )
{
case MN_TEAM: trap_SendConsoleCommand( "menu tremulous_teamselect\n" ); break;
@@ -411,6 +423,12 @@ void CG_Menu( int eventParm )
trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );
break;
+ case MN_A_NOEROOM:
+ trap_Cvar_Set( "ui_dialog", "There is no room to evolve here. Move away from walls or other "
+ "nearby objects and try again." );
+ trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );
+ break;
+
case MN_A_HIVEMIND:
trap_Cvar_Set( "ui_dialog", "There can only be one Overmind. Destroy the existing one if you "
"wish to move it." );
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index a5ce2a53..3e2235f3 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -2301,16 +2301,6 @@ void CG_Corpse( centity_t *cent )
//CG_AddRefEntityWithPowerups( &head, es->powerups, ci->team );
trap_R_AddRefEntityToScene( &head );
}
-
- if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS )
- {
- if( es->powerups == cg.predictedPlayerState.clientNum ||
- es->powerups == 65535 ) //65535 = 16bit signed -1
- {
- //draw indicator
- CG_PlayerFloatSprite( cent, cgs.media.friendShader );
- }
- }
}
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 549e5a81..9451a52a 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -245,38 +245,6 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse //qboolean reactorTest;
},
{
- BA_A_OBANK, //int buildNum;
- "obank", //char *buildName;
- "Organ Bank", //char *humanName;
- "team_alien_obank", //char *entityName;
- { "models/buildables/obank/obank.md3", 0, 0, 0 },
- { -15, -15, -15 }, //vec3_t mins;
- { 15, 15, 15 }, //vec3_t maxs;
- TR_GRAVITY, //trType_t traj;
- 0.0, //float bounce;
- OBANK_BP, //int buildPoints;
- ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
- OBANK_HEALTH, //int health;
- OBANK_REGEN, //int regenRate;
- OBANK_SPLASHDAMAGE, //int splashDamage;
- OBANK_SPLASHRADIUS, //int splashRadius;
- MOD_ASPAWN, //int meansOfDeath;
- BIT_ALIENS, //int team;
- ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon;
- BANIM_IDLE1, //int idleAnim;
- -1, //int nextthink;
- qtrue, //qboolean usable;
- 0, //int turretRange;
- 0, //int turretFireSpeed;
- WP_NONE, //weapon_t turretProjType;
- 0.5f, //float minNormal;
- qtrue, //qboolean invertNormal;
- qtrue, //qboolean creepTest;
- OBANK_CREEPSIZE, //int creepSize;
- qfalse, //qboolean dccTest;
- qfalse //qboolean reactorTest;
- },
- {
BA_H_SPAWN, //int buildNum;
"replicator", //char *buildName;
"Replicator", //char *humanName;
@@ -341,38 +309,6 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse //qboolean reactorTest;
},
{
- BA_H_ADVMEDISTAT, //int buildNum;
- "advmedistat", //char *buildName;
- "Adv Medistation", //char *humanName;
- "team_human_advmedistat",//char *entityName;
- { "models/buildables/medistat/medistat2.md3", 0, 0, 0 },
- { -65, -65, -7 }, //vec3_t mins;
- { 65, 65, 7 }, //vec3_t maxs;
- TR_GRAVITY, //trType_t traj;
- 0.0, //float bounce;
- ADVMEDISTAT_BP, //int buildPoints;
- ( 1 << S3 ), //int stages
- ADVMEDISTAT_HEALTH, //int health;
- 0, //int regenRate;
- ADVMEDISTAT_SPLASHDAMAGE, //int splashDamage;
- ADVMEDISTAT_SPLASHRADIUS, //int splashRadius;
- MOD_HSPAWN, //int meansOfDeath;
- BIT_HUMANS, //int team;
- ( 1 << WP_HBUILD2 ), //weapon_t buildWeapon;
- BANIM_IDLE1, //int idleAnim;
- 100, //int nextthink;
- qfalse, //qboolean usable;
- 0, //int turretRange;
- 0, //int turretFireSpeed;
- WP_NONE, //weapon_t turretProjType;
- 0.907f, //float minNormal;
- qfalse, //qboolean invertNormal;
- qfalse, //qboolean creepTest;
- 0, //int creepSize;
- qtrue, //qboolean dccTest;
- qfalse //qboolean reactorTest;
- },
- {
BA_H_MGTURRET, //int buildNum;
"mgturret", //char *buildName;
"Machinegun Turret", //char *humanName;
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 7db8669d..d86f01f1 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -394,7 +394,6 @@ typedef enum
BA_A_BOOSTER,
BA_A_HOVEL,
- BA_A_OBANK,
BA_H_SPAWN,
@@ -404,7 +403,6 @@ typedef enum
BA_H_ARMOURY,
BA_H_DCC,
BA_H_MEDISTAT,
- BA_H_ADVMEDISTAT,
BA_H_BANK,
BA_H_REACTOR,
@@ -554,6 +552,7 @@ typedef enum
MN_A_HOVEL_BLOCKED,
MN_A_OBANK,
MN_A_NOFUNDS,
+ MN_A_NOEROOM,
MN_H_SPAWN,
MN_H_BUILD,
diff --git a/src/game/g_active.c b/src/game/g_active.c
index 3f81dcfb..f5470e43 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -1152,6 +1152,15 @@ void ClientThink_real( gentity_t *ent )
break;
}
}
+
+ if( i == num && client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
+ {
+ if( client->ps.persistant[ PERS_CREDIT ] > 0 )
+ {
+ //no nearby objects and alien - show class menu
+ G_AddPredictableEvent( ent, EV_MENU, MN_A_INFEST );
+ }
+ }
}
}
}
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 2881982b..f83faefe 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -815,28 +815,6 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
-//==================================================================================
-
-
-
-
-/*
-================
-ABank_Activate
-
-Called when an alien activates an organ bank
-================
-*/
-void ABank_Activate( gentity_t *self, gentity_t *other, gentity_t *activator )
-{
- //only aliens can activate this
- if( activator->client->ps.stats[ STAT_PTEAM ] != PTE_ALIENS ) return;
-
- G_AddPredictableEvent( activator, EV_MENU, MN_A_OBANK );
-}
-
-
-
//==================================================================================
@@ -1233,19 +1211,7 @@ void HMedistat_Think( gentity_t *self )
return;
}
- if( self->s.modelindex == BA_H_ADVMEDISTAT )
- {
- maxclients = MAX_ADVMEDISTAT_CLIENTS;
-
- //the advanced medistat requires a DCC
- if( !( self->dcced = findDCC( self ) ) )
- {
- self->nextthink = level.time + REFRESH_TIME;
- return;
- }
- }
- else
- maxclients = MAX_MEDISTAT_CLIENTS;
+ maxclients = MAX_MEDISTAT_CLIENTS;
VectorAdd( self->s.origin, self->r.maxs, maxs );
VectorAdd( self->s.origin, self->r.mins, mins );
@@ -1973,12 +1939,6 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin
built->pain = ASpawn_Pain;
break;
- case BA_A_OBANK:
- built->think = ABarricade_Think;
- built->die = ASpawn_Die;
- built->use = ABank_Activate;
- break;
-
case BA_H_SPAWN:
built->die = HSpawn_Die;
built->think = HSpawn_Think;
@@ -2012,11 +1972,6 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin
built->die = HSpawn_Die;
break;
- case BA_H_ADVMEDISTAT:
- built->think = HMedistat_Think;
- built->die = HSpawn_Die;
- break;
-
case BA_H_REACTOR:
built->die = HSpawn_Die;
built->use = HRpt_Use;
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 0dfcbebe..65bc992c 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -626,44 +626,6 @@ void BodyFree( gentity_t *ent )
/*
-================
-useBody
-
-Called when a body is used
-================
-*/
-void useBody( gentity_t *self, gentity_t *other, gentity_t *activator )
-{
- int i, class, clientNum;
- int total = 0;
- float numerator, denominator;
- vec3_t up = { 0.0, 0.0, 1.0 };
-
- if( activator->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
- {
- //can't pick teammates bodies to bits
- if( !Q_stricmp( self->classname, "alienCorpse" ) )
- return;
-
- //can't use bodies that are not owned
- if( self->killedBy > 0 && self->killedBy != activator->client->ps.clientNum )
- return;
-
- //check the client /can/ upgrade to another class
- for( i = PCL_NONE + 1; i < PCL_NUM_CLASSES; i++ )
- {
- if( BG_ClassCanEvolveFromTo( activator->client->ps.stats[ STAT_PCLASS ],
- i, activator->client->ps.persistant[ PERS_CREDIT ], 0 ) &&
- BG_FindStagesForClass( i, g_alienStage.integer ) )
- break;
- }
-
- if( i < PCL_NUM_CLASSES )
- G_AddPredictableEvent( activator, EV_MENU, MN_A_INFEST );
- }
-}
-
-/*
=============
SpawnCorpse
@@ -702,39 +664,14 @@ void SpawnCorpse( gentity_t *ent )
body->nonSegModel = ent->client->ps.persistant[ PERS_STATE ] & PS_NONSEGMODEL;
if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
- {
- gentity_t *buildable = &g_entities[ ent->client->lasthurt_client ];
-
body->classname = "humanCorpse";
-
- if( ent->client->lasthurt_client < MAX_CLIENTS )
- {
- //client suicide - body is freebie
- if( ent->client->ps.clientNum == ent->client->lasthurt_client )
- body->killedBy = -1;
- else //owned by killer
- body->killedBy = ent->client->lasthurt_client;
- }
- else if( buildable && buildable->s.eType == ET_BUILDABLE ) //owned by builder
- body->killedBy = buildable->builtBy;
- else // *shrugs* probably killed by some map entity - freebie
- body->killedBy = -1;
-
- body->s.powerups = body->killedBy;
-
- //the body becomes free in a minute
- body->think = BodyFree;
- body->use = useBody;
- body->nextthink = level.time + 60000;
- }
else
- {
body->classname = "alienCorpse";
- body->s.powerups = MAX_CLIENTS;
- body->think = BodySink;
- body->nextthink = level.time + 60000;
- }
+ body->s.powerups = MAX_CLIENTS;
+
+ body->think = BodySink;
+ body->nextthink = level.time + 60000;
body->s.legsAnim = ent->s.legsAnim;
@@ -1321,8 +1258,6 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn )
int ammo, clips, maxClips;
weapon_t weapon;
float hModifier;
- trace_t tr;
- vec3_t avgNormal, nudgeOrigin;
index = ent - g_entities;
@@ -1359,53 +1294,11 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn )
//this is an infest spawn
if( spawn )
{
+ vec3_t prevMins, prevMaxs;
+
//spawn as new alien
VectorCopy( spawn->s.pos.trBase, spawn_origin );
- VectorCopy( spawn->s.angles, spawn_angles );
-
- BG_FindBBoxForClass( ent->client->pers.pclass, classMins, classMaxs, NULL, NULL, NULL );
-
- spawn_origin[ 2 ] += fabs( classMins[ 2 ] ) + 1;
-
- trap_Trace( &tr, spawn_origin, classMins, classMaxs, spawn_origin, ent->s.number, MASK_SHOT );
-
-#define MAX_NUDGES 20
-#define NUDGE_SIZE 10.f
-
- VectorClear( avgNormal );
- VectorCopy( spawn_origin, nudgeOrigin );
-
- //if the spawn is blocked nudge it away from whatever is blocking it
- for( i = 0; i < MAX_NUDGES && tr.fraction < 1.0f; i++ )
- {
- VectorMA( nudgeOrigin, NUDGE_SIZE, tr.plane.normal, nudgeOrigin );
- VectorAdd( avgNormal, tr.plane.normal, avgNormal );
-
- trap_Trace( &tr, nudgeOrigin, classMins, classMaxs, nudgeOrigin, ent->s.number, MASK_SHOT );
- }
-
- if( i = MAX_NUDGES )
- {
- VectorNormalize( avgNormal );
- VectorCopy( spawn_origin, nudgeOrigin );
-
- for( i = 0; i < MAX_NUDGES && tr.fraction < 1.0f; i++ )
- {
- VectorMA( nudgeOrigin, NUDGE_SIZE, avgNormal, nudgeOrigin );
-
- trap_Trace( &tr, nudgeOrigin, classMins, classMaxs, nudgeOrigin, ent->s.number, MASK_SHOT );
- }
-
- if( i != MAX_NUDGES )
- VectorCopy( nudgeOrigin, spawn_origin );
- //else
- //use original position and hope PM sorts it out
- }
- else
- VectorCopy( nudgeOrigin, spawn_origin );
-
- G_AddEvent( spawn, EV_GIB_ALIEN, DirToByte( up ) );
- spawn->freeAfterEvent = qtrue;
+ VectorCopy( spawn->s.apos.trBase, spawn_angles );
spawnPoint = spawn;
}
@@ -1546,7 +1439,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn )
if( client->sess.sessionTeam != TEAM_SPECTATOR &&
client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
{
- if( spawnPoint->s.origin2[ 2 ] > 0.0f )
+ if( !spawn && spawnPoint->s.origin2[ 2 ] > 0.0f )
{
vec3_t forward, dir;
@@ -1557,6 +1450,8 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn )
VectorScale( dir, UP_VEL, client->ps.velocity );
}
+ else
+ G_AddPredictableEvent( ent, EV_GIB_ALIEN, DirToByte( up ) );
}
// the respawned flag will be cleared after the attack and jump keys come up
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 2a99fb53..47163acc 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -963,99 +963,70 @@ void Cmd_Class_f( gentity_t *ent )
int allowedClasses[ NUM_AC ] = { PCL_A_B_BASE,
PCL_A_O_BASE };
int numLevels;
+ vec3_t fromMins, fromMaxs, toMins, toMaxs;
clientNum = ent->client - level.clients;
trap_Argv( 1, s, sizeof( s ) );
if( ent->client->pers.pteam == PTE_ALIENS &&
!( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) &&
- !( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) )
+ !( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) &&
+ !( ent->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBING ) &&
+ !( ent->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) )
{
//if we are not currently spectating, we are attempting evolution
if( ent->client->ps.stats[ STAT_PCLASS ] != PCL_NONE )
{
- for ( i = 1, body = g_entities + i; i < level.num_entities; i++, body++ )
+ //evolve now
+ ent->client->pers.pclass = BG_FindClassNumForName( s );
+
+ if( ent->client->pers.pclass == PCL_NONE )
{
- if( !Q_stricmp( body->classname, "humanCorpse" ) )
- {
- VectorSubtract( ent->s.pos.trBase, body->s.origin, distance );
- if( VectorLength( distance ) <= length )
- {
- length = VectorLength( distance );
- victim = body;
- }
- }
+ trap_SendServerCommand( ent-g_entities, va( "print \"Unknown class\n\"" ) );
+ return;
}
- //if a human corpse is nearby...
- if( length <= 200 )
+ numLevels = BG_ClassCanEvolveFromTo( ent->client->ps.stats[ STAT_PCLASS ], ent->client->pers.pclass,
+ (short)ent->client->ps.persistant[ PERS_CREDIT ], 0 );
+
+ BG_FindBBoxForClass( ent->client->ps.stats[ STAT_PCLASS ],
+ fromMins, fromMaxs, NULL, NULL, NULL );
+ BG_FindBBoxForClass( ent->client->pers.pclass,
+ toMins, toMaxs, NULL, NULL, NULL );
+
+ VectorCopy( ent->s.pos.trBase, infestOrigin );
+
+ infestOrigin[ 2 ] += ( fabs( toMins[ 2 ] ) - fabs( fromMins[ 2 ] ) ) + 1;
+
+ trap_Trace( &tr, infestOrigin, toMins, toMaxs, infestOrigin, ent->s.number, MASK_SHOT );
+
+ //check there is room to evolve
+ if( tr.fraction == 1.0f )
{
- if( !Q_stricmp( s, "store" ) )
+ //...check we can evolve to that class
+ if( numLevels && BG_FindStagesForClass( ent->client->pers.pclass, g_alienStage.integer ) )
{
- //increment credits
- ent->client->ps.persistant[ PERS_CREDIT ]++;
-
- //destroy body
- G_AddEvent( victim, EV_GIB_ALIEN, DirToByte( up ) );
- victim->freeAfterEvent = qtrue;
+ //remove credit
+ ent->client->ps.persistant[ PERS_CREDIT ] -= (short)( numLevels - 1 );
+
+ ClientUserinfoChanged( clientNum );
+ VectorCopy( infestOrigin, ent->s.pos.trBase );
+ ClientSpawn( ent, ent );
+ return;
}
else
{
- //evolve now
- ent->client->pers.pclass = BG_FindClassNumForName( s );
-
- if( ent->client->pers.pclass == PCL_NONE )
- {
- trap_SendServerCommand( ent-g_entities, va( "print \"Unknown class\n\"" ) );
- return;
- }
-
- numLevels = BG_ClassCanEvolveFromTo( ent->client->ps.stats[ STAT_PCLASS ], ent->client->pers.pclass,
- (short)ent->client->ps.persistant[ PERS_CREDIT ], 0 );
-
- //...check we can evolve to that class
- if( numLevels && BG_FindStagesForClass( ent->client->pers.pclass, g_alienStage.integer ) )
- {
- //remove credit
- ent->client->ps.persistant[ PERS_CREDIT ] -= (short)( numLevels - 1 );
-
- //prevent lerping
- ent->client->ps.eFlags ^= EF_TELEPORT_BIT;
-
- //evolve
- ent->client->ps.stats[ STAT_PCLASS ] = PCL_NONE;
- ent->client->sess.sessionTeam = TEAM_FREE;
- ClientUserinfoChanged( clientNum );
- ent->client->ps.stats[ STAT_STATE ] |= SS_INFESTING;
- ent->client->lastInfestTime = level.time;
- ent->client->infestBody = victim;
-
- VectorCopy( victim->s.pos.trBase, infestOrigin );
- infestOrigin[ 2 ] += 128.0f;
- trap_Trace( &tr, victim->s.pos.trBase, ent->r.mins, ent->r.maxs,
- infestOrigin, ent->s.number, MASK_SHOT );
- VectorCopy( tr.endpos, infestOrigin );
- infestOrigin[ 2 ] -= 16.0f;
-
- VectorCopy( victim->s.angles, infestAngles );
-
- infestAngles[ PITCH ] = 90;
-
- G_SetOrigin( ent, infestOrigin );
- VectorCopy( infestOrigin, ent->client->ps.origin );
- SetClientViewAngle( ent, infestAngles );
-
- //so no one can claim this body as of now
- victim->killedBy = victim->s.powerups = MAX_CLIENTS;
- }
- else
- {
- ent->client->pers.pclass = PCL_NONE;
- trap_SendServerCommand( ent-g_entities, va( "print \"You cannot evolve from your current class\n\"" ) );
- return;
- }
+ ent->client->pers.pclass = PCL_NONE;
+ trap_SendServerCommand( ent-g_entities, va( "print \"You cannot evolve from your current class\n\"" ) );
+ return;
}
}
+ else
+ {
+ ent->client->pers.pclass = PCL_NONE;
+ G_AddPredictableEvent( ent, EV_MENU, MN_A_NOEROOM );
+ return;
+ }
}
else
{
@@ -1608,42 +1579,8 @@ void Cmd_Deposit_f( gentity_t *ent )
else
G_AddPredictableEvent( ent, EV_MENU, MN_H_NOFUNDS );
}
- else if( ent->client->pers.pteam == PTE_ALIENS )
- {
- for ( i = 1, bankEntity = g_entities + i; i < level.num_entities; i++, bankEntity++ )
- {
- if( bankEntity->s.eType != ET_BUILDABLE )
- continue;
-
- if( bankEntity->s.modelindex == BA_A_OBANK )
- {
- VectorSubtract( ent->s.pos.trBase, bankEntity->s.origin, distance );
- if( VectorLength( distance ) <= 100 )
- nearBank = qtrue;
- }
- }
-
- if( !Q_stricmp( s, "all" ) )
- amount = (short)ent->client->ps.persistant[ PERS_CREDIT ];
- else
- amount = atoi( s );
-
- //no Bank nearby
- if( !nearBank )
- {
- trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an Bank\n\"" ) );
- return;
- }
-
- if( amount <= (short)ent->client->ps.persistant[ PERS_CREDIT ] )
- {
- ent->client->ps.persistant[ PERS_CREDIT ] -= (short)amount;
- ent->client->ps.persistant[ PERS_BANK ] += amount;
- level.bankCredits[ ent->client->ps.clientNum ] += amount;
- }
- else
- G_AddPredictableEvent( ent, EV_MENU, MN_A_NOFUNDS );
- }
+ else
+ trap_SendServerCommand( ent-g_entities, va( "print \"Aliens have no bank\n\"" ) );
}
@@ -1704,42 +1641,8 @@ void Cmd_Withdraw_f( gentity_t *ent )
else
G_AddPredictableEvent( ent, EV_MENU, MN_H_NOFUNDS );
}
- else if( ent->client->pers.pteam == PTE_ALIENS )
- {
- for ( i = 1, bankEntity = g_entities + i; i < level.num_entities; i++, bankEntity++ )
- {
- if( bankEntity->s.eType != ET_BUILDABLE )
- continue;
-
- if( bankEntity->s.modelindex == BA_A_OBANK )
- {
- VectorSubtract( ent->s.pos.trBase, bankEntity->s.origin, distance );
- if( VectorLength( distance ) <= 100 )
- nearBank = qtrue;
- }
- }
-
- if( !Q_stricmp( s, "all" ) )
- amount = level.bankCredits[ ent->client->ps.clientNum ];
- else
- amount = atoi( s );
-
- //no Bank nearby
- if( !nearBank )
- {
- trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an Bank\n\"" ) );
- return;
- }
-
- if( amount <= level.bankCredits[ ent->client->ps.clientNum ] )
- {
- ent->client->ps.persistant[ PERS_CREDIT ] += (short)amount;
- ent->client->ps.persistant[ PERS_BANK ] -= amount;
- level.bankCredits[ ent->client->ps.clientNum ] -= amount;
- }
- else
- G_AddPredictableEvent( ent, EV_MENU, MN_A_NOFUNDS );
- }
+ else
+ trap_SendServerCommand( ent-g_entities, va( "print \"Aliens have no bank\n\"" ) );
}
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 17ef67e8..96c9c55a 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -230,7 +230,9 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
AddScore( self, -1 );
}
- if( attacker && attacker->client && self->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
+ if( attacker && attacker->client &&
+ attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS &&
+ self->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
{
int clientNum = attacker->client->ps.clientNum;
float denominator, numerator = self->credits[ clientNum ];
@@ -244,7 +246,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
denominator = total;
- //if this corpse has been 100% claimed destroy it
for( i = 0; i < MAX_CLIENTS; i++ )
{
player = g_entities + i;
@@ -258,6 +259,12 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
}
}
}
+ else if( attacker && attacker->client &&
+ attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS &&
+ self->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
+ {
+ attacker->client->ps.persistant[ PERS_CREDIT ]++;
+ }
// Add team bonuses
//Team_FragBonuses(self, inflictor, attacker);
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index 7f98afe6..f97e865c 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -135,30 +135,30 @@
#define HYDRA_TTE 3000
#define HYDRA_VALUE 200
#define HYDRA_HEALTH AHM(100)
-#define HYDRA_REGEN 5
+#define HYDRA_REGEN 4
#define HYDRA_UPG_SPEED 1.25f
#define HYDRA_UPG_TTE 3000
#define HYDRA_UPG_VALUE AVM(240)
#define HYDRA_UPG_HEALTH AHM(120)
-#define HYDRA_UPG_REGEN 6
+#define HYDRA_UPG_REGEN 5
#define CHIMERA_SPEED 1.2f
#define CHIMERA_TTE 3000
#define CHIMERA_VALUE AVM(300)
#define CHIMERA_HEALTH AHM(200)
-#define CHIMERA_REGEN 7
+#define CHIMERA_REGEN 6
#define CHIMERA_UPG_SPEED 1.2f
#define CHIMERA_UPG_TTE 3000
#define CHIMERA_UPG_VALUE AVM(360)
#define CHIMERA_UPG_HEALTH AHM(250)
-#define CHIMERA_UPG_REGEN 10
+#define CHIMERA_UPG_REGEN 7
#define BMOFO_SPEED 1.1f
#define BMOFO_VALUE AVM(400)
#define BMOFO_HEALTH AHM(400)
-#define BMOFO_REGEN 15
+#define BMOFO_REGEN 9
@@ -175,21 +175,21 @@
*
*/
-#define ALIEN_BHLTH_MODIFIER 1.0f
+#define ALIEN_BHLTH_MODIFIER 1.5f
#define ABHM(h) ((int)((float)h*ALIEN_BHLTH_MODIFIER))
#define CREEP_BASESIZE 700
#define ASPAWN_BP 100
#define ASPAWN_HEALTH ABHM(500)
-#define ASPAWN_REGEN 25
+#define ASPAWN_REGEN 10
#define ASPAWN_SPLASHDAMAGE 50
#define ASPAWN_SPLASHRADIUS 50
#define ASPAWN_CREEPSIZE 120
#define BARRICADE_BP 80
#define BARRICADE_HEALTH ABHM(250)
-#define BARRICADE_REGEN 50
+#define BARRICADE_REGEN 15
#define BARRICADE_SPLASHDAMAGE 50
#define BARRICADE_SPLASHRADIUS 50
#define BARRICADE_CREEPSIZE 120
@@ -205,7 +205,7 @@
#define ACIDTUBE_BP 50
#define ACIDTUBE_HEALTH ABHM(100)
#define ACIDTUBE_REGEN 10
-#define ACIDTUBE_SPLASHDAMAGE 50
+#define ACIDTUBE_SPLASHDAMAGE 30
#define ACIDTUBE_SPLASHRADIUS 200
#define ACIDTUBE_CREEPSIZE 120
#define ACIDTUBE_RANGE 200.0f
@@ -214,7 +214,7 @@
#define TRAPPER_BP 150
#define TRAPPER_HEALTH ABHM(80)
#define TRAPPER_REGEN 8
-#define TRAPPER_SPLASHDAMAGE 20
+#define TRAPPER_SPLASHDAMAGE 15
#define TRAPPER_SPLASHRADIUS 100
#define TRAPPER_CREEPSIZE 30
#define TRAPPER_RANGE 400
@@ -224,7 +224,7 @@
#define OVERMIND_BP 0
#define OVERMIND_HEALTH ABHM(1000)
-#define OVERMIND_REGEN 50
+#define OVERMIND_REGEN 15
#define OVERMIND_SPLASHDAMAGE 100
#define OVERMIND_SPLASHRADIUS 300
#define OVERMIND_CREEPSIZE 120
@@ -233,7 +233,7 @@
#define HOVEL_BP 80
#define HOVEL_HEALTH ABHM(750)
-#define HOVEL_REGEN 150
+#define HOVEL_REGEN 20
#define HOVEL_SPLASHDAMAGE 20
#define HOVEL_SPLASHRADIUS 200
#define HOVEL_CREEPSIZE 120
@@ -271,7 +271,7 @@
*
*/
-#define HUMAN_WDMG_MODIFIER 1.0f
+#define HUMAN_WDMG_MODIFIER 2.0f
#define HDM(d) ((int)((float)d*HUMAN_WDMG_MODIFIER))
#define RIFLE_CLIPSIZE 30
@@ -407,12 +407,6 @@
#define MEDISTAT_SPLASHRADIUS 100
#define MAX_MEDISTAT_CLIENTS 1
-#define ADVMEDISTAT_BP 120
-#define ADVMEDISTAT_HEALTH HBHM(300)
-#define ADVMEDISTAT_SPLASHDAMAGE 75
-#define ADVMEDISTAT_SPLASHRADIUS 100
-#define MAX_ADVMEDISTAT_CLIENTS 3
-
#define MGTURRET_BP 80
#define MGTURRET_HEALTH HBHM(100)
#define MGTURRET_SPLASHDAMAGE 50
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c
index c23867d1..a48b78bc 100644
--- a/src/ui/ui_main.c
+++ b/src/ui/ui_main.c
@@ -3324,56 +3324,6 @@ static void UI_LoadTremHumanItems( )
/*
===============
-UI_LoadTremHumanArmouryBuys
-===============
-*/
-static void UI_LoadTremHumanArmouryBuys( )
-{
- int i, j = 0;
- stage_t stage = UI_GetCurrentHumanStage( );
-
- uiInfo.tremHumanArmouryBuyCount = 0;
-
- for( i = WP_NONE +1; i < WP_NUM_WEAPONS; i++ )
- {
- if( BG_FindTeamForWeapon( i ) == WUT_HUMANS &&
- BG_FindPurchasableForWeapon( i ) &&
- BG_FindStagesForWeapon( i, stage ) )
- {
- uiInfo.tremHumanArmouryBuyList[ j ].text =
- String_Alloc( BG_FindHumanNameForWeapon( i ) );
- uiInfo.tremHumanArmouryBuyList[ j ].cmd =
- String_Alloc( va( "cmd buy %s", BG_FindNameForWeapon( i ) ) );
- uiInfo.tremHumanArmouryBuyList[ j ].infopane =
- UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( i ) ) );
-
- j++;
-
- uiInfo.tremHumanArmouryBuyCount++;
- }
- }
-
- for( i = UP_NONE +1; i < UP_NUM_UPGRADES; i++ )
- {
- if( BG_FindTeamForUpgrade( i ) == WUT_HUMANS &&
- BG_FindStagesForUpgrade( i, stage ) )
- {
- uiInfo.tremHumanArmouryBuyList[ j ].text =
- String_Alloc( BG_FindHumanNameForUpgrade( i ) );
- uiInfo.tremHumanArmouryBuyList[ j ].cmd =
- String_Alloc( va( "cmd buy %s", BG_FindNameForUpgrade( i ) ) );
- uiInfo.tremHumanArmouryBuyList[ j ].infopane =
- UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForUpgrade( i ) ) );
-
- j++;
-
- uiInfo.tremHumanArmouryBuyCount++;
- }
- }
-}
-
-/*
-===============
UI_ParseCarriageList
===============
*/
@@ -3434,6 +3384,74 @@ static void UI_ParseCarriageList( int *weapons, int *upgrades )
/*
===============
+UI_LoadTremHumanArmouryBuys
+===============
+*/
+static void UI_LoadTremHumanArmouryBuys( )
+{
+ int i, j = 0;
+ stage_t stage = UI_GetCurrentHumanStage( );
+ int weapons, upgrades;
+ int slots = 0;
+
+ UI_ParseCarriageList( &weapons, &upgrades );
+
+ for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ )
+ {
+ if( weapons & ( 1 << i ) )
+ slots |= BG_FindSlotsForWeapon( i );
+ }
+
+ for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ )
+ {
+ if( upgrades & ( 1 << i ) )
+ slots |= BG_FindSlotsForUpgrade( i );
+ }
+
+ uiInfo.tremHumanArmouryBuyCount = 0;
+
+ for( i = WP_NONE +1; i < WP_NUM_WEAPONS; i++ )
+ {
+ if( BG_FindTeamForWeapon( i ) == WUT_HUMANS &&
+ BG_FindPurchasableForWeapon( i ) &&
+ BG_FindStagesForWeapon( i, stage ) &&
+ !( BG_FindSlotsForWeapon( i ) & slots ) )
+ {
+ uiInfo.tremHumanArmouryBuyList[ j ].text =
+ String_Alloc( BG_FindHumanNameForWeapon( i ) );
+ uiInfo.tremHumanArmouryBuyList[ j ].cmd =
+ String_Alloc( va( "cmd buy %s", BG_FindNameForWeapon( i ) ) );
+ uiInfo.tremHumanArmouryBuyList[ j ].infopane =
+ UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( i ) ) );
+
+ j++;
+
+ uiInfo.tremHumanArmouryBuyCount++;
+ }
+ }
+
+ for( i = UP_NONE +1; i < UP_NUM_UPGRADES; i++ )
+ {
+ if( BG_FindTeamForUpgrade( i ) == WUT_HUMANS &&
+ BG_FindStagesForUpgrade( i, stage ) &&
+ !( BG_FindSlotsForUpgrade( i ) & slots ) )
+ {
+ uiInfo.tremHumanArmouryBuyList[ j ].text =
+ String_Alloc( BG_FindHumanNameForUpgrade( i ) );
+ uiInfo.tremHumanArmouryBuyList[ j ].cmd =
+ String_Alloc( va( "cmd buy %s", BG_FindNameForUpgrade( i ) ) );
+ uiInfo.tremHumanArmouryBuyList[ j ].infopane =
+ UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForUpgrade( i ) ) );
+
+ j++;
+
+ uiInfo.tremHumanArmouryBuyCount++;
+ }
+ }
+}
+
+/*
+===============
UI_LoadTremHumanArmourySells
===============
*/
@@ -3511,11 +3529,6 @@ static void UI_LoadTremAlienUpgrades( )
uiInfo.tremAlienUpgradeCount++;
}
}
-
- uiInfo.tremAlienUpgradeList[ j ].text = String_Alloc( "Store" );
- uiInfo.tremAlienUpgradeList[ j ].cmd = String_Alloc( "cmd class store" );
- uiInfo.tremAlienUpgradeList[ j++ ].infopane = UI_FindInfoPaneByName( "storeclass" );
- uiInfo.tremAlienUpgradeCount++;
}
/*