using Content.Shared._Goobstation.MartialArts;
using Content.Shared._Goobstation.TableSlam; // Goobstation - Table Slam
using Content.Shared.Alert;
using Content.Shared.Movement.Pulling.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Movement.Pulling.Components;
///
/// Specifies an entity as being able to pull another entity with
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
[Access(typeof(PullingSystem), typeof(TableSlamSystem), typeof(SharedMartialArtsSystem))] // Goobstation - Table Slam
public sealed partial class PullerComponent : Component
{
///
/// Next time the puller change where they are pulling the target towards.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField, Access(Other = AccessPermissions.ReadWriteExecute)]
public TimeSpan NextPushTargetChange;
[DataField, AutoNetworkedField, Access(Other = AccessPermissions.ReadWriteExecute)]
public TimeSpan NextPushStop;
[DataField]
public TimeSpan PushChangeCooldown = TimeSpan.FromSeconds(0.1f), PushDuration = TimeSpan.FromSeconds(5f);
// 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;
///
/// Entity currently being pulled/pushed if applicable.
///
[AutoNetworkedField, DataField]
public EntityUid? Pulling;
///
/// The position the entity is currently being pulled towards.
///
[AutoNetworkedField, DataField]
public EntityCoordinates? PushingTowards;
///
/// Does this entity need hands to be able to pull something?
///
[DataField]
public bool NeedsHands = true;
///
/// The maximum acceleration of pushing, in meters per second squared.
///
[DataField]
public float PushAcceleration = 0.3f;
///
/// The maximum speed to which the pulled entity may be accelerated relative to the push direction, in meters per second.
///
[DataField]
public float MaxPushSpeed = 1.2f;
///
/// The maximum distance between the puller and the point towards which the puller may attempt to pull it, in meters.
///
[DataField]
public float MaxPushRange = 2f;
[DataField]
public ProtoId PullingAlert = "Pulling";
// Goobstation start
// Added Grab variables
[DataField]
public Dictionary PullingAlertSeverity = new()
{
{ GrabStage.No, 0 },
{ GrabStage.Soft, 1 },
{ GrabStage.Hard, 2 },
{ GrabStage.Suffocate, 3 },
};
[DataField, AutoNetworkedField]
public GrabStage GrabStage = GrabStage.No;
[DataField, AutoNetworkedField]
public GrabStageDirection GrabStageDirection = GrabStageDirection.Increase;
[AutoNetworkedField]
public TimeSpan NextStageChange;
[DataField]
public TimeSpan StageChangeCooldown = TimeSpan.FromSeconds(1.5f);
[AutoNetworkedField]
public TimeSpan WhenCanThrow;
///
/// After initiating / upgrading to a hard combat grab, how long should you have to keep somebody grabbed to be able to throw them.
///
[DataField]
public TimeSpan ThrowDelayOnGrab = TimeSpan.FromSeconds(2f);
[DataField]
public Dictionary EscapeChances = new()
{
{ GrabStage.No, 1f },
{ GrabStage.Soft, 0.4f }, // WD EDIT
{ GrabStage.Hard, 0.2f }, // WD EDIT
{ GrabStage.Suffocate, 0.1f },
};
[DataField]
public float SuffocateGrabStaminaDamage = 10f;
[DataField]
public float GrabThrowDamageModifier = 2f;
[ViewVariables]
public List GrabVirtualItems = new();
[ViewVariables]
public Dictionary GrabVirtualItemStageCount = new()
{
{ GrabStage.Suffocate, 1 },
};
[DataField]
public float StaminaDamageOnThrown = 100f;
[DataField]
public float GrabThrownSpeed = 7f;
[DataField]
public float ThrowingDistance = 4f;
[DataField]
public float SoftGrabSpeedModifier = 0.9f;
[DataField]
public float HardGrabSpeedModifier = 0.7f;
[DataField]
public float ChokeGrabSpeedModifier = 0.4f;
// Goobstation end
}
public sealed partial class StopPullingAlertEvent : BaseAlertEvent;