[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
/obj/machinery/computer/timeclock/New()
/obj/machinery/computer/timeclock/Initialize()
. = ..()
announce = new /obj/item/radio/intercom(src)
..()
/obj/machinery/computer/timeclock/Destroy()
if(card)

View File

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

View File

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

View File

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

View File

@@ -34,7 +34,8 @@ var/global/list/active_radio_jammers = list()
pickup_sound = 'sound/items/pickup/device.ogg'
drop_sound = 'sound/items/drop/device.ogg'
/obj/item/radio_jammer/New()
/obj/item/radio_jammer/Initialize()
. = ..()
power_source = new(src)
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
/obj/item/radio
icon = 'icons/obj/radio_vr.dmi' //VOREStation Edit
name = "shortwave radio" //VOREStation Edit
icon = 'icons/obj/radio_vr.dmi'
name = "shortwave radio"
desc = "Used to talk to people when headsets don't function. Range is limited."
suffix = "\[3\]"
icon_state = "walkietalkie"
@@ -42,19 +42,19 @@ var/global/list/default_medbay_channels = list(
var/loudspeaker = TRUE // Allows borgs to disable canhear_range.
var/datum/wires/radio/wires = null
var/b_stat = 0
var/broadcasting = 0
var/listening = 1
var/broadcasting = FALSE
var/listening = TRUE
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/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/centComm = 0//Holder to see if it's a CentCom encrypted radio
var/syndie = FALSE//Holder to see if it's a syndicate encrypted radio
var/centComm = FALSE//Holder to see if it's a CentCom encrypted radio
slot_flags = SLOT_BELT
throw_speed = 2
throw_range = 9
w_class = ITEMSIZE_SMALL
show_messages = 1
show_messages = TRUE
// Bluespace radios talk directly to telecomms equipment
var/bluespace_radio = FALSE
@@ -75,23 +75,6 @@ var/global/list/default_medbay_channels = list(
frequency = new_frequency
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()
. = ..()
if(frequency < RADIO_LOW_FREQ || frequency > RADIO_HIGH_FREQ)
@@ -137,6 +120,21 @@ var/global/list/default_medbay_channels = list(
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.")
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()
return
@@ -728,17 +726,21 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
if(keyslot.syndie)
src.syndie = 1
for (var/ch_name in src.channels)
if(!radio_controller)
sleep(30) // Waiting for the radio_controller to be created.
if(!radio_controller)
src.name = "broken radio"
controller_check(TRUE)
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)
return
/obj/item/radio/proc/config(op)
if(radio_controller)
for (var/ch_name in channels)
@@ -764,6 +766,6 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
/obj/item/radio/phone/medbay
frequency = MED_I_FREQ
/obj/item/radio/phone/medbay/New()
..()
/obj/item/radio/phone/medbay/Initialize()
. = ..()
internal_channels = default_medbay_channels.Copy()

View File

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

View File

@@ -217,7 +217,7 @@
//
// Includes normal radio uplink, multitool 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)
icon_state = "radio"
@@ -237,6 +237,6 @@
/obj/item/radio/headset/uplink
traitor_frequency = 1445
/obj/item/radio/headset/uplink/New()
..()
/obj/item/radio/headset/uplink/Initialize()
. = ..()
hidden_uplink = new(src)

View File

@@ -771,7 +771,7 @@
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.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
@@ -854,10 +854,10 @@
. = ..()
mob_radio = new /obj/item/radio/headset/mob_headset(src)
mob_radio.frequency = SYND_FREQ
mob_radio.syndie = 1
mob_radio.syndie = TRUE
mob_radio.ks2type = /obj/item/encryptionkey/syndicate
mob_radio.keyslot2 = new /obj/item/encryptionkey/syndicate(mob_radio)
mob_radio.recalculateChannels(1)
mob_radio.recalculateChannels(TRUE)
myid.access |= get_all_station_access()
//ERT catslug
@@ -901,7 +901,7 @@
mob_radio.centComm = 1
mob_radio.ks2type = /obj/item/encryptionkey/ert
mob_radio.keyslot2 = new /obj/item/encryptionkey/ert(mob_radio)
mob_radio.recalculateChannels(1)
mob_radio.recalculateChannels(TRUE)
myid.access |= get_all_station_access()
//Pilot Catslug

View File

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

View File

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