initial commit - cross reference with 5th port - obviously has compile errors
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
// Bluespace crystals, used in telescience and when crushed it will blink you to a random turf.
|
||||
|
||||
/obj/item/weapon/ore/bluespace_crystal
|
||||
name = "bluespace crystal"
|
||||
desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "bluespace_crystal"
|
||||
w_class = 1
|
||||
origin_tech = "bluespace=6;materials=3"
|
||||
points = 50
|
||||
var/blink_range = 8 // The teleport range when crushed/thrown at someone.
|
||||
|
||||
/obj/item/weapon/ore/bluespace_crystal/New()
|
||||
..()
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
|
||||
/obj/item/weapon/ore/bluespace_crystal/attack_self(mob/user)
|
||||
user.visible_message("<span class='warning'>[user] crushes [src]!</span>", "<span class='danger'>You crush [src]!</span>")
|
||||
PoolOrNew(/obj/effect/particle_effect/sparks, loc)
|
||||
playsound(src.loc, "sparks", 50, 1)
|
||||
blink_mob(user)
|
||||
user.unEquip(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/ore/bluespace_crystal/proc/blink_mob(mob/living/L)
|
||||
do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg')
|
||||
|
||||
/obj/item/weapon/ore/bluespace_crystal/throw_impact(atom/hit_atom)
|
||||
if(!..()) // not caught in mid-air
|
||||
visible_message("<span class='notice'>[src] fizzles and disappears upon impact!</span>")
|
||||
var/turf/T = get_turf(hit_atom)
|
||||
PoolOrNew(/obj/effect/particle_effect/sparks, T)
|
||||
playsound(src.loc, "sparks", 50, 1)
|
||||
if(isliving(hit_atom))
|
||||
blink_mob(hit_atom)
|
||||
qdel(src)
|
||||
|
||||
// Artifical bluespace crystal, doesn't give you much research.
|
||||
|
||||
/obj/item/weapon/ore/bluespace_crystal/artificial
|
||||
name = "artificial bluespace crystal"
|
||||
desc = "An artificially made bluespace crystal, it looks delicate."
|
||||
origin_tech = "bluespace=3;plasmatech=4"
|
||||
blink_range = 4 // Not as good as the organic stuff!
|
||||
points = 0 // nice try
|
||||
@@ -0,0 +1,155 @@
|
||||
var/list/GPS_list = list()
|
||||
/obj/item/device/gps
|
||||
name = "global positioning system"
|
||||
desc = "Helping lost spacemen find their way through the planets since 2016. Alt+click to toggle power."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "gps-c"
|
||||
w_class = 2
|
||||
slot_flags = SLOT_BELT
|
||||
origin_tech = "materials=2;magnets=1;bluespace=2"
|
||||
var/gpstag = "COM0"
|
||||
var/emped = 0
|
||||
var/turf/locked_location
|
||||
var/tracking = TRUE
|
||||
|
||||
/obj/item/device/gps/New()
|
||||
..()
|
||||
GPS_list.Add(src)
|
||||
name = "global positioning system ([gpstag])"
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/device/gps/Destroy()
|
||||
GPS_list.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/gps/emp_act(severity)
|
||||
emped = TRUE
|
||||
overlays -= "working"
|
||||
add_overlay("emp")
|
||||
addtimer(src, "reboot", 300)
|
||||
|
||||
/obj/item/device/gps/proc/reboot()
|
||||
emped = FALSE
|
||||
overlays -= "emp"
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/device/gps/AltClick(mob/user)
|
||||
if(!user.canUseTopic(src, be_close=TRUE))
|
||||
return //user not valid to use gps
|
||||
if(emped)
|
||||
user << "It's busted!"
|
||||
if(tracking)
|
||||
overlays -= "working"
|
||||
user << "[src] is no longer tracking, or visible to other GPS devices."
|
||||
tracking = FALSE
|
||||
else
|
||||
add_overlay("working")
|
||||
user << "[src] is now tracking, and visible to other GPS devices."
|
||||
tracking = TRUE
|
||||
|
||||
/obj/item/device/gps/attack_self(mob/user)
|
||||
if(!tracking)
|
||||
user << "[src] is turned off. Use alt+click to toggle it back on."
|
||||
return
|
||||
|
||||
var/obj/item/device/gps/t = ""
|
||||
var/gps_window_height = 110 + GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
|
||||
if(emped)
|
||||
t += "ERROR"
|
||||
else
|
||||
t += "<BR><A href='?src=\ref[src];tag=1'>Set Tag</A> "
|
||||
t += "<BR>Tag: [gpstag]"
|
||||
if(locked_location && locked_location.loc)
|
||||
t += "<BR>Bluespace coordinates saved: [locked_location.loc]"
|
||||
gps_window_height += 20
|
||||
|
||||
for(var/obj/item/device/gps/G in GPS_list)
|
||||
var/turf/pos = get_turf(G)
|
||||
var/area/gps_area = get_area(G)
|
||||
var/tracked_gpstag = G.gpstag
|
||||
if(G.emped == 1)
|
||||
t += "<BR>[tracked_gpstag]: ERROR"
|
||||
else if(G.tracking)
|
||||
t += "<BR>[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])"
|
||||
else
|
||||
continue
|
||||
var/datum/browser/popup = new(user, "GPS", name, 360, min(gps_window_height, 800))
|
||||
popup.set_content(t)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/item/device/gps/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["tag"] )
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = uppertext(copytext(sanitize(a), 1, 5))
|
||||
if(in_range(src, usr))
|
||||
gpstag = a
|
||||
name = "global positioning system ([gpstag])"
|
||||
attack_self(usr)
|
||||
|
||||
/obj/item/device/gps/science
|
||||
icon_state = "gps-s"
|
||||
gpstag = "SCI0"
|
||||
|
||||
/obj/item/device/gps/engineering
|
||||
icon_state = "gps-e"
|
||||
gpstag = "ENG0"
|
||||
|
||||
/obj/item/device/gps/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINE0"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/device/gps/cyborg
|
||||
icon_state = "gps-b"
|
||||
gpstag = "BORG0"
|
||||
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
|
||||
flags = NODROP
|
||||
|
||||
/obj/item/device/gps/internal
|
||||
icon_state = null
|
||||
flags = ABSTRACT
|
||||
gpstag = "Eerie Signal"
|
||||
desc = "Report to a coder immediately."
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
|
||||
/obj/item/device/gps/mining/internal
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINER"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/device/gps/visible_debug
|
||||
name = "visible GPS"
|
||||
gpstag = "ADMIN"
|
||||
desc = "This admin-spawn GPS unit leaves the coordinates visible \
|
||||
on any turf that it passes over, for debugging. Especially useful \
|
||||
for marking the area around the transition edges."
|
||||
var/list/turf/tagged
|
||||
|
||||
/obj/item/device/gps/visible_debug/New()
|
||||
. = ..()
|
||||
tagged = list()
|
||||
SSfastprocess.processing += src
|
||||
|
||||
/obj/item/device/gps/visible_debug/process()
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
// I assume it's faster to color,tag and OR the turf in, rather
|
||||
// then checking if its there
|
||||
T.color = RANDOM_COLOUR
|
||||
T.maptext = "[T.x],[T.y],[T.z]"
|
||||
tagged |= T
|
||||
|
||||
/obj/item/device/gps/visible_debug/proc/clear()
|
||||
while(tagged.len)
|
||||
var/turf/T = pop(tagged)
|
||||
T.color = initial(T.color)
|
||||
T.maptext = initial(T.maptext)
|
||||
|
||||
/obj/item/device/gps/visible_debug/Destroy()
|
||||
if(tagged)
|
||||
clear()
|
||||
tagged = null
|
||||
SSfastprocess.processing -= src
|
||||
. = ..()
|
||||
@@ -0,0 +1,174 @@
|
||||
///SCI TELEPAD///
|
||||
/obj/machinery/telepad
|
||||
name = "telepad"
|
||||
desc = "A bluespace telepad used for teleporting objects to and from a location."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "pad-idle"
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 200
|
||||
active_power_usage = 5000
|
||||
var/efficiency
|
||||
|
||||
/obj/machinery/telepad/New()
|
||||
..()
|
||||
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/telesci_pad(null)
|
||||
B.apply_default_parts(src)
|
||||
|
||||
/obj/item/weapon/circuitboard/machine/telesci_pad
|
||||
name = "circuit board (Telepad)"
|
||||
build_path = /obj/machinery/telepad
|
||||
origin_tech = "programming=4;engineering=3;plasmatech=4;bluespace=4"
|
||||
req_components = list(
|
||||
/obj/item/weapon/ore/bluespace_crystal = 2,
|
||||
/obj/item/weapon/stock_parts/capacitor = 1,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
def_components = list(/obj/item/weapon/ore/bluespace_crystal = /obj/item/weapon/ore/bluespace_crystal/artificial)
|
||||
|
||||
/obj/machinery/telepad/RefreshParts()
|
||||
var/E
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
|
||||
E += C.rating
|
||||
efficiency = E
|
||||
|
||||
/obj/machinery/telepad/attackby(obj/item/I, mob/user, params)
|
||||
if(default_deconstruction_screwdriver(user, "pad-idle-o", "pad-idle", I))
|
||||
return
|
||||
|
||||
if(panel_open)
|
||||
if(istype(I, /obj/item/device/multitool))
|
||||
var/obj/item/device/multitool/M = I
|
||||
M.buffer = src
|
||||
user << "<span class='caution'>You save the data in the [I.name]'s buffer.</span>"
|
||||
return 1
|
||||
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
if(default_deconstruction_crowbar(I))
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
//CARGO TELEPAD//
|
||||
/obj/machinery/telepad_cargo
|
||||
name = "cargo telepad"
|
||||
desc = "A telepad used by the Rapid Crate Sender."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "pad-idle"
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 20
|
||||
active_power_usage = 500
|
||||
var/stage = 0
|
||||
/obj/machinery/telepad_cargo/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
anchored = 0
|
||||
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
user << "<span class='caution'>\The [src] can now be moved.</span>"
|
||||
else if(!anchored)
|
||||
anchored = 1
|
||||
user << "<span class='caution'>\The [src] is now secured.</span>"
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(stage == 0)
|
||||
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "<span class='caution'>You unscrew the telepad's tracking beacon.</span>"
|
||||
stage = 1
|
||||
else if(stage == 1)
|
||||
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "<span class='caution'>You screw in the telepad's tracking beacon.</span>"
|
||||
stage = 0
|
||||
else if(istype(W, /obj/item/weapon/weldingtool) && stage == 1)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
|
||||
user << "<span class='notice'>You start disassembling [src]...</span>"
|
||||
if(do_after(user,20/WT.toolspeed, target = src))
|
||||
if(!WT.isOn())
|
||||
return
|
||||
user << "<span class='notice'>You disassemble [src].</span>"
|
||||
new /obj/item/stack/sheet/metal(get_turf(src))
|
||||
new /obj/item/stack/sheet/glass(get_turf(src))
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
///TELEPAD CALLER///
|
||||
/obj/item/device/telepad_beacon
|
||||
name = "telepad beacon"
|
||||
desc = "Use to warp in a cargo telepad."
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
icon_state = "beacon"
|
||||
item_state = "beacon"
|
||||
origin_tech = "bluespace=3"
|
||||
|
||||
/obj/item/device/telepad_beacon/attack_self(mob/user)
|
||||
if(user)
|
||||
user << "<span class='caution'>Locked In</span>"
|
||||
new /obj/machinery/telepad_cargo(user.loc)
|
||||
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
///HANDHELD TELEPAD USER///
|
||||
/obj/item/weapon/rcs
|
||||
name = "rapid-crate-sender (RCS)"
|
||||
desc = "Use this to send crates and closets to cargo telepads."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "rcs"
|
||||
flags = CONDUCT
|
||||
force = 10
|
||||
throwforce = 10
|
||||
throw_speed = 2
|
||||
throw_range = 5
|
||||
var/rcharges = 10
|
||||
var/obj/machinery/pad = null
|
||||
var/last_charge = 30
|
||||
var/mode = 0
|
||||
var/rand_x = 0
|
||||
var/rand_y = 0
|
||||
var/emagged = 0
|
||||
var/teleporting = 0
|
||||
|
||||
/obj/item/weapon/rcs/New()
|
||||
..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/weapon/rcs/examine(mob/user)
|
||||
..()
|
||||
user << "There are [rcharges] charge\s left."
|
||||
|
||||
/obj/item/weapon/rcs/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
/obj/item/weapon/rcs/process()
|
||||
if(rcharges > 10)
|
||||
rcharges = 10
|
||||
if(last_charge == 0)
|
||||
rcharges++
|
||||
last_charge = 30
|
||||
else
|
||||
last_charge--
|
||||
|
||||
/obj/item/weapon/rcs/attack_self(mob/user)
|
||||
if(emagged)
|
||||
if(mode == 0)
|
||||
mode = 1
|
||||
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
|
||||
user << "<span class='caution'>The telepad locator has become uncalibrated.</span>"
|
||||
else
|
||||
mode = 0
|
||||
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
|
||||
user << "<span class='caution'>You calibrate the telepad locator.</span>"
|
||||
|
||||
/obj/item/weapon/rcs/emag_act(mob/user)
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
user << "<span class='caution'>You emag the RCS. Click on it to toggle between modes.</span>"
|
||||
@@ -0,0 +1,373 @@
|
||||
/obj/machinery/computer/telescience
|
||||
name = "\improper Telepad Control Console"
|
||||
desc = "Used to teleport objects to and from the telescience telepad."
|
||||
icon_screen = "teleport"
|
||||
icon_keyboard = "teleport_key"
|
||||
circuit = /obj/item/weapon/circuitboard/computer/telesci_console
|
||||
var/sending = 1
|
||||
var/obj/machinery/telepad/telepad = null
|
||||
var/temp_msg = "Telescience control console initialized.<BR>Welcome."
|
||||
|
||||
// VARIABLES //
|
||||
var/teles_left // How many teleports left until it becomes uncalibrated
|
||||
var/datum/projectile_data/last_tele_data = null
|
||||
var/z_co = 1
|
||||
var/power_off
|
||||
var/rotation_off
|
||||
//var/angle_off
|
||||
var/last_target
|
||||
|
||||
var/rotation = 0
|
||||
var/angle = 45
|
||||
var/power = 5
|
||||
|
||||
// Based on the power used
|
||||
var/teleport_cooldown = 0 // every index requires a bluespace crystal
|
||||
var/list/power_options = list(5, 10, 20, 25, 30, 40, 50, 80, 100)
|
||||
var/teleporting = 0
|
||||
var/starting_crystals = 3
|
||||
var/max_crystals = 4
|
||||
var/list/crystals = list()
|
||||
var/obj/item/device/gps/inserted_gps
|
||||
|
||||
/obj/machinery/computer/telescience/New()
|
||||
..()
|
||||
recalibrate()
|
||||
|
||||
/obj/machinery/computer/telescience/Destroy()
|
||||
eject()
|
||||
if(inserted_gps)
|
||||
inserted_gps.loc = loc
|
||||
inserted_gps = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/telescience/examine(mob/user)
|
||||
..()
|
||||
user << "There are [crystals.len ? crystals.len : "no"] bluespace crystal\s in the crystal slots."
|
||||
|
||||
/obj/machinery/computer/telescience/initialize()
|
||||
..()
|
||||
for(var/i = 1; i <= starting_crystals; i++)
|
||||
crystals += new /obj/item/weapon/ore/bluespace_crystal/artificial(null) // starting crystals
|
||||
|
||||
/obj/machinery/computer/telescience/attack_paw(mob/user)
|
||||
user << "<span class='warning'>You are too primitive to use this computer!</span>"
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telescience/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weapon/ore/bluespace_crystal))
|
||||
if(crystals.len >= max_crystals)
|
||||
user << "<span class='warning'>There are not enough crystal slots.</span>"
|
||||
return
|
||||
if(!user.drop_item())
|
||||
return
|
||||
crystals += W
|
||||
W.loc = null
|
||||
user.visible_message("[user] inserts [W] into \the [src]'s crystal slot.", "<span class='notice'>You insert [W] into \the [src]'s crystal slot.</span>")
|
||||
updateDialog()
|
||||
else if(istype(W, /obj/item/device/gps))
|
||||
if(!inserted_gps)
|
||||
inserted_gps = W
|
||||
user.unEquip(W)
|
||||
W.loc = src
|
||||
user.visible_message("[user] inserts [W] into \the [src]'s GPS device slot.", "<span class='notice'>You insert [W] into \the [src]'s GPS device slot.</span>")
|
||||
else if(istype(W, /obj/item/device/multitool))
|
||||
var/obj/item/device/multitool/M = W
|
||||
if(M.buffer && istype(M.buffer, /obj/machinery/telepad))
|
||||
telepad = M.buffer
|
||||
M.buffer = null
|
||||
user << "<span class='caution'>You upload the data from the [W.name]'s buffer.</span>"
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/telescience/attack_ai(mob/user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/telescience/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/computer/telescience/interact(mob/user)
|
||||
var/t
|
||||
if(!telepad)
|
||||
in_use = 0 //Yeah so if you deconstruct teleporter while its in the process of shooting it wont disable the console
|
||||
t += "<div class='statusDisplay'>No telepad located. <BR>Please add telepad data.</div><BR>"
|
||||
else
|
||||
if(inserted_gps)
|
||||
t += "<A href='?src=\ref[src];ejectGPS=1'>Eject GPS</A>"
|
||||
t += "<A href='?src=\ref[src];setMemory=1'>Set GPS memory</A>"
|
||||
else
|
||||
t += "<span class='linkOff'>Eject GPS</span>"
|
||||
t += "<span class='linkOff'>Set GPS memory</span>"
|
||||
t += "<div class='statusDisplay'>[temp_msg]</div><BR>"
|
||||
t += "<A href='?src=\ref[src];setrotation=1'>Set Bearing</A>"
|
||||
t += "<div class='statusDisplay'>[rotation]°</div>"
|
||||
t += "<A href='?src=\ref[src];setangle=1'>Set Elevation</A>"
|
||||
t += "<div class='statusDisplay'>[angle]°</div>"
|
||||
t += "<span class='linkOn'>Set Power</span>"
|
||||
t += "<div class='statusDisplay'>"
|
||||
|
||||
for(var/i = 1; i <= power_options.len; i++)
|
||||
if(crystals.len + telepad.efficiency < i)
|
||||
t += "<span class='linkOff'>[power_options[i]]</span>"
|
||||
continue
|
||||
if(power == power_options[i])
|
||||
t += "<span class='linkOn'>[power_options[i]]</span>"
|
||||
continue
|
||||
t += "<A href='?src=\ref[src];setpower=[i]'>[power_options[i]]</A>"
|
||||
t += "</div>"
|
||||
|
||||
t += "<A href='?src=\ref[src];setz=1'>Set Sector</A>"
|
||||
t += "<div class='statusDisplay'>[z_co ? z_co : "NULL"]</div>"
|
||||
|
||||
t += "<BR><A href='?src=\ref[src];send=1'>Send</A>"
|
||||
t += " <A href='?src=\ref[src];receive=1'>Receive</A>"
|
||||
t += "<BR><A href='?src=\ref[src];recal=1'>Recalibrate Crystals</A> <A href='?src=\ref[src];eject=1'>Eject Crystals</A>"
|
||||
|
||||
// Information about the last teleport
|
||||
t += "<BR><div class='statusDisplay'>"
|
||||
if(!last_tele_data)
|
||||
t += "No teleport data found."
|
||||
else
|
||||
t += "Source Location: ([last_tele_data.src_x], [last_tele_data.src_y])<BR>"
|
||||
//t += "Distance: [round(last_tele_data.distance, 0.1)]m<BR>"
|
||||
t += "Time: [round(last_tele_data.time, 0.1)] secs<BR>"
|
||||
t += "</div>"
|
||||
|
||||
var/datum/browser/popup = new(user, "telesci", name, 300, 500)
|
||||
popup.set_content(t)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telescience/proc/sparks()
|
||||
if(telepad)
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(5, 1, get_turf(telepad))
|
||||
s.start()
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telescience/proc/telefail()
|
||||
sparks()
|
||||
visible_message("<span class='warning'>The telepad weakly fizzles.</span>")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telescience/proc/doteleport(mob/user)
|
||||
|
||||
if(teleport_cooldown > world.time)
|
||||
temp_msg = "Telepad is recharging power.<BR>Please wait [round((teleport_cooldown - world.time) / 10)] seconds."
|
||||
return
|
||||
|
||||
if(teleporting)
|
||||
temp_msg = "Telepad is in use.<BR>Please wait."
|
||||
return
|
||||
|
||||
if(telepad)
|
||||
|
||||
var/truePower = Clamp(power + power_off, 1, 1000)
|
||||
var/trueRotation = rotation + rotation_off
|
||||
var/trueAngle = Clamp(angle, 1, 90)
|
||||
|
||||
var/datum/projectile_data/proj_data = projectile_trajectory(telepad.x, telepad.y, trueRotation, trueAngle, truePower)
|
||||
last_tele_data = proj_data
|
||||
|
||||
var/trueX = Clamp(round(proj_data.dest_x, 1), 1, world.maxx)
|
||||
var/trueY = Clamp(round(proj_data.dest_y, 1), 1, world.maxy)
|
||||
var/spawn_time = round(proj_data.time) * 10
|
||||
|
||||
var/turf/target = locate(trueX, trueY, z_co)
|
||||
last_target = target
|
||||
var/area/A = get_area(target)
|
||||
flick("pad-beam", telepad)
|
||||
|
||||
if(spawn_time > 15) // 1.5 seconds
|
||||
playsound(telepad.loc, 'sound/weapons/flash.ogg', 25, 1)
|
||||
// Wait depending on the time the projectile took to get there
|
||||
teleporting = 1
|
||||
temp_msg = "Powering up bluespace crystals.<BR>Please wait."
|
||||
|
||||
|
||||
spawn(round(proj_data.time) * 10) // in seconds
|
||||
if(!telepad)
|
||||
return
|
||||
if(telepad.stat & NOPOWER)
|
||||
return
|
||||
teleporting = 0
|
||||
teleport_cooldown = world.time + (power * 2)
|
||||
teles_left -= 1
|
||||
|
||||
// use a lot of power
|
||||
use_power(power * 10)
|
||||
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(5, 1, get_turf(telepad))
|
||||
s.start()
|
||||
|
||||
temp_msg = "Teleport successful.<BR>"
|
||||
if(teles_left < 10)
|
||||
temp_msg += "<BR>Calibration required soon."
|
||||
else
|
||||
temp_msg += "Data printed below."
|
||||
|
||||
var/sparks = get_turf(target)
|
||||
var/datum/effect_system/spark_spread/y = new /datum/effect_system/spark_spread
|
||||
y.set_up(5, 1, sparks)
|
||||
y.start()
|
||||
|
||||
var/turf/source = target
|
||||
var/turf/dest = get_turf(telepad)
|
||||
var/log_msg = ""
|
||||
log_msg += ": [key_name(user)] has teleported "
|
||||
|
||||
if(sending)
|
||||
source = dest
|
||||
dest = target
|
||||
|
||||
flick("pad-beam", telepad)
|
||||
playsound(telepad.loc, 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff = 5)
|
||||
for(var/atom/movable/ROI in source)
|
||||
// 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
|
||||
|
||||
log_msg += "[key_name(L)] (on a chair), "
|
||||
else
|
||||
continue
|
||||
else if(!isobserver(ROI))
|
||||
continue
|
||||
if(ismob(ROI))
|
||||
var/mob/T = ROI
|
||||
log_msg += "[key_name(T)], "
|
||||
else
|
||||
log_msg += "[ROI.name]"
|
||||
if (istype(ROI, /obj/structure/closet))
|
||||
var/obj/structure/closet/C = ROI
|
||||
log_msg += " ("
|
||||
for(var/atom/movable/Q as mob|obj in C)
|
||||
if(ismob(Q))
|
||||
log_msg += "[key_name(Q)], "
|
||||
else
|
||||
log_msg += "[Q.name], "
|
||||
if (dd_hassuffix(log_msg, "("))
|
||||
log_msg += "empty)"
|
||||
else
|
||||
log_msg = dd_limittext(log_msg, length(log_msg) - 2)
|
||||
log_msg += ")"
|
||||
log_msg += ", "
|
||||
do_teleport(ROI, dest)
|
||||
|
||||
if (dd_hassuffix(log_msg, ", "))
|
||||
log_msg = dd_limittext(log_msg, length(log_msg) - 2)
|
||||
else
|
||||
log_msg += "nothing"
|
||||
log_msg += " [sending ? "to" : "from"] [trueX], [trueY], [z_co] ([A ? A.name : "null area"])"
|
||||
investigate_log(log_msg, "telesci")
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/telescience/proc/teleport(mob/user)
|
||||
if(rotation == null || angle == null || z_co == null)
|
||||
temp_msg = "ERROR!<BR>Set a angle, rotation and sector."
|
||||
return
|
||||
if(power <= 0)
|
||||
telefail()
|
||||
temp_msg = "ERROR!<BR>No power selected!"
|
||||
return
|
||||
if(angle < 1 || angle > 90)
|
||||
telefail()
|
||||
temp_msg = "ERROR!<BR>Elevation is less than 1 or greater than 90."
|
||||
return
|
||||
if(z_co == ZLEVEL_CENTCOM || z_co < 1 || z_co > ZLEVEL_SPACEMAX)
|
||||
telefail()
|
||||
temp_msg = "ERROR! Sector is outside known time and space!"
|
||||
return
|
||||
if(teles_left > 0)
|
||||
doteleport(user)
|
||||
else
|
||||
telefail()
|
||||
temp_msg = "ERROR!<BR>Calibration required."
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telescience/proc/eject()
|
||||
for(var/obj/item/I in crystals)
|
||||
I.loc = src.loc
|
||||
crystals -= I
|
||||
power = 0
|
||||
|
||||
/obj/machinery/computer/telescience/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(!telepad)
|
||||
updateDialog()
|
||||
return
|
||||
if(telepad.panel_open)
|
||||
temp_msg = "Telepad undergoing physical maintenance operations."
|
||||
|
||||
if(href_list["setrotation"])
|
||||
var/new_rot = input("Please input desired bearing in degrees.", name, rotation) as num
|
||||
if(..()) // Check after we input a value, as they could've moved after they entered something
|
||||
return
|
||||
rotation = Clamp(new_rot, -900, 900)
|
||||
rotation = round(rotation, 0.01)
|
||||
|
||||
if(href_list["setangle"])
|
||||
var/new_angle = input("Please input desired elevation in degrees.", name, angle) as num
|
||||
if(..())
|
||||
return
|
||||
angle = Clamp(round(new_angle, 0.1), 1, 9999)
|
||||
|
||||
if(href_list["setpower"])
|
||||
var/index = href_list["setpower"]
|
||||
index = text2num(index)
|
||||
if(index != null && power_options[index])
|
||||
if(crystals.len + telepad.efficiency >= index)
|
||||
power = power_options[index]
|
||||
|
||||
if(href_list["setz"])
|
||||
var/new_z = input("Please input desired sector.", name, z_co) as num
|
||||
if(..())
|
||||
return
|
||||
z_co = Clamp(round(new_z), 1, 10)
|
||||
|
||||
if(href_list["ejectGPS"])
|
||||
if(inserted_gps)
|
||||
inserted_gps.loc = loc
|
||||
inserted_gps = null
|
||||
|
||||
if(href_list["setMemory"])
|
||||
if(last_target && inserted_gps)
|
||||
inserted_gps.locked_location = last_target
|
||||
temp_msg = "Location saved."
|
||||
else
|
||||
temp_msg = "ERROR!<BR>No data was stored."
|
||||
|
||||
if(href_list["send"])
|
||||
sending = 1
|
||||
teleport(usr)
|
||||
|
||||
if(href_list["receive"])
|
||||
sending = 0
|
||||
teleport(usr)
|
||||
|
||||
if(href_list["recal"])
|
||||
recalibrate()
|
||||
sparks()
|
||||
temp_msg = "NOTICE:<BR>Calibration successful."
|
||||
|
||||
if(href_list["eject"])
|
||||
eject()
|
||||
temp_msg = "NOTICE:<BR>Bluespace crystals ejected."
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/telescience/proc/recalibrate()
|
||||
teles_left = rand(30, 40)
|
||||
//angle_off = rand(-25, 25)
|
||||
power_off = rand(-4, 0)
|
||||
rotation_off = rand(-10, 10)
|
||||
Reference in New Issue
Block a user