Files
PHY/Source/PHYInventory/Private/Items/PHYItemFragment_PropertySet.h
2026-03-05 14:44:34 +08:00

89 lines
2.4 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Copyright 2026 PHY. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "GIS_GameplayTagFloat.h"
#include "GIS_GameplayTagInteger.h"
#include "GIS_ItemFragment.h"
#include "PHYItemFragment_PropertySet.generated.h"
UENUM(BlueprintType)
enum class EPHYItemArchetype : uint8
{
Weapon,
Equipment,
Consumable,
Material,
Quest
};
UENUM(BlueprintType)
enum class EPHYEquipSlotType : uint8
{
None,
MainHand,
OffHand,
Head,
Chest,
Legs,
Feet,
Accessory
};
USTRUCT(BlueprintType)
struct FPHYConsumablePayload
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Consumable")
float RestoreHealth = 0.0f;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Consumable")
float RestoreInnerPower = 0.0f;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Consumable")
float DurationSeconds = 0.0f;
};
/**
* 统一道具属性片段:
* - 定义道具大类(武器/装备/药品...
* - 定义装备槽位
* - 定义创建实例时写入的动态属性(可用于随机词条前的基础值)
* - 定义药品基础效果载荷
*/
UCLASS(DisplayName="PHY Item Property Settings", Category="PHY")
class UPHYItemFragment_PropertySet : public UGIS_ItemFragment
{
GENERATED_BODY()
public:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Item")
EPHYItemArchetype ItemArchetype = EPHYItemArchetype::Material;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Item")
EPHYEquipSlotType EquipSlot = EPHYEquipSlotType::None;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Item", meta=(Categories="GIS.Item"))
FGameplayTagContainer ExtraItemTags;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Attributes", meta=(TitleProperty="{Tag} -> {Value}", Categories="GIS.Attribute"))
TArray<FGIS_GameplayTagFloat> BaseFloatModifiers;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Attributes", meta=(TitleProperty="{Tag} -> {Value}", Categories="GIS.Attribute"))
TArray<FGIS_GameplayTagInteger> BaseIntegerModifiers;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Consumable")
FPHYConsumablePayload ConsumablePayload;
virtual void OnInstanceCreated(UGIS_ItemInstance* ItemInstance) const override;
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Item")
bool IsEquippable() const;
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Item")
bool IsConsumable() const;
};