From 324f062cc7c72728367483a2a27aaa3c4d7d1a8a Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 7 Feb 2023 00:11:00 +0000 Subject: [PATCH] Updated EatableItems for AmmoFunctionality Added ammo base functionality for using the ammo item in game --- Content/Levels/MerchantPrototype.umap | 4 ++-- Source/the_twilight_abyss/BaseItems/Items/BaseItem.h | 3 +++ .../BaseItems/Items/EatableItems.cpp | 11 +++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Content/Levels/MerchantPrototype.umap b/Content/Levels/MerchantPrototype.umap index b26f4c0..e1f4942 100644 --- a/Content/Levels/MerchantPrototype.umap +++ b/Content/Levels/MerchantPrototype.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a85cec4d3024ec9a40e0fd888530e7982d06461cf90dca88004eae911b6a8431 -size 33243 +oid sha256:c5cc473e60c24da835baacec54217c1f6c675c42c29643b889f07bff057a9c95 +size 34830 diff --git a/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h b/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h index 346966f..4ff62dd 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h +++ b/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h @@ -53,6 +53,9 @@ public: UPROPERTY(EditAnywhere, Category = "Item") bool isDamageBuffItem; + UPROPERTY(EditAnywhere, Category = "Item") + bool isAmmoItemType; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Item") int32 StackCount = 1; diff --git a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp index eb3ceaa..dab88bc 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp +++ b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp @@ -16,7 +16,7 @@ void UEatableItems::Use(ATempCharacter* Character) { if(Character) { - if(isHealingItem == true) + if(isHealingItem) { if (Character->Health < 100) { @@ -29,12 +29,19 @@ void UEatableItems::Use(ATempCharacter* Character) UE_LOG(LogTemp, Display, TEXT("Health is full")); } } - if(isDamageBuffItem == true) + + if(isDamageBuffItem) { // need to add the damage buff functionality here UE_LOG(LogTemp, Display, TEXT("Damage Buffed")); Character->Inventory->RemoveItem(this); } + + if (isAmmoItemType) + { + UE_LOG(LogTemp, Display, TEXT("ADD AMMO FUNCTIONALITY HERE")); + Character->Inventory->RemoveItem(this); + } } }