Skip to content

Commit

Permalink
Made Stamres Show in Resistances View Take 2 (Simple-Station#767)
Browse files Browse the repository at this point in the history
<!--
This is a semi-strict format, you can add/remove sections as needed but
the order/format should be kept the same
Remove these comments before submitting
-->

# Description

title

for some reason something went horribly wrong
[here](Simple-Station#766)

---

<details><summary><h1>Media</h1></summary>
<p>


![image](https://github.com/user-attachments/assets/a9e71b67-ae47-437f-a370-d25b6388d48d)

</p>
</details>

---

# Changelog

no cl no fun

---------

Co-authored-by: whateverusername0 <whateveremail>
  • Loading branch information
whateverusername0 authored Aug 21, 2024
1 parent 841991d commit dfd2785
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions Content.Shared/Stunnable/StaminaDamageResistanceSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Shared.Armor;
using Content.Shared.Damage.Events;
using Content.Shared.Examine;
using Content.Shared.Inventory;
Expand All @@ -11,16 +12,21 @@ public override void Initialize()
base.Initialize();

SubscribeLocalEvent<StaminaDamageResistanceComponent, InventoryRelayedEvent<TakeStaminaDamageEvent>>(OnStaminaMeleeHit);
SubscribeLocalEvent<StaminaDamageResistanceComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<StaminaDamageResistanceComponent, ArmorExamineEvent>(OnExamine);
}

private void OnStaminaMeleeHit(Entity<StaminaDamageResistanceComponent> ent, ref InventoryRelayedEvent<TakeStaminaDamageEvent> args)
{
args.Args.Multiplier *= ent.Comp.Coefficient;
}
private void OnExamine(Entity<StaminaDamageResistanceComponent> ent, ref ExaminedEvent args)
private void OnExamine(Entity<StaminaDamageResistanceComponent> ent, ref ArmorExamineEvent args)
{
var percentage = (1 - ent.Comp.Coefficient) * 100;
args.PushMarkup(Loc.GetString("armor-examine-stamina", ("num", percentage)));

if (percentage == 0)
return;

args.Msg.PushNewline();
args.Msg.AddMarkup(Loc.GetString("armor-examine-stamina", ("num", percentage)));
}
}
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/armor/armor-examine.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ armor-damage-type-cold = Cold
armor-damage-type-poison = Poison
armor-damage-type-shock = Shock
armor-damage-type-structural = Structural
armor-examine-stamina = Reduces your stamina damage by [color=cyan]{$num}%[/color].
armor-examine-stamina = - [color=cyan]Stamina[/color] damage reduced by [color=lightblue]{$num}%[/color].

0 comments on commit dfd2785

Please sign in to comment.