From 73e02ce3eca0ed62d0aad893f3568a285f4e5b9e Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Sun, 19 Nov 2023 12:45:59 -0600 Subject: [PATCH] Adds an admin button to send nuke ops reinforcements (#79695) ## About The Pull Request Often times I want to send a second wave of nukies if the first wave completely flukes, but sending reinforcements is hard (I don't want to trigger a whole new nuke team, the Infiltrator is deployed to NT space, etc). So I add a button to check-antagonists that allow admins to one-click send more nuke ops.  I also took the opportunity to polish up the other admin button, particularly giving a reminder if it's being forced under the pop limit. ## Changelog :cl: Melbert admin: Adds a button to check-antagonists that allows admins to send Nuke Op reinforcements with a single button admin: Nuke Ops check antagonists now show you full war status (declared / not declared) fix: Fixes multiple nuke teams (or an admin) being able to declare war at once /:cl: --- code/__DEFINES/antagonists.dm | 3 + code/modules/admin/topic.dm | 4 + .../nukeop/equipment/nuclear_challenge.dm | 14 ++- code/modules/antagonists/nukeop/nukeop.dm | 116 +++++++++++++++++- 4 files changed, 127 insertions(+), 10 deletions(-) diff --git a/code/__DEFINES/antagonists.dm b/code/__DEFINES/antagonists.dm index 3048ec84593..a31b9aee407 100644 --- a/code/__DEFINES/antagonists.dm +++ b/code/__DEFINES/antagonists.dm @@ -10,6 +10,9 @@ #define NUKE_RESULT_HIJACK_DISK 9 #define NUKE_RESULT_HIJACK_NO_DISK 10 +/// Min players requireed for nukes to declare war +#define CHALLENGE_MIN_PLAYERS 50 + //fugitive end results #define FUGITIVE_RESULT_BADASS_HUNTER 0 #define FUGITIVE_RESULT_POSTMORTEM_HUNTER 1 diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 89503ef1f43..50fe0ed1e46 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1724,6 +1724,10 @@ var/obj/item/nuclear_challenge/button = locate(href_list["force_war"]) button.force_war() + else if(href_list["give_reinforcement"]) + var/datum/team/nuclear/nuketeam = locate(href_list["give_reinforcement"]) in GLOB.antagonist_teams + nuketeam.admin_spawn_reinforcement(usr) + else if (href_list["interview"]) if(!check_rights(R_ADMIN)) return diff --git a/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm b/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm index eeb4d255bf6..f3d2bde6fb7 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm @@ -1,6 +1,5 @@ #define CHALLENGE_TELECRYSTALS 280 #define CHALLENGE_TIME_LIMIT (5 MINUTES) -#define CHALLENGE_MIN_PLAYERS 50 #define CHALLENGE_SHUTTLE_DELAY (25 MINUTES) // 25 minutes, so the ops have at least 5 minutes before the shuttle is callable. GLOBAL_LIST_EMPTY(jam_on_wardec) @@ -54,7 +53,7 @@ GLOBAL_LIST_EMPTY(jam_on_wardec) ///Admin only proc to bypass checks and force a war declaration. Button on antag panel. /obj/item/nuclear_challenge/proc/force_war() - var/are_you_sure = tgui_alert(usr, "Are you sure you wish to force a war declaration?", "Declare war?", list("Yes", "No")) + var/are_you_sure = tgui_alert(usr, "Are you sure you wish to force a war declaration?[GLOB.player_list.len < CHALLENGE_MIN_PLAYERS ? " Note, the player count is under the required limit." : ""]", "Declare war?", list("Yes", "No")) if(are_you_sure != "Yes") return @@ -67,9 +66,14 @@ GLOBAL_LIST_EMPTY(jam_on_wardec) war_declaration = tgui_input_text(usr, "Insert your custom declaration", "Declaration", multiline = TRUE, encode = FALSE) if(!war_declaration) - to_chat(usr, span_warning("Invalid war declaration.")) + tgui_alert(usr, "Invalid war declaration.", "Poor Choice of Words") return + for(var/obj/item/circuitboard/computer/syndicate_shuttle/board as anything in GLOB.syndicate_shuttle_boards) + if(board.challenge) + tgui_alert(usr, "War has already been declared!", "War Was Declared") + return + war_was_declared(memo = war_declaration) /obj/item/nuclear_challenge/proc/war_was_declared(mob/living/user, memo) @@ -148,6 +152,9 @@ GLOBAL_LIST_EMPTY(jam_on_wardec) if(board.moved) to_chat(user, span_boldwarning("The shuttle has already been moved! You have forfeit the right to declare war.")) return FALSE + if(board.challenge) + to_chat(user, span_boldwarning("War has already been declared!")) + return FALSE return TRUE /obj/item/nuclear_challenge/clownops @@ -189,5 +196,4 @@ GLOBAL_LIST_EMPTY(jam_on_wardec) #undef CHALLENGE_TELECRYSTALS #undef CHALLENGE_TIME_LIMIT -#undef CHALLENGE_MIN_PLAYERS #undef CHALLENGE_SHUTTLE_DELAY diff --git a/code/modules/antagonists/nukeop/nukeop.dm b/code/modules/antagonists/nukeop/nukeop.dm index bd8514d72d8..b7801ab3104 100644 --- a/code/modules/antagonists/nukeop/nukeop.dm +++ b/code/modules/antagonists/nukeop/nukeop.dm @@ -516,12 +516,116 @@ disk_loc = disk_loc.loc disk_report += "in [disk_loc.loc] at ([disk_loc.x], [disk_loc.y], [disk_loc.z])