Wearable Wet Floor Sign and 'Janitorial Suicide Vest' (#20311)

* Explosive wet floor sign & janitorial suicide vest

* fix attributions

* Remove name & desc from explosive wet floor sign

* Make wet floor sign chameleonable
This commit is contained in:
Psychpsyo
2023-09-28 06:09:44 +02:00
committed by GitHub
parent d90a75ad76
commit 008f2d9d1c
11 changed files with 59 additions and 23 deletions

View File

@@ -29,6 +29,12 @@ namespace Content.Server.Explosion.Components
[DataField("beepInterval")]
public float BeepInterval = 1;
/// <summary>
/// Whether the timer should instead be activated through a verb in the right-click menu
/// </summary>
[DataField("useVerbInstead")]
public bool UseVerbInstead = false;
/// <summary>
/// Should timer be started when it was stuck to another entity.
/// Used for C4 charges and similar behaviour.

View File

@@ -48,6 +48,32 @@ public sealed partial class TriggerSystem
if (!args.CanInteract || !args.CanAccess)
return;
if (component.UseVerbInstead)
{
args.Verbs.Add(new AlternativeVerb()
{
Text = Loc.GetString("verb-start-detonation"),
Act = () => HandleTimerTrigger(
uid,
args.User,
component.Delay,
component.BeepInterval,
component.InitialBeepDelay,
component.BeepSound
),
Priority = 2
});
}
if (component.AllowToggleStartOnStick)
{
args.Verbs.Add(new AlternativeVerb()
{
Text = Loc.GetString("verb-toggle-start-on-stick"),
Act = () => ToggleStartOnStick(uid, args.User, component)
});
}
if (component.DelayOptions == null || component.DelayOptions.Count == 1)
return;
@@ -86,15 +112,6 @@ public sealed partial class TriggerSystem
},
});
}
if (component.AllowToggleStartOnStick)
{
args.Verbs.Add(new AlternativeVerb()
{
Text = Loc.GetString("verb-toggle-start-on-stick"),
Act = () => ToggleStartOnStick(uid, args.User, component)
});
}
}
private void CycleDelay(OnUseTimerTriggerComponent component, EntityUid user)
@@ -140,7 +157,7 @@ public sealed partial class TriggerSystem
private void OnTimerUse(EntityUid uid, OnUseTimerTriggerComponent component, UseInHandEvent args)
{
if (args.Handled || HasComp<AutomatedTimerComponent>(uid))
if (args.Handled || HasComp<AutomatedTimerComponent>(uid) || component.UseVerbInstead)
return;
HandleTimerTrigger(