Adds stuns

This commit is contained in:
zumorica
2020-05-13 16:53:01 +02:00
parent 69ce5763f3
commit b85161a35f
6 changed files with 210 additions and 0 deletions

View File

@@ -22,6 +22,8 @@ namespace Content.Server.GameObjects.EntitySystems
bool CanEmote() => true;
bool CanAttack() => true;
bool CanEquip() => true;
bool CanUnequip() => true;
}
public class ActionBlockerSystem : EntitySystem
@@ -119,5 +121,29 @@ namespace Content.Server.GameObjects.EntitySystems
return canattack;
}
public static bool CanEquip(IEntity entity)
{
bool canequip = true;
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
{
canequip &= actionblockercomponents.CanEquip();
}
return canequip;
}
public static bool CanUnequip(IEntity entity)
{
bool canunequip = true;
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
{
canunequip &= actionblockercomponents.CanUnequip();
}
return canunequip;
}
}
}