Teleporters now use crossed over bump (#20902)

This commit is contained in:
Qwertytoforty
2023-04-25 21:13:52 +02:00
committed by GitHub
parent b9e19eaeaf
commit b4fa897ea1
+17 -11
View File
@@ -329,6 +329,9 @@
name = "teleporter hub"
desc = "It's the hub of a teleporting machine."
icon_state = "tele0"
density = FALSE
layer = HOLOPAD_LAYER //Preventing mice and drones from sneaking under them.
plane = FLOOR_PLANE
var/accurate = 0
idle_power_consumption = 10
active_power_consumption = 2000
@@ -377,13 +380,13 @@
break
return power_station
/obj/machinery/teleport/hub/Bumped(M as mob|obj)
/obj/machinery/teleport/hub/Crossed(atom/movable/AM, oldloc)
if(!is_teleport_allowed(z) && !admin_usage)
if(ismob(M))
to_chat(M, "You can't use this here.")
if(ismob(AM))
to_chat(AM, "You can't use this here.")
return
if(power_station && power_station.engaged && !panel_open && !blockAI(M))
if(!teleport(M) && isliving(M)) // the isliving(M) is needed to avoid triggering errors if a spark bumps the telehub
if(power_station && power_station.engaged && !panel_open && !blockAI(AM))
if(!teleport(AM) && isliving(AM)) // the isliving(M) is needed to avoid triggering errors if a spark bumps the telehub
visible_message("<span class='warning'>[src] emits a loud buzz, as its teleport portal flickers and fails!</span>")
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, FALSE)
power_station.toggle() // turn off the portal.
@@ -448,6 +451,9 @@
name = "permanent teleporter"
desc = "A teleporter with the target pre-set on the circuit board."
icon_state = "tele0"
density = FALSE
layer = HOLOPAD_LAYER
plane = FLOOR_PLANE
idle_power_consumption = 10
active_power_consumption = 2000
@@ -468,23 +474,23 @@
tele_delay = max(A, 0)
update_icon(UPDATE_ICON_STATE)
/obj/machinery/teleport/perma/Bumped(atom/A)
/obj/machinery/teleport/perma/Crossed(atom/movable/AM, oldloc)
if(stat & (BROKEN|NOPOWER))
return
if(!is_teleport_allowed(z))
to_chat(A, "You can't use this here.")
to_chat(AM, "You can't use this here.")
return
if(target && !recalibrating && !panel_open && !blockAI(A))
do_teleport(A, target)
if(target && !recalibrating && !panel_open && !blockAI(AM))
do_teleport(AM, target)
use_power(5000)
if(tele_delay)
recalibrating = TRUE
update_icon(UPDATE_ICON_STATE | UPDATE_OVERLAYS)
update_lighting()
addtimer(CALLBACK(src, PROC_REF(BumpedCallback)), tele_delay)
addtimer(CALLBACK(src, PROC_REF(CrossedCallback)), tele_delay)
/obj/machinery/teleport/perma/proc/BumpedCallback()
/obj/machinery/teleport/perma/proc/CrossedCallback()
recalibrating = FALSE
update_icon(UPDATE_ICON_STATE | UPDATE_OVERLAYS)
update_lighting()