Added Names to GOAP Actions

This commit is contained in:
Philip W 2023-03-22 16:54:22 +00:00
parent fe7033f747
commit a0cd9f02fa
11 changed files with 13 additions and 5 deletions

View File

@ -6,6 +6,7 @@
void UCOMBO_A::Init()
{
ActionCost = 3.0f;
ActionName = "A";
PreConditions.Add("AzosResource", 1);
Effects.Add("PlayerHealth", 5);
Effects.Add("AzosResource", 1);

View File

@ -6,6 +6,7 @@
void UCOMBO_AA::Init()
{
ActionCost = 2.0f;
ActionName = "AA";
PreConditions.Add("AzosResource", 2);
Effects.Add("PlayerHealth", 10);
Effects.Add("AzosResource", 2);

View File

@ -6,6 +6,7 @@
void UCOMBO_AAA::Init()
{
ActionCost = 1.0f;
ActionName = "AAA";
PreConditions.Add("AzosResource", 3);
Effects.Add("PlayerHealth", 15);
Effects.Add("AzosResource", 3);

View File

@ -6,6 +6,7 @@
void UCOMBO_P::Init()
{
ActionCost = 3.0f;
ActionName = "P";
PreConditions.Add("ProbertiumResource", 1);
Effects.Add("PlayerHealth", 5);
Effects.Add("ProbertiumResource", 1);

View File

@ -6,6 +6,7 @@
void UCOMBO_PP::Init()
{
ActionCost = 2.0f;
ActionName = "PP";
PreConditions.Add("ProbertiumResource", 2);
Effects.Add("PlayerHealth", 10);
Effects.Add("ProbertiumResource", 2);

View File

@ -6,6 +6,7 @@
void UCOMBO_PPP::Init()
{
ActionCost = 1.0f;
ActionName = "PPP";
PreConditions.Add("ProbertiumResource", 3);
Effects.Add("PlayerHealth", 15);
Effects.Add("ProbertiumResource", 3);

View File

@ -6,6 +6,7 @@
void UDefaultAttack::Init()
{
ActionCost = 5.0f;
ActionName = "Punch";
PreConditions.Add("PlayerHealth", 1);
Effects.Add("PlayerHealth", 1);
}

View File

@ -17,6 +17,7 @@ class COMP250_1_2101327_AI_API UGOAPAction : public UObject
public:
float ActionCost = 1.0f;
FString ActionName;
UFUNCTION()
bool CheckPreConditions(UWorldState* WorldState);

View File

@ -472,7 +472,7 @@ void ATurnBaseCombatV2::EnemyTurn()
//DamagePlayer(10);
if (EnemyActionPlan.Num() > 0)
{
DamagePlayer(EnemyActionPlan[0]->Perform());
DamagePlayer(EnemyActionPlan[0]->Perform(), EnemyActionPlan[0]->ActionName);
EnemyActionPlan.RemoveAt(0);
}
else