using Content.Shared.GameObjects.EntitySystems.EffectBlocker;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Shared.GameObjects.EntitySystems
{
public abstract class SharedStandingStateSystem : EntitySystem
{
protected abstract bool OnDown(IEntity entity, bool playSound = true, bool dropItems = true,
bool force = false);
protected abstract bool OnStand(IEntity entity);
///
/// Set's the mob standing state to down.
///
/// The mob in question
/// Whether to play a sound when falling down or not
/// Whether to make the mob drop all the items on his hands
/// Whether or not to check if the entity can fall.
/// False if the mob was already downed or couldn't set the state
public bool Down(IEntity entity, bool playSound = true, bool dropItems = true, bool force = false)
{
if (dropItems)
{
DropAllItemsInHands(entity, false);
}
if (!force && !EffectBlockerSystem.CanFall(entity))
{
return false;
}
return OnDown(entity, playSound, dropItems, force);
}
///
/// Sets the mob's standing state to standing.
///
/// The mob in question.
/// False if the mob was already standing or couldn't set the state
public bool Standing(IEntity entity)
{
return OnStand(entity);
}
public virtual void DropAllItemsInHands(IEntity entity, bool doMobChecks = true)
{
}
}
}