diff --git a/code/datums/components/omen.dm b/code/datums/components/omen.dm index aee0cac939b..3a7b4d42f8d 100644 --- a/code/datums/components/omen.dm +++ b/code/datums/components/omen.dm @@ -59,15 +59,14 @@ return var/our_guy_pos = get_turf(living_guy) - for(var/turf_content in our_guy_pos) - if(istype(turf_content, /obj/machinery/door/airlock)) - to_chat(living_guy, span_warning("A malevolent force launches your body to the floor...")) - var/obj/machinery/door/airlock/darth_airlock = turf_content - living_guy.apply_status_effect(/datum/status_effect/incapacitating/paralyzed, 10) - INVOKE_ASYNC(darth_airlock, TYPE_PROC_REF(/obj/machinery/door/airlock, close), TRUE) - if(!permanent && !prob(66.6)) - qdel(src) - return + for(var/obj/machinery/door/airlock/darth_airlock in our_guy_pos) + if(darth_airlock.locked || !darth_airlock.hasPower()) + continue + + to_chat(living_guy, span_warning("A malevolent force launches your body to the floor...")) + living_guy.Paralyze(1 SECONDS, ignore_canstun = TRUE) + INVOKE_ASYNC(src, PROC_REF(slam_airlock), darth_airlock) + return if(istype(our_guy_pos, /turf/open/floor/noslip/tram_plate/energized)) var/turf/open/floor/noslip/tram_plate/energized/future_tram_victim = our_guy_pos @@ -87,12 +86,18 @@ return for(var/obj/machinery/vending/darth_vendor in the_turf) - if(darth_vendor.tiltable) - to_chat(living_guy, span_warning("A malevolent force tugs at the [darth_vendor]...")) - INVOKE_ASYNC(darth_vendor, TYPE_PROC_REF(/obj/machinery/vending, tilt), living_guy) - if(!permanent) - qdel(src) - return + if(!darth_vendor.tiltable || darth_vendor.tilted) + continue + to_chat(living_guy, span_warning("A malevolent force tugs at the [darth_vendor]...")) + INVOKE_ASYNC(darth_vendor, TYPE_PROC_REF(/obj/machinery/vending, tilt), living_guy) + if(!permanent) + qdel(src) + return + +/datum/component/omen/proc/slam_airlock(obj/machinery/door/airlock/darth_airlock) + . = darth_airlock.close(force_crush = TRUE) + if(. && !permanent && !prob(66.6)) + qdel(src) /// If we get knocked down, see if we have a really bad slip and bash our head hard /datum/component/omen/proc/check_slip(mob/living/our_guy, amount)