Mjollnir and Singularity Hammer for Wizard (#34446)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user