From 1c1e2da831986b63d2fdfb2390554bbc8cb874c4 Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Thu, 13 Apr 2023 22:49:56 -0500 Subject: [PATCH] Fixes omen component door crushing failing, fixes tilted vendors double dipping on omen people (#74692) ## About The Pull Request - Fixed door crush always failing. - It passed `forced = TRUE` and not `force_crush = TRUE`, so it just did a limp close -> re-open. Fixed that - Fixed tilted vendor double dip - It checked for tiltable but not already tilted, meaning you can get crushed -> move -> get crushed by the same vendor. Fixes that ## Why It's Good For The Game Curses ## Changelog :cl: Melbert fix: Omen Component door crush works fix: Omen Component vendors will no longer double dip (double tip) /:cl: --- code/datums/components/omen.dm | 35 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) 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)