mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 13:37:47 +03:00
# Description Fixes pulling being obnoxiously unphysical. Entities now exert a specific amount of force defined as the product of their mass and the SpecificForce set in their PullerComponent. Doing a ctrl-right click now sets a target position where your entity begins to continuously push the pulled entity towards, instead of throwing it or pushing it once (however, it should still be possible to drag people and disposals and the like). Additionally, your entity will properly experience recoil from dragging someone around. # TODO - [X] Do stuff - [X] Fix stuff - [X] Fix aghosts not being able to push (?) - [X] Fix pulling giving you free kinetic energy while in spess (how?) - [ ] Test if throwing felinids into disposals via pulling still works :trollface: <details><summary><h1>Media</h1></summary> <p> https://github.com/user-attachments/assets/2498ef8c-f743-4702-b73c-b2da0c16e9aa </p> </details> # Changelog 🆑 - add: Pulling has been reworked. Your character will now try to continuously push the pulled entity when you use the push keybind. - remove: You can no longer push the pulled entity while walking, and pushing now follows the momentum conservation laws.
47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
using Robust.Shared.GameStates;
|
|
|
|
namespace Content.Shared.Movement.Pulling.Components;
|
|
|
|
/// <summary>
|
|
/// Specifies an entity as being pullable by an entity with <see cref="PullerComponent"/>
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
[Access(typeof(Systems.PullingSystem))]
|
|
public sealed partial class PullableComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The current entity pulling this component.
|
|
/// </summary>
|
|
[AutoNetworkedField, DataField]
|
|
public EntityUid? Puller;
|
|
|
|
/// <summary>
|
|
/// The pull joint.
|
|
/// </summary>
|
|
[AutoNetworkedField, DataField]
|
|
public string? PullJointId;
|
|
|
|
public bool BeingPulled => Puller != null;
|
|
|
|
/// <summary>
|
|
/// If the physics component has FixedRotation should we keep it upon being pulled
|
|
/// </summary>
|
|
[Access(typeof(Systems.PullingSystem), Other = AccessPermissions.ReadExecute)]
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("fixedRotation")]
|
|
public bool FixedRotationOnPull;
|
|
|
|
/// <summary>
|
|
/// What the pullable's fixedrotation was set to before being pulled.
|
|
/// </summary>
|
|
[Access(typeof(Systems.PullingSystem), Other = AccessPermissions.ReadExecute)]
|
|
[AutoNetworkedField, DataField]
|
|
public bool PrevFixedRotation;
|
|
|
|
/// <summary>
|
|
/// Whether the entity is currently being actively pushed by the puller.
|
|
/// If true, the entity will be able to enter disposals upon colliding with them, and the like.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool BeingActivelyPushed = false;
|
|
}
|