1
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user