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

44 lines
1.5 KiB
C
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
2022-09-13 07:18:28 +00:00
#include "GameplayAbilitySpec.h"
2022-05-23 18:41:30 +00:00
#include "LyraAbilityCost.h"
2022-09-13 07:18:28 +00:00
#include "ScalableFloat.h"
#include "Templates/SubclassOf.h"
#include "UObject/UObjectGlobals.h"
2022-05-23 18:41:30 +00:00
#include "LyraAbilityCost_InventoryItem.generated.h"
2022-09-13 07:18:28 +00:00
class ULyraGameplayAbility;
2022-05-23 18:41:30 +00:00
class ULyraInventoryItemDefinition;
2022-09-13 07:18:28 +00:00
class UObject;
struct FGameplayAbilityActorInfo;
struct FGameplayTagContainer;
2022-05-23 18:41:30 +00:00
/**
* 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;
};