From f70983e2d50717e9e462759cd100271f34a3e584 Mon Sep 17 00:00:00 2001 From: moonheart08 Date: Tue, 12 Oct 2021 00:11:09 -0500 Subject: [PATCH] BANG (#4839) * BANG * how did that ever work in the first place --- .../Administration/AdminVerbSystem.cs | 25 ++++++++++++++++++- .../administration/verbs/explode-verb.ftl | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Resources/Locale/en-US/administration/verbs/explode-verb.ftl diff --git a/Content.Server/Administration/AdminVerbSystem.cs b/Content.Server/Administration/AdminVerbSystem.cs index a9873ca246..2d19e24831 100644 --- a/Content.Server/Administration/AdminVerbSystem.cs +++ b/Content.Server/Administration/AdminVerbSystem.cs @@ -1,9 +1,11 @@ +using System.Threading; using Content.Server.Administration.Commands; using Content.Server.Administration.Managers; using Content.Server.Administration.UI; using Content.Server.Configurable; using Content.Server.Disposal.Tube.Components; using Content.Server.EUI; +using Content.Server.Explosion; using Content.Server.Ghost.Roles; using Content.Server.Inventory.Components; using Content.Server.Mind.Commands; @@ -11,6 +13,7 @@ using Content.Server.Mind.Components; using Content.Server.Players; using Content.Server.Verbs; using Content.Shared.Administration; +using Content.Shared.Body.Components; using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Interaction.Helpers; using Content.Shared.Popups; @@ -20,6 +23,8 @@ using Robust.Server.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Localization; +using Robust.Shared.Timing; +using Timer = Robust.Shared.Timing.Timer; namespace Content.Server.Administration { @@ -30,10 +35,11 @@ namespace Content.Server.Administration { [Dependency] private readonly IConGroupController _groupController = default!; [Dependency] private readonly IAdminManager _adminManager = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly EuiManager _euiManager = default!; [Dependency] private readonly GhostRoleSystem _ghostRoleSystem = default!; [Dependency] private readonly VerbSystem _verbSystem = default!; - + public override void Initialize() { SubscribeLocalEvent(AddDebugVerbs); @@ -99,6 +105,23 @@ namespace Content.Server.Administration args.Verbs.Add(verb); } + if (_adminManager.HasAdminFlag(player, AdminFlags.Fun)) + { + Verb verb = new(); + verb.Text = Loc.GetString("explode-verb-get-data-text"); + verb.Category = VerbCategory.Debug; + verb.Act = () => + { + var coords = args.Target.Transform.Coordinates; + Timer.Spawn(_gameTiming.TickPeriod, () => ExplosionHelper.SpawnExplosion(coords, 0, 1, 2, 1), CancellationToken.None); + if (args.Target.TryGetComponent(out SharedBodyComponent? body)) + { + body.Gib(); + } + }; + args.Verbs.Add(verb); + } + // Set clothing verb if (_groupController.CanCommand(player, "setoutfit") && args.Target.HasComponent()) diff --git a/Resources/Locale/en-US/administration/verbs/explode-verb.ftl b/Resources/Locale/en-US/administration/verbs/explode-verb.ftl new file mode 100644 index 0000000000..d743ffaae8 --- /dev/null +++ b/Resources/Locale/en-US/administration/verbs/explode-verb.ftl @@ -0,0 +1 @@ +explode-verb-get-data-text = Explode