mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-06 14:27:29 +00:00
* Pulling rework
Fixing up the FOUR systems managing pulling, all the shitcode, and also making it nicer ingame.
* More pulling cleanup
* stats
* More cleanup
* First draft
* More pulling
* weh
* Fix puller
* Pulling working
* Fix merge
* Dunked
* Self-merge time
* Fix hotkey
* Fix container changes
* oop
* Fix multi-pulling
* Move alerts cleanup.
* pulling fixes
(cherry picked from commit c584f6444a)
42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
using Content.Shared.Movement.Pulling.Systems;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Shared.Movement.Pulling.Components;
|
|
|
|
/// <summary>
|
|
/// Specifies an entity as being able to pull another entity with <see cref="PullableComponent"/>
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
[Access(typeof(PullingSystem))]
|
|
public sealed partial class PullerComponent : Component
|
|
{
|
|
// My raiding guild
|
|
/// <summary>
|
|
/// Next time the puller can throw what is being pulled.
|
|
/// Used to avoid spamming it for infinite spin + velocity.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
|
|
public TimeSpan NextThrow;
|
|
|
|
[DataField]
|
|
public TimeSpan ThrowCooldown = TimeSpan.FromSeconds(1);
|
|
|
|
// Before changing how this is updated, please see SharedPullerSystem.RefreshMovementSpeed
|
|
public float WalkSpeedModifier => Pulling == default ? 1.0f : 0.95f;
|
|
|
|
public float SprintSpeedModifier => Pulling == default ? 1.0f : 0.95f;
|
|
|
|
/// <summary>
|
|
/// Entity currently being pulled if applicable.
|
|
/// </summary>
|
|
[AutoNetworkedField, DataField]
|
|
public EntityUid? Pulling;
|
|
|
|
/// <summary>
|
|
/// Does this entity need hands to be able to pull something?
|
|
/// </summary>
|
|
[DataField]
|
|
public bool NeedsHands = true;
|
|
}
|