remove robotics console emag checking, make it a bit fairer (#27876)

This commit is contained in:
deltanedas
2024-06-17 03:30:10 +00:00
committed by GitHub
parent 7ff557d1ef
commit c332677971
12 changed files with 123 additions and 42 deletions

View File

@@ -26,13 +26,7 @@ public sealed partial class TriggerSystem
if (!component.StartOnStick)
return;
HandleTimerTrigger(
uid,
args.User,
component.Delay,
component.BeepInterval,
component.InitialBeepDelay,
component.BeepSound);
StartTimer((uid, component), args.User);
}
private void OnExamined(EntityUid uid, OnUseTimerTriggerComponent component, ExaminedEvent args)
@@ -54,14 +48,7 @@ public sealed partial class TriggerSystem
args.Verbs.Add(new AlternativeVerb()
{
Text = Loc.GetString("verb-start-detonation"),
Act = () => HandleTimerTrigger(
uid,
args.User,
component.Delay,
component.BeepInterval,
component.InitialBeepDelay,
component.BeepSound
),
Act = () => StartTimer((uid, component), args.User),
Priority = 2
});
}
@@ -174,13 +161,7 @@ public sealed partial class TriggerSystem
if (component.DoPopup)
_popupSystem.PopupEntity(Loc.GetString("trigger-activated", ("device", uid)), args.User, args.User);
HandleTimerTrigger(
uid,
args.User,
component.Delay,
component.BeepInterval,
component.InitialBeepDelay,
component.BeepSound);
StartTimer((uid, component), args.User);
args.Handled = true;
}

View File

@@ -265,6 +265,18 @@ namespace Content.Server.Explosion.EntitySystems
comp.TimeRemaining += amount;
}
/// <summary>
/// Start the timer for triggering the device.
/// </summary>
public void StartTimer(Entity<OnUseTimerTriggerComponent?> ent, EntityUid? user)
{
if (!Resolve(ent, ref ent.Comp, false))
return;
var comp = ent.Comp;
HandleTimerTrigger(ent, user, comp.Delay, comp.BeepInterval, comp.InitialBeepDelay, comp.BeepSound);
}
public void HandleTimerTrigger(EntityUid uid, EntityUid? user, float delay, float beepInterval, float? initialBeepDelay, SoundSpecifier? beepSound)
{
if (delay <= 0)