Files
2026-03-05 11:39:06 +08:00

27 lines
860 B
C#

namespace Fantasy;
[ItemUse(ItemUseEffect.AddAttr)]
public class ItemUse_Drug_AddAttr : IItemUse
{
public uint CanUse(Account account, ItemConfig config, ref int count)
{
if (config.Params.Length < 2)
{
Log.Error($"configId:{config.Id} config.Params.Length({config.Params.Length}) < 2");
return 1;
}
Log.Debug($"CanUse 使用了药品增加属性 configId:{config.Id} count:{count}");
return 0;
}
public void Use(Account account, ItemConfig config, ref int count)
{
for (int i = 0; i < config.Params.Length; i += 2)
{
var attrKey = config.Params[i];
var attrValue = config.Params[i + 1];
Log.Debug($"Use 使用了药品增加属性 configId:{config.Id} attrKey:{attrKey} attrValue:{attrValue}");
}
}
}