From 3144a6e7f473bd0f335b88a236a69293c51aeae9 Mon Sep 17 00:00:00 2001 From: Mike Long Date: Sun, 31 Jan 2016 09:13:21 -0500 Subject: [PATCH 1/4] Added a new suicide act for pipe valves. --- code/game/machinery/pipe/construction.dm | 15 +++++++++++ code/modules/mob/living/carbon/carbon.dm | 34 +++++++++++++++--------- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 910bd136256..2ae34c5c632 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -240,6 +240,21 @@ var/global/list/pipeID2State = list( qdel(src) +/obj/item/pipe/suicide_act(mob/user) + if (pipe_type in list(PIPE_PUMP, PIPE_PASSIVE_GATE, PIPE_VOLUME_PUMP)) + user.visible_message("[user] shoved the [src.name] in \he's mouth and turned it on! It looks like \he's trying to commit suicide.") + if(istype(user, /mob/living/carbon)) + var/mob/living/carbon/C = user + for (var/i = 1 to 20) + C.vomit(0,1,0,4,0) + sleep(5) + if(istype(user, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = C + H.vessel.remove_reagent("blood",560) + return(OXYLOSS) + else + return ..() + /obj/item/pipe_meter name = "meter" desc = "A meter that can be laid on pipes" diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 1af4bf3838a..334298915a2 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -588,31 +588,41 @@ var/const/GALOSHES_DONT_HELP = 4 add_abilities_to_panel() -/mob/living/carbon/proc/vomit(var/lost_nutrition = 10, var/blood) +/mob/living/carbon/proc/vomit(var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0) if(src.is_muzzled()) src << "The muzzle prevents you from vomiting!" return 0 - Stun(4) + if(stun) + Stun(4) if(nutrition < 100 && !blood) visible_message("[src] dry heaves!", \ "You try to throw up, but there's nothing your stomach!") - Weaken(10) + if(stun) + Weaken(10) else visible_message("[src] throws up!", \ "You throw up!") playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1) var/turf/T = get_turf(src) - if(blood) - if(T) - T.add_blood_floor(src) - adjustBruteLoss(3) - else - if(T) - T.add_vomit_floor(src) - nutrition -= lost_nutrition - adjustToxLoss(-3) + for (var/i = 0 to distance) + if(blood) + if(T) + T.add_blood_floor(src) + if(stun) + adjustBruteLoss(3) + else + if(T) + T.add_vomit_floor(src) + nutrition -= lost_nutrition + if(stun) + adjustToxLoss(-3) + T = get_step(T, dir) + if (is_blocked_turf(T)) + break return 1 + + /mob/living/carbon/fully_replace_character_name(oldname,newname) ..() if(dna) From 8c3f2f16cb5e560d60483885e5f23a9dfac5c37e Mon Sep 17 00:00:00 2001 From: Mike Long Date: Sun, 31 Jan 2016 09:21:18 -0500 Subject: [PATCH 2/4] Now less spammy. --- code/modules/mob/living/carbon/carbon.dm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 334298915a2..d0a80e5f75f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -588,20 +588,23 @@ var/const/GALOSHES_DONT_HELP = 4 add_abilities_to_panel() -/mob/living/carbon/proc/vomit(var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0) +/mob/living/carbon/proc/vomit(var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0, var/message = 1) if(src.is_muzzled()) - src << "The muzzle prevents you from vomiting!" + if(message) + src << "The muzzle prevents you from vomiting!" return 0 if(stun) Stun(4) if(nutrition < 100 && !blood) - visible_message("[src] dry heaves!", \ - "You try to throw up, but there's nothing your stomach!") + if(message) + visible_message("[src] dry heaves!", \ + "You try to throw up, but there's nothing your stomach!") if(stun) Weaken(10) else - visible_message("[src] throws up!", \ - "You throw up!") + if(message) + visible_message("[src] throws up!", \ + "You throw up!") playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1) var/turf/T = get_turf(src) for (var/i = 0 to distance) From 9eb8b8b77021f6111d226eed0e8498bb5a8791e3 Mon Sep 17 00:00:00 2001 From: Mike Long Date: Sun, 31 Jan 2016 10:12:45 -0500 Subject: [PATCH 3/4] Removes whitespace and fixes grammar. --- code/game/machinery/pipe/construction.dm | 4 ++-- code/modules/mob/living/carbon/carbon.dm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 2ae34c5c632..f20f0786224 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -242,10 +242,10 @@ var/global/list/pipeID2State = list( /obj/item/pipe/suicide_act(mob/user) if (pipe_type in list(PIPE_PUMP, PIPE_PASSIVE_GATE, PIPE_VOLUME_PUMP)) - user.visible_message("[user] shoved the [src.name] in \he's mouth and turned it on! It looks like \he's trying to commit suicide.") + user.visible_message("[user] shoved the [src] in \his mouth and turned it on! It looks like \he's trying to commit suicide.") if(istype(user, /mob/living/carbon)) var/mob/living/carbon/C = user - for (var/i = 1 to 20) + for(var/i=1 to 20) C.vomit(0,1,0,4,0) sleep(5) if(istype(user, /mob/living/carbon/human)) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index d0a80e5f75f..5f0125eb2a0 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -607,7 +607,7 @@ var/const/GALOSHES_DONT_HELP = 4 "You throw up!") playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1) var/turf/T = get_turf(src) - for (var/i = 0 to distance) + for(var/i=0 to distance) if(blood) if(T) T.add_blood_floor(src) From 4854d6eed649fcf6f9979937a3544113f42084ca Mon Sep 17 00:00:00 2001 From: Mike Long Date: Sun, 31 Jan 2016 14:54:32 -0500 Subject: [PATCH 4/4] Pipe Suicide now deals oxygen AND brute loss. --- code/game/machinery/pipe/construction.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index f20f0786224..05915bc884c 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -251,7 +251,7 @@ var/global/list/pipeID2State = list( if(istype(user, /mob/living/carbon/human)) var/mob/living/carbon/human/H = C H.vessel.remove_reagent("blood",560) - return(OXYLOSS) + return(OXYLOSS|BRUTELOSS) else return ..()