mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 03:57:48 +01:00
Adds Quantum Pads
Pad-to-pad teleporters, though they cost 75% of a diamond for each one (since they require a bluespace crystal each).
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//wrapper
|
||||
/proc/do_teleport(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
|
||||
/proc/do_teleport(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null, local=TRUE) //VOREStation Edit
|
||||
new /datum/teleport/instant/science(arglist(args))
|
||||
return
|
||||
|
||||
@@ -12,15 +12,16 @@
|
||||
var/soundin //soundfile to play before teleportation
|
||||
var/soundout //soundfile to play after teleportation
|
||||
var/force_teleport = 1 //if false, teleport will use Move() proc (dense objects will prevent teleportation)
|
||||
var/local = TRUE //VOREStation Add - If false, can teleport from/to any z-level
|
||||
|
||||
|
||||
/datum/teleport/New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
|
||||
/datum/teleport/New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null, local=TRUE) //VOREStation Edit
|
||||
..()
|
||||
if(!initTeleport(arglist(args)))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/teleport/proc/initTeleport(ateleatom,adestination,aprecision,afteleport,aeffectin,aeffectout,asoundin,asoundout)
|
||||
/datum/teleport/proc/initTeleport(ateleatom,adestination,aprecision,afteleport,aeffectin,aeffectout,asoundin,asoundout,local) //VOREStation Edit
|
||||
if(!setTeleatom(ateleatom))
|
||||
return 0
|
||||
if(!setDestination(adestination))
|
||||
@@ -30,6 +31,7 @@
|
||||
setEffects(aeffectin,aeffectout)
|
||||
setForceTeleport(afteleport)
|
||||
setSounds(asoundin,asoundout)
|
||||
src.local = local // VOREStation Add
|
||||
return 1
|
||||
|
||||
//must succeed
|
||||
@@ -186,7 +188,7 @@
|
||||
return 0
|
||||
*/ //VOREStation Removal End
|
||||
//VOREStation Edit Start
|
||||
if(destination.z in using_map.player_levels)
|
||||
if(!local || (destination.z in using_map.player_levels)) //VOREStation Edit
|
||||
return 1
|
||||
if(istype(teleatom, /mob/living))
|
||||
to_chat(teleatom, "<span class='warning'>The portal refuses to carry you that far away!</span>")
|
||||
|
||||
@@ -173,6 +173,13 @@
|
||||
build_path = /obj/item/weapon/circuitboard/bomb_tester
|
||||
sort_string = "HABAG"
|
||||
|
||||
/datum/design/circuit/quantum_pad
|
||||
name = "Quantum Pad"
|
||||
id = "quantum_pad"
|
||||
req_tech = list(TECH_ENGINEERING = 4, TECH_POWER = 4, TECH_BLUESPACE = 4)
|
||||
build_path = /obj/item/weapon/circuitboard/quantumpad
|
||||
sort_string = "HABAH"
|
||||
|
||||
////// RIGSuit Stuff
|
||||
/*
|
||||
/datum/design/item/rig
|
||||
|
||||
@@ -20,6 +20,18 @@
|
||||
/obj/item/stack/cable_coil = 5,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
|
||||
// Bamfpads! Ported from /tg/
|
||||
/obj/item/weapon/circuitboard/quantumpad
|
||||
name = T_BOARD("quantum pad")
|
||||
board_type = new /datum/frame/frame_types/machine
|
||||
build_path = /obj/machinery/power/quantumpad
|
||||
origin_tech = list(TECH_ENGINEERING = 4, TECH_POWER = 4, TECH_BLUESPACE = 4)
|
||||
req_components = list(
|
||||
/obj/item/weapon/ore/bluespace_crystal = 1,
|
||||
/obj/item/weapon/stock_parts/capacitor = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/stack/cable_coil = 5)
|
||||
|
||||
// The Designs
|
||||
|
||||
/datum/design/circuit/telesci_console
|
||||
@@ -44,10 +56,17 @@
|
||||
build_path = /obj/item/device/gps/advanced
|
||||
sort_string = "HAAEB"
|
||||
|
||||
/datum/design/circuit/quantum_pad
|
||||
name = "Quantum Pad"
|
||||
id = "quantum_pad"
|
||||
req_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4, TECH_PHORON = 4, TECH_BLUESPACE = 5)
|
||||
build_path = /obj/item/weapon/circuitboard/quantumpad
|
||||
sort_string = "HAAC"
|
||||
|
||||
/datum/design/item/bluespace_crystal
|
||||
name = "Artificial Bluespace Crystal"
|
||||
id = "bluespace_crystal"
|
||||
req_tech = list(TECH_BLUESPACE = 3, TECH_PHORON = 4)
|
||||
materials = list("diamond" = 1500, "phoron" = 1500)
|
||||
build_path = /obj/item/weapon/ore/bluespace_crystal/artificial
|
||||
sort_string = "HAAEC"
|
||||
sort_string = "HAAED"
|
||||
@@ -0,0 +1,189 @@
|
||||
/obj/machinery/power/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"
|
||||
anchored = TRUE
|
||||
use_power = 1
|
||||
idle_power_usage = 200
|
||||
active_power_usage = 5000
|
||||
circuit = /obj/item/weapon/circuitboard/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 = 0 //if it's in the process of teleporting
|
||||
var/power_efficiency = 1
|
||||
var/obj/machinery/power/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/power/quantumpad/initialize()
|
||||
. = ..()
|
||||
default_apply_parts()
|
||||
connect_to_network()
|
||||
if(map_pad_id)
|
||||
mapped_quantum_pads[map_pad_id] = src
|
||||
|
||||
/obj/machinery/power/quantumpad/Destroy()
|
||||
mapped_quantum_pads -= map_pad_id
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/quantumpad/RefreshParts()
|
||||
var/E = 0
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
E += M.rating
|
||||
power_efficiency = E
|
||||
|
||||
E = 0
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
|
||||
E += C.rating
|
||||
|
||||
teleport_speed = initial(teleport_speed)
|
||||
teleport_speed -= (E*10)
|
||||
teleport_cooldown = initial(teleport_cooldown)
|
||||
teleport_cooldown -= (E * 100)
|
||||
|
||||
/obj/machinery/power/quantumpad/attackby(obj/item/I, mob/user, params)
|
||||
if(default_deconstruction_screwdriver(user, I))
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/device/multitool))
|
||||
if(panel_open)
|
||||
var/obj/item/device/multitool/M = I
|
||||
M.buffer = src
|
||||
to_chat(user, "<span class='notice'>You save the data in [I]'s buffer.</span>")
|
||||
return 1
|
||||
else
|
||||
var/obj/item/device/multitool/M = I
|
||||
if(istype(M.buffer, /obj/machinery/power/quantumpad))
|
||||
linked_pad = M.buffer
|
||||
to_chat(user, "<span class='notice'>You link [src] to the one in [I]'s buffer.</span>")
|
||||
return 1
|
||||
|
||||
if(default_part_replacement(user, I))
|
||||
return
|
||||
|
||||
if(default_deconstruction_crowbar(I))
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/quantumpad/update_icon()
|
||||
. = ..()
|
||||
|
||||
if(inoperable() || panel_open)
|
||||
icon_state = "pad-idle-o"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/machinery/power/quantumpad/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='warning'>The panel must be closed before operating this machine!</span>")
|
||||
return
|
||||
|
||||
if(istype(get_area(src), /area/shuttle))
|
||||
to_chat(user, "<span class='warning'>This is too unstable a platform for \the [src] to operate on!</span>")
|
||||
return
|
||||
|
||||
if(!powernet)
|
||||
to_chat(user, "<span class='warning'>[src] is not attached to a powernet!</span>")
|
||||
return
|
||||
|
||||
if(!linked_pad || QDELETED(linked_pad))
|
||||
if(!map_pad_link_id || !initMappedLink())
|
||||
to_chat(user, "<span class='warning'>There is no linked pad!</span>")
|
||||
return
|
||||
|
||||
if(world.time < last_teleport + teleport_cooldown)
|
||||
to_chat(user, "<span class='warning'>[src] is recharging power. Please wait [round((last_teleport + teleport_cooldown - world.time)/10)] seconds.</span>")
|
||||
return
|
||||
|
||||
if(teleporting)
|
||||
to_chat(user, "<span class='warning'>[src] is charging up. Please wait.</span>")
|
||||
return
|
||||
|
||||
if(linked_pad.teleporting)
|
||||
to_chat(user, "<span class='warning'>Linked pad is busy. Please wait.</span>")
|
||||
return
|
||||
|
||||
if(linked_pad.inoperable())
|
||||
to_chat(user, "<span class='warning'>Linked pad is not responding to ping.</span>")
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
doteleport(user)
|
||||
|
||||
/obj/machinery/power/quantumpad/proc/sparks()
|
||||
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
|
||||
sparks.set_up(5, 1, get_turf(src))
|
||||
sparks.start()
|
||||
|
||||
/obj/machinery/power/quantumpad/attack_ghost(mob/observer/dead/ghost)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(!linked_pad && map_pad_link_id)
|
||||
initMappedLink()
|
||||
if(linked_pad && !QDELETED(linked_pad))
|
||||
ghost.forceMove(get_turf(linked_pad))
|
||||
|
||||
/obj/machinery/power/quantumpad/proc/doteleport(mob/user)
|
||||
if(!linked_pad)
|
||||
return
|
||||
playsound(get_turf(src), 'sound/weapons/flash.ogg', 25, 1)
|
||||
teleporting = 1
|
||||
|
||||
spawn(teleport_speed)
|
||||
if(!src || QDELETED(src))
|
||||
teleporting = 0
|
||||
return
|
||||
if(inoperable())
|
||||
to_chat(user, "<span class='warning'>[src] is nonfunctional!</span>")
|
||||
teleporting = 0
|
||||
return
|
||||
if(!linked_pad || QDELETED(linked_pad) || linked_pad.inoperable())
|
||||
to_chat(user, "<span class='warning'>Linked pad is not responding to ping. Teleport aborted.</span>")
|
||||
teleporting = 0
|
||||
return
|
||||
|
||||
teleporting = 0
|
||||
last_teleport = world.time
|
||||
|
||||
// use a lot of power
|
||||
var/power_to_use = 10000 / power_efficiency
|
||||
if(draw_power(power_to_use) != power_to_use)
|
||||
to_chat(user, "<span class='warning'>Power is not sufficient to complete a teleport. Teleport aborted.</span>")
|
||||
return
|
||||
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), local = FALSE)
|
||||
|
||||
/obj/machinery/power/quantumpad/proc/initMappedLink()
|
||||
. = FALSE
|
||||
var/obj/machinery/power/quantumpad/link = mapped_quantum_pads[map_pad_link_id]
|
||||
if(link)
|
||||
linked_pad = link
|
||||
. = TRUE
|
||||
@@ -2674,6 +2674,7 @@
|
||||
#include "code\modules\telesci\bscyrstal.dm"
|
||||
#include "code\modules\telesci\construction.dm"
|
||||
#include "code\modules\telesci\gps_advanced.dm"
|
||||
#include "code\modules\telesci\quantum_pad.dm"
|
||||
#include "code\modules\telesci\telepad.dm"
|
||||
#include "code\modules\telesci\telesci_computer.dm"
|
||||
#include "code\modules\tension\tension.dm"
|
||||
|
||||
Reference in New Issue
Block a user