2021-12-05 18:09:01 +01:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Hands.Components;
|
|
|
|
|
using Content.Server.Pulling;
|
|
|
|
|
using Content.Shared.ActionBlocker;
|
2020-11-09 20:22:19 -08:00
|
|
|
using Content.Shared.Alert;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Buckle.Components;
|
2022-02-17 15:40:03 +13:00
|
|
|
using Content.Shared.Interaction;
|
2021-09-15 03:07:37 +10:00
|
|
|
using Content.Shared.MobState.Components;
|
2021-09-26 15:18:45 +02:00
|
|
|
using Content.Shared.Popups;
|
2021-10-05 14:29:03 +11:00
|
|
|
using Content.Shared.Pulling.Components;
|
2021-06-27 19:02:46 +10:00
|
|
|
using Content.Shared.Standing;
|
2021-10-10 12:47:26 +02:00
|
|
|
using Content.Shared.Stunnable;
|
2022-01-15 03:26:37 +01:00
|
|
|
using Robust.Server.GameObjects;
|
2021-03-21 09:12:03 -07:00
|
|
|
using Robust.Shared.Audio;
|
2020-07-03 23:43:01 +02:00
|
|
|
using Robust.Shared.Containers;
|
2021-03-21 09:12:03 -07:00
|
|
|
using Robust.Shared.Player;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.Timing;
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Buckle.Components
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2021-02-20 01:20:52 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Component that handles sitting entities into <see cref="StrapComponent"/>s.
|
|
|
|
|
/// </summary>
|
2020-06-25 15:52:24 +02:00
|
|
|
[RegisterComponent]
|
2021-01-11 22:14:01 +11:00
|
|
|
[ComponentReference(typeof(SharedBuckleComponent))]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class BuckleComponent : SharedBuckleComponent
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2021-12-08 17:04:21 +01:00
|
|
|
[Dependency] private readonly IEntityManager _entMan = default!;
|
2020-07-08 13:22:14 +02:00
|
|
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("size")]
|
|
|
|
|
private int _size = 100;
|
2020-07-08 13:22:14 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The amount of time that must pass for this entity to
|
|
|
|
|
/// be able to unbuckle after recently buckling.
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("delay")]
|
2020-07-17 10:43:10 +02:00
|
|
|
[ViewVariables]
|
2021-07-31 19:52:33 +02:00
|
|
|
private TimeSpan _unbuckleDelay = TimeSpan.FromSeconds(0.25f);
|
2020-07-08 13:22:14 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The time that this entity buckled at.
|
|
|
|
|
/// </summary>
|
2020-07-17 10:43:10 +02:00
|
|
|
[ViewVariables]
|
2020-07-08 13:22:14 +02:00
|
|
|
private TimeSpan _buckleTime;
|
|
|
|
|
|
2020-11-06 15:15:02 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// The position offset that is being applied to this entity if buckled.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Vector2 BuckleOffset { get; private set; }
|
2020-07-24 14:22:28 +02:00
|
|
|
|
2020-07-08 12:54:00 +02:00
|
|
|
private StrapComponent? _buckledTo;
|
2020-12-20 04:14:41 +01:00
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The strap that this component is buckled to.
|
|
|
|
|
/// </summary>
|
2020-07-04 13:51:14 +02:00
|
|
|
[ViewVariables]
|
|
|
|
|
public StrapComponent? BuckledTo
|
2020-07-02 23:36:06 +02:00
|
|
|
{
|
|
|
|
|
get => _buckledTo;
|
|
|
|
|
private set
|
|
|
|
|
{
|
|
|
|
|
_buckledTo = value;
|
2020-07-08 13:22:14 +02:00
|
|
|
_buckleTime = _gameTiming.CurTime;
|
2020-07-02 23:36:06 +02:00
|
|
|
Dirty();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2020-07-17 10:43:10 +02:00
|
|
|
public override bool Buckled => BuckledTo != null;
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
/// <summary>
|
2020-07-19 21:34:35 +02:00
|
|
|
/// The amount of space that this entity occupies in a
|
|
|
|
|
/// <see cref="StrapComponent"/>.
|
2020-07-17 10:43:10 +02:00
|
|
|
/// </summary>
|
2020-06-25 15:52:24 +02:00
|
|
|
[ViewVariables]
|
|
|
|
|
public int Size => _size;
|
|
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Shows or hides the buckled status effect depending on if the
|
|
|
|
|
/// entity is buckled or not.
|
|
|
|
|
/// </summary>
|
2020-11-06 15:15:02 +01:00
|
|
|
private void UpdateBuckleStatus()
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2020-11-06 15:15:02 +01:00
|
|
|
if (Buckled)
|
|
|
|
|
{
|
2022-01-05 00:19:23 -08:00
|
|
|
AlertType alertType = BuckledTo?.BuckledAlertType ?? AlertType.Buckled;
|
|
|
|
|
EntitySystem.Get<AlertsSystem>().ShowAlert(Owner, alertType);
|
2020-11-06 15:15:02 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2022-01-05 00:19:23 -08:00
|
|
|
EntitySystem.Get<AlertsSystem>().ClearAlertCategory(Owner, AlertCategory.Buckled);
|
2020-06-25 15:52:24 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
/// <summary>
|
2020-07-19 21:34:35 +02:00
|
|
|
/// Reattaches this entity to the strap, modifying its position and rotation.
|
2020-07-17 10:43:10 +02:00
|
|
|
/// </summary>
|
2020-07-19 21:34:35 +02:00
|
|
|
/// <param name="strap">The strap to reattach to.</param>
|
2020-11-06 15:15:02 +01:00
|
|
|
public void ReAttach(StrapComponent strap)
|
2020-07-08 15:30:48 +02:00
|
|
|
{
|
2021-12-08 17:04:21 +01:00
|
|
|
var ownTransform = _entMan.GetComponent<TransformComponent>(Owner);
|
|
|
|
|
var strapTransform = _entMan.GetComponent<TransformComponent>(strap.Owner);
|
2020-07-08 15:30:48 +02:00
|
|
|
|
|
|
|
|
ownTransform.AttachParent(strapTransform);
|
2021-10-25 15:22:57 +11:00
|
|
|
ownTransform.LocalRotation = Angle.Zero;
|
2020-07-08 15:30:48 +02:00
|
|
|
|
|
|
|
|
switch (strap.Position)
|
|
|
|
|
{
|
|
|
|
|
case StrapPosition.None:
|
|
|
|
|
break;
|
|
|
|
|
case StrapPosition.Stand:
|
2021-12-05 18:09:01 +01:00
|
|
|
EntitySystem.Get<StandingStateSystem>().Stand(Owner);
|
2020-07-08 15:30:48 +02:00
|
|
|
break;
|
|
|
|
|
case StrapPosition.Down:
|
2021-12-05 18:09:01 +01:00
|
|
|
EntitySystem.Get<StandingStateSystem>().Down(Owner, false, false);
|
2020-07-08 15:30:48 +02:00
|
|
|
break;
|
|
|
|
|
}
|
2020-07-19 21:34:35 +02:00
|
|
|
|
2021-12-29 23:14:21 +11:00
|
|
|
ownTransform.LocalPosition = strap.BuckleOffset;
|
2020-07-08 15:30:48 +02:00
|
|
|
}
|
|
|
|
|
|
2021-12-03 11:15:41 -08:00
|
|
|
public bool CanBuckle(EntityUid user, EntityUid to, [NotNullWhen(true)] out StrapComponent? strap)
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2021-12-03 11:15:41 -08:00
|
|
|
var popupSystem = EntitySystem.Get<SharedPopupSystem>();
|
Add the trash man (#1367)
* Add disposal.rsi
* Rename disposal resource to disposal.rsi and create basic components
* Add disposal nets
* Add pushing entities along the disposal network
* Add disposal unit
* Unregister disposable component
* Add flush and selfinsert verbs to disposal unit
* Add gradual disposals movement
* Fix being able to walk through space for a while after exiting disposals
* Multiply disposals speed by 10
And fix early returns when moving an entity
* Rename Disposable component to InDisposals
* Remove DisposalNet and add on anchor events
* Remove anchored events, moved to interfaces
* Code cleanup
* Fix adjacent tubes' connections when a tube connects
* Fix jittery movement in disposals
* Remove Logger.Debug call
* Move disposals updates to InDisposalsComponent
* Fix adjacent connection valid directions check
* Disposal tubes now throw you out where they are facing
* Add disposal unit exit cooldown
* Set different disposal pipe sprite state depending on anchored value
* Add recycler
* Add recycler animation
* Add bloody texture to the recycler when grinding a living being
* Add PowerDevice component to the disposal unit
* Made the Recycler center on the grid
* Add disposal junction
* Add picking a random direction if junction is entered from the output side
* Add disposal flush and clang sounds
Taken from VGStation
* Move disposal flush and clang sound file names to exposedata
* Add disposalsmap.yml to test with
* Add summaries to DisposalUnit fields
* Add sideDegrees yaml property to disposal junctions
* Fix outdated usings
* Add conveyor resources
* Update RobustToolbox
* More merge fixes
Add conveyor collision masks
* Add ConveyorComponent
* Fix crash when reentering a body
* Merge branch 'master' into disposals-1147
* Reduce recycler bounds, set hard to false, add summary and expose "safe" to yaml
* Move IAnchored and IUnAnchored to AnchorableComponent
* Update power components and remove old disposals map
* Remove redundant sprite layers
* Add tile pry command
* Fix tilepry command
* Fix DisposalJunctionComponent missing a component reference
* Add anchor by radius command
* Add Y-Junctions
* Add disposal bend
* Add unanchor command
* Change DisposalJunction prototypes to specify their angles
* Fix disposal units being hidden below the floor
* Removed IAnhored and IUnAnchored interfaces
* Replace CanBeNull annotation with nullable reference types
* Update showwires command
* Add recycler recycling items
* Added angle and speed properties to ConveyorComponent
* Fix conveyort textures
* Add animation to the disposal unit
* Fix anchor and unanchor commands sometimes not finding any entities
* Fix not reading flush_time from disposal unit prototype
* Fix merge conflict wrong using
* Fix disposal, recycling and conveyor texture paths
Delete diverters
* Update visualizer names
* Add DisposableComponent, change drag and drop to work with multiple components
Ignoreinsideblocker client side for drag and drops, like on the server
Add more comments
* Add conveyor belts properly moving entities on top
* Anchorr wires
* Change conveyor bounds to 0.49
* Anchor catwalks, airlocks, gravity generators, low walls, wires and windows
* Add starting/stopping conveyors
* Add reversed conveyors
* Add conveyor switches
* Move InDisposalsComponent code to DisposableComponent
* Add ExitVector method to tubes
* Fix not updating tube references when disconnecting one
* Replace IoCManager call with dependency
* Add tubes disconnecting if they move too far apart from one another
* Move disposals action blocking to shared
* Add rotating and flipping pipes
* Make conveyor intersection calculations approximate
* Fix 1% chance of the server crashing when initializing the map
Happens when emergency lockers remove themselves
* Add disposal unit interface
* Make disposal units refuse items if not powered
* Make disposal tubes hide only when anchored
* Make disposal junction arrows visible to mere mortals
* Add disposal tubes breaking
* Add tubeconnections command
* Add missing verb attribute
* Add flipped disposal junction
* Add ids and linking to conveyors and switches
* Add conveyor switch prying and placing
* Add anchoring conveyor switches and refactor placing them
* Add missing serializable attributes from DisposableComponentState
* Make conveyor speed VV ReadWrite
* Change drawdepth of conveyors to FloorObjects
* Make conveyor anchored check consistent
* Remove anchoring interaction from switches
* Add conveyor switch id syncing and move switches slightly when pried
* Make entities in containers not able to be moved by conveyors
* Add conveyor and switches loose textures
* Merge conflict fixes
* Add disposal unit test
* Add flushing test to disposal unit test
* Add disposal unit flush fail test
* Add disposals to the saltern map
* Fix saltern disposal junctions
* Add power checks to the recycler
* Fix disposal unit placement in maintenance closet
* Remove disposal junctions from saltern
* Readd junctions to saltern
* Add the chemmaster to saltern at the request of Ike
* Move the chemistry disposal unit
* Fix casing of disposal flush sound
* More merge conflict fixes
* Fix a compiler warning.
* Remove popup invocation from buckle
* Remove showPopup parameter from InteractionChecks
* Remove unnecessary physics components
Fixes the physics system dying
* Replace PhysicsComponent usages with CollidableComponent
* Update existing code for the new controller system
* Change conveyors to use a VirtualController instead of teleporting the entity
* Remove visualizer 2d suffix and update physics code
* Transition code to new controller system
* Fix shuttles not moving
* Fix throwing
* Fix guns
* Change hands to use physics.Stop() and remove item fumble method
* Add syncing conveyor switches states
* Fix the recycler wanting to be a conveyor too hard
* Fix showwires > showsubfloor rename in mapping command
* Fix wifi air conveyors
* Fix test error
* Add showsubfloorforever command
Changes drawdepth of the relevant entities
* Disable opening the disposal unit interface while inside
* Add closing the disposal unit interface when getting inside
* Add closing the interface when the disposal unit component is removed
* Add removing entities on disposal unit component removal
* Delay disposal unit flush and fix serialization
* Implement pressure in disposal units
* Fix chain engaging a disposal unit
* Implement states to the disposal unit
* Fix missing imports from merge conflict
* Update Content.Server/GameObjects/Components/Conveyor/ConveyorComponent.cs
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
* Address some reviews
* Fix za buildo
* Use container helper to detach disposables
* Make conveyors use the construction system
* Make conveyor groups and syncing sane
* Make flip flip
brave
* Add activate interface to conveyor switches
* Fix not removing the switch from its group when it's deleted
* Fix not registering conveyors and switches on initialize
* Stop using 0 as null
* Disconnect conveyors and switches when disposing of a group
* Make disposal units not able to be exited when flushing
* Make disposal units flush after a configurable 30 seconds
* Add handle and light layers to the disposal unit
* Merge engaging and flushing
* Update saltern.yml
* I love using 0 as null
* Make disposal unit visual layers make sense
* Remove duplicate remove method in disposal units and update light
* Replace DisposableComponent with disposal holders
* Fix disposal holders deleting their contents on deletion
* Account for disposal unit pressure in tests and make a failed flush autoengage
* Rename disposable to holder
* Fix junction connections
* Disable self insert and flush verbs when inside a disposal unit
* Fix spamming the engage button making the animation reset
* Make the recycler take materials into account properly
Fix cablestack1 not existing
* Merge conflict fixes
* Fix pipes not being saved anchored
* Change conveyors and groups to not use an id
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2020-07-30 23:45:28 +02:00
|
|
|
strap = null;
|
|
|
|
|
|
2021-12-03 11:15:41 -08:00
|
|
|
if (user == to)
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-08 17:04:21 +01:00
|
|
|
if (!_entMan.TryGetComponent(to, out strap))
|
2020-07-08 12:54:00 +02:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2021-12-05 18:09:01 +01:00
|
|
|
var strapUid = strap.Owner;
|
|
|
|
|
bool Ignored(EntityUid entity) => entity == Owner || entity == user || entity == strapUid;
|
2020-07-08 12:54:00 +02:00
|
|
|
|
2022-02-17 15:40:03 +13:00
|
|
|
if (!EntitySystem.Get<SharedInteractionSystem>().InRangeUnobstructed(Owner, strapUid, Range, predicate: Ignored, popup: true))
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
// If in a container
|
2020-11-13 20:25:04 +13:00
|
|
|
if (Owner.TryGetContainer(out var ownerContainer))
|
2020-07-08 16:00:04 +02:00
|
|
|
{
|
2020-07-17 10:43:10 +02:00
|
|
|
// And not in the same container as the strap
|
2020-11-13 20:25:04 +13:00
|
|
|
if (!strap.Owner.TryGetContainer(out var strapContainer) ||
|
2020-07-08 16:10:46 +02:00
|
|
|
ownerContainer != strapContainer)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2020-07-08 16:00:04 +02:00
|
|
|
}
|
|
|
|
|
|
2021-12-08 17:04:21 +01:00
|
|
|
if (!_entMan.HasComponent<HandsComponent>(user))
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2021-12-03 11:15:41 -08:00
|
|
|
popupSystem.PopupEntity(Loc.GetString("buckle-component-no-hands-message"), user, Filter.Entities(user));
|
2020-06-25 15:52:24 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-02 23:36:06 +02:00
|
|
|
if (Buckled)
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2021-12-05 18:09:01 +01:00
|
|
|
var message = Loc.GetString(Owner == user
|
2021-06-21 02:13:54 +02:00
|
|
|
? "buckle-component-already-buckled-message"
|
2021-07-31 19:52:33 +02:00
|
|
|
: "buckle-component-other-already-buckled-message", ("owner", Owner));
|
2021-12-03 11:15:41 -08:00
|
|
|
popupSystem.PopupEntity(message, user, Filter.Entities(user));
|
Add the trash man (#1367)
* Add disposal.rsi
* Rename disposal resource to disposal.rsi and create basic components
* Add disposal nets
* Add pushing entities along the disposal network
* Add disposal unit
* Unregister disposable component
* Add flush and selfinsert verbs to disposal unit
* Add gradual disposals movement
* Fix being able to walk through space for a while after exiting disposals
* Multiply disposals speed by 10
And fix early returns when moving an entity
* Rename Disposable component to InDisposals
* Remove DisposalNet and add on anchor events
* Remove anchored events, moved to interfaces
* Code cleanup
* Fix adjacent tubes' connections when a tube connects
* Fix jittery movement in disposals
* Remove Logger.Debug call
* Move disposals updates to InDisposalsComponent
* Fix adjacent connection valid directions check
* Disposal tubes now throw you out where they are facing
* Add disposal unit exit cooldown
* Set different disposal pipe sprite state depending on anchored value
* Add recycler
* Add recycler animation
* Add bloody texture to the recycler when grinding a living being
* Add PowerDevice component to the disposal unit
* Made the Recycler center on the grid
* Add disposal junction
* Add picking a random direction if junction is entered from the output side
* Add disposal flush and clang sounds
Taken from VGStation
* Move disposal flush and clang sound file names to exposedata
* Add disposalsmap.yml to test with
* Add summaries to DisposalUnit fields
* Add sideDegrees yaml property to disposal junctions
* Fix outdated usings
* Add conveyor resources
* Update RobustToolbox
* More merge fixes
Add conveyor collision masks
* Add ConveyorComponent
* Fix crash when reentering a body
* Merge branch 'master' into disposals-1147
* Reduce recycler bounds, set hard to false, add summary and expose "safe" to yaml
* Move IAnchored and IUnAnchored to AnchorableComponent
* Update power components and remove old disposals map
* Remove redundant sprite layers
* Add tile pry command
* Fix tilepry command
* Fix DisposalJunctionComponent missing a component reference
* Add anchor by radius command
* Add Y-Junctions
* Add disposal bend
* Add unanchor command
* Change DisposalJunction prototypes to specify their angles
* Fix disposal units being hidden below the floor
* Removed IAnhored and IUnAnchored interfaces
* Replace CanBeNull annotation with nullable reference types
* Update showwires command
* Add recycler recycling items
* Added angle and speed properties to ConveyorComponent
* Fix conveyort textures
* Add animation to the disposal unit
* Fix anchor and unanchor commands sometimes not finding any entities
* Fix not reading flush_time from disposal unit prototype
* Fix merge conflict wrong using
* Fix disposal, recycling and conveyor texture paths
Delete diverters
* Update visualizer names
* Add DisposableComponent, change drag and drop to work with multiple components
Ignoreinsideblocker client side for drag and drops, like on the server
Add more comments
* Add conveyor belts properly moving entities on top
* Anchorr wires
* Change conveyor bounds to 0.49
* Anchor catwalks, airlocks, gravity generators, low walls, wires and windows
* Add starting/stopping conveyors
* Add reversed conveyors
* Add conveyor switches
* Move InDisposalsComponent code to DisposableComponent
* Add ExitVector method to tubes
* Fix not updating tube references when disconnecting one
* Replace IoCManager call with dependency
* Add tubes disconnecting if they move too far apart from one another
* Move disposals action blocking to shared
* Add rotating and flipping pipes
* Make conveyor intersection calculations approximate
* Fix 1% chance of the server crashing when initializing the map
Happens when emergency lockers remove themselves
* Add disposal unit interface
* Make disposal units refuse items if not powered
* Make disposal tubes hide only when anchored
* Make disposal junction arrows visible to mere mortals
* Add disposal tubes breaking
* Add tubeconnections command
* Add missing verb attribute
* Add flipped disposal junction
* Add ids and linking to conveyors and switches
* Add conveyor switch prying and placing
* Add anchoring conveyor switches and refactor placing them
* Add missing serializable attributes from DisposableComponentState
* Make conveyor speed VV ReadWrite
* Change drawdepth of conveyors to FloorObjects
* Make conveyor anchored check consistent
* Remove anchoring interaction from switches
* Add conveyor switch id syncing and move switches slightly when pried
* Make entities in containers not able to be moved by conveyors
* Add conveyor and switches loose textures
* Merge conflict fixes
* Add disposal unit test
* Add flushing test to disposal unit test
* Add disposal unit flush fail test
* Add disposals to the saltern map
* Fix saltern disposal junctions
* Add power checks to the recycler
* Fix disposal unit placement in maintenance closet
* Remove disposal junctions from saltern
* Readd junctions to saltern
* Add the chemmaster to saltern at the request of Ike
* Move the chemistry disposal unit
* Fix casing of disposal flush sound
* More merge conflict fixes
* Fix a compiler warning.
* Remove popup invocation from buckle
* Remove showPopup parameter from InteractionChecks
* Remove unnecessary physics components
Fixes the physics system dying
* Replace PhysicsComponent usages with CollidableComponent
* Update existing code for the new controller system
* Change conveyors to use a VirtualController instead of teleporting the entity
* Remove visualizer 2d suffix and update physics code
* Transition code to new controller system
* Fix shuttles not moving
* Fix throwing
* Fix guns
* Change hands to use physics.Stop() and remove item fumble method
* Add syncing conveyor switches states
* Fix the recycler wanting to be a conveyor too hard
* Fix showwires > showsubfloor rename in mapping command
* Fix wifi air conveyors
* Fix test error
* Add showsubfloorforever command
Changes drawdepth of the relevant entities
* Disable opening the disposal unit interface while inside
* Add closing the disposal unit interface when getting inside
* Add closing the interface when the disposal unit component is removed
* Add removing entities on disposal unit component removal
* Delay disposal unit flush and fix serialization
* Implement pressure in disposal units
* Fix chain engaging a disposal unit
* Implement states to the disposal unit
* Fix missing imports from merge conflict
* Update Content.Server/GameObjects/Components/Conveyor/ConveyorComponent.cs
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
* Address some reviews
* Fix za buildo
* Use container helper to detach disposables
* Make conveyors use the construction system
* Make conveyor groups and syncing sane
* Make flip flip
brave
* Add activate interface to conveyor switches
* Fix not removing the switch from its group when it's deleted
* Fix not registering conveyors and switches on initialize
* Stop using 0 as null
* Disconnect conveyors and switches when disposing of a group
* Make disposal units not able to be exited when flushing
* Make disposal units flush after a configurable 30 seconds
* Add handle and light layers to the disposal unit
* Merge engaging and flushing
* Update saltern.yml
* I love using 0 as null
* Make disposal unit visual layers make sense
* Remove duplicate remove method in disposal units and update light
* Replace DisposableComponent with disposal holders
* Fix disposal holders deleting their contents on deletion
* Account for disposal unit pressure in tests and make a failed flush autoengage
* Rename disposable to holder
* Fix junction connections
* Disable self insert and flush verbs when inside a disposal unit
* Fix spamming the engage button making the animation reset
* Make the recycler take materials into account properly
Fix cablestack1 not existing
* Merge conflict fixes
* Fix pipes not being saved anchored
* Change conveyors and groups to not use an id
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2020-07-30 23:45:28 +02:00
|
|
|
|
2020-06-25 15:52:24 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-08 17:04:21 +01:00
|
|
|
var parent = _entMan.GetComponent<TransformComponent>(to).Parent;
|
2020-06-25 15:52:24 +02:00
|
|
|
while (parent != null)
|
|
|
|
|
{
|
2021-12-08 17:04:21 +01:00
|
|
|
if (parent == _entMan.GetComponent<TransformComponent>(user))
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2021-12-05 18:09:01 +01:00
|
|
|
var message = Loc.GetString(Owner == user
|
2021-06-21 02:13:54 +02:00
|
|
|
? "buckle-component-cannot-buckle-message"
|
2021-07-31 19:52:33 +02:00
|
|
|
: "buckle-component-other-cannot-buckle-message", ("owner", Owner));
|
2021-12-03 11:15:41 -08:00
|
|
|
popupSystem.PopupEntity(message, user, Filter.Entities(user));
|
Add the trash man (#1367)
* Add disposal.rsi
* Rename disposal resource to disposal.rsi and create basic components
* Add disposal nets
* Add pushing entities along the disposal network
* Add disposal unit
* Unregister disposable component
* Add flush and selfinsert verbs to disposal unit
* Add gradual disposals movement
* Fix being able to walk through space for a while after exiting disposals
* Multiply disposals speed by 10
And fix early returns when moving an entity
* Rename Disposable component to InDisposals
* Remove DisposalNet and add on anchor events
* Remove anchored events, moved to interfaces
* Code cleanup
* Fix adjacent tubes' connections when a tube connects
* Fix jittery movement in disposals
* Remove Logger.Debug call
* Move disposals updates to InDisposalsComponent
* Fix adjacent connection valid directions check
* Disposal tubes now throw you out where they are facing
* Add disposal unit exit cooldown
* Set different disposal pipe sprite state depending on anchored value
* Add recycler
* Add recycler animation
* Add bloody texture to the recycler when grinding a living being
* Add PowerDevice component to the disposal unit
* Made the Recycler center on the grid
* Add disposal junction
* Add picking a random direction if junction is entered from the output side
* Add disposal flush and clang sounds
Taken from VGStation
* Move disposal flush and clang sound file names to exposedata
* Add disposalsmap.yml to test with
* Add summaries to DisposalUnit fields
* Add sideDegrees yaml property to disposal junctions
* Fix outdated usings
* Add conveyor resources
* Update RobustToolbox
* More merge fixes
Add conveyor collision masks
* Add ConveyorComponent
* Fix crash when reentering a body
* Merge branch 'master' into disposals-1147
* Reduce recycler bounds, set hard to false, add summary and expose "safe" to yaml
* Move IAnchored and IUnAnchored to AnchorableComponent
* Update power components and remove old disposals map
* Remove redundant sprite layers
* Add tile pry command
* Fix tilepry command
* Fix DisposalJunctionComponent missing a component reference
* Add anchor by radius command
* Add Y-Junctions
* Add disposal bend
* Add unanchor command
* Change DisposalJunction prototypes to specify their angles
* Fix disposal units being hidden below the floor
* Removed IAnhored and IUnAnchored interfaces
* Replace CanBeNull annotation with nullable reference types
* Update showwires command
* Add recycler recycling items
* Added angle and speed properties to ConveyorComponent
* Fix conveyort textures
* Add animation to the disposal unit
* Fix anchor and unanchor commands sometimes not finding any entities
* Fix not reading flush_time from disposal unit prototype
* Fix merge conflict wrong using
* Fix disposal, recycling and conveyor texture paths
Delete diverters
* Update visualizer names
* Add DisposableComponent, change drag and drop to work with multiple components
Ignoreinsideblocker client side for drag and drops, like on the server
Add more comments
* Add conveyor belts properly moving entities on top
* Anchorr wires
* Change conveyor bounds to 0.49
* Anchor catwalks, airlocks, gravity generators, low walls, wires and windows
* Add starting/stopping conveyors
* Add reversed conveyors
* Add conveyor switches
* Move InDisposalsComponent code to DisposableComponent
* Add ExitVector method to tubes
* Fix not updating tube references when disconnecting one
* Replace IoCManager call with dependency
* Add tubes disconnecting if they move too far apart from one another
* Move disposals action blocking to shared
* Add rotating and flipping pipes
* Make conveyor intersection calculations approximate
* Fix 1% chance of the server crashing when initializing the map
Happens when emergency lockers remove themselves
* Add disposal unit interface
* Make disposal units refuse items if not powered
* Make disposal tubes hide only when anchored
* Make disposal junction arrows visible to mere mortals
* Add disposal tubes breaking
* Add tubeconnections command
* Add missing verb attribute
* Add flipped disposal junction
* Add ids and linking to conveyors and switches
* Add conveyor switch prying and placing
* Add anchoring conveyor switches and refactor placing them
* Add missing serializable attributes from DisposableComponentState
* Make conveyor speed VV ReadWrite
* Change drawdepth of conveyors to FloorObjects
* Make conveyor anchored check consistent
* Remove anchoring interaction from switches
* Add conveyor switch id syncing and move switches slightly when pried
* Make entities in containers not able to be moved by conveyors
* Add conveyor and switches loose textures
* Merge conflict fixes
* Add disposal unit test
* Add flushing test to disposal unit test
* Add disposal unit flush fail test
* Add disposals to the saltern map
* Fix saltern disposal junctions
* Add power checks to the recycler
* Fix disposal unit placement in maintenance closet
* Remove disposal junctions from saltern
* Readd junctions to saltern
* Add the chemmaster to saltern at the request of Ike
* Move the chemistry disposal unit
* Fix casing of disposal flush sound
* More merge conflict fixes
* Fix a compiler warning.
* Remove popup invocation from buckle
* Remove showPopup parameter from InteractionChecks
* Remove unnecessary physics components
Fixes the physics system dying
* Replace PhysicsComponent usages with CollidableComponent
* Update existing code for the new controller system
* Change conveyors to use a VirtualController instead of teleporting the entity
* Remove visualizer 2d suffix and update physics code
* Transition code to new controller system
* Fix shuttles not moving
* Fix throwing
* Fix guns
* Change hands to use physics.Stop() and remove item fumble method
* Add syncing conveyor switches states
* Fix the recycler wanting to be a conveyor too hard
* Fix showwires > showsubfloor rename in mapping command
* Fix wifi air conveyors
* Fix test error
* Add showsubfloorforever command
Changes drawdepth of the relevant entities
* Disable opening the disposal unit interface while inside
* Add closing the disposal unit interface when getting inside
* Add closing the interface when the disposal unit component is removed
* Add removing entities on disposal unit component removal
* Delay disposal unit flush and fix serialization
* Implement pressure in disposal units
* Fix chain engaging a disposal unit
* Implement states to the disposal unit
* Fix missing imports from merge conflict
* Update Content.Server/GameObjects/Components/Conveyor/ConveyorComponent.cs
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
* Address some reviews
* Fix za buildo
* Use container helper to detach disposables
* Make conveyors use the construction system
* Make conveyor groups and syncing sane
* Make flip flip
brave
* Add activate interface to conveyor switches
* Fix not removing the switch from its group when it's deleted
* Fix not registering conveyors and switches on initialize
* Stop using 0 as null
* Disconnect conveyors and switches when disposing of a group
* Make disposal units not able to be exited when flushing
* Make disposal units flush after a configurable 30 seconds
* Add handle and light layers to the disposal unit
* Merge engaging and flushing
* Update saltern.yml
* I love using 0 as null
* Make disposal unit visual layers make sense
* Remove duplicate remove method in disposal units and update light
* Replace DisposableComponent with disposal holders
* Fix disposal holders deleting their contents on deletion
* Account for disposal unit pressure in tests and make a failed flush autoengage
* Rename disposable to holder
* Fix junction connections
* Disable self insert and flush verbs when inside a disposal unit
* Fix spamming the engage button making the animation reset
* Make the recycler take materials into account properly
Fix cablestack1 not existing
* Merge conflict fixes
* Fix pipes not being saved anchored
* Change conveyors and groups to not use an id
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2020-07-30 23:45:28 +02:00
|
|
|
|
2020-06-25 15:52:24 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
parent = parent.Parent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!strap.HasSpace(this))
|
|
|
|
|
{
|
2021-12-05 18:09:01 +01:00
|
|
|
var message = Loc.GetString(Owner == user
|
2021-06-21 02:13:54 +02:00
|
|
|
? "buckle-component-cannot-fit-message"
|
2021-07-31 19:52:33 +02:00
|
|
|
: "buckle-component-other-cannot-fit-message", ("owner", Owner));
|
2021-12-03 11:15:41 -08:00
|
|
|
popupSystem.PopupEntity(message, user, Filter.Entities(user));
|
Add the trash man (#1367)
* Add disposal.rsi
* Rename disposal resource to disposal.rsi and create basic components
* Add disposal nets
* Add pushing entities along the disposal network
* Add disposal unit
* Unregister disposable component
* Add flush and selfinsert verbs to disposal unit
* Add gradual disposals movement
* Fix being able to walk through space for a while after exiting disposals
* Multiply disposals speed by 10
And fix early returns when moving an entity
* Rename Disposable component to InDisposals
* Remove DisposalNet and add on anchor events
* Remove anchored events, moved to interfaces
* Code cleanup
* Fix adjacent tubes' connections when a tube connects
* Fix jittery movement in disposals
* Remove Logger.Debug call
* Move disposals updates to InDisposalsComponent
* Fix adjacent connection valid directions check
* Disposal tubes now throw you out where they are facing
* Add disposal unit exit cooldown
* Set different disposal pipe sprite state depending on anchored value
* Add recycler
* Add recycler animation
* Add bloody texture to the recycler when grinding a living being
* Add PowerDevice component to the disposal unit
* Made the Recycler center on the grid
* Add disposal junction
* Add picking a random direction if junction is entered from the output side
* Add disposal flush and clang sounds
Taken from VGStation
* Move disposal flush and clang sound file names to exposedata
* Add disposalsmap.yml to test with
* Add summaries to DisposalUnit fields
* Add sideDegrees yaml property to disposal junctions
* Fix outdated usings
* Add conveyor resources
* Update RobustToolbox
* More merge fixes
Add conveyor collision masks
* Add ConveyorComponent
* Fix crash when reentering a body
* Merge branch 'master' into disposals-1147
* Reduce recycler bounds, set hard to false, add summary and expose "safe" to yaml
* Move IAnchored and IUnAnchored to AnchorableComponent
* Update power components and remove old disposals map
* Remove redundant sprite layers
* Add tile pry command
* Fix tilepry command
* Fix DisposalJunctionComponent missing a component reference
* Add anchor by radius command
* Add Y-Junctions
* Add disposal bend
* Add unanchor command
* Change DisposalJunction prototypes to specify their angles
* Fix disposal units being hidden below the floor
* Removed IAnhored and IUnAnchored interfaces
* Replace CanBeNull annotation with nullable reference types
* Update showwires command
* Add recycler recycling items
* Added angle and speed properties to ConveyorComponent
* Fix conveyort textures
* Add animation to the disposal unit
* Fix anchor and unanchor commands sometimes not finding any entities
* Fix not reading flush_time from disposal unit prototype
* Fix merge conflict wrong using
* Fix disposal, recycling and conveyor texture paths
Delete diverters
* Update visualizer names
* Add DisposableComponent, change drag and drop to work with multiple components
Ignoreinsideblocker client side for drag and drops, like on the server
Add more comments
* Add conveyor belts properly moving entities on top
* Anchorr wires
* Change conveyor bounds to 0.49
* Anchor catwalks, airlocks, gravity generators, low walls, wires and windows
* Add starting/stopping conveyors
* Add reversed conveyors
* Add conveyor switches
* Move InDisposalsComponent code to DisposableComponent
* Add ExitVector method to tubes
* Fix not updating tube references when disconnecting one
* Replace IoCManager call with dependency
* Add tubes disconnecting if they move too far apart from one another
* Move disposals action blocking to shared
* Add rotating and flipping pipes
* Make conveyor intersection calculations approximate
* Fix 1% chance of the server crashing when initializing the map
Happens when emergency lockers remove themselves
* Add disposal unit interface
* Make disposal units refuse items if not powered
* Make disposal tubes hide only when anchored
* Make disposal junction arrows visible to mere mortals
* Add disposal tubes breaking
* Add tubeconnections command
* Add missing verb attribute
* Add flipped disposal junction
* Add ids and linking to conveyors and switches
* Add conveyor switch prying and placing
* Add anchoring conveyor switches and refactor placing them
* Add missing serializable attributes from DisposableComponentState
* Make conveyor speed VV ReadWrite
* Change drawdepth of conveyors to FloorObjects
* Make conveyor anchored check consistent
* Remove anchoring interaction from switches
* Add conveyor switch id syncing and move switches slightly when pried
* Make entities in containers not able to be moved by conveyors
* Add conveyor and switches loose textures
* Merge conflict fixes
* Add disposal unit test
* Add flushing test to disposal unit test
* Add disposal unit flush fail test
* Add disposals to the saltern map
* Fix saltern disposal junctions
* Add power checks to the recycler
* Fix disposal unit placement in maintenance closet
* Remove disposal junctions from saltern
* Readd junctions to saltern
* Add the chemmaster to saltern at the request of Ike
* Move the chemistry disposal unit
* Fix casing of disposal flush sound
* More merge conflict fixes
* Fix a compiler warning.
* Remove popup invocation from buckle
* Remove showPopup parameter from InteractionChecks
* Remove unnecessary physics components
Fixes the physics system dying
* Replace PhysicsComponent usages with CollidableComponent
* Update existing code for the new controller system
* Change conveyors to use a VirtualController instead of teleporting the entity
* Remove visualizer 2d suffix and update physics code
* Transition code to new controller system
* Fix shuttles not moving
* Fix throwing
* Fix guns
* Change hands to use physics.Stop() and remove item fumble method
* Add syncing conveyor switches states
* Fix the recycler wanting to be a conveyor too hard
* Fix showwires > showsubfloor rename in mapping command
* Fix wifi air conveyors
* Fix test error
* Add showsubfloorforever command
Changes drawdepth of the relevant entities
* Disable opening the disposal unit interface while inside
* Add closing the disposal unit interface when getting inside
* Add closing the interface when the disposal unit component is removed
* Add removing entities on disposal unit component removal
* Delay disposal unit flush and fix serialization
* Implement pressure in disposal units
* Fix chain engaging a disposal unit
* Implement states to the disposal unit
* Fix missing imports from merge conflict
* Update Content.Server/GameObjects/Components/Conveyor/ConveyorComponent.cs
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
* Address some reviews
* Fix za buildo
* Use container helper to detach disposables
* Make conveyors use the construction system
* Make conveyor groups and syncing sane
* Make flip flip
brave
* Add activate interface to conveyor switches
* Fix not removing the switch from its group when it's deleted
* Fix not registering conveyors and switches on initialize
* Stop using 0 as null
* Disconnect conveyors and switches when disposing of a group
* Make disposal units not able to be exited when flushing
* Make disposal units flush after a configurable 30 seconds
* Add handle and light layers to the disposal unit
* Merge engaging and flushing
* Update saltern.yml
* I love using 0 as null
* Make disposal unit visual layers make sense
* Remove duplicate remove method in disposal units and update light
* Replace DisposableComponent with disposal holders
* Fix disposal holders deleting their contents on deletion
* Account for disposal unit pressure in tests and make a failed flush autoengage
* Rename disposable to holder
* Fix junction connections
* Disable self insert and flush verbs when inside a disposal unit
* Fix spamming the engage button making the animation reset
* Make the recycler take materials into account properly
Fix cablestack1 not existing
* Merge conflict fixes
* Fix pipes not being saved anchored
* Change conveyors and groups to not use an id
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2020-07-30 23:45:28 +02:00
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-03 11:15:41 -08:00
|
|
|
public override bool TryBuckle(EntityUid user, EntityUid to)
|
Add the trash man (#1367)
* Add disposal.rsi
* Rename disposal resource to disposal.rsi and create basic components
* Add disposal nets
* Add pushing entities along the disposal network
* Add disposal unit
* Unregister disposable component
* Add flush and selfinsert verbs to disposal unit
* Add gradual disposals movement
* Fix being able to walk through space for a while after exiting disposals
* Multiply disposals speed by 10
And fix early returns when moving an entity
* Rename Disposable component to InDisposals
* Remove DisposalNet and add on anchor events
* Remove anchored events, moved to interfaces
* Code cleanup
* Fix adjacent tubes' connections when a tube connects
* Fix jittery movement in disposals
* Remove Logger.Debug call
* Move disposals updates to InDisposalsComponent
* Fix adjacent connection valid directions check
* Disposal tubes now throw you out where they are facing
* Add disposal unit exit cooldown
* Set different disposal pipe sprite state depending on anchored value
* Add recycler
* Add recycler animation
* Add bloody texture to the recycler when grinding a living being
* Add PowerDevice component to the disposal unit
* Made the Recycler center on the grid
* Add disposal junction
* Add picking a random direction if junction is entered from the output side
* Add disposal flush and clang sounds
Taken from VGStation
* Move disposal flush and clang sound file names to exposedata
* Add disposalsmap.yml to test with
* Add summaries to DisposalUnit fields
* Add sideDegrees yaml property to disposal junctions
* Fix outdated usings
* Add conveyor resources
* Update RobustToolbox
* More merge fixes
Add conveyor collision masks
* Add ConveyorComponent
* Fix crash when reentering a body
* Merge branch 'master' into disposals-1147
* Reduce recycler bounds, set hard to false, add summary and expose "safe" to yaml
* Move IAnchored and IUnAnchored to AnchorableComponent
* Update power components and remove old disposals map
* Remove redundant sprite layers
* Add tile pry command
* Fix tilepry command
* Fix DisposalJunctionComponent missing a component reference
* Add anchor by radius command
* Add Y-Junctions
* Add disposal bend
* Add unanchor command
* Change DisposalJunction prototypes to specify their angles
* Fix disposal units being hidden below the floor
* Removed IAnhored and IUnAnchored interfaces
* Replace CanBeNull annotation with nullable reference types
* Update showwires command
* Add recycler recycling items
* Added angle and speed properties to ConveyorComponent
* Fix conveyort textures
* Add animation to the disposal unit
* Fix anchor and unanchor commands sometimes not finding any entities
* Fix not reading flush_time from disposal unit prototype
* Fix merge conflict wrong using
* Fix disposal, recycling and conveyor texture paths
Delete diverters
* Update visualizer names
* Add DisposableComponent, change drag and drop to work with multiple components
Ignoreinsideblocker client side for drag and drops, like on the server
Add more comments
* Add conveyor belts properly moving entities on top
* Anchorr wires
* Change conveyor bounds to 0.49
* Anchor catwalks, airlocks, gravity generators, low walls, wires and windows
* Add starting/stopping conveyors
* Add reversed conveyors
* Add conveyor switches
* Move InDisposalsComponent code to DisposableComponent
* Add ExitVector method to tubes
* Fix not updating tube references when disconnecting one
* Replace IoCManager call with dependency
* Add tubes disconnecting if they move too far apart from one another
* Move disposals action blocking to shared
* Add rotating and flipping pipes
* Make conveyor intersection calculations approximate
* Fix 1% chance of the server crashing when initializing the map
Happens when emergency lockers remove themselves
* Add disposal unit interface
* Make disposal units refuse items if not powered
* Make disposal tubes hide only when anchored
* Make disposal junction arrows visible to mere mortals
* Add disposal tubes breaking
* Add tubeconnections command
* Add missing verb attribute
* Add flipped disposal junction
* Add ids and linking to conveyors and switches
* Add conveyor switch prying and placing
* Add anchoring conveyor switches and refactor placing them
* Add missing serializable attributes from DisposableComponentState
* Make conveyor speed VV ReadWrite
* Change drawdepth of conveyors to FloorObjects
* Make conveyor anchored check consistent
* Remove anchoring interaction from switches
* Add conveyor switch id syncing and move switches slightly when pried
* Make entities in containers not able to be moved by conveyors
* Add conveyor and switches loose textures
* Merge conflict fixes
* Add disposal unit test
* Add flushing test to disposal unit test
* Add disposal unit flush fail test
* Add disposals to the saltern map
* Fix saltern disposal junctions
* Add power checks to the recycler
* Fix disposal unit placement in maintenance closet
* Remove disposal junctions from saltern
* Readd junctions to saltern
* Add the chemmaster to saltern at the request of Ike
* Move the chemistry disposal unit
* Fix casing of disposal flush sound
* More merge conflict fixes
* Fix a compiler warning.
* Remove popup invocation from buckle
* Remove showPopup parameter from InteractionChecks
* Remove unnecessary physics components
Fixes the physics system dying
* Replace PhysicsComponent usages with CollidableComponent
* Update existing code for the new controller system
* Change conveyors to use a VirtualController instead of teleporting the entity
* Remove visualizer 2d suffix and update physics code
* Transition code to new controller system
* Fix shuttles not moving
* Fix throwing
* Fix guns
* Change hands to use physics.Stop() and remove item fumble method
* Add syncing conveyor switches states
* Fix the recycler wanting to be a conveyor too hard
* Fix showwires > showsubfloor rename in mapping command
* Fix wifi air conveyors
* Fix test error
* Add showsubfloorforever command
Changes drawdepth of the relevant entities
* Disable opening the disposal unit interface while inside
* Add closing the disposal unit interface when getting inside
* Add closing the interface when the disposal unit component is removed
* Add removing entities on disposal unit component removal
* Delay disposal unit flush and fix serialization
* Implement pressure in disposal units
* Fix chain engaging a disposal unit
* Implement states to the disposal unit
* Fix missing imports from merge conflict
* Update Content.Server/GameObjects/Components/Conveyor/ConveyorComponent.cs
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
* Address some reviews
* Fix za buildo
* Use container helper to detach disposables
* Make conveyors use the construction system
* Make conveyor groups and syncing sane
* Make flip flip
brave
* Add activate interface to conveyor switches
* Fix not removing the switch from its group when it's deleted
* Fix not registering conveyors and switches on initialize
* Stop using 0 as null
* Disconnect conveyors and switches when disposing of a group
* Make disposal units not able to be exited when flushing
* Make disposal units flush after a configurable 30 seconds
* Add handle and light layers to the disposal unit
* Merge engaging and flushing
* Update saltern.yml
* I love using 0 as null
* Make disposal unit visual layers make sense
* Remove duplicate remove method in disposal units and update light
* Replace DisposableComponent with disposal holders
* Fix disposal holders deleting their contents on deletion
* Account for disposal unit pressure in tests and make a failed flush autoengage
* Rename disposable to holder
* Fix junction connections
* Disable self insert and flush verbs when inside a disposal unit
* Fix spamming the engage button making the animation reset
* Make the recycler take materials into account properly
Fix cablestack1 not existing
* Merge conflict fixes
* Fix pipes not being saved anchored
* Change conveyors and groups to not use an id
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2020-07-30 23:45:28 +02:00
|
|
|
{
|
2021-12-03 11:15:41 -08:00
|
|
|
var popupSystem = EntitySystem.Get<SharedPopupSystem>();
|
|
|
|
|
if (!CanBuckle(user, to, out var strap))
|
Add the trash man (#1367)
* Add disposal.rsi
* Rename disposal resource to disposal.rsi and create basic components
* Add disposal nets
* Add pushing entities along the disposal network
* Add disposal unit
* Unregister disposable component
* Add flush and selfinsert verbs to disposal unit
* Add gradual disposals movement
* Fix being able to walk through space for a while after exiting disposals
* Multiply disposals speed by 10
And fix early returns when moving an entity
* Rename Disposable component to InDisposals
* Remove DisposalNet and add on anchor events
* Remove anchored events, moved to interfaces
* Code cleanup
* Fix adjacent tubes' connections when a tube connects
* Fix jittery movement in disposals
* Remove Logger.Debug call
* Move disposals updates to InDisposalsComponent
* Fix adjacent connection valid directions check
* Disposal tubes now throw you out where they are facing
* Add disposal unit exit cooldown
* Set different disposal pipe sprite state depending on anchored value
* Add recycler
* Add recycler animation
* Add bloody texture to the recycler when grinding a living being
* Add PowerDevice component to the disposal unit
* Made the Recycler center on the grid
* Add disposal junction
* Add picking a random direction if junction is entered from the output side
* Add disposal flush and clang sounds
Taken from VGStation
* Move disposal flush and clang sound file names to exposedata
* Add disposalsmap.yml to test with
* Add summaries to DisposalUnit fields
* Add sideDegrees yaml property to disposal junctions
* Fix outdated usings
* Add conveyor resources
* Update RobustToolbox
* More merge fixes
Add conveyor collision masks
* Add ConveyorComponent
* Fix crash when reentering a body
* Merge branch 'master' into disposals-1147
* Reduce recycler bounds, set hard to false, add summary and expose "safe" to yaml
* Move IAnchored and IUnAnchored to AnchorableComponent
* Update power components and remove old disposals map
* Remove redundant sprite layers
* Add tile pry command
* Fix tilepry command
* Fix DisposalJunctionComponent missing a component reference
* Add anchor by radius command
* Add Y-Junctions
* Add disposal bend
* Add unanchor command
* Change DisposalJunction prototypes to specify their angles
* Fix disposal units being hidden below the floor
* Removed IAnhored and IUnAnchored interfaces
* Replace CanBeNull annotation with nullable reference types
* Update showwires command
* Add recycler recycling items
* Added angle and speed properties to ConveyorComponent
* Fix conveyort textures
* Add animation to the disposal unit
* Fix anchor and unanchor commands sometimes not finding any entities
* Fix not reading flush_time from disposal unit prototype
* Fix merge conflict wrong using
* Fix disposal, recycling and conveyor texture paths
Delete diverters
* Update visualizer names
* Add DisposableComponent, change drag and drop to work with multiple components
Ignoreinsideblocker client side for drag and drops, like on the server
Add more comments
* Add conveyor belts properly moving entities on top
* Anchorr wires
* Change conveyor bounds to 0.49
* Anchor catwalks, airlocks, gravity generators, low walls, wires and windows
* Add starting/stopping conveyors
* Add reversed conveyors
* Add conveyor switches
* Move InDisposalsComponent code to DisposableComponent
* Add ExitVector method to tubes
* Fix not updating tube references when disconnecting one
* Replace IoCManager call with dependency
* Add tubes disconnecting if they move too far apart from one another
* Move disposals action blocking to shared
* Add rotating and flipping pipes
* Make conveyor intersection calculations approximate
* Fix 1% chance of the server crashing when initializing the map
Happens when emergency lockers remove themselves
* Add disposal unit interface
* Make disposal units refuse items if not powered
* Make disposal tubes hide only when anchored
* Make disposal junction arrows visible to mere mortals
* Add disposal tubes breaking
* Add tubeconnections command
* Add missing verb attribute
* Add flipped disposal junction
* Add ids and linking to conveyors and switches
* Add conveyor switch prying and placing
* Add anchoring conveyor switches and refactor placing them
* Add missing serializable attributes from DisposableComponentState
* Make conveyor speed VV ReadWrite
* Change drawdepth of conveyors to FloorObjects
* Make conveyor anchored check consistent
* Remove anchoring interaction from switches
* Add conveyor switch id syncing and move switches slightly when pried
* Make entities in containers not able to be moved by conveyors
* Add conveyor and switches loose textures
* Merge conflict fixes
* Add disposal unit test
* Add flushing test to disposal unit test
* Add disposal unit flush fail test
* Add disposals to the saltern map
* Fix saltern disposal junctions
* Add power checks to the recycler
* Fix disposal unit placement in maintenance closet
* Remove disposal junctions from saltern
* Readd junctions to saltern
* Add the chemmaster to saltern at the request of Ike
* Move the chemistry disposal unit
* Fix casing of disposal flush sound
* More merge conflict fixes
* Fix a compiler warning.
* Remove popup invocation from buckle
* Remove showPopup parameter from InteractionChecks
* Remove unnecessary physics components
Fixes the physics system dying
* Replace PhysicsComponent usages with CollidableComponent
* Update existing code for the new controller system
* Change conveyors to use a VirtualController instead of teleporting the entity
* Remove visualizer 2d suffix and update physics code
* Transition code to new controller system
* Fix shuttles not moving
* Fix throwing
* Fix guns
* Change hands to use physics.Stop() and remove item fumble method
* Add syncing conveyor switches states
* Fix the recycler wanting to be a conveyor too hard
* Fix showwires > showsubfloor rename in mapping command
* Fix wifi air conveyors
* Fix test error
* Add showsubfloorforever command
Changes drawdepth of the relevant entities
* Disable opening the disposal unit interface while inside
* Add closing the disposal unit interface when getting inside
* Add closing the interface when the disposal unit component is removed
* Add removing entities on disposal unit component removal
* Delay disposal unit flush and fix serialization
* Implement pressure in disposal units
* Fix chain engaging a disposal unit
* Implement states to the disposal unit
* Fix missing imports from merge conflict
* Update Content.Server/GameObjects/Components/Conveyor/ConveyorComponent.cs
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
* Address some reviews
* Fix za buildo
* Use container helper to detach disposables
* Make conveyors use the construction system
* Make conveyor groups and syncing sane
* Make flip flip
brave
* Add activate interface to conveyor switches
* Fix not removing the switch from its group when it's deleted
* Fix not registering conveyors and switches on initialize
* Stop using 0 as null
* Disconnect conveyors and switches when disposing of a group
* Make disposal units not able to be exited when flushing
* Make disposal units flush after a configurable 30 seconds
* Add handle and light layers to the disposal unit
* Merge engaging and flushing
* Update saltern.yml
* I love using 0 as null
* Make disposal unit visual layers make sense
* Remove duplicate remove method in disposal units and update light
* Replace DisposableComponent with disposal holders
* Fix disposal holders deleting their contents on deletion
* Account for disposal unit pressure in tests and make a failed flush autoengage
* Rename disposable to holder
* Fix junction connections
* Disable self insert and flush verbs when inside a disposal unit
* Fix spamming the engage button making the animation reset
* Make the recycler take materials into account properly
Fix cablestack1 not existing
* Merge conflict fixes
* Fix pipes not being saved anchored
* Change conveyors and groups to not use an id
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2020-07-30 23:45:28 +02:00
|
|
|
{
|
2020-06-25 15:52:24 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-31 19:52:33 +02:00
|
|
|
SoundSystem.Play(Filter.Pvs(Owner), strap.BuckleSound.GetSound(), Owner);
|
2020-06-25 15:52:24 +02:00
|
|
|
|
|
|
|
|
if (!strap.TryAdd(this))
|
|
|
|
|
{
|
2021-12-05 18:09:01 +01:00
|
|
|
var message = Loc.GetString(Owner == user
|
2021-06-21 02:13:54 +02:00
|
|
|
? "buckle-component-cannot-buckle-message"
|
2021-07-31 19:52:33 +02:00
|
|
|
: "buckle-component-other-cannot-buckle-message", ("owner", Owner));
|
2021-12-03 11:15:41 -08:00
|
|
|
popupSystem.PopupEntity(message, user, Filter.Entities(user));
|
2020-06-25 15:52:24 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-15 03:26:37 +01:00
|
|
|
if(_entMan.TryGetComponent<AppearanceComponent>(Owner, out var appearance))
|
|
|
|
|
appearance.SetData(BuckleVisuals.Buckled, true);
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2021-05-22 13:53:51 +02:00
|
|
|
ReAttach(strap);
|
|
|
|
|
|
2020-07-04 13:44:32 +02:00
|
|
|
BuckledTo = strap;
|
2021-12-05 18:09:01 +01:00
|
|
|
LastEntityBuckledTo = BuckledTo.Owner;
|
2020-12-18 20:12:53 +01:00
|
|
|
DontCollide = true;
|
2020-07-24 14:22:28 +02:00
|
|
|
|
2020-11-06 15:15:02 +01:00
|
|
|
UpdateBuckleStatus();
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2022-02-15 20:04:33 -07:00
|
|
|
var ev = new BuckleChangeEvent() { Buckling = true, Strap = BuckledTo.Owner };
|
|
|
|
|
_entMan.EventBus.RaiseLocalEvent(Owner, ev, false);
|
2020-07-26 12:12:53 +02:00
|
|
|
|
2021-12-08 17:04:21 +01:00
|
|
|
if (_entMan.TryGetComponent(Owner, out SharedPullableComponent? ownerPullable))
|
2020-10-26 13:00:28 +02:00
|
|
|
{
|
2021-02-16 01:42:03 -07:00
|
|
|
if (ownerPullable.Puller != null)
|
2020-10-26 13:00:28 +02:00
|
|
|
{
|
2021-10-04 16:10:54 +01:00
|
|
|
EntitySystem.Get<PullingSystem>().TryStopPull(ownerPullable);
|
2021-02-16 01:42:03 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-08 17:04:21 +01:00
|
|
|
if (_entMan.TryGetComponent(to, out SharedPullableComponent? toPullable))
|
2021-02-16 01:42:03 -07:00
|
|
|
{
|
|
|
|
|
if (toPullable.Puller == Owner)
|
|
|
|
|
{
|
|
|
|
|
// can't pull it and buckle to it at the same time
|
2021-10-04 16:10:54 +01:00
|
|
|
EntitySystem.Get<PullingSystem>().TryStopPull(toPullable);
|
2020-10-26 13:00:28 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-25 15:52:24 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Tries to unbuckle the Owner of this component from its current strap.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="user">The entity doing the unbuckling.</param>
|
|
|
|
|
/// <param name="force">
|
|
|
|
|
/// Whether to force the unbuckling or not. Does not guarantee true to
|
|
|
|
|
/// be returned, but guarantees the owner to be unbuckled afterwards.
|
|
|
|
|
/// </param>
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// true if the owner was unbuckled, otherwise false even if the owner
|
|
|
|
|
/// was previously already unbuckled.
|
|
|
|
|
/// </returns>
|
2021-12-03 11:15:41 -08:00
|
|
|
public bool TryUnbuckle(EntityUid user, bool force = false)
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2020-11-06 15:15:02 +01:00
|
|
|
if (BuckledTo == null)
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-06 15:15:02 +01:00
|
|
|
var oldBuckledTo = BuckledTo;
|
2020-07-28 08:34:42 +02:00
|
|
|
|
2020-06-25 15:52:24 +02:00
|
|
|
if (!force)
|
|
|
|
|
{
|
2020-07-08 13:22:14 +02:00
|
|
|
if (_gameTiming.CurTime < _buckleTime + _unbuckleDelay)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-17 15:40:03 +13:00
|
|
|
if (!EntitySystem.Get<SharedInteractionSystem>().InRangeUnobstructed(user, oldBuckledTo.Owner, Range, popup: true))
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-28 08:34:42 +02:00
|
|
|
BuckledTo = null;
|
|
|
|
|
|
2021-12-29 15:57:20 +11:00
|
|
|
var entManager = IoCManager.Resolve<IEntityManager>();
|
|
|
|
|
var xform = entManager.GetComponent<TransformComponent>(Owner);
|
|
|
|
|
var oldBuckledXform = entManager.GetComponent<TransformComponent>(oldBuckledTo.Owner);
|
|
|
|
|
|
|
|
|
|
if (xform.ParentUid == oldBuckledXform.Owner)
|
2020-07-04 14:10:37 +02:00
|
|
|
{
|
2021-12-29 15:57:20 +11:00
|
|
|
xform.AttachParentToContainerOrGrid();
|
|
|
|
|
xform.WorldRotation = oldBuckledXform.WorldRotation;
|
|
|
|
|
|
|
|
|
|
if (oldBuckledTo.UnbuckleOffset != Vector2.Zero)
|
|
|
|
|
xform.Coordinates = oldBuckledXform.Coordinates.Offset(oldBuckledTo.UnbuckleOffset);
|
2020-07-04 14:10:37 +02:00
|
|
|
}
|
|
|
|
|
|
2022-01-15 03:26:37 +01:00
|
|
|
if(_entMan.TryGetComponent<AppearanceComponent>(Owner, out var appearance))
|
|
|
|
|
appearance.SetData(BuckleVisuals.Buckled, false);
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2021-12-08 17:04:21 +01:00
|
|
|
if (_entMan.HasComponent<KnockedDownComponent>(Owner)
|
2022-01-15 03:26:37 +01:00
|
|
|
| _entMan.TryGetComponent<MobStateComponent>(Owner, out var mobState) && mobState.IsIncapacitated())
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2021-12-05 18:09:01 +01:00
|
|
|
EntitySystem.Get<StandingStateSystem>().Down(Owner);
|
2020-06-25 15:52:24 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-12-05 18:09:01 +01:00
|
|
|
EntitySystem.Get<StandingStateSystem>().Stand(Owner);
|
2020-06-25 15:52:24 +02:00
|
|
|
}
|
|
|
|
|
|
2022-01-15 03:26:37 +01:00
|
|
|
mobState?.CurrentState?.EnterState(Owner, _entMan);
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2020-11-06 15:15:02 +01:00
|
|
|
UpdateBuckleStatus();
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2020-10-13 21:51:54 +02:00
|
|
|
oldBuckledTo.Remove(this);
|
2021-07-31 19:52:33 +02:00
|
|
|
SoundSystem.Play(Filter.Pvs(Owner), oldBuckledTo.UnbuckleSound.GetSound(), Owner);
|
|
|
|
|
|
2022-02-15 20:04:33 -07:00
|
|
|
var ev = new BuckleChangeEvent() { Buckling = false, Strap = oldBuckledTo.Owner };
|
|
|
|
|
_entMan.EventBus.RaiseLocalEvent(Owner, ev, false);
|
2020-07-26 12:12:53 +02:00
|
|
|
|
2020-06-25 15:52:24 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Makes an entity toggle the buckling status of the owner to a
|
|
|
|
|
/// specific entity.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="user">The entity doing the buckling/unbuckling.</param>
|
|
|
|
|
/// <param name="to">
|
|
|
|
|
/// The entity to toggle the buckle status of the owner to.
|
|
|
|
|
/// </param>
|
|
|
|
|
/// <param name="force">
|
|
|
|
|
/// Whether to force the unbuckling or not, if it happens. Does not
|
|
|
|
|
/// guarantee true to be returned, but guarantees the owner to be
|
|
|
|
|
/// unbuckled afterwards.
|
|
|
|
|
/// </param>
|
|
|
|
|
/// <returns>true if the buckling status was changed, false otherwise.</returns>
|
2021-12-03 11:15:41 -08:00
|
|
|
public bool ToggleBuckle(EntityUid user, EntityUid to, bool force = false)
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2021-12-05 18:09:01 +01:00
|
|
|
if (BuckledTo?.Owner == to)
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2020-07-17 10:43:10 +02:00
|
|
|
return TryUnbuckle(user, force);
|
2020-06-25 15:52:24 +02:00
|
|
|
}
|
2020-07-08 13:01:08 +02:00
|
|
|
|
|
|
|
|
return TryBuckle(user, to);
|
2020-06-25 15:52:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Startup()
|
|
|
|
|
{
|
|
|
|
|
base.Startup();
|
2020-11-06 15:15:02 +01:00
|
|
|
UpdateBuckleStatus();
|
2020-06-25 15:52:24 +02:00
|
|
|
}
|
2020-07-08 13:22:14 +02:00
|
|
|
|
2021-10-01 13:15:30 +02:00
|
|
|
protected override void Shutdown()
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2020-10-13 21:51:54 +02:00
|
|
|
BuckledTo?.Remove(this);
|
2021-12-05 18:09:01 +01:00
|
|
|
TryUnbuckle(Owner, true);
|
2020-07-08 15:30:48 +02:00
|
|
|
|
2020-07-08 13:22:14 +02:00
|
|
|
_buckleTime = default;
|
2020-11-06 15:15:02 +01:00
|
|
|
UpdateBuckleStatus();
|
2021-06-01 23:42:54 +10:00
|
|
|
|
2021-10-01 13:15:30 +02:00
|
|
|
base.Shutdown();
|
2020-06-25 15:52:24 +02:00
|
|
|
}
|
|
|
|
|
|
2021-11-30 15:20:38 +01:00
|
|
|
public override ComponentState GetComponentState()
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2020-07-04 01:28:06 +02:00
|
|
|
int? drawDepth = null;
|
|
|
|
|
|
|
|
|
|
if (BuckledTo != null &&
|
2021-12-08 17:04:21 +01:00
|
|
|
_entMan.GetComponent<TransformComponent>(BuckledTo.Owner).LocalRotation.GetCardinalDir() == Direction.North &&
|
2022-01-15 03:26:37 +01:00
|
|
|
_entMan.TryGetComponent<SpriteComponent>(BuckledTo.Owner, out var spriteComponent))
|
2020-07-04 01:28:06 +02:00
|
|
|
{
|
2022-01-15 03:26:37 +01:00
|
|
|
drawDepth = spriteComponent.DrawDepth - 1;
|
2020-07-04 01:28:06 +02:00
|
|
|
}
|
2020-12-20 04:14:41 +01:00
|
|
|
|
2020-12-18 20:12:53 +01:00
|
|
|
return new BuckleComponentState(Buckled, drawDepth, LastEntityBuckledTo, DontCollide);
|
2020-06-25 15:52:24 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|