diff options
-rw-r--r-- | entities.def | 10 | ||||
-rw-r--r-- | src/cgame/cg_particles.c | 2 | ||||
-rw-r--r-- | src/game/g_cmds.c | 2 | ||||
-rw-r--r-- | src/game/g_local.h | 3 | ||||
-rw-r--r-- | src/game/g_main.c | 14 | ||||
-rw-r--r-- | src/game/g_spawn.c | 4 | ||||
-rw-r--r-- | src/game/g_target.c | 40 |
7 files changed, 65 insertions, 10 deletions
diff --git a/entities.def b/entities.def index b7e615c4..bbe33af9 100644 --- a/entities.def +++ b/entities.def @@ -1017,6 +1017,14 @@ speed: severity of the quake (default: 100) count: duration of the quake (default: 10) */ +/*QUAKED target_alien_win (1 0 0) (-8 -8 -8) (8 8 8) +When triggered, this causes an unconditional win for the alien team. +*/ + +/*QUAKED target_human_win (1 0 0) (-8 -8 -8) (8 8 8) +When triggered, this causes an unconditional win for the human team. +*/ + /*QUAKED target_delay (0 .7 .7) (-8 -8 -8) (8 8 8) Time delay trigger intermediary. Like a target_relay, this can only be fired by other triggers which will cause it in turn to fire its own targets. @@ -1473,7 +1481,6 @@ random: random time variance in seconds added or subtracted from "wait" delay (d /*QUAKED trigger_stage (.5 .5 .5) (-8 -8 -8) (8 8 8) Fires its targets when the team key reaches stage key. -UNTESTED: please report whether or not this works for you. -------- KEYS -------- target: this points to the entity to activate. @@ -1487,7 +1494,6 @@ stage: the stage at which this entity is triggered; 1 for stage 2, 2 for stage 3 /*QUAKED trigger_win (.5 .5 .5) (-8 -8 -8) (8 8 8) Fires its targets when the team key wins. -UNTESTED: please report whether or not this works for you. -------- KEYS -------- target: this points to the entity to activate. diff --git a/src/cgame/cg_particles.c b/src/cgame/cg_particles.c index 8e77f075..64587360 100644 --- a/src/cgame/cg_particles.c +++ b/src/cgame/cg_particles.c @@ -2129,7 +2129,7 @@ static void CG_EvaluateParticlePhysics( particle_t *p ) VectorScale( p->velocity, bounce, p->velocity ); - if( trace.plane.normal[ 2 ] > 0.0f && + if( trace.plane.normal[ 2 ] > 0.5f && ( p->velocity[ 2 ] < 40.0f || p->velocity[ 2 ] < -cg.frametime * p->velocity[ 2 ] ) ) p->atRest = qtrue; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 540bedd0..819fbb75 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1119,7 +1119,7 @@ void Cmd_Class_f( gentity_t *ent ) if( G_ClassIsAllowed( PCL_ALIEN_BUILDER0_UPG ) && BG_FindStagesForClass( PCL_ALIEN_BUILDER0_UPG, g_alienStage.integer ) ) - allowedClasses[ numClasses++ ] = PCL_ALIEN_BUILDER0; + allowedClasses[ numClasses++ ] = PCL_ALIEN_BUILDER0_UPG; if( G_ClassIsAllowed( PCL_ALIEN_LEVEL0 ) ) allowedClasses[ numClasses++ ] = PCL_ALIEN_LEVEL0; diff --git a/src/game/g_local.h b/src/game/g_local.h index 002d4cb5..ee8a8a57 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -595,6 +595,9 @@ typedef struct int alienStage3Time; int humanStage2Time; int humanStage3Time; + + qboolean uncondAlienWin; + qboolean uncondHumanWin; } level_locals_t; // diff --git a/src/game/g_main.c b/src/game/g_main.c index 1afb6744..52fec4e0 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1812,9 +1812,10 @@ void CheckExitRules( void ) } //TA: end the game on these conditions - if( ( level.time > level.startTime + 1000 ) && - ( level.numAlienSpawns == 0 ) && - ( level.numLiveAlienClients == 0 ) ) + if( level.uncondHumanWin || + ( ( level.time > level.startTime + 1000 ) && + ( level.numAlienSpawns == 0 ) && + ( level.numLiveAlienClients == 0 ) ) ) { //humans win level.lastWin = PTE_HUMANS; @@ -1831,9 +1832,10 @@ void CheckExitRules( void ) LogExit( "Humans win." ); return; } - else if( ( level.time > level.startTime + 1000 ) && - ( level.numHumanSpawns == 0 ) && - ( level.numLiveHumanClients == 0 ) ) + else if( level.uncondAlienWin || + ( ( level.time > level.startTime + 1000 ) && + ( level.numHumanSpawns == 0 ) && + ( level.numLiveHumanClients == 0 ) ) ) { //aliens win level.lastWin = PTE_ALIENS; diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c index 39db22be..080f7b41 100644 --- a/src/game/g_spawn.c +++ b/src/game/g_spawn.c @@ -199,6 +199,8 @@ void SP_target_position( gentity_t *ent ); void SP_target_location( gentity_t *ent ); void SP_target_push( gentity_t *ent ); void SP_target_rumble( gentity_t *ent ); +void SP_target_alien_win( gentity_t *ent ); +void SP_target_human_win( gentity_t *ent ); void SP_light( gentity_t *self ); void SP_info_null( gentity_t *self ); @@ -280,6 +282,8 @@ spawn_t spawns[ ] = { "target_location", SP_target_location }, { "target_push", SP_target_push }, { "target_rumble", SP_target_rumble }, + { "target_alien_win", SP_target_alien_win }, + { "target_human_win", SP_target_human_win }, { "light", SP_light }, { "path_corner", SP_path_corner }, diff --git a/src/game/g_target.c b/src/game/g_target.c index 216b2550..c704d72f 100644 --- a/src/game/g_target.c +++ b/src/game/g_target.c @@ -390,3 +390,43 @@ void SP_target_rumble( gentity_t *self ) self->think = target_rumble_think; self->use = target_rumble_use; } + +/* +=============== +target_alien_win_use +=============== +*/ +void target_alien_win_use( gentity_t *self, gentity_t *other, gentity_t *activator ) +{ + level.uncondAlienWin = qtrue; +} + +/* +=============== +SP_target_alien_win +=============== +*/ +void SP_target_alien_win( gentity_t *self ) +{ + self->use = target_alien_win_use; +} + +/* +=============== +target_human_win_use +=============== +*/ +void target_human_win_use( gentity_t *self, gentity_t *other, gentity_t *activator ) +{ + level.uncondHumanWin = qtrue; +} + +/* +=============== +SP_target_human_win +=============== +*/ +void SP_target_human_win( gentity_t *self ) +{ + self->use = target_human_win_use; +} |