]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Pneumatic cannon accuracy buff (#23996)
authorGreyMario <mariomister541@gmail.com>
Sat, 13 Jan 2024 07:29:19 +0000 (23:29 -0800)
committerGitHub <noreply@github.com>
Sat, 13 Jan 2024 07:29:19 +0000 (00:29 -0700)
make thrown item launchers stronger than hands more accurate

Content.Shared/Throwing/ThrowingSystem.cs

index a4c95ec5e36bd62516340fdb7fe9c07c9de64098..e6315464119c59aa1d40a4f2004de9d018d50f48 100644 (file)
@@ -2,6 +2,8 @@ using System.Numerics;
 using Content.Shared.Administration.Logs;
 using Content.Shared.Database;
 using Content.Shared.Gravity;
+using Content.Shared.Hands.Components;
+using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Projectiles;
 using Content.Shared.Tag;
@@ -118,7 +120,11 @@ public sealed class ThrowingSystem : EntitySystem
         // Estimate time to arrival so we can apply OnGround status and slow it much faster.
         var time = direction.Length() / strength;
         comp.ThrownTime = _gameTiming.CurTime;
-        comp.LandTime = time < FlyTime ? default : comp.ThrownTime + TimeSpan.FromSeconds(time - FlyTime);
+        // did we launch this with something stronger than our hands?
+        if (TryComp<HandsComponent>(comp.Thrower, out var hands) && strength > hands.ThrowForceMultiplier)
+            comp.LandTime = comp.ThrownTime + TimeSpan.FromSeconds(time);
+        else
+            comp.LandTime = time < FlyTime ? default : comp.ThrownTime + TimeSpan.FromSeconds(time - FlyTime);
         comp.PlayLandSound = playSound;
 
         ThrowingAngleComponent? throwingAngle = null;