forked from space-syndicate/space-station-14-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPullerComponent.cs
116 lines (90 loc) · 3.36 KB
/
PullerComponent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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.Prototypes;
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(true)]
[Access(typeof(PullingSystem), typeof(TableSlamSystem))] // Goobstation - Table Slam
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, Access(Other = AccessPermissions.ReadWriteExecute)]
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;
[DataField]
public ProtoId<AlertPrototype> PullingAlert = "Pulling";
// Goobstation start
// Added Grab variables
[DataField]
public Dictionary<GrabStage, short> 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);
[DataField]
public Dictionary<GrabStage, float> EscapeChances = new()
{
{ GrabStage.No, 1f },
{ GrabStage.Soft, 0.3f },
{ GrabStage.Hard, 0.2f },
{ GrabStage.Suffocate, 0.01f },
};
[DataField]
public float SuffocateGrabStaminaDamage = 30f;
[DataField]
public float GrabThrowDamageModifier = 2f;
[ViewVariables]
public List<EntityUid> GrabVirtualItems = new();
[ViewVariables]
public Dictionary<GrabStage, int> GrabVirtualItemStageCount = new()
{
{ GrabStage.Suffocate, 1 },
};
[DataField]
public float StaminaDamageOnThrown = 210f;
[DataField]
public float GrabThrownSpeed = 7f;
[DataField]
public float ThrowingDistance = 4f;
[DataField]
public float SoftGrabSpeedModifier = 0.9f;
[DataField]
public float HardGrabSpeedModifier = 0.5f;
[DataField]
public float ChokeGrabSpeedModifier = 0.2f;
// Goobstation end
}
public sealed partial class StopPullingAlertEvent : BaseAlertEvent;