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() void UCOMBO_A::Init()
{ {
ActionCost = 3.0f; ActionCost = 3.0f;
ActionName = "A";
PreConditions.Add("AzosResource", 1); PreConditions.Add("AzosResource", 1);
Effects.Add("PlayerHealth", 5); Effects.Add("PlayerHealth", 5);
Effects.Add("AzosResource", 1); Effects.Add("AzosResource", 1);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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