From fabdf3d782496eb0144f80cb79a67e27cb58d7d2 Mon Sep 17 00:00:00 2001 From: Kasuobes Date: Tue, 3 May 2016 12:23:31 -0700 Subject: [PATCH 1/2] 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 2ba3d40a174..f2506f48ddd 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" From 0471e7e0c43183556e6a0f3eda449fda547adfbd Mon Sep 17 00:00:00 2001 From: Kasuobes Date: Wed, 4 May 2016 18:52:01 -0700 Subject: [PATCH 2/2] Refactors silicon job slot/tater cleanup (#1) * Refactors silicon job slot/tater cleanup Moved from ai/verb/wipe core to silicon/proc. * Adds wipe_software verb for pAI Let pAI ghost properly, calls silicon/proc/clear_client() * Refactors silicon job slot/tater cleanup --- .../modules/mob/living/silicon/ai/latejoin.dm | 13 +----- code/modules/mob/living/silicon/pai/pai.dm | 43 +++++++------------ code/modules/mob/living/silicon/silicon.dm | 17 +++++++- 3 files changed, 32 insertions(+), 41 deletions(-) diff --git a/code/modules/mob/living/silicon/ai/latejoin.dm b/code/modules/mob/living/silicon/ai/latejoin.dm index 7c60bb75e43..6383e55e344 100644 --- a/code/modules/mob/living/silicon/ai/latejoin.dm +++ b/code/modules/mob/living/silicon/ai/latejoin.dm @@ -29,15 +29,4 @@ var/global/list/empty_playable_ai_cores = list() 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) - qdel(mind.objectives) - mind.special_role = null - - clear_antag_roles(mind) - - ghostize(0) - qdel(src) + clear_client() \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index f2506f48ddd..bd757f9ab69 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -297,34 +297,6 @@ 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" @@ -472,3 +444,18 @@ else idaccessible = 0 src << "You block access modfications." + +/mob/living/silicon/pai/verb/wipe_software() + set name = "Wipe Software" + set category = "OOC" + set desc = "Wipe your software. This is functionally equivalent to cryo or robotic storage, freeing up your job slot." + + // Make sure people don't kill themselves accidentally + if(alert("WARNING: This will immediately wipe your software 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 Software", "No", "No", "Yes") != "Yes") + return + + close_up() + visible_message("[src] fades away from the screen, the pAI device goes silent.") + card.removePersonality() + clear_client() diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 8a8bd0a2748..ef6b1c7872b 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -364,4 +364,19 @@ /mob/living/silicon/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash) if(affect_silicon) - return ..() \ No newline at end of file + return ..() + +/mob/living/silicon/proc/clear_client() + //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 + + clear_antag_roles(mind) + + ghostize(0) + qdel(src)