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:
parent
3c2d057951
commit
618a9509ca
BIN
Content/Blueprints/Player/BP_MyTempCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Player/BP_MyTempCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Levels/Top_layer_level.umap
(Stored with Git LFS)
BIN
Content/Levels/Top_layer_level.umap
(Stored with Git LFS)
Binary file not shown.
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user