Toilet Upgrade (needs review) (#22133)

* Toilet Draft

* fixes

* toilets now have secret stash to place items in cistern.

* fixes

* plungers now unblock toilets.

* fix sprite

* new sprites and fix

* fixes

* improve seat sprites.

* fix

* removed visualisersystem changed to genericvisualizers

* flush sound for toilets and copyright for toilet sprites.

* fix atrributions

* fixes

* fix datafield flushtime

* sprite improvements

* fixes

* multiple changes

* fix

* fix

* fixes remove vv

* moved stash related functions to secret stash system from toilet.

* fix

* fix

* changes for recent review.

* fix

* fix
This commit is contained in:
brainfood1183
2024-03-31 04:21:18 +01:00
committed by GitHub
parent 80c4d3ea0f
commit 5f063d2d6d
51 changed files with 890 additions and 465 deletions

View File

@@ -1,12 +1,10 @@
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using Content.Shared.Body.Components;
using Content.Shared.Disposal.Components;
using Content.Shared.DoAfter;
using Content.Shared.DragDrop;
using Content.Shared.Emag.Systems;
using Content.Shared.Item;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Throwing;
using Robust.Shared.Audio;
using Robust.Shared.Physics.Components;
@@ -26,7 +24,6 @@ public abstract class SharedDisposalUnitSystem : EntitySystem
{
[Dependency] protected readonly IGameTiming GameTiming = default!;
[Dependency] protected readonly MetaDataSystem Metadata = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] protected readonly SharedJointSystem Joints = default!;
protected static TimeSpan ExitAttemptDelay = TimeSpan.FromSeconds(0.5);
@@ -112,19 +109,21 @@ public abstract class SharedDisposalUnitSystem : EntitySystem
if (!Transform(uid).Anchored)
return false;
// TODO: Probably just need a disposable tag.
var storable = HasComp<ItemComponent>(entity);
if (!storable && !HasComp<BodyComponent>(entity))
return false;
//Check if the entity is a mob and if mobs can be inserted
if (TryComp<MobStateComponent>(entity, out var damageState) && !component.MobsCanEnter)
if (component.Blacklist?.IsValid(entity, EntityManager) == true)
return false;
if (TryComp<PhysicsComponent>(entity, out var physics) && (physics.CanCollide || storable))
return true;
if (component.Whitelist != null && component.Whitelist?.IsValid(entity, EntityManager) != true)
return false;
if (TryComp<PhysicsComponent>(entity, out var physics) && (physics.CanCollide) || storable)
return true;
else
return false;
return damageState != null && (!component.MobsCanEnter || _mobState.IsDead(entity, damageState));
}
public abstract void DoInsertDisposalUnit(EntityUid uid, EntityUid toInsert, EntityUid user, SharedDisposalUnitComponent? disposal = null);