diff --git a/.ignore b/.ignore index 2c368e1..c85ee45 100644 --- a/.ignore +++ b/.ignore @@ -1,4 +1,3 @@ -.idea .git .vscode Content diff --git a/Source/the_twilight_abyss/TurnBaseCombat.cpp b/Source/the_twilight_abyss/TurnBaseCombat.cpp new file mode 100644 index 0000000..11409af --- /dev/null +++ b/Source/the_twilight_abyss/TurnBaseCombat.cpp @@ -0,0 +1,24 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "TurnBaseCombat.h" + +void ATurnBaseCombat::BeginPlay() +{ + Super::BeginPlay(); + + activeActionPoints = defaultActionPoints; + +} + +void ATurnBaseCombat::useActionPoint() +{ + activeActionPoints -= 1; +} + +void ATurnBaseCombat::revertActionPoints() +{ + activeActionPoints = defaultActionPoints; +} + + diff --git a/Source/the_twilight_abyss/TurnBaseCombat.h b/Source/the_twilight_abyss/TurnBaseCombat.h new file mode 100644 index 0000000..3416810 --- /dev/null +++ b/Source/the_twilight_abyss/TurnBaseCombat.h @@ -0,0 +1,46 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/GameStateBase.h" +#include "TurnBaseCombat.generated.h" + +/** + * + */ +UCLASS() +class THE_TWILIGHT_ABYSS_API ATurnBaseCombat : public AGameStateBase +{ + GENERATED_BODY() + +public: + ATurnBaseCombat() = default; + + UPROPERTY(EditDefaultsOnly) + int playerHealth = 100; + UPROPERTY(EditDefaultsOnly) + int enemyHealth = 100; + UPROPERTY(EditDefaultsOnly) + int defaultActionPoints = 3; + int activeActionPoints = 0; + + AActor* playerActor; + AActor* enemyActor; + + /* + TODO: + Reference Blueprint HUD + Reference Action Library + Reference Player Inventory + */ + +protected: + virtual void BeginPlay() override; + void useActionPoint(); + void revertActionPoints(); + +private: + UPROPERTY(EditDefaultsOnly) + bool isPlayerTurn = true; +};