mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 22:42:26 +01:00
Teleport pads are now controlled directly by the teleport control computer program.
Replaces all teleport stations with modular computers with that program.
This commit is contained in:
@@ -49,8 +49,8 @@
|
||||
// Now you can click through portals, wormholes, gateways, and teleporters while observing. -Sayu
|
||||
|
||||
/obj/machinery/teleport/pad/attack_ghost(mob/user as mob)
|
||||
if(station?.locked_obj)
|
||||
var/obj/teleport_obj = station.locked_obj.resolve()
|
||||
if(locked_obj)
|
||||
var/obj/teleport_obj = locked_obj.resolve()
|
||||
if(teleport_obj)
|
||||
user.forceMove(get_turf(teleport_obj))
|
||||
|
||||
|
||||
@@ -12,43 +12,51 @@
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 2000
|
||||
|
||||
var/obj/machinery/teleport/station/station
|
||||
light_color = "#02d1c7"
|
||||
|
||||
var/datum/weakref/locked_obj
|
||||
var/locked_obj_name
|
||||
|
||||
var/max_teleport_range = 4 //max overmap teleport distance
|
||||
var/calibration = 0 // a percentage chance for teleporting into space instead of your target. 0 is perfectly calibrated, 100 is totally uncalibrated
|
||||
var/engaged = FALSE
|
||||
|
||||
/obj/machinery/teleport/pad/Initialize()
|
||||
. = ..()
|
||||
find_station()
|
||||
queue_icon_update()
|
||||
|
||||
/obj/machinery/teleport/pad/proc/find_station()
|
||||
station = locate() in range(2, src)
|
||||
|
||||
/obj/machinery/teleport/pad/Destroy()
|
||||
station = null
|
||||
return ..()
|
||||
/obj/machinery/teleport/pad/machinery_process()
|
||||
var/old_engaged = engaged
|
||||
if(locked_obj)
|
||||
if(stat & (NOPOWER|BROKEN) || !within_range(locked_obj))
|
||||
engaged = FALSE
|
||||
else
|
||||
engaged = TRUE
|
||||
if(old_engaged != engaged)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/teleport/pad/CollidedWith(M as mob|obj)
|
||||
if(station?.engaged)
|
||||
if(engaged)
|
||||
teleport(M)
|
||||
use_power(5000)
|
||||
|
||||
/obj/machinery/teleport/pad/proc/teleport(atom/movable/M as mob|obj)
|
||||
if(!station.locked_obj)
|
||||
if(!locked_obj)
|
||||
audible_message(SPAN_WARNING("Failure: Cannot authenticate locked on coordinates. Please reinstate coordinate matrix."))
|
||||
var/obj/teleport_obj = station.locked_obj.resolve()
|
||||
var/obj/teleport_obj = locked_obj.resolve()
|
||||
if(!teleport_obj)
|
||||
station.locked_obj = null
|
||||
locked_obj = null
|
||||
return
|
||||
if(prob(station.calibration)) //oh dear a problem, put em in deep space
|
||||
if(prob(calibration)) //oh dear a problem, put em in deep space
|
||||
do_teleport(M, locate(rand((2*TRANSITIONEDGE), world.maxx - (2*TRANSITIONEDGE)), rand((2*TRANSITIONEDGE), world.maxy - (2*TRANSITIONEDGE)), pick(GetConnectedZlevels(z))), 2)
|
||||
else
|
||||
do_teleport(M, teleport_obj) //dead-on precision
|
||||
if(ishuman(M))
|
||||
station.calibration = min(station.calibration + 5, 100)
|
||||
calibration = min(calibration + 5, 100)
|
||||
|
||||
/obj/machinery/teleport/pad/update_icon()
|
||||
cut_overlays()
|
||||
if (station?.engaged)
|
||||
if (engaged)
|
||||
var/image/I = image(icon, src, "[initial(icon_state)]_active_overlay")
|
||||
I.layer = EFFECTS_ABOVE_LIGHTING_LAYER
|
||||
add_overlay(I)
|
||||
@@ -60,226 +68,7 @@
|
||||
I.layer = EFFECTS_ABOVE_LIGHTING_LAYER
|
||||
add_overlay(I)
|
||||
|
||||
/obj/machinery/teleport/station
|
||||
name = "teleportation station"
|
||||
desc = "A teleportation hub that can be used to lock onto beacons and implants and relaying the coordinates precisely to a nearby teleportation pad."
|
||||
icon_state = "station"
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 2000
|
||||
|
||||
var/obj/machinery/teleport/pad/pad
|
||||
|
||||
var/id = null
|
||||
var/engaged = FALSE
|
||||
|
||||
var/calibration = 0 // a percentage chance for teleporting into space instead of your target. 0 is perfectly calibrated, 100 is totally uncalibrated
|
||||
|
||||
var/datum/weakref/locked_obj
|
||||
var/locked_obj_name
|
||||
|
||||
var/max_teleport_range = 4 //max overmap teleport distance
|
||||
|
||||
/obj/machinery/teleport/station/Initialize()
|
||||
. = ..()
|
||||
find_pad()
|
||||
set_dir(get_dir(src, pad))
|
||||
id = "[rand(1000, 9999)]"
|
||||
queue_icon_update()
|
||||
|
||||
/obj/machinery/teleport/station/proc/find_pad()
|
||||
pad = locate() in range(2, src)
|
||||
if(pad)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/teleport/station/examine(mob/user)
|
||||
. = ..()
|
||||
to_chat(user, SPAN_NOTICE("\The [src]'s station ID is: <b>[id]</b>."))
|
||||
|
||||
/obj/machinery/teleport/station/machinery_process()
|
||||
var/old_engaged = engaged
|
||||
if(locked_obj)
|
||||
if(stat & (NOPOWER|BROKEN) || !within_range(locked_obj))
|
||||
engaged = FALSE
|
||||
else
|
||||
engaged = TRUE
|
||||
if(old_engaged != engaged)
|
||||
update_icon()
|
||||
if(pad)
|
||||
pad.update_icon()
|
||||
|
||||
/obj/machinery/teleport/station/update_icon()
|
||||
. = ..()
|
||||
cut_overlays()
|
||||
if (engaged)
|
||||
var/image/I = image(icon, src, "[initial(icon_state)]_active_overlay")
|
||||
I.layer = EFFECTS_ABOVE_LIGHTING_LAYER
|
||||
add_overlay(I)
|
||||
else if (operable())
|
||||
var/image/I = image(icon, src, "[initial(icon_state)]_idle_overlay")
|
||||
I.layer = EFFECTS_ABOVE_LIGHTING_LAYER
|
||||
add_overlay(I)
|
||||
|
||||
/obj/machinery/teleport/station/attack_hand(mob/user)
|
||||
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
|
||||
if(!ui)
|
||||
ui = new /datum/vueui(user, src, "machinery-teleporter", 600, 400, "Teleporter Control System")
|
||||
ui.auto_update_content = TRUE
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/teleport/station/vueui_data_change(var/list/data, var/mob/user, var/datum/vueui/ui)
|
||||
. = ..()
|
||||
data = . || data || list()
|
||||
|
||||
// block of root level data
|
||||
LAZYINITLIST(data["teleport_beacons"])
|
||||
LAZYINITLIST(data["teleport_implants"])
|
||||
data["locked_in_name"] = "None"
|
||||
|
||||
data["station_locked_in"] = !!locked_obj
|
||||
if(data["station_locked_in"])
|
||||
data["locked_in_name"] = locked_obj_name
|
||||
data["calibration"] = 100 - calibration
|
||||
var/list/area_index = list()
|
||||
|
||||
var/obj/selected_beacon = locked_obj ? locked_obj.resolve() : null
|
||||
var/list/teleport_beacon_info = list()
|
||||
for(var/obj/item/device/radio/beacon/R in teleportbeacons)
|
||||
var/turf/BT = get_turf(R)
|
||||
if(!BT)
|
||||
continue
|
||||
if(!isAdminLevel(z) && isAdminLevel(BT.z))
|
||||
continue
|
||||
if(!within_range(BT))
|
||||
continue
|
||||
var/tmpname = BT.loc.name
|
||||
if(area_index[tmpname])
|
||||
tmpname = "[tmpname] ([++area_index[tmpname]])"
|
||||
else
|
||||
area_index[tmpname] = 1
|
||||
var/list/teleporter_info = list(
|
||||
"beacon_name" = tmpname,
|
||||
"ref" = "\ref[R]",
|
||||
"selected_beacon" = (selected_beacon == R) ? TRUE : FALSE
|
||||
)
|
||||
teleport_beacon_info[++teleport_beacon_info.len] = teleporter_info
|
||||
data["teleport_beacons"] = teleport_beacon_info
|
||||
|
||||
var/list/teleport_implant_info = list()
|
||||
for(var/obj/item/implant/tracking/I in implants)
|
||||
if(!I.implanted || !ismob(I.loc))
|
||||
continue
|
||||
else
|
||||
var/mob/M = I.loc
|
||||
if(M.stat == DEAD && M.timeofdeath + 6000 < world.time)
|
||||
continue
|
||||
var/turf/IT = get_turf(M)
|
||||
if(!IT)
|
||||
continue
|
||||
if(!isAdminLevel(z) && (isAdminLevel(IT.z) || !AreConnectedZLevels(z, IT.z)))
|
||||
continue
|
||||
var/tmpname = M.real_name
|
||||
if(area_index[tmpname])
|
||||
tmpname = "[tmpname] ([++area_index[tmpname]])"
|
||||
else
|
||||
area_index[tmpname] = 1
|
||||
var/list/implant_info = list(
|
||||
"implant_name" = tmpname,
|
||||
"ref" = "\ref[I]",
|
||||
"selected_implant" = (selected_beacon == I) ? TRUE : FALSE
|
||||
)
|
||||
teleport_implant_info[++teleport_implant_info.len] = implant_info
|
||||
data["teleport_implants"] = teleport_implant_info
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/teleport/station/Topic(href, href_list)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
if(href_list["recalibrate"])
|
||||
start_recalibration()
|
||||
else if(href_list["beacon"])
|
||||
var/obj/O = locate(href_list["beacon"]) in teleportbeacons
|
||||
if(locked_obj)
|
||||
var/obj/LO = locked_obj.resolve()
|
||||
if(LO == O)
|
||||
disengage()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
return
|
||||
locked_obj = WEAKREF(O)
|
||||
locked_obj_name = href_list["name"]
|
||||
if(!engaged)
|
||||
engage()
|
||||
visible_message(SPAN_NOTICE("Locked in."), range = 2)
|
||||
else if(href_list["implant"])
|
||||
var/obj/O = locate(href_list["implant"]) in teleportbeacons
|
||||
if(locked_obj)
|
||||
var/obj/LO = locked_obj.resolve()
|
||||
if(LO == O)
|
||||
disengage()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
return
|
||||
locked_obj = WEAKREF(O)
|
||||
locked_obj_name = href_list["name"]
|
||||
if(!engaged)
|
||||
engage()
|
||||
visible_message(SPAN_NOTICE("Locked in."), range = 2)
|
||||
|
||||
SSvueui.check_uis_for_change(src)
|
||||
|
||||
/obj/machinery/teleport/station/proc/engage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
if(!pad && !find_pad())
|
||||
return
|
||||
|
||||
use_power(5000)
|
||||
update_use_power(2)
|
||||
pad.update_use_power(2)
|
||||
visible_message(SPAN_NOTICE("Teleporter engaged!"))
|
||||
add_fingerprint(usr)
|
||||
engaged = TRUE
|
||||
pad.queue_icon_update()
|
||||
queue_icon_update()
|
||||
|
||||
/obj/machinery/teleport/station/proc/disengage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
update_use_power(1)
|
||||
if(pad)
|
||||
pad.update_use_power(1)
|
||||
locked_obj = null
|
||||
locked_obj_name = null
|
||||
visible_message(SPAN_NOTICE("Teleporter disengaged!"))
|
||||
add_fingerprint(usr)
|
||||
engaged = FALSE
|
||||
if(pad)
|
||||
pad.queue_icon_update()
|
||||
queue_icon_update()
|
||||
|
||||
/obj/machinery/teleport/station/power_change()
|
||||
..()
|
||||
queue_icon_update()
|
||||
if(pad)
|
||||
pad.queue_icon_update()
|
||||
|
||||
/obj/machinery/teleport/station/proc/start_recalibration()
|
||||
audible_message(SPAN_NOTICE("Recalibrating..."))
|
||||
addtimer(CALLBACK(src, .proc/recalibrate), 5 SECONDS, TIMER_UNIQUE)
|
||||
|
||||
/obj/machinery/teleport/station/proc/recalibrate()
|
||||
calibration = 0
|
||||
audible_message(SPAN_NOTICE("Calibration complete."))
|
||||
|
||||
/obj/machinery/teleport/station/Destroy()
|
||||
pad = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/teleport/station/proc/within_range(var/target)
|
||||
/obj/machinery/teleport/pad/proc/within_range(var/target)
|
||||
if (isweakref(target))
|
||||
var/datum/weakref/target_ref = target
|
||||
target = target_ref.resolve()
|
||||
@@ -292,4 +81,38 @@
|
||||
var/target_sector = map_sectors["[T.z]"]
|
||||
if (istype(my_sector, /obj/effect/overmap/visitable) && istype(target_sector, /obj/effect/overmap/visitable))
|
||||
if(get_dist(my_sector, target_sector) < max_teleport_range)
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/teleport/pad/proc/engage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
use_power(5000)
|
||||
update_use_power(2)
|
||||
visible_message(SPAN_NOTICE("Teleporter engaged!"))
|
||||
add_fingerprint(usr)
|
||||
engaged = TRUE
|
||||
queue_icon_update()
|
||||
|
||||
/obj/machinery/teleport/pad/proc/disengage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
update_use_power(1)
|
||||
locked_obj = null
|
||||
locked_obj_name = null
|
||||
visible_message(SPAN_NOTICE("Teleporter disengaged!"))
|
||||
engaged = FALSE
|
||||
queue_icon_update()
|
||||
|
||||
/obj/machinery/teleport/pad/power_change()
|
||||
..()
|
||||
queue_icon_update()
|
||||
|
||||
/obj/machinery/teleport/pad/proc/start_recalibration()
|
||||
audible_message(SPAN_NOTICE("Recalibrating..."))
|
||||
addtimer(CALLBACK(src, .proc/recalibrate), 5 SECONDS, TIMER_UNIQUE)
|
||||
|
||||
/obj/machinery/teleport/pad/proc/recalibrate()
|
||||
calibration = 0
|
||||
audible_message(SPAN_NOTICE("Calibration complete."))
|
||||
|
||||
@@ -141,7 +141,7 @@ Frequency:
|
||||
/obj/item/hand_tele
|
||||
name = "hand tele"
|
||||
desc = "A hand-held bluespace teleporter that can rip open portals to a random nearby location, or lock onto a teleporter with a selected teleportation beacon."
|
||||
desc_info = "Ctrl-click to choose which teleportation station to link to. Use in-hand or alt-click to deploy a portal. When not linked to a station, or the station isn't pointing at a beacon, it will choose a completely random teleportation destination."
|
||||
desc_info = "Ctrl-click to choose which teleportation pad to link to. Use in-hand or alt-click to deploy a portal. When not linked to a pad, or the pad isn't pointing at a beacon, it will choose a completely random teleportation destination."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "hand_tele"
|
||||
item_state = "electronic"
|
||||
@@ -153,17 +153,18 @@ Frequency:
|
||||
origin_tech = list(TECH_MAGNET = 1, TECH_BLUESPACE = 3)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 10000)
|
||||
|
||||
var/obj/machinery/teleport/station/linked_station
|
||||
var/obj/machinery/teleport/pad/linked_pad
|
||||
var/list/active_teleporters
|
||||
|
||||
var/max_portals = 2
|
||||
|
||||
/obj/item/hand_tele/examine(mob/user, distance)
|
||||
. = ..()
|
||||
if(linked_station)
|
||||
to_chat(user, SPAN_NOTICE("\The [src] is linked to teleportation station [linked_station.id]."))
|
||||
if(linked_pad)
|
||||
var/area/A = get_area(linked_pad)
|
||||
to_chat(user, SPAN_NOTICE("\The [src] is linked to a teleportation pad in [A.name]"))
|
||||
else
|
||||
to_chat(user, SPAN_WARNING("\The [src] isn't linked to any teleportation stations!"))
|
||||
to_chat(user, SPAN_WARNING("\The [src] isn't linked to any teleportation pads!"))
|
||||
|
||||
/obj/item/hand_tele/set_initial_maptext()
|
||||
held_maptext = SMALL_FONTS(7, "Ready")
|
||||
@@ -184,15 +185,15 @@ Frequency:
|
||||
return
|
||||
|
||||
var/turf/teleport_turf
|
||||
if(linked_station)
|
||||
if(linked_station.stat & (NOPOWER|BROKEN))
|
||||
to_chat(user, SPAN_WARNING("The station \the [src] is connected doesn't seem to be responding!"))
|
||||
if(linked_pad)
|
||||
if(linked_pad.stat & (NOPOWER|BROKEN))
|
||||
to_chat(user, SPAN_WARNING("The pad \the [src] is connected doesn't seem to be responding!"))
|
||||
return
|
||||
if(!AreConnectedZLevels(current_location.z, linked_station.z))
|
||||
to_chat(user, SPAN_WARNING("The station \the [src] is connected to isn't close enough to lock onto now!"))
|
||||
if(!AreConnectedZLevels(current_location.z, linked_pad.z))
|
||||
to_chat(user, SPAN_WARNING("The pad \the [src] is connected to isn't close enough to lock onto now!"))
|
||||
return
|
||||
if(linked_station.locked_obj)
|
||||
teleport_turf = get_turf(linked_station.locked_obj.resolve())
|
||||
if(linked_pad.locked_obj)
|
||||
teleport_turf = get_turf(linked_pad.locked_obj.resolve())
|
||||
else
|
||||
var/list/potential_turfs = list()
|
||||
for(var/turf/T in orange(10))
|
||||
@@ -230,28 +231,29 @@ Frequency:
|
||||
if(user == loc)
|
||||
var/turf/current_location = get_turf(src)
|
||||
var/list/teleport_options = list()
|
||||
for(var/obj/machinery/teleport/station/S in SSmachinery.all_machines)
|
||||
if(AreConnectedZLevels(current_location.z, S.z))
|
||||
if(S.engaged)
|
||||
teleport_options["[S.id] (Active)"] = S
|
||||
for(var/obj/machinery/teleport/pad/P in SSmachinery.all_machines)
|
||||
if(AreConnectedZLevels(current_location.z, P.z))
|
||||
var/area/A = get_area(P)
|
||||
if(P.engaged)
|
||||
teleport_options["[A.name] (Active)"] = P
|
||||
else
|
||||
teleport_options["[S.id] (Inactive)"] = S
|
||||
teleport_options["[A.name] (Inactive)"] = P
|
||||
teleport_options["None (Dangerous)"] = null
|
||||
var/teleport_choice = input(user, "Please select a teleporter to lock in on.", "Hand Teleporter") as null|anything in teleport_options
|
||||
if(!teleport_choice)
|
||||
return
|
||||
var/old_station = linked_station
|
||||
linked_station = teleport_options[teleport_choice]
|
||||
if(linked_station)
|
||||
destroyed_event.register(linked_station, src, /obj/item/hand_tele/proc/station_destroyed)
|
||||
if(old_station && linked_station != old_station)
|
||||
destroyed_event.unregister(old_station, src)
|
||||
var/old_pad = linked_pad
|
||||
linked_pad = teleport_options[teleport_choice]
|
||||
if(linked_pad)
|
||||
destroyed_event.register(linked_pad, src, /obj/item/hand_tele/proc/pad_destroyed)
|
||||
if(old_pad && linked_pad != old_pad)
|
||||
destroyed_event.unregister(old_pad, src)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/hand_tele/proc/station_destroyed()
|
||||
linked_station = null
|
||||
audible_message("\The [src] beeps, \"Connected station destroyed, resetting to no-station.\"", null, 3)
|
||||
/obj/item/hand_tele/proc/pad_destroyed()
|
||||
linked_pad = null
|
||||
audible_message("\The [src] beeps, \"Connected pad destroyed, resetting to no-pad.\"", null, 3)
|
||||
|
||||
/obj/item/hand_tele/proc/remove_portal(var/obj/effect/portal/P)
|
||||
LAZYREMOVE(active_teleporters, P)
|
||||
|
||||
@@ -105,6 +105,11 @@
|
||||
_app_preset_type = /datum/modular_computer_app_presets/security/hos
|
||||
enrolled = 1
|
||||
|
||||
/obj/item/modular_computer/console/preset/command/teleporter
|
||||
name = "teleporter control console"
|
||||
desc = "A computer that has a special teleporter control program loaded."
|
||||
_app_preset_type = /datum/modular_computer_app_presets/command/teleporter
|
||||
|
||||
// Civilian
|
||||
/obj/item/modular_computer/console/preset/civilian
|
||||
name = "civilian console"
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
requires_ntnet = TRUE
|
||||
available_on_ntnet = FALSE
|
||||
required_access_run = access_heads
|
||||
usage_flags = PROGRAM_LAPTOP
|
||||
var/datum/weakref/station_ref
|
||||
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
|
||||
var/datum/weakref/pad_ref
|
||||
|
||||
/datum/computer_file/program/teleporter/ui_interact(var/mob/user)
|
||||
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
|
||||
@@ -41,43 +41,46 @@
|
||||
. = data
|
||||
|
||||
var/turf/T = get_turf(computer.loc)
|
||||
var/obj/machinery/teleport/station/linked_station
|
||||
if(station_ref)
|
||||
linked_station = station_ref.resolve()
|
||||
if(QDELETED(linked_station))
|
||||
station_ref = null
|
||||
var/obj/machinery/teleport/pad/linked_pad
|
||||
if(pad_ref)
|
||||
linked_pad = pad_ref.resolve()
|
||||
if(QDELETED(linked_pad))
|
||||
pad_ref = null
|
||||
|
||||
// block of root level data
|
||||
data["has_linked_station"] = !!linked_station
|
||||
LAZYINITLIST(data["nearby_stations"])
|
||||
data["has_linked_pad"] = !!linked_pad
|
||||
LAZYINITLIST(data["nearby_pads"])
|
||||
LAZYINITLIST(data["teleport_beacons"])
|
||||
LAZYINITLIST(data["teleport_implants"])
|
||||
data["station_locked_in"] = FALSE
|
||||
data["locked_in_name"] = "None"
|
||||
data["calibration"] = 0
|
||||
data["selected_target"] = null
|
||||
data["selected_target_name"] = "None"
|
||||
|
||||
if(!linked_station)
|
||||
var/list/near_stations_info = list()
|
||||
for(var/obj/machinery/teleport/station/S in range(3, T))
|
||||
var/list/station_info = list(
|
||||
"station_name" = "[S.name] ([S.x]-[S.y][S.z])",
|
||||
if(!linked_pad)
|
||||
var/list/near_pads_info = list()
|
||||
for(var/obj/machinery/teleport/pad/S in range(3, T))
|
||||
var/list/pad_info = list(
|
||||
"pad_name" = "[S.name] ([S.x]-[S.y][S.z])",
|
||||
"ref" = "\ref[S]"
|
||||
)
|
||||
near_stations_info[++near_stations_info.len] = station_info
|
||||
data["nearby_stations"] = near_stations_info
|
||||
near_pads_info[++near_pads_info.len] = pad_info
|
||||
data["nearby_pads"] = near_pads_info
|
||||
else
|
||||
data["station_locked_in"] = !!linked_station.locked_obj
|
||||
if(data["station_locked_in"])
|
||||
data["locked_in_name"] = linked_station.locked_obj_name
|
||||
data["calibration"] = 100 - linked_station.calibration
|
||||
var/atom/selected_atom = linked_pad.locked_obj ? linked_pad.locked_obj.resolve() : null
|
||||
if(selected_atom)
|
||||
data["selected_target"] = "\ref[selected_atom]"
|
||||
data["selected_target_name"] = linked_pad.locked_obj_name
|
||||
data["calibration"] = 100 - linked_pad.calibration
|
||||
var/list/area_index = list()
|
||||
|
||||
var/list/teleport_beacon_info = list()
|
||||
for(var/obj/item/device/radio/beacon/R in teleportbeacons)
|
||||
for(var/obj/item/device/radio/beacon/R as anything in teleportbeacons)
|
||||
var/turf/BT = get_turf(R)
|
||||
if(!BT)
|
||||
continue
|
||||
if(isNotStationLevel(BT.z))
|
||||
if(!isAdminLevel(linked_pad.z) && isAdminLevel(BT.z))
|
||||
continue
|
||||
if(!linked_pad.within_range(BT))
|
||||
continue
|
||||
var/tmpname = BT.loc.name
|
||||
if(area_index[tmpname])
|
||||
@@ -103,7 +106,9 @@
|
||||
var/turf/IT = get_turf(M)
|
||||
if(!IT)
|
||||
continue
|
||||
if(isNotStationLevel(IT.z))
|
||||
if(!isAdminLevel(linked_pad.z) && isAdminLevel(IT.z))
|
||||
continue
|
||||
if(!linked_pad.within_range(IT))
|
||||
continue
|
||||
var/tmpname = M.real_name
|
||||
if(area_index[tmpname])
|
||||
@@ -123,37 +128,37 @@
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
if(href_list["station"])
|
||||
var/obj/machinery/teleport/station/linked_station = locate(href_list["station"]) in range(3, get_turf(computer.loc))
|
||||
station_ref = WEAKREF(linked_station)
|
||||
if(href_list["pad"])
|
||||
var/obj/machinery/teleport/pad/linked_pad = locate(href_list["pad"]) in range(3, get_turf(computer.loc))
|
||||
pad_ref = WEAKREF(linked_pad)
|
||||
else if(href_list["recalibrate"])
|
||||
var/obj/machinery/teleport/station/linked_station = station_ref.resolve()
|
||||
linked_station.start_recalibration()
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
linked_pad.start_recalibration()
|
||||
else if(href_list["beacon"])
|
||||
var/obj/machinery/teleport/station/linked_station = station_ref.resolve()
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/O = locate(href_list["beacon"]) in teleportbeacons
|
||||
if(linked_station.locked_obj)
|
||||
var/obj/LO = linked_station.locked_obj.resolve()
|
||||
if(linked_pad.locked_obj)
|
||||
var/obj/LO = linked_pad.locked_obj.resolve()
|
||||
if(LO == O)
|
||||
linked_station.disengage()
|
||||
linked_pad.disengage()
|
||||
return
|
||||
linked_station.locked_obj = WEAKREF(O)
|
||||
linked_station.locked_obj_name = href_list["name"]
|
||||
if(!linked_station.engaged)
|
||||
linked_station.engage()
|
||||
linked_station.visible_message(SPAN_NOTICE("Locked in."), range = 2)
|
||||
linked_pad.locked_obj = WEAKREF(O)
|
||||
linked_pad.locked_obj_name = href_list["name"]
|
||||
if(!linked_pad.engaged)
|
||||
linked_pad.engage()
|
||||
linked_pad.visible_message(SPAN_NOTICE("Locked in."), range = 2)
|
||||
else if(href_list["implant"])
|
||||
var/obj/machinery/teleport/station/linked_station = station_ref.resolve()
|
||||
var/obj/O = locate(href_list["implant"]) in teleportbeacons
|
||||
if(linked_station.locked_obj)
|
||||
var/obj/LO = linked_station.locked_obj.resolve()
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/O = locate(href_list["implant"]) in implants
|
||||
if(linked_pad.locked_obj)
|
||||
var/obj/LO = linked_pad.locked_obj.resolve()
|
||||
if(LO == O)
|
||||
linked_station.disengage()
|
||||
linked_pad.disengage()
|
||||
return
|
||||
linked_station.locked_obj = WEAKREF(O)
|
||||
linked_station.locked_obj_name = href_list["name"]
|
||||
if(!linked_station.engaged)
|
||||
linked_station.engage()
|
||||
linked_station.visible_message(SPAN_NOTICE("Locked in."), range = 2)
|
||||
linked_pad.locked_obj = WEAKREF(O)
|
||||
linked_pad.locked_obj_name = href_list["name"]
|
||||
if(!linked_pad.engaged)
|
||||
linked_pad.engage()
|
||||
linked_pad.visible_message(SPAN_NOTICE("Locked in."), range = 2)
|
||||
|
||||
SSvueui.check_uis_for_change(src)
|
||||
SSvueui.check_uis_for_change(src)
|
||||
|
||||
@@ -23368,7 +23368,7 @@
|
||||
/turf/unsimulated/floor,
|
||||
/area/antag/mercenary)
|
||||
"kYI" = (
|
||||
/obj/machinery/teleport/station,
|
||||
/obj/item/modular_computer/console/preset/command/teleporter,
|
||||
/turf/unsimulated/floor{
|
||||
icon_state = "new_reinforced"
|
||||
},
|
||||
|
||||
@@ -18867,7 +18867,7 @@
|
||||
/turf/simulated/floor/plating,
|
||||
/area/teleporter)
|
||||
"aGS" = (
|
||||
/obj/machinery/teleport/station,
|
||||
/obj/item/modular_computer/console/preset/command/teleporter,
|
||||
/turf/simulated/floor/plating,
|
||||
/area/teleporter)
|
||||
"aGT" = (
|
||||
|
||||
@@ -23692,7 +23692,7 @@
|
||||
/turf/unsimulated/floor,
|
||||
/area/antag/mercenary)
|
||||
"kYI" = (
|
||||
/obj/machinery/teleport/station,
|
||||
/obj/item/modular_computer/console/preset/command/teleporter,
|
||||
/turf/unsimulated/floor{
|
||||
icon_state = "new_reinforced"
|
||||
},
|
||||
|
||||
@@ -3985,7 +3985,7 @@
|
||||
name = "\improper Ninja Base"
|
||||
})
|
||||
"akN" = (
|
||||
/obj/machinery/teleport/station,
|
||||
/obj/item/modular_computer/console/preset/command/teleporter,
|
||||
/turf/unsimulated/floor{
|
||||
name = "plating"
|
||||
},
|
||||
@@ -6223,7 +6223,7 @@
|
||||
/turf/simulated/floor/plating,
|
||||
/area/syndicate_station/start)
|
||||
"apq" = (
|
||||
/obj/machinery/teleport/station,
|
||||
/obj/item/modular_computer/console/preset/command/teleporter,
|
||||
/turf/simulated/floor/shuttle/dark_red,
|
||||
/area/syndicate_station/start)
|
||||
"apr" = (
|
||||
@@ -7945,7 +7945,7 @@
|
||||
},
|
||||
/area/centcom/living)
|
||||
"auV" = (
|
||||
/obj/machinery/teleport/station,
|
||||
/obj/item/modular_computer/console/preset/command/teleporter,
|
||||
/turf/unsimulated/floor{
|
||||
icon_state = "dark"
|
||||
},
|
||||
|
||||
@@ -38029,7 +38029,7 @@
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/assembly/chargebay)
|
||||
"xmF" = (
|
||||
/obj/machinery/teleport/station,
|
||||
/obj/item/modular_computer/console/preset/command/teleporter,
|
||||
/obj/effect/floor_decal/industrial/warning/full,
|
||||
/turf/simulated/floor/plating,
|
||||
/area/teleporter)
|
||||
|
||||
@@ -34201,7 +34201,7 @@
|
||||
/turf/simulated/floor/shuttle/black,
|
||||
/area/shuttle/distress)
|
||||
"bCB" = (
|
||||
/obj/machinery/teleport/station,
|
||||
/obj/item/modular_computer/console/preset/command/teleporter,
|
||||
/turf/unsimulated/floor{
|
||||
icon_state = "new_reinforced"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="has_linked_station">
|
||||
<h3>Linked Station Info</h3>
|
||||
<span :class="station_locked_in ? 'good' : 'bad'">{{ station_locked_in ? 'Locked In ' : 'Not Locked In ' }}</span><span :class="station_locked_in ? 'good' : 'bad'">({{ locked_in_name }})</span>
|
||||
<div v-if="has_linked_pad">
|
||||
<h3>Linked Pad Info</h3>
|
||||
<span :class="selected_target ? 'good' : 'bad'">{{ selected_target ? 'Locked In ' : 'Not Locked In ' }}</span><span :class="selected_target ? 'good' : 'bad'">({{ selected_target_name }})</span>
|
||||
<br><span>Calibration: {{calibration}}%</span> <vui-button :params="{ recalibrate: 1 }">Recalibrate</vui-button>
|
||||
<h3>Teleporter Beacons</h3>
|
||||
<table class="table border">
|
||||
@@ -13,7 +13,7 @@
|
||||
<tr v-for="beacon in teleport_beacons" class="item border" :key="beacon.ref">
|
||||
<td>{{ beacon.beacon_name }}</td>
|
||||
<td>
|
||||
<vui-button :class="{ 'danger' : beacon.selected_beacon == true}" :params="{ beacon: beacon.ref, name: beacon.beacon_name }">{{beacon.selected_beacon == true ? "Unset" : "Lock On"}}</vui-button>
|
||||
<vui-button :class="{ 'danger' : selected_target == beacon.ref }" :params="{ beacon: beacon.ref, name: beacon.beacon_name }">{{selected_target == beacon.ref ? "Unset" : "Lock On"}}</vui-button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -26,22 +26,22 @@
|
||||
<tr v-for="implant in teleport_implants" class="item border" :key="implant.ref">
|
||||
<td>{{ implant.implant_name }}</td>
|
||||
<td>
|
||||
<vui-button :class="{ 'danger' : implant.selected_implant == true}" :params="{ implant: implant.ref, name: implant.implant_name }">{{implant.selected_implant == true ? "Unset" : "Lock On"}}</vui-button>
|
||||
<vui-button :class="{ 'danger' : selected_target == implant.ref}" :params="{ implant: implant.ref, name: implant.implant_name }">{{selected_target == implant.ref ? "Unset" : "Lock On"}}</vui-button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div v-else>
|
||||
<h3>Nearby Teleportation Stations</h3>
|
||||
<h3>Nearby Teleportation Pads</h3>
|
||||
<table class="table border">
|
||||
<tr class="header border">
|
||||
<th>Name</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
<tr v-for="station in nearby_stations" class="item border" :key="station.ref">
|
||||
<td>{{ station.station_name }}</td>
|
||||
<tr v-for="pad in nearby_pads" class="item border" :key="pad.ref">
|
||||
<td>{{ pad.pad_name }}</td>
|
||||
<td>
|
||||
<vui-button :params="{ station: station.ref }">Link</vui-button>
|
||||
<vui-button :params="{ pad: pad.ref }">Link</vui-button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -65,4 +65,4 @@ table {
|
||||
tr {
|
||||
line-height: 135%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user