diff --git a/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs b/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs index 932a9680e9..be66d23f9d 100644 --- a/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs +++ b/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs @@ -38,5 +38,11 @@ namespace Content.Server.Explosion.Components /// [DataField("startOnStick")] public bool StartOnStick; + + /// + /// Allows changing the start-on-stick quality. + /// + [DataField("canToggleStartOnStick")] + public bool AllowToggleStartOnStick; } } diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs index 08b454d8f1..d0c0d27449 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs @@ -87,6 +87,15 @@ 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) @@ -116,6 +125,20 @@ public sealed partial class TriggerSystem } } + private void ToggleStartOnStick(EntityUid grenade, EntityUid user, OnUseTimerTriggerComponent comp) + { + if (comp.StartOnStick) + { + comp.StartOnStick = false; + _popupSystem.PopupEntity(Loc.GetString("popup-start-on-stick-off"), grenade, Filter.Entities(user)); + } + else + { + comp.StartOnStick = true; + _popupSystem.PopupEntity(Loc.GetString("popup-start-on-stick-on"), grenade, Filter.Entities(user)); + } + } + private void OnTimerUse(EntityUid uid, OnUseTimerTriggerComponent component, UseInHandEvent args) { if (args.Handled) return; diff --git a/Resources/Locale/en-US/weapons/grenades/timer-trigger.ftl b/Resources/Locale/en-US/weapons/grenades/timer-trigger.ftl index 70167b39d7..76861c8b4f 100644 --- a/Resources/Locale/en-US/weapons/grenades/timer-trigger.ftl +++ b/Resources/Locale/en-US/weapons/grenades/timer-trigger.ftl @@ -5,4 +5,8 @@ verb-trigger-timer-cycle = Cycle Time Delay examine-trigger-timer = The timer is set to {$time} seconds. -popup-trigger-timer-set = Timer set to {$time} seconds. \ No newline at end of file +popup-trigger-timer-set = Timer set to {$time} seconds. + +verb-toggle-start-on-stick = Toggle auto-activation +popup-start-on-stick-off = The device will no longer activate automatically when planted +popup-start-on-stick-on = The device will now activate automatically when planted diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Bombs/plastic.yml b/Resources/Prototypes/Entities/Objects/Weapons/Bombs/plastic.yml index f44163c3bd..4c240ec316 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Bombs/plastic.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Bombs/plastic.yml @@ -16,6 +16,7 @@ initialBeepDelay: 0 beepSound: /Audio/Machines/Nuke/general_beep.ogg startOnStick: true + canToggleStartOnStick: true - type: TriggerOnSignal - type: SignalReceiver - type: Sticky