"
dat += "Edit "
if(notescanned)
dat += "(This is a scanned image, editing it may cause some text formatting to change.) "
dat += "[(!notehtml ? note : notehtml)]"
if (2)
dat += "
"
var/turf/T = user.loc
if (isnull(T))
dat += "Unable to obtain a reading. "
else
var/datum/gas_mixture/environment = T.return_air()
var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles()
dat += "Air Pressure: [round(pressure,0.1)] kPa "
if (total_moles)
for(var/id in environment.get_gases())
var/gas_level = environment.get_moles(id)/total_moles
if(gas_level > 0)
dat += "[GLOB.gas_data.names[id]]: [round(gas_level*100, 0.01)]% "
dat += "Temperature: [round(environment.return_temperature()-T0C)]°C "
dat += " "
else//Else it links to the cart menu proc. Although, it really uses menu hub 4--menu 4 doesn't really exist as it simply redirects to hub.
dat += cartridge.generate_menu()
dat += ""
if (underline_flag)
dat = replacetext(dat, "text-decoration:none", "text-decoration:underline")
if (!underline_flag)
dat = replacetext(dat, "text-decoration:underline", "text-decoration:none")
user << browse(dat, "window=pda;size=400x450;border=1;can_resize=1;can_minimize=0")
onclose(user, "pda", src)
/obj/item/pda/Topic(href, href_list)
..()
var/mob/living/U = usr
//Looking for master was kind of pointless since PDAs don't appear to have one.
if(usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK, FALSE) && !href_list["close"])
add_fingerprint(U)
U.set_machine(src)
switch(href_list["choice"])
//BASIC FUNCTIONS===================================
if("Refresh")//Refresh, goes to the end of the proc.
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if ("Toggle_Font")
//CODE REVISION 2
font_index = (font_index + 1) % 4
switch(font_index)
if (MODE_MONO)
font_mode = FONT_MONO
if (MODE_SHARE)
font_mode = FONT_SHARE
if (MODE_ORBITRON)
font_mode = FONT_ORBITRON
if (MODE_VT)
font_mode = FONT_VT
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if ("Change_Color")
var/new_color = input("Please enter a color name or hex value (Default is \'#808000\').",background_color)as color
background_color = new_color
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if ("Toggle_Underline")
underline_flag = !underline_flag
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Return")//Return
if(mode<=9)
mode = 0
else
mode = round(mode/10)
if(mode==4 || mode == 5)//Fix for cartridges. Redirects to hub.
mode = 0
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if ("Authenticate")//Checks for ID
id_check(U)
if("UpdateInfo")
ownjob = id.assignment
if(istype(id, /obj/item/card/id/syndicate))
owner = id.registered_name
update_label()
if (!silent)
playsound(src, 'sound/machines/terminal_processing.ogg', 15, 1)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound), src, 'sound/machines/terminal_success.ogg', 15, 1), 13)
if("Eject")//Ejects the cart, only done from hub.
if (!isnull(cartridge))
U.put_in_hands(cartridge)
to_chat(U, "You remove [cartridge] from [src].")
scanmode = PDA_SCANNER_NONE
cartridge.host_pda = null
cartridge = null
update_icon()
if (!silent)
playsound(src, 'sound/machines/terminal_eject_disc.ogg', 50, 1)
//MENU FUNCTIONS===================================
if("0")//Hub
mode = 0
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("1")//Notes
mode = 1
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("2")//Messenger
mode = 2
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("21")//Read messeges
mode = 21
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("3")//Atmos scan
mode = 3
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("4")//Redirects to hub
mode = 0
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
//MAIN FUNCTIONS===================================
if("Light")
toggle_light()
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Medical Scan")
if(scanmode == PDA_SCANNER_MEDICAL)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_MEDICAL))
scanmode = PDA_SCANNER_MEDICAL
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Reagent Scan")
if(scanmode == PDA_SCANNER_REAGENT)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_REAGENT_SCANNER))
scanmode = PDA_SCANNER_REAGENT
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Halogen Counter")
if(scanmode == PDA_SCANNER_HALOGEN)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_ENGINE))
scanmode = PDA_SCANNER_HALOGEN
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Honk")
if ( !(last_noise && world.time < last_noise + 20) )
playsound(src, 'sound/items/bikehorn.ogg', 50, 1)
last_noise = world.time
if("Trombone")
if ( !(last_noise && world.time < last_noise + 20) )
playsound(src, 'sound/misc/sadtrombone.ogg', 50, 1)
last_noise = world.time
if("Gas Scan")
if(scanmode == PDA_SCANNER_GAS)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_ATMOS))
scanmode = PDA_SCANNER_GAS
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Drone Phone")
var/alert_s = input(U,"Alert severity level","Ping Drones",null) as null|anything in list("Low","Medium","High","Critical")
var/area/A = get_area(U)
if(A && alert_s && !QDELETED(U))
var/msg = "NON-DRONE PING: [U.name]: [alert_s] priority alert in [A.name]!"
_alert_drones(msg, TRUE, U)
to_chat(U, msg)
if (!silent)
playsound(src, 'sound/machines/terminal_success.ogg', 15, 1)
//NOTEKEEPER FUNCTIONS===================================
if ("Edit")
var/n = stripped_multiline_input(U, "Please enter message", name, note)
if (in_range(src, U) && loc == U)
if (mode == 1 && n)
note = n
notehtml = parsemarkdown(n, U)
notescanned = FALSE
else
U << browse(null, "window=pda")
return
//MESSENGER FUNCTIONS===================================
if("Toggle Messenger")
toff = !toff
if("Toggle Ringer")//If viewing texts then erase them, if not then toggle silent status
silent = !silent
if("Clear")//Clears messages
tnote = null
if("Ringtone")
var/t = stripped_input(U, "Please enter new ringtone", name, ttone, 20)
if(in_range(src, U) && loc == U && t)
if(SEND_SIGNAL(src, COMSIG_PDA_CHANGE_RINGTONE, U, t) & COMPONENT_STOP_RINGTONE_CHANGE)
U << browse(null, "window=pda")
return
else
ttone = t
else
U << browse(null, "window=pda")
return
if("Message")
create_message(U, locate(href_list["target"]))
if("MessageAll")
if(cartridge?.spam_enabled)
send_to_all(U)
if("toggle_block")
toggle_blocking(usr, href_list["target"])
if("block_pda")
block_pda(usr, href_list["target"])
if("unblock_pda")
unblock_pda(usr, href_list["target"])
if("cart")
if(cartridge)
cartridge.special(U, href_list)
else
U << browse(null, "window=pda")
return
//SYNDICATE FUNCTIONS===================================
if("Toggle Door")
if(cartridge && cartridge.access & CART_REMOTE_DOOR)
for(var/obj/machinery/door/poddoor/M in GLOB.machines)
if(M.id == cartridge.remote_door_id)
if(M.density)
M.open()
else
M.close()
//pAI FUNCTIONS===================================
if("pai")
switch(href_list["option"])
if("1") // Configure pAI device
pai.attack_self(U)
if("2") // Eject pAI device
var/turf/T = get_turf(loc)
if(T)
pai.forceMove(T)
//DRINK RECIPE BROWSER=============================
if("Drink Recipe Browser")
if(cartridge && cartridge.access & CART_BARTENDER)
recipe_search(U, GLOB.drink_reactions_list)
//CHEMISTRY RECIPE BROWSER
if("Chemistry Recipe Browser")
if(cartridge && cartridge.access & CART_CHEMISTRY)
recipe_search(U, GLOB.normalized_chemical_reactions_list)
//LINK FUNCTIONS===================================
else//Cartridge menu linking
mode = max(text2num(href_list["choice"]), 0)
else//If not in range, can't interact or not using the pda.
U.unset_machine()
U << browse(null, "window=pda")
return
//EXTRA FUNCTIONS===================================
if (mode == 2 || mode == 21)//To clear message overlays.
update_icon()
if ((honkamt > 0) && (prob(60)))//For clown virus.
honkamt--
playsound(src, 'sound/items/bikehorn.ogg', 30, 1)
if(U.machine == src && href_list["skiprefresh"]!="1")//Final safety.
attack_self(U)//It auto-closes the menu prior if the user is not in range and so on.
else
U.unset_machine()
U << browse(null, "window=pda")
return
/obj/item/pda/proc/remove_id(mob/user)
if(hasSiliconAccessInArea(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK, FALSE))
return
do_remove_id(user)
/obj/item/pda/proc/do_remove_id(mob/user)
if(!id)
return
if(user)
user.put_in_hands(id)
to_chat(user, "You remove the ID from the [name].")
else
id.forceMove(get_turf(src))
. = id
id = null
update_icon()
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
if(H.wear_id == src)
H.sec_hud_set_ID()
/obj/item/pda/proc/msg_input(mob/living/U = usr)
var/t = stripped_input(U, "Please enter message", name)
if (!t || toff)
return
if(!U.canUseTopic(src, BE_CLOSE, FALSE, NO_TK, FALSE))
return
if(emped)
t = Gibberish(t, 100)
return t
/obj/item/pda/proc/send_message(mob/living/user, list/obj/item/pda/targets, everyone)
var/message = msg_input(user)
if(!message || !targets.len)
return
if((last_text && world.time < last_text + 10) || (everyone && last_everyone && world.time < last_everyone + PDA_SPAM_DELAY))
return
if(prob(1))
message += "\nSent from my PDA"
// Send the signal
var/list/string_targets = list()
var/list/string_blocked
for(var/obj/item/pda/P in targets)
if(owner in P.blocked_pdas)
LAZYADD(string_blocked, P.owner)
continue
if(P.owner && P.ownjob) // != src is checked by the UI
string_targets += "[P.owner] ([P.ownjob])"
if(string_blocked)
string_blocked = english_list(string_blocked)
to_chat(user, "[icon2html(src, user)] The following recipients have blocked your message: [string_blocked].")
for (var/obj/machinery/computer/message_monitor/M in targets)
// In case of "Reply" to a message from a console, this will make the
// message be logged successfully. If the console is impersonating
// someone by matching their name and job, the reply will reach the
// impersonated PDA.
string_targets += "[M.customsender] ([M.customjob])"
if (!string_targets.len)
return
var/datum/signal/subspace/pda/signal = new(src, list(
"name" = "[owner]",
"job" = "[ownjob]",
"message" = message,
"targets" = string_targets,
"emojis" = allow_emojis
))
if (picture)
signal.data["photo"] = picture
signal.send_to_receivers()
// If it didn't reach, note that fact
if (!signal.data["done"])
to_chat(user, "ERROR: Server isn't responding.")
if (!silent)
playsound(src, 'sound/machines/terminal_error.ogg', 15, 1)
return
var/target_text = signal.format_target()
if(allow_emojis)
message = emoji_parse(message)//already sent- this just shows the sent emoji as one to the sender in the to_chat
signal.data["message"] = emoji_parse(signal.data["message"])
// Log it in our logs
tnote += "→ To [target_text]: [signal.format_message()] "
// Show it to ghosts
var/ghost_message = "[owner] PDA Message --> [target_text]: [signal.format_message()]"
for(var/i in GLOB.dead_mob_list)
var/mob/M = i
if(M?.client && M.client.prefs.chat_toggles & CHAT_GHOSTPDA)
to_chat(M, "[FOLLOW_LINK(M, user)] [ghost_message]")
to_chat(user, "Message sent to [target_text]: \"[message]\"")
// Log in the talk log
user.log_talk(message, LOG_PDA, tag="PDA: [initial(name)] to [target_text] (BLOCKED:[string_blocked])")
if (!silent)
playsound(src, 'sound/machines/terminal_success.ogg', 15, 1)
// Reset the photo
picture = null
last_text = world.time
if (everyone)
last_everyone = world.time
/obj/item/pda/proc/receive_message(datum/signal/subspace/pda/signal)
tnote += "← From [signal.data["name"]] ([signal.data["job"]]):(BLOCK/UNBLOCK) [signal.format_message()] "
if (!silent)
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))
L = loc
//Maybe they are a pAI!
else
L = get(src, /mob/living/silicon)
if(L && L.stat != UNCONSCIOUS)
var/hrefstart
var/hrefend
if (isAI(L))
hrefstart = ""
hrefend = ""
var/inbound_message = signal.format_message()
if(signal.data["emojis"] == TRUE)//so will not parse emojis as such from pdas that don't send emojis
inbound_message = emoji_parse(inbound_message)
to_chat(L, "[icon2html(src)] Message from [hrefstart][signal.data["name"]] ([signal.data["job"]])[hrefend], [inbound_message] (Reply) (BLOCK/UNBLOCK)")
new_alert = TRUE
update_icon(TRUE)
/obj/item/pda/proc/send_to_all(mob/living/U)
if (last_everyone && world.time < last_everyone + PDA_SPAM_DELAY)
to_chat(U,"Send To All function is still on cooldown.")
return
send_message(U,get_viewable_pdas(), TRUE)
/obj/item/pda/proc/create_message(mob/living/U, obj/item/pda/P)
send_message(U,list(P))
/obj/item/pda/proc/toggle_blocking(mob/user, target)
if(target in blocked_pdas)
unblock_pda(user, target)
else
block_pda(user, target)
/obj/item/pda/proc/block_pda(mob/user, target)
to_chat(user, "[icon2html(src, user)] [target] blocked from messages. Use the messenger PDA list to unblock.")
LAZYOR(blocked_pdas, target)
/obj/item/pda/proc/unblock_pda(mob/user, target)
to_chat(user, "[icon2html(src, user)] [target] unblocked from messages.")
LAZYREMOVE(blocked_pdas, target)
/obj/item/pda/AltClick(mob/user)
. = ..()
if(id)
remove_id(user)
playsound(src, 'sound/machines/terminal_eject_disc.ogg', 50, 1)
else
remove_pen(user)
playsound(src, 'sound/machines/button4.ogg', 50, 1)
return TRUE
/obj/item/pda/CtrlClick(mob/user)
..()
if(isturf(loc)) //stops the user from dragging the PDA by ctrl-clicking it.
return
remove_pen(user)
/obj/item/pda/verb/verb_toggle_light()
set category = "Object"
set name = "Toggle Flashlight"
toggle_light()
/obj/item/pda/verb/verb_remove_id()
set category = "Object"
set name = "Eject ID"
set src in usr
if(id)
remove_id(usr)
else
to_chat(usr, "This PDA does not have an ID in it!")
/obj/item/pda/verb/verb_remove_pen()
set category = "Object"
set name = "Remove Pen"
set src in usr
remove_pen()
/obj/item/pda/proc/toggle_light()
if(hasSiliconAccessInArea(usr) || !usr.canUseTopic(src, BE_CLOSE, check_resting = FALSE))
return FALSE
if(fon)
fon = FALSE
set_light(0)
else if(f_lum)
fon = TRUE
set_light(f_lum, f_pow, f_col)
update_icon()
return TRUE
/obj/item/pda/proc/remove_pen()
if(hasSiliconAccessInArea(usr) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK, FALSE))
return
if(inserted_item)
usr.put_in_hands(inserted_item)
to_chat(usr, "You remove [inserted_item] from [src].")
inserted_item = null
update_icon()
else
to_chat(usr, "This PDA does not have a pen in it!")
//trying to insert or remove an id
/obj/item/pda/proc/id_check(mob/user, obj/item/card/id/I)
if(!I)
if(id && (src in user.contents))
remove_id(user)
return TRUE
else
var/obj/item/card/id/C = user.get_active_held_item()
if(istype(C))
I = C
if(I?.registered_name)
if(!user.transferItemToLoc(I, src))
return FALSE
insert_id(I, user)
update_icon()
playsound(src, 'sound/machines/button.ogg', 50, 1)
return TRUE
/obj/item/pda/proc/insert_id(obj/item/card/id/inserting_id, mob/user)
var/obj/old_id = id
id = inserting_id
if(ishuman(loc))
var/mob/living/carbon/human/human_wearer = loc
if(human_wearer.wear_id == src)
human_wearer.sec_hud_set_ID()
if(old_id)
if(user)
user.put_in_hands(old_id)
else
old_id.forceMove(get_turf(src))
// access to status display signals
/obj/item/pda/attackby(obj/item/C, mob/user, params)
if(istype(C, /obj/item/cartridge) && !cartridge)
if(!user.transferItemToLoc(C, src))
return
cartridge = C
cartridge.host_pda = src
to_chat(user, "You insert [cartridge] into [src].")
update_icon()
playsound(src, 'sound/machines/button.ogg', 50, 1)
else if(istype(C, /obj/item/card/id))
var/obj/item/card/id/idcard = C
if(!idcard.registered_name)
to_chat(user, "\The [src] rejects the ID!")
if (!silent)
playsound(src, 'sound/machines/terminal_error.ogg', 15, 1)
return
if(!owner)
owner = idcard.registered_name
ownjob = idcard.assignment
update_label()
to_chat(user, "Card scanned.")
if (!silent)
playsound(src, 'sound/machines/terminal_success.ogg', 15, 1)
else
//Basic safety check. If either both objects are held by user or PDA is on ground and card is in hand.
if(((src in user.contents) || (isturf(loc) && in_range(src, user))) && (C in user.contents))
if(!id_check(user, idcard))
return
to_chat(user, "You put the ID into \the [src]'s slot.")
updateSelfDialog()//Update self dialog on success.
return //Return in case of failed check or when successful.
updateSelfDialog()//For the non-input related code.
else if(istype(C, /obj/item/paicard) && !pai)
if(!user.transferItemToLoc(C, src))
return
pai = C
to_chat(user, "You slot \the [C] into [src].")
update_icon()
updateUsrDialog()
else if(is_type_in_list(C, contained_item)) //Checks if there is a pen
if(inserted_item)
to_chat(user, "There is already \a [inserted_item] in \the [src]!")
return ..()
else
if(!user.transferItemToLoc(C, src))
return
to_chat(user, "You slide \the [C] into \the [src].")
inserted_item = C
update_icon()
playsound(src, 'sound/machines/button.ogg', 50, 1)
else if(istype(C, /obj/item/photo))
var/obj/item/photo/P = C
picture = P.picture
to_chat(user, "You scan \the [C].")
else
return ..()
/obj/item/pda/attack(mob/living/carbon/C, mob/living/user)
if(istype(C))
switch(scanmode)
if(PDA_SCANNER_MEDICAL)
C.visible_message("[user] has analyzed [C]'s vitals!")
healthscan(user, C, 1)
add_fingerprint(user)
if(PDA_SCANNER_HALOGEN)
C.visible_message("[user] has analyzed [C]'s radiation levels!")
user.show_message("Analyzing Results for [C]:")
if(C.radiation)
user.show_message("\green Radiation Level: \black [C.radiation]")
else
user.show_message("No radiation detected.")
/obj/item/pda/afterattack(atom/A as mob|obj|turf|area, mob/user, proximity)
. = ..()
if(!proximity)
return
switch(scanmode)
if(PDA_SCANNER_REAGENT)
if(!isnull(A.reagents))
if(A.reagents.reagent_list.len > 0)
var/reagents_length = A.reagents.reagent_list.len
to_chat(user, "[reagents_length] chemical agent[reagents_length > 1 ? "s" : ""] found.")
for (var/re in A.reagents.reagent_list)
to_chat(user, "\t [re]")
else
to_chat(user, "No active chemical agents found in [A].")
else
to_chat(user, "No significant chemical agents found in [A].")
if(PDA_SCANNER_GAS)
A.analyzer_act(user, src)
if (!scanmode && istype(A, /obj/item/paper) && owner)
var/obj/item/paper/PP = A
if (!PP.info)
to_chat(user, "Unable to scan! Paper is blank.")
return
notehtml = PP.info
note = replacetext(notehtml, " ", "\[br\]")
note = replacetext(note, "
", "\[*\]")
note = replacetext(note, "
", "\[list\]")
note = replacetext(note, "
", "\[/list\]")
note = html_encode(note)
notescanned = TRUE
to_chat(user, "Paper scanned. Saved to PDA's notekeeper." )
/obj/item/pda/proc/explode() //This needs tuning.
if(!detonatable)
return
var/turf/T = get_turf(src)
if (ismob(loc))
var/mob/M = loc
M.show_message("Your [src] explodes!", MSG_VISUAL, "You hear a loud *pop*!", MSG_AUDIBLE)
else
visible_message("[src] explodes!", "You hear a loud *pop*!")
if(T)
T.hotspot_expose(700,125)
if(istype(cartridge, /obj/item/cartridge/virus/syndicate))
explosion(T, -1, 1, 3, 4)
else
explosion(T, -1, -1, 2, 3)
qdel(src)
return
/obj/item/pda/Destroy()
GLOB.PDAs -= src
if(istype(id))
QDEL_NULL(id)
if(istype(cartridge))
QDEL_NULL(cartridge)
if(istype(pai))
QDEL_NULL(pai)
if(istype(inserted_item))
QDEL_NULL(inserted_item)
return ..()
//AI verb and proc for sending PDA messages.
/mob/living/silicon/ai/proc/cmd_send_pdamesg(mob/user)
var/list/plist = list()
var/list/namecounts = list()
if(aiPDA.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)
continue
plist[avoid_assoc_duplicate_keys(P.owner, namecounts)] = P
var/c = input(user, "Please select a PDA") as null|anything in sort_list(plist)
if (!c)
return
var/selected = plist[c]
if(aicamera.stored.len)
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
if(incapacitated())
return
aiPDA.create_message(src, selected)
/mob/living/silicon/ai/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, "PDA sender/receiver toggled [(aiPDA.toff ? "Off" : "On")]!")
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()
set category = "AI Commands"
set name = "PDA - Toggle Ringer"
if(usr.stat == DEAD)
return //won't work if dead
if(!isnull(aiPDA))
//0
aiPDA.silent = !aiPDA.silent
to_chat(usr, "PDA ringer toggled [(aiPDA.silent ? "Off" : "On")]!")
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)
if(incapacitated())
return
if(!isnull(aiPDA))
var/HTML = "AI PDA Message Log[aiPDA.tnote]"
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.")
// Pass along the pulse to atoms in contents, largely added so pAIs are vulnerable to EMP
/obj/item/pda/emp_act(severity)
. = ..()
if (!(. & EMP_PROTECT_CONTENTS))
for(var/atom/A in src)
A.emp_act(severity)
if (!(. & EMP_PROTECT_SELF))
emped += 1
spawn(2 * severity)
emped -= 1
/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)
continue
. += P
//borg pda stuff
/mob/living/silicon/robot/proc/cmd_send_pdamesg(mob/user)
var/list/plist = list()
var/list/namecounts = list()
if(aiPDA.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)
continue
plist[avoid_assoc_duplicate_keys(P.owner, namecounts)] = P
var/c = input(user, "Please select a PDA") as null|anything in sort_list(plist)
if (!c)
return
var/selected = plist[c]
if(aicamera.stored.len)
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
if(incapacitated())
return
aiPDA.create_message(src, selected)
/mob/living/silicon/robot/proc/cmd_show_message_log(mob/user)
if(incapacitated())
return
if(!isnull(aiPDA))
var/HTML = "AI PDA Message Log[aiPDA.tnote]"
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.")
#undef PDA_SCANNER_NONE
#undef PDA_SCANNER_MEDICAL
#undef PDA_SCANNER_FORENSICS
#undef PDA_SCANNER_REAGENT
#undef PDA_SCANNER_HALOGEN
#undef PDA_SCANNER_GAS
#undef PDA_SPAM_DELAY
#undef PDA_OVERLAY_ALERT
#undef PDA_OVERLAY_SCREEN
#undef PDA_OVERLAY_ID
#undef PDA_OVERLAY_ITEM
#undef PDA_OVERLAY_LIGHT
#undef PDA_OVERLAY_PAI