From 271fe31e64f8ce6088ceb48a1c86c5f7b6d6b2ea Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Mon, 2 Feb 2015 18:34:26 +0000 Subject: [PATCH] Admin verb to toggle latejoin-ability. Wipe Core disallowed in malfunction. --- code/game/machinery/computer/ai_core.dm | 21 +++++++++++++++++++ code/modules/admin/admin_verbs.dm | 3 ++- .../modules/mob/living/silicon/ai/latejoin.dm | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 40da8e2ca04..7bd8e4b8e89 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -242,3 +242,24 @@ return else return ..() + +/client/proc/empty_ai_core_toggle_latejoin() + set name = "Toggle AI Core Latejoin" + set category = "Admin" + + var/list/cores = list() + for(var/obj/structure/AIcore/deactivated/D in world) + cores["[D] ([D.loc.loc])"] = D + + var/id = input("Which core?", "Toggle AI Core Latejoin", null) as null|anything in cores + if(!id) return + + var/obj/structure/AIcore/deactivated/D = cores[id] + if(!D) return + + if(D in empty_playable_ai_cores) + empty_playable_ai_cores -= D + src << "\The [id] is now not available for latejoining AIs." + else + empty_playable_ai_cores += D + src << "\The [id] is now available for latejoining AIs." diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index d20105a67e6..823fb69f803 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -78,7 +78,8 @@ var/list/admin_verbs_admin = list( /client/proc/toggle_antagHUD_use, /client/proc/toggle_antagHUD_restrictions, /client/proc/allow_character_respawn, /* Allows a ghost to respawn */ - /client/proc/event_manager_panel + /client/proc/event_manager_panel, + /client/proc/empty_ai_core_toggle_latejoin ) var/list/admin_verbs_ban = list( /client/proc/unban_panel, diff --git a/code/modules/mob/living/silicon/ai/latejoin.dm b/code/modules/mob/living/silicon/ai/latejoin.dm index 11a617360a4..8aca00a711b 100644 --- a/code/modules/mob/living/silicon/ai/latejoin.dm +++ b/code/modules/mob/living/silicon/ai/latejoin.dm @@ -15,6 +15,10 @@ var/global/list/empty_playable_ai_cores = list() set category = "OOC" set desc = "Wipe your core. This is functionally equivalent to cryo or robotic storage, freeing up your job slot." + if(ticker && ticker.mode && ticker.mode.name == "AI malfunction") + usr << "You cannot use this verb in malfunction. If you need to leave, please adminhelp." + return + // Guard against misclicks, this isn't the sort of thing we want happening accidentally if(alert("WARNING: This will immediately wipe your core and ghost you, removing your character from the round permanently (similar to cryo and robotic storage). Are you entirely sure you want to do this?", "Wipe Core", "No", "No", "Yes") != "Yes")