From a7fad5d43953ea679418d7c39272bf3224f7767f Mon Sep 17 00:00:00 2001
From: Froffy025 <78222136+Froffy025@users.noreply.github.com>
Date: Sun, 14 Apr 2024 06:16:23 -0400
Subject: [PATCH] Wield recoil components (#26915)
* WieldRecoilComponents
* WieldRecoilComponents
* Update Content.Shared/Weapons/Ranged/Components/GunWieldBonusComponent.cs
Co-authored-by: Whisper <121047731+QuietlyWhisper@users.noreply.github.com>
* Update Content.Shared/Weapons/Ranged/Components/GunWieldBonusComponent.cs
---------
Co-authored-by: Whisper <121047731+QuietlyWhisper@users.noreply.github.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
---
.../Ranged/Components/GunWieldBonusComponent.cs | 16 ++++++++++++++++
Content.Shared/Wieldable/WieldableSystem.cs | 2 ++
2 files changed, 18 insertions(+)
diff --git a/Content.Shared/Weapons/Ranged/Components/GunWieldBonusComponent.cs b/Content.Shared/Weapons/Ranged/Components/GunWieldBonusComponent.cs
index 58c5fec2d8..ce96639e3c 100644
--- a/Content.Shared/Weapons/Ranged/Components/GunWieldBonusComponent.cs
+++ b/Content.Shared/Weapons/Ranged/Components/GunWieldBonusComponent.cs
@@ -17,4 +17,20 @@ public sealed partial class GunWieldBonusComponent : Component
///
[ViewVariables(VVAccess.ReadWrite), DataField("maxAngle"), AutoNetworkedField]
public Angle MaxAngle = Angle.FromDegrees(-43);
+
+ ///
+ /// Recoil bonuses applied upon being wielded.
+ /// Higher angle decay bonus, quicker recovery.
+ /// Lower angle increase bonus (negative numbers), slower buildup.
+ ///
+ [DataField, AutoNetworkedField]
+ public Angle AngleDecay = Angle.FromDegrees(0);
+
+ ///
+ /// Recoil bonuses applied upon being wielded.
+ /// Higher angle decay bonus, quicker recovery.
+ /// Lower angle increase bonus (negative numbers), slower buildup.
+ ///
+ [DataField, AutoNetworkedField]
+ public Angle AngleIncrease = Angle.FromDegrees(0);
}
diff --git a/Content.Shared/Wieldable/WieldableSystem.cs b/Content.Shared/Wieldable/WieldableSystem.cs
index 2baed19ef8..6bd406c1ca 100644
--- a/Content.Shared/Wieldable/WieldableSystem.cs
+++ b/Content.Shared/Wieldable/WieldableSystem.cs
@@ -90,6 +90,8 @@ public sealed class WieldableSystem : EntitySystem
{
args.MinAngle += bonus.Comp.MinAngle;
args.MaxAngle += bonus.Comp.MaxAngle;
+ args.AngleDecay += bonus.Comp.AngleDecay;
+ args.AngleIncrease += bonus.Comp.AngleIncrease;
}
}