// Project Lab - NHTV Igad

#include "UnrealProject.h"
#include "KOTHBossSpawner.h"
#include "NPCBase.h"

void AKOTHBossSpawner::BeginPlay()
{
	Super::BeginPlay();
	for (TActorIterator<ASpawnerBase>actorIt(GetWorld()); actorIt; ++actorIt)
	{
		ASpawnerBase *spawn = *actorIt;
		if (!spawn->possesable)
			spawn->SetTeam((int)team);
	}
}
void AKOTHBossSpawner::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
	Super::EndPlay(EndPlayReason);
}
void AKOTHBossSpawner::Tick(float deltaTime)
{
	Super::Tick(deltaTime);
}
bool AKOTHBossSpawner::IsBossAlive() const
{
	if(m_mobs.Num() > 0)
	{
		if(IsValid(m_mobs[0]))
			return true;
	}
	return false;
}
void AKOTHBossSpawner::m_RespawnMobs()
{
	if (IsContested(m_currentTeam) && m_currentTeam<5)
	{
		return;
	}
	Super::m_RespawnMobs();
}