Updated TurnBaseCombat for Switching Active Roles
Added Switching Active Roles and Constrained Active Action Points
This commit is contained in:
parent
b678c25377
commit
5907d5dbe8
@ -14,6 +14,13 @@ void ATurnBaseCombat::BeginPlay()
|
||||
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()
|
||||
@ -21,4 +28,9 @@ void ATurnBaseCombat::revertActionPoints()
|
||||
activeActionPoints = defaultActionPoints;
|
||||
}
|
||||
|
||||
void ATurnBaseCombat::switchTurn()
|
||||
{
|
||||
activeActor = (isPlayerTurn) ? enemyActor : playerActor;
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,20 +27,24 @@ public:
|
||||
|
||||
AActor* playerActor;
|
||||
AActor* enemyActor;
|
||||
AActor* activeActor;
|
||||
|
||||
/*
|
||||
TODO:
|
||||
Reference Blueprint HUD
|
||||
Reference Action Library
|
||||
Reference Player Inventory
|
||||
Reference Combat Logging System
|
||||
*/
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
void useActionPoint();
|
||||
void reuseActionPoint();
|
||||
void revertActionPoints();
|
||||
|
||||
private:
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
bool isPlayerTurn = true;
|
||||
void switchTurn();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user