summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_pmove.c4
-rw-r--r--src/game/g_local.h3
-rw-r--r--src/game/g_main.c31
-rw-r--r--src/game/g_misc.c2
-rw-r--r--src/game/g_spawn.c12
-rw-r--r--src/game/g_weapon.c7
-rw-r--r--src/game/tremulous.h6
7 files changed, 50 insertions, 15 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 446da8c0..feac25b1 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -2782,6 +2782,10 @@ static void PM_Weapon( void )
{
PM_AddEvent( EV_NOAMMO );
pm->ps->weaponTime += 200;
+
+ if( pm->ps->weaponstate == WEAPON_FIRING )
+ pm->ps->weaponstate = WEAPON_READY;
+
return;
}
diff --git a/src/game/g_local.h b/src/game/g_local.h
index bf2e3825..c897072d 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -809,6 +809,7 @@ typedef struct zap_s
int numTargets;
int timeToLive;
+ int damageUsed;
gentity_t *effectChannel;
} zap_t;
@@ -1075,6 +1076,8 @@ extern vmCvar_t g_currentMapRotation;
extern vmCvar_t g_currentMap;
extern vmCvar_t g_initialMapRotation;
+extern vmCvar_t g_mapConfigs;
+
void trap_Printf( const char *fmt );
void trap_Error( const char *fmt );
int trap_Milliseconds( void );
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 876d75a6..81675089 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -110,6 +110,8 @@ vmCvar_t g_currentMapRotation;
vmCvar_t g_currentMap;
vmCvar_t g_initialMapRotation;
+vmCvar_t g_mapConfigs;
+
static cvarTable_t gameCvarTable[ ] =
{
// don't override the cheat state set by the system
@@ -181,18 +183,18 @@ static cvarTable_t gameCvarTable[ ] =
{ &pmove_fixed, "pmove_fixed", "0", CVAR_SYSTEMINFO, 0, qfalse},
{ &pmove_msec, "pmove_msec", "8", CVAR_SYSTEMINFO, 0, qfalse},
- { &g_humanBuildPoints, "g_humanBuildPoints", "100", 0, 0, qfalse },
- { &g_alienBuildPoints, "g_alienBuildPoints", "100", 0, 0, qfalse },
+ { &g_humanBuildPoints, "g_humanBuildPoints", DEFAULT_HUMAN_BUILDPOINTS, 0, 0, qfalse },
+ { &g_alienBuildPoints, "g_alienBuildPoints", DEFAULT_ALIEN_BUILDPOINTS, 0, 0, qfalse },
{ &g_humanStage, "g_humanStage", "0", 0, 0, qfalse },
{ &g_humanKills, "g_humanKills", "0", 0, 0, qfalse },
- { &g_humanMaxStage, "g_humanMaxStage", "2", 0, 0, qfalse },
- { &g_humanStage2Threshold, "g_humanStage2Threshold", "20", 0, 0, qfalse },
- { &g_humanStage3Threshold, "g_humanStage3Threshold", "40", 0, 0, qfalse },
+ { &g_humanMaxStage, "g_humanMaxStage", DEFAULT_HUMAN_MAX_STAGE, 0, 0, qfalse },
+ { &g_humanStage2Threshold, "g_humanStage2Threshold", DEFAULT_HUMAN_STAGE2_THRESH, 0, 0, qfalse },
+ { &g_humanStage3Threshold, "g_humanStage3Threshold", DEFAULT_HUMAN_STAGE3_THRESH, 0, 0, qfalse },
{ &g_alienStage, "g_alienStage", "0", 0, 0, qfalse },
{ &g_alienKills, "g_alienKills", "0", 0, 0, qfalse },
- { &g_alienMaxStage, "g_alienMaxStage", "2", 0, 0, qfalse },
- { &g_alienStage2Threshold, "g_alienStage2Threshold", "20", 0, 0, qfalse },
- { &g_alienStage3Threshold, "g_alienStage3Threshold", "40", 0, 0, qfalse },
+ { &g_alienMaxStage, "g_alienMaxStage", DEFAULT_ALIEN_MAX_STAGE, 0, 0, qfalse },
+ { &g_alienStage2Threshold, "g_alienStage2Threshold", DEFAULT_ALIEN_STAGE2_THRESH, 0, 0, qfalse },
+ { &g_alienStage3Threshold, "g_alienStage3Threshold", DEFAULT_ALIEN_STAGE3_THRESH, 0, 0, qfalse },
{ &g_disabledEquipment, "g_disabledEquipment", "", CVAR_ROM, 0, qfalse },
{ &g_disabledClasses, "g_disabledClasses", "", CVAR_ROM, 0, qfalse },
@@ -202,6 +204,7 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_currentMapRotation, "g_currentMapRotation", "-1", 0, 0, qfalse }, // -1 = NOT_ROTATING
{ &g_currentMap, "g_currentMap", "0", 0, 0, qfalse },
{ &g_initialMapRotation, "g_initialMapRotation", "", CVAR_ARCHIVE, 0, qfalse },
+ { &g_mapConfigs, "g_mapConfigs", "", CVAR_ARCHIVE, 0, qfalse },
{ &g_rankings, "g_rankings", "0", 0, 0, qfalse}
};
@@ -488,6 +491,18 @@ void G_InitGame( int levelTime, int randomSeed, int restart )
else
G_Printf( "Not logging to disk\n" );
+ if( g_mapConfigs.string[0] )
+ {
+ char map[MAX_QPATH] = {""};
+
+ trap_SendConsoleCommand( EXEC_APPEND,
+ va( "exec \"%s/default.cfg\"\n", g_mapConfigs.string ) );
+
+ trap_Cvar_VariableStringBuffer( "mapname", map, sizeof( map ) );
+ trap_SendConsoleCommand( EXEC_APPEND,
+ va( "exec \"%s/%s.cfg\"\n", g_mapConfigs.string, map ) );
+ }
+
// initialize all entities for this game
memset( g_entities, 0, MAX_GENTITIES * sizeof( g_entities[ 0 ] ) );
level.gentities = g_entities;
diff --git a/src/game/g_misc.c b/src/game/g_misc.c
index d7728c89..2cd2dd05 100644
--- a/src/game/g_misc.c
+++ b/src/game/g_misc.c
@@ -146,7 +146,7 @@ void locateCamera( gentity_t *ent )
owner = G_PickTarget( ent->target );
if( !owner )
{
- G_Printf( "Couldn't find target for misc_partal_surface\n" );
+ G_Printf( "Couldn't find target for misc_portal_surface\n" );
G_FreeEntity( ent );
return;
}
diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c
index 4c515d83..3e0e1812 100644
--- a/src/game/g_spawn.c
+++ b/src/game/g_spawn.c
@@ -619,25 +619,25 @@ void SP_worldspawn( void )
G_SpawnString( "humanBuildPoints", DEFAULT_HUMAN_BUILDPOINTS, &s );
trap_Cvar_Set( "g_humanBuildPoints", s );
- G_SpawnString( "humanMaxStage", "2", &s );
+ G_SpawnString( "humanMaxStage", DEFAULT_HUMAN_MAX_STAGE, &s );
trap_Cvar_Set( "g_humanMaxStage", s );
- G_SpawnString( "humanStage2Threshold", g_humanStage2Threshold.string, &s );
+ G_SpawnString( "humanStage2Threshold", DEFAULT_HUMAN_STAGE2_THRESH, &s );
trap_Cvar_Set( "g_humanStage2Threshold", s );
- G_SpawnString( "humanStage3Threshold", g_humanStage3Threshold.string, &s );
+ G_SpawnString( "humanStage3Threshold", DEFAULT_HUMAN_STAGE3_THRESH, &s );
trap_Cvar_Set( "g_humanStage3Threshold", s );
G_SpawnString( "alienBuildPoints", DEFAULT_ALIEN_BUILDPOINTS, &s );
trap_Cvar_Set( "g_alienBuildPoints", s );
- G_SpawnString( "alienMaxStage", "2", &s );
+ G_SpawnString( "alienMaxStage", DEFAULT_ALIEN_MAX_STAGE, &s );
trap_Cvar_Set( "g_alienMaxStage", s );
- G_SpawnString( "alienStage2Threshold", g_alienStage2Threshold.string, &s );
+ G_SpawnString( "alienStage2Threshold", DEFAULT_ALIEN_STAGE2_THRESH, &s );
trap_Cvar_Set( "g_alienStage2Threshold", s );
- G_SpawnString( "alienStage3Threshold", g_alienStage3Threshold.string, &s );
+ G_SpawnString( "alienStage3Threshold", DEFAULT_ALIEN_STAGE3_THRESH, &s );
trap_Cvar_Set( "g_alienStage3Threshold", s );
G_SpawnString( "enableDust", "0", &s );
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index ed7dea10..15a6033b 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -1166,13 +1166,20 @@ void G_UpdateZaps( int msec )
damage = ceil( ( (float)msec / LEVEL2_AREAZAP_TIME ) *
LEVEL2_AREAZAP_DMG * damageFraction );
+ // don't let a high msec value inflate the total damage
+ if( damage + zap->damageUsed > LEVEL2_AREAZAP_DMG )
+ damage = LEVEL2_AREAZAP_DMG - zap->damageUsed;
+
VectorSubtract( target->s.origin, source->s.origin, forward );
VectorNormalize( forward );
//do the damage
if( damage )
+ {
G_Damage( target, source, zap->creator, forward, target->s.origin,
damage, DAMAGE_NO_KNOCKBACK | DAMAGE_NO_LOCDAMAGE, MOD_LEVEL2_ZAP );
+ zap->damageUsed += damage;
+ }
}
}
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index 6357981e..ee05ee70 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -578,7 +578,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define FREEKILL_HUMAN LEVEL0_VALUE
#define DEFAULT_ALIEN_BUILDPOINTS "100"
+#define DEFAULT_ALIEN_STAGE2_THRESH "20"
+#define DEFAULT_ALIEN_STAGE3_THRESH "40"
+#define DEFAULT_ALIEN_MAX_STAGE "2"
#define DEFAULT_HUMAN_BUILDPOINTS "100"
+#define DEFAULT_HUMAN_STAGE2_THRESH "20"
+#define DEFAULT_HUMAN_STAGE3_THRESH "40"
+#define DEFAULT_HUMAN_MAX_STAGE "2"
#define DAMAGE_FRACTION_FOR_KILL 0.5f //how much damage players (versus structures) need to
//do to increment the stage kill counters