Emergent Sanitation Gameplay (#1378)
* Emergent Sanitation Gameplay * Fix the map * Address review * Mention if it's slippery in the description
This commit is contained in:
@@ -10,6 +10,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
public interface IEffectBlocker
|
||||
{
|
||||
bool CanFall() => true;
|
||||
bool CanSlip() => true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -28,5 +29,16 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
|
||||
return canFall;
|
||||
}
|
||||
|
||||
public static bool CanSlip(IEntity entity)
|
||||
{
|
||||
var canSlip = true;
|
||||
foreach (var blocker in entity.GetAllComponents<IEffectBlocker>())
|
||||
{
|
||||
canSlip &= blocker.CanSlip(); // Sets var to false if false
|
||||
}
|
||||
|
||||
return canSlip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user