AzureAbyss/Source/the_twilight_abyss/TurnBaseCombat.cpp
PHILIP White 5907d5dbe8 Updated TurnBaseCombat for Switching Active Roles
Added Switching Active Roles and Constrained Active Action Points
2022-11-09 21:03:47 +00:00

37 lines
707 B
C++

// 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);
}
void ATurnBaseCombat::revertActionPoints()
{
activeActionPoints = defaultActionPoints;
}
void ATurnBaseCombat::switchTurn()
{
activeActor = (isPlayerTurn) ? enemyActor : playerActor;
}