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/
This commit is contained in:
Brandon Hu 2024-07-24 12:33:14 +00:00 committed by deltanedas
parent 64d5232591
commit c7f626df69
3 changed files with 15 additions and 0 deletions

View File

@ -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";
}

View File

@ -47,6 +47,7 @@ public sealed class WieldableSystem : EntitySystem
SubscribeLocalEvent<WieldableComponent, HandDeselectedEvent>(OnDeselectWieldable);
SubscribeLocalEvent<MeleeRequiresWieldComponent, AttemptMeleeEvent>(OnMeleeAttempt);
SubscribeLocalEvent<GunRequiresWieldComponent, ExaminedEvent>(OnExamineRequires);
SubscribeLocalEvent<GunRequiresWieldComponent, ShotAttemptedEvent>(OnShootAttempt);
SubscribeLocalEvent<GunWieldBonusComponent, ItemWieldedEvent>(OnGunWielded);
SubscribeLocalEvent<GunWieldBonusComponent, ItemUnwieldedEvent>(OnGunUnwielded);
@ -116,8 +117,17 @@ public sealed class WieldableSystem : EntitySystem
}
}
private void OnExamineRequires(Entity<GunRequiresWieldComponent> 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<GunRequiresWieldComponent>(uid))
return;
if (component.WieldBonusExamineMessage != null)
args.PushText(Loc.GetString(component.WieldBonusExamineMessage));
}

View File

@ -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.