From 5bf33775682e843a07bde2238a571996da3fbf9f Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:07:24 +0300 Subject: [PATCH] [MIRROR] Adds an admin button to send nuke ops reinforcements [MDB IGNORE] (#723) * Adds an admin button to send nuke ops reinforcements (#79695) --------- Co-authored-by: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- 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 3b63dd4a5ca..6ed9272a9ff 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 1b601bb0cc9..b52405e204a 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1766,6 +1766,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 c9ad46b1415..7690ab19efd 100644 --- a/code/modules/antagonists/nukeop/nukeop.dm +++ b/code/modules/antagonists/nukeop/nukeop.dm @@ -521,12 +521,116 @@ disk_loc = disk_loc.loc disk_report += "in [disk_loc.loc] at ([disk_loc.x], [disk_loc.y], [disk_loc.z])