2023-04-07 11:21:12 -07:00
|
|
|
using Content.Server.Administration.Managers;
|
|
|
|
|
using Content.Shared.Administration;
|
2023-11-19 17:44:42 +00:00
|
|
|
using Content.Shared.Explosion;
|
2023-08-25 18:50:46 +10:00
|
|
|
using Content.Shared.Ghost;
|
2023-09-12 22:34:04 +10:00
|
|
|
using Content.Shared.Hands;
|
2023-04-07 11:21:12 -07:00
|
|
|
using Content.Shared.Lock;
|
2022-03-30 16:23:20 -07:00
|
|
|
using Content.Shared.Storage;
|
2023-04-07 11:21:12 -07:00
|
|
|
using Content.Shared.Storage.Components;
|
2023-09-11 21:20:46 +10:00
|
|
|
using Content.Shared.Storage.EntitySystems;
|
2021-12-05 18:09:01 +01:00
|
|
|
using Content.Shared.Verbs;
|
2021-10-05 14:29:03 +11:00
|
|
|
using Robust.Server.GameObjects;
|
2023-09-12 22:34:04 +10:00
|
|
|
using Robust.Shared.Map;
|
2023-04-07 11:21:12 -07:00
|
|
|
using Robust.Shared.Player;
|
2023-10-16 16:54:10 +11:00
|
|
|
using Robust.Shared.Prototypes;
|
2022-04-04 23:00:52 -07:00
|
|
|
using Robust.Shared.Utility;
|
2018-10-25 17:35:34 -07:00
|
|
|
|
2023-09-11 21:20:46 +10:00
|
|
|
namespace Content.Server.Storage.EntitySystems;
|
2022-02-24 23:48:53 +13:00
|
|
|
|
2023-09-11 21:20:46 +10:00
|
|
|
public sealed partial class StorageSystem : SharedStorageSystem
|
|
|
|
|
{
|
2023-10-16 16:54:10 +11:00
|
|
|
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
2022-02-24 23:48:53 +13:00
|
|
|
|
2023-09-11 21:20:46 +10:00
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
2023-11-19 17:44:42 +00:00
|
|
|
SubscribeLocalEvent<StorageComponent, BeforeExplodeEvent>(OnExploded);
|
2022-02-24 23:48:53 +13:00
|
|
|
|
2023-09-11 21:20:46 +10:00
|
|
|
SubscribeLocalEvent<StorageFillComponent, MapInitEvent>(OnStorageFillMapInit);
|
|
|
|
|
}
|
2022-04-28 06:11:15 -06:00
|
|
|
|
2023-11-19 17:44:42 +00:00
|
|
|
private void OnExploded(Entity<StorageComponent> ent, ref BeforeExplodeEvent args)
|
|
|
|
|
{
|
|
|
|
|
args.Contents.AddRange(ent.Comp.Container.ContainedEntities);
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-12 22:34:04 +10:00
|
|
|
/// <inheritdoc />
|
|
|
|
|
public override void PlayPickupAnimation(EntityUid uid, EntityCoordinates initialCoordinates, EntityCoordinates finalCoordinates,
|
|
|
|
|
Angle initialRotation, EntityUid? user = null)
|
|
|
|
|
{
|
|
|
|
|
var filter = Filter.Pvs(uid).RemoveWhereAttachedEntity(e => e == user);
|
|
|
|
|
RaiseNetworkEvent(new PickupAnimationEvent(GetNetEntity(uid), GetNetCoordinates(initialCoordinates), GetNetCoordinates(finalCoordinates), initialRotation), filter);
|
|
|
|
|
}
|
2018-10-25 17:35:34 -07:00
|
|
|
}
|