// Fill out your copyright notice in the Description page of Project Settings.


#include "OverloadModuleTutorial.h"

#include "EndlessVendetta/EndlessVendettaCharacter.h"

void AOverloadModuleTutorial::BeginPlay()
{
	Super::BeginPlay();
	GadgetManager = Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->GadgetManager;
	SpawnNewWaypoint(HackTargetWaypointLoc, HackTargetWaypointDesc);
}

void AOverloadModuleTutorial::Tick(float DeltaSeconds)
{
	Super::Tick(DeltaSeconds);

	if (!GadgetManager->CombatInUse()) return;

	SpawnNewWaypoint(ResultWaypointLoc, ResultWaypointDesc);
	SetActorTickEnabled(false);
	FTimerHandle TimerHandle;
	GetWorld()->GetTimerManager().SetTimer(TimerHandle, this, &AOverloadModuleTutorial::FinishedTutorial, 7.5);
}