diff --git a/Content.Client/Morgue/CrematoriumSystem.cs b/Content.Client/Morgue/CrematoriumSystem.cs new file mode 100644 index 0000000000..66eac263c2 --- /dev/null +++ b/Content.Client/Morgue/CrematoriumSystem.cs @@ -0,0 +1,5 @@ +using Content.Shared.Morgue; + +namespace Content.Client.Morgue; + +public sealed class CrematoriumSystem : SharedCrematoriumSystem; diff --git a/Content.Client/Morgue/MorgueSystem.cs b/Content.Client/Morgue/MorgueSystem.cs new file mode 100644 index 0000000000..b8d2f109fb --- /dev/null +++ b/Content.Client/Morgue/MorgueSystem.cs @@ -0,0 +1,5 @@ +using Content.Shared.Morgue; + +namespace Content.Client.Morgue; + +public sealed class MorgueSystem : SharedMorgueSystem; diff --git a/Content.Client/Storage/Components/EntityStorageComponent.cs b/Content.Client/Storage/Components/EntityStorageComponent.cs deleted file mode 100644 index 514d5d6595..0000000000 --- a/Content.Client/Storage/Components/EntityStorageComponent.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Content.Shared.Storage.Components; -using Robust.Shared.GameStates; - -namespace Content.Client.Storage.Components; - -[RegisterComponent] -public sealed partial class EntityStorageComponent : SharedEntityStorageComponent -{ - -} diff --git a/Content.Client/Storage/Systems/EntityStorageSystem.cs b/Content.Client/Storage/Systems/EntityStorageSystem.cs index dd3f8d3860..ca2b986667 100644 --- a/Content.Client/Storage/Systems/EntityStorageSystem.cs +++ b/Content.Client/Storage/Systems/EntityStorageSystem.cs @@ -31,7 +31,7 @@ public sealed class EntityStorageSystem : SharedEntityStorageSystem SubscribeLocalEvent(OnHandleState); } - public override bool ResolveStorage(EntityUid uid, [NotNullWhen(true)] ref SharedEntityStorageComponent? component) + public override bool ResolveStorage(EntityUid uid, [NotNullWhen(true)] ref EntityStorageComponent? component) { if (component != null) return true; diff --git a/Content.Server/Administration/Commands/AddEntityStorageCommand.cs b/Content.Server/Administration/Commands/AddEntityStorageCommand.cs index 4c562d606d..b7b6ad89e9 100644 --- a/Content.Server/Administration/Commands/AddEntityStorageCommand.cs +++ b/Content.Server/Administration/Commands/AddEntityStorageCommand.cs @@ -1,4 +1,4 @@ -using Content.Server.Storage.Components; +using Content.Shared.Storage.Components; using Content.Server.Storage.EntitySystems; using Content.Shared.Administration; using Robust.Shared.Console; diff --git a/Content.Server/Administration/Commands/LinkBluespaceLocker.cs b/Content.Server/Administration/Commands/LinkBluespaceLocker.cs index 9fac72664b..47d87565d2 100644 --- a/Content.Server/Administration/Commands/LinkBluespaceLocker.cs +++ b/Content.Server/Administration/Commands/LinkBluespaceLocker.cs @@ -1,5 +1,6 @@ using Content.Server.Storage.Components; using Content.Shared.Administration; +using Content.Shared.Storage.Components; using Robust.Shared.Console; namespace Content.Server.Administration.Commands; diff --git a/Content.Server/Administration/Commands/RemoveEntityStorageCommand.cs b/Content.Server/Administration/Commands/RemoveEntityStorageCommand.cs index 858e48a71e..f267cd28cb 100644 --- a/Content.Server/Administration/Commands/RemoveEntityStorageCommand.cs +++ b/Content.Server/Administration/Commands/RemoveEntityStorageCommand.cs @@ -1,4 +1,4 @@ -using Content.Server.Storage.Components; +using Content.Shared.Storage.Components; using Content.Server.Storage.EntitySystems; using Content.Shared.Administration; using Robust.Shared.Console; diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index 3703c8c1ac..cd89b11e10 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -14,7 +14,6 @@ using Content.Server.Pointing.Components; using Content.Server.Polymorph.Systems; using Content.Server.Popups; using Content.Server.Speech.Components; -using Content.Server.Storage.Components; using Content.Server.Storage.EntitySystems; using Content.Server.Tabletop; using Content.Server.Tabletop.Components; @@ -40,6 +39,7 @@ using Content.Shared.Movement.Systems; using Content.Shared.Nutrition.Components; using Content.Shared.Popups; using Content.Shared.Slippery; +using Content.Shared.Storage.Components; using Content.Shared.Stunnable; using Content.Shared.Tabletop.Components; using Content.Shared.Tools.Systems; diff --git a/Content.Server/Construction/Conditions/StorageWelded.cs b/Content.Server/Construction/Conditions/StorageWelded.cs index ba0927ffa3..fea18e4392 100644 --- a/Content.Server/Construction/Conditions/StorageWelded.cs +++ b/Content.Server/Construction/Conditions/StorageWelded.cs @@ -1,6 +1,6 @@ -using Content.Server.Storage.Components; using Content.Shared.Construction; using Content.Shared.Examine; +using Content.Shared.Storage.Components; using Content.Shared.Tools.Systems; using JetBrains.Annotations; diff --git a/Content.Server/Morgue/Components/ActiveCrematoriumComponent.cs b/Content.Server/Morgue/Components/ActiveCrematoriumComponent.cs deleted file mode 100644 index e5180cd892..0000000000 --- a/Content.Server/Morgue/Components/ActiveCrematoriumComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Content.Server.Morgue.Components; - -/// -/// used to track actively cooking crematoriums -/// -[RegisterComponent] -public sealed partial class ActiveCrematoriumComponent : Component -{ - [ViewVariables(VVAccess.ReadWrite)] - public float Accumulator = 0; -} diff --git a/Content.Server/Morgue/Components/CrematoriumComponent.cs b/Content.Server/Morgue/Components/CrematoriumComponent.cs deleted file mode 100644 index 7e660479bf..0000000000 --- a/Content.Server/Morgue/Components/CrematoriumComponent.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Robust.Shared.Audio; - -namespace Content.Server.Morgue.Components; - -[RegisterComponent] -public sealed partial class CrematoriumComponent : Component -{ - /// - /// The time it takes to cook in second - /// - [ViewVariables(VVAccess.ReadWrite)] - public int CookTime = 5; - - [DataField("cremateStartSound")] - public SoundSpecifier CremateStartSound = new SoundPathSpecifier("/Audio/Items/Lighters/lighter1.ogg"); - - [DataField("crematingSound")] - public SoundSpecifier CrematingSound = new SoundPathSpecifier("/Audio/Effects/burning.ogg"); - - [DataField("cremateFinishSound")] - public SoundSpecifier CremateFinishSound = new SoundPathSpecifier("/Audio/Machines/ding.ogg"); -} diff --git a/Content.Server/Morgue/CrematoriumSystem.cs b/Content.Server/Morgue/CrematoriumSystem.cs index 387be509e9..803b392fc7 100644 --- a/Content.Server/Morgue/CrematoriumSystem.cs +++ b/Content.Server/Morgue/CrematoriumSystem.cs @@ -1,195 +1,58 @@ using Content.Server.Ghost; -using Content.Server.Morgue.Components; -using Content.Server.Storage.Components; -using Content.Server.Storage.EntitySystems; -using Content.Shared.Database; -using Content.Shared.Examine; using Content.Shared.IdentityManagement; using Content.Shared.Interaction.Events; -using Content.Shared.Mind; using Content.Shared.Morgue; +using Content.Shared.Morgue.Components; using Content.Shared.Popups; -using Content.Shared.Standing; -using Content.Shared.Storage; -using Content.Shared.Storage.Components; -using Content.Shared.Verbs; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Containers; using Robust.Shared.Player; namespace Content.Server.Morgue; - -public sealed class CrematoriumSystem : EntitySystem +public sealed class CrematoriumSystem : SharedCrematoriumSystem { - [Dependency] private readonly SharedAudioSystem _audio = default!; - [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly GhostSystem _ghostSystem = default!; - [Dependency] private readonly EntityStorageSystem _entityStorage = default!; - [Dependency] private readonly SharedPopupSystem _popup = default!; - [Dependency] private readonly StandingStateSystem _standing = default!; - [Dependency] private readonly SharedMindSystem _minds = default!; - [Dependency] private readonly SharedContainerSystem _containers = default!; public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnExamine); - SubscribeLocalEvent>(AddCremateVerb); SubscribeLocalEvent(OnSuicideByEnvironment); - SubscribeLocalEvent(OnAttemptOpen); } - private void OnExamine(EntityUid uid, CrematoriumComponent component, ExaminedEvent args) - { - if (!TryComp(uid, out var appearance)) - return; - - using (args.PushGroup(nameof(CrematoriumComponent))) - { - if (_appearance.TryGetData(uid, CrematoriumVisuals.Burning, out var isBurning, appearance) && - isBurning) - { - args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-is-burning", - ("owner", uid))); - } - - if (_appearance.TryGetData(uid, StorageVisuals.HasContents, out var hasContents, appearance) && - hasContents) - { - args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-has-contents")); - } - else - { - args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-empty")); - } - } - } - - private void OnAttemptOpen(EntityUid uid, ActiveCrematoriumComponent component, ref StorageOpenAttemptEvent args) - { - args.Cancelled = true; - } - - private void AddCremateVerb(EntityUid uid, CrematoriumComponent component, GetVerbsEvent args) - { - if (!TryComp(uid, out var storage)) - return; - - if (!args.CanAccess || !args.CanInteract || args.Hands == null || storage.Open) - return; - - if (HasComp(uid)) - return; - - AlternativeVerb verb = new() - { - Text = Loc.GetString("cremate-verb-get-data-text"), - // TODO VERB ICON add flame/burn symbol? - Act = () => TryCremate(uid, component, storage), - Impact = LogImpact.High // could be a body? or evidence? I dunno. - }; - args.Verbs.Add(verb); - } - - public bool Cremate(EntityUid uid, CrematoriumComponent? component = null, EntityStorageComponent? storage = null) - { - if (!Resolve(uid, ref component, ref storage)) - return false; - - if (HasComp(uid)) - return false; - - _audio.PlayPvs(component.CremateStartSound, uid); - _appearance.SetData(uid, CrematoriumVisuals.Burning, true); - - _audio.PlayPvs(component.CrematingSound, uid); - - AddComp(uid); - return true; - } - - public bool TryCremate(EntityUid uid, CrematoriumComponent? component = null, EntityStorageComponent? storage = null) - { - if (!Resolve(uid, ref component, ref storage)) - return false; - - if (storage.Open || storage.Contents.ContainedEntities.Count < 1) - return false; - - return Cremate(uid, component, storage); - } - - private void FinishCooking(EntityUid uid, CrematoriumComponent component, EntityStorageComponent? storage = null) - { - if (!Resolve(uid, ref storage)) - return; - - _appearance.SetData(uid, CrematoriumVisuals.Burning, false); - RemComp(uid); - - if (storage.Contents.ContainedEntities.Count > 0) - { - for (var i = storage.Contents.ContainedEntities.Count - 1; i >= 0; i--) - { - var item = storage.Contents.ContainedEntities[i]; - _containers.Remove(item, storage.Contents); - Del(item); - } - var ash = Spawn("Ash", Transform(uid).Coordinates); - _containers.Insert(ash, storage.Contents); - } - - _entityStorage.OpenStorage(uid, storage); - _audio.PlayPvs(component.CremateFinishSound, uid); - } - - private void OnSuicideByEnvironment(EntityUid uid, CrematoriumComponent component, SuicideByEnvironmentEvent args) + private void OnSuicideByEnvironment(Entity ent, ref SuicideByEnvironmentEvent args) { if (args.Handled) return; var victim = args.Victim; - if (TryComp(victim, out ActorComponent? actor) && _minds.TryGetMind(victim, out var mindId, out var mind)) + if (HasComp(victim) && Mind.TryGetMind(victim, out var mindId, out var mind)) { _ghostSystem.OnGhostAttempt(mindId, false, mind: mind); if (mind.OwnedEntity is { Valid: true } entity) { - _popup.PopupEntity(Loc.GetString("crematorium-entity-storage-component-suicide-message"), entity); + Popup.PopupEntity(Loc.GetString("crematorium-entity-storage-component-suicide-message"), entity); } } - _popup.PopupEntity(Loc.GetString("crematorium-entity-storage-component-suicide-message-others", + Popup.PopupEntity(Loc.GetString("crematorium-entity-storage-component-suicide-message-others", ("victim", Identity.Entity(victim, EntityManager))), - victim, Filter.PvsExcept(victim), true, PopupType.LargeCaution); + victim, + Filter.PvsExcept(victim), + true, + PopupType.LargeCaution); - if (_entityStorage.CanInsert(victim, uid)) + if (EntityStorage.CanInsert(victim, ent.Owner)) { - _entityStorage.CloseStorage(uid); - _standing.Down(victim, false); - _entityStorage.Insert(victim, uid); + EntityStorage.CloseStorage(ent.Owner); + Standing.Down(victim, false); + EntityStorage.Insert(victim, ent.Owner); } else { + EntityStorage.CloseStorage(ent.Owner); Del(victim); } - _entityStorage.CloseStorage(uid); - Cremate(uid, component); + Cremate(ent.AsNullable()); args.Handled = true; } - - public override void Update(float frameTime) - { - base.Update(frameTime); - - var query = EntityQueryEnumerator(); - while (query.MoveNext(out var uid, out var act, out var crem)) - { - act.Accumulator += frameTime; - - if (act.Accumulator >= crem.CookTime) - FinishCooking(uid, crem); - } - } } diff --git a/Content.Server/Morgue/MorgueSystem.cs b/Content.Server/Morgue/MorgueSystem.cs index 92ed16a06b..a97ccd04cd 100644 --- a/Content.Server/Morgue/MorgueSystem.cs +++ b/Content.Server/Morgue/MorgueSystem.cs @@ -1,95 +1,46 @@ -using Content.Server.Storage.Components; -using Content.Shared.Examine; -using Content.Shared.Mobs.Components; using Content.Shared.Morgue; using Content.Shared.Morgue.Components; +using Content.Shared.Storage.Components; using Robust.Shared.Audio.Systems; -using Robust.Shared.Player; +using Robust.Shared.Timing; namespace Content.Server.Morgue; -public sealed class MorgueSystem : EntitySystem +public sealed class MorgueSystem : SharedMorgueSystem { - [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnExamine); + SubscribeLocalEvent(OnMapInit); } - /// - /// Handles the examination text for looking at a morgue. - /// - private void OnExamine(Entity ent, ref ExaminedEvent args) + private void OnMapInit(Entity ent, ref MapInitEvent args) { - if (!args.IsInDetailsRange) - return; - - _appearance.TryGetData(ent.Owner, MorgueVisuals.Contents, out var contents); - - var text = contents switch - { - MorgueContents.HasSoul => "morgue-entity-storage-component-on-examine-details-body-has-soul", - MorgueContents.HasContents => "morgue-entity-storage-component-on-examine-details-has-contents", - MorgueContents.HasMob => "morgue-entity-storage-component-on-examine-details-body-has-no-soul", - _ => "morgue-entity-storage-component-on-examine-details-empty" - }; - - args.PushMarkup(Loc.GetString(text)); + ent.Comp.NextBeep = _timing.CurTime + ent.Comp.NextBeep; } /// - /// Updates data periodically in case something died/got deleted in the morgue. - /// - private void CheckContents(EntityUid uid, MorgueComponent? morgue = null, EntityStorageComponent? storage = null, AppearanceComponent? app = null) - { - if (!Resolve(uid, ref morgue, ref storage, ref app)) - return; - - if (storage.Contents.ContainedEntities.Count == 0) - { - _appearance.SetData(uid, MorgueVisuals.Contents, MorgueContents.Empty); - return; - } - - var hasMob = false; - - foreach (var ent in storage.Contents.ContainedEntities) - { - if (!hasMob && HasComp(ent)) - hasMob = true; - - if (HasComp(ent)) - { - _appearance.SetData(uid, MorgueVisuals.Contents, MorgueContents.HasSoul, app); - return; - } - } - - _appearance.SetData(uid, MorgueVisuals.Contents, hasMob ? MorgueContents.HasMob : MorgueContents.HasContents, app); - } - - /// - /// Handles the periodic beeping that morgues do when a live body is inside. + /// Handles the periodic beeping that morgues do when a live body is inside. /// public override void Update(float frameTime) { base.Update(frameTime); + var curTime = _timing.CurTime; var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var comp, out var storage, out var appearance)) { - comp.AccumulatedFrameTime += frameTime; - - CheckContents(uid, comp, storage); - - if (comp.AccumulatedFrameTime < comp.BeepTime) + if (curTime < comp.NextBeep) continue; - comp.AccumulatedFrameTime -= comp.BeepTime; + comp.NextBeep += comp.BeepTime; + + CheckContents(uid, comp, storage); if (comp.DoSoulBeep && _appearance.TryGetData(uid, MorgueVisuals.Contents, out var contents, appearance) && contents == MorgueContents.HasSoul) { diff --git a/Content.Server/NPC/Systems/NPCUtilitySystem.cs b/Content.Server/NPC/Systems/NPCUtilitySystem.cs index 26910d1603..5f077a06bb 100644 --- a/Content.Server/NPC/Systems/NPCUtilitySystem.cs +++ b/Content.Server/NPC/Systems/NPCUtilitySystem.cs @@ -7,7 +7,6 @@ using Content.Server.NPC.Queries.Curves; using Content.Server.NPC.Queries.Queries; using Content.Server.Nutrition.Components; using Content.Server.Nutrition.EntitySystems; -using Content.Server.Storage.Components; using Content.Server.Temperature.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Damage; @@ -20,6 +19,7 @@ using Content.Shared.Mobs.Systems; using Content.Shared.NPC.Systems; using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; +using Content.Shared.Storage.Components; using Content.Shared.Stunnable; using Content.Shared.Tools.Systems; using Content.Shared.Turrets; diff --git a/Content.Server/Resist/ResistLockerSystem.cs b/Content.Server/Resist/ResistLockerSystem.cs index 597f3ee8d0..3698306b31 100644 --- a/Content.Server/Resist/ResistLockerSystem.cs +++ b/Content.Server/Resist/ResistLockerSystem.cs @@ -1,11 +1,11 @@ using Content.Server.Popups; -using Content.Server.Storage.Components; using Content.Server.Storage.EntitySystems; using Content.Shared.DoAfter; using Content.Shared.Lock; using Content.Shared.Movement.Events; using Content.Shared.Popups; using Content.Shared.Resist; +using Content.Shared.Storage.Components; using Content.Shared.Tools.Components; using Content.Shared.Tools.Systems; using Content.Shared.ActionBlocker; diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs index 3f91b0fa71..38c3480078 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs @@ -3,7 +3,7 @@ using Content.Shared.Damage; using Content.Shared.Revenant; using Robust.Shared.Random; using Content.Shared.Tag; -using Content.Server.Storage.Components; +using Content.Shared.Storage.Components; using Content.Server.Light.Components; using Content.Server.Ghost; using Robust.Shared.Physics; diff --git a/Content.Server/StationEvents/Events/BluespaceLockerRule.cs b/Content.Server/StationEvents/Events/BluespaceLockerRule.cs index c07b178093..5e0ce6eb67 100644 --- a/Content.Server/StationEvents/Events/BluespaceLockerRule.cs +++ b/Content.Server/StationEvents/Events/BluespaceLockerRule.cs @@ -4,6 +4,7 @@ using Content.Server.Storage.Components; using Content.Server.Storage.EntitySystems; using Content.Shared.Access.Components; using Content.Shared.Station.Components; +using Content.Shared.Storage.Components; using Content.Shared.GameTicking.Components; namespace Content.Server.StationEvents.Events; diff --git a/Content.Server/StationEvents/Events/RandomEntityStorageSpawnRule.cs b/Content.Server/StationEvents/Events/RandomEntityStorageSpawnRule.cs index a9f2793818..2c2d2414b7 100644 --- a/Content.Server/StationEvents/Events/RandomEntityStorageSpawnRule.cs +++ b/Content.Server/StationEvents/Events/RandomEntityStorageSpawnRule.cs @@ -1,8 +1,7 @@ -using Content.Server.GameTicking.Rules.Components; using Content.Server.StationEvents.Components; -using Content.Server.Storage.Components; using Content.Server.Storage.EntitySystems; using Content.Shared.GameTicking.Components; +using Content.Shared.Storage.Components; using Robust.Shared.Map; using Robust.Shared.Random; diff --git a/Content.Server/Storage/Components/EntityStorageComponent.cs b/Content.Server/Storage/Components/EntityStorageComponent.cs deleted file mode 100644 index 3fba89b64a..0000000000 --- a/Content.Server/Storage/Components/EntityStorageComponent.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Content.Server.Atmos; -using Content.Shared.Atmos; -using Content.Shared.Storage.Components; -using Robust.Shared.GameStates; - -namespace Content.Server.Storage.Components; - -[RegisterComponent] -public sealed partial class EntityStorageComponent : SharedEntityStorageComponent, IGasMixtureHolder -{ - /// - /// Gas currently contained in this entity storage. - /// None while open. Grabs gas from the atmosphere when closed, and exposes any entities inside to it. - /// - [ViewVariables(VVAccess.ReadWrite)] - [DataField("air")] - public GasMixture Air { get; set; } = new (200); -} diff --git a/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs b/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs index 27d84de28c..c38a3e9b17 100644 --- a/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs +++ b/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs @@ -68,7 +68,7 @@ public sealed class EntityStorageSystem : SharedEntityStorageSystem } } - protected override void OnComponentInit(EntityUid uid, SharedEntityStorageComponent component, ComponentInit args) + protected override void OnComponentInit(EntityUid uid, EntityStorageComponent component, ComponentInit args) { base.OnComponentInit(uid, component, args); @@ -76,7 +76,7 @@ public sealed class EntityStorageSystem : SharedEntityStorageSystem _construction.AddContainer(uid, ContainerName, construction); } - public override bool ResolveStorage(EntityUid uid, [NotNullWhen(true)] ref SharedEntityStorageComponent? component) + public override bool ResolveStorage(EntityUid uid, [NotNullWhen(true)] ref EntityStorageComponent? component) { if (component != null) return true; @@ -107,7 +107,7 @@ public sealed class EntityStorageSystem : SharedEntityStorageSystem args.Contents.AddRange(ent.Comp.Contents.ContainedEntities); } - protected override void TakeGas(EntityUid uid, SharedEntityStorageComponent component) + protected override void TakeGas(EntityUid uid, EntityStorageComponent component) { if (!component.Airtight) return; @@ -121,7 +121,7 @@ public sealed class EntityStorageSystem : SharedEntityStorageSystem } } - public override void ReleaseGas(EntityUid uid, SharedEntityStorageComponent component) + public override void ReleaseGas(EntityUid uid, EntityStorageComponent component) { var serverComp = (EntityStorageComponent) component; diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactCrusherSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactCrusherSystem.cs index 8bc87cb378..885186f79c 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactCrusherSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactCrusherSystem.cs @@ -2,10 +2,10 @@ using Content.Server.Body.Systems; using Content.Server.Popups; using Content.Server.Power.EntitySystems; using Content.Server.Stack; -using Content.Server.Storage.Components; using Content.Shared.Body.Components; using Content.Shared.Damage; using Content.Shared.Power; +using Content.Shared.Storage.Components; using Content.Shared.Verbs; using Content.Shared.Whitelist; using Content.Shared.Xenoarchaeology.Equipment; diff --git a/Content.Shared/Morgue/Components/ActiveCrematoriumComponent.cs b/Content.Shared/Morgue/Components/ActiveCrematoriumComponent.cs new file mode 100644 index 0000000000..6d3707c0f7 --- /dev/null +++ b/Content.Shared/Morgue/Components/ActiveCrematoriumComponent.cs @@ -0,0 +1,9 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Morgue.Components; + +/// +/// Used to track actively cooking crematoriums. +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class ActiveCrematoriumComponent : Component; diff --git a/Content.Shared/Morgue/Components/CrematoriumComponent.cs b/Content.Shared/Morgue/Components/CrematoriumComponent.cs new file mode 100644 index 0000000000..c372e1f71b --- /dev/null +++ b/Content.Shared/Morgue/Components/CrematoriumComponent.cs @@ -0,0 +1,42 @@ +using Robust.Shared.Audio; +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; + +namespace Content.Shared.Morgue.Components; + +/// +/// Allows an entity storage to dispose bodies by turning them into ash. +/// +[RegisterComponent, NetworkedComponent] +[AutoGenerateComponentState, AutoGenerateComponentPause] +public sealed partial class CrematoriumComponent : Component +{ + /// + /// The entity to spawn when something was burned. + /// + [DataField, AutoNetworkedField] + public EntProtoId LeftOverProtoId = "Ash"; + + /// + /// The time it takes to cremate something. + /// + [DataField, AutoNetworkedField] + public TimeSpan CookTime = TimeSpan.FromSeconds(5); + + /// + /// The timestamp at which cremating is finished. + /// + [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] + [AutoNetworkedField, AutoPausedField] + public TimeSpan ActiveUntil = TimeSpan.Zero; + + [DataField] + public SoundSpecifier CremateStartSound = new SoundPathSpecifier("/Audio/Items/Lighters/lighter1.ogg"); + + [DataField] + public SoundSpecifier CrematingSound = new SoundPathSpecifier("/Audio/Effects/burning.ogg"); + + [DataField] + public SoundSpecifier CremateFinishSound = new SoundPathSpecifier("/Audio/Machines/ding.ogg"); +} diff --git a/Content.Shared/Morgue/Components/EntityStorageLayingDownOverrideComponent.cs b/Content.Shared/Morgue/Components/EntityStorageLayingDownOverrideComponent.cs index 6b15a0cdb6..30a2637314 100644 --- a/Content.Shared/Morgue/Components/EntityStorageLayingDownOverrideComponent.cs +++ b/Content.Shared/Morgue/Components/EntityStorageLayingDownOverrideComponent.cs @@ -1,6 +1,10 @@ +using Robust.Shared.GameStates; + namespace Content.Shared.Morgue.Components; -[RegisterComponent] -public sealed partial class EntityStorageLayingDownOverrideComponent : Component -{ -} +/// +/// Makes an entity storage only accept entities that are laying down. +/// This is true for mobs that are crit, dead or crawling. +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class EntityStorageLayingDownOverrideComponent : Component; diff --git a/Content.Shared/Morgue/Components/MorgueComponent.cs b/Content.Shared/Morgue/Components/MorgueComponent.cs index 5d3fa45161..176e2269c8 100644 --- a/Content.Shared/Morgue/Components/MorgueComponent.cs +++ b/Content.Shared/Morgue/Components/MorgueComponent.cs @@ -1,26 +1,38 @@ using Robust.Shared.Audio; using Robust.Shared.GameStates; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.Morgue.Components; +/// +/// When added to an entity storage this component will keep track of the mind status of the player inside. +/// [RegisterComponent, NetworkedComponent] +[AutoGenerateComponentState, AutoGenerateComponentPause] public sealed partial class MorgueComponent : Component { /// - /// Whether or not the morgue beeps if a living player is inside. + /// Whether or not the morgue beeps if a living player is inside. /// - [DataField] + [DataField, AutoNetworkedField] public bool DoSoulBeep = true; - [DataField] - public float AccumulatedFrameTime = 0f; + /// + /// The timestamp for the next beep. + /// + [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] + [AutoPausedField] + public TimeSpan NextBeep = TimeSpan.Zero; /// - /// The amount of time between each beep. + /// The amount of time between each beep. /// [DataField] - public float BeepTime = 10f; + public TimeSpan BeepTime = TimeSpan.FromSeconds(10); + /// + /// The beep sound to play. + /// [DataField] public SoundSpecifier OccupantHasSoulAlarmSound = new SoundPathSpecifier("/Audio/Weapons/Guns/EmptyAlarm/smg_empty_alarm.ogg"); } diff --git a/Content.Shared/Morgue/SharedCrematoriumSystem.cs b/Content.Shared/Morgue/SharedCrematoriumSystem.cs new file mode 100644 index 0000000000..6c216f0232 --- /dev/null +++ b/Content.Shared/Morgue/SharedCrematoriumSystem.cs @@ -0,0 +1,170 @@ +using Content.Shared.Database; +using Content.Shared.Examine; +using Content.Shared.Mind; +using Content.Shared.Morgue.Components; +using Content.Shared.Popups; +using Content.Shared.Standing; +using Content.Shared.Storage; +using Content.Shared.Storage.Components; +using Content.Shared.Storage.EntitySystems; +using Content.Shared.Verbs; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Containers; +using Robust.Shared.Network; +using Robust.Shared.Timing; + +namespace Content.Shared.Morgue; + +public abstract class SharedCrematoriumSystem : EntitySystem +{ + [Dependency] protected readonly SharedEntityStorageSystem EntityStorage = default!; + [Dependency] protected readonly SharedPopupSystem Popup = default!; + [Dependency] protected readonly StandingStateSystem Standing = default!; + [Dependency] protected readonly SharedMindSystem Mind = default!; + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly INetManager _net = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly SharedContainerSystem _container = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnExamine); + SubscribeLocalEvent>(AddCremateVerb); + SubscribeLocalEvent(OnAttemptOpen); + } + + private void OnExamine(Entity ent, ref ExaminedEvent args) + { + if (!TryComp(ent, out var appearance)) + return; + + using (args.PushGroup(nameof(CrematoriumComponent))) + { + if (_appearance.TryGetData(ent.Owner, CrematoriumVisuals.Burning, out var isBurning, appearance) && + isBurning) + { + args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-is-burning", + ("owner", ent.Owner))); + } + + if (_appearance.TryGetData(ent.Owner, StorageVisuals.HasContents, out var hasContents, appearance) && + hasContents) + { + args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-has-contents")); + } + else + { + args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-empty")); + } + } + } + + private void OnAttemptOpen(Entity ent, ref StorageOpenAttemptEvent args) + { + args.Cancelled = true; + } + + private void AddCremateVerb(EntityUid uid, CrematoriumComponent component, GetVerbsEvent args) + { + if (!TryComp(uid, out var storage)) + return; + + if (!args.CanAccess || !args.CanInteract || args.Hands == null || storage.Open) + return; + + if (HasComp(uid)) + return; + + AlternativeVerb verb = new() + { + Text = Loc.GetString("cremate-verb-get-data-text"), + // TODO VERB ICON add flame/burn symbol? + Act = () => TryCremate((uid, component, storage), args.User), + Impact = LogImpact.High // could be a body? or evidence? I dunno. + }; + args.Verbs.Add(verb); + } + + /// + /// Start the cremation. + /// + public bool Cremate(Entity ent, EntityUid? user = null) + { + if (!Resolve(ent, ref ent.Comp)) + return false; + + if (HasComp(ent)) + return false; + + _audio.PlayPredicted(ent.Comp.CremateStartSound, ent.Owner, user); + _audio.PlayPredicted(ent.Comp.CrematingSound, ent.Owner, user); + _appearance.SetData(ent.Owner, CrematoriumVisuals.Burning, true); + + AddComp(ent); + ent.Comp.ActiveUntil = _timing.CurTime + ent.Comp.CookTime; + Dirty(ent); + return true; + } + + /// + /// Try to start to start the cremation. + /// Only works when the crematorium is closed and there are entities inside. + /// + public bool TryCremate(Entity ent, EntityUid? user = null) + { + if (!Resolve(ent, ref ent.Comp1, ref ent.Comp2)) + return false; + + if (ent.Comp2.Open || ent.Comp2.Contents.ContainedEntities.Count < 1) + return false; + + return Cremate((ent.Owner, ent.Comp1), user); + } + + /// + /// Finish the cremation process. + /// This will delete the entities inside and spawn ash. + /// + private void FinishCooking(Entity ent) + { + if (!Resolve(ent, ref ent.Comp1, ref ent.Comp2)) + return; + + _appearance.SetData(ent.Owner, CrematoriumVisuals.Burning, false); + RemComp(ent); + + if (ent.Comp2.Contents.ContainedEntities.Count > 0) + { + for (var i = ent.Comp2.Contents.ContainedEntities.Count - 1; i >= 0; i--) + { + var item = ent.Comp2.Contents.ContainedEntities[i]; + _container.Remove(item, ent.Comp2.Contents); + PredictedDel(item); + } + PredictedTrySpawnInContainer(ent.Comp1.LeftOverProtoId, ent.Owner, ent.Comp2.Contents.ID, out _); + } + + EntityStorage.OpenStorage(ent.Owner, ent.Comp2); + + if (_net.IsServer) // can't predict without the user + _audio.PlayPvs(ent.Comp1.CremateFinishSound, ent.Owner); + } + + public override void Update(float frameTime) + { + base.Update(frameTime); + + var curTime = _timing.CurTime; + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out _, out var crematorium)) + { + if (curTime < crematorium.ActiveUntil) + continue; + + FinishCooking((uid, crematorium, null)); + } + } +} diff --git a/Content.Shared/Morgue/SharedMorgueSystem.cs b/Content.Shared/Morgue/SharedMorgueSystem.cs new file mode 100644 index 0000000000..3da92d798a --- /dev/null +++ b/Content.Shared/Morgue/SharedMorgueSystem.cs @@ -0,0 +1,83 @@ +using Content.Shared.Mobs.Components; +using Content.Shared.Storage.Components; +using Content.Shared.Examine; +using Content.Shared.Morgue.Components; +using Robust.Shared.Player; + +namespace Content.Shared.Morgue; + +public abstract class SharedMorgueSystem : EntitySystem +{ + [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnExamine); + SubscribeLocalEvent(OnClosed); + SubscribeLocalEvent(OnOpened); + } + + /// + /// Handles the examination text for looking at a morgue. + /// + private void OnExamine(Entity ent, ref ExaminedEvent args) + { + if (!args.IsInDetailsRange) + return; + + _appearance.TryGetData(ent.Owner, MorgueVisuals.Contents, out var contents); + + var text = contents switch + { + MorgueContents.HasSoul => "morgue-entity-storage-component-on-examine-details-body-has-soul", + MorgueContents.HasContents => "morgue-entity-storage-component-on-examine-details-has-contents", + MorgueContents.HasMob => "morgue-entity-storage-component-on-examine-details-body-has-no-soul", + _ => "morgue-entity-storage-component-on-examine-details-empty" + }; + + args.PushMarkup(Loc.GetString(text)); + } + + private void OnClosed(Entity ent, ref StorageAfterCloseEvent args) + { + CheckContents(ent.Owner, ent.Comp); + } + + private void OnOpened(Entity ent, ref StorageAfterOpenEvent args) + { + CheckContents(ent.Owner, ent.Comp); + } + + /// + /// Updates data in case something died/got deleted in the morgue. + /// + public void CheckContents(EntityUid uid, MorgueComponent? morgue = null, EntityStorageComponent? storage = null, AppearanceComponent? app = null) + { + if (!Resolve(uid, ref morgue, ref storage, ref app)) + return; + + if (storage.Contents.ContainedEntities.Count == 0) + { + _appearance.SetData(uid, MorgueVisuals.Contents, MorgueContents.Empty, app); + return; + } + + var hasMob = false; + + foreach (var ent in storage.Contents.ContainedEntities) + { + if (!hasMob && HasComp(ent)) + hasMob = true; + + if (HasComp(ent)) + { + _appearance.SetData(uid, MorgueVisuals.Contents, MorgueContents.HasSoul, app); + return; + } + } + + _appearance.SetData(uid, MorgueVisuals.Contents, hasMob ? MorgueContents.HasMob : MorgueContents.HasContents, app); + } +} diff --git a/Content.Shared/Storage/Components/SharedEntityStorageComponent.cs b/Content.Shared/Storage/Components/EntityStorageComponent.cs similarity index 89% rename from Content.Shared/Storage/Components/SharedEntityStorageComponent.cs rename to Content.Shared/Storage/Components/EntityStorageComponent.cs index a0d4e418cc..9d720e4736 100644 --- a/Content.Shared/Storage/Components/SharedEntityStorageComponent.cs +++ b/Content.Shared/Storage/Components/EntityStorageComponent.cs @@ -1,4 +1,5 @@ using System.Numerics; +using Content.Shared.Atmos; using Content.Shared.Physics; using Content.Shared.Whitelist; using Robust.Shared.Audio; @@ -8,8 +9,8 @@ using Robust.Shared.Serialization; namespace Content.Shared.Storage.Components; -[NetworkedComponent] -public abstract partial class SharedEntityStorageComponent : Component +[RegisterComponent, NetworkedComponent] +public sealed partial class EntityStorageComponent : Component, IGasMixtureHolder { public readonly float MaxSize = 1.0f; // maximum width or height of an entity allowed inside the storage. @@ -19,7 +20,7 @@ public abstract partial class SharedEntityStorageComponent : Component /// /// Collision masks that get removed when the storage gets opened. /// - public readonly int MasksToRemove = (int) ( + public readonly int MasksToRemove = (int)( CollisionGroup.MidImpassable | CollisionGroup.HighImpassable | CollisionGroup.LowImpassable); @@ -33,13 +34,13 @@ public abstract partial class SharedEntityStorageComponent : Component /// /// The total amount of items that can fit in one entitystorage /// - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public int Capacity = 30; /// /// Whether or not the entity still has collision when open /// - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public bool IsCollidableWhenOpen; /// @@ -47,45 +48,45 @@ public abstract partial class SharedEntityStorageComponent : Component /// If false, it prevents the storage from opening when the entity inside of it moves. /// This is for objects that you want the player to move while inside, like large cardboard boxes, without opening the storage. /// - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public bool OpenOnMove = true; //The offset for where items are emptied/vacuumed for the EntityStorage. - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public Vector2 EnteringOffset = new(0, 0); //The collision groups checked, so that items are depositied or grabbed from inside walls. - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public CollisionGroup EnteringOffsetCollisionFlags = CollisionGroup.Impassable | CollisionGroup.MidImpassable; /// /// How close you have to be to the "entering" spot to be able to enter /// - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public float EnteringRange = 0.18f; /// /// Whether or not to show the contents when the storage is closed /// - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public bool ShowContents; /// /// Whether or not light is occluded by the storage /// - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public bool OccludesLight = true; /// /// Whether or not all the contents stored should be deleted with the entitystorage /// - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public bool DeleteContentsOnDestruction; /// /// Whether or not the container is sealed and traps air inside of it /// - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public bool Airtight = true; /// @@ -118,6 +119,13 @@ public abstract partial class SharedEntityStorageComponent : Component /// [ViewVariables] public Container Contents = default!; + + /// + /// Gas currently contained in this entity storage. + /// None while open. Grabs gas from the atmosphere when closed, and exposes any entities inside to it. + /// + [DataField] + public GasMixture Air { get; set; } = new(200); } [Serializable, NetSerializable] diff --git a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs index fd7cb87b2a..6039d3b940 100644 --- a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs @@ -48,12 +48,12 @@ public abstract class SharedEntityStorageSystem : EntitySystem public const string ContainerName = "entity_storage"; - protected void OnEntityUnpausedEvent(EntityUid uid, SharedEntityStorageComponent component, EntityUnpausedEvent args) + protected void OnEntityUnpausedEvent(EntityUid uid, EntityStorageComponent component, EntityUnpausedEvent args) { component.NextInternalOpenAttempt += args.PausedTime; } - protected void OnGetState(EntityUid uid, SharedEntityStorageComponent component, ref ComponentGetState args) + protected void OnGetState(EntityUid uid, EntityStorageComponent component, ref ComponentGetState args) { args.State = new EntityStorageComponentState(component.Open, component.Capacity, @@ -63,7 +63,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem component.NextInternalOpenAttempt); } - protected void OnHandleState(EntityUid uid, SharedEntityStorageComponent component, ref ComponentHandleState args) + protected void OnHandleState(EntityUid uid, EntityStorageComponent component, ref ComponentHandleState args) { if (args.Current is not EntityStorageComponentState state) return; @@ -75,19 +75,19 @@ public abstract class SharedEntityStorageSystem : EntitySystem component.NextInternalOpenAttempt = state.NextInternalOpenAttempt; } - protected virtual void OnComponentInit(EntityUid uid, SharedEntityStorageComponent component, ComponentInit args) + protected virtual void OnComponentInit(EntityUid uid, EntityStorageComponent component, ComponentInit args) { component.Contents = _container.EnsureContainer(uid, ContainerName); component.Contents.ShowContents = component.ShowContents; component.Contents.OccludesLight = component.OccludesLight; } - protected virtual void OnComponentStartup(EntityUid uid, SharedEntityStorageComponent component, ComponentStartup args) + protected virtual void OnComponentStartup(EntityUid uid, EntityStorageComponent component, ComponentStartup args) { _appearance.SetData(uid, StorageVisuals.Open, component.Open); } - protected void OnInteract(EntityUid uid, SharedEntityStorageComponent component, ActivateInWorldEvent args) + protected void OnInteract(EntityUid uid, EntityStorageComponent component, ActivateInWorldEvent args) { if (args.Handled || !args.Complex) return; @@ -96,9 +96,9 @@ public abstract class SharedEntityStorageSystem : EntitySystem ToggleOpen(args.User, uid, component); } - public abstract bool ResolveStorage(EntityUid uid, [NotNullWhen(true)] ref SharedEntityStorageComponent? component); + public abstract bool ResolveStorage(EntityUid uid, [NotNullWhen(true)] ref EntityStorageComponent? component); - protected void OnLockToggleAttempt(EntityUid uid, SharedEntityStorageComponent target, ref LockToggleAttemptEvent args) + protected void OnLockToggleAttempt(EntityUid uid, EntityStorageComponent target, ref LockToggleAttemptEvent args) { // Cannot (un)lock open lockers. if (target.Open) @@ -109,7 +109,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem args.Cancelled = true; } - protected void OnDestruction(EntityUid uid, SharedEntityStorageComponent component, DestructionEventArgs args) + protected void OnDestruction(EntityUid uid, EntityStorageComponent component, DestructionEventArgs args) { component.Open = true; Dirty(uid, component); @@ -125,7 +125,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem } } - protected void OnRelayMovement(EntityUid uid, SharedEntityStorageComponent component, ref ContainerRelayMovementEntityEvent args) + protected void OnRelayMovement(EntityUid uid, EntityStorageComponent component, ref ContainerRelayMovementEntityEvent args) { if (!HasComp(args.Entity)) return; @@ -136,21 +136,21 @@ public abstract class SharedEntityStorageSystem : EntitySystem if (_timing.CurTime < component.NextInternalOpenAttempt) return; - component.NextInternalOpenAttempt = _timing.CurTime + SharedEntityStorageComponent.InternalOpenAttemptDelay; + component.NextInternalOpenAttempt = _timing.CurTime + EntityStorageComponent.InternalOpenAttemptDelay; Dirty(uid, component); if (component.OpenOnMove) TryOpenStorage(args.Entity, uid); } - protected void OnFoldAttempt(EntityUid uid, SharedEntityStorageComponent component, ref FoldAttemptEvent args) + protected void OnFoldAttempt(EntityUid uid, EntityStorageComponent component, ref FoldAttemptEvent args) { if (args.Cancelled) return; args.Cancelled = component.Open || component.Contents.ContainedEntities.Count != 0; } - protected void AddToggleOpenVerb(EntityUid uid, SharedEntityStorageComponent component, GetVerbsEvent args) + protected void AddToggleOpenVerb(EntityUid uid, EntityStorageComponent component, GetVerbsEvent args) { if (!args.CanAccess || !args.CanInteract) return; @@ -175,7 +175,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem } - public void ToggleOpen(EntityUid user, EntityUid target, SharedEntityStorageComponent? component = null) + public void ToggleOpen(EntityUid user, EntityUid target, EntityStorageComponent? component = null) { if (!ResolveStorage(target, ref component)) return; @@ -190,7 +190,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem } } - public void EmptyContents(EntityUid uid, SharedEntityStorageComponent? component = null) + public void EmptyContents(EntityUid uid, EntityStorageComponent? component = null) { if (!ResolveStorage(uid, ref component)) return; @@ -203,7 +203,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem } } - public void OpenStorage(EntityUid uid, SharedEntityStorageComponent? component = null) + public void OpenStorage(EntityUid uid, EntityStorageComponent? component = null) { if (!ResolveStorage(uid, ref component)) return; @@ -224,7 +224,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem RaiseLocalEvent(uid, ref afterev); } - public void CloseStorage(EntityUid uid, SharedEntityStorageComponent? component = null) + public void CloseStorage(EntityUid uid, EntityStorageComponent? component = null) { if (!ResolveStorage(uid, ref component)) return; @@ -275,7 +275,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem RaiseLocalEvent(uid, ref afterev); } - public bool Insert(EntityUid toInsert, EntityUid container, SharedEntityStorageComponent? component = null) + public bool Insert(EntityUid toInsert, EntityUid container, EntityStorageComponent? component = null) { if (!ResolveStorage(container, ref component)) return false; @@ -295,7 +295,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem return true; } - public bool Remove(EntityUid toRemove, EntityUid container, SharedEntityStorageComponent? component = null, TransformComponent? xform = null) + public bool Remove(EntityUid toRemove, EntityUid container, EntityStorageComponent? component = null, TransformComponent? xform = null) { if (!Resolve(container, ref xform, false)) return false; @@ -322,7 +322,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem return true; } - public bool CanInsert(EntityUid toInsert, EntityUid container, SharedEntityStorageComponent? component = null) + public bool CanInsert(EntityUid toInsert, EntityUid container, EntityStorageComponent? component = null) { if (!ResolveStorage(container, ref component)) return false; @@ -379,7 +379,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem return true; } - public bool IsOpen(EntityUid target, SharedEntityStorageComponent? component = null) + public bool IsOpen(EntityUid target, EntityStorageComponent? component = null) { if (!ResolveStorage(target, ref component)) return false; @@ -387,7 +387,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem return component.Open; } - public bool CanOpen(EntityUid user, EntityUid target, bool silent = false, SharedEntityStorageComponent? component = null) + public bool CanOpen(EntityUid user, EntityUid target, bool silent = false, EntityStorageComponent? component = null) { if (!ResolveStorage(target, ref component)) return false; @@ -429,7 +429,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem return !ev.Cancelled; } - public bool AddToContents(EntityUid toAdd, EntityUid container, SharedEntityStorageComponent? component = null) + public bool AddToContents(EntityUid toAdd, EntityUid container, EntityStorageComponent? component = null) { if (!ResolveStorage(container, ref component)) return false; @@ -440,7 +440,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem return Insert(toAdd, container, component); } - private void ModifyComponents(EntityUid uid, SharedEntityStorageComponent? component = null) + private void ModifyComponents(EntityUid uid, EntityStorageComponent? component = null) { if (!ResolveStorage(uid, ref component)) return; @@ -472,12 +472,12 @@ public abstract class SharedEntityStorageSystem : EntitySystem _appearance.SetData(uid, StorageVisuals.HasContents, component.Contents.ContainedEntities.Count > 0); } - protected virtual void TakeGas(EntityUid uid, SharedEntityStorageComponent component) + protected virtual void TakeGas(EntityUid uid, EntityStorageComponent component) { } - public virtual void ReleaseGas(EntityUid uid, SharedEntityStorageComponent component) + public virtual void ReleaseGas(EntityUid uid, EntityStorageComponent component) { }