From 0a02d1cb1321d6f21e11a3f80c8042bb717927f1 Mon Sep 17 00:00:00 2001 From: george99g Date: Mon, 30 Apr 2018 05:35:00 +0300 Subject: [PATCH 1/3] Deactivate suicide prescans via ghost var --- code/game/machinery/cloning.dm | 9 +++-- code/modules/client/verbs/suicide.dm | 39 ++++++++++++++++++++++ code/modules/mob/dead/observer/observer.dm | 3 ++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 3482cc2ec7..f7c1c53d20 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -134,8 +134,11 @@ clonemind = locate(mindref) in SSticker.minds if(!istype(clonemind)) //not a mind return FALSE - if( clonemind.current && clonemind.current.stat != DEAD ) //mind is associated with a non-dead body - return FALSE + if(clonemind.current) + if(clonemind.current.stat != DEAD) //mind is associated with a non-dead body + return FALSE + if(clonemind.current.suiciding) // Mind is associated with a body that is suiciding. + return FALSE if(clonemind.active) //somebody is using that mind if( ckey(clonemind.key)!=ckey ) return FALSE @@ -144,6 +147,8 @@ var/mob/dead/observer/G = clonemind.get_ghost() if(!G) return FALSE + if(G.suiciding) // The ghost came from a body that is suiciding. + return FALSE if(clonemind.damnation_type) //Can't clone the damned. INVOKE_ASYNC(src, .proc/horrifyingsound) mess = TRUE diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm index 2b5602833a..dc4441ed13 100644 --- a/code/modules/client/verbs/suicide.dm +++ b/code/modules/client/verbs/suicide.dm @@ -12,8 +12,11 @@ return if(confirm == "Yes") suiciding = TRUE +<<<<<<< HEAD log_game("[key_name(src)] (job: [job ? "[job]" : "None"]) committed suicide at [get_area(src)].") message_admins("[key_name(src)] (job: [job ? "[job]" : "None"]) committed suicide at [get_area(src)].") +======= +>>>>>>> f280924... Deactivate suicide prescans via ghost var (#36839) var/obj/item/held_item = get_active_held_item() if(held_item) var/damagetype = held_item.suicide_act(src) @@ -23,6 +26,9 @@ suiciding = FALSE SendSignal(COMSIG_ADD_MOOD_EVENT, "shameful_suicide", /datum/mood_event/shameful_suicide) return + + suicide_log() + var/damage_mod = 0 for(var/T in list(BRUTELOSS, FIRELOSS, TOXLOSS, OXYLOSS)) damage_mod += (T & damagetype) ? 1 : 0 @@ -49,6 +55,7 @@ adjustOxyLoss(max(200 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0)) death(FALSE) + return var/suicide_message @@ -73,6 +80,8 @@ visible_message("[suicide_message]", "[suicide_message]") + suicide_log() + adjustOxyLoss(max(200 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0)) death(0) @@ -87,6 +96,9 @@ suiciding = 1 visible_message("[src]'s brain is growing dull and lifeless. [p_they(TRUE)] look[p_s()] like [p_theyve()] lost the will to live.", \ "[src]'s brain is growing dull and lifeless. [p_they(TRUE)] look[p_s()] like [p_theyve()] lost the will to live.") + + suicide_log() + death(0) /mob/living/carbon/monkey/verb/suicide() @@ -100,6 +112,9 @@ suiciding = 1 visible_message("[src] is attempting to bite [p_their()] tongue. It looks like [p_theyre()] trying to commit suicide.", \ "[src] is attempting to bite [p_their()] tongue. It looks like [p_theyre()] trying to commit suicide.") + + suicide_log() + adjustOxyLoss(max(200- getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0)) death(0) @@ -114,6 +129,9 @@ suiciding = 1 visible_message("[src] is powering down. It looks like [p_theyre()] trying to commit suicide.", \ "[src] is powering down. It looks like [p_theyre()] trying to commit suicide.") + + suicide_log() + //put em at -175 adjustOxyLoss(max(maxHealth * 2 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0)) death(0) @@ -129,6 +147,9 @@ suiciding = 1 visible_message("[src] is powering down. It looks like [p_theyre()] trying to commit suicide.", \ "[src] is powering down. It looks like [p_theyre()] trying to commit suicide.") + + suicide_log() + //put em at -175 adjustOxyLoss(max(maxHealth * 2 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0)) death(0) @@ -140,6 +161,9 @@ var/turf/T = get_turf(src.loc) T.visible_message("[src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\"", null, \ "[src] bleeps electronically.") + + suicide_log() + death(0) else to_chat(src, "Aborting suicide attempt.") @@ -156,6 +180,9 @@ visible_message("[src] is thrashing wildly! It looks like [p_theyre()] trying to commit suicide.", \ "[src] is thrashing wildly! It looks like [p_theyre()] trying to commit suicide.", \ "You hear thrashing.") + + suicide_log() + //put em at -175 adjustOxyLoss(max(200 - getFireLoss() - getBruteLoss() - getOxyLoss(), 0)) death(0) @@ -171,8 +198,20 @@ suiciding = 1 visible_message("[src] begins to fall down. It looks like [p_theyve()] lost the will to live.", \ "[src] begins to fall down. It looks like [p_theyve()] lost the will to live.") + + suicide_log() + death(0) +/mob/living/proc/suicide_log() + var/turf/T = get_turf(src) + + log_game("[key_name(src)] committed suicide at [get_area(src)][COORD(T)] as [src.type].") + +/mob/living/carbon/human/suicide_log() + var/turf/T = get_turf(src) + + log_game("[key_name(src)] (job: [src.job ? "[src.job]" : "None"]) committed suicide at [get_area(src)][COORD(T)].") /mob/living/proc/canSuicide() if(stat == CONSCIOUS) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 51a3c657a9..8bfe33b3ea 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -91,6 +91,9 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) name = random_unique_name(gender) mind = body.mind //we don't transfer the mind but we keep a reference to it. + + suiciding = body.suiciding // Transfer whether they committed suicide. + if(ishuman(body)) var/mob/living/carbon/human/body_human = body if(HAIR in body_human.dna.species.species_traits) From dd5669d752d639e3fdfaa48f119c8183ef1d21b0 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Tue, 1 May 2018 21:22:42 -0400 Subject: [PATCH 2/3] Update suicide.dm --- code/modules/client/verbs/suicide.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm index dc4441ed13..e192af633c 100644 --- a/code/modules/client/verbs/suicide.dm +++ b/code/modules/client/verbs/suicide.dm @@ -12,11 +12,8 @@ return if(confirm == "Yes") suiciding = TRUE -<<<<<<< HEAD log_game("[key_name(src)] (job: [job ? "[job]" : "None"]) committed suicide at [get_area(src)].") message_admins("[key_name(src)] (job: [job ? "[job]" : "None"]) committed suicide at [get_area(src)].") -======= ->>>>>>> f280924... Deactivate suicide prescans via ghost var (#36839) var/obj/item/held_item = get_active_held_item() if(held_item) var/damagetype = held_item.suicide_act(src) From 711f309c4686f4dd4a207bd2835f80ef63df23ee Mon Sep 17 00:00:00 2001 From: deathride58 Date: Wed, 2 May 2018 10:01:47 -0400 Subject: [PATCH 3/3] Update suicide.dm --- code/modules/client/verbs/suicide.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm index e192af633c..c968cc9c76 100644 --- a/code/modules/client/verbs/suicide.dm +++ b/code/modules/client/verbs/suicide.dm @@ -12,8 +12,6 @@ return if(confirm == "Yes") suiciding = TRUE - log_game("[key_name(src)] (job: [job ? "[job]" : "None"]) committed suicide at [get_area(src)].") - message_admins("[key_name(src)] (job: [job ? "[job]" : "None"]) committed suicide at [get_area(src)].") var/obj/item/held_item = get_active_held_item() if(held_item) var/damagetype = held_item.suicide_act(src) @@ -204,11 +202,13 @@ var/turf/T = get_turf(src) log_game("[key_name(src)] committed suicide at [get_area(src)][COORD(T)] as [src.type].") + message_admins("[key_name(src)] committed suicide at [get_area(src)] as [src.type].") /mob/living/carbon/human/suicide_log() var/turf/T = get_turf(src) log_game("[key_name(src)] (job: [src.job ? "[src.job]" : "None"]) committed suicide at [get_area(src)][COORD(T)].") + message_admins("[key_name(src)] (job: [job ? "[job]" : "None"]) committed suicide at [get_area(src)].") /mob/living/proc/canSuicide() if(stat == CONSCIOUS)