Updated EatableItems to add ammo {UNSTABLE}

Added functionality to the ammo count currently unstable as need to wait for other programmer to understand why it crashes.
This commit is contained in:
MH261677 2023-02-19 15:29:16 +00:00
parent 3c2d057951
commit 618a9509ca
4 changed files with 18 additions and 5 deletions

Binary file not shown.

BIN
Content/Levels/Top_layer_level.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -39,7 +39,14 @@ void UEatableItems::Use(ATempCharacter* Character)
if (isAmmoItemType)
{
UE_LOG(LogTemp, Display, TEXT("ADD AMMO FUNCTIONALITY HERE"));
if (TurnBaseCombat->IronResource > 10)
{
TurnBaseCombat->IronResource += 5;
}
if (TurnBaseCombat->SulfurResource > 10)
{
TurnBaseCombat->SulfurResource += 5;
}
Character->Inventory->RemoveItem(this);
}
}

View File

@ -4,6 +4,7 @@
#include "CoreMinimal.h"
#include "BaseItem.h"
#include "the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.h"
#include "EatableItems.generated.h"
/**
@ -19,4 +20,9 @@ class THE_TWILIGHT_ABYSS_API UEatableItems : public UBaseItem
protected:
virtual void Use(class ATempCharacter* Character) override;
private:
ATurnBaseCombatV2* TurnBaseCombat;
};