From a0cd9f02fab823fb50f5c9a263b357b8de03ee4b Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Wed, 22 Mar 2023 16:54:22 +0000 Subject: [PATCH] Added Names to GOAP Actions --- .../Content/StarterContent/Architecture/Floor_400x400.uasset | 4 ++-- .../StarterContent/Blueprints/Blueprint_CeilingLight.uasset | 4 ++-- .../Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_A.cpp | 1 + .../Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_AA.cpp | 1 + .../Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_AAA.cpp | 1 + .../Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_P.cpp | 1 + .../Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_PP.cpp | 1 + .../Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_PPP.cpp | 1 + .../COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp | 1 + .../Source/COMP250_1_2101327_AI/GOAP/GOAPAction.h | 1 + .../TurnBasedCombatV2/TurnBaseCombatV2.cpp | 2 +- 11 files changed, 13 insertions(+), 5 deletions(-) diff --git a/COMP250_1_2101327_AI/Content/StarterContent/Architecture/Floor_400x400.uasset b/COMP250_1_2101327_AI/Content/StarterContent/Architecture/Floor_400x400.uasset index 633e867..c2a34af 100644 --- a/COMP250_1_2101327_AI/Content/StarterContent/Architecture/Floor_400x400.uasset +++ b/COMP250_1_2101327_AI/Content/StarterContent/Architecture/Floor_400x400.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5cb77f439981e84f95f1169147733c5c1e014743b1e405e0723b40f23b6b9f68 -size 14831 +oid sha256:4c0ecf0ac0702cc2bd355ec050232a61c49e10f102448efbeb735a51824adef6 +size 14948 diff --git a/COMP250_1_2101327_AI/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/COMP250_1_2101327_AI/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset index c5c3b84..1034abe 100644 --- a/COMP250_1_2101327_AI/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset +++ b/COMP250_1_2101327_AI/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4a60a29ad596546d481e43dfb8698842a78cc07f4a4b1000fa397cfba4e72331 -size 158206 +oid sha256:f6c13a84d6c9bc0304340e711bd62286838c1fbea908e77cb3906a65ef7504b0 +size 43745 diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_A.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_A.cpp index ea365ce..aea812d 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_A.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_A.cpp @@ -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); diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_AA.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_AA.cpp index 614b6f5..a59c6b4 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_AA.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_AA.cpp @@ -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); diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_AAA.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_AAA.cpp index 9b5e869..bba660a 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_AAA.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_AAA.cpp @@ -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); diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_P.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_P.cpp index 9de9b17..db3804a 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_P.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_P.cpp @@ -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); diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_PP.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_PP.cpp index c970777..94e348f 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_PP.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_PP.cpp @@ -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); diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_PPP.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_PPP.cpp index 421689c..b2ee97d 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_PPP.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/COMBO_PPP.cpp @@ -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); diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp index d4614cf..c33526e 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp @@ -6,6 +6,7 @@ void UDefaultAttack::Init() { ActionCost = 5.0f; + ActionName = "Punch"; PreConditions.Add("PlayerHealth", 1); Effects.Add("PlayerHealth", 1); } diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/GOAPAction.h b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/GOAPAction.h index 71cb6a5..9b9e324 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/GOAPAction.h +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/GOAPAction.h @@ -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); diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.cpp index cfd4f5a..d0f44e8 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -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