From 527034df5175af192dc1fa4be09bf2e402159357 Mon Sep 17 00:00:00 2001 From: zaracka Date: Sun, 12 Aug 2018 16:36:22 -0400 Subject: [PATCH] improves suicide restraint checks gives SOFT_CRIT stat check a to_chat message grammatically corrects UNCONSCIOUS to_chat message gives stun check a to_chat message swaps canmove for IsStun and IsKnockdown --- code/modules/client/verbs/suicide.dm | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm index 6b273cb8183..64d58cd40b5 100644 --- a/code/modules/client/verbs/suicide.dm +++ b/code/modules/client/verbs/suicide.dm @@ -205,18 +205,24 @@ log_game("[key_name(src)] (job: [src.job ? "[src.job]" : "None"]) committed suicide at [AREACOORD(src)].") /mob/living/proc/canSuicide() - if(stat == CONSCIOUS) - return TRUE - else if(stat == DEAD) - to_chat(src, "You're already dead!") - else if(stat == UNCONSCIOUS) - to_chat(src, "You need to be conscious to suicide!") + switch(stat) + if(CONSCIOUS) + return TRUE + if(SOFT_CRIT) + to_chat(src, "You can't commit suicide while in a critical condition!") + if(UNCONSCIOUS) + to_chat(src, "You need to be conscious to commit suicide!") + if(DEAD) + to_chat(src, "You're already dead!") return /mob/living/carbon/canSuicide() if(!..()) return - if(!canmove || restrained()) //just while I finish up the new 'fun' suiciding verb. This is to prevent metagaming via suicide - to_chat(src, "You can't commit suicide whilst restrained! ((You can type Ghost instead however.))") + if(IsStun() || IsKnockdown()) //just while I finish up the new 'fun' suiciding verb. This is to prevent metagaming via suicide + to_chat(src, "You can't commit suicide while stunned! ((You can type Ghost instead however.))") + return + if(restrained()) + to_chat(src, "You can't commit suicide while restrained! ((You can type Ghost instead however.))") return return TRUE