func_escapezone: make it work again. can't find solid info on the rewards

so I may have to revisit it anyway for rebalancing issues
This commit is contained in:
Marco Cawthorne 2023-03-01 16:13:52 -08:00
parent 8177fc0bef
commit 06a3e6bc6b
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
3 changed files with 44 additions and 2 deletions

View File

@ -29,9 +29,10 @@ Used in the Escape mode (es_* maps).
class
func_escapezone:NSBrushTrigger
{
void(void) func_escapezone;
void func_escapezone(void);
virtual void(void) Respawn;
virtual void Respawn(void);
virtual void Touch(entity);
};
void
@ -45,3 +46,41 @@ func_escapezone::Respawn(void)
{
InitBrushTrigger();
}
void
func_escapezone::Touch(entity eToucher)
{
CSMultiplayerRules rule = (CSMultiplayerRules)g_grMode;
int to_escape = g_cs_total_t;
/* only 3 Ts need to escape, max */
if (to_escape > 3)
to_escape = 3;
player pl = (player)eToucher;
/* don't matter when rules are not active */
if (g_cs_gamestate != GAME_ACTIVE)
return;
/* disallow the wrong players */
if (pl.classname != "player")
return;
if (pl.team != TEAM_T)
return;
rule.m_iEscapedTerrorists++;
/* mark player as spectator for the end of this 'round' */
pl.MakeTempSpectator();
/* threshold has been met to trigger the end of the round */
if (rule.m_iEscapedTerrorists >= to_escape) {
/* reset */
rule.m_iEscapedTerrorists = 0;
/* Ts win the round */
rule.RoundOver(TEAM_T, 3600, FALSE);
}
}

View File

@ -45,6 +45,8 @@ class CSMultiplayerRules:CSGameRules
entity m_eLastTSpawn;
entity m_eLastCTSpawn;
int m_iEscapedTerrorists;
void() CSMultiplayerRules;
virtual void(void) InitPostEnts;

View File

@ -1028,6 +1028,7 @@ CSMultiplayerRules::CSMultiplayerRules(void)
forceinfokey(world, "teamscore_1", "0");
forceinfokey(world, "team_2", "Counter-Terrorist");
forceinfokey(world, "teamscore_2", "0");
m_iEscapedTerrorists = 0;
}
/*