Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / buff / buff / Buff_ActivePropsCapacity.cs
@小李xl 小李xl on 22 Mar 2024 613 bytes 道具逻辑片段更新参数描述

using System.Text.Json;

[BuffFragment(
    "ActivePropsCapacity",
    "主动道具背包容量 buff",
    Arg1 = "(int)主动道具背包增加的容量"
)]
public class Buff_ActivePropsCapacity : BuffFragment
{
    private int _value;

    public override void InitParam(JsonElement[] arg)
    {
        _value = arg[0].GetInt32();
    }

    public override void OnPickUpItem()
    {
        Role.ActivePropsPack.SetCapacity(Role.ActivePropsPack.Capacity + _value);
    }

    public override void OnRemoveItem()
    {
        Role.ActivePropsPack.SetCapacity(Role.ActivePropsPack.Capacity - _value);
    }
}