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>
This commit is contained in:
Froffy025
2024-04-14 06:16:23 -04:00
committed by GitHub
parent 9d0dfcf2b9
commit a7fad5d439
2 changed files with 18 additions and 0 deletions

View File

@@ -17,4 +17,20 @@ public sealed partial class GunWieldBonusComponent : Component
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("maxAngle"), AutoNetworkedField]
public Angle MaxAngle = Angle.FromDegrees(-43);
/// <summary>
/// Recoil bonuses applied upon being wielded.
/// Higher angle decay bonus, quicker recovery.
/// Lower angle increase bonus (negative numbers), slower buildup.
/// </summary>
[DataField, AutoNetworkedField]
public Angle AngleDecay = Angle.FromDegrees(0);
/// <summary>
/// Recoil bonuses applied upon being wielded.
/// Higher angle decay bonus, quicker recovery.
/// Lower angle increase bonus (negative numbers), slower buildup.
/// </summary>
[DataField, AutoNetworkedField]
public Angle AngleIncrease = Angle.FromDegrees(0);
}

View File

@@ -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;
}
}