summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-07-18 19:27:33 +0000
committerTim Angus <tim@ngus.net>2005-07-18 19:27:33 +0000
commit336d990c950bf26b001e7a6396a9bd1b484d5583 (patch)
tree43758b89de01089b3ae99bdba02db9e96dabe24d /src
parent35ee9b1554981454b1a402e3764044299c9d0661 (diff)
* Repeater is now free
* Repeater can now only be built in locations with no power * Repeater will self destruct if it has not powered anything for 90 seconds * Reduced period for free kills/credits * Mass driver damage reduced by 40% * Build timers increased a bit, especially human * The more healthy human buildables now take longer to repair
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_servercmds.c14
-rw-r--r--src/game/bg_public.h5
-rw-r--r--src/game/g_buildable.c48
-rw-r--r--src/game/g_cmds.c3
-rw-r--r--src/game/g_local.h3
-rw-r--r--src/game/g_weapon.c15
-rw-r--r--src/game/tremulous.h16
7 files changed, 85 insertions, 19 deletions
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c
index 7a9ed748..bec94eee 100644
--- a/src/cgame/cg_servercmds.c
+++ b/src/cgame/cg_servercmds.c
@@ -651,11 +651,11 @@ void CG_Menu( int menu )
}
break;
- case MN_H_RPLWARN:
+ case MN_H_TNODEWARN:
if( !cg_disableBuildWarnings.integer )
{
- trap_Cvar_Set( "ui_dialog", "WARNING: This replicator will not be powered. Build a reactor to "
- "prevent seeing this message again." );
+ trap_Cvar_Set( "ui_dialog", "WARNING: This telenode will not be powered. Build near a power "
+ "structure to prevent seeing this message again." );
trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );
}
break;
@@ -669,6 +669,14 @@ void CG_Menu( int menu )
}
break;
+ case MN_H_RPTWARN2:
+ if( !cg_disableBuildWarnings.integer )
+ {
+ trap_Cvar_Set( "ui_dialog", "This area already has power. A repeater is not required here." );
+ trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );
+ }
+ break;
+
case MN_H_NOSLOTS:
trap_Cvar_Set( "ui_dialog", "You have no room to carry this. Please sell any conflicting "
"upgrades before purchasing this item." );
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 97ca9d86..6bfb8a6b 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -612,8 +612,9 @@ typedef enum
MN_H_REACTOR,
MN_H_NOROOM,
MN_H_NORMAL,
- MN_H_RPLWARN,
- MN_H_RPTWARN
+ MN_H_TNODEWARN,
+ MN_H_RPTWARN,
+ MN_H_RPTWARN2
} dynMenu_t;
// animations
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index c2109aea..3d6e58a0 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -104,6 +104,30 @@ gentity_t *G_CheckSpawnPoint( vec3_t origin, vec3_t normal, buildable_t spawn, v
return NULL;
}
+/*
+================
+G_NumberOfDependants
+
+Return number of entities that depend on this one
+================
+*/
+static int G_NumberOfDependants( gentity_t *self )
+{
+ int i, n = 0;
+ gentity_t *ent;
+
+ for ( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ )
+ {
+ if( ent->s.eType != ET_BUILDABLE )
+ continue;
+
+ if( ent->parentNode == self )
+ n++;
+ }
+
+ return n;
+}
+
#define POWER_REFRESH_TIME 2000
/*
@@ -1453,6 +1477,17 @@ void HRpt_Think( gentity_t *self )
}
}
+ if( G_NumberOfDependants( self ) == 0 )
+ {
+ //if no dependants for x seconds then disappear
+ if( self->count < 0 )
+ self->count = level.time;
+ else if( self->count > 0 && ( ( level.time - self->count ) > REPEATER_INACTIVE_TIME ) )
+ G_Damage( self, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE );
+ }
+ else
+ self->count = -1;
+
self->powered = reactor;
self->nextthink = level.time + POWER_REFRESH_TIME;
@@ -2503,7 +2538,7 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance
//warn that the current spawn will not be externally powered
if( buildable == BA_H_SPAWN )
- reason = IBE_RPLWARN;
+ reason = IBE_TNODEWARN;
}
//this buildable requires a DCC
@@ -2524,6 +2559,8 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance
if( i >= level.num_entities )
reason = IBE_RPTWARN;
+ else if( G_isPower( entity_origin ) )
+ reason = IBE_RPTWARN2;
}
//check permission to build here
@@ -2685,6 +2722,7 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin
built->think = HRpt_Think;
built->die = HSpawn_Die;
built->use = HRpt_Use;
+ built->count = -1;
break;
default:
@@ -2833,8 +2871,8 @@ qboolean G_ValidateBuild( gentity_t *ent, buildable_t buildable )
G_buildItem( ent, buildable, origin, ent->s.apos.trBase );
return qtrue;
- case IBE_RPLWARN:
- G_TriggerMenu( ent->client->ps.clientNum, MN_H_RPLWARN );
+ case IBE_TNODEWARN:
+ G_TriggerMenu( ent->client->ps.clientNum, MN_H_TNODEWARN );
G_buildItem( ent, buildable, origin, ent->s.apos.trBase );
return qtrue;
@@ -2843,6 +2881,10 @@ qboolean G_ValidateBuild( gentity_t *ent, buildable_t buildable )
G_buildItem( ent, buildable, origin, ent->s.apos.trBase );
return qtrue;
+ case IBE_RPTWARN2:
+ G_TriggerMenu( ent->client->ps.clientNum, MN_H_RPTWARN2 );
+ return qfalse;
+
default:
break;
}
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 03dcb33e..3a0c2612 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1909,8 +1909,9 @@ void Cmd_Build_f( gentity_t *ent )
switch( G_itemFits( ent, buildable, dist, origin ) )
{
case IBE_NONE:
- case IBE_RPLWARN:
+ case IBE_TNODEWARN:
case IBE_RPTWARN:
+ case IBE_RPTWARN2:
case IBE_SPWNWARN:
case IBE_NOROOM:
case IBE_NORMAL:
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 8ab0a200..dd5c3abf 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -632,8 +632,9 @@ typedef enum
IBE_REACTOR,
IBE_REPEATER,
- IBE_RPLWARN,
+ IBE_TNODEWARN,
IBE_RPTWARN,
+ IBE_RPTWARN2,
IBE_NOPOWER,
IBE_NODCC,
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index 2e94ed7e..525bef97 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -611,7 +611,7 @@ void cancelBuildFire( gentity_t *ent )
bHealth = BG_FindHealthForBuildable( traceEnt->s.modelindex );
- traceEnt->health += ( bHealth / 10.0f );
+ traceEnt->health += HBUILD_HEALRATE;
if( traceEnt->health > bHealth )
traceEnt->health = bHealth;
@@ -659,6 +659,10 @@ void buildFire( gentity_t *ent, dynMenu_t menu )
else
ent->client->ps.stats[ STAT_MISC ] +=
BG_FindBuildDelayForWeapon( ent->s.weapon );
+
+ // don't want it bigger than 32k
+ if( ent->client->ps.stats[ STAT_MISC ] > 30000 )
+ ent->client->ps.stats[ STAT_MISC ] = 30000;
}
return;
}
@@ -1181,7 +1185,6 @@ void FireWeapon( gentity_t *ent )
// set aiming directions
AngleVectors( ent->client->ps.viewangles, forward, right, up );
CalcMuzzlePoint( ent, forward, right, up, muzzle );
- ent->client->firedWeapon = qtrue;
}
else
{
@@ -1215,27 +1218,35 @@ void FireWeapon( gentity_t *ent )
break;
case WP_MACHINEGUN:
bulletFire( ent, RIFLE_SPREAD, RIFLE_DMG, MOD_MACHINEGUN );
+ if( ent->client ) ent->client->firedWeapon = qtrue;
break;
case WP_SHOTGUN:
shotgunFire( ent );
+ if( ent->client ) ent->client->firedWeapon = qtrue;
break;
case WP_CHAINGUN:
bulletFire( ent, CHAINGUN_SPREAD, CHAINGUN_DMG, MOD_CHAINGUN );
+ if( ent->client ) ent->client->firedWeapon = qtrue;
break;
case WP_FLAMER:
flamerFire( ent );
+ if( ent->client ) ent->client->firedWeapon = qtrue;
break;
case WP_PULSE_RIFLE:
pulseRifleFire( ent );
+ if( ent->client ) ent->client->firedWeapon = qtrue;
break;
case WP_MASS_DRIVER:
massDriverFire( ent );
+ if( ent->client ) ent->client->firedWeapon = qtrue;
break;
case WP_LUCIFER_CANNON:
LCChargeFire( ent, qfalse );
+ if( ent->client ) ent->client->firedWeapon = qtrue;
break;
case WP_LAS_GUN:
lasGunFire( ent );
+ if( ent->client ) ent->client->firedWeapon = qtrue;
break;
case WP_PAIN_SAW:
painSawFire( ent );
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index 8c137c23..e8d5ba48 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -30,8 +30,8 @@
#define ABUILDER_CLAW_RANGE 64.0f
#define ABUILDER_CLAW_WIDTH 4.0f
#define ABUILDER_CLAW_REPEAT 1000
-#define ABUILDER_BASE_DELAY 15000
-#define ABUILDER_ADV_DELAY 10000
+#define ABUILDER_BASE_DELAY 17000
+#define ABUILDER_ADV_DELAY 12000
#define ABUILDER_BLOB_DMG ADM(5)
#define ABUILDER_BLOB_REPEAT 1000
#define ABUILDER_BLOB_SPEED 800.0f
@@ -356,7 +356,7 @@
#define MDRIVER_CLIPSIZE 5
#define MDRIVER_SPAWNCLIPS 2
#define MDRIVER_MAXCLIPS 3
-#define MDRIVER_DMG HDM(50)
+#define MDRIVER_DMG HDM(35)
#define MDRIVER_REPEAT 1000
#define MDRIVER_RELOAD 2000
@@ -399,11 +399,12 @@
#define HBUILD_PRICE 0
#define HBUILD_REPEAT 1000
-#define HBUILD_DELAY 15000
+#define HBUILD_DELAY 20000
+#define HBUILD_HEALRATE 18
#define HBUILD2_PRICE 75
#define HBUILD2_REPEAT 1000
-#define HBUILD2_DELAY 10000
+#define HBUILD2_DELAY 17500
@@ -519,11 +520,12 @@
#define REACTOR_ATTACK_DAMAGE 40
#define REACTOR_VALUE 2
-#define REPEATER_BP 10
+#define REPEATER_BP 0
#define REPEATER_BT 10000
#define REPEATER_HEALTH HBHM(400)
#define REPEATER_SPLASHDAMAGE 50
#define REPEATER_SPLASHRADIUS 100
+#define REPEATER_INACTIVE_TIME 90000
#define ENERGY_REFIL_TIME 1000 //1/2 second between every clip refil
@@ -559,6 +561,6 @@
#define ALIEN_MAX_KILLS 9
#define ALIEN_MAX_SINGLE_KILLS 3
-#define FREEKILL_PERIOD 180000 //msec
+#define FREEKILL_PERIOD 120000 //msec
#define FREEKILL_ALIEN 1
#define FREEKILL_HUMAN LEVEL0_VALUE