// 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 BaseFloatModifiers; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Attributes", meta=(TitleProperty="{Tag} -> {Value}", Categories="GIS.Attribute")) TArray 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; };