From 6309db6a5533e435f02d5b8877cca204db6b3773 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Mon, 20 Mar 2023 07:30:55 +0000 Subject: [PATCH] Added Test Actions --- .../GOAP/Actions/Combo_P.cpp | 12 ++++++++++++ .../GOAP/Actions/Combo_P.h | 19 +++++++++++++++++++ .../GOAP/Actions/DefaultAttack.cpp | 11 +++++++++++ .../GOAP/Actions/DefaultAttack.h | 19 +++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/Combo_P.cpp create mode 100644 COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/Combo_P.h create mode 100644 COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp create mode 100644 COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.h 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 new file mode 100644 index 0000000..3952daa --- /dev/null +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/Combo_P.cpp @@ -0,0 +1,12 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Combo_P.h" + +void UCombo_P::Init() +{ + PreConditions.Add("PlayerHealth", 15); + PreConditions.Add("ProbertiumResource", 5); + Effects.Add("PlayerHealth", 15); + Effects.Add("ProbertiumResource", 5); +} \ No newline at end of file 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 new file mode 100644 index 0000000..5634ab1 --- /dev/null +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/Combo_P.h @@ -0,0 +1,19 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "../GOAPAction.h" +#include "Combo_P.generated.h" + +/** + * + */ +UCLASS() +class COMP250_1_2101327_AI_API UCombo_P : public UGOAPAction +{ + GENERATED_BODY() + +public: + virtual void Init() 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 new file mode 100644 index 0000000..0627890 --- /dev/null +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.cpp @@ -0,0 +1,11 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "DefaultAttack.h" + +void UDefaultAttack::Init() +{ + ActionCost = 2.0f; + PreConditions.Add("PlayerHealth", 10); + Effects.Add("PlayerHealth", 10); +} 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 new file mode 100644 index 0000000..258e8b4 --- /dev/null +++ b/COMP250_1_2101327_AI/Source/COMP250_1_2101327_AI/GOAP/Actions/DefaultAttack.h @@ -0,0 +1,19 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "../GOAPAction.h" +#include "DefaultAttack.generated.h" + +/** + * + */ +UCLASS() +class COMP250_1_2101327_AI_API UDefaultAttack : public UGOAPAction +{ + GENERATED_BODY() + +public: + virtual void Init() override; +};