#pragma once

#include <common/mutators/base.qh>
#define autocvar_g_invasion_point_limit cvar("g_invasion_point_limit")
int autocvar_g_invasion_type;
bool g_invasion;
IntrusiveList g_invasion_roundends;
IntrusiveList g_invasion_waves;
IntrusiveList g_invasion_spawns;
void invasion_Initialize();

REGISTER_MUTATOR(inv, false)
{
	MUTATOR_STATIC();
	MUTATOR_ONADD
	{
		g_invasion_roundends = IL_NEW();
		g_invasion_waves = IL_NEW();
		g_invasion_spawns = IL_NEW();
		GameRules_limit_score(autocvar_g_invasion_point_limit);

		g_invasion = true;
		cvar_settemp("g_monsters", "1");
		invasion_Initialize();
	}
	return 0;
}

int inv_numspawned;
int inv_maxspawned;
int inv_roundcnt;
int inv_maxrounds;
int inv_numkilled;
float inv_lastcheck;
int inv_maxcurrent;

float inv_monsterskill;

const int INV_TYPE_ROUND = 0; // round-based waves of enemies
const int INV_TYPE_HUNT = 1; // clear the map of placed enemies
const int INV_TYPE_STAGE = 2; // reach the end of the level
