Makes comm frequencies randomized at roundstart.

This commit is contained in:
madmanmartian
2019-08-15 21:59:54 +01:00
parent 8e270e22cd
commit 212fdd6656
13 changed files with 219 additions and 152 deletions

View File

@@ -0,0 +1,43 @@
#define COMMON "Common"
#define SECURITY "Security"
#define ENGINEERING "Engineering"
#define COMMAND "Command"
#define MEDICAL "Medical"
#define SCIENCE "Science"
#define SERVICE "Service"
#define CARGO "Supply"
#define DEATHSQUAD "Deathsquad"
#define RESPONSE "Responders"
#define REV "Revolutionaries"
#define AIPRIVATE "AI Private"
#define DJ "DJ"
#define SYND "Syndicate"
#define RAIDER "Vox Raiders"
var/list/freq_text = list(COMMON,SECURITY,ENGINEERING,COMMAND,MEDICAL,SCIENCE,SERVICE,CARGO,DEATHSQUAD,RESPONSE,AIPRIVATE,DJ,REV, SYND, RAIDER)
var/list/freqs = list() //Generated by generate_radio_frequencies, in more_init_stuff.dm
#define DSQUAD_FREQ freqs[DEATHSQUAD]
#define RESPONSE_FREQ freqs[RESPONSE]
#define AIPRIV_FREQ freqs[AIPRIVATE]
#define DJ_FREQ freqs[DJ]
#define COMMON_FREQ freqs[COMMON]
#define COMM_FREQ freqs[COMMAND]
#define REV_FREQ freqs[REV]
#define SYND_FREQ freqs[SYND]
#define RAID_FREQ freqs[RAIDER]
#define SEC_FREQ freqs[SECURITY]
#define ENG_FREQ freqs[ENGINEERING]
#define SCI_FREQ freqs[SCIENCE]
#define MED_FREQ freqs[MEDICAL]
#define SUP_FREQ freqs[CARGO]
#define SER_FREQ freqs[SERVICE]
var/list/freqtospan = list()
var/list/radiochannels = list()
var/list/radiochannelsreverse = list()
//Only the channels that someone in the main station should have access to normally.
var/list/stationchannels = list()

View File

