AzureAbyss/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp

42 lines
670 B
C++
Raw Normal View History

// 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)
{
Character->Health += 10;
if(StoredItems)
{
StoredItems->Remove(this);
}
}
}
void UEatableItems::Buy(ATempCharacter* PurchaseItem)
{
if(PurchaseItem)
{
if(PurchaseItem->GoldBalance <= 0)
{
UE_LOG(LogTemp, Display, TEXT("Not Enough Gold"));
}
else
{
PurchaseItem->GoldBalance -= ItemCostPrice;
}
}
}