|
|
|
@@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
|
|
//The advanced pea-green monochrome lcd of tomorrow.
|
|
|
|
|
|
|
|
|
|
var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
@@ -25,7 +26,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
var/f_lum = 2 //Luminosity for the flashlight function
|
|
|
|
|
var/silent = 0 //To beep or not to beep, that is the question
|
|
|
|
|
var/toff = 0 //If 1, messenger disabled
|
|
|
|
|
var/tnote = null //Current Texts
|
|
|
|
|
var/tnote[0] //Current Texts
|
|
|
|
|
var/last_text //No text spamming
|
|
|
|
|
var/last_honk //Also no honk spamming that's bad too
|
|
|
|
|
var/ttone = "beep" //The ringtone!
|
|
|
|
@@ -37,7 +38,10 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
var/cart = "" //A place to stick cartridge menu information
|
|
|
|
|
var/detonate = 1 // Can the PDA be blown up?
|
|
|
|
|
var/hidden = 0 // Is the PDA hidden from the PDA list?
|
|
|
|
|
|
|
|
|
|
var/active_conversation = null // New variable that allows us to only view a single conversation.
|
|
|
|
|
var/list/conversations = list() // For keeping up with who we have PDA messsages from.
|
|
|
|
|
var/newmessage = 0 //To remove hackish overlay check
|
|
|
|
|
|
|
|
|
|
var/obj/item/weapon/card/id/id = null //Making it possible to slot an ID card into the PDA so it can function as both.
|
|
|
|
|
var/ownjob = null //related to above
|
|
|
|
|
|
|
|
|
@@ -242,7 +246,13 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
if(usr.stat == 2)
|
|
|
|
|
usr << "You can't do that because you are dead!"
|
|
|
|
|
return
|
|
|
|
|
var/HTML = "<html><head><title>AI PDA Message Log</title></head><body>[tnote]</body></html>"
|
|
|
|
|
var/HTML = "<html><head><title>AI PDA Message Log</title></head><body>"
|
|
|
|
|
for(var/index in tnote)
|
|
|
|
|
if(index["sent"])
|
|
|
|
|
HTML += addtext("<i><b>→ To <a href='byond://?src=\ref[src];choice=Message;target=",index["src"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
|
|
|
|
|
else
|
|
|
|
|
HTML += addtext("<i><b>← From <a href='byond://?src=\ref[src];choice=Message;target=",index["target"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
|
|
|
|
|
HTML +="</body></html>"
|
|
|
|
|
usr << browse(HTML, "window=log;size=400x444;border=1;can_resize=1;can_close=1;can_minimize=0")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -309,6 +319,172 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
return attack_self(M)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Notes for those wanting to modify this code or even understand it.
|
|
|
|
|
There are two modes: New UI and a UI already existing.
|
|
|
|
|
If the UI is new, you define your variables, if the ui already exists if it didn't have variables in data for what you want to add
|
|
|
|
|
then it won't add it even if you make a data["blahblah"] for it. That's the reason for the = null all over the place, so that.
|
|
|
|
|
ui.push_data(data) proc has to have the var structure already setup otherwise it can't push the update.
|
|
|
|
|
|
|
|
|
|
The exception to the "YOU HAVE TO DEFINE IT" rule is cartridges, we later force
|
|
|
|
|
the ui to close if a cartridge is inserted so that never will be a problem.
|
|
|
|
|
So there will never be a time a UI creation causes that to be a problem.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/obj/item/device/pda/ui_interact(mob/user, ui_key = "main")
|
|
|
|
|
var/title = "Personal Data Assistant"
|
|
|
|
|
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, ui_key)
|
|
|
|
|
|
|
|
|
|
var/data[0] // This is the data that will be sent to the PDA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data["owner"] = owner // Who is your daddy...
|
|
|
|
|
data["ownjob"] = ownjob // ...and what does he do?
|
|
|
|
|
|
|
|
|
|
data["mode"] = mode // The current view
|
|
|
|
|
data["scanmode"] = scanmode // Scanners
|
|
|
|
|
data["fon"] = fon // Flashlight on?
|
|
|
|
|
data["pai"] = (isnull(pai) ? 0 : 1) // pAI inserted?
|
|
|
|
|
data["note"] = note // current pda notes
|
|
|
|
|
data["silent"] = silent // does the pda make noise when it receives a message?
|
|
|
|
|
data["toff"] = toff // is the messenger function turned off?
|
|
|
|
|
data["active_conversation"] = active_conversation // Which conversation are we following right now?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data["idInserted"] = (id ? 1 : 0)
|
|
|
|
|
data["idLink"] = (id ? text("[id.registered_name], [id.assignment]") : "--------")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(cartridge)
|
|
|
|
|
var/cartdata[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data["records"] = cartridge.create_NanoUI_values()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cartdata["name"] = cartridge.name
|
|
|
|
|
cartdata["access"] = list(\
|
|
|
|
|
"access_security" = cartridge.access_security,\
|
|
|
|
|
"access_engine" = cartridge.access_engine,\
|
|
|
|
|
"access_atmos" = cartridge.access_atmos,\
|
|
|
|
|
"access_medical" = cartridge.access_medical,\
|
|
|
|
|
"access_clown" = cartridge.access_clown,\
|
|
|
|
|
"access_mime" = cartridge.access_mime,\
|
|
|
|
|
"access_janitor" = cartridge.access_janitor,\
|
|
|
|
|
"access_quartermaster" = cartridge.access_quartermaster,\
|
|
|
|
|
"access_hydroponics" = cartridge.access_hydroponics,\
|
|
|
|
|
"access_reagent_scanner" = cartridge.access_reagent_scanner,\
|
|
|
|
|
"access_remote_door" = cartridge.access_remote_door,\
|
|
|
|
|
"access_status_display" = cartridge.access_status_display\
|
|
|
|
|
)
|
|
|
|
|
if(isnull(cartridge.radio))
|
|
|
|
|
cartdata["radio"] = 0
|
|
|
|
|
else
|
|
|
|
|
if(istype(cartridge.radio, /obj/item/radio/integrated/beepsky))
|
|
|
|
|
cartdata["radio"] = 1
|
|
|
|
|
if(istype(cartridge.radio, /obj/item/radio/integrated/signal))
|
|
|
|
|
cartdata["radio"] = 2
|
|
|
|
|
if(istype(cartridge.radio, /obj/item/radio/integrated/mule))
|
|
|
|
|
cartdata["radio"] = 3
|
|
|
|
|
|
|
|
|
|
cartdata["type"] = cartridge.type
|
|
|
|
|
cartdata["charges"] = cartridge.charges ? cartridge.charges : 0
|
|
|
|
|
data["cartridge"] = cartdata
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data["stationTime"] = worldtime2text()
|
|
|
|
|
data["newMessage"] = newmessage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var/convopdas[0]
|
|
|
|
|
var/pdas[0]
|
|
|
|
|
var/count = 0
|
|
|
|
|
for (var/obj/item/device/pda/P in sortAtom(PDAs))
|
|
|
|
|
if (!P.owner||P.toff||P == src||P.hidden) continue
|
|
|
|
|
if(conversations.Find("\ref[P]"))
|
|
|
|
|
convopdas.Add(list(list("Name" = "[P]", "Reference" = "\ref[P]", "Detonate" = "[P.detonate]", "inconvo" = "1")))
|
|
|
|
|
else
|
|
|
|
|
pdas.Add(list(list("Name" = "[P]", "Reference" = "\ref[P]", "Detonate" = "[P.detonate]", "inconvo" = "0")))
|
|
|
|
|
count++
|
|
|
|
|
data["convopdas"] = convopdas
|
|
|
|
|
data["pdas"] = pdas
|
|
|
|
|
data["pda_count"] = count
|
|
|
|
|
data["messagescount"] = tnote.len
|
|
|
|
|
data["messages"] = tnote
|
|
|
|
|
var/found = 0
|
|
|
|
|
if(active_conversation)
|
|
|
|
|
for(var/c in tnote)
|
|
|
|
|
if(c["target"] == active_conversation)
|
|
|
|
|
data["convo_name"] = c["owner"]
|
|
|
|
|
data["convo_job"] = c["job"]
|
|
|
|
|
found = 1
|
|
|
|
|
break
|
|
|
|
|
if(!found)
|
|
|
|
|
data["convo_name"] = null
|
|
|
|
|
data["convo_job"] = null
|
|
|
|
|
|
|
|
|
|
if(!ui || mode==41)
|
|
|
|
|
data["manifest"] = data_core.get_manifest_json()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!ui || mode==3)
|
|
|
|
|
var/turf/T = get_turf_or_move(user.loc)
|
|
|
|
|
if(!isnull(T))
|
|
|
|
|
var/datum/gas_mixture/environment = T.return_air()
|
|
|
|
|
|
|
|
|
|
var/pressure = environment.return_pressure()
|
|
|
|
|
var/total_moles = environment.total_moles()
|
|
|
|
|
|
|
|
|
|
if (total_moles)
|
|
|
|
|
var/o2_level = environment.oxygen/total_moles
|
|
|
|
|
var/n2_level = environment.nitrogen/total_moles
|
|
|
|
|
var/co2_level = environment.carbon_dioxide/total_moles
|
|
|
|
|
var/plasma_level = environment.toxins/total_moles
|
|
|
|
|
var/unknown_level = 1-(o2_level+n2_level+co2_level+plasma_level)
|
|
|
|
|
data["aircontents"] = list(\
|
|
|
|
|
"pressure" = "[round(pressure,0.1)]",\
|
|
|
|
|
"nitrogen" = "[round(n2_level*100,0.1)]",\
|
|
|
|
|
"oxygen" = "[round(o2_level*100,0.1)]",\
|
|
|
|
|
"carbon_dioxide" = "[round(co2_level*100,0.1)]",\
|
|
|
|
|
"plasma" = "[round(plasma_level*100,0.01)]",\
|
|
|
|
|
"other" = "[round(unknown_level, 0.01)]",\
|
|
|
|
|
"temp" = "[round(environment.temperature-T0C,0.1)]",\
|
|
|
|
|
"reading" = 1\
|
|
|
|
|
)
|
|
|
|
|
if(isnull(data["aircontents"]))
|
|
|
|
|
data["aircontents"] = list(\
|
|
|
|
|
"pressure" = null,\
|
|
|
|
|
"nitrogen" = null,\
|
|
|
|
|
"oxygen" = null,\
|
|
|
|
|
"carbon_dioxide" = null,\
|
|
|
|
|
"plasma" = null,\
|
|
|
|
|
"other" = null,\
|
|
|
|
|
"temp" = null,\
|
|
|
|
|
"reading" = 0\
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ui)
|
|
|
|
|
// the ui does not exist, so we'll create a new one
|
|
|
|
|
ui = new(user, src, ui_key, "pda.tmpl", title, 630, 600)
|
|
|
|
|
// When the UI is first opened this is the data it will use
|
|
|
|
|
ui.set_initial_data(data)
|
|
|
|
|
ui.open()
|
|
|
|
|
else
|
|
|
|
|
// The UI is already open so push the new data to it
|
|
|
|
|
ui.push_data(data)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//NOTE: graphic resources are loaded on client login
|
|
|
|
|
/obj/item/device/pda/attack_self(mob/user as mob)
|
|
|
|
|
|
|
|
|
@@ -317,203 +493,21 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
if(active_uplink_check(user))
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
var/dat = "<html><head><title>Personal Data Assistant</title></head><body bgcolor=\"#808000\"><style>a, a:link, a:visited, a:active, a:hover { color: #000000; }img {border-style:none;}</style>"
|
|
|
|
|
|
|
|
|
|
dat += "<a href='byond://?src=\ref[src];choice=Close'><img src=pda_exit.png> Close</a>"
|
|
|
|
|
|
|
|
|
|
if ((!isnull(cartridge)) && (mode == 0))
|
|
|
|
|
dat += " | <a href='byond://?src=\ref[src];choice=Eject'><img src=pda_eject.png> Eject [cartridge]</a>"
|
|
|
|
|
if (mode)
|
|
|
|
|
dat += " | <a href='byond://?src=\ref[src];choice=Return'><img src=pda_menu.png> Return</a>"
|
|
|
|
|
dat += " | <a href='byond://?src=\ref[src];choice=Refresh'><img src=pda_refresh.png> Refresh</a>"
|
|
|
|
|
|
|
|
|
|
dat += "<br>"
|
|
|
|
|
|
|
|
|
|
if (!owner)
|
|
|
|
|
dat += "Warning: No owner information entered. Please swipe card.<br><br>"
|
|
|
|
|
dat += "<a href='byond://?src=\ref[src];choice=Refresh'><img src=pda_refresh.png> Retry</a>"
|
|
|
|
|
else
|
|
|
|
|
switch (mode)
|
|
|
|
|
if (0)
|
|
|
|
|
dat += "<h2>PERSONAL DATA ASSISTANT v.1.2</h2>"
|
|
|
|
|
dat += "Owner: [owner], [ownjob]<br>"
|
|
|
|
|
dat += text("ID: <A href='?src=\ref[src];choice=Authenticate'>[id ? "[id.registered_name], [id.assignment]" : "----------"]")
|
|
|
|
|
dat += text("<br><A href='?src=\ref[src];choice=UpdateInfo'>[id ? "Update PDA Info" : ""]</A><br>")
|
|
|
|
|
|
|
|
|
|
dat += "Station Time: [worldtime2text()]"//:[world.time / 100 % 6][world.time / 100 % 10]"
|
|
|
|
|
|
|
|
|
|
dat += "<br><br>"
|
|
|
|
|
|
|
|
|
|
dat += "<h4>General Functions</h4>"
|
|
|
|
|
dat += "<ul>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=1'><img src=pda_notes.png> Notekeeper</a></li>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=2'><img src=pda_mail.png> Messenger</a></li>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=41'><img src=pda_notes.png> View Crew Manifest</a></li>"
|
|
|
|
|
//dat += "<li><a href='byond://?src=\red[src];choice=chatroom'><img src=pda_chatroom.png> Nanotrasen Relay Chat</a></li>"
|
|
|
|
|
|
|
|
|
|
if (cartridge)
|
|
|
|
|
if (cartridge.access_clown)
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=Honk'><img src=pda_honk.png> Honk Synthesizer</a></li>"
|
|
|
|
|
if(cartridge.access_status_display)
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=42'><img src=pda_status.png> Set Status Display</a></li>"
|
|
|
|
|
dat += "</ul>"
|
|
|
|
|
if (cartridge.access_engine)
|
|
|
|
|
dat += "<h4>Engineering Functions</h4>"
|
|
|
|
|
dat += "<ul>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=43'><img src=pda_power.png> Power Monitor</a></li>"
|
|
|
|
|
dat += "</ul>"
|
|
|
|
|
if (cartridge.access_medical)
|
|
|
|
|
dat += "<h4>Medical Functions</h4>"
|
|
|
|
|
dat += "<ul>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=44'><img src=pda_medical.png> Medical Records</a></li>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=Medical Scan'><img src=pda_scanner.png> [scanmode == 1 ? "Disable" : "Enable"] Medical Scanner</a></li>"
|
|
|
|
|
dat += "</ul>"
|
|
|
|
|
if (cartridge.access_security)
|
|
|
|
|
dat += "<h4>Security Functions</h4>"
|
|
|
|
|
dat += "<ul>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=45'><img src=pda_cuffs.png> Security Records</A></li>"
|
|
|
|
|
if(istype(cartridge.radio, /obj/item/radio/integrated/beepsky))
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=46'><img src=pda_cuffs.png> Security Bot Access</a></li>"
|
|
|
|
|
dat += "</ul>"
|
|
|
|
|
else dat += "</ul>"
|
|
|
|
|
if(cartridge.access_quartermaster)
|
|
|
|
|
dat += "<h4>Quartermaster Functions:</h4>"
|
|
|
|
|
dat += "<ul>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=47'><img src=pda_crate.png> Supply Records</A></li>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=48'><img src=pda_mule.png> Delivery Bot Control</A></li>"
|
|
|
|
|
dat += "</ul>"
|
|
|
|
|
dat += "</ul>"
|
|
|
|
|
|
|
|
|
|
dat += "<h4>Utilities</h4>"
|
|
|
|
|
dat += "<ul>"
|
|
|
|
|
if (cartridge)
|
|
|
|
|
if (cartridge.access_janitor)
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=49'><img src=pda_bucket.png> Custodial Locator</a></li>"
|
|
|
|
|
if (istype(cartridge.radio, /obj/item/radio/integrated/signal))
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=40'><img src=pda_signaler.png> Signaler System</a></li>"
|
|
|
|
|
if (cartridge.access_reagent_scanner)
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=Reagent Scan'><img src=pda_reagent.png> [scanmode == 3 ? "Disable" : "Enable"] Reagent Scanner</a></li>"
|
|
|
|
|
if (cartridge.access_engine)
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=Halogen Counter'><img src=pda_reagent.png> [scanmode == 4 ? "Disable" : "Enable"] Halogen Counter</a></li>"
|
|
|
|
|
if (cartridge.access_atmos)
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=Gas Scan'><img src=pda_reagent.png> [scanmode == 5 ? "Disable" : "Enable"] Gas Scanner</a></li>"
|
|
|
|
|
if (cartridge.access_remote_door)
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=Toggle Door'><img src=pda_rdoor.png> Toggle Remote Door</a></li>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=3'><img src=pda_atmos.png> Atmospheric Scan</a></li>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=Light'><img src=pda_flashlight.png> [fon ? "Disable" : "Enable"] Flashlight</a></li>"
|
|
|
|
|
if (pai)
|
|
|
|
|
if(pai.loc != src)
|
|
|
|
|
pai = null
|
|
|
|
|
else
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=pai;option=1'>pAI Device Configuration</a></li>"
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=pai;option=2'>Eject pAI Device</a></li>"
|
|
|
|
|
dat += "</ul>"
|
|
|
|
|
|
|
|
|
|
if (1)
|
|
|
|
|
dat += "<h4><img src=pda_notes.png> Notekeeper V2.1</h4>"
|
|
|
|
|
dat += "<a href='byond://?src=\ref[src];choice=Edit'> Edit</a><br>"
|
|
|
|
|
dat += note
|
|
|
|
|
|
|
|
|
|
if (2)
|
|
|
|
|
dat += "<h4><img src=pda_mail.png> SpaceMessenger V3.9.4</h4>"
|
|
|
|
|
dat += "<a href='byond://?src=\ref[src];choice=Toggle Ringer'><img src=pda_bell.png> Ringer: [silent == 1 ? "Off" : "On"]</a> | "
|
|
|
|
|
dat += "<a href='byond://?src=\ref[src];choice=Toggle Messenger'><img src=pda_mail.png> Send / Receive: [toff == 1 ? "Off" : "On"]</a> | "
|
|
|
|
|
dat += "<a href='byond://?src=\ref[src];choice=Ringtone'><img src=pda_bell.png> Set Ringtone</a> | "
|
|
|
|
|
dat += "<a href='byond://?src=\ref[src];choice=21'><img src=pda_mail.png> Messages</a><br>"
|
|
|
|
|
|
|
|
|
|
if (istype(cartridge, /obj/item/weapon/cartridge/syndicate))
|
|
|
|
|
dat += "<b>[cartridge:shock_charges] detonation charges left.</b><HR>"
|
|
|
|
|
if (istype(cartridge, /obj/item/weapon/cartridge/clown))
|
|
|
|
|
dat += "<b>[cartridge:honk_charges] viral files left.</b><HR>"
|
|
|
|
|
if (istype(cartridge, /obj/item/weapon/cartridge/mime))
|
|
|
|
|
dat += "<b>[cartridge:mime_charges] viral files left.</b><HR>"
|
|
|
|
|
|
|
|
|
|
dat += "<h4><img src=pda_menu.png> Detected PDAs</h4>"
|
|
|
|
|
|
|
|
|
|
dat += "<ul>"
|
|
|
|
|
|
|
|
|
|
var/count = 0
|
|
|
|
|
|
|
|
|
|
if (!toff)
|
|
|
|
|
for (var/obj/item/device/pda/P in sortAtom(PDAs))
|
|
|
|
|
if (!P.owner||P.toff||P == src||P.hidden) continue
|
|
|
|
|
dat += "<li><a href='byond://?src=\ref[src];choice=Message;target=\ref[P]'>[P]</a>"
|
|
|
|
|
if (istype(cartridge, /obj/item/weapon/cartridge/syndicate) && P.detonate)
|
|
|
|
|
dat += " (<a href='byond://?src=\ref[src];choice=Detonate;target=\ref[P]'><img src=pda_boom.png>*Detonate*</a>)"
|
|
|
|
|
if (istype(cartridge, /obj/item/weapon/cartridge/clown))
|
|
|
|
|
dat += " (<a href='byond://?src=\ref[src];choice=Send Honk;target=\ref[P]'><img src=pda_honk.png>*Send Virus*</a>)"
|
|
|
|
|
if (istype(cartridge, /obj/item/weapon/cartridge/mime))
|
|
|
|
|
dat += " (<a href='byond://?src=\ref[src];choice=Send Silence;target=\ref[P]'>*Send Virus*</a>)"
|
|
|
|
|
dat += "</li>"
|
|
|
|
|
count++
|
|
|
|
|
dat += "</ul>"
|
|
|
|
|
if (count == 0)
|
|
|
|
|
dat += "None detected.<br>"
|
|
|
|
|
|
|
|
|
|
if(21)
|
|
|
|
|
dat += "<h4><img src=pda_mail.png> SpaceMessenger V3.9.4</h4>"
|
|
|
|
|
dat += "<a href='byond://?src=\ref[src];choice=Clear'><img src=pda_blank.png> Clear Messages</a>"
|
|
|
|
|
|
|
|
|
|
dat += "<h4><img src=pda_mail.png> Messages</h4>"
|
|
|
|
|
|
|
|
|
|
dat += tnote
|
|
|
|
|
dat += "<br>"
|
|
|
|
|
|
|
|
|
|
if (3)
|
|
|
|
|
dat += "<h4><img src=pda_atmos.png> Atmospheric Readings</h4>"
|
|
|
|
|
|
|
|
|
|
var/turf/T = get_turf_or_move(user.loc)
|
|
|
|
|
if (isnull(T))
|
|
|
|
|
dat += "Unable to obtain a reading.<br>"
|
|
|
|
|
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<br>"
|
|
|
|
|
|
|
|
|
|
if (total_moles)
|
|
|
|
|
var/o2_level = environment.oxygen/total_moles
|
|
|
|
|
var/n2_level = environment.nitrogen/total_moles
|
|
|
|
|
var/co2_level = environment.carbon_dioxide/total_moles
|
|
|
|
|
var/plasma_level = environment.toxins/total_moles
|
|
|
|
|
var/unknown_level = 1-(o2_level+n2_level+co2_level+plasma_level)
|
|
|
|
|
dat += "Nitrogen: [round(n2_level*100)]%<br>"
|
|
|
|
|
dat += "Oxygen: [round(o2_level*100)]%<br>"
|
|
|
|
|
dat += "Carbon Dioxide: [round(co2_level*100)]%<br>"
|
|
|
|
|
dat += "Plasma: [round(plasma_level*100)]%<br>"
|
|
|
|
|
if(unknown_level > 0.01)
|
|
|
|
|
dat += "OTHER: [round(unknown_level)]%<br>"
|
|
|
|
|
dat += "Temperature: [round(environment.temperature-T0C)]°C<br>"
|
|
|
|
|
dat += "<br>"
|
|
|
|
|
|
|
|
|
|
if (5)
|
|
|
|
|
dat += "<h4><img src=pda_chatroom.png> Nanotrasen Relay Chat</h4>"
|
|
|
|
|
|
|
|
|
|
dat += "<h4><img src=pda_menu.png> Detected Channels</h4>: <li>"
|
|
|
|
|
for(var/datum/chatroom/C in chatrooms)
|
|
|
|
|
dat += "<a href='byond://?src=\ref[src];pdachannel=[C.name]'>#[html_encode(lowertext(C.name))]"
|
|
|
|
|
if(C.password != "")
|
|
|
|
|
dat += " <img src=pda_locked.png>"
|
|
|
|
|
dat += "</li>"
|
|
|
|
|
|
|
|
|
|
if (41) //crew manifest
|
|
|
|
|
dat += "<h4><img src=pda_notes.png> Crew Manifest</h4>"
|
|
|
|
|
dat += "Entries cannot be modified from this terminal.<br><br>"
|
|
|
|
|
if(data_core)
|
|
|
|
|
dat += data_core.get_manifest(1) // make it monochrome
|
|
|
|
|
dat += "<br>"
|
|
|
|
|
|
|
|
|
|
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 += cart
|
|
|
|
|
|
|
|
|
|
dat += "</body></html>"
|
|
|
|
|
user << browse(dat, "window=pda;size=400x444;border=1;can_resize=1;can_close=0;can_minimize=0")
|
|
|
|
|
onclose(user, "pda", src)
|
|
|
|
|
ui_interact(user) //NanoUI requires this proc
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
/obj/item/device/pda/Topic(href, href_list)
|
|
|
|
|
if(href_list["cartmenu"] && !isnull(cartridge))
|
|
|
|
|
cartridge.Topic(href, href_list)
|
|
|
|
|
return 1
|
|
|
|
|
if(href_list["radiomenu"] && !isnull(cartridge) && !isnull(cartridge.radio))
|
|
|
|
|
cartridge.radio.Topic(href, href_list)
|
|
|
|
|
return 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
..()
|
|
|
|
|
var/mob/user = usr
|
|
|
|
|
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
|
|
|
|
var/mob/living/U = usr
|
|
|
|
|
//Looking for master was kind of pointless since PDAs don't appear to have one.
|
|
|
|
|
//if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ) )
|
|
|
|
@@ -530,7 +524,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
|
|
|
|
|
if("Close")//Self explanatory
|
|
|
|
|
U.unset_machine()
|
|
|
|
|
U << browse(null, "window=pda")
|
|
|
|
|
ui.close()
|
|
|
|
|
return
|
|
|
|
|
if("Refresh")//Refresh, goes to the end of the proc.
|
|
|
|
|
if("Return")//Return
|
|
|
|
@@ -538,11 +532,12 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
mode = 0
|
|
|
|
|
else
|
|
|
|
|
mode = round(mode/10)
|
|
|
|
|
if(mode==2)
|
|
|
|
|
active_conversation = null
|
|
|
|
|
if(mode==4)//Fix for cartridges. Redirects to hub.
|
|
|
|
|
mode = 0
|
|
|
|
|
else if(mode >= 40 && mode <= 49)//Fix for cartridges. Redirects to refresh the menu.
|
|
|
|
|
cartridge.mode = mode
|
|
|
|
|
cartridge.unlock()
|
|
|
|
|
if ("Authenticate")//Checks for ID
|
|
|
|
|
id_check(U, 1)
|
|
|
|
|
if("UpdateInfo")
|
|
|
|
@@ -554,6 +549,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
if(ismob(T))
|
|
|
|
|
T = T.loc
|
|
|
|
|
cartridge.loc = T
|
|
|
|
|
ui.close()
|
|
|
|
|
mode = 0
|
|
|
|
|
scanmode = 0
|
|
|
|
|
if (cartridge.radio)
|
|
|
|
|
cartridge.radio.hostpda = null
|
|
|
|
@@ -625,57 +622,80 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
note = replacetext(n, "\n", "<BR>")
|
|
|
|
|
notehtml = n
|
|
|
|
|
else
|
|
|
|
|
U << browse(null, "window=pda")
|
|
|
|
|
return
|
|
|
|
|
ui.close()
|
|
|
|
|
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(href_list["option"] == "All")
|
|
|
|
|
tnote.Cut()
|
|
|
|
|
conversations.Cut()
|
|
|
|
|
if(href_list["option"] == "Convo")
|
|
|
|
|
var/new_tnote[0]
|
|
|
|
|
for(var/i in tnote)
|
|
|
|
|
if(i["target"] != active_conversation)
|
|
|
|
|
new_tnote[++new_tnote.len] = i
|
|
|
|
|
tnote = new_tnote
|
|
|
|
|
conversations.Remove(active_conversation)
|
|
|
|
|
|
|
|
|
|
active_conversation = null
|
|
|
|
|
if(mode==21)
|
|
|
|
|
mode=2
|
|
|
|
|
|
|
|
|
|
if("Ringtone")
|
|
|
|
|
var/t = input(U, "Please enter new ringtone", name, ttone) as text
|
|
|
|
|
if (in_range(src, U) && loc == U)
|
|
|
|
|
if (t)
|
|
|
|
|
if(src.hidden_uplink && hidden_uplink.check_trigger(U, lowertext(t), lowertext(lock_code)))
|
|
|
|
|
U << "The PDA softly beeps."
|
|
|
|
|
U << browse(null, "window=pda")
|
|
|
|
|
ui.close()
|
|
|
|
|
else
|
|
|
|
|
t = copytext(sanitize(t), 1, 20)
|
|
|
|
|
ttone = t
|
|
|
|
|
else
|
|
|
|
|
U << browse(null, "window=pda")
|
|
|
|
|
ui.close()
|
|
|
|
|
return
|
|
|
|
|
if("Message")
|
|
|
|
|
|
|
|
|
|
var/obj/item/device/pda/P = locate(href_list["target"])
|
|
|
|
|
src.create_message(U, P)
|
|
|
|
|
if(mode == 2)
|
|
|
|
|
active_conversation = href_list["target"]
|
|
|
|
|
mode = 21
|
|
|
|
|
|
|
|
|
|
if("Select Conversation")
|
|
|
|
|
var/P = href_list["convo"]
|
|
|
|
|
for(var/n in conversations)
|
|
|
|
|
if(P == n)
|
|
|
|
|
active_conversation=P
|
|
|
|
|
mode=21
|
|
|
|
|
if("Send Honk")//Honk virus
|
|
|
|
|
if(istype(cartridge, /obj/item/weapon/cartridge/clown))//Cartridge checks are kind of unnecessary since everything is done through switch.
|
|
|
|
|
var/obj/item/device/pda/P = locate(href_list["target"])//Leaving it alone in case it may do something useful, I guess.
|
|
|
|
|
if(!isnull(P))
|
|
|
|
|
if (!P.toff && cartridge:honk_charges > 0)
|
|
|
|
|
cartridge:honk_charges--
|
|
|
|
|
if (!P.toff && cartridge.charges > 0)
|
|
|
|
|
cartridge.charges--
|
|
|
|
|
U.show_message("\blue Virus sent!", 1)
|
|
|
|
|
P.honkamt = (rand(15,20))
|
|
|
|
|
else
|
|
|
|
|
U << "PDA not found."
|
|
|
|
|
else
|
|
|
|
|
U << browse(null, "window=pda")
|
|
|
|
|
ui.close()
|
|
|
|
|
return
|
|
|
|
|
if("Send Silence")//Silent virus
|
|
|
|
|
if(istype(cartridge, /obj/item/weapon/cartridge/mime))
|
|
|
|
|
var/obj/item/device/pda/P = locate(href_list["target"])
|
|
|
|
|
if(!isnull(P))
|
|
|
|
|
if (!P.toff && cartridge:mime_charges > 0)
|
|
|
|
|
cartridge:mime_charges--
|
|
|
|
|
if (!P.toff && cartridge.charges > 0)
|
|
|
|
|
cartridge.charges--
|
|
|
|
|
U.show_message("\blue Virus sent!", 1)
|
|
|
|
|
P.silent = 1
|
|
|
|
|
P.ttone = "silence"
|
|
|
|
|
else
|
|
|
|
|
U << "PDA not found."
|
|
|
|
|
else
|
|
|
|
|
U << browse(null, "window=pda")
|
|
|
|
|
ui.close()
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -694,8 +714,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
if(istype(cartridge, /obj/item/weapon/cartridge/syndicate))
|
|
|
|
|
var/obj/item/device/pda/P = locate(href_list["target"])
|
|
|
|
|
if(!isnull(P))
|
|
|
|
|
if (!P.toff && cartridge:shock_charges > 0)
|
|
|
|
|
cartridge:shock_charges--
|
|
|
|
|
if (!P.toff && cartridge.charges > 0)
|
|
|
|
|
cartridge.charges--
|
|
|
|
|
|
|
|
|
|
var/difficulty = 0
|
|
|
|
|
|
|
|
|
@@ -712,7 +732,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
U.show_message("\red An error flashes on your [src].", 1)
|
|
|
|
|
else if (prob(difficulty * 3))
|
|
|
|
|
U.show_message("\red Energy feeds back into your [src]!", 1)
|
|
|
|
|
U << browse(null, "window=pda")
|
|
|
|
|
ui.close()
|
|
|
|
|
explode()
|
|
|
|
|
log_admin("[key_name(U)] just attempted to blow up [P] with the Detomatix cartridge but failed, blowing themselves up")
|
|
|
|
|
message_admins("[key_name_admin(U)] just attempted to blow up [P] with the Detomatix cartridge but failed, blowing themselves up", 1)
|
|
|
|
@@ -725,7 +745,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
U << "PDA not found."
|
|
|
|
|
else
|
|
|
|
|
U.unset_machine()
|
|
|
|
|
U << browse(null, "window=pda")
|
|
|
|
|
ui.close()
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
//pAI FUNCTIONS===================================
|
|
|
|
@@ -737,33 +757,31 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
var/turf/T = get_turf_or_move(src.loc)
|
|
|
|
|
if(T)
|
|
|
|
|
pai.loc = T
|
|
|
|
|
pai = null
|
|
|
|
|
|
|
|
|
|
//LINK FUNCTIONS===================================
|
|
|
|
|
|
|
|
|
|
else//Cartridge menu linking
|
|
|
|
|
else
|
|
|
|
|
mode = text2num(href_list["choice"])
|
|
|
|
|
cartridge.mode = mode
|
|
|
|
|
cartridge.unlock()
|
|
|
|
|
if(cartridge)
|
|
|
|
|
cartridge.mode = mode
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else//If not in range or not using the pda.
|
|
|
|
|
U.unset_machine()
|
|
|
|
|
U << browse(null, "window=pda")
|
|
|
|
|
ui.close()
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
//EXTRA FUNCTIONS===================================
|
|
|
|
|
|
|
|
|
|
if (mode == 2||mode == 21)//To clear message overlays.
|
|
|
|
|
overlays.Cut()
|
|
|
|
|
newmessage = 0
|
|
|
|
|
|
|
|
|
|
if ((honkamt > 0) && (prob(60)))//For clown virus.
|
|
|
|
|
honkamt--
|
|
|
|
|
playsound(loc, '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
|
|
|
|
|
src.updateUsrDialog()
|
|
|
|
|
return 1 // return 1 tells it to refresh the UI in NanoUI
|
|
|
|
|
|
|
|
|
|
/obj/item/device/pda/proc/remove_id()
|
|
|
|
|
if (id)
|
|
|
|
@@ -792,7 +810,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
|
|
|
|
|
if(!can_use())
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
last_text = world.time
|
|
|
|
|
// check if telecomms I/O route 1459 is stable
|
|
|
|
|
//var/telecomms_intact = telecomms_process(P.owner, owner, t)
|
|
|
|
@@ -822,23 +840,24 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
U << "ERROR: Cannot reach recepient."
|
|
|
|
|
return
|
|
|
|
|
useMS.send_pda_message("[P.owner]","[owner]","[t]")
|
|
|
|
|
|
|
|
|
|
tnote += "<i><b>→ To [P.owner]:</b></i><br>[t]<br>"
|
|
|
|
|
P.tnote += "<i><b>← From <a href='byond://?src=\ref[P];choice=Message;target=\ref[src]'>[owner]</a> ([ownjob]):</b></i><br>[t]<br>"
|
|
|
|
|
for(var/mob/M in player_list)
|
|
|
|
|
if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTEARS)) // src.client is so that ghosts don't have to listen to mice
|
|
|
|
|
M.show_message("<span class='game say'>PDA Message - <span class='name'>[owner]</span> -> <span class='name'>[P.owner]</span>: <span class='message'>[t]</span></span>")
|
|
|
|
|
tnote.Add(list(list("sent" = 1, "owner" = "[P.owner]", "job" = "[P.ownjob]", "message" = "[t]", "target" = "\ref[P]")))
|
|
|
|
|
P.tnote.Add(list(list("sent" = 0, "owner" = "[owner]", "job" = "[ownjob]", "message" = "[t]", "target" = "\ref[src]")))
|
|
|
|
|
if(!conversations.Find("\ref[P]"))
|
|
|
|
|
conversations.Add("\ref[P]")
|
|
|
|
|
if(!P.conversations.Find("\ref[src]"))
|
|
|
|
|
P.conversations.Add("\ref[src]")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (prob(15)) //Give the AI a chance of intercepting the message
|
|
|
|
|
var/who = src.owner
|
|
|
|
|
if(prob(50))
|
|
|
|
|
who = P:owner
|
|
|
|
|
who = P.owner
|
|
|
|
|
for(var/mob/living/silicon/ai/ai in mob_list)
|
|
|
|
|
// Allows other AIs to intercept the message but the AI won't intercept their own message.
|
|
|
|
|
if(ai.aiPDA != P && ai.aiPDA != src)
|
|
|
|
|
ai.show_message("<i>Intercepted message from <b>[who]</b>: [t]</i>")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!P.silent)
|
|
|
|
|
playsound(P.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
|
|
|
|
for (var/mob/O in hearers(3, P.loc))
|
|
|
|
@@ -851,12 +870,14 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
else
|
|
|
|
|
L = get(P, /mob/living/silicon)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(L)
|
|
|
|
|
L << "\icon[P] <b>Message from [src.owner] ([ownjob]), </b>\"[t]\" (<a href='byond://?src=\ref[P];choice=Message;skiprefresh=1;target=\ref[src]'>Reply</a>)"
|
|
|
|
|
|
|
|
|
|
log_pda("[usr] (PDA: [src.name]) sent \"[t]\" to [P.name]")
|
|
|
|
|
P.overlays.Cut()
|
|
|
|
|
P.overlays += image('icons/obj/pda.dmi', "pda-r")
|
|
|
|
|
P.newmessage = 1
|
|
|
|
|
else
|
|
|
|
|
U << "<span class='notice'>ERROR: Messaging server is not responding.</span>"
|
|
|
|
|
|
|
|
|
@@ -926,12 +947,15 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
/obj/item/device/pda/attackby(obj/item/C as obj, mob/user as mob)
|
|
|
|
|
..()
|
|
|
|
|
if(istype(C, /obj/item/weapon/cartridge) && !cartridge)
|
|
|
|
|
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
|
|
|
|
cartridge = C
|
|
|
|
|
user.drop_item()
|
|
|
|
|
cartridge.loc = src
|
|
|
|
|
user << "<span class='notice'>You insert [cartridge] into [src].</span>"
|
|
|
|
|
if(cartridge.radio)
|
|
|
|
|
cartridge.radio.hostpda = src
|
|
|
|
|
if(ui)
|
|
|
|
|
ui.close()
|
|
|
|
|
|
|
|
|
|
else if(istype(C, /obj/item/weapon/card/id))
|
|
|
|
|
var/obj/item/weapon/card/id/idcard = C
|
|
|
|
@@ -1045,9 +1069,6 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
|
|
|
|
|
if(5)
|
|
|
|
|
if((istype(A, /obj/item/weapon/tank)) || (istype(A, /obj/machinery/portable_atmospherics)))
|
|
|
|
|
if(istype(A, /obj/item/weapon/tank))
|
|
|
|
|
var/obj/item/weapon/tank/t = A
|
|
|
|
|
t.manipulated_by = user.real_name
|
|
|
|
|
var/obj/icon = A
|
|
|
|
|
for (var/mob/O in viewers(user, null))
|
|
|
|
|
O << "\red [user] has used [src] on \icon[icon] [A]"
|
|
|
|
@@ -1138,8 +1159,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
if ((istype(M, /mob/living/carbon/human) && (M.real_name != src.owner) && (istype(src.cartridge, /obj/item/weapon/cartridge/clown))))
|
|
|
|
|
if (src.cartridge:honk_charges < 5)
|
|
|
|
|
src.cartridge:honk_charges++
|
|
|
|
|
if (src.cartridge.charges < 5)
|
|
|
|
|
src.cartridge.charges++
|
|
|
|
|
|
|
|
|
|
M.stop_pulling()
|
|
|
|
|
M << "\blue You slipped on the PDA!"
|
|
|
|
|