pAIs added. Two on station (Crew Quarters, R&D Director's Office) and one on the Derelict.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1634 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
only.lurking@gmail.com
2011-05-30 19:33:28 +00:00
parent 1754eaedb0
commit edfe89e94d
24 changed files with 3085 additions and 1445 deletions
+27 -3
View File
@@ -36,6 +36,8 @@
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
var/obj/item/device/paicard/pai = null // A slot for a personal AI device
/obj/item/device/pda/medical
default_cartridge = /obj/item/weapon/cartridge/medical
icon_state = "pda-m"
@@ -198,6 +200,12 @@
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)
@@ -345,6 +353,7 @@
if("4")//Redirects to hub
mode = 0
//MAIN FUNCTIONS===================================
if("Light")
@@ -474,6 +483,7 @@
U << browse(null, "window=pda")
return
//SYNDICATE FUNCTIONS===================================
if("Door")
@@ -524,6 +534,15 @@
U << browse(null, "window=pda")
return
//pAI FUNCTIONS===================================
if("pai")
if(href_list["option"] == "1") // Configure pAI device
pai.attack_self(U)
if(href_list["option"] == "2") // Eject pAI device
var/turf/T = get_turf_or_move(src.loc)
if(T)
pai.loc = T
//LINK FUNCTIONS===================================
else//Cartridge menu linking
@@ -588,7 +607,7 @@
return
// access to status display signals
/obj/item/device/pda/attackby(obj/item/weapon/C as obj, mob/user as mob)
/obj/item/device/pda/attackby(obj/item/C as obj, mob/user as mob)
..()
if (istype(C, /obj/item/weapon/cartridge) && isnull(src.cartridge))
user.drop_item()
@@ -623,8 +642,13 @@
user << "\blue Rank updated."
updateSelfDialog()//Update self dialog on success.
return//Return in case of failed check or when successful.
updateSelfDialog()//For the non-input related code.
updateSelfDialog()//For the non-input related code.
else if (istype(C, /obj/item/device/paicard) && !src.pai)
user.drop_item()
C.loc = src
pai = C
user << "\blue You slot \the [C] into [src]."
updateUsrDialog()
return
/obj/item/device/pda/attack(mob/C as mob, mob/user as mob)
+97
View File
@@ -0,0 +1,97 @@
/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 = "<TT><B>Personal AI Device</B><BR>"
if(pai && (!pai.master_dna || !pai.master))
dat += "<a href='byond://?src=\ref[src];setdna=1'>Imprint Master DNA</a><br>"
if(pai)
dat += "Installed Personality: [pai.name]<br>"
dat += "Prime directive: <br>[pai.pai_law0]<br>"
dat += "Additional directives: <br>[pai.pai_laws]<br>"
dat += "<a href='byond://?src=\ref[src];setlaws=1'>Configure Directives</a><br>"
dat += "<br>"
dat += "<h3>Device Settings</h3><br>"
if(radio)
dat += "<b>Radio Uplink</b><br>"
dat += "Transmit: <A href='byond://?src=\ref[src];wires=4'>[(radio.wires & 4) ? "Enabled" : "Disabled"]</A><br>"
dat += "Receive: <A href='byond://?src=\ref[src];wires=2'>[(radio.wires & 2) ? "Enabled" : "Disabled"]</A><br>"
dat += "Signal Pulser: <A href='byond://?src=\ref[src];wires=1'>[(radio.wires & 1) ? "Enabled" : "Disabled"]</A><br>"
else
dat += "<b>Radio Uplink</b><br>"
dat += "<font color=red><i>Radio firmware not loaded. Please install a pAI personality to load firmware.</i></font><br>"
dat += "<A href='byond://?src=\ref[src];wipe=1'>\[Wipe current pAI personality\]</a><br>"
else
if(looking_for_personality)
dat += "Searching for a personality..."
dat += "<A href='byond://?src=\ref[src];request=1'>\[View available personalities\]</a><br>"
else
dat += "No personality is installed.<br>"
dat += "<A href='byond://?src=\ref[src];request=1'>\[Request personal AI personality\]</a><br>"
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 << "<font color=blue>You don't have any DNA, or your DNA is incompatible with this device.</font>"
else
var/datum/dna/dna = usr.dna
pai.master = M.real_name
pai.master_dna = dna.unique_enzymes
pai << "<font color = red><h3>You have been bound to a new master.</h3></font>"
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 << "<font color = #ff0000><h2>You feel yourself slipping away from reality.</h2></font>"
M << "<font color = #ff4d4d><h3>Byte by byte you lose your sense of self.</h3></font>"
M << "<font color = #ff8787><h4>Your mental faculties leave you.</h4></font>"
M << "<font color = #ffc4c4><h5>oblivion... </h5></font>"
M.death(0)
del(M)
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 : <br>[pai.pai_law0]"
pai << "Supplemental Directives: <br>[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)
@@ -0,0 +1,11 @@
/obj/item/weapon/pai_cable/proc/plugin(obj/machinery/M as obj, mob/user as mob)
if(istype(M, /obj/machinery/door) || istype(M, /obj/machinery/camera))
user.visible_message("[user] inserts [src] into a data port on [M].", "You insert [src] into a data port on [M].", "You hear the satisfying click of a wire jack fastening into place.")
user.drop_item()
src.loc = M
src.machine = M
else
user.visible_message("[user] dumbly fumbles to find a place on [M] to plug in [src].", "There aren't any ports on [M] that match the jack belonging to [src].")
/obj/item/weapon/pai_cable/attack(obj/machinery/M as obj, mob/user as mob)
src.plugin(M, user)
+20 -15
View File
@@ -32,15 +32,16 @@
/obj/item/device/radio/proc/interact(mob/user as mob)
var/dat = {"
<html><head><title>[src]</title></head><body><TT>
Microphone: [broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>
Speaker: [listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>
Frequency:
<A href='byond://?src=\ref[src];freq=-10'>-</A>
<A href='byond://?src=\ref[src];freq=-2'>-</A>
[format_frequency(frequency)]
<A href='byond://?src=\ref[src];freq=2'>+</A>
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>"}
<html><head><title>[src]</title></head><body><TT>
Microphone: [broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>
Speaker: [listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>
Frequency:
<A href='byond://?src=\ref[src];freq=-10'>-</A>
<A href='byond://?src=\ref[src];freq=-2'>-</A>
[format_frequency(frequency)]
<A href='byond://?src=\ref[src];freq=2'>+</A>
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>
"}
for (var/ch_name in channels)
dat+=text_sec_channel(ch_name, channels[ch_name])
@@ -53,10 +54,11 @@ Frequency:
if (!b_stat)
return ""
return {"
<hr>
Green Wire: <A href='byond://?src=\ref[src];wires=4'>[(wires & 4) ? "Cut" : "Mend"] Wire</A><BR>
Red Wire: <A href='byond://?src=\ref[src];wires=2'>[(wires & 2) ? "Cut" : "Mend"] Wire</A><BR>
Blue Wire: <A href='byond://?src=\ref[src];wires=1'>[(wires & 1) ? "Cut" : "Mend"] Wire</A><BR>"}
<hr>
Green Wire: <A href='byond://?src=\ref[src];wires=4'>[(wires & 4) ? "Cut" : "Mend"] Wire</A><BR>
Red Wire: <A href='byond://?src=\ref[src];wires=2'>[(wires & 2) ? "Cut" : "Mend"] Wire</A><BR>
Blue Wire: <A href='byond://?src=\ref[src];wires=1'>[(wires & 1) ? "Cut" : "Mend"] Wire</A><BR>
"}
/obj/item/device/radio/proc/text_sec_channel(var/chan_name, var/chan_stat)
@@ -66,8 +68,9 @@ Blue Wire: <A href='byond://?src=\ref[src];wires=1'>[(wires & 1) ? "Cut" : "Men
Microphone:"<A href='byond://?src=\ref[src];ch_name=[chan_name];talk=[!broad]'> [broad ? "Engaged" : "Disengaged"]</A>"
*/
return {"
<B>[chan_name]</B><br>
Speaker: <A href='byond://?src=\ref[src];ch_name=[chan_name];listen=[!list]'>[list ? "Engaged" : "Disengaged"]</A><BR>"}
<B>[chan_name]</B><br>
Speaker: <A href='byond://?src=\ref[src];ch_name=[chan_name];listen=[!list]'>[list ? "Engaged" : "Disengaged"]</A><BR>
"}
/obj/item/device/radio/Topic(href, href_list)
//..()
@@ -175,6 +178,8 @@ Speaker: <A href='byond://?src=\ref[src];ch_name=[chan_name];listen=[!list]'>[li
eqjobname = "AI"
else if (isrobot(M))
eqjobname = "Cyborg"//Androids don't really describe these too well, in my opinion.
else if (istype(M, /mob/living/silicon/pai))
eqjobname = "Personal AI"
else
eqjobname = "Unknown"