Add hints towards flash protection to all items which provide it (#37267)

* Update welding.yml

* Update FlashSystem.cs

Add subscriber event for flash immunity examine text

* Create flash-immunity-component.ftl

* Removed changed description text

* change to use entity version

* fixed mistake
This commit is contained in:
Helix-ctrl
2025-06-15 23:38:36 +01:00
committed by GitHub
parent c83420fca5
commit 1d4cf48c31
2 changed files with 8 additions and 1 deletions

View File

@@ -45,7 +45,7 @@ namespace Content.Server.Flash
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<FlashImmunityComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<FlashComponent, MeleeHitEvent>(OnFlashMeleeHit); SubscribeLocalEvent<FlashComponent, MeleeHitEvent>(OnFlashMeleeHit);
// ran before toggling light for extra-bright lantern // ran before toggling light for extra-bright lantern
SubscribeLocalEvent<FlashComponent, UseInHandEvent>(OnFlashUseInHand, before: new[] { typeof(HandheldLightSystem) }); SubscribeLocalEvent<FlashComponent, UseInHandEvent>(OnFlashUseInHand, before: new[] { typeof(HandheldLightSystem) });
@@ -54,7 +54,13 @@ namespace Content.Server.Flash
SubscribeLocalEvent<PermanentBlindnessComponent, FlashAttemptEvent>(OnPermanentBlindnessFlashAttempt); SubscribeLocalEvent<PermanentBlindnessComponent, FlashAttemptEvent>(OnPermanentBlindnessFlashAttempt);
SubscribeLocalEvent<TemporaryBlindnessComponent, FlashAttemptEvent>(OnTemporaryBlindnessFlashAttempt); SubscribeLocalEvent<TemporaryBlindnessComponent, FlashAttemptEvent>(OnTemporaryBlindnessFlashAttempt);
} }
private void OnExamine(Entity<FlashImmunityComponent> ent, ref ExaminedEvent args)
{
args.PushMarkup(Loc.GetString("flash-protection"));
}
private void OnFlashMeleeHit(EntityUid uid, FlashComponent comp, MeleeHitEvent args) private void OnFlashMeleeHit(EntityUid uid, FlashComponent comp, MeleeHitEvent args)
{ {
if (!args.IsHit || if (!args.IsHit ||

View File

@@ -0,0 +1 @@
flash-protection = It provides protection from [color=lightblue]bright flashes[/color].