Files
Paradise/code/game/objects/devices/aicard.dm
T
morikou@gmail.com d25ee28cc4 Blood: The Last Annoying, Sparkly Twit Update:
- When a blood sample is taken, it retains some information on what kind of chemicals were the subject's body at the time the sample was taken.
- Two new R&D Items: Mass-Spectrometer (EM Spectrum Research 2, Biotech 2) and Advanced Mass-Spectrometer (EM Spectrum Research 4, Biotech 2). Allows for the identification of chemicals in a blood sample. To use the devices, you simply use a container (or syringe) full of blood on the device and then click the device in your hand (like how you use the gas analyzer). At low reliability, they might miss some chemicals in their report or potentially even break. The Advanced version not only lists what chemicals were present in the body, but also much much.
- The deconstructive analyzer now gives 1 or 2 points to a device design's reliability (rather then just 1) when analyzing a device. Also fixed some bugs in the deconstructive analyzer.
- Not all devices have a 100% reliability now (most current ones did, but not all).
- Few tweaks in R&D lab. Derp derp.
- Mint tweaked slightly. Miners can now access the mint foyer and the mint materials loading area but not the vault (only the captain can access the vault, by default).
- Research sub-paths Robotics and generators removed. Now all techs just use the primary paths. Sub-paths might be re-added later but not these ones.
- Power Storage Technology renamed "Power Manipulation Technology".
- More stuff can be analyzed in the destructive analyzer. Intellicards can now be produced from the protolathe (Programming 4. Requires 1000 glass and 200 gold)
- Updated the R&D readme file. Now it has a list of all the holes in the tech paths (ie. Where we need to add new stuff). It's not intended as a complete list of everything that can be made or researched, just a check list to make sure all the research levels are covered.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1073 316c924e-a436-60f5-8080-3fe189b3f50e
2011-02-19 20:18:18 +00:00

182 lines
5.5 KiB
Plaintext

