#pragma once

#include <common/mutators/base.qh>
#define autocvar_g_domination_point_limit cvar("g_domination_point_limit")
bool autocvar_g_domination_roundbased;
int autocvar_g_domination_roundbased_point_limit;
int autocvar_g_domination_point_leadlimit;

IntrusiveList g_dompoints;
void dom_Initialize();

REGISTER_MUTATOR(dom, false)
{
	MUTATOR_STATIC();
	MUTATOR_ONADD
	{
		int point_limit = autocvar_g_domination_point_limit;
		if (autocvar_g_domination_roundbased && autocvar_g_domination_roundbased_point_limit)
			point_limit = autocvar_g_domination_roundbased_point_limit;

		GameRules_teams(true);
		GameRules_limit_score(point_limit);
		GameRules_limit_lead(autocvar_g_domination_point_leadlimit);

		dom_Initialize();
	}
	return 0;
}

// score rule declarations
const float ST_DOM_TICKS = 1;
const float ST_DOM_CAPS = 1;

// pps: points per second
float total_pps;
float pps_red;
float pps_blue;
float pps_yellow;
float pps_pink;

// capture declarations
.float enemy_playerid;
.entity sprite;
.float captime;

// misc globals
float domination_roundbased;

void AnimateDomPoint(entity this);
