mirror of
https://github.com/quotefox/Hyper-Station-13.git
synced 2026-07-19 11:42:27 +01:00
Cyborg PDA Update
Allows robots to use the same PDA subtype as the AI. Adds a 1/1000 chance of AOL "You've got mail!" playing when receiving a PDA message.
This commit is contained in:
@@ -795,8 +795,12 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
tnote += "<i><b>← From <a href='byond://?src=[REF(src)];choice=Message;target=[REF(signal.source)]'>[signal.data["name"]]</a> ([signal.data["job"]]):</b></i><br>[signal.format_message()]<br>"
|
||||
|
||||
if (!silent)
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
audible_message("[icon2html(src, hearers(src))] *[ttone]*", null, 3)
|
||||
if(prob(0.1))
|
||||
playsound(src, 'sound/machines/youve_got_mail.ogg', 50, 1)
|
||||
audible_message("[icon2html(src, hearers(src))] *You've got mail!*", null, 3)
|
||||
else
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
audible_message("[icon2html(src, hearers(src))] *[ttone]*", null, 3)
|
||||
//Search for holder of the PDA.
|
||||
var/mob/living/L = null
|
||||
if(loc && isliving(loc))
|
||||
@@ -1069,21 +1073,21 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
|
||||
//AI verb and proc for sending PDA messages.
|
||||
|
||||
/mob/living/silicon/ai/proc/cmd_send_pdamesg(mob/user)
|
||||
/mob/living/silicon/proc/cmd_send_pdamesg(mob/user)
|
||||
var/list/plist = list()
|
||||
var/list/namecounts = list()
|
||||
|
||||
if(aiPDA.toff)
|
||||
if(builtInPDA.toff)
|
||||
to_chat(user, "Turn on your receiver in order to send messages.")
|
||||
return
|
||||
|
||||
for (var/obj/item/pda/P in get_viewable_pdas())
|
||||
if (P == src)
|
||||
continue
|
||||
else if (P == aiPDA)
|
||||
else if (P == builtInPDA)
|
||||
continue
|
||||
|
||||
plist[avoid_assoc_duplicate_keys(P.owner, namecounts)] = P
|
||||
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)
|
||||
|
||||
@@ -1096,42 +1100,42 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
var/add_photo = input(user,"Do you want to attach a photo?","Photo","No") as null|anything in list("Yes","No")
|
||||
if(add_photo=="Yes")
|
||||
var/datum/picture/Pic = aicamera.selectpicture(user)
|
||||
aiPDA.picture = Pic
|
||||
builtInPDA.picture = Pic
|
||||
|
||||
if(incapacitated())
|
||||
return
|
||||
|
||||
aiPDA.create_message(src, selected)
|
||||
builtInPDA.create_message(src, selected)
|
||||
|
||||
|
||||
/mob/living/silicon/ai/verb/cmd_toggle_pda_receiver()
|
||||
/mob/living/silicon/verb/cmd_toggle_pda_receiver()
|
||||
set category = "AI Commands"
|
||||
set name = "PDA - Toggle Sender/Receiver"
|
||||
if(usr.stat == DEAD)
|
||||
return //won't work if dead
|
||||
if(!isnull(aiPDA))
|
||||
aiPDA.toff = !aiPDA.toff
|
||||
to_chat(usr, "<span class='notice'>PDA sender/receiver toggled [(aiPDA.toff ? "Off" : "On")]!</span>")
|
||||
if(!isnull(builtInPDA))
|
||||
builtInPDA.toff = !builtInPDA.toff
|
||||
to_chat(usr, "<span class='notice'>PDA sender/receiver toggled [(builtInPDA.toff ? "Off" : "On")]!</span>")
|
||||
else
|
||||
to_chat(usr, "You do not have a PDA. You should make an issue report about this.")
|
||||
|
||||
/mob/living/silicon/ai/verb/cmd_toggle_pda_silent()
|
||||
/mob/living/silicon/verb/cmd_toggle_pda_silent()
|
||||
set category = "AI Commands"
|
||||
set name = "PDA - Toggle Ringer"
|
||||
if(usr.stat == DEAD)
|
||||
return //won't work if dead
|
||||
if(!isnull(aiPDA))
|
||||
if(!isnull(builtInPDA))
|
||||
//0
|
||||
aiPDA.silent = !aiPDA.silent
|
||||
to_chat(usr, "<span class='notice'>PDA ringer toggled [(aiPDA.silent ? "Off" : "On")]!</span>")
|
||||
builtInPDA.silent = !builtInPDA.silent
|
||||
to_chat(usr, "<span class='notice'>PDA ringer toggled [(builtInPDA.silent ? "Off" : "On")]!</span>")
|
||||
else
|
||||
to_chat(usr, "You do not have a PDA. You should make an issue report about this.")
|
||||
|
||||
/mob/living/silicon/ai/proc/cmd_show_message_log(mob/user)
|
||||
/mob/living/silicon/proc/cmd_show_message_log(mob/user)
|
||||
if(incapacitated())
|
||||
return
|
||||
if(!isnull(aiPDA))
|
||||
var/HTML = "<html><head><title>AI PDA Message Log</title></head><body>[aiPDA.tnote]</body></html>"
|
||||
if(!isnull(builtInPDA))
|
||||
var/HTML = "<html><head><title>PDA Message Log</title></head><body>[builtInPDA.tnote]</body></html>"
|
||||
user << browse(HTML, "window=log;size=400x444;border=1;can_resize=1;can_close=1;can_minimize=0")
|
||||
else
|
||||
to_chat(user, "You do not have a PDA. You should make an issue report about this.")
|
||||
|
||||
Reference in New Issue
Block a user