/obj/item/device/aicard
name = "inteliCard"
icon = 'pda.dmi'
icon_state = "aicard" // aicard-full
item_state = "electronic"
w_class = 2.0
flags = FPRINT | TABLEPASS | ONBELT
var/flush = null
origin_tech = "programming=4"
attack(mob/living/silicon/ai/M as mob, mob/user as mob)
if (src.flush)
user << "<b>Transfer failed</b>: Cannot transfer while wipe in progress."
return
if(!istype(M, /mob/living/silicon/ai))
return ..()
if(src.contents.len > 0)
for(var/mob/living/silicon/ai/A in src)
// Already have an AI
if(M.real_name != "Inactive AI")
user << "<b>Transfer failed</b>: Existing AI found on this terminal. Remove existing AI to install a new one."
return
else
M.name = A.name
M.real_name = A.real_name
if(A.mind)
A.mind.transfer_to(M)
A.mind.original = M
M.control_disabled = 0
M.laws_object = A.laws_object
M.oxyloss = A.oxyloss
M.fireloss = A.fireloss
M.bruteloss = A.bruteloss
M.toxloss = A.toxloss
if (!A.stat)
M.stat = A.stat
M.updatehealth()
M << "You have been uploaded to a stationary terminal. Remote device connection restored."
user << "<b>Transfer succesful</b>: [M.name] ([rand(1000,9999)].exe) installed and executed succesfully. Local copy has been removed."
del(A)
if (!M.stat)
M.icon_state = "ai"
else
M.icon_state = "ai-crash"
src.icon_state = "aicard"
src.name = "inteliCard"
src.overlays = null
return
else
if (M.real_name != "Inactive AI")
if (ticker.mode.name == "AI malfunction")
var/datum/game_mode/malfunction/malf = ticker.mode
for (var/datum/mind/malfai in malf.malf_ai)
if (M.mind == malfai)
user << "This AI's download interface has been disabled."
return
var/mob/living/silicon/ai/O = new /mob/living/silicon/ai( src )
O.invisibility = 0
O.canmove = 0
O.name = M.name
O.real_name = M.real_name
O.anchored = 1
O.aiRestorePowerRoutine = 0
O.control_disabled = 1 // Can't control things remotely if you're stuck in a card!
O.laws_object = M.laws_object
O.stat = M.stat
O.oxyloss = M.oxyloss
O.fireloss = M.fireloss
O.bruteloss = M.bruteloss
O.toxloss = M.toxloss
O.updatehealth()
if(M.mind)
M.mind.transfer_to(O)
M.mind.original = O
src.name = "inteliCard - [M.name]"
M.name = "Inactive AI"
M.real_name = "Inactive AI"
M.icon_state = "ai-empty"
if (O.stat == 2)
src.icon_state = "aicard-404"
else
src.icon_state = "aicard-full"
O << "You have been downloaded to a mobile storage device. Remote device connection severed."
user << "<b>Transfer succeeded</b>: [O.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
else
user << "There isn't an AI on this terminal."
attack(mob/living/silicon/decoy/M as mob, mob/user as mob)
if (!istype (M, /mob/living/silicon/decoy))
return ..()
else
M.death()
user << "<b>ERROR ERROR ERROR</b>"
Topic(href, href_list)
if (href_list["close"])
usr << browse(null, "window=aicard")
usr.machine = null
if (href_list["wipe"])
var/confirm = alert("Are you sure you want to wipe this card's memory? This cannot be undone once started.", "Confirm Wipe", "Yes", "No")
if(confirm == "Yes")
src.flush = 1
for(var/mob/living/silicon/ai/A in src)
A.suiciding = 1
A << "Your core files are being wiped!"
while (A.stat != 2)
A.oxyloss += 2
A.updatehealth()
src.attack_self(usr)
sleep(10)
src.flush = 0
if (href_list["wireless"])
for(var/mob/living/silicon/ai/A in src)
A.control_disabled = !A.control_disabled
A << "The intelicard's wireless port has been [A.control_disabled ? "disabled" : "enabled"]!"
if (A.control_disabled)
src.overlays -= image('pda.dmi', "aicard-on")
else
src.overlays += image('pda.dmi', "aicard-on")
src.attack_self(usr)
attack_self(mob/user)
if (!in_range(src, user))
return
user.machine = src
var/dat = "<TT><B>Intelicard</B><BR>"
var/laws
for(var/mob/living/silicon/ai/A in src)
dat += "Stored AI: [A.name]<br>System integrity: [(A.health+100)/2]%<br>"
for (var/index = 1, index <= A.laws_object.ion.len, index++)
var/law = A.laws_object.ion[index]
if (length(law) > 0)
var/num = ionnum()
laws += "[num]. [law]"
if (A.laws_object.zeroth)
laws += "0: [A.laws_object.zeroth]<BR>"
var/number = 1
for (var/index = 1, index <= A.laws_object.inherent.len, index++)
var/law = A.laws_object.inherent[index]
if (length(law) > 0)
laws += "[number]: [law]<BR>"
number++
for (var/index = 1, index <= A.laws_object.supplied.len, index++)
var/law = A.laws_object.supplied[index]
if (length(law) > 0)
laws += "[number]: [law]<BR>"
number++
dat += "Laws:<br>[laws]<br>"
if (A.stat == 2)
dat += "<b>AI nonfunctional</b>"
else
if (!src.flush)
dat += {"<A href='byond://?src=\ref[src];wipe=1'>Wipe AI</A>"}
else
dat += "<b>Wipe in progress</b>"
dat += {" <A href='byond://?src=\ref[src];wireless=1'>[A.control_disabled ? "Enable" : "Disable"] Wireless Activity</A>"}
dat += {"<a href='byond://?src=\ref[src];close=1'> Close</a>"}
user << browse(dat, "window=aicard")
onclose(user, "aicard")
return