Mjollnir and Singularity Hammer for Wizard (#34446)

This commit is contained in:
keronshb
2025-02-20 18:38:52 -05:00
committed by GitHub
parent f3c681153a
commit a9054c5e9c
29 changed files with 698 additions and 206 deletions

View File

@@ -191,6 +191,9 @@ public abstract class SharedWieldableSystem : EntitySystem
args.Handled = TryWield(uid, component, args.User);
else if (component.UnwieldOnUse)
args.Handled = TryUnwield(uid, component, args.User);
if (HasComp<UseDelayComponent>(uid) && !component.UseDelayOnWield)
args.ApplyDelay = false;
}
public bool CanWield(EntityUid uid, WieldableComponent component, EntityUid user, bool quiet = false)
@@ -235,9 +238,11 @@ public abstract class SharedWieldableSystem : EntitySystem
if (!CanWield(used, component, user))
return false;
if (TryComp(used, out UseDelayComponent? useDelay)
&& !_delay.TryResetDelay((used, useDelay), true))
return false;
if (TryComp(used, out UseDelayComponent? useDelay) && component.UseDelayOnWield)
{
if (!_delay.TryResetDelay((used, useDelay), true))
return false;
}
var attemptEv = new WieldAttemptEvent(user);
RaiseLocalEvent(used, ref attemptEv);