AzureAbyss/Source/the_twilight_abyss/TurnBaseCombat.cpp

37 lines
707 B
C++
Raw Normal View History

2022-11-09 20:32:31 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#include "TurnBaseCombat.h"
void ATurnBaseCombat::BeginPlay()
{
Super::BeginPlay();
activeActionPoints = defaultActionPoints;
}
void ATurnBaseCombat::useActionPoint()
{
activeActionPoints -= 1;
activeActionPoints = FMath::Clamp(activeActionPoints, 0, defaultActionPoints);
}
void ATurnBaseCombat::reuseActionPoint()
{
activeActionPoints += 1;
activeActionPoints = FMath::Clamp(activeActionPoints, 0, defaultActionPoints);
2022-11-09 20:32:31 +00:00
}
void ATurnBaseCombat::revertActionPoints()
{
activeActionPoints = defaultActionPoints;
}
void ATurnBaseCombat::switchTurn()
{
activeActor = (isPlayerTurn) ? enemyActor : playerActor;
}
2022-11-09 20:32:31 +00:00