From 443a25cbd3f5ef8ab31f1e5a0adcd2c43ca9eb87 Mon Sep 17 00:00:00 2001 From: BIGZi0348 <118811750+BIGZi0348@users.noreply.github.com> Date: Sat, 26 Oct 2024 20:20:19 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B7=D0=B0=D1=89=D0=B8=D1=82=D1=8B=20=D0=BE=D1=82=20?= =?UTF-8?q?=D0=B3=D0=BE=D1=80=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=BE=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D1=89=D0=B8?= =?UTF-8?q?=D1=82=D1=8B=20=D0=BE=D1=82=20=D0=B2=D0=B7=D1=80=D1=8B=D0=B2?= =?UTF-8?q?=D0=BE=D0=B2=20(#747)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Добавил отображение защиты от горения * Update Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs Co-authored-by: ThereDrD <88589686+ThereDrD0@users.noreply.github.com> * Update Resources/Locale/ru-RU/_white/info/fire-protection.ftl Co-authored-by: ThereDrD <88589686+ThereDrD0@users.noreply.github.com> * Правки * негативный ноль с плавающей точкой --------- Co-authored-by: ThereDrD <88589686+ThereDrD0@users.noreply.github.com> --- .../EntitySystems/FireProtectionSystem.cs | 29 +++++++++++++++++++ .../Examine/GroupExamineComponent.cs | 1 + .../ru-RU/_white/info/fire-protection.ftl | 3 ++ .../ru-RU/explosions/explosion-resistance.ftl | 3 +- 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 Resources/Locale/ru-RU/_white/info/fire-protection.ftl diff --git a/Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs b/Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs index 6f80bc0588..e1059112fe 100644 --- a/Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs @@ -1,6 +1,9 @@ using Content.Shared.Atmos; using Content.Shared.Clothing.Components; using Content.Shared.Inventory; +using Content.Shared.Examine; // WD +using Content.Shared.Verbs; // WD +using Robust.Shared.Utility; // WD namespace Content.Shared.Clothing.EntitySystems; @@ -9,15 +12,41 @@ namespace Content.Shared.Clothing.EntitySystems; /// public sealed class FireProtectionSystem : EntitySystem { + [Dependency] private readonly ExamineSystemShared _examine = default!; // WD + + private const string IconTexture = "/Textures/Interface/VerbIcons/dot.svg.192dpi.png"; // WD + public override void Initialize() { base.Initialize(); SubscribeLocalEvent>(OnGetProtection); + SubscribeLocalEvent>(OnProtectionVerbExamine); // WD } private void OnGetProtection(Entity ent, ref InventoryRelayedEvent args) { args.Args.Reduce(ent.Comp.Reduction); } + + // WD EDIT START + private void OnProtectionVerbExamine(Entity entity, ref GetVerbsEvent args) + { + if (!args.CanInteract || !args.CanAccess) + return; + + var modifierPercentage = MathF.Round(entity.Comp.Reduction * 100f, 1); + + if (modifierPercentage == float.NegativeZero) + return; + + var msg = new FormattedMessage(); + + msg.AddMarkup(Loc.GetString("fire-protection-examine", ("modifier", modifierPercentage))); + + _examine.AddDetailedExamineVerb(args, entity.Comp, msg, + Loc.GetString("fire-protection-examinable-verb-text"), IconTexture, + Loc.GetString("fire-protection-examinable-verb-message")); + } + // WD EDIT END } diff --git a/Content.Shared/Examine/GroupExamineComponent.cs b/Content.Shared/Examine/GroupExamineComponent.cs index f91fd4c4de..136ead31fb 100644 --- a/Content.Shared/Examine/GroupExamineComponent.cs +++ b/Content.Shared/Examine/GroupExamineComponent.cs @@ -22,6 +22,7 @@ namespace Content.Shared.Examine { "Armor", "ClothingSpeedModifier", + "FireProtection" // WD }, }, }; diff --git a/Resources/Locale/ru-RU/_white/info/fire-protection.ftl b/Resources/Locale/ru-RU/_white/info/fire-protection.ftl new file mode 100644 index 0000000000..769b0c77f9 --- /dev/null +++ b/Resources/Locale/ru-RU/_white/info/fire-protection.ftl @@ -0,0 +1,3 @@ +fire-protection-examinable-verb-text = Защита +fire-protection-examinable-verb-message = Изучить показатели защиты. +fire-protection-examine = Обеспечивает защиту от огня на [color=yellow]{ $modifier }%[/color]. diff --git a/Resources/Locale/ru-RU/explosions/explosion-resistance.ftl b/Resources/Locale/ru-RU/explosions/explosion-resistance.ftl index 0c025e7b6c..696f900ddd 100644 --- a/Resources/Locale/ru-RU/explosions/explosion-resistance.ftl +++ b/Resources/Locale/ru-RU/explosions/explosion-resistance.ftl @@ -1 +1,2 @@ -explosion-resistance-coefficient-value = - [color=orange]Взрывной[/color] урон снижен благодаря [color=lightblue]{ $value }%[/color]. +explosion-resistance-coefficient-value = - [color=orange]Взрывной[/color] урон снижается на [color=lightblue]{ $value }%[/color]. +explosion-resistance-contents-coefficient-value = - [color=orange]Взрывной[/color] урон [color=white]содержимому[/color] снижается на [color=lightblue]{$value}%[/color].