From fabdf3d782496eb0144f80cb79a67e27cb58d7d2 Mon Sep 17 00:00:00 2001 From: Kasuobes Date: Tue, 3 May 2016 12:23:31 -0700 Subject: [PATCH] Adds delete_personality verb for pAI Ported over from AI's wipe_core verb, allow pAIs to ghost and leave the round properly in case nobody wipes the pAI device. --- code/modules/mob/living/silicon/pai/pai.dm | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 2ba3d40a17..f2506f48dd 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -297,6 +297,34 @@ return close_up() + + +/mob/living/silicon/pai/verb/delete_personality() + set name = "Delete Personality" + set category = "OOC" + set desc = "Delete your personality. This is functionally equivalent to cryo or robotic storage, freeing up the pAI device for a new personality." + + // Guard against misclicks, this isn't the sort of thing we want happening accidentally + if(alert("WARNING: This will immediately delete your personality 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?", + "Delete Personality", "No", "No", "Yes") != "Yes") + return + + // We warned you. + visible_message("[src] fades away, the pAI device goes silent.") + close_up() + + //Handle job slot/tater cleanup. + var/job = mind.assigned_role + + job_master.FreeRole(job) + + if(mind.objectives.len) + qdel(mind.objectives) + mind.special_role = null + + card.removePersonality() + ghostize(0) + qdel(src) /mob/living/silicon/pai/proc/choose_chassis() set category = "pAI Commands"