/obj/machinery/quantumpad name = "quantum pad" desc = "A bluespace quantum-linked telepad used for teleporting objects to other quantum pads." icon = 'icons/obj/telescience.dmi' icon_state = "qpad-idle" use_power = IDLE_POWER_USE idle_power_usage = 200 active_power_usage = 5000 obj_flags = CAN_BE_HIT | UNIQUE_RENAME circuit = /obj/item/circuitboard/machine/quantumpad var/teleport_cooldown = 400 //30 seconds base due to base parts var/teleport_speed = 50 var/last_teleport //to handle the cooldown var/teleporting = FALSE //if it's in the process of teleporting var/power_efficiency = 1 var/obj/machinery/quantumpad/linked_pad //mapping var/static/list/mapped_quantum_pads = list() var/map_pad_id = "" as text //what's my name var/map_pad_link_id = "" as text //who's my friend /obj/machinery/quantumpad/Initialize() . = ..() if(map_pad_id) mapped_quantum_pads[map_pad_id] = src /obj/machinery/quantumpad/Destroy() mapped_quantum_pads -= map_pad_id return ..() /obj/machinery/quantumpad/examine(mob/user) ..() to_chat(user, "It is [ linked_pad ? "currently" : "not"] linked to another pad.") if(!panel_open) to_chat(user, "The panel is screwed in, obstructing the linking device.") else to_chat(user, "The linking device is now able to be scanned with a multitool.") /obj/machinery/quantumpad/RefreshParts() var/E = 0 for(var/obj/item/stock_parts/capacitor/C in component_parts) E += C.rating power_efficiency = E E = 0 for(var/obj/item/stock_parts/manipulator/M in component_parts) E += M.rating teleport_speed = initial(teleport_speed) teleport_speed -= (E*10) teleport_cooldown = initial(teleport_cooldown) teleport_cooldown -= (E * 100) /obj/machinery/quantumpad/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, "pad-idle-o", "qpad-idle", I)) return if(panel_open) if(istype(I, /obj/item/multitool)) var/obj/item/multitool/M = I M.buffer = src to_chat(user, "You save the data in [I]'s buffer. It can now be saved to pads with closed panels.") return TRUE else if(istype(I, /obj/item/multitool)) var/obj/item/multitool/M = I if(istype(M.buffer, /obj/machinery/quantumpad)) if(M.buffer == src) to_chat(user, "You cannot link a pad to itself!") return TRUE else linked_pad = M.buffer to_chat(user, "You link [src] to the one in [I]'s buffer.") return TRUE else to_chat(user, "There is no quantum pad data saved in [I]'s buffer!") return TRUE if(default_deconstruction_crowbar(I)) return return ..() /obj/machinery/quantumpad/interact(mob/user) if(!linked_pad || QDELETED(linked_pad)) if(!map_pad_link_id || !initMappedLink()) to_chat(user, "There is no linked pad!") return if(world.time < last_teleport + teleport_cooldown) to_chat(user, "[src] is recharging power. Please wait [DisplayTimeText(last_teleport + teleport_cooldown - world.time)].") return if(teleporting) to_chat(user, "[src] is charging up. Please wait.") return if(linked_pad.teleporting) to_chat(user, "Linked pad is busy. Please wait.") return if(linked_pad.stat & NOPOWER) to_chat(user, "Linked pad is not responding to ping.") return add_fingerprint(user) doteleport(user) /obj/machinery/quantumpad/proc/sparks() var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(5, 1, get_turf(src)) s.start() /obj/machinery/quantumpad/attack_ghost(mob/dead/observer/ghost) . = ..() if(.) return if(!linked_pad && map_pad_link_id) initMappedLink() if(linked_pad) ghost.forceMove(get_turf(linked_pad)) /obj/machinery/quantumpad/proc/doteleport(mob/user) if(linked_pad) playsound(get_turf(src), 'sound/weapons/flash.ogg', 25, 1) teleporting = TRUE spawn(teleport_speed) if(!src || QDELETED(src)) teleporting = FALSE return if(stat & NOPOWER) to_chat(user, "[src] is unpowered!") teleporting = FALSE return if(!linked_pad || QDELETED(linked_pad) || linked_pad.stat & NOPOWER) to_chat(user, "Linked pad is not responding to ping. Teleport aborted.") teleporting = FALSE return 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, 1, extrarange = 3, falloff = 5) flick("qpad-beam", linked_pad) playsound(get_turf(linked_pad), 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff = 5) 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)) continue do_teleport(ROI, get_turf(linked_pad)) /obj/machinery/quantumpad/proc/initMappedLink() . = FALSE var/obj/machinery/quantumpad/link = mapped_quantum_pads[map_pad_link_id] if(link) linked_pad = link . = TRUE /obj/item/paper/guides/quantumpad name = "Quantum Pad For Dummies" info = "
Dummies Guide To Quantum Pads


Do you hate the concept of having to use your legs, let alone walk to places? Well, with the Quantum Pad (tm), never again will the fear of cardio keep you from going places!

How to set up your Quantum Pad(tm)


1.Unscrew the Quantum Pad(tm) you wish to link.
2. Use your multi-tool to cache the buffer of the Quantum Pad(tm) you wish to link.
3. Apply the multi-tool to the secondary Quantum Pad(tm) you wish to link to the first Quantum Pad(tm)

If you followed these instructions carefully, your Quantum Pad(tm) should now be properly linked together for near-instant movement across the station! Bear in mind that this is technically a one-way teleport, so you'll need to do the same process with the secondary pad to the first one if you wish to travel between both.
"