mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Added a transfer_ai() proc to easily transfer AIs between objects, provided the mobile object has a flush variable.
Probably fixed AI-ninja suit transfer. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1559 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -371,11 +371,12 @@
|
||||
item_state = "s-ninja_suit"
|
||||
allowed = list(/obj/item/weapon/gun,/obj/item/weapon/ammo,/obj/item/weapon/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank/emergency_oxygen)
|
||||
radiation_protection = 0.75
|
||||
var/affecting = null
|
||||
var/mob/living/carbon/affecting = null
|
||||
var/active = 0//Stealth off.
|
||||
var/kamikaze = 0//Kamikaze on or off.
|
||||
var/obj/item/weapon/cell/cell//Starts out with a high-capacity cell using new proc.
|
||||
var/obj/item/device/aicard/aicard//For the build in AI card.
|
||||
var/mob/living/silicon/AI = null//If there is an AI inside the suit. Paths to target.
|
||||
var/flush = 0//If an AI purge is in progress.
|
||||
var/control = 1//If in control of the suit.
|
||||
var/initialize = 0//Suit starts off.
|
||||
var/spideros = 0//Mode of SpiderOS. This can change so I won't bother listing the modes here (0 is hub). Check ninja_equipment.dm for how it all works.
|
||||
|
||||
@@ -24,57 +24,25 @@ ________________________________________________________________________________
|
||||
reagents.add_reagent("radium", 120)//AI can inject radium directly. There should be at least 60 units left over after adrenaline boosting.
|
||||
reagents.add_reagent("nutriment", 80)
|
||||
cell = new/obj/item/weapon/cell/high//The suit should *always* have a battery because so many things rely on it.
|
||||
aicard = new/obj/item/device/aicard
|
||||
cell.charge = 9000
|
||||
|
||||
/obj/item/clothing/suit/space/space_ninja/Del()
|
||||
if(aicard.contents.len)//If there are AIs present when the ninja kicks the bucket.
|
||||
killai(aicard)
|
||||
if(AI)//If there are AIs present when the ninja kicks the bucket.
|
||||
killai(AI)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/clothing/suit/space/space_ninja/proc/killai(var/obj/item/device/aicard/A as obj)
|
||||
for(var/mob/living/silicon/ai/AI in A)//In case intelicards are changes to house more than one AI.
|
||||
AI << "\red Self-destruct protocol dete-- *bzzzzz*"
|
||||
AI.death()//Kill
|
||||
AI.ghostize()//Turn into ghost
|
||||
del(AI)
|
||||
/obj/item/clothing/suit/space/space_ninja/proc/killai(var/mob/living/silicon/ai/A as mob)
|
||||
A << "\red Self-destruct protocol dete-- *bzzzzz*"
|
||||
A.death()//Kill
|
||||
A.ghostize()//Turn into ghost
|
||||
del(AI)
|
||||
return
|
||||
|
||||
/obj/item/clothing/suit/space/space_ninja/attackby(var/obj/item/device/aicard/aicard_temp as obj, U as mob)//When the suit is attacked by an AI card.
|
||||
if(istype(aicard_temp, /obj/item/device/aicard))//If it's actually an AI card.
|
||||
if(control)
|
||||
if(initialize&&U==affecting)//If the suit is initialized and the actor is the user.
|
||||
|
||||
var/mob/living/silicon/ai/A_T = locate() in aicard_temp//Determine if there is an AI on target card. Saves time when checking later.
|
||||
var/mob/living/silicon/ai/A = locate() in aicard//Deterine if there is an AI on the installed card.
|
||||
|
||||
if(A)//If the installed AI card is not empty.
|
||||
if(A_T)//If there is an AI on the target card.
|
||||
U << "\red <b>ERROR</b>: \black [A_T.name] already installed. Remove [A_T.name] to install a new one."
|
||||
else
|
||||
if(aicard.flush)//If the installed card is purging.
|
||||
U << "\red <b>ERROR</b>: \black [A.name] is purging. Please wait until the process is finished."
|
||||
else
|
||||
A.loc = aicard_temp//Throw them into the target card. Since they are already on a card, transfer is easy.
|
||||
aicard_temp.name = "inteliCard - [A.name]"
|
||||
aicard_temp.icon_state = "aicard-full"
|
||||
A << "You have been uploaded to a mobile storage device."
|
||||
U << "\blue <b>SUCCESS</b>: \black [A.name] ([rand(1000,9999)].exe) removed from host and stored within local memory."
|
||||
|
||||
else//If the installed AI card is empty.
|
||||
if(A_T&&A_T.stat!=2)//If there is an AI on the target card and it's not DED.
|
||||
if(aicard_temp.flush)//If the target card is purging.
|
||||
U << "\red <b>ERROR</b>: \black [A_T.name] is wiping. You cannot install this AI until it is repaired."
|
||||
else
|
||||
A_T.loc = aicard//Throw them into the installed card.
|
||||
aicard_temp.icon_state = "aicard"
|
||||
aicard_temp.name = "inteliCard"
|
||||
aicard_temp.overlays = null
|
||||
A_T << "You have been uploaded to a mobile storage device."
|
||||
U << "\blue <b>SUCCESS</b>: \black [A_T.name] ([rand(1000,9999)].exe) removed from local memory and installed to host."
|
||||
else if(A_T.stat==2)//If the target AI is dead. Else just got to return since nothing would happen if both are empty.
|
||||
U << "\red <b>ERROR</b>: \black [A_T.name] is inactive. Unable to install."
|
||||
aicard_temp.transfer_ai("NINJASUIT","AICARD",src,U)
|
||||
else
|
||||
U << "\red <b>ERROR</b>: \black Remote access channel disabled."
|
||||
return
|
||||
@@ -262,8 +230,8 @@ ________________________________________________________________________________
|
||||
U << "\red #2#"
|
||||
spawn(30)
|
||||
U << "\red #1#: <B>G00DBYE</B>"
|
||||
if(aicard.contents.len)
|
||||
killai(aicard)
|
||||
if(AI)
|
||||
killai(AI)
|
||||
U.gib()
|
||||
return
|
||||
U << "\blue Disconnecting neural-net interface...\green<B>Success</B>\blue."
|
||||
@@ -326,7 +294,7 @@ ________________________________________________________________________________
|
||||
dat += "<h4><img src=sos_1.png> Available Functions:</h4>"
|
||||
dat += "<ul>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=Stealth'><img src=sos_4.png> Toggle Stealth: [active == 1 ? "Disable" : "Enable"]</a></li>"
|
||||
if(aicard.contents.len)
|
||||
if(AI)
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=5'><img src=sos_13.png> AI Status</a></li>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=1'><img src=sos_3.png> Medical Screen</a></li>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=2'><img src=sos_5.png> Atmos Scan</a></li>"
|
||||
@@ -446,7 +414,8 @@ ________________________________________________________________________________
|
||||
if(5)
|
||||
var/laws
|
||||
dat += "<h4><img src=sos_13.png> AI Control:</h4>"
|
||||
for(var/mob/living/silicon/ai/A in aicard)
|
||||
var/mob/living/silicon/ai/A = AI
|
||||
if(AI)//If an AI exists, in case it gets purged.
|
||||
dat += "Stored AI: <b>[A.name]</b><br>"
|
||||
dat += "System integrity: [(A.health+100)/2]%<br>"
|
||||
|
||||
@@ -478,18 +447,18 @@ ________________________________________________________________________________
|
||||
if (A.stat == 2)//If AI dies while inside the card.
|
||||
if(A.client)//If they are still in their body.
|
||||
A.ghostize()//Throw them into a ghost.
|
||||
AI = null
|
||||
del(A)//Delete A.
|
||||
aicard.overlays = null
|
||||
else
|
||||
del(A)
|
||||
U << "Artificial Intelligence has self-terminated. Rebooting..."
|
||||
spideros()//Refresh.
|
||||
else
|
||||
if (!aicard.flush)
|
||||
dat += {"<A href='byond://?src=\ref[src];choice=Purge AI'>Purge AI</A><br>"}
|
||||
if (!flush)
|
||||
dat += {"<A href='byond://?src=\ref[src];choice=Purge AI;target=\ref[A]'>Purge AI</A><br>"}
|
||||
else
|
||||
dat += "<b>Purge in progress...</b><br>"
|
||||
dat += {" <A href='byond://?src=\ref[src];choice=Wireless AI'>[A.control_disabled ? "Enable" : "Disable"] Wireless Activity</A>"}
|
||||
dat += {" <A href='byond://?src=\ref[src];choice=Wireless AI;target=\ref[A]'>[A.control_disabled ? "Enable" : "Disable"] Wireless Activity</A>"}
|
||||
dat += "</body></html>"
|
||||
|
||||
U << browse(dat,"window=spideros;size=400x444;border=1;can_resize=0;can_close=0;can_minimize=0")
|
||||
@@ -688,15 +657,15 @@ ________________________________________________________________________________
|
||||
A.show_laws()
|
||||
U << "\blue Law Override: <b>SUCCESS</b>."
|
||||
if("Purge AI")
|
||||
var/confirm = alert("Are you sure you want to purge the AI? This cannot be undone once started.", "Confirm Purge", "Yes", "No")
|
||||
var/mob/living/silicon/ai/AI = locate() in aicard//Important to place here in case the AI does not exist anymore.
|
||||
var/mob/living/silicon/ai/A = locate(href_list["target"])
|
||||
var/confirm = alert("Are you sure you want to purge the AI? This cannot be undone once started.", "Confirm purge", "Yes", "No")
|
||||
if(U.stat||U.wear_suit!=src||!initialize||!AI)
|
||||
U << browse(null, "window=spideros")
|
||||
return
|
||||
if(confirm == "Yes")
|
||||
if(AI.laws_object.zeroth)
|
||||
AI << "\red <b>WARNING</b>: \black Purge procedure detected. \n Now hacking terminal..."
|
||||
AI.control_disabled = 0
|
||||
if(A.laws_object.zeroth)
|
||||
A << "\red <b>WARNING</b>: \black purge procedure detected. \n Now hacking host..."
|
||||
A.control_disabled = 0
|
||||
U << "\red <b>WARNING</b>: HACKING ATT--TEMPT IN PR0GRESsS!"
|
||||
spideros = 0
|
||||
unlock = 0
|
||||
@@ -704,23 +673,23 @@ ________________________________________________________________________________
|
||||
control = 0
|
||||
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/deinit
|
||||
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/spideros
|
||||
A.verbs += /mob/living/silicon/ai/proc/ninja_spideros
|
||||
A.verbs += /mob/living/silicon/ai/proc/ninja_return_control
|
||||
U << browse(null, "window=spideros")
|
||||
return
|
||||
else
|
||||
aicard.flush = 1
|
||||
AI.suiciding = 1
|
||||
AI << "Your core files are being purged! This is the end..."
|
||||
while (AI.stat != 2)
|
||||
AI.oxyloss += 2
|
||||
AI.updatehealth()
|
||||
flush = 1
|
||||
A.suiciding = 1
|
||||
A << "Your core files are being purged! This is the end..."
|
||||
while (A.stat != 2)
|
||||
A.oxyloss += 2
|
||||
A.updatehealth()
|
||||
sleep(10)
|
||||
killai(AI)
|
||||
aicard.overlays = null
|
||||
aicard.flush = 0
|
||||
killai(A)
|
||||
if("Wireless AI")
|
||||
for(var/mob/living/silicon/ai/A in aicard)
|
||||
A.control_disabled = !A.control_disabled
|
||||
A << "AI wireless has been [A.control_disabled ? "disabled" : "enabled"]."
|
||||
var/mob/living/silicon/ai/A = locate(href_list["target"])
|
||||
A.control_disabled = !A.control_disabled
|
||||
A << "AI wireless has been [A.control_disabled ? "disabled" : "enabled"]."
|
||||
|
||||
spideros()//Refreshes the screen by calling it again (which replaces current screen with new screen).
|
||||
else//If they are not in control.
|
||||
|
||||
@@ -100,7 +100,7 @@ mob/proc/create_ninja()
|
||||
set desc = "Hack directly into the Black Widow(tm) neuro-interface."
|
||||
set category = "AI Commands"
|
||||
|
||||
loc.loc:hack_spideros()//aicard.ninjasuit:hack_spideros()
|
||||
loc.loc:hack_spideros()//ninjasuit:hack_spideros()
|
||||
|
||||
/mob/living/silicon/ai/proc/ninja_return_control()
|
||||
set name = "Relinquish Control"
|
||||
@@ -108,16 +108,18 @@ mob/proc/create_ninja()
|
||||
set category = "AI Commands"
|
||||
|
||||
src << browse(null, "window=hack spideros")//Close window
|
||||
loc.loc:control = 0//Return control
|
||||
loc.loc:affecting:verbs += /obj/item/clothing/suit/space/space_ninja/proc/deinit//Add back verbs
|
||||
loc.loc:affecting:verbs += /obj/item/clothing/suit/space/space_ninja/proc/spideros
|
||||
loc.loc:affecting << "<b>UPDATE</b>: [name] has seized hacking attempt. All systems clear."
|
||||
loc:control = 0//Return control
|
||||
loc:affecting:verbs += /obj/item/clothing/suit/space/space_ninja/proc/deinit//Add back verbs
|
||||
loc:affecting:verbs += /obj/item/clothing/suit/space/space_ninja/proc/spideros
|
||||
verbs -= /mob/living/silicon/ai/proc/ninja_spideros
|
||||
verbs -= /mob/living/silicon/ai/proc/ninja_return_control
|
||||
loc:affecting << "<b>UPDATE</b>: [real_name] has seized hacking attempt. All systems clear."
|
||||
|
||||
/obj/item/clothing/suit/space/space_ninja/proc/hack_spideros()
|
||||
|
||||
if(!affecting||!AI) return//Just in case... something went wrong. Very wrong.
|
||||
var/mob/living/carbon/human/U = affecting
|
||||
var/mob/living/silicon/ai/AI = locate() in aicard
|
||||
if(!affecting||!AI) return//Just in case... something went wrong.
|
||||
var/mob/living/silicon/ai/A = AI
|
||||
|
||||
var/dat = "<html><head><title>SpiderOS</title></head><body bgcolor=\"#3D5B43\" text=\"#DB2929\"><style>a, a:link, a:visited, a:active, a:hover { color: #DB2929; }img {border-style:none;}</style>"
|
||||
if(spideros==0)
|
||||
@@ -215,7 +217,7 @@ mob/proc/create_ninja()
|
||||
dat += "Hostile runtime intrusion detected: operation locked. The Spider Clan is watching you, <b>INTRUDER</b>."
|
||||
dat += "</body></html>"
|
||||
|
||||
AI << browse(dat,"window=hack spideros;size=400x444;border=1;can_resize=0;can_close=0;can_minimize=0")
|
||||
A << browse(dat,"window=hack spideros;size=400x444;border=1;can_resize=0;can_close=0;can_minimize=0")
|
||||
|
||||
//DEBUG===================================
|
||||
|
||||
@@ -241,13 +243,12 @@ var/ninja_debug_target//Easiest way to do this. The proc below sets this variabl
|
||||
set name = "Debug Hack Spider OS"
|
||||
set category = "Ninja Debug"
|
||||
|
||||
var/mob/living/carbon/human/H = ninja_debug_target
|
||||
var/mob/living/silicon/ai/AI = locate() in H.wear_suit:aicard
|
||||
if(AI)
|
||||
if(!AI.key)
|
||||
AI.client.mob = H
|
||||
var/mob/living/silicon/ai/A = loc:AI
|
||||
if(A)
|
||||
if(!A.key)
|
||||
A.client.mob = loc:affecting
|
||||
else
|
||||
H.client.mob = AI
|
||||
loc:affecting:client:mob = A
|
||||
return
|
||||
|
||||
//Tests the net and what it does.
|
||||
|
||||
@@ -153,27 +153,204 @@
|
||||
|
||||
attackby(var/obj/item/device/aicard/A as obj, var/mob/user as mob)
|
||||
if(istype(A, /obj/item/device/aicard))//Is it?
|
||||
if (!A.flush)//If not wiping.
|
||||
var/mob/living/silicon/ai/AI = locate() in A//I love locate(). Best proc ever.
|
||||
if(AI)//If AI exists on the card. Else nothing since both are empty.
|
||||
AI.control_disabled = 0
|
||||
AI.loc = src.loc//To replace the terminal.
|
||||
AI << "You have been uploaded to a stationary terminal. Remote device connection restored."
|
||||
user << "<b>Transfer succesful</b>: [AI.name] ([rand(1000,9999)].exe) installed and executed succesfully. Local copy has been removed."
|
||||
A.icon_state = "aicard"
|
||||
A.name = "inteliCard"
|
||||
A.overlays = null
|
||||
del(src)
|
||||
else
|
||||
user << "<b>Transfer failed</b>: Cannot transfer while wipe in progress."
|
||||
return
|
||||
A.transfer_ai("INACTIVE","AICARD",src,user)
|
||||
return
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(ishuman(user))//Checks to see if they are ninja
|
||||
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
|
||||
if(user:wear_suit:control)
|
||||
attackby(user:wear_suit:aicard,user)
|
||||
user:wear_suit:transfer_ai("INACTIVE","NINJASUIT",src,user)
|
||||
else
|
||||
user << "\red <b>ERROR</b>: \black Remote access channel disabled."
|
||||
return
|
||||
return
|
||||
|
||||
//This is a good place for AI-related object verbs so I'm sticking it here.
|
||||
|
||||
//What operation to perform based on target, what ineraction to perform based on object used, target itself, user. The object used is src and calls this proc.
|
||||
/obj/item/proc/transfer_ai(var/choice as text, var/interaction as text, var/target, var/mob/U as mob)
|
||||
if(!src:flush)
|
||||
switch(choice)
|
||||
if("AICORE")//AI mob.
|
||||
var/mob/living/silicon/ai/T = target
|
||||
switch(interaction)
|
||||
if("AICARD")
|
||||
var/obj/item/device/aicard/C = src
|
||||
if(C.contents.len)//If there is an AI on card.
|
||||
U << "\red <b>Transfer failed</b>: \black Existing AI found on this terminal. Remove existing AI to install a new one."
|
||||
else
|
||||
if (ticker.mode.name == "AI malfunction")
|
||||
var/datum/game_mode/malfunction/malf = ticker.mode
|
||||
for (var/datum/mind/malfai in malf.malf_ai)
|
||||
if (T.mind == malfai)
|
||||
U << "\red <b>ERROR</b>: \black Remote transfer interface disabled."//Do ho ho ho~
|
||||
return
|
||||
new /obj/AIcore/deactivated(T.loc)//Spawns a deactivated terminal at AI location.
|
||||
T.aiRestorePowerRoutine = 0//So the AI initially has power.
|
||||
T.control_disabled = 1//Can't control things remotely if you're stuck in a card!
|
||||
T.loc = C//Throw AI into the card.
|
||||
C.name = "inteliCard - [T.name]"
|
||||
if (T.stat == 2)
|
||||
C.icon_state = "aicard-404"
|
||||
else
|
||||
C.icon_state = "aicard-full"
|
||||
T << "You have been downloaded to a mobile storage device. Remote device connection severed."
|
||||
U << "\blue <b>Transfer successful</b>: \black [T.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
|
||||
if("NINJASUIT")
|
||||
var/obj/item/clothing/suit/space/space_ninja/C = src
|
||||
if(C.AI)//If there is an AI on card.
|
||||
U << "\red <b>Transfer failed</b>: \black Existing AI found on this terminal. Remove existing AI to install a new one."
|
||||
else
|
||||
if (ticker.mode.name == "AI malfunction")
|
||||
var/datum/game_mode/malfunction/malf = ticker.mode
|
||||
for (var/datum/mind/malfai in malf.malf_ai)
|
||||
if (T.mind == malfai)
|
||||
U << "\red <b>ERROR</b>: \black Remote transfer interface disabled."
|
||||
return
|
||||
if(T.stat)//If the ai is dead/dying.
|
||||
U << "\red <b>ERROR</b>: \black [T.name] data core is corrupted. Unable to install."
|
||||
else
|
||||
new /obj/AIcore/deactivated(T.loc)
|
||||
T.aiRestorePowerRoutine = 0
|
||||
T.control_disabled = 1
|
||||
T.loc = C
|
||||
C.AI = T
|
||||
T << "You have been downloaded to a mobile storage device. Remote device connection severed."
|
||||
U << "\blue <b>Transfer successful</b>: \black [T.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
|
||||
|
||||
if("INACTIVE")//Inactive AI object.
|
||||
var/obj/AIcore/deactivated/T = target
|
||||
switch(interaction)
|
||||
if("AICARD")
|
||||
var/obj/item/device/aicard/C = src
|
||||
var/mob/living/silicon/ai/A = locate() in C//I love locate(). Best proc ever.
|
||||
if(A)//If AI exists on the card. Else nothing since both are empty.
|
||||
A.control_disabled = 0
|
||||
A.loc = T.loc//To replace the terminal.
|
||||
A << "You have been uploaded to a stationary terminal. Remote device connection restored."
|
||||
U << "\blue <b>Transfer successful</b>: \black [A.name] ([rand(1000,9999)].exe) installed and executed succesfully. Local copy has been removed."
|
||||
C.icon_state = "aicard"
|
||||
C.name = "inteliCard"
|
||||
C.overlays = null
|
||||
del(T)
|
||||
if("NINJASUIT")
|
||||
var/obj/item/clothing/suit/space/space_ninja/C = src
|
||||
var/mob/living/silicon/ai/A = C.AI
|
||||
if(A)
|
||||
A.control_disabled = 0
|
||||
C.AI = null
|
||||
A.loc = T.loc
|
||||
A << "You have been uploaded to a stationary terminal. Remote device connection restored."
|
||||
U << "\blue <b>Transfer succesful</b>: \black [A.name] ([rand(1000,9999)].exe) installed and executed succesfully. Local copy has been removed."
|
||||
del(T)
|
||||
if("AIFIXER")//AI Fixer terminal.
|
||||
var/obj/machinery/computer/aifixer/T = target
|
||||
switch(interaction)
|
||||
if("AICARD")
|
||||
var/obj/item/device/aicard/C = src
|
||||
if(!T.contents.len)
|
||||
if (!C.contents.len)
|
||||
U << "No AI to copy over!"//Well duh
|
||||
else for(var/mob/living/silicon/ai/A in C)
|
||||
A << "You have been uploaded to a stationary terminal. Sadly, there is no remote access from here."
|
||||
U << "\blue <b>Transfer successful</b>: \black [A.name] ([rand(1000,9999)].exe) installed and executed succesfully. Local copy has been removed."
|
||||
C.icon_state = "aicard"
|
||||
C.name = "inteliCard"
|
||||
C.overlays = null
|
||||
A.loc = T
|
||||
T.occupant = A
|
||||
A.control_disabled = 1
|
||||
if (A.stat == 2)
|
||||
T.overlays += image('computer.dmi', "ai-fixer-404")
|
||||
else
|
||||
T.overlays += image('computer.dmi', "ai-fixer-full")
|
||||
T.overlays -= image('computer.dmi', "ai-fixer-empty")
|
||||
else
|
||||
if(!C.contents.len && T.occupant && !T.active)
|
||||
C.name = "inteliCard - [T.occupant.name]"
|
||||
T.overlays += image('computer.dmi', "ai-fixer-empty")
|
||||
if (T.occupant.stat == 2)
|
||||
C.icon_state = "aicard-404"
|
||||
T.overlays -= image('computer.dmi', "ai-fixer-404")
|
||||
else
|
||||
C.icon_state = "aicard-full"
|
||||
T.overlays -= image('computer.dmi', "ai-fixer-full")
|
||||
T.occupant << "You have been downloaded to a mobile storage device. Still no remote access."
|
||||
U << "\blue <b>Transfer succesful</b>: \black [T.occupant.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
|
||||
T.occupant.loc = C
|
||||
T.occupant = null
|
||||
else if (C.contents.len)
|
||||
U << "\red <b>ERROR</b>: \black Artificial intelligence detected on terminal."
|
||||
else if (T.active)
|
||||
U << "\red <b>ERROR</b>: \black Reconstruction in progress."
|
||||
else if (!T.occupant)
|
||||
U << "\red <b>ERROR</b>: \black Unable to locate artificial intelligence."
|
||||
if("NINJASUIT")
|
||||
var/obj/item/clothing/suit/space/space_ninja/C = src
|
||||
if(!T.contents.len)
|
||||
if (!C.AI)
|
||||
U << "No AI to copy over!"
|
||||
else
|
||||
var/mob/living/silicon/ai/A = C.AI
|
||||
A << "You have been uploaded to a stationary terminal. Sadly, there is no remote access from here."
|
||||
U << "\blue <b>Transfer successful</b>: \black [A.name] ([rand(1000,9999)].exe) installed and executed succesfully. Local copy has been removed."
|
||||
A.loc = T
|
||||
T.occupant = A
|
||||
C.AI = null
|
||||
A.control_disabled = 1
|
||||
T.overlays += image('computer.dmi', "ai-fixer-full")
|
||||
T.overlays -= image('computer.dmi', "ai-fixer-empty")
|
||||
else
|
||||
if(!C.AI && T.occupant && !T.active)
|
||||
if (T.occupant.stat)
|
||||
U << "\red <b>ERROR</b>: \black [T.occupant.name] data core is corrupted. Unable to install."
|
||||
else
|
||||
T.overlays += image('computer.dmi', "ai-fixer-empty")
|
||||
T.overlays -= image('computer.dmi', "ai-fixer-full")
|
||||
T.occupant << "You have been downloaded to a mobile storage device. Still no remote access."
|
||||
U << "\blue <b>Transfer successful</b>: \black [T.occupant.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
|
||||
T.occupant.loc = C
|
||||
T.occupant = null
|
||||
else if (C.AI)
|
||||
U << "\red <b>ERROR</b>: \black Artificial intelligence detected on terminal."
|
||||
else if (T.active)
|
||||
U << "\red <b>ERROR</b>: \black Reconstruction in progress."
|
||||
else if (!T.occupant)
|
||||
U << "\red <b>ERROR</b>: \black Unable to locate artificial intelligence."
|
||||
if("NINJASUIT")//Ninjasuit
|
||||
var/obj/item/clothing/suit/space/space_ninja/T = target
|
||||
switch(interaction)
|
||||
if("AICARD")
|
||||
var/obj/item/device/aicard/C = src
|
||||
if(T.initialize&&U==T.affecting)//If the suit is initialized and the actor is the user.
|
||||
|
||||
var/mob/living/silicon/ai/A_T = locate() in C//Determine if there is an AI on target card. Saves time when checking later.
|
||||
var/mob/living/silicon/ai/A = T.AI//Deterine if there is an AI in suit.
|
||||
|
||||
if(A)//If the host AI card is not empty.
|
||||
if(A_T)//If there is an AI on the target card.
|
||||
U << "\red <b>ERROR</b>: \black [A_T.name] already installed. Remove [A_T.name] to install a new one."
|
||||
else
|
||||
A.loc = C//Throw them into the target card. Since they are already on a card, transfer is easy.
|
||||
C.name = "inteliCard - [A.name]"
|
||||
C.icon_state = "aicard-full"
|
||||
T.AI = null
|
||||
A << "You have been uploaded to a mobile storage device."
|
||||
U << "\blue <b>SUCCESS</b>: \black [A.name] ([rand(1000,9999)].exe) removed from host and stored within local memory."
|
||||
else//If host AI is empty.
|
||||
if(C.flush)//If the other card is flushing.
|
||||
U << "\red <b>ERROR</b>: \black AI flush is in progress, cannot execute transfer protocol."
|
||||
else
|
||||
if(A_T&&!A_T.stat)//If there is an AI on the target card and it's not inactive.
|
||||
A_T.loc = T//Throw them into suit.
|
||||
C.icon_state = "aicard"
|
||||
C.name = "inteliCard"
|
||||
C.overlays = null
|
||||
T.AI = A_T
|
||||
A_T << "You have been uploaded to a mobile storage device."
|
||||
U << "\blue <b>SUCCESS</b>: \black [A_T.name] ([rand(1000,9999)].exe) removed from local memory and installed to host."
|
||||
else if(A_T)//If the target AI is dead. Else just go to return since nothing would happen if both are empty.
|
||||
U << "\red <b>ERROR</b>: \black [A_T.name] data core is corrupted. Unable to install."
|
||||
else
|
||||
U << "\red <b>ERROR</b>: \black AI flush is in progress, cannot execute transfer protocol."
|
||||
return
|
||||
@@ -45,46 +45,7 @@
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
user << "This terminal isn't functioning right now, get it working!"
|
||||
return
|
||||
var/obj/item/device/aicard/C = I
|
||||
if(contents.len == 0)
|
||||
if (C.contents.len == 0)
|
||||
user << "No AI to copy over!"//Well duh
|
||||
else for(var/mob/living/silicon/ai/A in C)
|
||||
A << "You have been uploaded to a stationary terminal. Sadly, there is no remote access from here."
|
||||
user << "<b>Transfer succesful</b>: [A.name] ([rand(1000,9999)].exe) installed and executed succesfully. Local copy has been removed."
|
||||
C.icon_state = "aicard"
|
||||
C.name = "inteliCard"
|
||||
C.overlays = null
|
||||
A.loc = src
|
||||
occupant = A
|
||||
A.control_disabled = 1
|
||||
if (A.stat == 2)
|
||||
overlays += image('computer.dmi', "ai-fixer-404")
|
||||
else
|
||||
overlays += image('computer.dmi', "ai-fixer-full")
|
||||
overlays -= image('computer.dmi', "ai-fixer-empty")
|
||||
|
||||
|
||||
else
|
||||
if(C.contents.len == 0 && src.occupant && !src.active)
|
||||
C.name = "inteliCard - [occupant.name]"
|
||||
overlays += image('computer.dmi', "ai-fixer-empty")
|
||||
if (src.occupant.stat == 2)
|
||||
C.icon_state = "aicard-404"
|
||||
src.overlays -= image('computer.dmi', "ai-fixer-404")
|
||||
else
|
||||
C.icon_state = "aicard-full"
|
||||
src.overlays -= image('computer.dmi', "ai-fixer-full")
|
||||
occupant << "You have been downloaded to a mobile storage device. Still no remote access."
|
||||
user << "<b>Transfer succeeded</b>: [occupant.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
|
||||
occupant.loc = C
|
||||
occupant = null
|
||||
else if (C.contents.len)
|
||||
user << "There's already an AI in the reconstructer!"
|
||||
else if (active)
|
||||
user << "Can't remove an AI during reconstruction!"
|
||||
else if (!occupant)
|
||||
user << "No AI to remove!"
|
||||
I:transfer_ai("AIFIXER","AICARD",src,user)
|
||||
|
||||
//src.attack_hand(user)
|
||||
return
|
||||
@@ -102,7 +63,7 @@
|
||||
if(ishuman(user))//Checks to see if they are ninja
|
||||
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
|
||||
if(user:wear_suit:control)
|
||||
attackby(user:wear_suit:aicard,user)
|
||||
user:wear_suit.transfer_ai("AIFIXER","NINJASUIT",src,user)
|
||||
else
|
||||
user << "\red <b>ERROR</b>: \black Remote access channel disabled."
|
||||
return
|
||||
|
||||
@@ -13,30 +13,7 @@
|
||||
if(!istype(M, /mob/living/silicon/ai))//If target is not an AI.
|
||||
return ..()
|
||||
|
||||
if (flush)//Here to prevent being unable to attack with card when wiping an AI.
|
||||
user << "<b>Transfer failed</b>: Cannot transfer while wipe in progress."
|
||||
return
|
||||
|
||||
if(contents.len > 0)//If there is an AI on card.
|
||||
user << "<b>Transfer failed</b>: Existing AI found on this terminal. Remove existing AI to install a new one."
|
||||
else
|
||||
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."//Do ho ho ho~
|
||||
return
|
||||
new /obj/AIcore/deactivated(M.loc)//Spawns a deactivated terminal at AI location.
|
||||
M.aiRestorePowerRoutine = 0//So the AI initially has power.
|
||||
M.control_disabled = 1//Can't control things remotely if you're stuck in a card!
|
||||
M.loc = src//Throw AI into the card.
|
||||
name = "inteliCard - [M.name]"
|
||||
if (M.stat == 2)
|
||||
src.icon_state = "aicard-404"
|
||||
else
|
||||
src.icon_state = "aicard-full"
|
||||
M << "You have been downloaded to a mobile storage device. Remote device connection severed."
|
||||
user << "<b>Transfer succeeded</b>: [M.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
|
||||
transfer_ai("AICORE", "AICARD", M, user)
|
||||
return
|
||||
|
||||
attack(mob/living/silicon/decoy/M as mob, mob/user as mob)
|
||||
|
||||
@@ -287,7 +287,7 @@
|
||||
if(ishuman(M))//Checks to see if they are ninja
|
||||
if(istype(M:gloves, /obj/item/clothing/gloves/space_ninja)&&M:gloves:candrain&&!M:gloves:draining)
|
||||
if(M:wear_suit:control)
|
||||
M:wear_suit:aicard.attack(src,M)
|
||||
M:wear_suit:transfer_ai("AICORE", "NINJASUIT", src, M)
|
||||
else
|
||||
M << "\red <b>ERROR</b>: \black Remote access channel disabled."
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user