2021-01-20 10:02:34 +03:00
|
|
|
#nullable enable
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Content.Server.GameObjects.Components.Watercloset;
|
|
|
|
|
using Content.Shared.Construction;
|
|
|
|
|
using JetBrains.Annotations;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-01-20 10:02:34 +03:00
|
|
|
using Robust.Shared.Localization;
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
using Robust.Shared.Utility;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Construction.Conditions
|
|
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
public class ToiletLidClosed : IEdgeCondition
|
|
|
|
|
{
|
|
|
|
|
public async Task<bool> Condition(IEntity entity)
|
|
|
|
|
{
|
|
|
|
|
if (!entity.TryGetComponent(out ToiletComponent? toilet)) return false;
|
|
|
|
|
return !toilet.LidOpen;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool DoExamine(IEntity entity, FormattedMessage message, bool inExamineRange)
|
|
|
|
|
{
|
|
|
|
|
if (!entity.TryGetComponent(out ToiletComponent? toilet)) return false;
|
|
|
|
|
if (!toilet.LidOpen) return false;
|
2021-02-04 17:44:49 +01:00
|
|
|
|
2021-01-20 10:02:34 +03:00
|
|
|
message.AddMarkup(Loc.GetString("Use a [color=yellow]crowbar[/color] to close the lid.\n"));
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-04 17:44:49 +01:00
|
|
|
void IExposeData.ExposeData(ObjectSerializer serializer)
|
2021-01-20 10:02:34 +03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|