From 09047962de5b52b7d5a3bb97ee2fdb4bb8db372e Mon Sep 17 00:00:00 2001 From: Markolie Date: Thu, 5 Feb 2015 14:58:22 +0100 Subject: [PATCH] Include missed file --- .../modules/mob/living/silicon/ai/latejoin.dm | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 code/modules/mob/living/silicon/ai/latejoin.dm diff --git a/code/modules/mob/living/silicon/ai/latejoin.dm b/code/modules/mob/living/silicon/ai/latejoin.dm new file mode 100644 index 00000000000..8c966d636c7 --- /dev/null +++ b/code/modules/mob/living/silicon/ai/latejoin.dm @@ -0,0 +1,44 @@ +var/global/list/empty_playable_ai_cores = list() + +/hook/roundstart/proc/spawn_empty_ai() + for(var/obj/effect/landmark/start/S in landmarks_list) + if(S.name != "AI") + continue + if(locate(/mob/living) in S.loc) + continue + empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(S)) + + return 1 + +/mob/living/silicon/ai/verb/wipe_core() + set name = "Wipe Core" + 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") + return + + // We warned you. + empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(loc) + global_announcer.autosay("[src] has been moved to intelligence storage.", "Artificial Intelligence Oversight") + + //Handle job slot/tater cleanup. + var/job = mind.assigned_role + + job_master.FreeRole(job) + + if(mind.objectives.len) + del(mind.objectives) + mind.special_role = null + else + if(ticker.mode.name == "AutoTraitor") + var/datum/game_mode/traitor/autotraitor/current_mode = ticker.mode + current_mode.possible_traitors.Remove(src) + + del(src) \ No newline at end of file