Auto stash before revert of "Merge pull request #14289 from Dovixx/SSD-portal"

This commit is contained in:
Shadow Quill
2020-09-16 14:17:04 -05:00
1137 changed files with 33060 additions and 25040 deletions
@@ -1,192 +0,0 @@
//copy pasta of the space piano, don't hurt me -Pete
/obj/item/instrument
name = "generic instrument"
icon = 'icons/obj/musician.dmi'
lefthand_file = 'icons/mob/inhands/equipment/instruments_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/instruments_righthand.dmi'
resistance_flags = FLAMMABLE
max_integrity = 100
var/datum/song/handheld/song
var/instrumentId = "generic"
var/instrumentExt = "mid"
/obj/item/instrument/New()
song = new(instrumentId, src, instrumentExt)
..()
/obj/item/instrument/Destroy()
QDEL_NULL(song)
return ..()
/obj/item/instrument/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] begins to play 'Gloomy Sunday'! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS
/obj/item/instrument/Initialize(mapload)
song.tempo = song.sanitize_tempo(song.tempo) // tick_lag isn't set when the map is loaded
..()
/obj/item/instrument/attack_self(mob/user)
ui_interact(user)
/obj/item/instrument/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1)
if(!isliving(user) || user.incapacitated())
return
song.ui_interact(user, ui_key, ui, force_open)
/obj/item/instrument/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
return song.ui_data(user, ui_key, state)
/obj/item/instrument/Topic(href, href_list)
song.Topic(href, href_list)
/obj/item/instrument/violin
name = "space violin"
desc = "A wooden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\""
icon_state = "violin"
item_state = "violin"
instrumentExt = "ogg"
force = 10
hitsound = "swing_hit"
instrumentId = "violin"
/obj/item/instrument/violin/golden
name = "golden violin"
desc = "A golden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\""
icon_state = "golden_violin"
item_state = "golden_violin"
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
/obj/item/instrument/piano_synth
name = "synthesizer"
desc = "An advanced electronic synthesizer that can be used as various instruments."
icon_state = "synth"
item_state = "synth"
instrumentId = "piano"
instrumentExt = "ogg"
var/static/list/insTypes = list("accordion" = "mid", "glockenspiel" = "mid", "guitar" = "ogg", "eguitar" = "ogg", "harmonica" = "mid", "piano" = "ogg", "recorder" = "mid", "saxophone" = "mid", "trombone" = "mid", "violin" = "ogg", "xylophone" = "mid")
actions_types = list(/datum/action/item_action/synthswitch)
/obj/item/instrument/piano_synth/proc/changeInstrument(name = "piano")
song.instrumentDir = name
song.instrumentExt = insTypes[name]
/obj/item/instrument/guitar
name = "guitar"
desc = "It's made of wood and has bronze strings."
icon_state = "guitar"
item_state = "guitar"
instrumentExt = "ogg"
force = 10
attack_verb = list("played metal on", "serenaded", "crashed", "smashed")
hitsound = 'sound/effects/guitarsmash.ogg'
instrumentId = "guitar"
/obj/item/instrument/eguitar
name = "electric guitar"
desc = "Makes all your shredding needs possible."
icon_state = "eguitar"
item_state = "eguitar"
instrumentExt = "ogg"
force = 12
attack_verb = list("played metal on", "shredded", "crashed", "smashed")
hitsound = 'sound/weapons/stringsmash.ogg'
instrumentId = "eguitar"
/obj/item/instrument/glockenspiel
name = "glockenspiel"
desc = "Smooth metal bars perfect for any marching band."
icon_state = "glockenspiel"
item_state = "glockenspiel"
instrumentId = "glockenspiel"
/obj/item/instrument/accordion
name = "accordion"
desc = "Pun-Pun not included."
icon_state = "accordion"
item_state = "accordion"
instrumentId = "accordion"
/obj/item/instrument/saxophone
name = "saxophone"
desc = "This soothing sound will be sure to leave your audience in tears."
icon_state = "saxophone"
item_state = "saxophone"
instrumentId = "saxophone"
/obj/item/instrument/trombone
name = "trombone"
desc = "How can any pool table ever hope to compete?"
icon_state = "trombone"
item_state = "trombone"
instrumentId = "trombone"
/obj/item/instrument/recorder
name = "recorder"
desc = "Just like in school, playing ability and all."
icon_state = "recorder"
item_state = "recorder"
instrumentId = "recorder"
/obj/item/instrument/harmonica
name = "harmonica"
desc = "For when you get a bad case of the space blues."
icon_state = "harmonica"
item_state = "harmonica"
instrumentId = "harmonica"
force = 5
w_class = WEIGHT_CLASS_SMALL
/obj/item/instrument/xylophone
name = "xylophone"
desc = "a percussion instrument with a bright tone."
icon_state = "xylophone"
item_state = "xylophone"
instrumentId = "xylophone"
/obj/item/instrument/bikehorn
name = "gilded bike horn"
desc = "An exquisitely decorated bike horn, capable of honking in a variety of notes."
icon_state = "bike_horn"
item_state = "bike_horn"
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
attack_verb = list("beautifully honks")
instrumentId = "bikehorn"
instrumentExt = "ogg"
w_class = WEIGHT_CLASS_TINY
force = 0
throw_speed = 3
throw_range = 7
hitsound = 'sound/items/bikehorn.ogg'
/datum/crafting_recipe/violin
name = "Violin"
result = /obj/item/instrument/violin
reqs = list(/obj/item/stack/sheet/wood = 5,
/obj/item/stack/cable_coil = 6,
/obj/item/stack/tape_roll = 5)
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
time = 80
category = CAT_MISC
/datum/crafting_recipe/guitar
name = "Guitar"
result = /obj/item/instrument/guitar
reqs = list(/obj/item/stack/sheet/wood = 5,
/obj/item/stack/cable_coil = 6,
/obj/item/stack/tape_roll = 5)
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
time = 80
category = CAT_MISC
/datum/crafting_recipe/eguitar
name = "Electric Guitar"
result = /obj/item/instrument/eguitar
reqs = list(/obj/item/stack/sheet/metal = 5,
/obj/item/stack/cable_coil = 6,
/obj/item/stack/tape_roll = 5)
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
time = 80
category = CAT_MISC
@@ -191,7 +191,7 @@
if(CanUse(U))
if(!Use(U))
return
to_chat(U, "<span class='notice'>You replace [target.fitting] with [src].</span>")
to_chat(U, "<span class='notice'>You replace the light [target.fitting] with [src].</span>")
if(target.status != LIGHT_EMPTY)
AddShards(1, U)
@@ -18,13 +18,6 @@
name = "syndicate personal AI device"
faction = list("syndicate")
/obj/item/paicard/relaymove(var/mob/user, var/direction)
if(user.stat || user.stunned)
return
var/obj/item/rig/rig = get_rig()
if(istype(rig))
rig.forced_move(direction, user)
/obj/item/paicard/New()
..()
overlays += "pai-off"
@@ -10,8 +10,6 @@
materials = list(MAT_METAL=10000, MAT_GLASS=2500)
var/code = 2
is_special = 1
/obj/item/radio/electropack/attack_hand(mob/user as mob)
if(src == user.back)
to_chat(user, "<span class='notice'>You need help taking this off!</span>")
@@ -54,23 +52,6 @@
if(src.flags & NODROP)
A.flags |= NODROP
/obj/item/radio/electropack/Topic(href, href_list)
if(..())
return 1
if(href_list["freq"])
var/new_frequency = sanitize_frequency(frequency + text2num(href_list["freq"]))
set_frequency(new_frequency)
else if(href_list["code"])
code += text2num(href_list["code"])
code = round(code)
code = clamp(code, 1, 100)
else if(href_list["power"])
on = !on
add_fingerprint(usr)
/obj/item/radio/electropack/receive_signal(datum/signal/signal)
if(!signal || signal.encryption != code)
@@ -96,18 +77,48 @@
return
/obj/item/radio/electropack/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/item/radio/electropack/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_inventory_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "radio_electro.tmpl", "[name]", 400, 500)
ui = new(user, src, ui_key, "Electropack", name, 360, 150, master_ui, state)
ui.open()
ui.set_auto_update(1)
/obj/item/radio/electropack/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
/obj/item/radio/electropack/tgui_data(mob/user)
var/list/data = list()
data["power"] = on
data["freq"] = format_frequency(frequency)
data["frequency"] = frequency
data["code"] = code
data["minFrequency"] = PUBLIC_LOW_FREQ
data["maxFrequency"] = PUBLIC_HIGH_FREQ
return data
/obj/item/radio/electropack/tgui_act(action, params)
if(..())
return
. = TRUE
switch(action)
if("power")
on = !on
if("freq")
var/value = params["freq"]
if(value)
frequency = sanitize_frequency(value)
set_frequency(frequency)
else
. = FALSE
if("code")
var/value = text2num(params["code"])
if(value)
value = round(value)
code = clamp(value, 1, 100)
else
. = FALSE
if("reset")
if(params["reset"] == "freq")
frequency = initial(frequency)
else if(params["reset"] == "code")
code = initial(code)
else
. = FALSE
if(.)
add_fingerprint(usr)
@@ -9,7 +9,6 @@
"Vox Armalis" = 'icons/mob/species/armalis/ears.dmi'
) //We read you loud and skree-er.
materials = list(MAT_METAL=75)
subspace_transmission = TRUE
canhear_range = 0 // can't hear headsets from very far away
slot_flags = SLOT_EARS
@@ -91,6 +90,7 @@
ks1type = /obj/item/encryptionkey/syndicate/nukeops
requires_tcomms = FALSE
instant = TRUE // Work instantly if there are no comms
freqlock = TRUE
/obj/item/radio/headset/syndicate/alt //undisguised bowman with flash protection
name = "syndicate headset"
@@ -289,6 +289,7 @@
icon_state = "com_headset"
item_state = "headset"
ks2type = /obj/item/encryptionkey/ert
freqlock = TRUE
/obj/item/radio/headset/ert/alt
name = "\proper emergency response team's bowman headset"
@@ -367,7 +368,7 @@
else
to_chat(user, "This headset doesn't have any encryption keys! How useless...")
/obj/item/radio/headset/proc/recalculateChannels(var/setDescription = FALSE)
/obj/item/radio/headset/recalculateChannels(setDescription = FALSE)
channels = list()
translate_binary = FALSE
translate_hive = FALSE
@@ -75,7 +75,6 @@
name = "illicit intercom"
desc = "Talk through this. Evilly"
frequency = SYND_FREQ
subspace_transmission = TRUE
syndiekey = new /obj/item/encryptionkey/syndicate/nukeops
/obj/item/radio/intercom/syndicate/New()
@@ -85,7 +84,6 @@
/obj/item/radio/intercom/pirate
name = "pirate radio intercom"
desc = "You wouldn't steal a space shuttle. Piracy. It's a crime!"
subspace_transmission = 1
/obj/item/radio/intercom/pirate/New()
..()
@@ -109,13 +107,13 @@
GLOB.global_intercoms.Remove(src)
return ..()
/obj/item/radio/intercom/attack_ai(mob/user as mob)
/obj/item/radio/intercom/attack_ai(mob/user)
add_hiddenprint(user)
add_fingerprint(user)
spawn(0)
attack_self(user)
/obj/item/radio/intercom/attack_hand(mob/user as mob)
/obj/item/radio/intercom/attack_hand(mob/user)
add_fingerprint(user)
spawn(0)
attack_self(user)
@@ -186,10 +184,10 @@
update_icon()
START_PROCESSING(SSobj, src)
for(var/i, i<= 5, i++)
wires.UpdateCut(i,1)
wires.on_cut(i, 1)
/obj/item/radio/intercom/wirecutter_act(mob/user, obj/item/I)
if(!(buildstage == 3 && b_stat && wires.IsAllCut()))
if(!(buildstage == 3 && b_stat && wires.is_all_cut()))
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
@@ -270,4 +268,4 @@
/obj/item/radio/intercom/locked/prison/New()
..()
wires.CutWireIndex(RADIO_WIRE_TRANSMIT)
wires.cut(WIRE_RADIO_TRANSMIT)
+119 -155
View File
@@ -26,21 +26,37 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
suffix = "\[3\]"
icon_state = "walkietalkie"
item_state = "walkietalkie"
var/on = 1 // 0 for off
/// boolean for radio enabled or not
var/on = TRUE
var/last_transmission
var/frequency = PUB_FREQ //common chat
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/frequency = PUB_FREQ
/// tune to frequency to unlock traitor supplies
var/traitor_frequency = 0
/// the range which mobs can hear this radio from
var/canhear_range = 3
var/datum/wires/radio/wires = null
var/b_stat = 0
var/broadcasting = 0
var/listening = 1
var/list/channels = list() //see communications.dm for full list. First channes is a "default" for :h
var/subspace_transmission = 0
var/obj/item/encryptionkey/syndicate/syndiekey = null //Holder for the syndicate encryption key if present
var/disable_timer = 0 //How many times this is disabled by EMPs
var/is_special = 0 //For electropacks mostly, skips Topic() checks
/// Whether the radio will broadcast stuff it hears, out over the radio
var/broadcasting = FALSE
/// Whether the radio is currently receiving
var/listening = TRUE
/// Whether the radio can be re-tuned to restricted channels it has no key for
var/freerange = FALSE
/// Whether the radio is able to have its primary frequency changed. Used for radios with weird primary frequencies, like DS, syndi, etc
var/freqlock = FALSE
/// Whether the radio broadcasts to everyone within a few tiles, or not
var/loudspeaker = FALSE
/// Whether loudspeaker can be toggled by the user
var/has_loudspeaker = FALSE
/// see communications.dm for full list. First channes is a "default" for :h
var/list/channels = list()
/// Holder for the syndicate encryption key if present
var/obj/item/encryptionkey/syndicate/syndiekey = null
/// How many times this is disabled by EMPs
var/disable_timer = 0
flags = CONDUCT
slot_flags = SLOT_BELT
@@ -76,6 +92,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
GLOB.global_radios |= src
/obj/item/radio/Destroy()
SStgui.close_uis(wires)
QDEL_NULL(wires)
if(SSradio)
SSradio.remove_object(src, frequency)
@@ -99,47 +116,87 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
/obj/item/radio/attack_ghost(mob/user)
return interact(user)
/obj/item/radio/attack_self(mob/user as mob)
user.set_machine(src)
interact(user)
/obj/item/radio/attack_self(mob/user)
tgui_interact(user)
/obj/item/radio/interact(mob/user)
if(!user)
return 0
if(b_stat)
wires.Interact(user)
tgui_interact(user)
return ui_interact(user)
/obj/item/radio/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/item/radio/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 400, 550)
ui = new(user, src, ui_key, "Radio", name, 360, 150 + (length(channels) * 20), master_ui, state)
ui.open()
ui.set_auto_update(1)
/obj/item/radio/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
/obj/item/radio/tgui_data(mob/user)
var/list/data = list()
data["mic_status"] = broadcasting
data["speaker"] = listening
data["freq"] = format_frequency(frequency)
data["rawfreq"] = num2text(frequency)
data["mic_cut"] = (wires.IsIndexCut(RADIO_WIRE_TRANSMIT) || wires.IsIndexCut(RADIO_WIRE_SIGNAL))
data["spk_cut"] = (wires.IsIndexCut(RADIO_WIRE_RECEIVE) || wires.IsIndexCut(RADIO_WIRE_SIGNAL))
var/list/chanlist = list_channels(user)
if(islist(chanlist) && chanlist.len)
data["chan_list"] = chanlist
data["chan_list_len"] = chanlist.len
if(syndiekey)
data["useSyndMode"] = 1
data["broadcasting"] = broadcasting
data["listening"] = listening
data["frequency"] = frequency
data["minFrequency"] = freerange ? RADIO_LOW_FREQ : PUBLIC_LOW_FREQ
data["maxFrequency"] = freerange ? RADIO_HIGH_FREQ : PUBLIC_HIGH_FREQ
data["canReset"] = frequency == initial(frequency) ? FALSE : TRUE
data["freqlock"] = freqlock
data["channels"] = list()
for(var/channel in channels)
data["channels"][channel] = channels[channel] & FREQ_LISTENING
data["has_loudspeaker"] = has_loudspeaker
data["loudspeaker"] = loudspeaker
return data
/obj/item/radio/tgui_act(action, params, datum/tgui/ui)
if(..())
return
. = TRUE
switch(action)
if("frequency")
if(freqlock)
return
var/tune = params["tune"]
var/adjust = text2num(params["adjust"])
if(tune == "reset")
tune = initial(frequency)
else if(adjust)
tune = frequency + adjust * 10
else if(text2num(tune) != null)
tune = tune * 10
else
. = FALSE
if(hidden_uplink)
if(hidden_uplink.check_trigger(usr, frequency, traitor_frequency))
usr << browse(null, "window=radio")
if(.)
set_frequency(sanitize_frequency(tune, freerange))
if("listen")
listening = !listening
if("broadcast")
broadcasting = !broadcasting
if("channel")
var/channel = params["channel"]
if(!(channel in channels))
return
if(channels[channel] & FREQ_LISTENING)
channels[channel] &= ~FREQ_LISTENING
else
channels[channel] |= FREQ_LISTENING
if("loudspeaker")
// Toggle loudspeaker mode, AKA everyone around you hearing your radio.
if(has_loudspeaker)
loudspeaker = !loudspeaker
if(loudspeaker)
canhear_range = 3
else
canhear_range = 0
else
. = FALSE
if(.)
add_fingerprint(usr)
/obj/item/radio/proc/list_channels(var/mob/user)
return list_internal_channels(user)
@@ -184,57 +241,10 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
return can_admin_interact()
/obj/item/radio/proc/ToggleBroadcast()
broadcasting = !broadcasting && !(wires.IsIndexCut(RADIO_WIRE_TRANSMIT) || wires.IsIndexCut(RADIO_WIRE_SIGNAL))
broadcasting = !broadcasting && !(wires.is_cut(WIRE_RADIO_TRANSMIT) || wires.is_cut(WIRE_RADIO_SIGNAL))
/obj/item/radio/proc/ToggleReception()
listening = !listening && !(wires.IsIndexCut(RADIO_WIRE_RECEIVE) || wires.IsIndexCut(RADIO_WIRE_SIGNAL))
/obj/item/radio/Topic(href, href_list)
if(..())
return 1
if(is_special)
return 0
if(href_list["track"])
var/mob/target = locate(href_list["track"])
var/mob/living/silicon/ai/A = locate(href_list["track2"])
if(A && target)
A.ai_actual_track(target)
. = 1
else if(href_list["freq"])
var/new_frequency = (frequency + text2num(href_list["freq"]))
if((new_frequency < PUBLIC_LOW_FREQ || new_frequency > PUBLIC_HIGH_FREQ))
new_frequency = sanitize_frequency(new_frequency)
set_frequency(new_frequency)
if(hidden_uplink)
if(hidden_uplink.check_trigger(usr, frequency, traitor_frequency))
usr << browse(null, "window=radio")
. = 1
else if(href_list["talk"])
ToggleBroadcast()
. = 1
else if(href_list["listen"])
var/chan_name = href_list["ch_name"]
if(!chan_name)
ToggleReception()
else
if(channels[chan_name] & FREQ_LISTENING)
channels[chan_name] &= ~FREQ_LISTENING
else
channels[chan_name] |= FREQ_LISTENING
. = 1
else if(href_list["spec_freq"])
var/freq = href_list["spec_freq"]
if(has_channel_access(usr, freq))
set_frequency(text2num(freq))
. = 1
if(href_list["nowindow"]) // here for pAIs, maybe others will want it, idk
return 1
add_fingerprint(usr)
listening = !listening && !(wires.is_cut(WIRE_RADIO_RECEIVER) || wires.is_cut(WIRE_RADIO_SIGNAL))
/obj/item/radio/proc/autosay(message, from, channel, role = "Unknown") //BS12 EDIT
var/datum/radio_frequency/connection = null
@@ -325,7 +335,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
// If we were to send to a channel we don't have, drop it.
return RADIO_CONNECTION_FAIL
/obj/item/radio/talk_into(mob/living/M as mob, list/message_pieces, channel, var/verb = "says")
/obj/item/radio/talk_into(mob/living/M as mob, list/message_pieces, channel, verbage = "says")
if(!on)
return 0 // the device has to be on
// Fix for permacell radios, but kinda eh about actually fixing them.
@@ -334,7 +344,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
// Uncommenting this. To the above comment:
// The permacell radios aren't suppose to be able to transmit, this isn't a bug and this "fix" is just making radio wires useless. -Giacom
if(wires.IsIndexCut(RADIO_WIRE_TRANSMIT)) // The device has to have all its wires and shit intact
if(wires.is_cut(WIRE_RADIO_TRANSMIT)) // The device has to have all its wires and shit intact
return 0
if(!M.IsVocal())
@@ -411,11 +421,16 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
jobname = "Unknown"
voicemask = TRUE
// Copy the message pieces so we can safely edit comms line without affecting the actual line
var/list/message_pieces_copy = list()
for(var/datum/multilingual_say_piece/S in message_pieces)
message_pieces_copy += new /datum/multilingual_say_piece(S.speaking, S.message)
// Make us a message datum!
var/datum/tcomms_message/tcm = new
tcm.sender_name = displayname
tcm.sender_job = jobname
tcm.message_pieces = message_pieces
tcm.message_pieces = message_pieces_copy
tcm.source_level = position.z
tcm.freq = connection.frequency
tcm.vmask = voicemask
@@ -423,6 +438,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
tcm.connection = connection
tcm.vname = M.voice_name
tcm.sender = M
tcm.verbage = verbage
// Now put that through the stuff
var/handled = FALSE
if(connection)
@@ -509,7 +525,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
var/is_listening = TRUE
if(!on)
is_listening = FALSE
if(!wires || wires.IsIndexCut(RADIO_WIRE_RECEIVE))
if(!wires || wires.is_cut(WIRE_RADIO_RECEIVER))
is_listening = FALSE
if(!listening)
is_listening = FALSE
@@ -575,19 +591,24 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
if(!disable_timer)
on = 1
/obj/item/radio/proc/recalculateChannels()
/// Exists so that borg radios and headsets can override it.
stack_trace("recalculateChannels() called on a radio which does not implement the proc.")
///////////////////////////////
//////////Borg Radios//////////
///////////////////////////////
//Giving borgs their own radio to have some more room to work with -Sieve
/obj/item/radio/borg
name = "Cyborg Radio"
var/mob/living/silicon/robot/myborg = null // Cyborg which owns this radio. Used for power checks
var/obj/item/encryptionkey/keyslot = null//Borg radios can handle a single encryption key
var/shut_up = 1
icon = 'icons/obj/robot_component.dmi' // Cyborgs radio icons should look like the component.
icon_state = "radio"
has_loudspeaker = TRUE
loudspeaker = FALSE
canhear_range = 0
subspace_transmission = 1
dog_fashion = null
/obj/item/radio/borg/syndicate
@@ -609,12 +630,14 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
..()
syndiekey = keyslot
set_frequency(SYND_FREQ)
freqlock = TRUE
/obj/item/radio/borg/deathsquad
/obj/item/radio/borg/deathsquad/New()
..()
set_frequency(DTH_FREQ)
freqlock = TRUE
/obj/item/radio/borg/ert
keyslot = new /obj/item/encryptionkey/ert
@@ -622,6 +645,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
/obj/item/radio/borg/ert/New()
..()
set_frequency(ERT_FREQ)
freqlock = TRUE
/obj/item/radio/borg/ert/specops
keyslot = new /obj/item/encryptionkey/centcom
@@ -666,7 +690,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
else
to_chat(user, "This radio doesn't have any encryption keys!")
/obj/item/radio/borg/proc/recalculateChannels()
/obj/item/radio/borg/recalculateChannels()
channels = list()
syndiekey = null
@@ -699,72 +723,12 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
return
/obj/item/radio/borg/Topic(href, href_list)
if(..())
return 1
if(href_list["mode"])
var/enable_subspace_transmission = text2num(href_list["mode"])
if(enable_subspace_transmission != subspace_transmission)
subspace_transmission = !subspace_transmission
if(subspace_transmission)
to_chat(usr, "<span class='notice'>Subspace Transmission is enabled.</span>")
else
to_chat(usr, "<span class='notice'>Subspace Transmission is disabled.</span>")
if(subspace_transmission == 0)//Simple as fuck, clears the channel list to prevent talking/listening over them if subspace transmission is disabled
channels = list()
else
recalculateChannels()
. = 1
if(href_list["shutup"]) // Toggle loudspeaker mode, AKA everyone around you hearing your radio.
var/do_shut_up = text2num(href_list["shutup"])
if(do_shut_up != shut_up)
shut_up = !shut_up
if(shut_up)
canhear_range = 0
to_chat(usr, "<span class='notice'>Loudspeaker disabled.</span>")
else
canhear_range = 3
to_chat(usr, "<span class='notice'>Loudspeaker enabled.</span>")
. = 1
/obj/item/radio/borg/interact(mob/user as mob)
/obj/item/radio/borg/interact(mob/user)
if(!on)
return
. = ..()
/obj/item/radio/borg/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 430, 500)
ui.open()
ui.set_auto_update(1)
/obj/item/radio/borg/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
data["mic_status"] = broadcasting
data["speaker"] = listening
data["freq"] = format_frequency(frequency)
data["rawfreq"] = num2text(frequency)
var/list/chanlist = list_channels(user)
if(islist(chanlist) && chanlist.len)
data["chan_list"] = chanlist
data["chan_list_len"] = chanlist.len
if(syndiekey)
data["useSyndMode"] = 1
data["has_loudspeaker"] = 1
data["loudspeaker"] = !shut_up
data["has_subspace"] = 1
data["subspace"] = subspace_transmission
return data
/obj/item/radio/proc/config(op)
if(SSradio)
for(var/ch_name in channels)
+1 -1
View File
@@ -72,7 +72,7 @@ REAGENT SCANNER
var/turf/U = O.loc
if(U && U.intact)
O.invisibility = 101
O.alpha = 255
O.alpha = 255
for(var/mob/living/M in T.contents)
var/oldalpha = M.alpha
if(M.alpha < 255 && istype(M))
@@ -64,7 +64,7 @@
A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb).
investigate_log("[key_name(user)] attached a [A] to a transfer valve.", INVESTIGATE_BOMB)
msg_admin_attack("[key_name_admin(user)]attached [A] to a transfer valve.", ATKLOG_FEW)
add_attack_logs(user, src, "attached [A] to a transfer valve", ATKLOG_FEW)
log_game("[key_name_admin(user)] attached [A] to a transfer valve.")
attacher = user
SSnanoui.update_uis(src) // update all UIs attached to src
@@ -86,64 +86,64 @@
O.hear_message(M, msg)
/obj/item/transfer_valve/attack_self(mob/user)
ui_interact(user)
tgui_interact(user)
/obj/item/transfer_valve/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1)
// update the ui if it exists, returns null if no ui is passed/found
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/item/transfer_valve/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_inventory_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "transfer_valve.tmpl", "Tank Transfer Valve", 460, 280)
// open the new ui window
ui = new(user, src, ui_key, "TransferValve", name, 460, 320, master_ui, state)
ui.open()
// auto update every Master Controller tick
//ui.set_auto_update(1)
/obj/item/transfer_valve/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
data["attachmentOne"] = tank_one ? tank_one.name : null
data["attachmentTwo"] = tank_two ? tank_two.name : null
data["valveAttachment"] = attached_device ? attached_device.name : null
data["valveOpen"] = valve_open ? 1 : 0
/obj/item/transfer_valve/tgui_data(mob/user)
var/list/data = list()
data["tank_one"] = tank_one ? tank_one.name : null
data["tank_two"] = tank_two ? tank_two.name : null
data["attached_device"] = attached_device ? attached_device.name : null
data["valve"] = valve_open
return data
/obj/item/transfer_valve/Topic(href, href_list)
..()
if(usr.incapacitated())
return 0
if(loc != usr)
return 0
if(tank_one && href_list["tankone"])
split_gases()
valve_open = 0
tank_one.forceMove(get_turf(src))
tank_one = null
/obj/item/transfer_valve/tgui_act(action, params)
if(..())
return
. = TRUE
switch(action)
if("tankone")
if(tank_one)
split_gases()
valve_open = FALSE
tank_one.forceMove(get_turf(src))
tank_one = null
update_icon()
if((!tank_two || tank_two.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL))
w_class = WEIGHT_CLASS_NORMAL
if("tanktwo")
if(tank_two)
split_gases()
valve_open = FALSE
tank_two.forceMove(get_turf(src))
tank_two = null
update_icon()
if((!tank_one || tank_one.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL))
w_class = WEIGHT_CLASS_NORMAL
if("toggle")
toggle_valve(usr)
if("device")
if(attached_device)
attached_device.attack_self(usr)
if("remove_device")
if(attached_device)
attached_device.forceMove(get_turf(src))
attached_device.holder = null
attached_device = null
update_icon()
else
. = FALSE
if(.)
update_icon()
if((!tank_two || tank_two.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL))
w_class = WEIGHT_CLASS_NORMAL
else if(tank_two && href_list["tanktwo"])
split_gases()
valve_open = 0
tank_two.forceMove(get_turf(src))
tank_two = null
update_icon()
if((!tank_one || tank_one.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL))
w_class = WEIGHT_CLASS_NORMAL
else if(href_list["open"])
toggle_valve()
else if(attached_device)
if(href_list["rem_device"])
attached_device.forceMove(get_turf(src))
attached_device.holder = null
attached_device = null
update_icon()
if(href_list["device"])
attached_device.attack_self(usr)
add_fingerprint(usr)
return 1 // Returning 1 sends an update to attached UIs
add_fingerprint(usr)
/obj/item/transfer_valve/proc/process_activation(obj/item/D)
if(toggle)
@@ -190,7 +190,7 @@
it explodes properly when it gets a signal (and it does).
*/
/obj/item/transfer_valve/proc/toggle_valve()
/obj/item/transfer_valve/proc/toggle_valve(mob/user)
if(!valve_open && tank_one && tank_two)
valve_open = 1
var/turf/bombturf = get_turf(src)
@@ -207,6 +207,8 @@
investigate_log("Bomb valve opened at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]) with [attached_device ? attached_device : "no device"], attached by [attacher_name]. Last touched by: [key_name(mob)]", INVESTIGATE_BOMB)
message_admins("Bomb valve opened at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a> with [attached_device ? attached_device : "no device"], attached by [attacher_name]. Last touched by: [key_name_admin(mob)]")
log_game("Bomb valve opened at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]) with [attached_device ? attached_device : "no device"], attached by [attacher_name]. Last touched by: [key_name(mob)]")
if(user)
add_attack_logs(user, src, "Bomb valve opened with [attached_device ? attached_device : "no device"], attached by [attacher_name]. Last touched by: [key_name(mob)]", ATKLOG_FEW)
merge_gases()
spawn(20) // In case one tank bursts
for(var/i in 1 to 5)