diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm
index 93c3b63d1..22025d491 100644
--- a/code/_onclick/hud/ai.dm
+++ b/code/_onclick/hud/ai.dm
@@ -113,8 +113,8 @@
/obj/screen/ai/pda_msg_send/Click()
if(..())
return
- var/mob/living/silicon/ai/AI = usr
- AI.cmd_send_pdamesg(usr)
+ var/mob/living/silicon/S = usr
+ S.cmd_send_pdamesg(usr, TRUE)
/obj/screen/ai/pda_msg_show
name = "PDA - Show Message Log"
@@ -123,8 +123,8 @@
/obj/screen/ai/pda_msg_show/Click()
if(..())
return
- var/mob/living/silicon/ai/AI = usr
- AI.cmd_show_message_log(usr)
+ var/mob/living/silicon/S = usr
+ S.cmd_show_message_log(usr)
/obj/screen/ai/image_take
name = "Take Image"
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index aed207ea3..505344595 100644
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -738,8 +738,9 @@ GLOBAL_LIST_EMPTY(PDAs)
if((last_text && world.time < last_text + 10) || (everyone && last_everyone && world.time < last_everyone + PDA_SPAM_DELAY))
return
var/emoji_message = emoji_parse(message)
- if(prob(1))
- message += "\nSent from my PDA"
+ //Bad for RP
+ //if(prob(1))
+ // message += "\nSent from my PDA"
// Send the signal
var/list/string_targets = list()
for (var/obj/item/pda/P in targets)
@@ -796,7 +797,7 @@ GLOBAL_LIST_EMPTY(PDAs)
if (!silent)
if(prob(0.1))
- playsound(src, 'sound/machines/youve_got_mail.ogg', 50, 1)
+ playsound(src, 'sound/machines/youve_got_mail.ogg', 50, 0)
audible_message("[icon2html(src, hearers(src))] *You've got mail!*", null, 3)
else
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
@@ -1071,8 +1072,7 @@ GLOBAL_LIST_EMPTY(PDAs)
QDEL_NULL(inserted_item)
return ..()
-//AI verb and proc for sending PDA messages.
-
+//Silicon verb and proc for sending PDA messages.
/mob/living/silicon/proc/cmd_send_pdamesg(mob/user)
var/list/plist = list()
var/list/namecounts = list()
@@ -1082,11 +1082,8 @@ GLOBAL_LIST_EMPTY(PDAs)
return
for (var/obj/item/pda/P in get_viewable_pdas())
- if (P == src)
+ if (P == builtInPDA)//Don't want to send messages to yourself
continue
- else if (P == builtInPDA)
- continue
-
plist[avoid_assoc_duplicate_keys(P.owner, namecounts)+" ("+P.ownjob+")"] = P
var/c = input(user, "Please select a PDA") as null|anything in sortList(plist)
@@ -1134,6 +1131,7 @@ GLOBAL_LIST_EMPTY(PDAs)
/mob/living/silicon/proc/cmd_show_message_log(mob/user)
if(incapacitated())
return
+
if(!isnull(builtInPDA))
var/HTML = "
PDA Message Log[builtInPDA.tnote]"
user << browse(HTML, "window=log;size=400x444;border=1;can_resize=1;can_close=1;can_minimize=0")
@@ -1154,6 +1152,7 @@ GLOBAL_LIST_EMPTY(PDAs)
/proc/get_viewable_pdas()
. = list()
+
// Returns a list of PDAs which can be viewed from another PDA/message monitor.
for(var/obj/item/pda/P in GLOB.PDAs)
if(!P.owner || P.toff || P.hidden)
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 07f0079e2..f0f34c22c 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -141,7 +141,7 @@
builtInPDA = new/obj/item/pda/ai(src)
builtInPDA.owner = name
builtInPDA.ownjob = "AI"
- builtInPDA.name = name + " (" + builtInPDA.ownjob + ")"
+ builtInPDA.update_label()
aiMulti = new(src)
radio = new /obj/item/radio/headset/ai(src)
@@ -799,7 +799,7 @@
if(control_disabled || incapacitated())
to_chat(src, "You can't do that right now!")
return FALSE
- if(be_close && !in_range(M, src))
+ if(be_close && !in_range(M, src) && M != builtInPDA) //Makes sure AIs in shells can always use their PDA. This one probably unnecessary since it's called from robot.dm, but just in case.
to_chat(src, "You are too far away!")
return FALSE
return can_see(M) //stop AIs from leaving windows open and using then after they lose vision
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index e561cdee3..76735942d 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -143,6 +143,11 @@
if(wires.is_cut(WIRE_CAMERA))
builtInCamera.status = 0
+ module = new /obj/item/robot_module(src)
+ module.rebuild_modules()
+ update_icons()
+ . = ..()
+
//If this body is meant to be a borg controlled by the AI player
if(shell)
make_shell()
@@ -161,17 +166,12 @@
updatename()
- //Name updated, can build PDA data now
- if(!builtInPDA)
+ //Name updated, can build PDA data now. Checks for if AI is meant to control.
+ if(!builtInPDA && !shell)
builtInPDA = new/obj/item/pda/ai(src)
builtInPDA.owner = name
builtInPDA.ownjob = "Station Cyborg"
- builtInPDA.name = name + " (" + builtInPDA.ownjob + ")"
-
- module = new /obj/item/robot_module(src)
- module.rebuild_modules()
- update_icons()
- . = ..()
+ builtInPDA.update_label()
equippable_hats = typecacheof(equippable_hats)
@@ -939,7 +939,7 @@
if(stat || lockcharge || low_power_mode)
to_chat(src, "You can't do that right now!")
return FALSE
- if(be_close && !in_range(M, src))
+ if(be_close && !in_range(M, src) && M != builtInPDA) //Makes sure AIs in shells can always use their PDA
to_chat(src, "You are too far away!")
return FALSE
return TRUE
@@ -1149,6 +1149,10 @@
mainframe.connected_robots |= src
lawupdate = TRUE
lawsync()
+
+ //Ensures AI shells have the same PDA as their mainframe AI
+ builtInPDA = AI.builtInPDA
+
if(radio && AI.radio) //AI keeps all channels, including Syndie if it is a Traitor
if(AI.radio.syndie)
radio.make_syndie()