@@ -1294,7 +1294,7 @@ var/default_colour_matrix = list(1,0,0,0,\
#define LANGUAGE_SLIME "Slime"
#define LANGUAGE_MARTIAN "Martian"
//#define SAY_DEBUG 1
#define SAY_DEBUG 1
#ifdef SAY_DEBUG
#warn SOME ASSHOLE FORGOT TO COMMENT SAY_DEBUG BEFORE COMMITTING
#define say_testing(a,x) to_chat(a, ("([__FILE__]:[__LINE__] say_testing) [x]"))

View File

@@ -1808,3 +1808,81 @@ Game Mode config tags:
if(!istype(C) || (!C.prefs.window_flashing && !ignorepref))
return
winset(C, "mainwindow", "flash=5")
/proc/generate_radio_frequencies()
//1200-1600
var/list/taken_freqs = list()
for(var/i in freq_text)
var/freq_found = FALSE
while(freq_found != TRUE)
var/chosen_freq = rand(1201, 1599)
chosen_freq = sanitize_frequency(chosen_freq)
if(taken_freqs.Find(chosen_freq))
continue
taken_freqs.Add(chosen_freq)
freqs[i] = chosen_freq
world.log << "freq [i] is now [chosen_freq]"
freq_found = TRUE
freqtospan = list(
"[COMMON_FREQ]" = "commonradio",
"[SCI_FREQ]" = "sciradio",
"[MED_FREQ]" = "medradio",
"[ENG_FREQ]" = "engradio",
"[SUP_FREQ]" = "supradio",
"[SER_FREQ]" = "serradio",
"[SEC_FREQ]" = "secradio",
"[COMM_FREQ]" = "comradio",
"[AIPRIV_FREQ]" = "aiprivradio",
"[SYND_FREQ]" = "syndradio",
"[DSQUAD_FREQ]" = "dsquadradio",
"[RESPONSE_FREQ]" = "resteamradio",
"[RAID_FREQ]" = "raiderradio",
)
radiochannelsreverse = list(
"[DJ_FREQ]" = "DJ",
"[SYND_FREQ]" = "Syndicate",
"[RAID_FREQ]" = "Raider",
"[RESPONSE_FREQ]" = "Response Team",
"[SUP_FREQ]" = "Supply",
"[SER_FREQ]" = "Service",
"[SCI_FREQ]" = "Science",
"[MED_FREQ]" = "Medical",
"[COMM_FREQ]" = "Command",
"[ENG_FREQ]" = "Engineering",
"[SEC_FREQ]" = "Security",
"[DSQUAD_FREQ]" = "Deathsquad",
"[AIPRIV_FREQ]" = "AI Private",
"[COMMON_FREQ]" = "Common"
)
radiochannels = list(
"Common" = COMMON_FREQ,
"AI Private" = AIPRIV_FREQ,
"Deathsquad" = DSQUAD_FREQ,
"Security" = SEC_FREQ,
"Engineering" = ENG_FREQ,
"Command" = COMM_FREQ,
"Medical" = MED_FREQ,
"Science" = SCI_FREQ,
"Service" = SER_FREQ,
"Supply" = SUP_FREQ,
"Response Team" = RESPONSE_FREQ,
"Raider" = RAID_FREQ,
"Syndicate" = SYND_FREQ,
"DJ" = DJ_FREQ
)
stationchannels = list(
"Common" = COMMON_FREQ,
"Security" = SEC_FREQ,
"Engineering" = ENG_FREQ,
"Command" = COMM_FREQ,
"Medical" = MED_FREQ,
"Science" = SCI_FREQ,
"Service" = SER_FREQ,
"Supply" = SUP_FREQ
)

View File

@@ -31,7 +31,6 @@ var/datum/subsystem/more_init/SSmore_init
..()
buildcamlist()
if(config.media_base_url)
watch = start_watch()
log_startup_progress("Caching jukebox playlists...")

View File

@@ -87,16 +87,7 @@ 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
1441 - death squad
1443 - Confession Intercom
1349 - Botany, chef, bartender
1347 - Cargo techs
Randomized frequencues between 1200 to 1600
Devices:
1451 - tracking implant
@@ -118,79 +109,6 @@ On the map:
1453 for engineering access
1455 for AI access
*/
var/list/radiochannels = list(
"Common" = COMMON_FREQ,
"AI Private" = AIPRIV_FREQ,
"Deathsquad" = DSQUAD_FREQ,
"Security" = SEC_FREQ,
"Engineering" = ENG_FREQ,
"Command" = COMM_FREQ,
"Medical" = MED_FREQ,
"Science" = SCI_FREQ,
"Service" = SERV_FREQ,
"Supply" = SUPP_FREQ,
"Response Team" = RESTEAM_FREQ,
"Raider" = RAID_FREQ,
"Syndicate" = SYND_FREQ,
"DJ" = DJ_FREQ
)
var/list/radiochannelsreverse = list(
"1201" = "DJ",
"1213" = "Syndicate",
"1215" = "Raider",
"1345" = "Response Team",
"1347" = "Supply",
"1349" = "Service",
"1351" = "Science",
"1355" = "Medical",
"1353" = "Command",
"1357" = "Engineering",
"1359" = "Security",
"1441" = "Deathsquad",
"1447" = "AI Private",
"1459" = "Common"
)
//Only the channels that someone in the main station should have access to normally.
var/list/stationchannels = list(
"Common" = COMMON_FREQ,
"Security" = SEC_FREQ,
"Engineering" = ENG_FREQ,
"Command" = COMM_FREQ,
"Medical" = MED_FREQ,
"Science" = SCI_FREQ,
"Service" = SERV_FREQ,
"Supply" = SUPP_FREQ
)
//depenging helpers
var/const/SUPP_FREQ = 1347 //supply, coloured light brown in chat window
var/const/SERV_FREQ = 1349 //service, coloured green in chat window
var/const/DSQUAD_FREQ = 1441 //death squad frequency, coloured grey in chat window
var/const/RESTEAM_FREQ = 1345 //response team frequency, uses the deathsquad color at the moment.
var/const/AIPRIV_FREQ = 1447 //AI private, colored magenta in chat window
var/const/DJ_FREQ = 1201 //Media
var/const/COMMON_FREQ = 1459
// central command channels, i.e deathsquid & response teams
var/list/CENT_FREQS = list(1345, 1441)
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
var/const/REV_FREQ = 1211
var/const/SYND_FREQ = 1213
var/const/RAID_FREQ = 1215 // for raiders
// department channels
var/const/SEC_FREQ = 1359
var/const/ENG_FREQ = 1357
var/const/SCI_FREQ = 1351
var/const/MED_FREQ = 1355
var/const/SUP_FREQ = 1347
var/const/SER_FREQ = 1349
#define TRANSMISSION_WIRE 0
#define TRANSMISSION_RADIO 1

View File

@@ -51,7 +51,10 @@
id = "Receiver A"
network = "tcommsat"
autolinkers = list("receiverA") // link to relay
freq_listening = list(1351, 1355, 1347, 1349) // science, medical, supply, service
/obj/machinery/telecomms/receiver/preset_left/initialize()
..()
freq_listening = list(SCI_FREQ, MED_FREQ, SUP_FREQ, SER_FREQ) // science, medical, supply, service
//--PRESET RIGHT--//
@@ -60,7 +63,10 @@
id = "Receiver B"
network = "tcommsat"
autolinkers = list("receiverB") // link to relay
freq_listening = list(1345, 1353, 1357, 1359) //ert, command, engineering, security
/obj/machinery/telecomms/receiver/preset_right/initialize()
..()
freq_listening = list(RESPONSE_FREQ, COMM_FREQ, ENG_FREQ, SEC_FREQ) //ert, command, engineering, security
//Common and other radio frequencies for people to freely use
/obj/machinery/telecomms/receiver/preset_right/New()
@@ -77,27 +83,39 @@
/obj/machinery/telecomms/bus/preset_one
id = "Bus 1"
network = "tcommsat"
freq_listening = list(1351, 1355)
autolinkers = list("processor1", "science", "medical")
/obj/machinery/telecomms/bus/preset_one/initialize()
..()
freq_listening = list(SCI_FREQ, MED_FREQ)
/obj/machinery/telecomms/bus/preset_two
id = "Bus 2"
network = "tcommsat"
freq_listening = list(1347, 1349)
autolinkers = list("processor2", "supply", "service")
/obj/machinery/telecomms/bus/preset_two/initialize()
..()
freq_listening = list(SUP_FREQ, SCI_FREQ)
/obj/machinery/telecomms/bus/preset_three
id = "Bus 3"
network = "tcommsat"
freq_listening = list(1359, 1353)
autolinkers = list("processor3", "security", "command")
/obj/machinery/telecomms/bus/preset_three/initialize()
..()
freq_listening = list(SEC_FREQ, COMM_FREQ)
/obj/machinery/telecomms/bus/preset_four
id = "Bus 4"
network = "tcommsat"
freq_listening = list(1345, 1357)
autolinkers = list("processor4", "engineering", "common")
/obj/machinery/telecomms/bus/preset_four/initialize()
..()
freq_listening = list(ENG_FREQ, COMMON_FREQ)
/obj/machinery/telecomms/bus/preset_four/New()
for(var/i = 1441, i < 1489, i += 2)
freq_listening |= i
@@ -147,35 +165,51 @@
/obj/machinery/telecomms/server/presets/science
id = "Science Server"
freq_listening = list(1351)
autolinkers = list("science")
/obj/machinery/telecomms/server/presets/science/initialize()
..()
freq_listening = list(SCI_FREQ)
/obj/machinery/telecomms/server/presets/medical
id = "Medical Server"
freq_listening = list(1355)
autolinkers = list("medical")
/obj/machinery/telecomms/server/presets/medical/initialize()
..()
freq_listening = list(MED_FREQ)
/obj/machinery/telecomms/server/presets/supply
id = "Supply Server"
freq_listening = list(1347)
autolinkers = list("supply")
/obj/machinery/telecomms/server/presets/supply/initialize()
..()
freq_listening = list(SUP_FREQ)
//Using old mining channel frequency for a service channel for the bartender, botanist and chef.
//Also cleaned up all the references to the mining channel I could find, it most likely will never be used again anyway. - Duny
/obj/machinery/telecomms/server/presets/service
id = "Service Server"
freq_listening = list(1349)
autolinkers = list("service")
/obj/machinery/telecomms/server/presets/service/initialize()
..()
freq_listening = list(SER_FREQ)
/obj/machinery/telecomms/server/presets/common
id = "Common Server"
freq_listening = list(1345)
autolinkers = list("common")
/obj/machinery/telecomms/server/presets/common/initialize()
..()
freq_listening = list(COMMON_FREQ)
//Common and other radio frequencies for people to freely use
// 1441 to 1489
/obj/machinery/telecomms/server/presets/common/New()
for(var/i = 1441, i < 1489, i += 2)
if(radiochannelsreverse.Find("[i]"))
continue
freq_listening |= i
..()
@@ -185,19 +219,27 @@
/obj/machinery/telecomms/server/presets/command
id = "Command Server"
freq_listening = list(1353)
autolinkers = list("command")
/obj/machinery/telecomms/server/presets/command/initialize()
..()
freq_listening = list(COMM_FREQ)
/obj/machinery/telecomms/server/presets/engineering
id = "Engineering Server"
freq_listening = list(1357)
autolinkers = list("engineering")
/obj/machinery/telecomms/server/presets/engineering/initialize()
..()
freq_listening = list(ENG_FREQ)
/obj/machinery/telecomms/server/presets/security
id = "Security Server"
freq_listening = list(1359)
autolinkers = list("security")
/obj/machinery/telecomms/server/presets/security/initialize()
..()
freq_listening = list(SEC_FREQ)
//Broadcasters

View File

@@ -172,7 +172,10 @@
/obj/item/device/radio/intercom/medbay
name = "station intercom (Medbay)"
frequency = 1485
/obj/item/device/radio/intercom/medbay/initialize()
..()
set_frequency(MED_FREQ)
/obj/item/device/radio/intercom/medbay/broadcast_nospeaker
broadcasting = 1

View File

@@ -7,7 +7,7 @@
var/illegalradio_construction = 0
var/on = 1 // 0 for off
var/last_transmission
var/frequency = 1459 //common chat
var/frequency = 1459
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/obj/item/device/radio/patch_link = null
@@ -62,7 +62,7 @@
/obj/item/device/radio/initialize()
frequency = COMMON_FREQ //common chat
if(freerange)
if(frequency < 1200 || frequency > 1600)
frequency = sanitize_frequency(frequency, maxf)

View File

@@ -22,37 +22,6 @@ var/global/lastDecTalkUse = 0
This file has the basic atom/movable level speech procs.
And the base of the send_speech() proc, which is the core of saycode.
*/
var/list/freqtospan = list(
"1459" = "commonradio",
"1351" = "sciradio",
"1355" = "medradio",
"1357" = "engradio",
"1347" = "supradio",
"1349" = "serradio",
"1359" = "secradio",
"1353" = "comradio",
"1447" = "aiprivradio",
"1213" = "syndradio",
"1441" = "dsquadradio",
"1345" = "resteamradio",
"1215" = "raiderradio",
)
var/list/freqtoname = list(
"1459" = "Common",
"1351" = "Science",
"1353" = "Command",
"1355" = "Medical",
"1357" = "Engineering",
"1359" = "Security",
"1441" = "Deathsquad",
"1213" = "Syndicate",
"1347" = "Supply",
"1349" = "Service",
"1447" = "AI Private",
"1345" = "Response Team",
"1215" = "Raider",
)
/atom/movable/proc/say(message, var/datum/language/speaking, var/atom/movable/radio=src, var/class) //so we can force nonmobs to speak a certain language
if(!can_speak())

View File

@@ -484,7 +484,21 @@ var/global/list/paper_folding_results = list ( \
/obj/item/weapon/paper/intercoms
name = "paper - 'Ace Reporter Intercom manual'"
info = "<B>Welcome new owner!</B><BR><BR>You have purchased the latest in listening equipment. The telecommunication setup we created is the best in listening to common and private radio fequencies.Now to listen to the private channels, you'll have to configure the intercoms.<br> Here is a list of frequencies for you to listen on.<br><ul><li>145.9 - Common Channel</li><li>144.7 - Private AI Channel</li><li>135.9 - Security Channel</li><li>135.7 - Engineering Channel</li><li>135.5 - Medical Channel</li><li>135.3 - Command Channel</li><li>135.1 - Science Channel</li><li>134.9 - Service Channel</li><li>134.7 - Supply Channel</li>"
/obj/item/weapon/paper/intercoms/initialize()
..()
info = "<B>Welcome new owner!</B><BR><BR>You have purchased the latest in listening equipment. The telecommunication setup we created is the best in listening to common and private radio fequencies.Now to listen to the private channels, you'll have to configure the intercoms.<br>\
Here is a list of frequencies for you to listen on.<br>\
<ul>\
<li>[COMMON_FREQ] - Common Channel</li>\
<li>[AIPRIV_FREQ] - Private AI Channel</li>\
<li>[SEC_FREQ] - Security Channel</li>\
<li>[ENG_FREQ] - Engineering Channel</li>\
<li>[MED_FREQ] - Medical Channel</li>\
<li>[COMM_FREQ] - Command Channel</li>\
<li>[SCI_FREQ] - Science Channel</li>\
<li>[SER_FREQ] - Service Channel</li>\
<li>[SUP_FREQ] - Supply Channel</li>"
/obj/item/weapon/paper/flag
icon_state = "flag_neutral"

View File

@@ -76,13 +76,13 @@
interpreter.SetVar("WEST", WEST) // WEST (8)
// Channel macros
interpreter.SetVar("$common", 1459)
interpreter.SetVar("$science", 1351)
interpreter.SetVar("$command", 1353)
interpreter.SetVar("$medical", 1355)
interpreter.SetVar("$engineering", 1357)
interpreter.SetVar("$security", 1359)
interpreter.SetVar("$supply", 1347)
interpreter.SetVar("$common", COMMON_FREQ)
interpreter.SetVar("$science", SCI_FREQ)
interpreter.SetVar("$command", COMM_FREQ)
interpreter.SetVar("$medical", MED_FREQ)
interpreter.SetVar("$engineering", ENG_FREQ)
interpreter.SetVar("$security", SEC_FREQ)
interpreter.SetVar("$supply", SUP_FREQ)
// Signal data

View File

@@ -102,7 +102,7 @@ var/savefile/panicfile
initialize_runesets()
initialize_beespecies()
generate_radio_frequencies()
//sun = new /datum/sun()
radio_controller = new /datum/controller/radio()
data_core = new /obj/effect/datacore()

View File

@@ -24,6 +24,7 @@
#include "__DEFINES\carbon_defines.dm"
#include "__DEFINES\clothing.dm"
#include "__DEFINES\colors.dm"
#include "__DEFINES\communications.dm"
#include "__DEFINES\component_desires.dm"
#include "__DEFINES\component_signals.dm"
#include "__DEFINES\dates.dm"