METHOD(mayhem, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
{
TC(Gametype, this);
- returns(menu, _("Frag limit:"), 5, 100, 5, "g_mayhem_fraglimit", string_null, _("How many frags worth of score is needed before the match will end"));
+ returns(menu, _("Frag limit:"), 5, 100, 5, "fraglimit_override", string_null, _("How many frags worth of score is needed before the match will end"));
}
ATTRIB(mayhem, m_legacydefaults, string, "30 20 0");
ENDCLASS(mayhem)
float autocvar_g_mayhem_fraglimit;
float autocvar_g_mayhem_visual_score_limit;
-float mayhempointmultiplier;
bool autocvar_g_mayhem_regenerate;
string autocvar_g_mayhem_weaponarena;
void mayhem_Initialize()
{
- if(autocvar_g_mayhem_visual_score_limit > 0 && autocvar_g_mayhem_fraglimit > 0)
- mayhempointmultiplier = autocvar_g_mayhem_visual_score_limit / autocvar_g_mayhem_fraglimit;
-
- GameRules_limit_score(autocvar_g_mayhem_visual_score_limit);
+ if (autocvar_fraglimit_override != 0)
+ GameRules_limit_score(autocvar_g_mayhem_visual_score_limit);
+ else
+ GameRules_limit_score(9999);
InitializeEntity(NULL, mayhem_DelayedInit, INITPRIO_GAMETYPE);
}
MUTATOR_HOOKFUNCTION(mayhem, SetStartItems)
{
start_items &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
- if(!cvar("g_use_ammunition") || autocvar_g_mayhem_unlimited_ammo)
+ if (!cvar("g_use_ammunition") || autocvar_g_mayhem_unlimited_ammo)
start_items |= IT_UNLIMITED_AMMO;
start_health = warmup_start_health = autocvar_g_mayhem_start_health;
//this hook also enables rotting, as players spawn with more hp and armor than what default rot limits are set to this is a bad idea as of now
MUTATOR_HOOKFUNCTION(mayhem, PlayerRegen)
{
- if(autocvar_g_mayhem_regenerate)
+ if (autocvar_g_mayhem_regenerate)
return false;
return true;
}
M_ARGV(4, float) = frag_damage;
}
-void FFAMayhemCalculatePlayerScore(entity scorer){
+void FFAMayhemCalculatePlayerScore(entity scorer)
+{
+ if (autocvar_fraglimit_override > 0) autocvar_g_mayhem_fraglimit = autocvar_fraglimit_override;
+
switch (autocvar_g_mayhem_scoringmethod)
{
default:
float autocvar_g_tmayhem_visual_score_limit;
float autocvar_g_tmayhem_score_leadlimit;
bool autocvar_g_tmayhem_team_spawns;
-float tmayhempointmultiplier;
// TODO? rename to teammayhem? requires checking alias and other string lengths
int autocvar_g_tmayhem_teams;
void tmayhem_DelayedInit(entity this)
{
// if no teams are found, spawn defaults
- if(find(NULL, classname, "tmayhem_team") == NULL)
+ if (find(NULL, classname, "tmayhem_team") == NULL)
{
LOG_TRACE("No \"tmayhem_team\" entities found on this map, creating them anyway.");
void tmayhem_Initialize()
{
- if(autocvar_g_tmayhem_visual_score_limit != 0 && autocvar_g_tmayhem_fraglimit != 0)
- tmayhempointmultiplier = autocvar_g_tmayhem_visual_score_limit / autocvar_g_tmayhem_fraglimit;
-
GameRules_teams(true);
GameRules_spawning_teams(autocvar_g_tmayhem_team_spawns);
- GameRules_limit_score(autocvar_g_tmayhem_visual_score_limit);
GameRules_limit_lead(autocvar_g_tmayhem_score_leadlimit);
+ if (autocvar_fraglimit_override != 0)
+ GameRules_limit_score(autocvar_g_tmayhem_visual_score_limit);
+ else
+ GameRules_limit_score(9999);
+
InitializeEntity(NULL, tmayhem_DelayedInit, INITPRIO_GAMETYPE);
}
// code up to here is just to support maps that don't have team entities
MUTATOR_HOOKFUNCTION(tmayhem, SetStartItems)
{
start_items &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
- if(!cvar("g_use_ammunition") || autocvar_g_tmayhem_unlimited_ammo)
+ if (!cvar("g_use_ammunition") || autocvar_g_tmayhem_unlimited_ammo)
start_items |= IT_UNLIMITED_AMMO;
start_health = warmup_start_health = autocvar_g_tmayhem_start_health;
//this hook also enables rotting, as players spawn with more hp and armor than what default rot limits are set to this is a bad idea as of now until PlayerRegen is changed
MUTATOR_HOOKFUNCTION(tmayhem, PlayerRegen)
{
- if(autocvar_g_tmayhem_regenerate)
+ if (autocvar_g_tmayhem_regenerate)
return false;
return true;
}
M_ARGV(5, float) = frag_mirrordamage;
}
-void TeamMayhemCalculatePlayerScore(entity scorer){
+void TeamMayhemCalculatePlayerScore(entity scorer)
+{
+ if (autocvar_fraglimit_override > 0) autocvar_g_tmayhem_fraglimit = autocvar_fraglimit_override;
+
switch (autocvar_g_tmayhem_scoringmethod)
{
default:
METHOD(tmayhem, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
{
TC(Gametype, this);
- returns(menu, _("Frag limit:"), 5, 100, 5, "g_tmayhem_fraglimit", "g_tmayhem_teams_override", _("How many frags worth of score is needed before the match will end"));
+ returns(menu, _("Frag limit:"), 5, 100, 5, "fraglimit_override", "g_tmayhem_teams_override", _("How many frags worth of score is needed before the match will end"));
}
ATTRIB(tmayhem, m_legacydefaults, string, "50 20 2 0");
ENDCLASS(tmayhem)