if(WinningConditionHelper_zeroisworst)
leadlimit = 0; // not supported in this mode
- if(g_dm || g_tdm || g_ca || g_freezetag || (g_race && !g_race_qualifying) || g_nexball)
+ if(MUTATOR_CALLHOOK(Scores_CountFragsRemaining))
// these modes always score in increments of 1, thus this makes sense
{
if(leaderfrags != WinningConditionHelper_topscore)
/**/ o(string, ret_string) \
/**/
MUTATOR_HOOKABLE(FixPlayermodel, EV_FixPlayermodel);
+
+/** Return error to play frag remaining announcements */
+MUTATOR_HOOKABLE(Scores_CountFragsRemaining, EV_NO_ARGS);
#endif
return true;
}
+MUTATOR_HOOKFUNCTION(ca_CountFrags)
+{
+ // announce remaining frags
+ return true;
+}
+
void ca_Initialize()
{
allowed_to_spawn = true;
MUTATOR_HOOK(FilterItem, ca_FilterItem, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, ca_PlayerDamage_SplitHealthArmor, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerRegen, ca_PlayerRegen, CBC_ORDER_ANY);
+ MUTATOR_HOOK(Scores_CountFragsRemaining, ca_CountFrags, CBC_ORDER_ANY);
MUTATOR_ONADD
{
--- /dev/null
+MUTATOR_HOOKFUNCTION(dm_CountFrags)
+{
+ // announce remaining frags
+ return true;
+}
+
+MUTATOR_DEFINITION(gamemode_deathmatch)
+{
+ MUTATOR_HOOK(Scores_CountFragsRemaining, dm_CountFrags, CBC_ORDER_ANY);
+
+ MUTATOR_ONADD
+ {
+ if(time > 1) // game loads at time 1
+ error("This is a game type and it cannot be added at runtime.");
+ }
+
+ MUTATOR_ONROLLBACK_OR_REMOVE
+ {
+ // we actually cannot roll back dm_Initialize here
+ // BUT: we don't need to! If this gets called, adding always
+ // succeeds.
+ }
+
+ MUTATOR_ONREMOVE
+ {
+ print("This is a game type and it cannot be removed at runtime.");
+ return -1;
+ }
+
+ return 0;
+}
MUTATOR_HOOKFUNCTION(freezetag_GetTeamCount)
{
ret_float = freezetag_teams;
- return 0;
+ return false;
}
void freezetag_Initialize()
if(!(balls & BALL_BASKET))
return;
W_SetupShot(self, false, 2, "nexball/shoot2.wav", CH_WEAPON_A, 0);
-// Send_Effect("grenadelauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
missile = spawn();
missile.owner = self;
return false;
}
+MUTATOR_HOOKFUNCTION(race_CountFrags)
+{
+ // announce remaining frags if not in qualifying mode
+ if(!g_race_qualifying)
+ return true;
+
+ return false;
+}
+
void race_Initialize()
{
race_ScoreRules();
MUTATOR_HOOK(GetPressedKeys, race_PlayerPostThink, CBC_ORDER_ANY);
MUTATOR_HOOK(ForbidPlayerScore_Clear, race_ForbidClearPlayerScore, CBC_ORDER_ANY);
MUTATOR_HOOK(GetTeamCount, race_GetTeamCount, CBC_ORDER_ANY);
+ MUTATOR_HOOK(Scores_CountFragsRemaining, race_CountFrags, CBC_ORDER_ANY);
MUTATOR_ONADD
{
return true;
}
+MUTATOR_HOOKFUNCTION(tdm_CountFrags)
+{
+ // announce remaining frags
+ return true;
+}
+
MUTATOR_DEFINITION(gamemode_tdm)
{
MUTATOR_HOOK(GetTeamCount, tdm_GetTeamCount, CBC_ORDER_ANY);
+ MUTATOR_HOOK(Scores_CountFragsRemaining, tdm_CountFrags, CBC_ORDER_ANY);
MUTATOR_ONADD
{
MUTATOR_DECLARATION(gamemode_cts);
MUTATOR_DECLARATION(gamemode_race);
MUTATOR_DECLARATION(gamemode_tdm);
+MUTATOR_DECLARATION(gamemode_deathmatch);
MUTATOR_DECLARATION(mutator_dodging);
MUTATOR_DECLARATION(mutator_invincibleprojectiles);
#include "gamemode_race.qc"
#include "gamemode_cts.qc"
#include "gamemode_tdm.qc"
+#include "gamemode_deathmatch.qc"
#include "mutator_invincibleproj.qc"
#include "mutator_new_toys.qc"
if(g_dm)
{
+ MUTATOR_ADD(gamemode_deathmatch);
}
if(g_tdm)