Files
tbd-station-14/Content.Server/Construction/Conditions/ToiletLidClosed.cs
Alex Evgrashin 02ea6ce57c Toilet (#3012)
* Ported sprites from eris

* Added yml

* lid open/close logic

* interactivity

* Working on new secret stash component

* Object will drop on destruction

* Can get item and examine message

* Reagent container and some cleaning

* Moved potted plant to stash

* New base prefab

* Now you can deconstruct toilet

* Small fixes

* Fixed unknown components errors

* Fixed grammar errors

Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>

* Now use prob

* More grammar

* Update Content.Server/Construction/Conditions/ToiletLidClosed.cs

Aaaaaaaa

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* No delays

* Amazing sound design

* Moved sound to mono

* Toilet viz

Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2021-01-20 18:02:34 +11:00

36 lines
1.1 KiB
C#

#nullable enable
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Watercloset;
using Content.Shared.Construction;
using JetBrains.Annotations;
using Robust.Shared.Interfaces.GameObjects;
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;
message.AddMarkup(Loc.GetString("Use a [color=yellow]crowbar[/color] to close the lid.\n"));
return true;
}
public void ExposeData(ObjectSerializer serializer)
{
}
}
}