From bb28771fa4ef5d0fe16e7d5c6f207f9b517b11a4 Mon Sep 17 00:00:00 2001 From: tattle <66640614+dragomagol@users.noreply.github.com> Date: Tue, 5 Dec 2023 18:26:04 -0800 Subject: [PATCH] Chasms prevent teleportation (#80102) ## About The Pull Request Chasms prevent teleportation Fixes #80101 ## Why It's Good For The Game Being able to teleport people into chasms using beacons as an anchor is bad. It has very little counterplay besides fishing out the beacon, changing the teleport target (assuming it's not hidden), or killing someone holding a handtele. The alternate idea for this PR was to see if the chasm added some sort of trait to the things falling in it and make it so the teleporter would ignore things with that trait, but it seems like chasms don't do that. ## Changelog :cl: Tattle balance: you can no longer teleport into chasms /:cl: --------- Co-authored-by: tattle --- code/datums/components/chasm.dm | 5 +++++ code/datums/helper_datums/teleport.dm | 1 + 2 files changed, 6 insertions(+) diff --git a/code/datums/components/chasm.dm b/code/datums/components/chasm.dm index f85ca347aa0..76538bcb315 100644 --- a/code/datums/components/chasm.dm +++ b/code/datums/components/chasm.dm @@ -20,6 +20,7 @@ /obj/effect/light_emitter/tendril, /obj/effect/mapping_helpers, /obj/effect/particle_effect/ion_trails, + /obj/effect/particle_effect/sparks, /obj/effect/portal, /obj/effect/projectile, /obj/effect/spectre_of_resurrection, @@ -42,6 +43,7 @@ RegisterSignal(parent, COMSIG_ATOM_ABSTRACT_ENTERED, PROC_REF(entered)) RegisterSignal(parent, COMSIG_ATOM_ABSTRACT_EXITED, PROC_REF(exited)) RegisterSignal(parent, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON, PROC_REF(initialized_on)) + RegisterSignal(parent, COMSIG_ATOM_INTERCEPT_TELEPORTING, PROC_REF(block_teleport)) //allow catwalks to give the turf the CHASM_STOPPED trait before dropping stuff when the turf is changed. //otherwise don't do anything because turfs and areas are initialized before movables. if(!mapload) @@ -63,6 +65,9 @@ SIGNAL_HANDLER drop_stuff(movable) +/datum/component/chasm/proc/block_teleport() + return COMPONENT_BLOCK_TELEPORT + /datum/component/chasm/proc/on_chasm_stopped(datum/source) SIGNAL_HANDLER UnregisterSignal(source, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_EXITED, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON)) diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index c0217d95774..6ea1a8121f0 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -66,6 +66,7 @@ if(!forced) if(!check_teleport_valid(teleatom, destination, channel)) + teleatom.balloon_alert(teleatom, "something holds you back!") return FALSE if(isobserver(teleatom))