Proto-kinetic crusher (#16277)
Co-authored-by: AJCM-git <60196617+AJCM-git@users.noreply.github.com>
This commit is contained in:
@@ -8,6 +8,10 @@ using Content.Shared.Item;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Content.Shared.Weapons.Melee.Components;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Content.Shared.Weapons.Ranged.Components;
|
||||
using Content.Shared.Weapons.Ranged.Systems;
|
||||
using Content.Shared.Wieldable.Components;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
@@ -34,9 +38,32 @@ public sealed class WieldableSystem : EntitySystem
|
||||
SubscribeLocalEvent<WieldableComponent, GetVerbsEvent<InteractionVerb>>(AddToggleWieldVerb);
|
||||
SubscribeLocalEvent<WieldableComponent, DisarmAttemptEvent>(OnDisarmAttemptEvent);
|
||||
|
||||
SubscribeLocalEvent<MeleeRequiresWieldComponent, AttemptMeleeEvent>(OnMeleeAttempt);
|
||||
SubscribeLocalEvent<GunRequiresWieldComponent, AttemptShootEvent>(OnShootAttempt);
|
||||
|
||||
SubscribeLocalEvent<IncreaseDamageOnWieldComponent, MeleeHitEvent>(OnMeleeHit);
|
||||
}
|
||||
|
||||
private void OnMeleeAttempt(EntityUid uid, MeleeRequiresWieldComponent component, ref AttemptMeleeEvent args)
|
||||
{
|
||||
if (TryComp<WieldableComponent>(uid, out var wieldable) &&
|
||||
!wieldable.Wielded)
|
||||
{
|
||||
args.Cancelled = true;
|
||||
args.Message = Loc.GetString("wieldable-component-requires", ("item", uid));
|
||||
}
|
||||
}
|
||||
|
||||
private void OnShootAttempt(EntityUid uid, GunRequiresWieldComponent component, ref AttemptShootEvent args)
|
||||
{
|
||||
if (TryComp<WieldableComponent>(uid, out var wieldable) &&
|
||||
!wieldable.Wielded)
|
||||
{
|
||||
args.Cancelled = true;
|
||||
args.Message = Loc.GetString("wieldable-component-requires", ("item", uid));
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDisarmAttemptEvent(EntityUid uid, WieldableComponent component, DisarmAttemptEvent args)
|
||||
{
|
||||
if (component.Wielded)
|
||||
|
||||
Reference in New Issue
Block a user