Merge pull request #63 from Markolie/master

Bug fixes, /tg/ telescience port
This commit is contained in:
Fox-McCloud
2014-12-12 03:41:03 -05:00
26 changed files with 769 additions and 724 deletions
+2 -1
View File
@@ -92,7 +92,8 @@
/atom/proc/emp_act(var/severity)
return
/atom/proc/bullet_act(var/obj/item/projectile/Proj)
/atom/proc/bullet_act(var/obj/item/projectile/Proj, def_zone)
Proj.on_hit(src, 0, def_zone)
return 0
/atom/proc/in_contents_of(container)//can take class or object instance as argument
+12 -12
View File
@@ -423,20 +423,20 @@
var/reagent_id = null
if(emagged == 2) //Emagged! Time to poison everybody.
reagent_id = "toxin"
if(treat_virus)
var/virus = 0
if(C:virus2.len)
for (var/ID in C.virus2)
if (ID in virusDB) // If the virus is known, the medbot is aware of it and will try to cure it
virus = 1
if (!reagent_id && (virus))
if(!C.reagents.has_reagent(treatment_virus))
reagent_id = treatment_virus
reagent_id = "toxin"
else
if(treat_virus)
var/virus = 0
if(C:virus2.len)
for (var/ID in C.virus2)
if (ID in virusDB) // If the virus is known, the medbot is aware of it and will try to cure it
virus = 1
if (!reagent_id && (virus))
if(!C.reagents.has_reagent(treatment_virus))
reagent_id = treatment_virus
if (!reagent_id && (C.getBruteLoss() >= heal_threshold))
if(!C.reagents.has_reagent(treatment_brute))
reagent_id = treatment_brute
-315
View File
@@ -1,315 +0,0 @@
/obj/machinery/computer/telescience
name = "Telepad Control Console"
desc = "Used to teleport objects to and from the telescience telepad."
icon_state = "teleport-sci"
circuit = "/obj/item/weapon/circuitboard/telesci_console"
var/teles_left // How many teleports left until it becomes uncalibrated
var/x_off // X offset
var/y_off // Y offset
var/x_co // X coordinate
var/y_co // Y coordinate
var/z_co // Z coordinate
var/trueX // X + offset
var/trueY // Y + offset
var/obj/machinery/telepad/telepad
var/tele_id = "Telesci"
var/obj/item/device/sps/inserted_sps
var/last_target
/obj/machinery/computer/telescience/update_icon()
if(stat & BROKEN)
icon_state = "telescib"
else
if(stat & NOPOWER)
src.icon_state = "teleport0"
stat |= NOPOWER
else
icon_state = initial(icon_state)
stat &= ~NOPOWER
/obj/machinery/computer/telescience/Destroy()
if(inserted_sps)
inserted_sps.loc = loc
inserted_sps = null
..()
/obj/machinery/computer/telescience/attack_paw(mob/user)
usr << "You are too primitive to use this computer."
return
/obj/machinery/telescience/station/attack_ai(mob/user)
src.attack_hand()
/obj/machinery/computer/telescience/attack_hand(mob/user)
ui_interact(user)
/obj/machinery/computer/telescience/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
if(..())
return
if(stat & (NOPOWER|BROKEN))
return
// On first use, the coordinates are null. Rather than displaying null, we'll set them to unset.
if(!x_co)
x_co = "Unset"
if(!y_co)
y_co = "Unset"
if(!z_co)
z_co = "Unset"
var/data[0]
data["coordx"] = x_co
data["coordy"] = y_co
data["coordz"] = z_co
data["sps"] = inserted_sps
// Set up the Nano UI
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "telescience_console.tmpl", "Telescience Console UI", 640, 300)
ui.set_initial_data(data)
ui.open()
/obj/machinery/computer/telescience/proc/telefail(var/level)
var/teleturf = get_turf(telepad)
switch(level)
if(1)
for(var/mob/O in hearers(telepad, null))
O.show_message("\red The telepad weakly fizzles.", 2)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, teleturf)
s.start()
if(2)
for(var/mob/living/carbon/human/M in viewers(telepad, null))
if(M.loc.loc == telepad.loc.loc) // Stops the geneticists with X-Ray vision getting irradiated
M.apply_effect((rand(50, 100)), IRRADIATE, 0)
M << "\red You feel irradiated."
if(3)
for(var/turf/simulated/floor/target_tile in range(0,telepad))
var/datum/gas_mixture/napalm = new
napalm.toxins = 25
napalm.temperature = 2000
target_tile.assume_air(napalm)
spawn (0) target_tile.hotspot_expose(700, 400)
for(var/mob/O in hearers(telepad, null))
O.show_message("\red The telepad sets on fire!", 2)
if(4)
var/blocked = list(/mob/living/simple_animal/hostile,
/mob/living/simple_animal/hostile/alien/queen/large,
/mob/living/simple_animal/hostile/pirate,
/mob/living/simple_animal/hostile/pirate/ranged,
/mob/living/simple_animal/hostile/russian,
/mob/living/simple_animal/hostile/russian/ranged,
/mob/living/simple_animal/hostile/syndicate,
/mob/living/simple_animal/hostile/syndicate/melee,
/mob/living/simple_animal/hostile/syndicate/melee/space,
/mob/living/simple_animal/hostile/syndicate/ranged,
/mob/living/simple_animal/hostile/syndicate/ranged/space,
/mob/living/simple_animal/hostile/retaliate,
/mob/living/simple_animal/hostile/giant_spider/nurse)
var/list/hostiles = typesof(/mob/living/simple_animal/hostile) - blocked
playsound(teleturf, 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/human/M in viewers(telepad, null))
flick("e_flash", M.flash)
var/chosen = pick(hostiles)
var/mob/living/simple_animal/hostile/H = new chosen
H.loc = teleturf
return
/obj/machinery/computer/telescience/proc/teleprep(var/type)
if(!telepad)
usr << "\red Error: No associated telepad. Please recalibrate and try again."
return
if(telepad.panel_open)
usr << "\red Error: The telepad can not be used while in maintenance mode."
return
var/numpick
var/failure = checkFail()
if(failure > 0)
numpick = pick(1,1,1,1,1,2,2,2,2,3)
telefail(numpick)
return
if(teles_left > 0)
if(prob(70 + (5 * telepad.efficiency)))
teles_left -= 1
tele(type)
if(teles_left == 0)
for(var/mob/O in hearers(src, null))
O.show_message("\red The telepad has become uncalibrated.", 2)
return
else
if(prob(25 + (10 * telepad.efficiency)))
tele(type)
else
numpick = pick(1,1,1,2,2,3,4)
telefail(numpick)
return
numpick = pick(1,1,1,1,1,2,2,2,2,3)
telefail(numpick)
return
/obj/machinery/computer/telescience/proc/tele(var/type)
var/tele = get_turf(telepad)
trueX = (x_co + x_off)
trueY = (y_co + y_off)
var/target = locate(trueX, trueY, z_co)
last_target = target
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, tele)
s.start()
flick("pad-beam", telepad)
var/list/teleportables = list()
switch(type)
if(0)
for(var/atom/A in tele)
if(!istype(A, /obj/effect) && !istype(A, /mob/living/silicon/ai) && !istype(A, /obj/item/device/radio/intercom) && !istype(A, /obj/structure/closet/secure_closet/brig))
if(istype(A, /obj/structure))
var/obj/structure/S = A
if(!S.anchored)
teleportables += S
else if(istype(A, /obj/machinery))
var/obj/machinery/M = A
if(!M.anchored)
teleportables += M
else
teleportables += A
for(var/atom/T in teleportables)
do_teleport(T, target, 0)
usr << "\blue Teleport successful."
if(1)
for(var/atom/A in target)
if(!istype(A, /obj/effect) && !istype(A, /mob/living/silicon/ai) && !istype(A, /obj/item/device/radio/intercom))
if(istype(A, /obj/structure))
var/obj/structure/S = A
if(!S.anchored)
teleportables += S
else if(istype(A, /obj/machinery))
var/obj/machinery/M = A
if(!M.anchored)
teleportables += M
else
teleportables += A
for(var/atom/T in teleportables)
do_teleport(T, tele, 0)
usr << "\blue Teleport successful."
return
/obj/machinery/computer/telescience/proc/checkFail()
var/fail = 0
if(x_co == "" || x_co == "Unset")
usr << "\red Error: set X coordinate."
fail = 1
return fail
if(y_co == "" || y_co == "Unset")
usr << "\red Error: set Y coordinate."
fail = 1
return fail
if(z_co == "" || z_co == "Unset")
usr << "\red Error: set Z coordinate."
fail = 1
return fail
if(x_co < 11 || x_co > 245)
usr << "\red Error: X is less than 11 or greater than 245."
fail = 1
return fail
if(y_co < 11 || y_co > 245)
usr << "\red Error: Y is less than 11 or greater than 245."
fail = 1
return fail
if(z_co == 2 || z_co < 1 || z_co > 6)
if (z_co == 7 & src.emagged == 1)
// This should be empty, allows for it to continue if the z-level is 7 and the machine is emagged.
else
usr << "\red Error: Z is less than 1, greater than [src.emagged ? "7" : "6"], or equal to 2."
fail = 1
return fail
if(istype(get_area(locate(x_co,y_co,z_co)), /area/security/armoury/gamma))
usr << "\red Error: Attempting to access telescience-protected area."
fail = 1
return fail
return fail
/obj/machinery/computer/telescience/Topic(href, href_list)
if(..())
return
if(href_list["ejectSPS"])
inserted_sps.loc = loc
inserted_sps = null
nanomanager.update_uis(src)
if(href_list["setMemory"])
if(last_target)
inserted_sps.locked_location = last_target
usr << "\blue Location saved."
else
usr << "\red Error: No data stored."
nanomanager.update_uis(src)
if(href_list["setx"])
var/a = input("Please input desired X coordinate.", name, x_co) as num
a = copytext(sanitize(a), 1, 20)
x_co = a
x_co = text2num(x_co)
nanomanager.update_uis(src)
return
if(href_list["sety"])
var/b = input("Please input desired Y coordinate.", name, y_co) as num
b = copytext(sanitize(b), 1, 20)
y_co = b
y_co = text2num(y_co)
nanomanager.update_uis(src)
return
if(href_list["setz"])
var/c = input("Please input desired Z coordinate.", name, z_co) as num
c = copytext(sanitize(c), 1, 20)
z_co = c
z_co = text2num(z_co)
nanomanager.update_uis(src)
return
if(href_list["send"])
teleprep(0)
nanomanager.update_uis(src)
return
if(href_list["receive"])
teleprep(1)
nanomanager.update_uis(src)
return
if(href_list["recal"])
if(telepad == null)
for(var/obj/machinery/telepad/T in range(src,10))
telepad = T
if(!telepad)
usr << "\red Error: No telepads in range were found."
nanomanager.update_uis(src)
return
var/teleturf = get_turf(telepad)
teles_left = rand(8,12)
x_off = rand(-10,10)
y_off = rand(-10,10)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, teleturf)
s.start()
usr << "\blue Calibration successful."
nanomanager.update_uis(src)
return
/obj/machinery/computer/telescience/attackby(I as obj, var/mob/user as mob) // Emagging
if(istype(I,/obj/item/weapon/card/emag))
if (src.emagged == 0)
user << "\blue You scramble the Telescience authentication key to an unknown signal. You should be able to teleport to more places now!"
src.emagged = 1
else
user << "\red The machine seems unaffected by the card swipe..."
else if(istype(I, /obj/item/device/sps))
if(!inserted_sps)
inserted_sps = I
user.before_take_item(I)
inserted_sps.loc = src
user.visible_message("<span class='notice'>You insert [I] into the SPS device slot.</span>")
attack_hand(user)
else if(istype(I, /obj/item/device/multitool))
var/obj/item/device/multitool/M = I
if(M.buffer && istype(M.buffer, /obj/machinery/telepad))
telepad = M.buffer
M.buffer = null
user << "<span class='caution'>You upload the data from [I]'s buffer.</span>"
else
..()
+2 -2
View File
@@ -132,9 +132,9 @@
o += "<span class='warning'>"
else
o += "<span style='color:blue'>"
o += "[celsius]Celsius</span> "
o += "[celsius] Celsius</span> "
o += "<span style='color:blue'>"
o += "[pressure]kPa</span></li>"
o += "[pressure] kPa</span></li>"
usr << o
if( islist(users_to_open) && users_to_open.len)
-78
View File
@@ -1,78 +0,0 @@
/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 = 2
active_power_usage = 50
var/efficiency
/obj/machinery/telepad/New()
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/telesci_pad(src)
component_parts += new /obj/item/bluespace_crystal/artificial(src)
component_parts += new /obj/item/bluespace_crystal/artificial(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
component_parts += new /obj/item/stack/cable_coil(src, 1)
RefreshParts()
/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)
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>"
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(I)
/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 = 2
active_power_usage = 50
var/stage = 0
/obj/machinery/telepad_cargo/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
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>"
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
if(istype(W, /obj/item/weapon/weldingtool) && stage == 1)
playsound(src, 'sound/items/Welder.ogg', 50, 1)
user << "<span class='caution'>You disassemble the telepad.</span>"
new /obj/item/stack/sheet/metal(get_turf(src))
new /obj/item/stack/sheet/glass(get_turf(src))
qdel(src)
+5 -5
View File
@@ -3,7 +3,7 @@
desc = "Used to control a linked teleportation Hub and Station."
icon_state = "teleport"
circuit = "/obj/item/weapon/circuitboard/teleporter"
var/obj/item/device/sps/locked = null
var/obj/item/device/gps/locked = null
var/regime_set = "Teleporter"
var/id = null
var/obj/machinery/teleport/station/power_station
@@ -40,16 +40,16 @@
user << "\blue The teleporter can now lock on to Syndicate beacons!"
else
ui_interact(user)
else if(istype(I, /obj/item/device/sps))
var/obj/item/device/sps/L = I
else if(istype(I, /obj/item/device/gps))
var/obj/item/device/gps/L = I
if(L.locked_location && !(stat & (NOPOWER|BROKEN)))
user.before_take_item(L)
L.loc = src
locked = L
user << "<span class='caution'>You insert the SPS device into the [name]'s slot.</span>"
user << "<span class='caution'>You insert the GPS device into the [name]'s slot.</span>"
src.attack_hand(user)
else
user << "<span class='warning'>No useable data was found on te SPS device.</span>"
user << "<span class='warning'>No useable data was found on te GPS device.</span>"
else
..()
return
+16 -3
View File
@@ -190,6 +190,13 @@
targeting_active = 1
target()
targeting_active = 0
if(prob(15))
if(prob(50))
playsound(get_turf(src), 'sound/effects/turret/move1.wav', 60, 1)
else
playsound(get_turf(src), 'sound/effects/turret/move2.wav', 60, 1)
else if(!isPopping())//else, pop down
if(!isDown())
popDown()
@@ -229,6 +236,10 @@
else
A = new /obj/item/projectile/energy/electrode( loc )
use_power(200)
if(src.lasers)
playsound(get_turf(src), 'sound/weapons/Laser.ogg', 60, 1)
else
playsound(get_turf(src), 'sound/weapons/Taser.ogg', 60, 1)
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x
@@ -244,6 +255,7 @@
if ((!isPopping()) || src.popping==-1)
invisibility = 0
popping = 1
playsound(get_turf(src), 'sound/effects/turret/open.wav', 60, 1)
if (src.cover!=null)
flick("popup", src.cover)
src.cover.icon_state = "openTurretCover"
@@ -253,6 +265,7 @@
/obj/machinery/turret/proc/popDown()
if ((!isPopping()) || src.popping==1)
popping = -1
playsound(get_turf(src), 'sound/effects/turret/open.wav', 60, 1)
if (src.cover!=null)
flick("popdown", src.cover)
src.cover.icon_state = "turretCover"
@@ -272,7 +285,7 @@
/obj/machinery/turret/attackby(obj/item/weapon/W, mob/user)//I can't believe no one added this before/N
..()
playsound(src.loc, 'sound/weapons/smash.ogg', 60, 1)
playsound(get_turf(src), 'sound/weapons/smash.ogg', 60, 1)
src.spark_system.start()
src.health -= W.force * 0.5
if (src.health <= 0)
@@ -422,7 +435,7 @@
/obj/machinery/turret/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
if(!(stat & BROKEN))
playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1)
playsound(get_turf(src), 'sound/weapons/slash.ogg', 25, 1, -1)
visible_message("\red <B>[] has slashed at []!</B>", M, src)
src.health -= 15
if (src.health <= 0)
@@ -609,7 +622,7 @@
return
if (targloc == curloc)
return
playsound(src, 'sound/weapons/Gunshot.ogg', 50, 1)
playsound(get_turf(src), 'sound/weapons/Gunshot.ogg', 60, 1)
var/obj/item/projectile/A = new /obj/item/projectile/bullet(curloc)
A.current = curloc
A.yo = targloc.y - curloc.y
-84
View File
@@ -1,84 +0,0 @@
var/list/sps_list = list()
/obj/item/device/sps
name = "space positioning system"
desc = "Helping lost spacemen find their way through the planets since 2016."
icon = 'icons/obj/telescience.dmi'
icon_state = "gps-c"
w_class = 2.0
slot_flags = SLOT_BELT
origin_tech = "materials=2;magnets=3;bluespace=2"
var/spstag = "COM0"
var/emped = 0
var/turf/locked_location
/obj/item/device/sps/New()
..()
sps_list.Add(src)
name = "space positioning system ([spstag])"
overlays += "working"
/obj/item/device/sps/Destroy()
sps_list.Remove(src)
..()
/obj/item/device/sps/emp_act(severity)
emped = 1
overlays -= "working"
overlays += "emp"
spawn(300)
emped = 0
overlays -= "emp"
overlays += "working"
/obj/item/device/sps/attack_self(mob/user as mob)
var/obj/item/device/sps/t = ""
var/sps_window_height = 110 + sps_list.len * 20 // Variable window height, depending on how many sps units there are to show
if(emped)
t += "ERROR"
else
t += "<A href='?src=\ref[src];tag=1'>Set Tag</A><A href='?src=\ref[src];refresh=1'>Refresh</A>"
t += "<BR>Tag: [spstag]"
if(locked_location && locked_location.loc)
t += "<BR>Bluespace coordinates saved: [locked_location.loc]"
sps_window_height += 20
for(var/obj/item/device/sps/G in sps_list)
var/turf/pos = get_turf(G)
var/area/sps_area = get_area(G)
var/tracked_spstag = G.spstag
if(G.emped == 1)
t += "<BR>[tracked_spstag]: ERROR"
else
t += "<BR>[tracked_spstag]: [format_text(sps_area.name)] ([pos.x], [pos.y], [pos.z])"
var/datum/browser/popup = new(user, "sps", name, 360, min(sps_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/sps/Topic(href, href_list)
..()
if(href_list["tag"] )
var/a = input("Please enter desired tag.", name, spstag) as text
a = uppertext(copytext(sanitize(a), 1, 5))
if(src.loc == usr)
spstag = a
name = "space positioning system ([spstag])"
attack_self(usr)
if(href_list["refresh"] )
if(src.loc == usr)
attack_self(usr)
/obj/item/device/sps/science
icon_state = "gps-s"
spstag = "SCI0"
/obj/item/device/sps/engineering
icon_state = "gps-e"
spstag = "ENG0"
/obj/item/device/sps/mining
icon_state = "gps-m"
spstag = "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."
@@ -4,7 +4,7 @@
icon_state = "intercom"
anchored = 1
w_class = 4.0
canhear_range = 2
canhear_range = 5
flags = FPRINT | CONDUCT | TABLEPASS | NOBLOODY
var/number = 0
var/anyai = 1
-59
View File
@@ -1,59 +0,0 @@
/obj/item/weapon/rcs
name = "rapid-crate-sender (RCS)"
desc = "Use this to send crates and closets to cargo telepads."
icon = 'icons/obj/items.dmi'
icon_state = "rcs"
opacity = 0
density = 0
anchored = 0.0
flags = FPRINT | CONDUCT
force = 10.0
throwforce = 10.0
throw_speed = 1
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()
processing_objects.Add(src)
desc = "Use this to send crates and closets to cargo telepads. There are [rcharges] charges left."
/obj/item/weapon/rcs/Destroy()
processing_objects.Remove(src)
..()
/obj/item/weapon/rcs/process()
if(rcharges > 10)
rcharges = 10
if(last_charge == 0)
rcharges++
desc = "Use this to send crates and closets to cargo telepads. There are [rcharges] charges left."
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 << "\red The telepad locator has become uncalibrated."
else
mode = 0
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
user << "\blue You calibrate the telepad locator."
/obj/item/weapon/rcs/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/emag) && emagged == 0)
emagged = 1
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
user << "\red You emag the RCS. Click on it to toggle between modes."
return
-6
View File
@@ -487,12 +487,6 @@
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
H.updatehealth()
if(istype(M,/mob/living/carbon/human/machine) && M.stat == 0) // If an IPC is brought back to life by welding it, which is possible, update the mob list
if(M in dead_mob_list)
dead_mob_list -= M
respawnable_list -= M
living_mob_list += M
mob_list += M
return
else
user << "\red You need more welding fuel to complete this task."
@@ -18,8 +18,11 @@
if (!H.amputated)
if ((health >= (config.health_threshold_dead/100*75)) && stat == DEAD) //need to get them 25% away from death point before reviving them
dead_mob_list -= src
respawnable_list -= src
living_mob_list += src
mob_list += src
stat = CONSCIOUS
ear_deaf = 0
return
/mob/living/carbon/human/getBrainLoss()
+4 -2
View File
@@ -1292,7 +1292,9 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
see_invisible = SEE_INVISIBLE_LIVING
seer = 0
var/tmp/has_ninja_mask = 0
if(istype(wear_mask, /obj/item/clothing/mask/gas/voice/space_ninja))
has_ninja_mask = 1
var/obj/item/clothing/mask/gas/voice/space_ninja/O = wear_mask
switch(O.mode)
if(0)
@@ -1305,7 +1307,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
if(!druggy) see_invisible = SEE_INVISIBLE_LIVING
if(1)
see_in_dark = 5
if(!druggy) see_invisible = SEE_INVISIBLE_LIVING
if(!druggy) see_invisible = SEE_INVISIBLE_MINIMUM
if(2)
sight |= SEE_MOBS
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
@@ -1340,7 +1342,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
see_invisible = SEE_INVISIBLE_LIVING
if(istype(O,/obj/item/clothing/glasses/hud/security/night) || istype(O,/obj/item/clothing/glasses/hud/health/night))
see_invisible = SEE_INVISIBLE_MINIMUM
else if(!seer)
else if(!seer && !has_ninja_mask)
see_in_dark = species.darksight
see_invisible = SEE_INVISIBLE_LIVING
-6
View File
@@ -633,12 +633,6 @@ obj/structure/cable/proc/cableColor(var/colorC)
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
H.updatehealth()
if(istype(M,/mob/living/carbon/human/machine) && M.stat == 0) // If an IPC is brought back to life by welding it, which is possible, update the mob list
if(M in dead_mob_list)
dead_mob_list -= M
respawnable_list -= M
living_mob_list += M
mob_list += M
return
else
user << "Nothing to fix!"
+7 -10
View File
@@ -51,6 +51,7 @@
var/drowsy = 0
var/agony = 0
var/embed = 0 // whether or not the projectile can embed itself in the mob
var/forcedodge = 0
proc/delete()
@@ -82,9 +83,8 @@
loc = A.loc
return 0 //cannot shoot yourself
if(bumped) return 0
var/forcedodge = 0 // force the projectile to pass
if(bumped)
return 1
bumped = 1
if(firer && istype(A, /mob))
var/mob/M = A
@@ -137,14 +137,11 @@
spawn(0)
if(A)
if(!forcedodge)
forcedodge = A.bullet_act(src, def_zone) // searches for return value
if(forcedodge == -1) // the bullet passes through a dense object!
var/turf/new_loc = get_turf(A)
var/permutation = A.bullet_act(src, def_zone) // searches for return value, could be deleted after run so check A isn't null
if(permutation == -1 || forcedodge)// the bullet passes through a dense object!
bumped = 0 // reset bumped variable!
if(istype(A, /turf))
loc = A
else
loc = A.loc
loc = new_loc
permutated.Add(A)
return 0
if(istype(A,/turf))
@@ -42,6 +42,7 @@
icon_state = "xray"
damage = 15
irradiate = 30
forcedodge = 1
/obj/item/projectile/beam/pulse
name = "pulse"
+4 -4
View File
@@ -2123,14 +2123,14 @@ datum/design/bluespace_crystal
reliability_base = 100
build_path = "/obj/item/bluespace_crystal/artificial"
datum/design/telesci_sps
name = "SPS Device"
datum/design/telesci_gps
name = "GPS Device"
desc = "A device that can track its position at all times."
id = "telesci_sps"
id = "telesci_Gps"
req_tech = list("materials" = 2, "magnets" = 3, "bluespace" = 3)
build_type = PROTOLATHE
materials = list("$metal" = 500, "$glass" = 1000)
build_path = /obj/item/device/sps
build_path = /obj/item/device/gps
/////////////////////////////////////////
/////////////////HUDs////////////////////
@@ -2,18 +2,6 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Miscellaneous xenoarchaeology tools
/obj/item/device/gps
name = "relay positioning device"
desc = "Triangulates the approximate co-ordinates using a nearby satellite network."
icon = 'icons/obj/device.dmi'
icon_state = "locator"
item_state = "locator"
w_class = 2
/obj/item/device/gps/attack_self(var/mob/user as mob)
var/turf/T = get_turf(src)
user << "\blue \icon[src] [src] flashes <i>[T.x].[rand(0,9)]:[T.y].[rand(0,9)]:[T.z].[rand(0,9)]</i>."
/obj/item/device/measuring_tape
name = "measuring tape"
desc = "A coiled metallic tape used to check dimensions and lengths."
+81
View File
@@ -0,0 +1,81 @@
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."
icon = 'icons/obj/telescience.dmi'
icon_state = "gps-c"
w_class = 2.0
slot_flags = SLOT_BELT
origin_tech = "programming=2;engineering=2"
var/gpstag = "COM0"
var/emped = 0
var/turf/locked_location
/obj/item/device/gps/New()
..()
GPS_list.Add(src)
name = "global positioning system ([gpstag])"
overlays += "working"
/obj/item/device/gps/Destroy()
GPS_list.Remove(src)
..()
/obj/item/device/gps/emp_act(severity)
emped = 1
overlays -= "working"
overlays += "emp"
spawn(300)
emped = 0
overlays -= "emp"
overlays += "working"
/obj/item/device/gps/attack_self(mob/user as mob)
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
t += "<BR>[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])"
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(src.loc == 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."
+158
View File
@@ -0,0 +1,158 @@
///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()
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/telesci_pad(null)
component_parts += new /obj/item/bluespace_crystal/artificial(null)
component_parts += new /obj/item/bluespace_crystal/artificial(null)
component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
component_parts += new /obj/item/stack/cable_coil(null, 1)
RefreshParts()
/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)
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>"
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(I)
//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 as obj, mob/user as mob)
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>"
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
if(istype(W, /obj/item/weapon/weldingtool) && stage == 1)
playsound(src, 'sound/items/Welder.ogg', 50, 1)
user << "<span class = 'caution'> You disassemble the telepad.</span>"
new /obj/item/stack/sheet/metal(get_turf(src))
new /obj/item/stack/sheet/glass(get_turf(src))
qdel(src)
///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 = "signaler"
origin_tech = "bluespace=3"
/obj/item/device/telepad_beacon/attack_self(mob/user as mob)
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.0
throwforce = 10.0
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()
..()
processing_objects.Add(src)
/obj/item/weapon/rcs/examine(mob/user)
..()
user << "There are [rcharges] charge\s left."
/obj/item/weapon/rcs/Destroy()
processing_objects.Remove(src)
..()
/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/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/emag) && emagged == 0)
emagged = 1
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/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>"
return
+383
View File
@@ -0,0 +1,383 @@
/obj/machinery/computer/telescience
name = "\improper Telepad Control Console"
desc = "Used to teleport objects to and from the telescience telepad."
icon_state = "teleport"
circuit = /obj/item/weapon/circuitboard/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
..()
/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/bluespace_crystal/artificial(null) // starting crystals
/obj/machinery/computer/telescience/attack_paw(mob/user)
user << "You are too primitive to use this computer."
return
/obj/machinery/computer/telescience/attackby(obj/item/W, mob/user)
if(istype(W,/obj/item/weapon/card/emag))
if (emagged == 0)
user << "\blue You scramble the Telescience authentication key to an unknown signal. You should be able to teleport to more places now!"
emagged = 1
else
user << "\red The machine seems unaffected by the card swipe..."
if(istype(W, /obj/item/bluespace_crystal))
if(crystals.len >= max_crystals)
user << "<span class='warning'>There are not enough crystal slots.</span>"
return
user.drop_item()
crystals += W
W.loc = null
user.visible_message("<span class='notice'>[user] inserts [W] into \the [src]'s crystal slot.</span>")
updateUsrDialog()
else if(istype(W, /obj/item/device/gps))
if(!inserted_gps)
inserted_gps = W
user.before_take_item(W)
W.loc = src
user.visible_message("<span class='notice'>[user] inserts [W] into \the [src]'s GPS device slot.</span>")
updateUsrDialog()
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>"
updateUsrDialog()
else
..()
/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)
user.set_machine(src)
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] degrees</div>"
t += "<A href='?src=\ref[src];setangle=1'>Set Elevation</A>"
t += "<div class='statusDisplay'>[angle] degrees</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/effect/system/spark_spread/s = new /datum/effect/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/effect/system/spark_spread/s = new /datum/effect/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/effect/system/spark_spread/y = new /datum/effect/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")
updateUsrDialog()
/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 == 2 || z_co < 1 || z_co > 6)
if (z_co == 7 & emagged == 1)
// This should be empty, allows for it to continue if the z-level is 7 and the machine is emagged.
else
telefail()
temp_msg = "ERROR! Sector is less than 1, <BR>greater than [src.emagged ? "7" : "6"], or equal to 2."
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)
updateUsrDialog()
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."
updateUsrDialog()
/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)