[MIRROR] new to init (radios) (#10085)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-02-07 08:56:04 -07:00
committed by GitHub
parent f6033a35da
commit 440e4e907b
11 changed files with 121 additions and 112 deletions

View File

@@ -22,9 +22,9 @@
var/obj/item/radio/intercom/announce // Integreated announcer var/obj/item/radio/intercom/announce // Integreated announcer
/obj/machinery/computer/timeclock/New() /obj/machinery/computer/timeclock/Initialize()
. = ..()
announce = new /obj/item/radio/intercom(src) announce = new /obj/item/radio/intercom(src)
..()
/obj/machinery/computer/timeclock/Destroy() /obj/machinery/computer/timeclock/Destroy()
if(card) if(card)

View File

@@ -290,9 +290,9 @@
time_till_despawn = 60 //1 second, because gateway. time_till_despawn = 60 //1 second, because gateway.
/obj/machinery/cryopod/New() /obj/machinery/cryopod/Initialize()
. = ..()
announce = new /obj/item/radio/intercom(src) announce = new /obj/item/radio/intercom(src)
..()
/obj/machinery/cryopod/Destroy() /obj/machinery/cryopod/Destroy()
if(occupant) if(occupant)

View File

@@ -5,14 +5,14 @@
icon_state = "headset" icon_state = "headset"
item_state = null //To remove the radio's state item_state = null //To remove the radio's state
matter = list(MAT_STEEL = 75) matter = list(MAT_STEEL = 75)
subspace_transmission = 1 subspace_transmission = TRUE
canhear_range = 0 // can't hear headsets from very far away canhear_range = 0 // can't hear headsets from very far away
slot_flags = SLOT_EARS slot_flags = SLOT_EARS
sprite_sheets = list(SPECIES_TESHARI = 'icons/inventory/ears/mob_teshari.dmi', sprite_sheets = list(SPECIES_TESHARI = 'icons/inventory/ears/mob_teshari.dmi',
SPECIES_WEREBEAST = 'icons/inventory/ears/mob_vr_werebeast.dmi') SPECIES_WEREBEAST = 'icons/inventory/ears/mob_vr_werebeast.dmi')
var/translate_binary = 0 var/translate_binary = FALSE
var/translate_hive = 0 var/translate_hive = FALSE
var/obj/item/encryptionkey/keyslot1 = null var/obj/item/encryptionkey/keyslot1 = null
var/obj/item/encryptionkey/keyslot2 = null var/obj/item/encryptionkey/keyslot2 = null
var/ks1type = null var/ks1type = null
@@ -21,14 +21,14 @@
drop_sound = 'sound/items/drop/component.ogg' drop_sound = 'sound/items/drop/component.ogg'
pickup_sound = 'sound/items/pickup/component.ogg' pickup_sound = 'sound/items/pickup/component.ogg'
/obj/item/radio/headset/New() /obj/item/radio/headset/Initialize()
..() . = ..()
internal_channels.Cut() internal_channels.Cut()
if(ks1type) if(ks1type)
keyslot1 = new ks1type(src) keyslot1 = new ks1type(src)
if(ks2type) if(ks2type)
keyslot2 = new ks2type(src) keyslot2 = new ks2type(src)
recalculateChannels(1) recalculateChannels(TRUE)
/obj/item/radio/headset/Destroy() /obj/item/radio/headset/Destroy()
qdel(keyslot1) qdel(keyslot1)
@@ -144,11 +144,11 @@
return return
/obj/item/radio/headset/recalculateChannels(var/setDescription = 0) /obj/item/radio/headset/recalculateChannels(var/setDescription = FALSE)
src.channels = list() src.channels = list()
src.translate_binary = 0 src.translate_binary = FALSE
src.translate_hive = 0 src.translate_hive = FALSE
src.syndie = 0 src.syndie = FALSE
if(keyslot1) if(keyslot1)
for(var/ch_name in keyslot1.channels) for(var/ch_name in keyslot1.channels)
@@ -158,13 +158,13 @@
src.channels[ch_name] = keyslot1.channels[ch_name] src.channels[ch_name] = keyslot1.channels[ch_name]
if(keyslot1.translate_binary) if(keyslot1.translate_binary)
src.translate_binary = 1 src.translate_binary = TRUE
if(keyslot1.translate_hive) if(keyslot1.translate_hive)
src.translate_hive = 1 src.translate_hive = TRUE
if(keyslot1.syndie) if(keyslot1.syndie)
src.syndie = 1 src.syndie = TRUE
if(keyslot2) if(keyslot2)
for(var/ch_name in keyslot2.channels) for(var/ch_name in keyslot2.channels)
@@ -174,29 +174,32 @@
src.channels[ch_name] = keyslot2.channels[ch_name] src.channels[ch_name] = keyslot2.channels[ch_name]
if(keyslot2.translate_binary) if(keyslot2.translate_binary)
src.translate_binary = 1 src.translate_binary = TRUE
if(keyslot2.translate_hive) if(keyslot2.translate_hive)
src.translate_hive = 1 src.translate_hive = TRUE
if(keyslot2.syndie) if(keyslot2.syndie)
src.syndie = 1 src.syndie = TRUE
handle_finalize_recalculatechannels(setDescription, TRUE)
/obj/item/radio/headset/proc/handle_finalize_recalculatechannels(var/setDescription = FALSE, var/initial_run = FALSE)
PRIVATE_PROC(TRUE)
SHOULD_NOT_OVERRIDE(TRUE)
if(!radio_controller && initial_run)
addtimer(CALLBACK(src,PROC_REF(handle_finalize_recalculatechannels),setDescription, FALSE),3 SECONDS)
return
if(!radio_controller && !initial_run)
name = "broken radio headset"
return
for (var/ch_name in channels) for (var/ch_name in channels)
if(!radio_controller)
sleep(30) // Waiting for the radio_controller to be created.
if(!radio_controller)
src.name = "broken radio headset"
return
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT) secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
if(setDescription) if(setDescription)
setupRadioDescription() setupRadioDescription()
return
/obj/item/radio/headset/proc/setupRadioDescription() /obj/item/radio/headset/proc/setupRadioDescription()
var/radio_text = "" var/radio_text = ""
for(var/i = 1 to channels.len) for(var/i = 1 to channels.len)

