Refactored CollidedWith (#19541)

Refactored CollidedWith()
This commit is contained in:
Fluffy
2024-06-29 10:01:18 +00:00
committed by GitHub
parent d63d63d78c
commit d8d67ebd3a
31 changed files with 317 additions and 183 deletions
+26 -12
View File
@@ -115,19 +115,26 @@
//okay, here's the good teleporting stuff
/obj/machinery/gateway/centerstation/CollidedWith(atom/movable/M as mob|obj)
/obj/machinery/gateway/centerstation/CollidedWith(atom/bumped_atom)
. = ..()
if(!ready || !active || !awaygate)
return
if(!ismovable(bumped_atom))
return
var/atom/movable/AM = bumped_atom
if(awaygate.calibrated)
M.forceMove(get_step(awaygate.loc, SOUTH))
M.set_dir(SOUTH)
AM.forceMove(get_step(awaygate.loc, SOUTH))
AM.set_dir(SOUTH)
return
else
var/obj/effect/landmark/dest = pick(GLOB.awaydestinations)
if(dest)
M.forceMove(dest.loc)
M.set_dir(SOUTH)
AM.forceMove(dest.loc)
AM.set_dir(SOUTH)
use_power_oneoff(5000)
return
@@ -215,17 +222,24 @@
toggleoff()
/obj/machinery/gateway/centeraway/CollidedWith(atom/movable/M as mob|obj)
/obj/machinery/gateway/centeraway/CollidedWith(atom/bumped_atom)
. = ..()
if(!ready || !active)
return
if(istype(M, /mob/living/carbon))
for(var/obj/item/implant/exile/E in M)//Checking that there is an exile implant in the contents
if(E.imp_in == M)//Checking that it's actually implanted vs just in their pocket
to_chat(M, "\black The station gate has detected your exile implant and is blocking your entry.")
if(!ismovable(bumped_atom))
return
var/atom/movable/AM = bumped_atom
if(iscarbon(AM))
for(var/obj/item/implant/exile/E in AM)//Checking that there is an exile implant in the contents
if(E.imp_in == AM)//Checking that it's actually implanted vs just in their pocket
to_chat(AM, "\black The station gate has detected your exile implant and is blocking your entry.")
return
M.forceMove(get_step(stationgate.loc, SOUTH))
M.set_dir(SOUTH)
AM.forceMove(get_step(stationgate.loc, SOUTH))
AM.set_dir(SOUTH)
/obj/machinery/gateway/centeraway/attackby(obj/item/attacking_item, mob/user)