From b521e214db92cd234dd4e8bb496978cfcb7661ea Mon Sep 17 00:00:00 2001 From: tralezab <40974010+tralezab@users.noreply.github.com> Date: Fri, 22 Nov 2019 17:30:13 -0800 Subject: [PATCH] [READY] shapeshifting in a pipe violently kills you: I WON EDITION (#47515) * cast proc edit I like these fringe interactions that punish you for trying something stupid in the hopes it does something game breaking. * dead project style *dabs* * cleaning up the code 1/2 * still needs work, fuu * Update code/modules/spells/spell_types/shapeshift.dm Co-Authored-By: moo <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com> * fixes the check, once and for all * FINALLY * :pensive: :100: Co-Authored-By: skoglol * even more improvements Co-Authored-By: skoglol * here we go --- code/modules/spells/spell_types/shapeshift.dm | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/code/modules/spells/spell_types/shapeshift.dm b/code/modules/spells/spell_types/shapeshift.dm index 81d396580e5..bae8d4864aa 100644 --- a/code/modules/spells/spell_types/shapeshift.dm +++ b/code/modules/spells/spell_types/shapeshift.dm @@ -16,7 +16,7 @@ var/convert_damage = TRUE //If you want to convert the caster's health to the shift, and vice versa. var/convert_damage_type = BRUTE //Since simplemobs don't have advanced damagetypes, what to convert damage back into. - var/shapeshift_type + var/mob/living/shapeshift_type var/list/possible_shapes = list(/mob/living/simple_animal/mouse,\ /mob/living/simple_animal/pet/dog/corgi,\ /mob/living/simple_animal/hostile/carp/ranged/chaos,\ @@ -46,10 +46,31 @@ var/obj/shapeshift_holder/S = locate() in M if(S) - Restore(M) + M = Restore(M) else - Shapeshift(M) + M = Shapeshift(M) + if(M.movement_type & (VENTCRAWLING)) + if(!M.ventcrawler) //you're shapeshifting into something that can't fit into a vent + var/obj/machinery/atmospherics/pipeyoudiein = M.loc + var/datum/pipeline/ourpipeline + var/pipenets = pipeyoudiein.returnPipenets() + if(islist(pipenets)) + ourpipeline = pipenets[1] + else + ourpipeline = pipenets + to_chat(M, "Casting [src] inside of [pipeyoudiein] quickly turns you into a bloody mush!") + var/gibtype = /obj/effect/gibspawner/generic + if(isalien(M)) + gibtype = /obj/effect/gibspawner/xeno + for(var/obj/machinery/atmospherics/components/unary/possiblevent in range(10, get_turf(M))) + if(possiblevent.parents.len && possiblevent.parents[1] == ourpipeline) + new gibtype(get_turf(possiblevent)) + playsound(possiblevent, 'sound/effects/reee.ogg', 75, TRUE) + priority_announce("We detected a pipe blockage around [get_area(get_turf(M))], please dispatch someone to investigate.", "Central Command") + M.death() + qdel(M) + return /obj/effect/proc_holder/spell/targeted/shapeshift/proc/Shapeshift(mob/living/caster) var/obj/shapeshift_holder/H = locate() in caster @@ -62,12 +83,14 @@ clothes_req = FALSE human_req = FALSE + return shape /obj/effect/proc_holder/spell/targeted/shapeshift/proc/Restore(mob/living/shape) var/obj/shapeshift_holder/H = locate() in shape if(!H) return + . = H.stored H.restore() clothes_req = initial(clothes_req) @@ -150,7 +173,7 @@ /obj/shapeshift_holder/proc/restore(death=FALSE) restoring = TRUE qdel(slink) - stored.forceMove(get_turf(src)) + stored.forceMove(shape.loc) stored.notransform = FALSE if(shape.mind) shape.mind.transfer_to(stored)