Updated EatableItems for AmmoFunctionality

Added ammo base functionality for using the ammo item in game
This commit is contained in:
MH261677 2023-02-07 00:11:00 +00:00
parent 797c447d47
commit 324f062cc7
3 changed files with 14 additions and 4 deletions

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

Binary file not shown.

View File

@ -53,6 +53,9 @@ public:
UPROPERTY(EditAnywhere, Category = "Item") UPROPERTY(EditAnywhere, Category = "Item")
bool isDamageBuffItem; bool isDamageBuffItem;
UPROPERTY(EditAnywhere, Category = "Item")
bool isAmmoItemType;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Item") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Item")
int32 StackCount = 1; int32 StackCount = 1;

View File

@ -16,7 +16,7 @@ void UEatableItems::Use(ATempCharacter* Character)
{ {
if(Character) if(Character)
{ {
if(isHealingItem == true) if(isHealingItem)
{ {
if (Character->Health < 100) if (Character->Health < 100)
{ {
@ -29,12 +29,19 @@ void UEatableItems::Use(ATempCharacter* Character)
UE_LOG(LogTemp, Display, TEXT("Health is full")); UE_LOG(LogTemp, Display, TEXT("Health is full"));
} }
} }
if(isDamageBuffItem == true)
if(isDamageBuffItem)
{ {
// need to add the damage buff functionality here // need to add the damage buff functionality here
UE_LOG(LogTemp, Display, TEXT("Damage Buffed")); UE_LOG(LogTemp, Display, TEXT("Damage Buffed"));
Character->Inventory->RemoveItem(this); Character->Inventory->RemoveItem(this);
} }
if (isAmmoItemType)
{
UE_LOG(LogTemp, Display, TEXT("ADD AMMO FUNCTIONALITY HERE"));
Character->Inventory->RemoveItem(this);
}
} }
} }