Added display for amount of hits left in stun batons/stun prods. (#25141)

Added display for amount of hits left in stun batons/stunprods.

Co-authored-by: Plykiya <plykiya@protonmail.com>
(cherry picked from commit 5f2cc18be77010962b94bbeb969ee06ba43f655d)
This commit is contained in:
Plykiya 2024-02-11 22:36:06 -08:00 committed by Debug
parent df496a6d5d
commit 4f434db79c
No known key found for this signature in database
GPG Key ID: 271270A74EF9C350
2 changed files with 10 additions and 0 deletions

View 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)

View 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.