diff --git a/COMP250_1_2101327_AI/Content/StarterContent/Audio/Collapse01.uasset b/COMP250_1_2101327_AI/Content/StarterContent/Audio/Collapse01.uasset index 5e3ff30..7f0ee46 100644 --- a/COMP250_1_2101327_AI/Content/StarterContent/Audio/Collapse01.uasset +++ b/COMP250_1_2101327_AI/Content/StarterContent/Audio/Collapse01.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:85c827023ee4b466228ec65e92b4b4a0415a106de041ac1c2cab481a2a5dfa8d -size 348532 +oid sha256:5565f16f5c4074ccbc5c0f305a5a21edbe258c6246cc40fd8e9f39ff7906a70b +size 353935 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 fe3dc98..c5c3b84 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:05f0f54c9bd76fa02141c2e0c2afb6728419f333f39c645391bd0dfdc34da9b2 -size 43745 +oid sha256:4a60a29ad596546d481e43dfb8698842a78cc07f4a4b1000fa397cfba4e72331 +size 158206 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 3952daa..9408bce 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 @@ -9,4 +9,12 @@ void UCombo_P::Init() PreConditions.Add("ProbertiumResource", 5); Effects.Add("PlayerHealth", 15); Effects.Add("ProbertiumResource", 5); -} \ No newline at end of file +} + +bool UCombo_P::Perform() +{ + ATurnBaseCombatV2* CombatSystem = Cast(GetWorld()->GetGameState()); + CombatSystem->DamagePlayer(15, "P"); + + return true; +} diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/Combo_P.h b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/Combo_P.h index 5634ab1..f692f57 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/Combo_P.h +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/Combo_P.h @@ -16,4 +16,5 @@ class COMP250_1_2101327_AI_API UCombo_P : public UGOAPAction public: virtual void Init() override; + virtual bool Perform() override; }; 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 0627890..599809e 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 @@ -5,7 +5,15 @@ void UDefaultAttack::Init() { - ActionCost = 2.0f; - PreConditions.Add("PlayerHealth", 10); - Effects.Add("PlayerHealth", 10); + ActionCost = 5.0f; + PreConditions.Add("PlayerHealth", 1); + Effects.Add("PlayerHealth", 1); +} + +bool UDefaultAttack::Perform() +{ + ATurnBaseCombatV2* CombatSystem = Cast(GetWorld()->GetGameState()); + CombatSystem->DamagePlayer(1, "Punch"); + + return true; } diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.h b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.h index 258e8b4..2756d84 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.h +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.h @@ -16,4 +16,5 @@ class COMP250_1_2101327_AI_API UDefaultAttack : public UGOAPAction public: virtual void Init() override; + virtual bool Perform() override; }; diff --git a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/GOAPAction.cpp b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/GOAPAction.cpp index 02e6da8..e282e8a 100644 --- a/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/GOAPAction.cpp +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/GOAPAction.cpp @@ -26,3 +26,8 @@ TMap UGOAPAction::ApplyEffects(TMap WorldState) } return WorldState; } + +bool UGOAPAction::Perform() +{ + return false; +} 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 8cfb3bc..58ac314 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 @@ -4,6 +4,7 @@ #include "CoreMinimal.h" #include "UObject/Object.h" +#include "COMP250_1_2101327_AI/TurnBasedCombatV2/TurnBaseCombatV2.h" #include "GOAPAction.generated.h" /** @@ -21,7 +22,9 @@ public: bool CheckPreConditions(TMap WorldState); UFUNCTION() TMap ApplyEffects(TMap WorldState); - + UFUNCTION() + virtual bool Perform(); + UPROPERTY() TMap PreConditions; UPROPERTY()