This commit is contained in:
CortexCore
2024-03-29 00:58:24 +08:00
parent 967ad8eacf
commit 05315ef4a8
232 changed files with 53368 additions and 8539 deletions

View File

@@ -51,6 +51,7 @@ namespace BITFALL.Entities.Armor
if (_inventory is not null)
{
_inventory.OnUsedItem += OnUsedItem;
_inventory.AllowUseItemFactory += OnAllowUse;
}
@@ -74,6 +75,14 @@ namespace BITFALL.Entities.Armor
}
}
private bool OnAllowUse(IBasicItem arg)
{
if (OnTryEquip(arg) is false)
{
throw new InGameException("<color=yellow>无护甲或护甲已满</color>");
}
return true;
}
private bool OnTryEquip(IBasicItem arg)
{
if (arg is null) return true;