324f062cc7
Added ammo base functionality for using the ammo item in game
48 lines
955 B
C++
48 lines
955 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "EatableItems.h"
|
|
|
|
#include "the_twilight_abyss/BaseItems/InventoryComponent.h"
|
|
#include "the_twilight_abyss/PlayerTemp/TempCharacter.h"
|
|
|
|
|
|
UEatableItems::UEatableItems()
|
|
{
|
|
|
|
}
|
|
|
|
void UEatableItems::Use(ATempCharacter* Character)
|
|
{
|
|
if(Character)
|
|
{
|
|
if(isHealingItem)
|
|
{
|
|
if (Character->Health < 100)
|
|
{
|
|
Character->Health += 10;
|
|
UE_LOG(LogTemp, Display, TEXT("Healed"));
|
|
Character->Inventory->RemoveItem(this);
|
|
}
|
|
else if (Character->Health >= 100)
|
|
{
|
|
UE_LOG(LogTemp, Display, TEXT("Health is full"));
|
|
}
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
|