mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 23:53:47 +01:00
fun fact: This took 6 hours because bay uses different say().
fun fact: I'm never porting say-related stuff from bay. Conflicts: code/game/objects/items/devices/radio/encryptionkey.dm code/game/objects/items/devices/radio/headset.dm code/modules/mob/living/say.dm code/modules/mob/living/silicon/ai/ai.dm
This commit is contained in:
@@ -71,6 +71,10 @@
|
||||
dat += "<br>"
|
||||
dat += {"<a href='byond://?src=\ref[src];choice=Wireless'>[A.control_disabled ? "Enable" : "Disable"] Wireless Activity</a>"}
|
||||
dat += "<br>"
|
||||
dat += "Subspace Transceiver is: [A.radio.disabledAi ? "Disabled" : "Enabled"]"
|
||||
dat += "<br>"
|
||||
dat += {"<a href='byond://?src=\ref[src];choice=Radio'>[A.radio.disabledAi ? "Enable" : "Disable"] Subspace Transceiver</a>"}
|
||||
dat += "<br>"
|
||||
dat += {"<a href='byond://?src=\ref[src];choice=Close'> Close</a>"}
|
||||
user << browse(dat, "window=aicard")
|
||||
onclose(user, "aicard")
|
||||
@@ -110,6 +114,12 @@
|
||||
sleep(10)
|
||||
flush = 0
|
||||
|
||||
if ("Radio")
|
||||
for(var/mob/living/silicon/ai/A in src)
|
||||
A.radio.disabledAi = !A.radio.disabledAi
|
||||
A << "Your Subspace Transceiver has been: [A.radio.disabledAi ? "disabled" : "enabled"]"
|
||||
U << "You [A.radio.disabledAi ? "Disable" : "Enable"] the AI's Subspace Transceiver"
|
||||
|
||||
if ("Wireless")
|
||||
for(var/mob/living/silicon/ai/A in src)
|
||||
A.control_disabled = !A.control_disabled
|
||||
|
||||
@@ -131,3 +131,9 @@
|
||||
name = "NanoTrasen ERT Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
channels = list("Response Team" = 1, "Science" = 1, "Command" = 1, "Medical" = 1, "Engineering" = 1, "Security" = 1, "Supply" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/heads/ai_integrated //ported from bay, this goes 'inside' the AI.
|
||||
name = "AI Integrated Encryption Key"
|
||||
desc = "Integrated encryption key"
|
||||
icon_state = "cap_cypherkey"
|
||||
channels = list("Command" = 1, "Security" = 1, "Engineering" = 1, "Science" = 1, "Medical" = 1, "Supply" = 1, "Service" = 1)
|
||||
@@ -20,7 +20,10 @@
|
||||
keyslot1 = new /obj/item/device/encryptionkey/
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/device/radio/headset/receive_range(freq, level)
|
||||
|
||||
/obj/item/device/radio/headset/receive_range(freq, level, aiOverride = 0)
|
||||
if(aiOverride)
|
||||
return ..(freq, level)
|
||||
if(ishuman(src.loc))
|
||||
var/mob/living/carbon/human/H = src.loc
|
||||
if(H.l_ear == src || H.r_ear == src)
|
||||
@@ -164,6 +167,21 @@
|
||||
freerange = 1
|
||||
keyslot2 = new /obj/item/device/encryptionkey/ert
|
||||
|
||||
//The below was ported from Baystation.
|
||||
/obj/item/device/radio/headset/heads/ai_integrated //No need to care about icons, it should be hidden inside the AI anyway.
|
||||
name = "AI Subspace Transceiver"
|
||||
desc = "Integrated AI radio transceiver."
|
||||
icon_state = "ai_radio"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/heads/ai_integrated
|
||||
var/myAi = null // Atlantis: Reference back to the AI which has this radio.
|
||||
var/disabledAi = 0 // Atlantis: Used to manually disable AI's integrated radio via intellicard menu.
|
||||
|
||||
/obj/item/device/radio/headset/heads/ai_integrated/receive_range(freq, level)
|
||||
if(disabledAi)
|
||||
return -1 //Transciever Disabled.
|
||||
return ..(freq, level, 1)
|
||||
|
||||
/obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
// ..()
|
||||
user.set_machine(src)
|
||||
@@ -268,4 +286,4 @@
|
||||
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
@@ -146,6 +146,7 @@ var/list/department_radio_keys = list(
|
||||
var/italics = 0
|
||||
var/message_range = null
|
||||
var/message_mode = null
|
||||
|
||||
var/datum/language/speaking = null //For use if a specific language is being spoken.
|
||||
|
||||
var/braindam = getBrainLoss()
|
||||
@@ -178,7 +179,7 @@ var/list/department_radio_keys = list(
|
||||
message_mode = department_radio_keys[channel_prefix]
|
||||
if (message_mode || speaking || copytext(message,1,2) == ":")
|
||||
message = trim(copytext(message, 3))
|
||||
if (!(istype(src,/mob/living/carbon/human) || istype(src,/mob/living/carbon/monkey) || istype(src, /mob/living/simple_animal/parrot) || isrobot(src) && (message_mode=="department" || (message_mode in radiochannels))))
|
||||
if (!(istype(src,/mob/living/carbon/human) || istype(src,/mob/living/carbon/monkey) || istype(src, /mob/living/simple_animal/parrot) || isrobot(src) && (message_mode=="department" || isAI(src) && (message_mode=="department") || (message_mode in radiochannels))))
|
||||
message_mode = null //only humans can use headsets
|
||||
|
||||
if(src.stunned > 2 || (traumatic_shock > 61 && prob(50)))
|
||||
@@ -284,7 +285,6 @@ var/list/department_radio_keys = list(
|
||||
message_range = 1
|
||||
italics = 1
|
||||
|
||||
|
||||
if("changeling")
|
||||
if(mind && mind.changeling)
|
||||
log_say("[key_name(src)] ([mind.changeling.changelingID]): [message]")
|
||||
@@ -301,12 +301,18 @@ var/list/department_radio_keys = list(
|
||||
if(C:l_ear) devices += C:l_ear
|
||||
if(C:r_ear) devices += C:r_ear
|
||||
if(issilicon(src))
|
||||
var/mob/living/silicon/Ro=src
|
||||
if(!isAI(Ro))
|
||||
if(Ro:radio)
|
||||
devices += Ro:radio
|
||||
if(isAI(src))//for the AI's radio. This can't be with the borg thing above due to typecasting.
|
||||
var/mob/living/silicon/ai/A = src
|
||||
if(A.radio)
|
||||
A.radio.talk_into(src, message, message_mode)
|
||||
used_radios += A.radio
|
||||
else
|
||||
warning("[src] has no radio!")
|
||||
var/mob/living/silicon/Ro=src
|
||||
if(!isAI(Ro))
|
||||
if(Ro:radio)
|
||||
devices += Ro:radio
|
||||
else
|
||||
warning("[src] has no radio!")
|
||||
message_range = 1
|
||||
italics = 1
|
||||
if(devices.len>0)
|
||||
|
||||
@@ -33,7 +33,8 @@ var/list/ai_list = list()
|
||||
var/obj/item/device/multitool/aiMulti = null
|
||||
var/custom_sprite = 0 //For our custom sprites
|
||||
var/alienAI = 0
|
||||
//Hud stuff
|
||||
|
||||
var/obj/item/device/radio/headset/heads/ai_integrated/radio = null
|
||||
|
||||
//MALFUNCTION
|
||||
var/datum/module_picker/malf_picker
|
||||
@@ -90,11 +91,13 @@ var/list/ai_list = list()
|
||||
aiPDA.name = name + " (" + aiPDA.ownjob + ")"
|
||||
|
||||
aiMulti = new(src)
|
||||
radio = new(src)
|
||||
radio.myAi = src
|
||||
|
||||
if (istype(loc, /turf))
|
||||
verbs.Add(/mob/living/silicon/ai/proc/ai_network_change, \
|
||||
/mob/living/silicon/ai/proc/ai_statuschange, /mob/living/silicon/ai/proc/ai_hologram_change, \
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light)
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light, /mob/living/silicon/ai/proc/control_integrateed_radio)
|
||||
|
||||
if(!safety)//Only used by AIize() to successfully spawn an AI.
|
||||
if (!B)//If there is no player/brain inside.
|
||||
@@ -778,4 +781,14 @@ var/list/ai_list = list()
|
||||
anchored = 1
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/control_integrateed_radio()
|
||||
set name = "Radio Settings"
|
||||
set desc = "Allows you to change settings of your radio."
|
||||
set category = "AI Commands"
|
||||
|
||||
src << "Accessing Subspace Transceiver control..."
|
||||
if (src.radio)
|
||||
src.radio.interact(src)
|
||||
|
||||
Reference in New Issue
Block a user