#pragma once
+#include <common/mutators/base.qh>
+
float autocvar_g_onslaught_point_limit;
+IntrusiveList g_onsshields;
void ons_Initialize();
REGISTER_MUTATOR(ons, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- ons_Initialize();
-
- ActivateTeamplay();
- SetLimits(autocvar_g_onslaught_point_limit, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
- have_team_spawns = -1; // request team spawns
- }
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back ons_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
+ GameRules_teams(true);
+ GameRules_limit_score(autocvar_g_onslaught_point_limit);
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ ons_Initialize();
}
-
return false;
}
.float teleport_antispam;
-.bool isgenneighbor[17];
-.bool iscpneighbor[17];
+.int aregensneighbor;
+.int arecpsneighbor;
float ons_notification_time[17];
.float ons_overtime_damagedelay;
// declarations for functions used outside gamemode_onslaught.qc
void ons_Generator_UpdateSprite(entity e);
void ons_ControlPoint_UpdateSprite(entity e);
-bool ons_ControlPoint_Attackable(entity cp, int teamnumber);
+bool ons_ControlPoint_Attackable(entity cp, int teamnum);
// CaptureShield: Prevent capturing or destroying control point/generator if it is not available yet
float ons_captureshield_force; // push force of the shield
.entity havocbot_ons_target;
-.int havocbot_role_flags;
.float havocbot_attack_time;
void havocbot_role_ons_defense(entity this);