mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-28 07:20:09 +01:00
Telecomms considers sector range, away site radio fixes (#14014)
This commit is contained in:
@@ -80,8 +80,7 @@ var/list/ANTAG_FREQS_ASSOC = list(
|
||||
"[SYND_FREQ]" = TRUE,
|
||||
"[RAID_FREQ]" = TRUE,
|
||||
"[NINJ_FREQ]" = TRUE,
|
||||
"[BURG_FREQ]" = TRUE,
|
||||
"[SHIP_FREQ]" = TRUE
|
||||
"[BURG_FREQ]" = TRUE
|
||||
)
|
||||
|
||||
//Department channels, arranged lexically
|
||||
|
||||
@@ -119,7 +119,7 @@ Class Procs:
|
||||
var/clicksound //played sound on usage
|
||||
var/clickvol = 40 //volume
|
||||
var/obj/item/device/assembly/signaler/signaler // signaller attached to the machine
|
||||
var/obj/effect/overmap/visitable/ship/linked // overmap sector the machine is linked to
|
||||
var/obj/effect/overmap/visitable/linked // overmap sector the machine is linked to
|
||||
|
||||
/obj/machinery/Initialize(mapload, d = 0, populate_components = TRUE, is_internal = FALSE)
|
||||
. = ..()
|
||||
@@ -494,7 +494,7 @@ Class Procs:
|
||||
|
||||
|
||||
// A late init operation called in SSshuttle for ship computers and holopads, used to attach the thing to the right ship.
|
||||
/obj/machinery/proc/attempt_hook_up(obj/effect/overmap/visitable/ship/sector)
|
||||
/obj/machinery/proc/attempt_hook_up(var/obj/effect/overmap/visitable/sector)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
if(!istype(sector))
|
||||
return FALSE
|
||||
@@ -504,15 +504,15 @@ Class Procs:
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/proc/sync_linked()
|
||||
var/obj/effect/overmap/visitable/ship/sector = map_sectors["[z]"]
|
||||
var/obj/effect/overmap/visitable/sector = map_sectors["[z]"]
|
||||
if(!sector)
|
||||
return
|
||||
return attempt_hook_up_recursive(sector)
|
||||
|
||||
/obj/machinery/proc/attempt_hook_up_recursive(obj/effect/overmap/visitable/ship/sector)
|
||||
/obj/machinery/proc/attempt_hook_up_recursive(var/obj/effect/overmap/visitable/sector)
|
||||
if(attempt_hook_up(sector))
|
||||
return sector
|
||||
for(var/obj/effect/overmap/visitable/ship/candidate in sector)
|
||||
for(var/obj/effect/overmap/visitable/candidate in sector)
|
||||
if((. = .(candidate)))
|
||||
return
|
||||
|
||||
|
||||
@@ -120,20 +120,24 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
|
||||
machinetype = 6
|
||||
produces_heat = 0
|
||||
var/intercept = 0 // if nonzero, broadcasts all messages to syndicate channel
|
||||
var/listening_freqs
|
||||
var/channel_color
|
||||
var/channel_name
|
||||
var/list/listening_freqs = list()
|
||||
|
||||
|
||||
/obj/machinery/telecomms/allinone/Initialize()
|
||||
. = ..()
|
||||
|
||||
if(!listening_freqs)
|
||||
listening_freqs = ANTAG_FREQS //Covers any updates to ANTAG_FREQS
|
||||
return ..()
|
||||
|
||||
desc += " It has an effective broadcast range of [overmap_range] grids on the overmap."
|
||||
|
||||
/obj/machinery/telecomms/allinone/receive_signal(datum/signal/signal)
|
||||
|
||||
if(!on) // has to be on to receive messages
|
||||
return
|
||||
|
||||
if(!check_receive_sector(signal) && !intercept) //Too far on the overmap to receive. Antag (intercept) don't care about sector checks.
|
||||
return
|
||||
|
||||
if(is_freq_listening(signal)) // detect subspace signals
|
||||
|
||||
signal.data["done"] = 1 // mark the signal as being broadcasted
|
||||
@@ -147,19 +151,26 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
|
||||
if(signal.data["slow"] > 0)
|
||||
sleep(signal.data["slow"]) // simulate the network lag if necessary
|
||||
|
||||
var/list/broadcast_levels = list()
|
||||
if(!intercept)
|
||||
broadcast_levels = list(z)
|
||||
broadcast_levels += GetConnectedZlevels(z) //For multi-z away sites
|
||||
else
|
||||
broadcast_levels = list(0) //This lets antag headsets work everywhere
|
||||
|
||||
/* ###### Broadcast a message using signal.data ###### */
|
||||
|
||||
var/datum/radio_frequency/connection = signal.data["connection"]
|
||||
|
||||
if(connection.frequency in listening_freqs) // if antag broadcast, just
|
||||
if(connection.frequency in listening_freqs) //Regular broadcasts
|
||||
Broadcast_Message(signal.data["connection"], signal.data["mob"],
|
||||
signal.data["vmask"], signal.data["vmessage"],
|
||||
signal.data["radio"], signal.data["message"],
|
||||
signal.data["name"], signal.data["job"],
|
||||
signal.data["realname"], signal.data["vname"],, signal.data["compression"], list(0), connection.frequency,
|
||||
signal.data["verb"], signal.data["language"], channel_name ? channel_name : signal.data["channel_tag"], channel_color ? channel_color : signal.data["channel_color"])
|
||||
signal.data["realname"], signal.data["vname"],, signal.data["compression"], broadcast_levels, connection.frequency,
|
||||
signal.data["verb"], signal.data["language"])
|
||||
else
|
||||
if(intercept)
|
||||
if(intercept) //Antag Broadcast intercepting station messages
|
||||
Broadcast_Message(signal.data["connection"], signal.data["mob"],
|
||||
signal.data["vmask"], signal.data["vmessage"],
|
||||
signal.data["radio"], signal.data["message"],
|
||||
@@ -170,8 +181,21 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
|
||||
|
||||
/obj/machinery/telecomms/allinone/ship
|
||||
listening_freqs = list(SHIP_FREQ)
|
||||
channel_color = "#7331c4"
|
||||
channel_name = "Ship"
|
||||
|
||||
//This goes on the station map so away ships can maintain radio contact.
|
||||
//Regular telecomms machines cannot listen to broadcasts coming from non-station z-levels. If we did this, comms would be receiving a substantial amount of duplicated messages.
|
||||
/obj/machinery/telecomms/allinone/ship/station_relay
|
||||
name = "External Signal Receiver"
|
||||
icon = 'icons/obj/machines/telecomms.dmi'
|
||||
icon_state = "ntnet"
|
||||
desc = "This device allows nearby third-party ships to maintain radio contact with their crew that are aboard the %STATIONNAME."
|
||||
desc_info = "This device does not need to be linked to other telecommunications equipment; it will receive and broadcast on its own. It only needs to be powered."
|
||||
use_power = POWER_USE_IDLE
|
||||
idle_power_usage = 25
|
||||
|
||||
/obj/machinery/telecomms/allinone/ship/station_relay/Initialize()
|
||||
. = ..()
|
||||
desc = replacetext(desc, "%STATIONNAME", current_map.station_name)
|
||||
|
||||
/**
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
|
||||
var/hide = 0 // Is it a hidden machine?
|
||||
var/list/listening_level = 0 // 0 = auto set in New() - this is the z level that the machine is listening to.
|
||||
|
||||
var/overmap_range = 2 //OVERMAP: Number of sectors out we can communicate
|
||||
|
||||
|
||||
/obj/machinery/telecomms/proc/relay_information(datum/signal/signal, filter, copysig, amount = 20)
|
||||
// relay signal to all linked machinery that are of type [filter]. If signal has been sent [amount] times, stop sending
|
||||
@@ -105,6 +107,20 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
|
||||
else
|
||||
return 0
|
||||
|
||||
//OVERMAP: Since telecomms is subspace, limit how far it goes. This prevents double-broadcasts across the entire overmap, and gives the ability to intrude on comms range of other ships
|
||||
/obj/machinery/telecomms/proc/check_receive_sector(datum/signal/signal)
|
||||
if(isAdminLevel(z) || isAdminLevel(signal.data["level"])) //Messages to and from centcomm levels are not sector-restricted.
|
||||
return TRUE
|
||||
if(current_map.use_overmap)
|
||||
if(!linked) //If we're using overmap and not associated with a sector, doesn't work.
|
||||
return FALSE
|
||||
var/obj/effect/overmap/visitable/S = signal.data["sector"]
|
||||
if(istype(S)) //If our signal isn't sending a sector, it's something associated with telecomms_process_active(), which has their own limits.
|
||||
if(S != linked) //If we're not the same ship, check range
|
||||
if(get_dist(S, linked) > overmap_range && !(S in view(overmap_range, linked)))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/telecomms/New()
|
||||
telecomms_list += src
|
||||
..()
|
||||
@@ -129,6 +145,11 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
|
||||
if(below)
|
||||
listening_level += below.z
|
||||
|
||||
if(current_map.use_overmap && !linked)
|
||||
var/my_sector = map_sectors["[z]"]
|
||||
if (istype(my_sector, /obj/effect/overmap/visitable))
|
||||
attempt_hook_up(my_sector)
|
||||
|
||||
/obj/machinery/telecomms/Destroy()
|
||||
telecomms_list -= src
|
||||
for(var/obj/machinery/telecomms/comm in telecomms_list)
|
||||
@@ -261,6 +282,8 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
|
||||
return
|
||||
if(!check_receive_level(signal))
|
||||
return
|
||||
if(!check_receive_sector(signal))
|
||||
return
|
||||
|
||||
if(signal.transmission_method == TRANSMISSION_SUBSPACE)
|
||||
if(is_freq_listening(signal)) // detect subspace signals
|
||||
@@ -273,7 +296,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
|
||||
|
||||
/obj/machinery/telecomms/receiver/proc/check_receive_level(datum/signal/signal)
|
||||
|
||||
if(signal.data["level"] != listening_level)
|
||||
if(!(signal.data["level"] in listening_level))
|
||||
for(var/obj/machinery/telecomms/hub/H in links)
|
||||
var/list/connected_levels = list()
|
||||
for(var/obj/machinery/telecomms/relay/R in H.links)
|
||||
@@ -284,7 +307,6 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/*
|
||||
The HUB idles until it receives information. It then passes on that information
|
||||
depending on where it came from.
|
||||
|
||||
@@ -671,10 +671,10 @@
|
||||
syndie = TRUE
|
||||
ks1type = /obj/item/device/encryptionkey/bluespace
|
||||
|
||||
//Ghostrole headset
|
||||
/obj/item/device/radio/headset/ship
|
||||
icon_state = "syn_headset"
|
||||
ks1type = /obj/item/device/encryptionkey/ship
|
||||
syndie = TRUE
|
||||
|
||||
/obj/item/device/radio/headset/binary
|
||||
origin_tech = list(TECH_ILLEGAL = 3)
|
||||
|
||||
@@ -359,6 +359,12 @@ var/global/list/default_medbay_channels = list(
|
||||
|
||||
var/turf/position = get_turf(src)
|
||||
|
||||
var/obj/effect/overmap/visitable/sector
|
||||
if(current_map.use_overmap)
|
||||
var/my_sector = map_sectors["[position.z]"]
|
||||
if(istype(my_sector, /obj/effect/overmap/visitable))
|
||||
sector = my_sector
|
||||
|
||||
//#### Tagging the signal with all appropriate identity values ####//
|
||||
|
||||
// ||-- The mob's name identity --||
|
||||
@@ -446,7 +452,8 @@ var/global/list/default_medbay_channels = list(
|
||||
"reject" = 0, // if nonzero, the signal will not be accepted by any broadcasting machinery
|
||||
"level" = position.z, // The source's z level
|
||||
"language" = speaking,
|
||||
"verb" = verb
|
||||
"verb" = verb,
|
||||
"sector" = sector
|
||||
)
|
||||
signal.frequency = connection.frequency // Quick frequency set
|
||||
|
||||
@@ -508,7 +515,8 @@ var/global/list/default_medbay_channels = list(
|
||||
"reject" = 0,
|
||||
"level" = position.z,
|
||||
"language" = speaking,
|
||||
"verb" = verb
|
||||
"verb" = verb,
|
||||
"sector" = sector
|
||||
)
|
||||
signal.frequency = connection.frequency // Quick frequency set
|
||||
|
||||
|
||||
@@ -320,6 +320,7 @@ em {font-style: normal; font-weight: bold;}
|
||||
.centradio {color: #7272a7;}
|
||||
.airadio {color: #ec00ec;}
|
||||
.entradio {color: #cfcfcf;}
|
||||
.shipradio {color: #8b4cd8;}
|
||||
|
||||
.secradio {color: #e21111;}
|
||||
.engradio {color: #cc7b01;}
|
||||
|
||||
@@ -317,6 +317,7 @@ em {font-style: normal;font-weight: bold;}
|
||||
.centradio {color: #5C5C8A;}
|
||||
.airadio {color: #FF00FF;}
|
||||
.entradio {color: #bd893c;}
|
||||
.shipradio {color: #7331c4;}
|
||||
|
||||
.secradio {color: #A30000;}
|
||||
.engradio {color: #A66300;}
|
||||
|
||||
@@ -286,6 +286,7 @@ em {font-style: normal; font-weight: bold;}
|
||||
.centradio {color: #5C5C8A;}
|
||||
.airadio {color: #FF00FF;}
|
||||
.entradio {color: #bd893c;}
|
||||
.shipradio {color: #7331c4;}
|
||||
|
||||
.secradio {color: #A30000;}
|
||||
.engradio {color: #A66300;}
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
/datum/shuttle/autodock/overmap/on_move_interim()
|
||||
..()
|
||||
for(var/obj/machinery/computer/shuttle_control/explore/E in shuttle_computers)
|
||||
var/obj/effect/overmap/visitable/ship/S = E.linked
|
||||
var/obj/effect/overmap/visitable/ship/S = E.connected
|
||||
if(S)
|
||||
S.halt()
|
||||
S.unhalt()
|
||||
|
||||
@@ -44,8 +44,21 @@ var/global/area/overmap/map_overmap // Global object used to locate the overmap
|
||||
LAZYADD(SSshuttle.sectors_to_initialize, src) //Queued for further init. Will populate the waypoint lists; waypoints not spawned yet will be added in as they spawn.
|
||||
SSshuttle.clear_init_queue()
|
||||
|
||||
/obj/effect/overmap/visitable/Destroy()
|
||||
for(var/obj/machinery/hologram/holopad/H as anything in SSmachinery.all_holopads)
|
||||
if(H.linked == src)
|
||||
H.linked = null
|
||||
for(var/obj/machinery/telecomms/T in telecomms_list)
|
||||
if(T.linked == src)
|
||||
T.linked = null
|
||||
. = ..()
|
||||
|
||||
//This is called later in the init order by SSshuttle to populate sector objects. Importantly for subtypes, shuttles will be created by then.
|
||||
/obj/effect/overmap/visitable/proc/populate_sector_objects()
|
||||
for(var/obj/machinery/hologram/holopad/H as anything in SSmachinery.all_holopads)
|
||||
H.attempt_hook_up(src)
|
||||
for(var/obj/machinery/telecomms/T in telecomms_list)
|
||||
T.attempt_hook_up(src)
|
||||
|
||||
/obj/effect/overmap/visitable/proc/get_areas()
|
||||
return get_filtered_areas(list(/proc/area_belongs_to_zlevels = map_z))
|
||||
|
||||
@@ -6,18 +6,19 @@
|
||||
var/display_state = "status"
|
||||
|
||||
/obj/machinery/computer/ship/engines/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(!linked)
|
||||
if(!connected)
|
||||
display_reconnect_dialog(user, "ship control systems")
|
||||
return
|
||||
|
||||
|
||||
var/data[0]
|
||||
data["state"] = display_state
|
||||
data["global_state"] = linked.engines_state
|
||||
data["global_limit"] = round(linked.thrust_limit*100)
|
||||
data["global_state"] = connected.engines_state
|
||||
data["global_limit"] = round(connected.thrust_limit*100)
|
||||
var/total_thrust = 0
|
||||
|
||||
var/list/enginfo[0]
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
for(var/datum/ship_engine/E in connected.engines)
|
||||
var/list/rdata[0]
|
||||
rdata["eng_type"] = E.name
|
||||
rdata["eng_on"] = E.is_on()
|
||||
@@ -33,7 +34,7 @@
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "engines_control.tmpl", "[linked.name] Engines Control", 390, 530)
|
||||
ui = new(user, src, ui_key, "engines_control.tmpl", "[connected.name] Engines Control", 390, 530)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
@@ -47,25 +48,25 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
if(href_list["global_toggle"])
|
||||
linked.engines_state = !linked.engines_state
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
if(linked.engines_state == !E.is_on())
|
||||
connected.engines_state = !connected.engines_state
|
||||
for(var/datum/ship_engine/E in connected.engines)
|
||||
if(connected.engines_state == !E.is_on())
|
||||
E.toggle()
|
||||
return TOPIC_REFRESH
|
||||
|
||||
if(href_list["set_global_limit"])
|
||||
var/newlim = input("Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num
|
||||
var/newlim = input("Input new thrust limit (0..100%)", "Thrust limit", connected.thrust_limit*100) as num
|
||||
if(!CanInteract(usr, physical_state))
|
||||
return TOPIC_NOACTION
|
||||
linked.thrust_limit = Clamp(newlim/100, 0, 1)
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
E.set_thrust_limit(linked.thrust_limit)
|
||||
connected.thrust_limit = Clamp(newlim/100, 0, 1)
|
||||
for(var/datum/ship_engine/E in connected.engines)
|
||||
E.set_thrust_limit(connected.thrust_limit)
|
||||
return TOPIC_REFRESH
|
||||
|
||||
if(href_list["global_limit"])
|
||||
linked.thrust_limit = Clamp(linked.thrust_limit + text2num(href_list["global_limit"]), 0, 1)
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
E.set_thrust_limit(linked.thrust_limit)
|
||||
connected.thrust_limit = Clamp(connected.thrust_limit + text2num(href_list["global_limit"]), 0, 1)
|
||||
for(var/datum/ship_engine/E in connected.engines)
|
||||
E.set_thrust_limit(connected.thrust_limit)
|
||||
return TOPIC_REFRESH
|
||||
|
||||
if(href_list["engine"])
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
/obj/machinery/computer/ship/helm/attackby(obj/item/I, user)
|
||||
if(istype(I, /obj/item/clothing/head/helmet/pilot))
|
||||
if(!linked)
|
||||
if(!connected)
|
||||
to_chat(user, SPAN_WARNING("\The [src] isn't linked to any vessels!"))
|
||||
return
|
||||
var/obj/item/clothing/head/helmet/pilot/PH = I
|
||||
@@ -36,7 +36,7 @@
|
||||
else
|
||||
to_chat(user, SPAN_NOTICE("You link \the [I] to \the [src]."))
|
||||
PH.set_console(src)
|
||||
PH.set_hud_maptext("| Ship Status | [linked.x]-[linked.y] |<br>Speed: [linked.get_speed()] | Acceleration: [get_acceleration()]<br>ETA to Next Grid: [get_eta()]")
|
||||
PH.set_hud_maptext("| Ship Status | [connected.x]-[connected.y] |<br>Speed: [connected.get_speed()] | Acceleration: [get_acceleration()]<br>ETA to Next Grid: [get_eta()]")
|
||||
check_processing()
|
||||
return
|
||||
return ..()
|
||||
@@ -63,65 +63,65 @@
|
||||
..()
|
||||
if (autopilot && dx && dy)
|
||||
var/turf/T = locate(dx,dy,current_map.overmap_z)
|
||||
if(linked.loc == T)
|
||||
if(linked.is_still())
|
||||
if(connected.loc == T)
|
||||
if(connected.is_still())
|
||||
autopilot = 0
|
||||
else
|
||||
linked.decelerate()
|
||||
connected.decelerate()
|
||||
else
|
||||
var/brake_path = linked.get_brake_path()
|
||||
var/direction = get_dir(linked.loc, T)
|
||||
var/acceleration = min(linked.get_acceleration(), accellimit)
|
||||
var/speed = linked.get_speed()
|
||||
var/heading = linked.get_heading()
|
||||
var/brake_path = connected.get_brake_path()
|
||||
var/direction = get_dir(connected.loc, T)
|
||||
var/acceleration = min(connected.get_acceleration(), accellimit)
|
||||
var/speed = connected.get_speed()
|
||||
var/heading = connected.get_heading()
|
||||
|
||||
// Destination is current grid or speedlimit is exceeded
|
||||
if ((get_dist(linked.loc, T) <= brake_path) || speed > speedlimit)
|
||||
linked.decelerate()
|
||||
if ((get_dist(connected.loc, T) <= brake_path) || speed > speedlimit)
|
||||
connected.decelerate()
|
||||
// Heading does not match direction
|
||||
else if (heading & ~direction)
|
||||
linked.accelerate(turn(heading & ~direction, 180), accellimit)
|
||||
connected.accelerate(turn(heading & ~direction, 180), accellimit)
|
||||
// All other cases, move toward direction
|
||||
else if (speed + acceleration <= speedlimit)
|
||||
linked.accelerate(direction, accellimit)
|
||||
connected.accelerate(direction, accellimit)
|
||||
for(var/obj/item/clothing/head/helmet/pilot/PH as anything in linked_helmets)
|
||||
PH.set_hud_maptext("| Ship Status | [linked.x]-[linked.y] |<br>Speed: [round(linked.get_speed()*1000, 0.01)] | Acceleration: [get_acceleration()]<br>ETA to Next Grid: [get_eta()]")
|
||||
PH.check_ship_overlay(PH.loc, linked)
|
||||
PH.set_hud_maptext("| Ship Status | [connected.x]-[connected.y] |<br>Speed: [round(connected.get_speed()*1000, 0.01)] | Acceleration: [get_acceleration()]<br>ETA to Next Grid: [get_eta()]")
|
||||
PH.check_ship_overlay(PH.loc, connected)
|
||||
|
||||
/obj/machinery/computer/ship/helm/relaymove(var/mob/user, direction)
|
||||
if(viewing_overmap(user) && linked)
|
||||
linked.relaymove(user, direction, accellimit)
|
||||
if(viewing_overmap(user) && connected)
|
||||
connected.relaymove(user, direction, accellimit)
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/ship/helm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/data[0]
|
||||
|
||||
if(!linked)
|
||||
if(!connected)
|
||||
display_reconnect_dialog(user, "helm")
|
||||
else
|
||||
var/turf/T = get_turf(linked)
|
||||
var/turf/T = get_turf(connected)
|
||||
var/obj/effect/overmap/visitable/sector/current_sector = locate() in T
|
||||
|
||||
data["sector"] = current_sector ? current_sector.name : "Deep Space"
|
||||
data["sector_info"] = current_sector ? current_sector.desc : "Not Available"
|
||||
data["landed"] = linked.get_landed_info()
|
||||
data["s_x"] = linked.x
|
||||
data["s_y"] = linked.y
|
||||
data["landed"] = connected.get_landed_info()
|
||||
data["s_x"] = connected.x
|
||||
data["s_y"] = connected.y
|
||||
data["dest"] = dy && dx
|
||||
data["d_x"] = dx
|
||||
data["d_y"] = dy
|
||||
data["speedlimit"] = speedlimit ? speedlimit*1000 : "Halted"
|
||||
data["accel"] = get_acceleration()
|
||||
data["heading"] = linked.get_heading() ? dir2angle(linked.get_heading()) : 0
|
||||
data["heading"] = connected.get_heading() ? dir2angle(connected.get_heading()) : 0
|
||||
data["autopilot"] = autopilot
|
||||
data["manual_control"] = viewing_overmap(user)
|
||||
data["canburn"] = linked.can_burn()
|
||||
data["canburn"] = connected.can_burn()
|
||||
data["accellimit"] = accellimit*1000
|
||||
|
||||
var/speed = round(linked.get_speed()*1000, 0.01)
|
||||
if(linked.get_speed() < SHIP_SPEED_SLOW)
|
||||
var/speed = round(connected.get_speed()*1000, 0.01)
|
||||
if(connected.get_speed() < SHIP_SPEED_SLOW)
|
||||
speed = "<span class='good'>[speed]</span>"
|
||||
if(linked.get_speed() > SHIP_SPEED_FAST)
|
||||
if(connected.get_speed() > SHIP_SPEED_FAST)
|
||||
speed = "<span class='average'>[speed]</span>"
|
||||
data["speed"] = speed
|
||||
|
||||
@@ -141,17 +141,17 @@
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "helm.tmpl", "[linked.name] Helm Control", 565, 545)
|
||||
ui = new(user, src, ui_key, "helm.tmpl", "[connected.name] Helm Control", 565, 545)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/computer/ship/helm/proc/get_acceleration()
|
||||
return min(round(linked.get_acceleration()*1000, 0.01),accellimit*1000)
|
||||
return min(round(connected.get_acceleration()*1000, 0.01),accellimit*1000)
|
||||
|
||||
/obj/machinery/computer/ship/helm/proc/get_eta()
|
||||
var/ETA = linked.ETA()
|
||||
if(ETA && linked.get_speed())
|
||||
var/ETA = connected.ETA()
|
||||
if(ETA && connected.get_speed())
|
||||
return "[round(ETA/10)] seconds"
|
||||
else
|
||||
return "N/A"
|
||||
@@ -160,7 +160,7 @@
|
||||
if(..())
|
||||
return TOPIC_HANDLED
|
||||
|
||||
if(!linked)
|
||||
if(!connected)
|
||||
return TOPIC_HANDLED
|
||||
|
||||
if (href_list["add"])
|
||||
@@ -176,13 +176,13 @@
|
||||
return TOPIC_REFRESH
|
||||
switch(href_list["add"])
|
||||
if("current")
|
||||
R.fields["x"] = linked.x
|
||||
R.fields["y"] = linked.y
|
||||
R.fields["x"] = connected.x
|
||||
R.fields["y"] = connected.y
|
||||
if("new")
|
||||
var/newx = input("Input new entry x coordinate", "Coordinate input", linked.x) as num
|
||||
var/newx = input("Input new entry x coordinate", "Coordinate input", connected.x) as num
|
||||
if(!CanInteract(usr, physical_state))
|
||||
return TOPIC_REFRESH
|
||||
var/newy = input("Input new entry y coordinate", "Coordinate input", linked.y) as num
|
||||
var/newy = input("Input new entry y coordinate", "Coordinate input", connected.y) as num
|
||||
if(!CanInteract(usr, physical_state))
|
||||
return TOPIC_NOACTION
|
||||
R.fields["x"] = Clamp(newx, 1, world.maxx)
|
||||
@@ -233,12 +233,12 @@
|
||||
if(!issilicon(usr)) // AI and robots aren't allowed to pilot
|
||||
if (href_list["move"])
|
||||
var/ndir = text2num(href_list["move"])
|
||||
linked.relaymove(usr, ndir, accellimit)
|
||||
addtimer(CALLBACK(src, .proc/updateUsrDialog), linked.burn_delay + 1) // remove when turning into vueui
|
||||
connected.relaymove(usr, ndir, accellimit)
|
||||
addtimer(CALLBACK(src, .proc/updateUsrDialog), connected.burn_delay + 1) // remove when turning into vueui
|
||||
|
||||
if (href_list["brake"])
|
||||
linked.decelerate()
|
||||
addtimer(CALLBACK(src, .proc/updateUsrDialog), linked.burn_delay + 1) // remove when turning into vueui
|
||||
connected.decelerate()
|
||||
addtimer(CALLBACK(src, .proc/updateUsrDialog), connected.burn_delay + 1) // remove when turning into vueui
|
||||
|
||||
if (href_list["apilot"])
|
||||
autopilot = !autopilot
|
||||
@@ -255,33 +255,33 @@
|
||||
icon_screen = "command"
|
||||
|
||||
/obj/machinery/computer/ship/navigation/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(!linked)
|
||||
if(!connected)
|
||||
display_reconnect_dialog(user, "Navigation")
|
||||
return
|
||||
|
||||
var/data[0]
|
||||
|
||||
|
||||
var/turf/T = get_turf(linked)
|
||||
var/turf/T = get_turf(connected)
|
||||
var/obj/effect/overmap/visitable/sector/current_sector = locate() in T
|
||||
|
||||
data["sector"] = current_sector ? current_sector.name : "Deep Space"
|
||||
data["sector_info"] = current_sector ? current_sector.desc : "Not Available"
|
||||
data["s_x"] = linked.x
|
||||
data["s_y"] = linked.y
|
||||
data["speed"] = round(linked.get_speed()*1000, 0.01)
|
||||
data["accel"] = round(linked.get_acceleration()*1000, 0.01)
|
||||
data["heading"] = linked.get_heading() ? dir2angle(linked.get_heading()) : 0
|
||||
data["s_x"] = connected.x
|
||||
data["s_y"] = connected.y
|
||||
data["speed"] = round(connected.get_speed()*1000, 0.01)
|
||||
data["accel"] = round(connected.get_acceleration()*1000, 0.01)
|
||||
data["heading"] = connected.get_heading() ? dir2angle(connected.get_heading()) : 0
|
||||
data["viewing"] = viewing_overmap(user)
|
||||
|
||||
if(linked.get_speed())
|
||||
data["ETAnext"] = "[round(linked.ETA()/10)] seconds"
|
||||
if(connected.get_speed())
|
||||
data["ETAnext"] = "[round(connected.ETA()/10)] seconds"
|
||||
else
|
||||
data["ETAnext"] = "N/A"
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "nav.tmpl", "[linked.name] Navigation Screen", 380, 530)
|
||||
ui = new(user, src, ui_key, "nav.tmpl", "[connected.name] Navigation Screen", 380, 530)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
@@ -290,7 +290,7 @@
|
||||
if(..())
|
||||
return TOPIC_HANDLED
|
||||
|
||||
if (!linked)
|
||||
if (!connected)
|
||||
return TOPIC_NOACTION
|
||||
|
||||
if (href_list["viewing"])
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
var/obj/machinery/shipsensors/sensors
|
||||
circuit = /obj/item/circuitboard/ship/sensors
|
||||
|
||||
/obj/machinery/computer/ship/sensors/attempt_hook_up(obj/effect/overmap/visitable/ship/sector)
|
||||
/obj/machinery/computer/ship/sensors/attempt_hook_up(var/obj/effect/overmap/visitable/sector)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
|
||||
@@ -6,6 +6,7 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
|
||||
/obj/machinery/computer/ship
|
||||
var/list/viewers // Weakrefs to mobs in direct-view mode.
|
||||
var/extra_view = 0 // how much the view is increased by when the mob is in overmap mode.
|
||||
var/obj/effect/overmap/visitable/ship/connected //The ship we're attached to. This is a typecheck for linked, to ensure we're linked to a ship and not a sector
|
||||
|
||||
/obj/machinery/computer/ship/proc/display_reconnect_dialog(var/mob/user, var/flavor)
|
||||
var/datum/browser/popup = new (user, "[src]", "[src]")
|
||||
@@ -37,6 +38,11 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
|
||||
return TOPIC_HANDLED
|
||||
return TOPIC_NOACTION
|
||||
|
||||
/obj/machinery/computer/ship/sync_linked()
|
||||
. = ..()
|
||||
if(istype(linked, /obj/effect/overmap/visitable/ship))
|
||||
connected = linked
|
||||
|
||||
// Management of mob view displacement. look to shift view to the ship on the overmap; unlook to shift back.
|
||||
|
||||
/obj/machinery/computer/ship/proc/look(var/mob/user)
|
||||
@@ -94,8 +100,8 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
|
||||
return 0
|
||||
|
||||
/obj/machinery/computer/ship/Destroy()
|
||||
if(linked)
|
||||
LAZYREMOVE(linked.consoles, src)
|
||||
if(connected)
|
||||
LAZYREMOVE(connected.consoles, src)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/computer/ship/sensors/Destroy()
|
||||
@@ -110,15 +116,18 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
|
||||
/obj/machinery/computer/ship/on_user_login(mob/M)
|
||||
unlook(M)
|
||||
|
||||
/obj/machinery/computer/ship/attempt_hook_up(obj/effect/overmap/visitable/ship/sector)
|
||||
/obj/machinery/computer/ship/attempt_hook_up(var/obj/effect/overmap/visitable/sector)
|
||||
. = ..()
|
||||
|
||||
if(.)
|
||||
LAZYSET(linked.consoles, src, TRUE)
|
||||
connected = linked
|
||||
LAZYSET(connected.consoles, src, TRUE)
|
||||
|
||||
/obj/machinery/computer/ship/Initialize()
|
||||
. = ..()
|
||||
if(current_map.use_overmap && !linked)
|
||||
var/my_sector = map_sectors["[z]"]
|
||||
if (istype(my_sector, /obj/effect/overmap/visitable/ship))
|
||||
if (istype(my_sector, /obj/effect/overmap/visitable))
|
||||
attempt_hook_up(my_sector)
|
||||
if(istype(linked, /obj/effect/overmap/visitable/ship))
|
||||
connected = linked
|
||||
|
||||
@@ -2,16 +2,23 @@
|
||||
/obj/machinery/computer/shuttle_control/explore
|
||||
name = "general shuttle control console"
|
||||
ui_template = "shuttle_control_console_exploration.tmpl"
|
||||
var/obj/effect/overmap/visitable/ship/connected //Ship we're connected to
|
||||
|
||||
/obj/machinery/computer/shuttle_control/explore/attempt_hook_up(obj/effect/overmap/visitable/ship/sector)
|
||||
/obj/machinery/computer/shuttle_control/explore/Initialize()
|
||||
. = ..()
|
||||
if(istype(linked, /obj/effect/overmap/visitable/ship))
|
||||
connected = linked
|
||||
|
||||
/obj/machinery/computer/shuttle_control/explore/attempt_hook_up(var/obj/effect/overmap/visitable/sector)
|
||||
. = ..()
|
||||
|
||||
if(.)
|
||||
LAZYSET(linked.consoles, src, TRUE)
|
||||
connected = linked
|
||||
LAZYSET(connected.consoles, src, TRUE)
|
||||
|
||||
/obj/machinery/computer/shuttle_control/explore/Destroy()
|
||||
if(linked)
|
||||
LAZYREMOVE(linked.consoles, src)
|
||||
if(connected)
|
||||
LAZYREMOVE(connected.consoles, src)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/computer/shuttle_control/explore/get_ui_data(var/datum/shuttle/autodock/overmap/shuttle)
|
||||
|
||||
@@ -45,16 +45,12 @@ var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND)
|
||||
/obj/effect/overmap/visitable/ship/Destroy()
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
SSshuttle.ships -= src
|
||||
|
||||
for(var/obj/machinery/computer/ship/S in SSmachinery.machinery)
|
||||
if(S.linked == src)
|
||||
S.linked = null
|
||||
for(var/obj/machinery/computer/shuttle_control/explore/C in SSmachinery.machinery)
|
||||
if(C.linked == src)
|
||||
C.linked = null
|
||||
for(var/obj/machinery/hologram/holopad/H as anything in SSmachinery.all_holopads)
|
||||
if(H.linked == src)
|
||||
H.linked = null
|
||||
|
||||
. = ..()
|
||||
|
||||
@@ -246,8 +242,6 @@ var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND)
|
||||
S.attempt_hook_up(src)
|
||||
for(var/obj/machinery/computer/shuttle_control/explore/C in SSmachinery.machinery)
|
||||
C.attempt_hook_up(src)
|
||||
for(var/obj/machinery/hologram/holopad/H as anything in SSmachinery.all_holopads)
|
||||
H.attempt_hook_up(src)
|
||||
for(var/datum/ship_engine/E in ship_engines)
|
||||
if(check_ownership(E.holder))
|
||||
engines |= E
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ em {font-style: normal;font-weight: bold;}
|
||||
.centradio {color: #5C5C8A;}
|
||||
.airadio {color: #FF00FF;}
|
||||
.entradio {color: #bd893c;}
|
||||
.shipradio {color: #4444FF;}
|
||||
.shipradio {color: #7331c4;}
|
||||
|
||||
.secradio {color: #A30000;}
|
||||
.penradio {color: #DB1270;}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
author: Doxxmedearly
|
||||
delete-after: True
|
||||
changes:
|
||||
- rscadd: "Radio communications are now limited by sector distance. The default max range is two grids. The centcomm level, ERT staging, and antagonist bases are exempt from this."
|
||||
- tweak: "Ships will now only hear other ships' communications if they are within this range. Get close on the overmap if you want to eavesdrop. Note that away ships will still only hear the Ship Frequency, not Horizon comms."
|
||||
- bugfix: "Away ship roles should no longer get duplicated radio messages, even when in comms range of multiple other away ships."
|
||||
- tweak: "As away shuttles do not have telecomms units, they will no longer receive radio broadcasts when departed, if they were previously able to. Intrepid/Mining shuttle can still speak DURING the bluespace jump, away ships cannot. Holopads are unaffected."
|
||||
- maptweak: "Added an External Signal Receiver to the Horizon tcomms room. This does not need any special setup or connections, and while powered, will allow away ships to communicate with their crew who are aboard the Horizon. This has no bearing on antagonists, so disabling it won't help you there, crafty engineers."
|
||||
@@ -22455,6 +22455,10 @@
|
||||
},
|
||||
/turf/simulated/floor/wood,
|
||||
/area/crew_quarters/captain)
|
||||
"Px" = (
|
||||
/obj/machinery/telecomms/allinone/ship/station_relay,
|
||||
/turf/simulated/floor/bluegrid,
|
||||
/area/tcommsat/chamber)
|
||||
"Py" = (
|
||||
/obj/structure/cable/green{
|
||||
icon_state = "0-8"
|
||||
@@ -47509,7 +47513,7 @@ Wh
|
||||
fc
|
||||
TU
|
||||
xe
|
||||
PB
|
||||
Px
|
||||
Mg
|
||||
PY
|
||||
wF
|
||||
|
||||
@@ -9,7 +9,7 @@ Used In File(s): /code/game/objects/item/devices/radio/radio.dm
|
||||
.comradio {color: #395A9A;}
|
||||
.syndradio {color: #6D3F40;}
|
||||
.bluespaceradio {color: #1883A3;}
|
||||
.shipradio {color: #4444FF;}
|
||||
.shipradio {color: #7331c4;}
|
||||
.centradio {color: #5C5C8A;}
|
||||
.airadio {color: #FF00FF;}
|
||||
.secradio {color: #A30000;}
|
||||
|
||||
Reference in New Issue
Block a user