summaryrefslogtreecommitdiff
path: root/src/game/g_trigger.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2004-03-18 16:44:54 +0000
committerTim Angus <tim@ngus.net>2004-03-18 16:44:54 +0000
commit1eee6be0ea1aeec679cff80fea36a91e6d0c788f (patch)
tree835ab33758dd9fa0b3e6f0a5a9003efcf04c8060 /src/game/g_trigger.c
parent9582bcfdfcce0aa7132917c8403c5f12d2be3e79 (diff)
* Added trigger_stage entity which is fired on stage transitions
* Alien evolution is no longer allowed within range of humans * Reduced human damage boost from 10% to 7% * Reduced reactor base health to 1250
Diffstat (limited to 'src/game/g_trigger.c')
-rw-r--r--src/game/g_trigger.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/game/g_trigger.c b/src/game/g_trigger.c
index 95359f7a..1bd05a38 100644
--- a/src/game/g_trigger.c
+++ b/src/game/g_trigger.c
@@ -477,3 +477,43 @@ void SP_func_timer( gentity_t *self )
}
+/*
+===============
+G_Checktrigger_stages
+
+Called when stages change
+===============
+*/
+void G_Checktrigger_stages( pTeam_t team, stage_t stage )
+{
+ int i;
+ gentity_t *ent;
+
+ for( i = 1, ent = g_entities + i ; i < level.num_entities ; i++, ent++ )
+ {
+ if( !ent->inuse )
+ continue;
+
+ if( !Q_stricmp( ent->classname, "trigger_stage" ) )
+ {
+ if( team == ent->stageTeam && stage == ent->stageStage )
+ ent->use( ent, ent, ent );
+ }
+ }
+}
+
+
+void trigger_stage_use( gentity_t *self, gentity_t *other, gentity_t *activator )
+{
+ G_UseTargets( self, self );
+}
+
+void SP_trigger_stage( gentity_t *self )
+{
+ G_SpawnInt( "team", "0", &self->stageTeam );
+ G_SpawnInt( "stage", "0", &self->stageStage );
+
+ self->use = trigger_stage_use;
+
+ self->r.svFlags = SVF_NOCLIENT;
+}