]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Added display for amount of hits left in stun batons/stun prods. (#25141)
authorPlykiya <58439124+Plykiya@users.noreply.github.com>
Mon, 12 Feb 2024 06:36:06 +0000 (22:36 -0800)
committerGitHub <noreply@github.com>
Mon, 12 Feb 2024 06:36:06 +0000 (23:36 -0700)
Added display for amount of hits left in stun batons/stunprods.

Co-authored-by: Plykiya <plykiya@protonmail.com>
Content.Server/Stunnable/Systems/StunbatonSystem.cs
Resources/Locale/en-US/weapons/melee/melee.ftl

index 027259495c10a0d2edd8fd3656a4cf7f62e4d473..5f019490b5c0c4b4c833ace19ed91d123e7a0cda 100644 (file)
@@ -48,6 +48,12 @@ namespace Content.Server.Stunnable.Systems
             ? Loc.GetString("comp-stunbaton-examined-on")
             : Loc.GetString("comp-stunbaton-examined-off");
             args.PushMarkup(onMsg);
+
+            if (TryComp<BatteryComponent>(entity.Owner, out var battery))
+            {
+                var count = (int) (battery.CurrentCharge / entity.Comp.EnergyPerUse);
+                args.PushMarkup(Loc.GetString("melee-battery-examine", ("color", "yellow"), ("count", count)));
+            }
         }
 
         private void ToggleDone(Entity<StunbatonComponent> entity, ref ItemToggledEvent args)
index 6dddfcc8244720ff4a55fdd3bf24f2078b0a13c7..871d142504f0a07c8f60ce7a7da429c41a409fce 100644 (file)
@@ -1,3 +1,7 @@
 melee-inject-failed-hardsuit = Your {$weapon} cannot inject through hardsuits!
 
 melee-balloon-pop = {CAPITALIZE(THE($balloon))} popped!
+
+
+#BatteryComponent
+melee-battery-examine = It has enough charge for [color={$color}]{$count}[/color] hits.