RealtimeStyleTransferRuntime/Source/LyraGame/AbilitySystem/Abilities/LyraAbilityCost_InventoryIt...

44 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameplayAbilitySpec.h"
#include "LyraAbilityCost.h"
#include "ScalableFloat.h"
#include "Templates/SubclassOf.h"
#include "UObject/UObjectGlobals.h"
#include "LyraAbilityCost_InventoryItem.generated.h"
class ULyraGameplayAbility;
class ULyraInventoryItemDefinition;
class UObject;
struct FGameplayAbilityActorInfo;
struct FGameplayTagContainer;
/**
* Represents a cost that requires expending a quantity of an inventory item
*/
UCLASS(meta=(DisplayName="Inventory Item"))
class ULyraAbilityCost_InventoryItem : public ULyraAbilityCost
{
GENERATED_BODY()
public:
ULyraAbilityCost_InventoryItem();
//~ULyraAbilityCost interface
virtual bool CheckCost(const ULyraGameplayAbility* Ability, const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, FGameplayTagContainer* OptionalRelevantTags) const override;
virtual void ApplyCost(const ULyraGameplayAbility* Ability, const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo) override;
//~End of ULyraAbilityCost interface
protected:
/** How much of the item to spend (keyed on ability level) */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=AbilityCost)
FScalableFloat Quantity;
/** Which item to consume */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=AbilityCost)
TSubclassOf<ULyraInventoryItemDefinition> ItemDefinition;
};