From 51c7bdc007a80d362d6841a43528a3a38c7eecb6 Mon Sep 17 00:00:00 2001 From: Tad Hardesty Date: Thu, 7 Dec 2017 05:58:27 -0800 Subject: [PATCH] Replace radio frequency magic numbers with defines (#33236) * Change transmission_method to use defines rather than magic numbers * Use MIN and MAX_FREE_FREQ defines when bounds-checking radios * Remove violently broken "Debug Signals" verb The relevant Destroy() is never called, making the static pointers list take lots of memory and be large enough, even at roundstart, to crash the chat when invoked (25k+ entries). * Remove unnecessary checks for SSradio not existing * Move department frequencies from GLOB to defines * Replace all hardcoded radio frequencies with named defines * Change the radio filters to be defines * Use a define for the default signaler code --- code/__DEFINES/radio.dm | 58 ++++++- code/controllers/subsystem/blackbox.dm | 26 +-- .../weather/weather_types/radiation_storm.dm | 4 +- code/game/communications.dm | 149 ++++-------------- code/game/gamemodes/nuclear/nuclear.dm | 4 +- code/game/machinery/airlock_control.dm | 20 +-- code/game/machinery/computer/atmos_alert.dm | 4 +- code/game/machinery/computer/atmos_control.dm | 20 +-- .../game/machinery/computer/communications.dm | 7 +- code/game/machinery/doors/alarmlock.dm | 4 +- code/game/machinery/doors/brigdoors.dm | 4 +- .../embedded_controller/airlock_controller.dm | 4 +- .../simple_vent_controller.dm | 4 +- code/game/machinery/magnet.dm | 16 +- code/game/machinery/navbeacon.dm | 2 +- code/game/machinery/requests_console.dm | 18 +-- code/game/machinery/status_display.dm | 2 +- code/game/machinery/telecomms/broadcasting.dm | 8 +- .../telecomms/machine_interactions.dm | 2 +- .../machinery/telecomms/machines/allinone.dm | 4 +- code/game/machinery/telecomms/machines/bus.dm | 12 +- .../machinery/telecomms/machines/receiver.dm | 8 +- .../machinery/telecomms/machines/server.dm | 19 ++- .../machinery/telecomms/telecomunications.dm | 2 +- code/game/mecha/mecha_topic.dm | 2 +- code/game/objects/effects/anomalies.dm | 2 +- code/game/objects/items/devices/PDA/cart.dm | 4 +- code/game/objects/items/devices/PDA/radio.dm | 8 +- .../objects/items/devices/pressureplates.dm | 2 +- .../items/devices/radio/electropack.dm | 6 +- .../objects/items/devices/radio/intercom.dm | 2 +- .../game/objects/items/devices/radio/radio.dm | 17 +- code/game/objects/items/teleportation.dm | 4 +- code/game/say.dm | 24 +-- code/modules/admin/verbs/diagnostics.dm | 15 +- code/modules/admin/verbs/mapping.dm | 1 - code/modules/assembly/signaler.dm | 12 +- .../atmospherics/machinery/airalarm.dm | 16 +- .../components/binary_devices/dp_vent_pump.dm | 6 +- .../components/binary_devices/passive_gate.dm | 6 +- .../components/binary_devices/pump.dm | 6 +- .../components/binary_devices/volume_pump.dm | 2 +- .../components/trinary_devices/filter.dm | 2 +- .../unary_devices/outlet_injector.dm | 2 +- .../components/unary_devices/vent_pump.dm | 8 +- .../components/unary_devices/vent_scrubber.dm | 10 +- .../atmospherics/machinery/other/meter.dm | 2 +- code/modules/awaymissions/capture_the_flag.dm | 4 +- code/modules/cargo/console.dm | 4 +- code/modules/clothing/outfits/ert.dm | 2 +- code/modules/clothing/outfits/standard.dm | 12 +- code/modules/flufftext/Hallucination.dm | 2 +- .../integrated_electronics/subtypes/input.dm | 10 +- code/modules/mining/laborcamp/laborstacker.dm | 4 +- .../mob/living/silicon/pai/software.dm | 2 +- .../mob/living/simple_animal/bot/bot.dm | 2 +- 56 files changed, 270 insertions(+), 332 deletions(-) diff --git a/code/__DEFINES/radio.dm b/code/__DEFINES/radio.dm index f2a2cbc1055..9f7c82e48db 100644 --- a/code/__DEFINES/radio.dm +++ b/code/__DEFINES/radio.dm @@ -1,5 +1,55 @@ -#define MIN_FREE_FREQ 1201 -#define MAX_FREE_FREQ 1599 +// Radios use a large variety of predefined frequencies. -#define MIN_FREQ 1441 -#define MAX_FREQ 1489 \ No newline at end of file +#define MIN_FREE_FREQ 1201 // ------------------------------------------------- +// Frequencies are always odd numbers and range from 1201 to 1599. + +#define FREQ_SYNDICATE 1213 // Nuke op comms frequency, dark brown +#define FREQ_CTF_RED 1215 // CTF red team comms frequency, red +#define FREQ_CTF_BLUE 1217 // CTF blue team comms frequency, blue +#define FREQ_CENTCOM 1337 // CentCom comms frequency, gray +#define FREQ_SUPPLY 1347 // Supply comms frequency, light brown +#define FREQ_SERVICE 1349 // Service comms frequency, green +#define FREQ_SCIENCE 1351 // Science comms frequency, plum +#define FREQ_COMMAND 1353 // Command comms frequency, gold +#define FREQ_MEDICAL 1355 // Medical comms frequency, soft blue +#define FREQ_ENGINEERING 1357 // Engineering comms frequency, orange +#define FREQ_SECURITY 1359 // Security comms frequency, red + +#define FREQ_STATUS_DISPLAYS 1435 +#define FREQ_ATMOS_ALARMS 1437 // air alarms <-> alert computers +#define FREQ_ATMOS_CONTROL 1439 // air alarms <-> vents and scrubbers + +#define MIN_FREQ 1441 // ------------------------------------------------------ +// Only the 1441 to 1489 range is freely available for general conversation. +// This represents 1/8th of the available spectrum. + +#define FREQ_ATMOS_STORAGE 1441 +#define FREQ_NAV_BEACON 1445 +#define FREQ_AI_PRIVATE 1447 // AI private comms frequency, magenta +#define FREQ_PRESSURE_PLATE 1447 +#define FREQ_AIRLOCK_CONTROL 1449 +#define FREQ_ELECTROPACK 1449 +#define FREQ_MAGNETS 1449 +#define FREQ_LOCATOR_IMPLANT 1451 +#define FREQ_SIGNALER 1457 // the default for new signalers +#define FREQ_COMMON 1459 // Common comms frequency, dark green + +#define MAX_FREQ 1489 // ------------------------------------------------------ + +#define MAX_FREE_FREQ 1599 // ------------------------------------------------- + +// Transmission types. +#define TRANSMISSION_WIRE 0 // some sort of wired connection, not used +#define TRANSMISSION_RADIO 1 // electromagnetic radiation (default) +#define TRANSMISSION_SUBSPACE 2 // subspace transmission (headsets only) + +// Filter types, used as an optimization to avoid unnecessary proc calls. +#define RADIO_TO_AIRALARM "to_airalarm" +#define RADIO_FROM_AIRALARM "from_airalarm" +#define RADIO_SIGNALER "signaler" +#define RADIO_ATMOSIA "atmosia" +#define RADIO_NAVBEACONS "navbeacons" +#define RADIO_AIRLOCK "airlock" +#define RADIO_MAGNETS "magnets" + +#define DEFAULT_SIGNALER_CODE 30 diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm index 9c4ee107e98..4d1e66b3014 100644 --- a/code/controllers/subsystem/blackbox.dm +++ b/code/controllers/subsystem/blackbox.dm @@ -83,31 +83,31 @@ SUBSYSTEM_DEF(blackbox) if(sealed) return switch(freq) - if(1459) + if(FREQ_COMMON) record_feedback("tally", "radio_usage", 1, "common") - if(GLOB.SCI_FREQ) + if(FREQ_SCIENCE) record_feedback("tally", "radio_usage", 1, "science") - if(GLOB.COMM_FREQ) + if(FREQ_COMMAND) record_feedback("tally", "radio_usage", 1, "command") - if(GLOB.MED_FREQ) + if(FREQ_MEDICAL) record_feedback("tally", "radio_usage", 1, "medical") - if(GLOB.ENG_FREQ) + if(FREQ_ENGINEERING) record_feedback("tally", "radio_usage", 1, "engineering") - if(GLOB.SEC_FREQ) + if(FREQ_SECURITY) record_feedback("tally", "radio_usage", 1, "security") - if(GLOB.SYND_FREQ) + if(FREQ_SYNDICATE) record_feedback("tally", "radio_usage", 1, "syndicate") - if(GLOB.SERV_FREQ) + if(FREQ_SERVICE) record_feedback("tally", "radio_usage", 1, "service") - if(GLOB.SUPP_FREQ) + if(FREQ_SUPPLY) record_feedback("tally", "radio_usage", 1, "supply") - if(GLOB.CENTCOM_FREQ) + if(FREQ_CENTCOM) record_feedback("tally", "radio_usage", 1, "centcom") - if(GLOB.AIPRIV_FREQ) + if(FREQ_AI_PRIVATE) record_feedback("tally", "radio_usage", 1, "ai private") - if(GLOB.REDTEAM_FREQ) + if(FREQ_CTF_RED) record_feedback("tally", "radio_usage", 1, "CTF red team") - if(GLOB.BLUETEAM_FREQ) + if(FREQ_CTF_BLUE) record_feedback("tally", "radio_usage", 1, "CTF blue team") else record_feedback("tally", "radio_usage", 1, "other") diff --git a/code/datums/weather/weather_types/radiation_storm.dm b/code/datums/weather/weather_types/radiation_storm.dm index 76c3aab14d0..92f820df6d5 100644 --- a/code/datums/weather/weather_types/radiation_storm.dm +++ b/code/datums/weather/weather_types/radiation_storm.dm @@ -52,7 +52,7 @@ status_alarm() /datum/weather/rad_storm/proc/status_alarm(command) //Makes the status displays show the radiation warning for those who missed the announcement. - var/datum/radio_frequency/frequency = SSradio.return_frequency(1435) + var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS) if(!frequency) return @@ -60,7 +60,7 @@ var/datum/signal/status_signal = new var/atom/movable/virtualspeaker/virt = new /atom/movable/virtualspeaker(null) status_signal.source = virt - status_signal.transmission_method = 1 + status_signal.transmission_method = TRANSMISSION_RADIO status_signal.data["command"] = "shuttle" if(command == "alert") diff --git a/code/game/communications.dm b/code/game/communications.dm index d60a5d83015..ec537da7a64 100644 --- a/code/game/communications.dm +++ b/code/game/communications.dm @@ -86,101 +86,42 @@ GLOBAL_LIST_EMPTY(all_radios) for(var/freq in GLOB.all_radios) GLOB.all_radios["[freq]"] -= radio -/* -Frequency range: 1200 to 1600 -Radiochat range: 1441 to 1489 (most devices refuse to be tune to other frequency, even during mapmaking) - -Radio: -1459 - standard radio chat -1351 - Science -1353 - Command -1355 - Medical -1357 - Engineering -1359 - Security -1337 - death squad -1443 - Confession Intercom -1349 - Miners -1347 - Cargo techs -1447 - AI Private - -Devices: -1451 - tracking implant -1457 - RSD default - -On the map: -1311 for prison shuttle console (in fact, it is not used) -1435 for status displays -1437 for atmospherics/fire alerts -1439 for engine components -1439 for air pumps, air scrubbers, atmo control -1441 for atmospherics - supply tanks -1443 for atmospherics - distribution loop/mixed air tank -1445 for bot nav beacons -1447 for mulebot, secbot and ed209 control -1449 for airlock controls, electropack, magnets -1451 for toxin lab access -1453 for engineering access -1455 for AI access -*/ +// For information on what objects or departments use what frequencies, +// see __DEFINES/radio.dm. Mappers may also select additional frequencies for +// use in maps, such as in intercoms. GLOBAL_LIST_INIT(radiochannels, list( - "Common" = 1459, - "Science" = 1351, - "Command" = 1353, - "Medical" = 1355, - "Engineering" = 1357, - "Security" = 1359, - "CentCom" = 1337, - "Syndicate" = 1213, - "Supply" = 1347, - "Service" = 1349, - "AI Private" = 1447, - "Red Team" = 1215, - "Blue Team" = 1217 + "Common" = FREQ_COMMON, + "Science" = FREQ_SCIENCE, + "Command" = FREQ_COMMAND, + "Medical" = FREQ_MEDICAL, + "Engineering" = FREQ_ENGINEERING, + "Security" = FREQ_SECURITY, + "CentCom" = FREQ_CENTCOM, + "Syndicate" = FREQ_SYNDICATE, + "Supply" = FREQ_SUPPLY, + "Service" = FREQ_SERVICE, + "AI Private" = FREQ_AI_PRIVATE, + "Red Team" = FREQ_CTF_RED, + "Blue Team" = FREQ_CTF_BLUE )) GLOBAL_LIST_INIT(reverseradiochannels, list( - "1459" = "Common", - "1351" = "Science", - "1353" = "Command", - "1355" = "Medical", - "1357" = "Engineering", - "1359" = "Security", - "1337" = "CentCom", - "1213" = "Syndicate", - "1347" = "Supply", - "1349" = "Service", - "1447" = "AI Private", - "1215" = "Red Team", - "1217" = "Blue Team" + "[FREQ_COMMON]" = "Common", + "[FREQ_SCIENCE]" = "Science", + "[FREQ_COMMAND]" = "Command", + "[FREQ_MEDICAL]" = "Medical", + "[FREQ_ENGINEERING]" = "Engineering", + "[FREQ_SECURITY]" = "Security", + "[FREQ_CENTCOM]" = "CentCom", + "[FREQ_SYNDICATE]" = "Syndicate", + "[FREQ_SUPPLY]" = "Supply", + "[FREQ_SERVICE]" = "Service", + "[FREQ_AI_PRIVATE]" = "AI Private", + "[FREQ_CTF_RED]" = "Red Team", + "[FREQ_CTF_BLUE]" = "Blue Team" )) -//depenging helpers -GLOBAL_VAR_CONST(SYND_FREQ, 1213) //nuke op frequency, coloured dark brown in chat window -GLOBAL_VAR_CONST(SUPP_FREQ, 1347) //supply, coloured light brown in chat window -GLOBAL_VAR_CONST(SERV_FREQ, 1349) //service, coloured green in chat window -GLOBAL_VAR_CONST(SCI_FREQ, 1351) //science, coloured plum in chat window -GLOBAL_VAR_CONST(COMM_FREQ, 1353) //command, colored gold in chat window -GLOBAL_VAR_CONST(MED_FREQ, 1355) //medical, coloured blue in chat window -GLOBAL_VAR_CONST(ENG_FREQ, 1357) //engineering, coloured orange in chat window -GLOBAL_VAR_CONST(SEC_FREQ, 1359) //security, coloured red in chat window -GLOBAL_VAR_CONST(CENTCOM_FREQ, 1337) //centcom frequency, coloured grey in chat window -GLOBAL_VAR_CONST(AIPRIV_FREQ, 1447) //AI private, colored magenta in chat window -GLOBAL_VAR_CONST(REDTEAM_FREQ, 1215) // red team (CTF) frequency, coloured red -GLOBAL_VAR_CONST(BLUETEAM_FREQ, 1217) // blue team (CTF) frequency, coloured blue - -#define TRANSMISSION_WIRE 0 -#define TRANSMISSION_RADIO 1 - -/* filters */ -GLOBAL_VAR_INIT(RADIO_TO_AIRALARM, "1") -GLOBAL_VAR_INIT(RADIO_FROM_AIRALARM, "2") -GLOBAL_VAR_INIT(RADIO_CHAT, "3") //deprecated -GLOBAL_VAR_INIT(RADIO_ATMOSIA, "4") -GLOBAL_VAR_INIT(RADIO_NAVBEACONS, "5") -GLOBAL_VAR_INIT(RADIO_AIRLOCK, "6") -GLOBAL_VAR_INIT(RADIO_MAGNETS, "9") - /datum/radio_frequency var/frequency as num @@ -240,48 +181,18 @@ GLOBAL_VAR_INIT(RADIO_MAGNETS, "9") devices -= devices_filter - - - -/client/proc/print_pointers() - set name = "Debug Signals" - set category = "Debug" - - if(!holder) - return - - var/datum/signal/S - to_chat(src, "There are [S.pointers.len] pointers:") - for(var/p in S.pointers) - to_chat(src, p) - S = locate(p) - if(istype(S)) - to_chat(src, S.debug_print()) - /obj/proc/receive_signal(datum/signal/signal, receive_method, receive_param) return /datum/signal var/obj/source - var/transmission_method = 0 - //0 = wire - //1 = radio transmission - //2 = subspace transmission + var/transmission_method = TRANSMISSION_WIRE var/data = list() var/encryption var/frequency = 0 - var/static/list/pointers = list() - -/datum/signal/New() - ..() - pointers += "[REF(src)]" - -/datum/signal/Destroy() - pointers -= "[REF(src)]" - return ..() /datum/signal/proc/copy_from(datum/signal/model) source = model.source diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 6f6e8cfaa3b..a5b1ea1d8bc 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -150,8 +150,8 @@ /datum/outfit/syndicate/post_equip(mob/living/carbon/human/H) var/obj/item/device/radio/R = H.ears - R.set_frequency(GLOB.SYND_FREQ) - R.freqlock = 1 + R.set_frequency(FREQ_SYNDICATE) + R.freqlock = TRUE if(command_radio) R.command = TRUE diff --git a/code/game/machinery/airlock_control.dm b/code/game/machinery/airlock_control.dm index 2f89993fdbf..f854ea84ac4 100644 --- a/code/game/machinery/airlock_control.dm +++ b/code/game/machinery/airlock_control.dm @@ -53,14 +53,14 @@ /obj/machinery/door/airlock/proc/send_status() if(radio_connection) var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.data["tag"] = id_tag signal.data["timestamp"] = world.time signal.data["door_status"] = density?("closed"):("open") signal.data["lock_status"] = locked?("locked"):("unlocked") - radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = GLOB.RADIO_AIRLOCK) + radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK) /obj/machinery/door/airlock/open(surpress_send) @@ -79,10 +79,10 @@ SSradio.remove_object(src, frequency) if(new_frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_AIRLOCK) + radio_connection = SSradio.add_object(src, frequency, RADIO_AIRLOCK) /obj/machinery/door/airlock/Destroy() - if(frequency && SSradio) + if(frequency) SSradio.remove_object(src,frequency) return ..() @@ -97,7 +97,7 @@ var/id_tag var/master_tag - var/frequency = 1449 + var/frequency = FREQ_AIRLOCK_CONTROL var/datum/radio_frequency/radio_connection @@ -116,17 +116,17 @@ /obj/machinery/airlock_sensor/attack_hand(mob/user) var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.data["tag"] = master_tag signal.data["command"] = "cycle" - radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = GLOB.RADIO_AIRLOCK) + radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK) flick("airlock_sensor_cycle", src) /obj/machinery/airlock_sensor/process() if(on) var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.data["tag"] = id_tag signal.data["timestamp"] = world.time @@ -137,14 +137,14 @@ signal.data["pressure"] = num2text(pressure) - radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = GLOB.RADIO_AIRLOCK) + radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK) update_icon() /obj/machinery/airlock_sensor/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_AIRLOCK) + radio_connection = SSradio.add_object(src, frequency, RADIO_AIRLOCK) /obj/machinery/airlock_sensor/Initialize() . = ..() diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index f5115c7e2a1..6aa4c1495ed 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -6,7 +6,7 @@ icon_keyboard = "atmos_key" var/list/priority_alarms = list() var/list/minor_alarms = list() - var/receive_frequency = 1437 + var/receive_frequency = FREQ_ATMOS_ALARMS var/datum/radio_frequency/radio_connection light_color = LIGHT_COLOR_CYAN @@ -57,7 +57,7 @@ /obj/machinery/computer/atmos_alert/proc/set_frequency(new_frequency) SSradio.remove_object(src, receive_frequency) receive_frequency = new_frequency - radio_connection = SSradio.add_object(src, receive_frequency, GLOB.RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, receive_frequency, RADIO_ATMOSIA) /obj/machinery/computer/atmos_alert/receive_signal(datum/signal/signal) if(!signal || signal.encryption) diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index 5c993f0bdea..a1167010509 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -11,7 +11,7 @@ var/on = TRUE var/id_tag - var/frequency = 1441 + var/frequency = FREQ_ATMOS_STORAGE var/datum/radio_frequency/radio_connection /obj/machinery/air_sensor/update_icon() @@ -22,7 +22,7 @@ var/datum/signal/signal = new var/datum/gas_mixture/air_sample = return_air() - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.data = list( "sigtype" = "status", "id_tag" = id_tag, @@ -37,13 +37,13 @@ var/gas_name = air_sample.gases[gas_id][GAS_META][META_GAS_NAME] signal.data["gases"][gas_name] = air_sample.gases[gas_id][MOLES] / total_moles * 100 - radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) /obj/machinery/air_sensor/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA) /obj/machinery/air_sensor/Initialize() . = ..() @@ -66,7 +66,7 @@ icon_keyboard = "atmos_key" circuit = /obj/item/circuitboard/computer/atmos_control - var/frequency = 1441 + var/frequency = FREQ_ATMOS_STORAGE var/list/sensors = list( "n2_sensor" = "Nitrogen Tank", "o2_sensor" = "Oxygen Tank", @@ -129,7 +129,7 @@ /obj/machinery/computer/atmos_control/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA) ///////////////////////////////////////////////////////////// // LARGE TANK CONTROL @@ -138,7 +138,7 @@ /obj/machinery/computer/atmos_control/tank var/input_tag var/output_tag - frequency = 1441 + frequency = FREQ_ATMOS_STORAGE circuit = /obj/item/circuitboard/computer/atmos_control/tank var/list/input_info @@ -147,7 +147,7 @@ // This hacky madness is the evidence of the fact that a lot of machines were never meant to be constructable, im so sorry you had to see this /obj/machinery/computer/atmos_control/tank/proc/reconnect(mob/user) var/list/IO = list() - var/datum/radio_frequency/freq = SSradio.return_frequency(1441) + var/datum/radio_frequency/freq = SSradio.return_frequency(FREQ_ATMOS_STORAGE) var/list/devices = freq.devices["_default"] for(var/obj/machinery/atmospherics/components/unary/vent_pump/U in devices) var/list/text = splittext(U.id_tag, "_") @@ -195,7 +195,7 @@ if(..() || !radio_connection) return var/datum/signal/signal = new - signal.transmission_method = 1 + signal.transmission_method = TRANSMISSION_RADIO signal.source = src signal.data = list("sigtype" = "command") switch(action) @@ -214,7 +214,7 @@ target = Clamp(target, 0, 50 * ONE_ATMOSPHERE) signal.data += list("tag" = output_tag, "set_internal_pressure" = target) . = TRUE - radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) /obj/machinery/computer/atmos_control/tank/receive_signal(datum/signal/signal) if(!signal || signal.encryption) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 6223011736b..d410e06594a 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -28,7 +28,6 @@ var/const/STATE_TOGGLE_EMERGENCY = 10 var/const/STATE_PURCHASE = 11 - var/status_display_freq = "1435" var/stat_msg1 var/stat_msg2 @@ -228,7 +227,7 @@ log_game("[key_name(usr)] answered [currmsg.title] comm message. Answer : [currmsg.answered]") if(currmsg) currmsg.answer_callback.Invoke() - + state = STATE_VIEWMESSAGE if("status") state = STATE_STATUSDISPLAY @@ -693,14 +692,14 @@ /obj/machinery/computer/communications/proc/post_status(command, data1, data2) - var/datum/radio_frequency/frequency = SSradio.return_frequency(1435) + var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS) if(!frequency) return var/datum/signal/status_signal = new status_signal.source = src - status_signal.transmission_method = 1 + status_signal.transmission_method = TRANSMISSION_RADIO status_signal.data["command"] = command switch(command) diff --git a/code/game/machinery/doors/alarmlock.dm b/code/game/machinery/doors/alarmlock.dm index ce7edeb31d3..86da30429ee 100644 --- a/code/game/machinery/doors/alarmlock.dm +++ b/code/game/machinery/doors/alarmlock.dm @@ -8,7 +8,7 @@ glass = TRUE var/datum/radio_frequency/air_connection - var/air_frequency = 1437 + var/air_frequency = FREQ_ATMOS_ALARMS autoclose = FALSE /obj/machinery/door/airlock/alarmlock/New() @@ -23,7 +23,7 @@ /obj/machinery/door/airlock/alarmlock/Initialize() . = ..() SSradio.remove_object(src, air_frequency) - air_connection = SSradio.add_object(src, air_frequency, GLOB.RADIO_TO_AIRALARM) + air_connection = SSradio.add_object(src, air_frequency, RADIO_TO_AIRALARM) open() /obj/machinery/door/airlock/alarmlock/receive_signal(datum/signal/signal) diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 4c0d4a1804a..9097d1bd3c0 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -112,8 +112,8 @@ return 0 if(!forced) - Radio.set_frequency(GLOB.SEC_FREQ) - Radio.talk_into(src, "Timer has expired. Releasing prisoner.", GLOB.SEC_FREQ, get_default_language()) + Radio.set_frequency(FREQ_SECURITY) + Radio.talk_into(src, "Timer has expired. Releasing prisoner.", FREQ_SECURITY, get_default_language()) timing = FALSE activation_time = null diff --git a/code/game/machinery/embedded_controller/airlock_controller.dm b/code/game/machinery/embedded_controller/airlock_controller.dm index 2ec4a7c4b05..73ee58fc08c 100644 --- a/code/game/machinery/embedded_controller/airlock_controller.dm +++ b/code/game/machinery/embedded_controller/airlock_controller.dm @@ -160,7 +160,7 @@ process_again = 1 else var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.data = list( "tag" = airpump_tag, "sigtype"="command" @@ -209,7 +209,7 @@ name = "airlock console" density = FALSE - frequency = 1449 + frequency = FREQ_AIRLOCK_CONTROL power_channel = ENVIRON // Setup parameters only diff --git a/code/game/machinery/embedded_controller/simple_vent_controller.dm b/code/game/machinery/embedded_controller/simple_vent_controller.dm index af945c7ccb6..fbc0b65b0be 100644 --- a/code/game/machinery/embedded_controller/simple_vent_controller.dm +++ b/code/game/machinery/embedded_controller/simple_vent_controller.dm @@ -25,7 +25,7 @@ if("vent_clear") var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.data = list( "tag" = airpump_tag, "sigtype"="command" @@ -45,7 +45,7 @@ name = "vent controller" density = FALSE - frequency = 1229 + frequency = FREQ_ATMOS_CONTROL power_channel = ENVIRON // Setup parameters only diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index b32adcdc26b..8c11180ee6e 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -15,7 +15,7 @@ use_power = IDLE_POWER_USE idle_power_usage = 50 - var/freq = 1449 // radio frequency + var/freq = FREQ_MAGNETS // radio frequency var/electricity_level = 1 // intensity of the magnetic pull var/magnetic_field = 1 // the range of magnetic attraction var/code = 0 // frequency code, they should be different unless you have a group of magnets working together or something @@ -33,7 +33,7 @@ var/turf/T = loc hide(T.intact) center = T - SSradio.add_object(src, freq, GLOB.RADIO_MAGNETS) + SSradio.add_object(src, freq, RADIO_MAGNETS) return INITIALIZE_HINT_LATELOAD /obj/machinery/magnetic_module/LateInitialize() @@ -198,7 +198,7 @@ anchored = TRUE use_power = IDLE_POWER_USE idle_power_usage = 45 - var/frequency = 1449 + var/frequency = FREQ_MAGNETS var/code = 0 var/list/magnets = list() var/title = "Magnetic Control Console" @@ -224,7 +224,7 @@ if(path) // check for default path filter_path() // renders rpath - radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_MAGNETS) + radio_connection = SSradio.add_object(src, frequency, RADIO_MAGNETS) /obj/machinery/magnetic_controller/Destroy() SSradio.remove_object(src, frequency) @@ -279,7 +279,7 @@ // Prepare signal beforehand, because this is a radio operation var/datum/signal/signal = new - signal.transmission_method = 1 // radio transmission + signal.transmission_method = TRANSMISSION_RADIO signal.source = src signal.frequency = frequency signal.data["code"] = code @@ -302,7 +302,7 @@ // Broadcast the signal - radio_connection.post_signal(src, signal, filter = GLOB.RADIO_MAGNETS) + radio_connection.post_signal(src, signal, filter = RADIO_MAGNETS) spawn(1) updateUsrDialog() // pretty sure this increases responsiveness @@ -346,7 +346,7 @@ // Prepare the radio signal var/datum/signal/signal = new - signal.transmission_method = 1 // radio transmission + signal.transmission_method = TRANSMISSION_RADIO signal.source = src signal.frequency = frequency signal.data["code"] = code @@ -370,7 +370,7 @@ // Broadcast the signal spawn() - radio_connection.post_signal(src, signal, filter = GLOB.RADIO_MAGNETS) + radio_connection.post_signal(src, signal, filter = RADIO_MAGNETS) if(speed == 10) sleep(1) diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 2879ea9b542..fe2926f1501 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -15,7 +15,7 @@ var/open = FALSE // true if cover is open var/locked = TRUE // true if controls are locked - var/freq = 1445 // radio frequency + var/freq = FREQ_NAV_BEACON var/location = "" // location response text var/list/codes // assoc. list of transponder codes var/codes_txt = "" // codes as set on map: "tag1;tag2" or "tag1=value;tag2=value" diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index f0e6eb2df04..827093d759e 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -315,13 +315,13 @@ GLOBAL_LIST_EMPTY(allConsoles) var/radio_freq switch(text2num(href_list["emergency"])) if(1) //Security - radio_freq = GLOB.SEC_FREQ + radio_freq = FREQ_SECURITY emergency = "Security" if(2) //Engineering - radio_freq = GLOB.ENG_FREQ + radio_freq = FREQ_ENGINEERING emergency = "Engineering" if(3) //Medical - radio_freq = GLOB.MED_FREQ + radio_freq = FREQ_MEDICAL emergency = "Medical" if(radio_freq) Radio.set_frequency(radio_freq) @@ -352,17 +352,17 @@ GLOBAL_LIST_EMPTY(allConsoles) var/radio_freq = 0 switch(href_list["department"]) if("bridge") - radio_freq = GLOB.COMM_FREQ + radio_freq = FREQ_COMMAND if("medbay") - radio_freq = GLOB.MED_FREQ + radio_freq = FREQ_MEDICAL if("science") - radio_freq = GLOB.SCI_FREQ + radio_freq = FREQ_SCIENCE if("engineering") - radio_freq = GLOB.ENG_FREQ + radio_freq = FREQ_ENGINEERING if("security") - radio_freq = GLOB.SEC_FREQ + radio_freq = FREQ_SECURITY if("cargobay" || "mining") - radio_freq = GLOB.SUPP_FREQ + radio_freq = FREQ_SUPPLY Radio.set_frequency(radio_freq) var/authentic if(msgVerified || msgStamped) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 83681475fd4..edcf422b583 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -32,7 +32,7 @@ var/index1 // display index for scrolling messages or 0 if non-scrolling var/index2 - var/frequency = 1435 // radio frequency + var/frequency = FREQ_STATUS_DISPLAYS var/supply_display = 0 // true if a supply shuttle display var/shuttle_id // Id used for "generic shuttle timer" mode diff --git a/code/game/machinery/telecomms/broadcasting.dm b/code/game/machinery/telecomms/broadcasting.dm index aebccdddd2e..6451af06843 100644 --- a/code/game/machinery/telecomms/broadcasting.dm +++ b/code/game/machinery/telecomms/broadcasting.dm @@ -121,8 +121,8 @@ radios += R var/freqtext = num2text(freq) - for(var/obj/item/device/radio/R in GLOB.all_radios["[GLOB.SYND_FREQ]"]) //syndicate radios use magic that allows them to hear everything. this was already the case, now it just doesn't need the allinone anymore. solves annoying bugs that aren't worth solving. - if(R.receive_range(GLOB.SYND_FREQ, list(R.z)) > -1 && freqtext in GLOB.reverseradiochannels) + for(var/obj/item/device/radio/R in GLOB.all_radios["[FREQ_SYNDICATE]"]) //syndicate radios use magic that allows them to hear everything. this was already the case, now it just doesn't need the allinone anymore. solves annoying bugs that aren't worth solving. + if(R.receive_range(FREQ_SYNDICATE, list(R.z)) > -1 && freqtext in GLOB.reverseradiochannels) radios |= R // Get a list of mobs who can hear from the radios we collected. @@ -159,7 +159,7 @@ // First, we want to generate a new radio signal var/datum/signal/signal = new - signal.transmission_method = 2 // 2 would be a subspace transmission. + signal.transmission_method = TRANSMISSION_SUBSPACE var/turf/pos = get_turf(src) // --- Finally, tag the actual signal with the appropriate values --- @@ -173,7 +173,7 @@ "done" = 0, "level" = pos.z // The level it is being broadcasted at. ) - signal.frequency = 1459// Common channel + signal.frequency = FREQ_COMMON //#### Sending the signal to all subspace receivers ####// for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 74774f2670b..9cbe8689fc0 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -234,7 +234,7 @@ if(newfreq && canAccess(usr)) if(findtext(num2text(newfreq), ".")) newfreq *= 10 // shift the decimal one place - if(newfreq == GLOB.SYND_FREQ) + if(newfreq == FREQ_SYNDICATE) temp = "-% Error: Interference preventing filtering frequency: \"[newfreq] GHz\" %-" else if(!(newfreq in freq_listening) && newfreq < 10000) diff --git a/code/game/machinery/telecomms/machines/allinone.dm b/code/game/machinery/telecomms/machines/allinone.dm index f881e18d357..b08e2c20560 100644 --- a/code/game/machinery/telecomms/machines/allinone.dm +++ b/code/game/machinery/telecomms/machines/allinone.dm @@ -36,12 +36,12 @@ /* ###### Copy all syndie communications to the Syndicate Frequency ###### */ - if(intercept && signal.frequency == GLOB.SYND_FREQ) + if(intercept && signal.frequency == FREQ_SYNDICATE) Broadcast_Message(signal.data["mob"], signal.data["vmask"], signal.data["radio"], signal.data["message"], signal.data["name"], signal.data["job"], - signal.data["realname"],, signal.data["compression"], list(0, z), GLOB.SYND_FREQ, signal.data["spans"], + signal.data["realname"],, signal.data["compression"], list(0, z), FREQ_SYNDICATE, signal.data["spans"], signal.data["verb_say"], signal.data["verb_ask"], signal.data["verb_exclaim"], signal.data["verb_yell"], signal.data["language"]) /* ###### Broadcast a message using signal.data ###### */ diff --git a/code/game/machinery/telecomms/machines/bus.dm b/code/game/machinery/telecomms/machines/bus.dm index 252a285d2a3..d05c4f34f84 100644 --- a/code/game/machinery/telecomms/machines/bus.dm +++ b/code/game/machinery/telecomms/machines/bus.dm @@ -25,7 +25,7 @@ if(is_freq_listening(signal)) if(change_frequency) - if(signal.frequency != GLOB.SYND_FREQ) + if(signal.frequency != FREQ_SYNDICATE) signal.frequency = change_frequency if(!istype(machine_from, /obj/machinery/telecomms/processor) && machine_from != src) // Signal must be ready (stupid assuming machine), let's send it @@ -54,30 +54,30 @@ /obj/machinery/telecomms/bus/preset_one id = "Bus 1" network = "tcommsat" - freq_listening = list(GLOB.SCI_FREQ, GLOB.MED_FREQ) + freq_listening = list(FREQ_SCIENCE, FREQ_MEDICAL) autolinkers = list("processor1", "science", "medical") /obj/machinery/telecomms/bus/preset_two id = "Bus 2" network = "tcommsat" - freq_listening = list(GLOB.SUPP_FREQ,GLOB.SERV_FREQ) + freq_listening = list(FREQ_SUPPLY, FREQ_SERVICE) autolinkers = list("processor2", "supply", "service") /obj/machinery/telecomms/bus/preset_three id = "Bus 3" network = "tcommsat" - freq_listening = list(GLOB.SEC_FREQ, GLOB.COMM_FREQ) + freq_listening = list(FREQ_SECURITY, FREQ_COMMAND) autolinkers = list("processor3", "security", "command") /obj/machinery/telecomms/bus/preset_four id = "Bus 4" network = "tcommsat" - freq_listening = list(GLOB.ENG_FREQ) + freq_listening = list(FREQ_ENGINEERING) autolinkers = list("processor4", "engineering", "common") /obj/machinery/telecomms/bus/preset_four/Initialize() . = ..() - for(var/i = 1441, i < 1489, i += 2) + for(var/i = MIN_FREQ, i <= MAX_FREQ, i += 2) freq_listening |= i /obj/machinery/telecomms/bus/preset_one/birdstation diff --git a/code/game/machinery/telecomms/machines/receiver.dm b/code/game/machinery/telecomms/machines/receiver.dm index 79ab1258785..8dab3b41f42 100644 --- a/code/game/machinery/telecomms/machines/receiver.dm +++ b/code/game/machinery/telecomms/machines/receiver.dm @@ -26,7 +26,7 @@ return if(!check_receive_level(signal)) return - if(signal.transmission_method == 2) + if(signal.transmission_method == TRANSMISSION_SUBSPACE) if(is_freq_listening(signal)) // detect subspace signals @@ -58,7 +58,7 @@ id = "Receiver A" network = "tcommsat" autolinkers = list("receiverA") // link to relay - freq_listening = list(GLOB.SCI_FREQ, GLOB.MED_FREQ, GLOB.SUPP_FREQ, GLOB.SERV_FREQ) // science, medical, supply, service + freq_listening = list(FREQ_SCIENCE, FREQ_MEDICAL, FREQ_SUPPLY, FREQ_SERVICE) //--PRESET RIGHT--// @@ -67,12 +67,12 @@ id = "Receiver B" network = "tcommsat" autolinkers = list("receiverB") // link to relay - freq_listening = list(GLOB.COMM_FREQ, GLOB.ENG_FREQ, GLOB.SEC_FREQ) //command, engineering, security + freq_listening = list(FREQ_COMMAND, FREQ_ENGINEERING, FREQ_SECURITY) //Common and other radio frequencies for people to freely use /obj/machinery/telecomms/receiver/preset_right/Initialize() . = ..() - for(var/i = 1441, i < 1489, i += 2) + for(var/i = MIN_FREQ, i <= MAX_FREQ, i += 2) freq_listening |= i /obj/machinery/telecomms/receiver/preset_left/birdstation diff --git a/code/game/machinery/telecomms/machines/server.dm b/code/game/machinery/telecomms/machines/server.dm index a328333b367..ad7400137ec 100644 --- a/code/game/machinery/telecomms/machines/server.dm +++ b/code/game/machinery/telecomms/machines/server.dm @@ -131,22 +131,22 @@ /obj/machinery/telecomms/server/presets/science id = "Science Server" - freq_listening = list(GLOB.SCI_FREQ) + freq_listening = list(FREQ_SCIENCE) autolinkers = list("science") /obj/machinery/telecomms/server/presets/medical id = "Medical Server" - freq_listening = list(GLOB.MED_FREQ) + freq_listening = list(FREQ_MEDICAL) autolinkers = list("medical") /obj/machinery/telecomms/server/presets/supply id = "Supply Server" - freq_listening = list(GLOB.SUPP_FREQ) + freq_listening = list(FREQ_SUPPLY) autolinkers = list("supply") /obj/machinery/telecomms/server/presets/service id = "Service Server" - freq_listening = list(GLOB.SERV_FREQ) + freq_listening = list(FREQ_SERVICE) autolinkers = list("service") /obj/machinery/telecomms/server/presets/common @@ -154,26 +154,25 @@ freq_listening = list() autolinkers = list("common") - //Common and other radio frequencies for people to freely use - // 1441 to 1489 +//Common and other radio frequencies for people to freely use /obj/machinery/telecomms/server/presets/common/Initialize() . = ..() - for(var/i = 1441, i < 1489, i += 2) + for(var/i = MIN_FREQ, i <= MAX_FREQ, i += 2) freq_listening |= i /obj/machinery/telecomms/server/presets/command id = "Command Server" - freq_listening = list(GLOB.COMM_FREQ) + freq_listening = list(FREQ_COMMAND) autolinkers = list("command") /obj/machinery/telecomms/server/presets/engineering id = "Engineering Server" - freq_listening = list(GLOB.ENG_FREQ) + freq_listening = list(FREQ_ENGINEERING) autolinkers = list("engineering") /obj/machinery/telecomms/server/presets/security id = "Security Server" - freq_listening = list(GLOB.SEC_FREQ) + freq_listening = list(FREQ_SECURITY) autolinkers = list("security") /obj/machinery/telecomms/server/presets/common/birdstation/Initialize() diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index 62f53f73ad2..80d1cefaf98 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -61,7 +61,7 @@ GLOBAL_LIST_EMPTY(telecomms_list) var/datum/signal/copy = new if(copysig) - copy.transmission_method = 2 + copy.transmission_method = TRANSMISSION_SUBSPACE copy.frequency = signal.frequency // Copy the main data contents! Workaround for some nasty bug where the actual array memory is copied and not its contents. copy.data = list( diff --git a/code/game/mecha/mecha_topic.dm b/code/game/mecha/mecha_topic.dm index 54b44f89f94..4c1bceca284 100644 --- a/code/game/mecha/mecha_topic.dm +++ b/code/game/mecha/mecha_topic.dm @@ -284,7 +284,7 @@ if(href_list["rfreq"]) var/new_frequency = (radio.frequency + afilter.getNum("rfreq")) - if (!radio.freerange || (radio.frequency < 1200 || radio.frequency > 1600)) + if (!radio.freerange || (radio.frequency < MIN_FREE_FREQ || radio.frequency > MAX_FREE_FREQ)) new_frequency = sanitize_frequency(new_frequency) radio.set_frequency(new_frequency) send_byjax(src.occupant,"exosuit.browser","rfreq","[format_frequency(radio.frequency)]") diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index e471efcf96d..1e08c2e67a2 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -27,7 +27,7 @@ aSignal.name = "[name] core" aSignal.code = rand(1,100) - aSignal.frequency = rand(1200, 1599) + aSignal.frequency = rand(MIN_FREE_FREQ, MAX_FREE_FREQ) if(IsMultiple(aSignal.frequency, 2))//signaller frequencies are always uneven! aSignal.frequency++ diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index ce2d5b6bf86..4f55864e4db 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -192,14 +192,14 @@ /obj/item/cartridge/proc/post_status(command, data1, data2) - var/datum/radio_frequency/frequency = SSradio.return_frequency(1435) + var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS) if(!frequency) return var/datum/signal/status_signal = new status_signal.source = src - status_signal.transmission_method = 1 + status_signal.transmission_method = TRANSMISSION_RADIO status_signal.data["command"] = command switch(command) diff --git a/code/game/objects/items/devices/PDA/radio.dm b/code/game/objects/items/devices/PDA/radio.dm index 2c4fc8fa488..4cd8a3cb77c 100644 --- a/code/game/objects/items/devices/PDA/radio.dm +++ b/code/game/objects/items/devices/PDA/radio.dm @@ -19,8 +19,8 @@ /obj/item/radio/integrated/signal - var/frequency = 1457 - var/code = 30 + var/frequency = FREQ_SIGNALER + var/code = DEFAULT_SIGNALER_CODE var/last_transmission var/datum/radio_frequency/radio_connection @@ -31,7 +31,7 @@ /obj/item/radio/integrated/signal/Initialize() . = ..() - if (src.frequency < 1200 || src.frequency > 1600) + if (src.frequency < MIN_FREE_FREQ || src.frequency > MAX_FREE_FREQ) src.frequency = sanitize_frequency(src.frequency) set_frequency(frequency) @@ -39,7 +39,7 @@ /obj/item/radio/integrated/signal/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency) + radio_connection = SSradio.add_object(src, frequency, RADIO_SIGNALER) /obj/item/radio/integrated/signal/proc/send_signal(message="ACTIVATE") diff --git a/code/game/objects/items/devices/pressureplates.dm b/code/game/objects/items/devices/pressureplates.dm index 183e960a081..d1ecf9ee286 100644 --- a/code/game/objects/items/devices/pressureplates.dm +++ b/code/game/objects/items/devices/pressureplates.dm @@ -11,7 +11,7 @@ var/sound/trigger_sound = 'sound/effects/pressureplate.ogg' var/obj/item/device/assembly/signaler/sigdev = null var/roundstart_signaller = FALSE - var/roundstart_signaller_freq = 1447 + var/roundstart_signaller_freq = FREQ_PRESSURE_PLATE var/roundstart_signaller_code = 30 var/roundstart_hide = FALSE var/removable_signaller = TRUE diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index 2a4c6f25b95..bf32c230420 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -12,7 +12,7 @@ materials = list(MAT_METAL=10000, MAT_GLASS=2500) var/on = TRUE var/code = 2 - var/frequency = 1449 + var/frequency = FREQ_ELECTROPACK var/shock_cooldown = 0 /obj/item/device/electropack/suicide_act(mob/user) @@ -21,7 +21,7 @@ /obj/item/device/electropack/Initialize() . = ..() - SSradio.add_object(src, frequency, GLOB.RADIO_CHAT) + SSradio.add_object(src, frequency, RADIO_SIGNALER) /obj/item/device/electropack/Destroy() SSradio.remove_object(src, frequency) @@ -67,7 +67,7 @@ if(href_list["freq"]) SSradio.remove_object(src, frequency) frequency = sanitize_frequency(frequency + text2num(href_list["freq"])) - SSradio.add_object(src, frequency, GLOB.RADIO_CHAT) + SSradio.add_object(src, frequency, RADIO_SIGNALER) else if(href_list["code"]) code += text2num(href_list["code"]) diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 3e9ce8c3412..674e32ff9c8 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -112,7 +112,7 @@ return -1 if(!src.listening) return -1 - if(freq == GLOB.SYND_FREQ) + if(freq == FREQ_SYNDICATE) if(!(src.syndie)) return -1//Prevents broadcast of messages over devices lacking the encryption diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 236f3df93ec..b1ab5c88d75 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -8,7 +8,7 @@ dog_fashion = /datum/dog_fashion/back var/on = TRUE // 0 for off var/last_transmission - var/frequency = 1459 //common chat + var/frequency = FREQ_COMMON var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies var/canhear_range = 3 // the range which mobs can hear this radio from var/list/secure_radio_connections @@ -306,7 +306,7 @@ if(independent) var/datum/signal/signal = new - signal.transmission_method = 2 + signal.transmission_method = TRANSMISSION_SUBSPACE signal.data = list( "mob" = M, // store a reference to the mob "mobtype" = M.type, // the mob's type @@ -344,9 +344,8 @@ if(subspace_transmission) // First, we want to generate a new radio signal var/datum/signal/signal = new - signal.transmission_method = 2 // 2 would be a subspace transmission. - // transmission_method could probably be enumerated through #define. Would be neater. - // --- Finally, tag the actual signal with the appropriate values --- + signal.transmission_method = TRANSMISSION_SUBSPACE + // --- Finally, tag the actual signal with the appropriate values --- signal.data = list( // Identity-associated tags: "mob" = M, // store a reference to the mob @@ -397,7 +396,7 @@ var/filter_type = 2 var/datum/signal/signal = new - signal.transmission_method = 2 + signal.transmission_method = TRANSMISSION_SUBSPACE /* --- Try to send a normal subspace broadcast first */ @@ -470,10 +469,10 @@ var/turf/position = get_turf(src) if(!position || !(position.z in level)) return -1 - if(freq == GLOB.SYND_FREQ) + if(freq == FREQ_SYNDICATE) if(!(src.syndie)) //Checks to see if it's allowed on that frequency, based on the encryption keys return -1 - if(freq == GLOB.CENTCOM_FREQ) + if(freq == FREQ_CENTCOM) if(!independent) return -1 if (!on) @@ -555,7 +554,7 @@ /obj/item/device/radio/borg/syndicate/Initialize() . = ..() - set_frequency(GLOB.SYND_FREQ) + set_frequency(FREQ_SYNDICATE) /obj/item/device/radio/borg/attackby(obj/item/W, mob/user, params) diff --git a/code/game/objects/items/teleportation.dm b/code/game/objects/items/teleportation.dm index 28024b76ab3..49aa5b53636 100644 --- a/code/game/objects/items/teleportation.dm +++ b/code/game/objects/items/teleportation.dm @@ -17,7 +17,7 @@ icon = 'icons/obj/device.dmi' icon_state = "locator" var/temp = null - var/frequency = 1451 + var/frequency = FREQ_LOCATOR_IMPLANT var/broadcasting = null var/listening = 1 flags_1 = CONDUCT_1 @@ -208,7 +208,7 @@ Frequency: current_area = current_location.loc if(!current_location || current_area.noteleport || current_location.z > ZLEVEL_SPACEMAX || !isturf(user.loc))//If turf was not found or they're on z level 2 or >7 which does not currently exist. or if user is not located on a turf to_chat(user, "\The [src] is malfunctioning.") - return + return user.show_message("Locked In.", 2) var/list/obj/effect/portal/created = create_portal_pair(current_location, get_teleport_turf(get_turf(T)), src, 300, 1) if(!(LAZYLEN(created) == 2)) diff --git a/code/game/say.dm b/code/game/say.dm index 570974c0bc6..284b77d54d2 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -4,18 +4,18 @@ And the base of the send_speech() proc, which is the core of saycode. */ GLOBAL_LIST_INIT(freqtospan, list( - "1351" = "sciradio", - "1355" = "medradio", - "1357" = "engradio", - "1347" = "suppradio", - "1349" = "servradio", - "1359" = "secradio", - "1353" = "comradio", - "1447" = "aiprivradio", - "1213" = "syndradio", - "1337" = "centcomradio", - "1215" = "redteamradio", - "1217" = "blueteamradio" + "[FREQ_SCIENCE]" = "sciradio", + "[FREQ_MEDICAL]" = "medradio", + "[FREQ_ENGINEERING]" = "engradio", + "[FREQ_SUPPLY]" = "suppradio", + "[FREQ_SERVICE]" = "servradio", + "[FREQ_SECURITY]" = "secradio", + "[FREQ_COMMAND]" = "comradio", + "[FREQ_AI_PRIVATE]" = "aiprivradio", + "[FREQ_SYNDICATE]" = "syndradio", + "[FREQ_CENTCOM]" = "centcomradio", + "[FREQ_CTF_RED]" = "redteamradio", + "[FREQ_CTF_BLUE]" = "blueteamradio" )) /atom/movable/proc/say(message, datum/language/language = null) diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index bcf58b1a4c4..6f2bcb6c46b 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -53,17 +53,6 @@ set category = "Debug" set name = "Radio report" - var/filters = list( - "1" = "GLOB.RADIO_TO_AIRALARM", - "2" = "GLOB.RADIO_FROM_AIRALARM", - "3" = "GLOB.RADIO_CHAT", - "4" = "GLOB.RADIO_ATMOSIA", - "5" = "GLOB.RADIO_NAVBEACONS", - "6" = "GLOB.RADIO_AIRLOCK", - "7" = "RADIO_SECBOT", - "8" = "RADIO_MULEBOT", - "_default" = "NO_FILTER" - ) var/output = "Radio Report
" for (var/fq in SSradio.frequencies) output += "Freq: [fq]
" @@ -74,9 +63,9 @@ for (var/filter in fqs.devices) var/list/f = fqs.devices[filter] if (!f) - output += "  [filters[filter]]: ERROR
" + output += "  [filter]: ERROR
" continue - output += "  [filters[filter]]: [f.len]
" + output += "  [filter]: [f.len]
" for (var/device in f) if (istype(device, /atom)) var/atom/A = device diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 5d0c2fe833e..cbde59bcb6c 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -39,7 +39,6 @@ GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list( /client/proc/cmd_admin_rejuvenate, /datum/admins/proc/show_traitor_panel, /client/proc/disable_communication, - /client/proc/print_pointers, /client/proc/cmd_show_at_list, /client/proc/cmd_show_at_markers, /client/proc/manipulate_organs, diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index d9fdab39be5..c5954e9a0ec 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -9,8 +9,8 @@ wires = WIRE_RECEIVE | WIRE_PULSE | WIRE_RADIO_PULSE | WIRE_RADIO_RECEIVE attachable = 1 - var/code = 30 - var/frequency = 1457 + var/code = DEFAULT_SIGNALER_CODE + var/frequency = FREQ_SIGNALER var/delay = 0 var/datum/radio_frequency/radio_connection @@ -73,7 +73,7 @@ Code: if (href_list["freq"]) var/new_frequency = (frequency + text2num(href_list["freq"])) - if(new_frequency < 1200 || new_frequency > 1600) + if(new_frequency < MIN_FREE_FREQ || new_frequency > MAX_FREE_FREQ) new_frequency = sanitize_frequency(new_frequency) set_frequency(new_frequency) @@ -132,13 +132,9 @@ Code: /obj/item/device/assembly/signaler/proc/set_frequency(new_frequency) - if(!SSradio) - sleep(20) - if(!SSradio) - return SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_CHAT) + radio_connection = SSradio.add_object(src, frequency, RADIO_SIGNALER) return // Embedded signaller used in grenade construction. diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index efe45f4e84e..fd75d18e5a8 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -80,8 +80,8 @@ var/shorted = 0 var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone - var/frequency = 1439 - var/alarm_frequency = 1437 + var/frequency = FREQ_ATMOS_CONTROL + var/alarm_frequency = FREQ_ATMOS_ALARMS var/datum/radio_frequency/radio_connection var/list/TLV = list( // Breathable air. @@ -424,21 +424,21 @@ /obj/machinery/airalarm/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_TO_AIRALARM) + radio_connection = SSradio.add_object(src, frequency, RADIO_TO_AIRALARM) /obj/machinery/airalarm/proc/send_signal(target, list/command)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise if(!radio_connection) return 0 var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.source = src signal.data = command signal.data["tag"] = target signal.data["sigtype"] = "command" - radio_connection.post_signal(src, signal, GLOB.RADIO_FROM_AIRALARM) + radio_connection.post_signal(src, signal, RADIO_FROM_AIRALARM) return 1 @@ -631,7 +631,7 @@ var/datum/signal/alert_signal = new alert_signal.source = src - alert_signal.transmission_method = 1 + alert_signal.transmission_method = TRANSMISSION_RADIO alert_signal.data["zone"] = A.name alert_signal.data["type"] = "Atmospheric" @@ -739,7 +739,7 @@ return return ..() - + /obj/machinery/airalarm/AltClick(mob/user) ..() if(!issilicon(user) && (!user.canUseTopic(src, be_close=TRUE) || !isturf(loc))) @@ -747,7 +747,7 @@ return else togglelock(user) - + /obj/machinery/airalarm/proc/togglelock(mob/living/user) if(stat & (NOPOWER|BROKEN)) to_chat(user, "It does nothing!") diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index f8204947f12..ad77eb93f58 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -131,14 +131,14 @@ Acts like a normal vent, but has an input AND output. SSradio.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA) /obj/machinery/atmospherics/components/binary/dp_vent_pump/proc/broadcast_status() if(!radio_connection) return var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.source = src signal.data = list( @@ -152,7 +152,7 @@ Acts like a normal vent, but has an input AND output. "external" = external_pressure_bound, "sigtype" = "status" ) - radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) /obj/machinery/atmospherics/components/binary/dp_vent_pump/atmosinit() ..() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm index 86c5375d071..adb6e0d96a0 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm @@ -72,14 +72,14 @@ Passive gate is similar to the regular pump except: SSradio.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA) /obj/machinery/atmospherics/components/binary/passive_gate/proc/broadcast_status() if(!radio_connection) return var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.source = src signal.data = list( @@ -90,7 +90,7 @@ Passive gate is similar to the regular pump except: "sigtype" = "status" ) - radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) /obj/machinery/atmospherics/components/binary/passive_gate/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \ datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm index 54eb6124693..3160cdbab47 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm @@ -75,14 +75,14 @@ Thus, the two variables affect pump operation are set in New(): SSradio.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA) /obj/machinery/atmospherics/components/binary/pump/proc/broadcast_status() if(!radio_connection) return var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.source = src signal.data = list( @@ -93,7 +93,7 @@ Thus, the two variables affect pump operation are set in New(): "sigtype" = "status" ) - radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) /obj/machinery/atmospherics/components/binary/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \ datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm index 667a0cb42a3..cd48fbdddae 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm @@ -78,7 +78,7 @@ Thus, the two variables affect pump operation are set in New(): return var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.source = src signal.data = list( diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index 4baeb3dd3e5..5860633b28f 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -29,7 +29,7 @@ SSradio.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA) /obj/machinery/atmospherics/components/trinary/filter/New() ..() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm index 37bfb5d9525..6657e921dfa 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm @@ -94,7 +94,7 @@ return var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.source = src signal.data = list( diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index a05a13217dd..aebd947f555 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -26,7 +26,7 @@ // INT_BOUND: Do not pass internal_pressure_bound // NO_BOUND: Do not pass either - var/frequency = 1439 + var/frequency = FREQ_ATMOS_CONTROL var/datum/radio_frequency/radio_connection var/radio_filter_out var/radio_filter_in @@ -179,7 +179,7 @@ return var/datum/signal/signal = new - signal.transmission_method = 1 // radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.source = src signal.data = list( @@ -206,8 +206,8 @@ /obj/machinery/atmospherics/components/unary/vent_pump/atmosinit() //some vents work his own spesial way - radio_filter_in = frequency==1439?(GLOB.RADIO_FROM_AIRALARM):null - radio_filter_out = frequency==1439?(GLOB.RADIO_TO_AIRALARM):null + radio_filter_in = frequency==FREQ_ATMOS_CONTROL?(RADIO_FROM_AIRALARM):null + radio_filter_out = frequency==FREQ_ATMOS_CONTROL?(RADIO_TO_AIRALARM):null if(frequency) set_frequency(frequency) broadcast_status() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index ce41fb5b680..a1980f6c22e 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -23,7 +23,7 @@ var/widenet = 0 //is this scrubber acting on the 3x3 area around it. var/list/turf/adjacent_turfs = list() - var/frequency = 1439 + var/frequency = FREQ_ATMOS_CONTROL var/datum/radio_frequency/radio_connection var/radio_filter_out var/radio_filter_in @@ -81,7 +81,7 @@ icon_state = "scrub_off" return - if(scrubbing & SCRUBBING) + if(scrubbing & SCRUBBING) if(widenet) icon_state = "scrub_wide" else @@ -99,7 +99,7 @@ return FALSE var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal + signal.transmission_method = TRANSMISSION_RADIO signal.source = src var/list/f_types = list() @@ -130,8 +130,8 @@ return TRUE /obj/machinery/atmospherics/components/unary/vent_scrubber/atmosinit() - radio_filter_in = frequency==initial(frequency)?(GLOB.RADIO_FROM_AIRALARM):null - radio_filter_out = frequency==initial(frequency)?(GLOB.RADIO_TO_AIRALARM):null + radio_filter_in = frequency==initial(frequency)?(RADIO_FROM_AIRALARM):null + radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null if(frequency) set_frequency(frequency) broadcast_status() diff --git a/code/modules/atmospherics/machinery/other/meter.dm b/code/modules/atmospherics/machinery/other/meter.dm index a26b3797355..42413776a9b 100644 --- a/code/modules/atmospherics/machinery/other/meter.dm +++ b/code/modules/atmospherics/machinery/other/meter.dm @@ -79,7 +79,7 @@ var/datum/signal/signal = new signal.source = src - signal.transmission_method = 1 + signal.transmission_method = TRANSMISSION_RADIO signal.data = list( "id_tag" = id_tag, "device" = "AM", diff --git a/code/modules/awaymissions/capture_the_flag.dm b/code/modules/awaymissions/capture_the_flag.dm index d9d1a04e3a9..5627206edfa 100644 --- a/code/modules/awaymissions/capture_the_flag.dm +++ b/code/modules/awaymissions/capture_the_flag.dm @@ -509,7 +509,7 @@ /datum/outfit/ctf/red/post_equip(mob/living/carbon/human/H) ..() var/obj/item/device/radio/R = H.ears - R.set_frequency(GLOB.REDTEAM_FREQ) + R.set_frequency(FREQ_CTF_RED) R.freqlock = TRUE R.independent = TRUE H.dna.species.stunmod = 0 @@ -517,7 +517,7 @@ /datum/outfit/ctf/blue/post_equip(mob/living/carbon/human/H) ..() var/obj/item/device/radio/R = H.ears - R.set_frequency(GLOB.BLUETEAM_FREQ) + R.set_frequency(FREQ_CTF_BLUE) R.freqlock = TRUE R.independent = TRUE H.dna.species.stunmod = 0 diff --git a/code/modules/cargo/console.dm b/code/modules/cargo/console.dm index 3fcb0648a14..319a09381d5 100644 --- a/code/modules/cargo/console.dm +++ b/code/modules/cargo/console.dm @@ -201,14 +201,14 @@ /obj/machinery/computer/cargo/proc/post_signal(command) - var/datum/radio_frequency/frequency = SSradio.return_frequency(1435) + var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS) if(!frequency) return var/datum/signal/status_signal = new status_signal.source = src - status_signal.transmission_method = 1 + status_signal.transmission_method = TRANSMISSION_RADIO status_signal.data["command"] = command frequency.post_signal(src, status_signal) diff --git a/code/modules/clothing/outfits/ert.dm b/code/modules/clothing/outfits/ert.dm index 58b4d1fffe5..2fae534c128 100644 --- a/code/modules/clothing/outfits/ert.dm +++ b/code/modules/clothing/outfits/ert.dm @@ -14,7 +14,7 @@ L.implant(H, null, 1) var/obj/item/device/radio/R = H.ears - R.set_frequency(GLOB.CENTCOM_FREQ) + R.set_frequency(FREQ_CENTCOM) R.freqlock = 1 var/obj/item/card/id/W = H.wear_id diff --git a/code/modules/clothing/outfits/standard.dm b/code/modules/clothing/outfits/standard.dm index e16dd2a7829..050c2fdc875 100644 --- a/code/modules/clothing/outfits/standard.dm +++ b/code/modules/clothing/outfits/standard.dm @@ -102,8 +102,8 @@ var/obj/item/device/radio/R = H.ears if(R) - R.set_frequency(GLOB.SYND_FREQ) - R.freqlock = 1 + R.set_frequency(FREQ_SYNDICATE) + R.freqlock = TRUE var/obj/item/card/id/W = H.wear_id if(W) @@ -257,8 +257,8 @@ W.update_label() var/obj/item/device/radio/headset/R = H.ears - R.set_frequency(GLOB.CENTCOM_FREQ) - R.freqlock = 1 + R.set_frequency(FREQ_CENTCOM) + R.freqlock = TRUE /datum/outfit/ghost_cultist name = "Cultist Ghost" @@ -396,8 +396,8 @@ return var/obj/item/device/radio/R = H.ears - R.set_frequency(GLOB.CENTCOM_FREQ) - R.freqlock = 1 + R.set_frequency(FREQ_CENTCOM) + R.freqlock = TRUE var/obj/item/implant/mindshield/L = new/obj/item/implant/mindshield(H)//Here you go Deuryn L.implant(H, null, 1) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 194edd77b19..a4726d4bfd0 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -779,7 +779,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) humans += H person = pick(humans) - var/message = target.compose_message(person,understood_language,pick(radio_messages),"1459",person.get_spans(),face_name = TRUE) + var/message = target.compose_message(person,understood_language,pick(radio_messages),"[FREQ_COMMON]",person.get_spans(),face_name = TRUE) feedback_details += "Type: Radio, Source: [person.real_name], Message: [message]" to_chat(target, message) qdel(src) diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index 2cf44be975c..108e531dd3b 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -478,8 +478,8 @@ power_draw_idle = 5 power_draw_per_use = 40 - var/frequency = 1457 - var/code = 30 + var/frequency = FREQ_SIGNALER + var/code = DEFAULT_SIGNALER_CODE var/datum/radio_frequency/radio_connection /obj/item/integrated_circuit/input/signaler/Initialize() @@ -520,13 +520,9 @@ /obj/item/integrated_circuit/input/signaler/proc/set_frequency(new_frequency) if(!frequency) return - if(!SSradio) - sleep(20) - if(!SSradio) - return SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_CHAT) + radio_connection = SSradio.add_object(src, frequency, RADIO_SIGNALER) /obj/item/integrated_circuit/input/signaler/receive_signal(datum/signal/signal) var/new_code = get_pin_data(IC_INPUT, 2) diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index 12c9bfb30e5..7b38bc4cb57 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -102,8 +102,8 @@ to_chat(usr, "No permission to dock could be granted.") else if(!emagged) - Radio.set_frequency(GLOB.SEC_FREQ) - Radio.talk_into(src, "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", GLOB.SEC_FREQ, get_spans(), get_default_language()) + Radio.set_frequency(FREQ_SECURITY) + Radio.talk_into(src, "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY, get_spans(), get_default_language()) to_chat(usr, "Shuttle received message and will be sent shortly.") /obj/machinery/mineral/labor_claim_console/proc/check_auth() diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 7df929f20a3..ee3caf19859 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -178,7 +178,7 @@ if(href_list["freq"]) var/new_frequency = (sradio.frequency + text2num(href_list["freq"])) - if(new_frequency < 1200 || new_frequency > 1600) + if(new_frequency < MIN_FREE_FREQ || new_frequency > MAX_FREE_FREQ) new_frequency = sanitize_frequency(new_frequency) sradio.set_frequency(new_frequency) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 67f55f4e977..a4cf20d0b8c 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -72,7 +72,7 @@ var/nearest_beacon // the nearest beacon's tag var/turf/nearest_beacon_loc // the nearest beacon's location - var/beacon_freq = 1445 // navigation beacon frequency + var/beacon_freq = FREQ_NAV_BEACON var/model = "" //The type of bot it is. var/bot_type = 0 //The type of bot it is, for radio control. var/data_hud_type = DATA_HUD_DIAGNOSTIC_BASIC //The type of data HUD the bot uses. Diagnostic by default.