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
@@ -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."
+36
View File
@@ -0,0 +1,36 @@
// Bluespace crystals, used in telescience and when crushed it will blink you to a random turf.
/obj/item/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=4;materials=3"
var/blink_range = 8 // The teleport range when crushed/thrown at someone.
/obj/item/bluespace_crystal/New()
..()
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/item/bluespace_crystal/attack_self(var/mob/user)
blink_mob(user)
user.drop_item()
user.visible_message("<span class='notice'>[user] crushes the [src]!</span>")
qdel(src)
/obj/item/bluespace_crystal/proc/blink_mob(var/mob/living/L)
do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg')
/obj/item/bluespace_crystal/throw_impact(atom/hit_atom)
..()
if(isliving(hit_atom))
blink_mob(hit_atom)
qdel(src)
// Artifical bluespace crystal, doesn't give you much research.
/obj/item/bluespace_crystal/artificial
name = "artificial bluespace crystal"
desc = "An artificially made bluespace crystal, it looks delicate."
origin_tech = "bluespace=2"
blink_range = 4 // Not as good as the organic stuff!
+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)