diff --git a/Content.Shared/Clothing/Components/FireProtectionComponent.cs b/Content.Shared/Clothing/Components/FireProtectionComponent.cs index cafa6e5359..0aa196f167 100644 --- a/Content.Shared/Clothing/Components/FireProtectionComponent.cs +++ b/Content.Shared/Clothing/Components/FireProtectionComponent.cs @@ -14,4 +14,11 @@ public sealed partial class FireProtectionComponent : Component /// [DataField(required: true)] public float Reduction; + + /// + /// LocId for message that will be shown on detailed examine. + /// Actually can be moved into system + /// + [DataField] + public LocId ExamineMessage = "fire-protection-reduction-value"; } diff --git a/Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs b/Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs index 6f80bc0588..b6c29b21ad 100644 --- a/Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs @@ -1,3 +1,4 @@ +using Content.Shared.Armor; using Content.Shared.Atmos; using Content.Shared.Clothing.Components; using Content.Shared.Inventory; @@ -14,10 +15,22 @@ public sealed class FireProtectionSystem : EntitySystem base.Initialize(); SubscribeLocalEvent>(OnGetProtection); + SubscribeLocalEvent(OnArmorExamine); } private void OnGetProtection(Entity ent, ref InventoryRelayedEvent args) { args.Args.Reduce(ent.Comp.Reduction); } + + private void OnArmorExamine(Entity ent, ref ArmorExamineEvent args) + { + var value = MathF.Round((1f - ent.Comp.Reduction) * 100, 1); + + if (value == 0) + return; + + args.Msg.PushNewline(); + args.Msg.AddMarkupOrThrow(Loc.GetString(ent.Comp.ExamineMessage, ("value", value))); + } } diff --git a/Resources/Locale/en-US/clothing/components/fire-protection-component.ftl b/Resources/Locale/en-US/clothing/components/fire-protection-component.ftl new file mode 100644 index 0000000000..9f8c82deba --- /dev/null +++ b/Resources/Locale/en-US/clothing/components/fire-protection-component.ftl @@ -0,0 +1 @@ +fire-protection-reduction-value = - [color=orange]Fire[/color] damage reduced by [color=lightblue]{$value}%[/color].