View File

@@ -2,12 +2,12 @@
listening = 0 //CHOMP Edit: Temporary bandaid fix for comms lag. listening = 0 //CHOMP Edit: Temporary bandaid fix for comms lag.
name = "station intercom (General)" name = "station intercom (General)"
desc = "Talk through this." desc = "Talk through this."
icon = 'icons/obj/radio_vr.dmi' //VOREStation Edit - New Icon icon = 'icons/obj/radio_vr.dmi'
icon_state = "intercom" icon_state = "intercom"
layer = ABOVE_WINDOW_LAYER layer = ABOVE_WINDOW_LAYER
anchored = TRUE anchored = TRUE
w_class = ITEMSIZE_LARGE w_class = ITEMSIZE_LARGE
canhear_range = 7 //VOREStation Edit canhear_range = 7
flags = NOBLOODY flags = NOBLOODY
light_color = "#00ff00" light_color = "#00ff00"
light_power = 0.25 light_power = 0.25
@@ -15,7 +15,7 @@
vis_flags = VIS_HIDE // They have an emissive that looks bad in openspace due to their wall-mounted nature vis_flags = VIS_HIDE // They have an emissive that looks bad in openspace due to their wall-mounted nature
var/circuit = /obj/item/circuitboard/intercom var/circuit = /obj/item/circuitboard/intercom
var/number = 0 var/number = 0
var/wiresexposed = 0 var/wiresexposed = FALSE
/obj/item/radio/intercom/Initialize() /obj/item/radio/intercom/Initialize()
. = ..() . = ..()
@@ -34,8 +34,8 @@
/obj/item/radio/intercom/custom /obj/item/radio/intercom/custom
name = "station intercom (Custom)" name = "station intercom (Custom)"
broadcasting = 0 broadcasting = FALSE
listening = 0 listening = FALSE
/obj/item/radio/intercom/interrogation /obj/item/radio/intercom/interrogation
name = "station intercom (Interrogation)" name = "station intercom (Interrogation)"
@@ -54,13 +54,13 @@
/obj/item/radio/intercom/specops /obj/item/radio/intercom/specops
name = "\improper Spec Ops intercom" name = "\improper Spec Ops intercom"
frequency = ERT_FREQ frequency = ERT_FREQ
subspace_transmission = 1 subspace_transmission = TRUE
centComm = 1 centComm = TRUE
/obj/item/radio/intercom/department /obj/item/radio/intercom/department
canhear_range = 5 canhear_range = 5
broadcasting = 0 broadcasting = FALSE
listening = 1 listening = TRUE
/obj/item/radio/intercom/department/medbay /obj/item/radio/intercom/department/medbay
name = "station intercom (Medbay)" name = "station intercom (Medbay)"
@@ -84,23 +84,23 @@
channels = radiochannels.Copy() channels = radiochannels.Copy()
return ..() return ..()
/obj/item/radio/intercom/New() /obj/item/radio/intercom/Initialize()
..() . = ..()
circuit = new circuit(src) circuit = new circuit(src)
/obj/item/radio/intercom/department/medbay/New() /obj/item/radio/intercom/department/medbay/Initialize()
..() . = ..()
internal_channels = default_medbay_channels.Copy() internal_channels = default_medbay_channels.Copy()
/obj/item/radio/intercom/department/security/New() /obj/item/radio/intercom/department/security/Initialize()
..() . = ..()
internal_channels = list( internal_channels = list(
num2text(PUB_FREQ) = list(), num2text(PUB_FREQ) = list(),
num2text(SEC_I_FREQ) = list(access_security) num2text(SEC_I_FREQ) = list(access_security)
) )
/obj/item/radio/intercom/entertainment/New() /obj/item/radio/intercom/entertainment/Initialize()
..() . = ..()
internal_channels = list( internal_channels = list(
num2text(PUB_FREQ) = list(), num2text(PUB_FREQ) = list(),
num2text(ENT_FREQ) = list() num2text(ENT_FREQ) = list()
@@ -110,22 +110,22 @@
name = "illicit intercom" name = "illicit intercom"
desc = "Talk through this. Evilly" desc = "Talk through this. Evilly"
frequency = SYND_FREQ frequency = SYND_FREQ
subspace_transmission = 1 subspace_transmission = TRUE
syndie = 1 syndie = TRUE
/obj/item/radio/intercom/syndicate/New() /obj/item/radio/intercom/syndicate/Initialize()
..() . = ..()
internal_channels[num2text(SYND_FREQ)] = list(access_syndicate) internal_channels[num2text(SYND_FREQ)] = list(access_syndicate)
/obj/item/radio/intercom/raider /obj/item/radio/intercom/raider
name = "illicit intercom" name = "illicit intercom"
desc = "Pirate radio, but not in the usual sense of the word." desc = "Pirate radio, but not in the usual sense of the word."
frequency = RAID_FREQ frequency = RAID_FREQ
subspace_transmission = 1 subspace_transmission = TRUE
syndie = 1 syndie = TRUE
/obj/item/radio/intercom/raider/New() /obj/item/radio/intercom/raider/Initialize()
..() . = ..()
internal_channels[num2text(RAID_FREQ)] = list(access_syndicate) internal_channels[num2text(RAID_FREQ)] = list(access_syndicate)
/obj/item/radio/intercom/attack_ai(mob/user as mob) /obj/item/radio/intercom/attack_ai(mob/user as mob)
@@ -230,8 +230,8 @@
/obj/item/radio/intercom/locked/ai_private /obj/item/radio/intercom/locked/ai_private
name = "\improper AI intercom" name = "\improper AI intercom"
frequency = AI_FREQ frequency = AI_FREQ
broadcasting = 1 broadcasting = TRUE
listening = 1 listening = TRUE
/obj/item/radio/intercom/locked/confessional /obj/item/radio/intercom/locked/confessional
name = "confessional intercom" name = "confessional intercom"

View File

@@ -34,7 +34,8 @@ var/global/list/active_radio_jammers = list()
pickup_sound = 'sound/items/pickup/device.ogg' pickup_sound = 'sound/items/pickup/device.ogg'
drop_sound = 'sound/items/drop/device.ogg' drop_sound = 'sound/items/drop/device.ogg'
/obj/item/radio_jammer/New() /obj/item/radio_jammer/Initialize()
. = ..()
power_source = new(src) power_source = new(src)
update_icon() // So it starts with the full overlay. update_icon() // So it starts with the full overlay.

View File

@@ -27,8 +27,8 @@ var/global/list/default_medbay_channels = list(
//VOREStation Edit End //VOREStation Edit End
/obj/item/radio /obj/item/radio
icon = 'icons/obj/radio_vr.dmi' //VOREStation Edit icon = 'icons/obj/radio_vr.dmi'
name = "shortwave radio" //VOREStation Edit name = "shortwave radio"
desc = "Used to talk to people when headsets don't function. Range is limited." desc = "Used to talk to people when headsets don't function. Range is limited."
suffix = "\[3\]" suffix = "\[3\]"
icon_state = "walkietalkie" icon_state = "walkietalkie"
@@ -42,19 +42,19 @@ var/global/list/default_medbay_channels = list(
var/loudspeaker = TRUE // Allows borgs to disable canhear_range. var/loudspeaker = TRUE // Allows borgs to disable canhear_range.
var/datum/wires/radio/wires = null var/datum/wires/radio/wires = null
var/b_stat = 0 var/b_stat = 0
var/broadcasting = 0 var/broadcasting = FALSE
var/listening = 1 var/listening = TRUE
var/list/channels = list() //see communications.dm for full list. First channel is a "default" for :h var/list/channels = list() //see communications.dm for full list. First channel is a "default" for :h
var/subspace_transmission = 0 var/subspace_transmission = FALSE
var/subspace_switchable = FALSE var/subspace_switchable = FALSE
var/adhoc_fallback = FALSE //Falls back to 'radio' mode if subspace not available var/adhoc_fallback = FALSE //Falls back to 'radio' mode if subspace not available
var/syndie = 0//Holder to see if it's a syndicate encrypted radio var/syndie = FALSE//Holder to see if it's a syndicate encrypted radio
var/centComm = 0//Holder to see if it's a CentCom encrypted radio var/centComm = FALSE//Holder to see if it's a CentCom encrypted radio
slot_flags = SLOT_BELT slot_flags = SLOT_BELT
throw_speed = 2 throw_speed = 2
throw_range = 9 throw_range = 9
w_class = ITEMSIZE_SMALL w_class = ITEMSIZE_SMALL
show_messages = 1 show_messages = TRUE
// Bluespace radios talk directly to telecomms equipment // Bluespace radios talk directly to telecomms equipment
var/bluespace_radio = FALSE var/bluespace_radio = FALSE
@@ -75,23 +75,6 @@ var/global/list/default_medbay_channels = list(
frequency = new_frequency frequency = new_frequency
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
/obj/item/radio/New()
..()
wires = new(src)
internal_channels = default_internal_channels.Copy()
listening_objects += src
/obj/item/radio/Destroy()
qdel(wires)
wires = null
listening_objects -= src
if(radio_controller)
radio_controller.remove_object(src, frequency)
for (var/ch_name in channels)
radio_controller.remove_object(src, radiochannels[ch_name])
return ..()
/obj/item/radio/Initialize() /obj/item/radio/Initialize()
. = ..() . = ..()
if(frequency < RADIO_LOW_FREQ || frequency > RADIO_HIGH_FREQ) if(frequency < RADIO_LOW_FREQ || frequency > RADIO_HIGH_FREQ)
@@ -137,6 +120,21 @@ var/global/list/default_medbay_channels = list(
if(!found) if(!found)
testing("A radio [src] at [x],[y],[z] specified bluespace prelink IDs, but the machines with corresponding IDs ([bs_tx_preload_id], [bs_rx_preload_id]) couldn't be found.") testing("A radio [src] at [x],[y],[z] specified bluespace prelink IDs, but the machines with corresponding IDs ([bs_tx_preload_id], [bs_rx_preload_id]) couldn't be found.")
wires = new(src)
internal_channels = default_internal_channels.Copy()
listening_objects += src
return INITIALIZE_HINT_LATELOAD
/obj/item/radio/Destroy()
qdel(wires)
wires = null
listening_objects -= src
if(radio_controller)
radio_controller.remove_object(src, frequency)
for (var/ch_name in channels)
radio_controller.remove_object(src, radiochannels[ch_name])
return ..()
/obj/item/radio/proc/recalculateChannels() /obj/item/radio/proc/recalculateChannels()
return return
@@ -728,17 +726,21 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
if(keyslot.syndie) if(keyslot.syndie)
src.syndie = 1 src.syndie = 1
for (var/ch_name in src.channels) controller_check(TRUE)
if(!radio_controller)
sleep(30) // Waiting for the radio_controller to be created.
if(!radio_controller)
src.name = "broken radio"
return
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
return return
/obj/item/radio/borg/proc/controller_check(var/initial_run = FALSE)
PRIVATE_PROC(TRUE)
SHOULD_NOT_OVERRIDE(TRUE)
if(!radio_controller && initial_run)
addtimer(CALLBACK(src,PROC_REF(controller_check), FALSE),3 SECONDS)
return
if(!radio_controller && !initial_run)
name = "broken radio headset"
return
for (var/ch_name in channels)
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
/obj/item/radio/proc/config(op) /obj/item/radio/proc/config(op)
if(radio_controller) if(radio_controller)
for (var/ch_name in channels) for (var/ch_name in channels)
@@ -764,6 +766,6 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
/obj/item/radio/phone/medbay /obj/item/radio/phone/medbay
frequency = MED_I_FREQ frequency = MED_I_FREQ
/obj/item/radio/phone/medbay/New() /obj/item/radio/phone/medbay/Initialize()
..() . = ..()
internal_channels = default_medbay_channels.Copy() internal_channels = default_medbay_channels.Copy()

View File

@@ -1,5 +1,5 @@
/obj/item/radio/phone /obj/item/radio/phone
subspace_transmission = 1 subspace_transmission = TRUE
canhear_range = 0 canhear_range = 0
adhoc_fallback = TRUE adhoc_fallback = TRUE
@@ -7,11 +7,11 @@
name = "Medbay Emergency Radio Link" name = "Medbay Emergency Radio Link"
icon_state = "med_walkietalkie" icon_state = "med_walkietalkie"
frequency = MED_I_FREQ frequency = MED_I_FREQ
subspace_transmission = 1 subspace_transmission = TRUE
adhoc_fallback = TRUE adhoc_fallback = TRUE
/obj/item/radio/emergency/New() /obj/item/radio/emergency/Initialize()
..() . = ..()
internal_channels = default_medbay_channels.Copy() internal_channels = default_medbay_channels.Copy()

View File

@@ -217,7 +217,7 @@
// //
// Includes normal radio uplink, multitool uplink, // Includes normal radio uplink, multitool uplink,
// implant uplink (not the implant tool) and a preset headset uplink. // implant uplink (not the implant tool) and a preset headset uplink.
/obj/item/radio/uplink/New() /obj/item/radio/uplink/Initialize()
..() ..()
hidden_uplink = new(src) hidden_uplink = new(src)
icon_state = "radio" icon_state = "radio"
@@ -237,6 +237,6 @@
/obj/item/radio/headset/uplink /obj/item/radio/headset/uplink
traitor_frequency = 1445 traitor_frequency = 1445
/obj/item/radio/headset/uplink/New() /obj/item/radio/headset/uplink/Initialize()
..() . = ..()
hidden_uplink = new(src) hidden_uplink = new(src)

View File

@@ -771,7 +771,7 @@
mob_radio.frequency = PUB_FREQ mob_radio.frequency = PUB_FREQ
mob_radio.ks2type = /obj/item/encryptionkey/heads/captain //Might not be able to speak, but the catslug can listen. mob_radio.ks2type = /obj/item/encryptionkey/heads/captain //Might not be able to speak, but the catslug can listen.
mob_radio.keyslot2 = new /obj/item/encryptionkey/heads/captain(mob_radio) mob_radio.keyslot2 = new /obj/item/encryptionkey/heads/captain(mob_radio)
mob_radio.recalculateChannels(1) mob_radio.recalculateChannels(TRUE)
//============================================================================= //=============================================================================
//Admin-spawn only catslugs below - Expect overpowered things & silliness below //Admin-spawn only catslugs below - Expect overpowered things & silliness below
@@ -854,10 +854,10 @@
. = ..() . = ..()
mob_radio = new /obj/item/radio/headset/mob_headset(src) mob_radio = new /obj/item/radio/headset/mob_headset(src)
mob_radio.frequency = SYND_FREQ mob_radio.frequency = SYND_FREQ
mob_radio.syndie = 1 mob_radio.syndie = TRUE
mob_radio.ks2type = /obj/item/encryptionkey/syndicate mob_radio.ks2type = /obj/item/encryptionkey/syndicate
mob_radio.keyslot2 = new /obj/item/encryptionkey/syndicate(mob_radio) mob_radio.keyslot2 = new /obj/item/encryptionkey/syndicate(mob_radio)
mob_radio.recalculateChannels(1) mob_radio.recalculateChannels(TRUE)
myid.access |= get_all_station_access() myid.access |= get_all_station_access()
//ERT catslug //ERT catslug
@@ -901,7 +901,7 @@
mob_radio.centComm = 1 mob_radio.centComm = 1
mob_radio.ks2type = /obj/item/encryptionkey/ert mob_radio.ks2type = /obj/item/encryptionkey/ert
mob_radio.keyslot2 = new /obj/item/encryptionkey/ert(mob_radio) mob_radio.keyslot2 = new /obj/item/encryptionkey/ert(mob_radio)
mob_radio.recalculateChannels(1) mob_radio.recalculateChannels(TRUE)
myid.access |= get_all_station_access() myid.access |= get_all_station_access()
//Pilot Catslug //Pilot Catslug

View File

@@ -17,13 +17,15 @@
on = 0 //Are we currently active?? on = 0 //Are we currently active??
var/menu_message = "" var/menu_message = ""
/obj/item/radio/integrated/New() /obj/item/radio/integrated/Initialize()
..() ..()
if(istype(loc.loc, /obj/item/pda)) if(istype(loc.loc, /obj/item/pda))
hostpda = loc.loc hostpda = loc.loc
return INITIALIZE_HINT_LATELOAD
/obj/item/radio/integrated/LateInitialize()
if(bot_filter) if(bot_filter)
spawn(5) add_to_radio(bot_filter)
add_to_radio(bot_filter)
/obj/item/radio/integrated/Destroy() /obj/item/radio/integrated/Destroy()
if(radio_controller) if(radio_controller)

View File

@@ -19,12 +19,13 @@
turbolifts -= src turbolifts -= src
return ..() return ..()
/obj/turbolift_map_holder/New()
turbolifts += src
..()
/obj/turbolift_map_holder/Initialize() /obj/turbolift_map_holder/Initialize()
. = ..() ..()
turbolifts += src
return INITIALIZE_HINT_LATELOAD
/obj/turbolift_map_holder/LateInitialize()
..()
// Create our system controller. // Create our system controller.
var/datum/turbolift/lift = new() var/datum/turbolift/lift = new()