81d926ffb3
Made it so when the players health is above 100 they cant heal anymore. (Removed healing stacking)
48 lines
999 B
C++
48 lines
999 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 == true)
|
|
{
|
|
if (Character->Health < 100)
|
|
{
|
|
Character->Health += 10;
|
|
UE_LOG(LogTemp, Display, TEXT("Healed"));
|
|
//delete itself
|
|
Character->Inventory->RemoveItem(this);
|
|
}
|
|
else if (Character->Health >= 100)
|
|
{
|
|
UE_LOG(LogTemp, Display, TEXT("Health is full"));
|
|
}
|
|
}
|
|
if(isDamageBuffItem == true)
|
|
{
|
|
// need to add the damage buff functionality here
|
|
UE_LOG(LogTemp, Display, TEXT("Damage Buffed"));
|
|
Character->Inventory->RemoveItem(this);
|
|
}
|
|
}
|
|
|
|
/*
|
|
when player uses the item syrengine to debuff enemies
|
|
detect what enemie actors the player is fighting with
|
|
lower their damage by a value.
|
|
*/
|
|
}
|
|
|