From 10de2370cf4348fe66657d5d56b6073ffe91b1f5 Mon Sep 17 00:00:00 2001
From: skoglol <33292112+kriskog@users.noreply.github.com>
Date: Tue, 10 Dec 2019 08:44:28 +0100
Subject: [PATCH] New disarm intent suicide (#47902)
About The Pull Request
Adds a new disarm intent suicide. Fixes the intent logic, it will now run different suicides for disarm and grab. Added some ghostize that I overlooked last time.
https://streamable.com/ifx25
Why It's Good For The Game
Fixes, silly new content
Changelog
cl Skoglol
fix: All human intent suicides now work properly
add: New disarm intent suicide
/cl
---
code/modules/client/verbs/suicide.dm | 18 ++++++++++++++----
.../mob/living/carbon/human/suicides.dm | 17 +++++++++++++++++
sound/effects/cartoon_pop.ogg | Bin 0 -> 6452 bytes
sound/effects/license.txt | 3 +++
tgstation.dme | 1 +
5 files changed, 35 insertions(+), 4 deletions(-)
create mode 100644 code/modules/mob/living/carbon/human/suicides.dm
create mode 100644 sound/effects/cartoon_pop.ogg
diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm
index 58b11cddfbc..2fbb591e889 100644
--- a/code/modules/client/verbs/suicide.dm
+++ b/code/modules/client/verbs/suicide.dm
@@ -75,20 +75,23 @@
adjustOxyLoss(max(200 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(FALSE)
+ ghostize(FALSE) // Disallows reentering body and disassociates mind
return
var/suicide_message
if(a_intent == INTENT_DISARM)
+ if(prob(25))
+ disarm_suicide() // Snowflake suicide for a tired joke.
+ return //above proc handles logging and death
suicide_message = pick("[src] is attempting to push [p_their()] own head off [p_their()] shoulders! It looks like [p_theyre()] trying to commit suicide.", \
- "[src] is pushing [p_their()] thumbs into [p_their()] eye sockets! It looks like [p_theyre()] trying to commit suicide.", \
- "[src] is ripping [p_their()] own arms off! It looks like [p_theyre()] trying to commit suicide.")//heheh get it?
- if(a_intent == INTENT_GRAB)
+ "[src] is pushing [p_their()] thumbs into [p_their()] eye sockets! It looks like [p_theyre()] trying to commit suicide.")
+ else if(a_intent == INTENT_GRAB)
suicide_message = pick("[src] is attempting to pull [p_their()] own head off! It looks like [p_theyre()] trying to commit suicide.", \
"[src] is aggressively grabbing [p_their()] own neck! It looks like [p_theyre()] trying to commit suicide.", \
"[src] is pulling [p_their()] eyes out of their sockets! It looks like [p_theyre()] trying to commit suicide.")
- if(a_intent == INTENT_HELP)
+ else if(a_intent == INTENT_HELP)
suicide_message = pick("[src] is hugging [p_them()]self to death! It looks like [p_theyre()] trying to commit suicide.", \
"[src] is high-fiving [p_them()]self to death! It looks like [p_theyre()] trying to commit suicide.", \
"[src] is getting too high on life! It looks like [p_theyre()] trying to commit suicide.")
@@ -121,6 +124,7 @@
suicide_log()
death(FALSE)
+ ghostize(FALSE) // Disallows reentering body and disassociates mind
/mob/living/carbon/monkey/verb/suicide()
set hidden = 1
@@ -138,6 +142,7 @@
adjustOxyLoss(max(200- getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(FALSE)
+ ghostize(FALSE) // Disallows reentering body and disassociates mind
/mob/living/silicon/ai/verb/suicide()
set hidden = 1
@@ -156,6 +161,7 @@
//put em at -175
adjustOxyLoss(max(maxHealth * 2 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(FALSE)
+ ghostize(FALSE) // Disallows reentering body and disassociates mind
/mob/living/silicon/robot/verb/suicide()
set hidden = 1
@@ -174,6 +180,7 @@
//put em at -175
adjustOxyLoss(max(maxHealth * 2 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(FALSE)
+ ghostize(FALSE) // Disallows reentering body and disassociates mind
/mob/living/silicon/pai/verb/suicide()
set hidden = 1
@@ -186,6 +193,7 @@
suicide_log()
death(FALSE)
+ ghostize(FALSE) // Disallows reentering body and disassociates mind
else
to_chat(src, "Aborting suicide attempt.")
@@ -207,6 +215,7 @@
//put em at -175
adjustOxyLoss(max(200 - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(FALSE)
+ ghostize(FALSE) // Disallows reentering body and disassociates mind
/mob/living/simple_animal/verb/suicide()
set hidden = 1
@@ -223,6 +232,7 @@
suicide_log()
death(FALSE)
+ ghostize(FALSE) // Disallows reentering body and disassociates mind
/mob/living/proc/suicide_log()
log_message("committed suicide as [src.type]", LOG_ATTACK)
diff --git a/code/modules/mob/living/carbon/human/suicides.dm b/code/modules/mob/living/carbon/human/suicides.dm
new file mode 100644
index 00000000000..bde239a36d4
--- /dev/null
+++ b/code/modules/mob/living/carbon/human/suicides.dm
@@ -0,0 +1,17 @@
+/mob/living/carbon/human/proc/delayed_suicide()
+ suicide_log()
+ adjustBruteLoss(max(200 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
+ death(FALSE)
+ ghostize(FALSE) // Disallows reentering body and disassociates mind
+
+/mob/living/carbon/human/proc/disarm_suicide()
+ var/suicide_message = "[src] is ripping [p_their()] own arms off! It looks like [p_theyre()] trying to commit suicide." //heheh get it?
+ visible_message("[suicide_message]", "[suicide_message]")
+
+ var/timer = 15
+ for(var/obj/item/bodypart/thing in bodyparts)
+ if(thing.body_part == ARM_LEFT || thing.body_part == ARM_RIGHT)
+ addtimer(CALLBACK(thing, /obj/item/bodypart/.proc/dismember), timer)
+ addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, src, 'sound/effects/cartoon_pop.ogg', 70), timer)
+ timer += 15
+ addtimer(CALLBACK(src, /mob/living/carbon/human/.proc/delayed_suicide, FALSE), timer-10)
diff --git a/sound/effects/cartoon_pop.ogg b/sound/effects/cartoon_pop.ogg
new file mode 100644
index 0000000000000000000000000000000000000000..aca8c7ade4eae1570522ca0f0dc77c2eeccd2155
GIT binary patch
literal 6452
zcmeHLc~p~0kpDQ0+yprc5D_E@iGc|alqe{Ppb!a1AjmDJ5;^5iVAP2c6ayj#h!UbA
zh6q7G5D;;6ROAxnltU3wQ7%D6Kpii(6P#<`zPJ0{>|gt~U#C-DRbAcvt4eouoOkVV
zgCwCJW&i0Ra}l|pw_#91M`CYuY!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