From 8263be1b730290a8f9d83f70db01028bb2afdbe0 Mon Sep 17 00:00:00 2001 From: Lucy Date: Tue, 3 Sep 2024 11:38:13 -0400 Subject: [PATCH] All jaunts now kick you out if you are KO'd mid-jaunt (#86339) ## About The Pull Request Basically, this is https://github.com/tgstation/tgstation/pull/83241 extended to all jaunts, like bloodcrawl and such ## Why It's Good For The Game Kinda sucks getting RR'd if you die for some stupid reason mid-bloodcrawl (i.e accidentally suffocating while jaunting) ## Changelog :cl: fix: You will now be ejected from any jaunt (i.e bloodcrawl or shadow walk) if you lose consciousness somehow during the jaunt. /:cl: --- code/game/objects/effects/phased_mob.dm | 8 ++++++++ code/modules/antagonists/heretic/magic/space_crawl.dm | 10 +--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/game/objects/effects/phased_mob.dm b/code/game/objects/effects/phased_mob.dm index b1df969b45c..357e9683072 100644 --- a/code/game/objects/effects/phased_mob.dm +++ b/code/game/objects/effects/phased_mob.dm @@ -23,6 +23,7 @@ jaunter.forceMove(src) if(ismob(jaunter)) var/mob/mob_jaunter = jaunter + RegisterSignal(mob_jaunter, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_change)) mob_jaunter.reset_perspective(src) /obj/effect/dummy/phased_mob/Destroy() @@ -55,6 +56,7 @@ /obj/effect/dummy/phased_mob/Exited(atom/movable/gone, direction) . = ..() if(gone == jaunter) + UnregisterSignal(jaunter, COMSIG_MOB_STATCHANGE) SEND_SIGNAL(src, COMSIG_MOB_EJECTED_FROM_JAUNT, jaunter) jaunter = null @@ -98,3 +100,9 @@ newloc = can_z_move(direction, get_turf(src), newloc, ZMOVE_INCAPACITATED_CHECKS | ZMOVE_FEEDBACK | ZMOVE_ALLOW_ANCHORED, user) return newloc + +/// Signal proc for [COMSIG_MOB_STATCHANGE], to throw us out of the jaunt if we lose consciousness. +/obj/effect/dummy/phased_mob/proc/on_stat_change(mob/living/source, new_stat, old_stat) + SIGNAL_HANDLER + if(source == jaunter && source.stat != CONSCIOUS) + eject_jaunter() diff --git a/code/modules/antagonists/heretic/magic/space_crawl.dm b/code/modules/antagonists/heretic/magic/space_crawl.dm index 90f74a37047..49b9ae96f30 100644 --- a/code/modules/antagonists/heretic/magic/space_crawl.dm +++ b/code/modules/antagonists/heretic/magic/space_crawl.dm @@ -83,7 +83,6 @@ jaunter.put_in_hands(right_hand) RegisterSignal(jaunter, SIGNAL_REMOVETRAIT(TRAIT_ALLOW_HERETIC_CASTING), PROC_REF(on_focus_lost)) - RegisterSignal(jaunter, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_change)) playsound(our_turf, 'sound/magic/cosmic_energy.ogg', 50, TRUE, -1) our_turf.visible_message(span_warning("[jaunter] sinks into [our_turf]!")) new /obj/effect/temp_visual/space_explosion(our_turf) @@ -107,7 +106,7 @@ /datum/action/cooldown/spell/jaunt/space_crawl/on_jaunt_exited(obj/effect/dummy/phased_mob/jaunt, mob/living/unjaunter) UnregisterSignal(jaunt, COMSIG_MOVABLE_MOVED) - UnregisterSignal(unjaunter, list(SIGNAL_REMOVETRAIT(TRAIT_ALLOW_HERETIC_CASTING), COMSIG_MOB_STATCHANGE)) + UnregisterSignal(unjaunter, list(SIGNAL_REMOVETRAIT(TRAIT_ALLOW_HERETIC_CASTING))) playsound(get_turf(unjaunter), 'sound/magic/cosmic_energy.ogg', 50, TRUE, -1) new /obj/effect/temp_visual/space_explosion(get_turf(unjaunter)) if(iscarbon(unjaunter)) @@ -122,13 +121,6 @@ var/turf/our_turf = get_turf(source) try_exit_jaunt(our_turf, source, TRUE) -/// Signal proc for [COMSIG_MOB_STATCHANGE], to throw us out of the jaunt if we lose consciousness. -/datum/action/cooldown/spell/jaunt/space_crawl/proc/on_stat_change(mob/living/source, new_stat, old_stat) - SIGNAL_HANDLER - if(new_stat != CONSCIOUS) - var/turf/our_turf = get_turf(source) - try_exit_jaunt(our_turf, source, TRUE) - /// Spacecrawl "hands", prevent the user from holding items in spacecrawl /obj/item/space_crawl name = "space crawl"