/obj/item/device/paicard name = "personal AI device" icon = 'pda.dmi' icon_state = "pai" item_state = "electronic" w_class = 2.0 flags = FPRINT | TABLEPASS | ONBELT origin_tech = "programming=2" var/obj/item/device/radio/radio var/looking_for_personality = 0 var/mob/living/silicon/pai/pai attack_self(mob/user) if (!in_range(src, user)) return user.machine = src var/dat = "Personal AI Device
" if(pai && (!pai.master_dna || !pai.master)) dat += "Imprint Master DNA
" if(pai) dat += "Installed Personality: [pai.name]
" dat += "Prime directive:
[pai.pai_law0]
" dat += "Additional directives:
[pai.pai_laws]
" dat += "Configure Directives
" dat += "
" dat += "

Device Settings


" if(radio) dat += "Radio Uplink
" dat += "Transmit: [(radio.wires & 4) ? "Enabled" : "Disabled"]
" dat += "Receive: [(radio.wires & 2) ? "Enabled" : "Disabled"]
" dat += "Signal Pulser: [(radio.wires & 1) ? "Enabled" : "Disabled"]
" else dat += "Radio Uplink
" dat += "Radio firmware not loaded. Please install a pAI personality to load firmware.
" dat += "\[Wipe current pAI personality\]
" else if(looking_for_personality) dat += "Searching for a personality..." dat += "\[View available personalities\]
" else dat += "No personality is installed.
" dat += "\[Request personal AI personality\]
" dat += "Each time this button is pressed, a request will be sent out to any available personalities. Check back often and alot time for personalities to respond. This process could take anywhere from 15 seconds to several minutes, depending on the available personalities' timeliness." user << browse(dat, "window=paicard") onclose(user, "paicard") return Topic(href, href_list) if(href_list["setdna"]) if(pai.master_dna) return var/mob/M = usr if(!istype(M, /mob/living/carbon)) usr << "You don't have any DNA, or your DNA is incompatible with this device." else var/datum/dna/dna = usr.dna pai.master = M.real_name pai.master_dna = dna.unique_enzymes pai << "

You have been bound to a new master.

" if(href_list["request"]) src.looking_for_personality = 1 paiController.findPAI(src, usr) if(href_list["wipe"]) var/confirm = input("Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe") in list("Yes", "No") if(confirm == "Yes") for(var/mob/M in src) M << "

You feel yourself slipping away from reality.

" M << "

Byte by byte you lose your sense of self.

" M << "

Your mental faculties leave you.

" M << "
oblivion...
" M.death(0) src.pai = null if(href_list["wires"]) var/t1 = text2num(href_list["wires"]) if (radio.wires & t1) radio.wires &= ~t1 if(href_list["setlaws"]) var/newlaws = input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message if(newlaws) pai.pai_laws = newlaws pai << "Your supplemental directives have been updated. Your new directives are:" pai << "Prime Directive :
[pai.pai_law0]" pai << "Supplemental Directives:
[pai.pai_laws]" attack_self(usr) // WIRE_SIGNAL = 1 // WIRE_RECEIVE = 2 // WIRE_TRANSMIT = 4 proc/alertUpdate() var/turf/T = get_turf_or_move(src.loc) for (var/mob/M in viewers(T)) M.show_message("\blue [src] flashes a message across its screen, \"Additional personalities available for download.\"", 3, "\blue [src] bleeps electronically.", 2) emp_act(severity) for(var/mob/M in src) M.emp_act(severity) ..()