diff --git a/Content.Shared/Weapons/Reflect/ReflectSystem.cs b/Content.Shared/Weapons/Reflect/ReflectSystem.cs index 1ca2cef4e4..31816d6023 100644 --- a/Content.Shared/Weapons/Reflect/ReflectSystem.cs +++ b/Content.Shared/Weapons/Reflect/ReflectSystem.cs @@ -15,6 +15,8 @@ using Robust.Shared.Network; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; using Robust.Shared.Random; +using Content.Shared.Examine; +using Content.Shared.Localizations; namespace Content.Shared.Weapons.Reflect; @@ -45,6 +47,7 @@ public sealed class ReflectSystem : EntitySystem SubscribeLocalEvent(OnReflectUnequipped); SubscribeLocalEvent(OnReflectHandEquipped); SubscribeLocalEvent(OnReflectHandUnequipped); + SubscribeLocalEvent(OnExamine); } private void OnReflectUserCollide(Entity ent, ref ProjectileReflectAttemptEvent args) @@ -200,4 +203,30 @@ public sealed class ReflectSystem : EntitySystem ent.Comp.InRightPlace = false; Dirty(ent); } + + #region Examine + private void OnExamine(Entity ent, ref ExaminedEvent args) + { + // This isn't examine verb or something just because it looks too much bad. + // Trust me, universal verb for the potential weapons, armor and walls looks awful. + var value = MathF.Round(ent.Comp.ReflectProb * 100, 1); + + if (!_toggle.IsActivated(ent.Owner) || value == 0 || ent.Comp.Reflects == ReflectType.None) + return; + + var compTypes = ent.Comp.Reflects.ToString().Split(", "); + + List typeList = new(compTypes.Length); + + for (var i = 0; i < compTypes.Length; i++) + { + var type = Loc.GetString(("reflect-component-" + compTypes[i]).ToLower()); + typeList.Add(type); + } + + var msg = ContentLocalizationManager.FormatList(typeList); + + args.PushMarkup(Loc.GetString("reflect-component-examine", ("value", value), ("type", msg))); + } + #endregion } diff --git a/Resources/Locale/en-US/reflect/reflect-component.ftl b/Resources/Locale/en-US/reflect/reflect-component.ftl new file mode 100644 index 0000000000..bf3f612af3 --- /dev/null +++ b/Resources/Locale/en-US/reflect/reflect-component.ftl @@ -0,0 +1,3 @@ +reflect-component-examine = It has a [color=lightblue]{$value}%[/color] chance to [color=cyan]reflect[/color] {$type}. +reflect-component-nonenergy = bullets +reflect-component-energy = energy bolts