From c4dcc9097299835ac3995290622c7a079d18c820 Mon Sep 17 00:00:00 2001 From: Brandon Hu <103440971+Brandon-Huu@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:33:14 +0000 Subject: [PATCH] tweak(GunRequiresWield): State the requirement for gun wielding in the description. (#30301) * https://en.wikipedia.org/wiki/List_of_LASD_deputy_gangs * https://knock-la.com/tradition-of-violence-lasd-gang-history/ * https://coc.lacounty.gov/deputy-gangs/ --- .../Ranged/Components/GunRequiresWieldComponent.cs | 3 +++ Content.Shared/Wieldable/WieldableSystem.cs | 10 ++++++++++ .../Locale/en-US/wieldable/wieldable-component.ftl | 2 ++ 3 files changed, 15 insertions(+) diff --git a/Content.Shared/Weapons/Ranged/Components/GunRequiresWieldComponent.cs b/Content.Shared/Weapons/Ranged/Components/GunRequiresWieldComponent.cs index fa3732209f..2016459b9d 100644 --- a/Content.Shared/Weapons/Ranged/Components/GunRequiresWieldComponent.cs +++ b/Content.Shared/Weapons/Ranged/Components/GunRequiresWieldComponent.cs @@ -15,4 +15,7 @@ public sealed partial class GunRequiresWieldComponent : Component [DataField, AutoNetworkedField] public TimeSpan PopupCooldown = TimeSpan.FromSeconds(1); + + [DataField] + public LocId? WieldRequiresExamineMessage = "gunrequireswield-component-examine"; } diff --git a/Content.Shared/Wieldable/WieldableSystem.cs b/Content.Shared/Wieldable/WieldableSystem.cs index a0c9d04ff7..d76876c0cf 100644 --- a/Content.Shared/Wieldable/WieldableSystem.cs +++ b/Content.Shared/Wieldable/WieldableSystem.cs @@ -47,6 +47,7 @@ public sealed class WieldableSystem : EntitySystem SubscribeLocalEvent(OnDeselectWieldable); SubscribeLocalEvent(OnMeleeAttempt); + SubscribeLocalEvent(OnExamineRequires); SubscribeLocalEvent(OnShootAttempt); SubscribeLocalEvent(OnGunWielded); SubscribeLocalEvent(OnGunUnwielded); @@ -116,8 +117,17 @@ public sealed class WieldableSystem : EntitySystem } } + private void OnExamineRequires(Entity entity, ref ExaminedEvent args) + { + if(entity.Comp.WieldRequiresExamineMessage != null) + args.PushText(Loc.GetString(entity.Comp.WieldRequiresExamineMessage)); + } + private void OnExamine(EntityUid uid, GunWieldBonusComponent component, ref ExaminedEvent args) { + if (HasComp(uid)) + return; + if (component.WieldBonusExamineMessage != null) args.PushText(Loc.GetString(component.WieldBonusExamineMessage)); } diff --git a/Resources/Locale/en-US/wieldable/wieldable-component.ftl b/Resources/Locale/en-US/wieldable/wieldable-component.ftl index 84b58224a7..585d611016 100644 --- a/Resources/Locale/en-US/wieldable/wieldable-component.ftl +++ b/Resources/Locale/en-US/wieldable/wieldable-component.ftl @@ -18,3 +18,5 @@ wieldable-component-not-in-hands = { CAPITALIZE(THE($item)) } isn't in your hand wieldable-component-requires = { CAPITALIZE(THE($item))} must be wielded! gunwieldbonus-component-examine = This weapon has improved accuracy when wielded. + +gunrequireswield-component-examine = This weapon can only be fired when wielded. -- 2.52.0