Resprites Quantum Pads and Cargo Pads (#27595)

* Resprites Quantum Pads and Cargo Pads

Adds a new sprite and animation for teleporter pads

* Fix rendering layers

Makes quantum pads move to a higher layer while active
This commit is contained in:
ExusA
2024-12-25 03:15:55 +00:00
committed by GitHub
parent fa8c9f476a
commit 2c66db9670
2 changed files with 58 additions and 42 deletions
+58 -42
View File
@@ -1,3 +1,6 @@
#define QPAD_ANIM_WINDUP 0.8 SECONDS
#define QPAD_ANIM_COOLDOWN 0.7 SECONDS
/obj/machinery/quantumpad
name = "quantum pad"
desc = "A bluespace quantum-linked telepad used for teleporting objects to other quantum pads."
@@ -168,57 +171,70 @@
else
to_chat(user, "<span class='warning'>Linked pad is not on or near any active cameras on the station.</span>")
/obj/machinery/quantumpad/proc/sparks()
do_sparks(5, 1, get_turf(src))
/obj/machinery/quantumpad/attack_ghost(mob/dead/observer/ghost)
if(!QDELETED(linked_pad))
ghost.forceMove(get_turf(linked_pad))
/obj/machinery/quantumpad/proc/precharge()
layer = HIGH_OBJ_LAYER
linked_pad.layer = HIGH_OBJ_LAYER
flick("qpad-beam", src)
flick("qpad-beam", linked_pad)
addtimer(CALLBACK(src, PROC_REF(finish_teleport)), max((teleport_speed + QPAD_ANIM_COOLDOWN), 1))
/obj/machinery/quantumpad/proc/finish_teleport()
if(!teleporting)
layer = BELOW_OBJ_LAYER
linked_pad.layer = BELOW_OBJ_LAYER
/obj/machinery/quantumpad/proc/doteleport(mob/user)
if(linked_pad)
playsound(get_turf(src), 'sound/weapons/flash.ogg', 25, 1)
teleporting = TRUE
src.icon_state = "qpad-charge"
linked_pad.icon_state = "qpad-charge"
addtimer(CALLBACK(src, PROC_REF(precharge)), max((teleport_speed - QPAD_ANIM_WINDUP), 1))
addtimer(CALLBACK(src, PROC_REF(process_teleport)), teleport_speed)
spawn(teleport_speed)
if(!src || QDELETED(src))
teleporting = FALSE
return
if(stat & NOPOWER)
to_chat(user, "<span class='warning'>[src] is unpowered!</span>")
teleporting = FALSE
return
if(!linked_pad || QDELETED(linked_pad) || linked_pad.stat & NOPOWER)
to_chat(user, "<span class='warning'>Linked pad is not responding to ping. Teleport aborted.</span>")
teleporting = FALSE
return
/obj/machinery/quantumpad/proc/process_teleport(mob/user)
if(!src || QDELETED(src))
teleporting = FALSE
return
if(stat & NOPOWER)
to_chat(user, "<span class='warning'>[src] is unpowered!</span>")
teleporting = FALSE
return
if(!linked_pad || QDELETED(linked_pad) || linked_pad.stat & NOPOWER)
to_chat(user, "<span class='warning'>Linked pad is not responding to ping. Teleport aborted.</span>")
teleporting = FALSE
return
teleporting = FALSE
last_teleport = world.time
teleporting = FALSE
last_teleport = world.time
// use a lot of power
use_power(10000 / power_efficiency)
sparks()
linked_pad.sparks()
flick("qpad-beam", src)
playsound(get_turf(src), 'sound/weapons/emitter2.ogg', 25, TRUE)
flick("qpad-beam", linked_pad)
playsound(get_turf(linked_pad), 'sound/weapons/emitter2.ogg', 25, TRUE)
var/tele_success = TRUE
for(var/atom/movable/ROI in get_turf(src))
// if is anchored, don't let through
if(ROI.anchored)
if(isliving(ROI))
var/mob/living/L = ROI
if(L.buckled)
// TP people on office chairs
if(L.buckled.anchored)
continue
else
continue
else if(!isobserver(ROI))
// use a lot of power
use_power(10000 / power_efficiency)
playsound(get_turf(src), 'sound/weapons/emitter2.ogg', 25, TRUE)
playsound(get_turf(linked_pad), 'sound/weapons/emitter2.ogg', 25, TRUE)
var/tele_success = TRUE
for(var/atom/movable/ROI in get_turf(src))
// if is anchored, don't let through
if(ROI.anchored)
if(isliving(ROI))
var/mob/living/L = ROI
if(L.buckled)
// TP people on office chairs
if(L.buckled.anchored)
continue
tele_success = do_teleport(ROI, get_turf(linked_pad))
if(!tele_success)
to_chat(user, "<span class='warning'>Teleport failed due to bluespace interference.</span>")
else
continue
else if(!isobserver(ROI))
continue
tele_success = do_teleport(ROI, get_turf(linked_pad), do_effect = FALSE)
if(!tele_success)
to_chat(user, "<span class='warning'>Teleport failed due to bluespace interference.</span>")
src.icon_state = "qpad-idle"
linked_pad.icon_state = "qpad-idle"
#undef QPAD_ANIM_WINDUP
#undef QPAD_ANIM_COOLDOWN
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB