mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
Added an AI System Integrity Restorer to the RD's office
Stick an AI into it via intelicard, then push button to begin repair process. AI unable to interact with things while in there. Can revive dead AIs, but you won't be able to stick it back into its core until I come up with a way to repair damaged cores. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@140 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -0,0 +1,168 @@
|
||||
/obj/machinery/computer/aifixer
|
||||
name = "AI System Integrity Restorer"
|
||||
icon = 'AIcore.dmi'
|
||||
icon_state = "ai-fixer"
|
||||
req_access = list(access_captain, access_robotics, access_heads)
|
||||
var/mob/living/silicon/ai/occupant = null
|
||||
var/active = 0
|
||||
|
||||
/obj/machinery/computer/aifixer/New()
|
||||
src.overlays += image('AIcore.dmi', "ai-fixer-empty")
|
||||
|
||||
|
||||
/obj/machinery/computer/aifixer/attackby(I as obj, user as mob)
|
||||
/*
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/robotics/M = new /obj/item/weapon/circuitboard/robotics( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.id = src.id
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/robotics/M = new /obj/item/weapon/circuitboard/robotics( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.id = src.id
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
*/
|
||||
if(istype(I, /obj/item/device/aicard))
|
||||
var/obj/item/device/aicard/C = I
|
||||
if(src.contents.len == 0)
|
||||
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
|
||||
src.occupant = A
|
||||
if (A.stat == 2)
|
||||
src.overlays += image('AIcore.dmi', "ai-fixer-404")
|
||||
else
|
||||
src.overlays += image('AIcore.dmi', "ai-fixer-full")
|
||||
src.overlays -= image('AIcore.dmi', "ai-fixer-empty")
|
||||
|
||||
else
|
||||
if(C.contents.len == 0 && src.occupant && !src.active)
|
||||
C.name = "inteliCard - [src.occupant.name]"
|
||||
src.overlays += image('AIcore.dmi', "ai-fixer-empty")
|
||||
if (src.occupant.stat == 2)
|
||||
C.icon_state = "aicard-404"
|
||||
src.overlays -= image('AIcore.dmi', "ai-fixer-404")
|
||||
else
|
||||
C.icon_state = "aicard-full"
|
||||
src.overlays -= image('AIcore.dmi', "ai-fixer-full")
|
||||
src.occupant << "You have been downloaded to a mobile storage device. Remote device connection severed."
|
||||
user << "<b>Transfer succeeded</b>: [src.occupant.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
|
||||
src.occupant.loc = C
|
||||
src.occupant = null
|
||||
|
||||
|
||||
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/aifixer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/aifixer/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/aifixer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = "<h3>AI System Integrity Restorer</h3><br><br>"
|
||||
|
||||
if (src.occupant)
|
||||
var/laws
|
||||
dat += "Stored AI: [src.occupant.name]<br>System integrity: [(src.occupant.health+100)/2]%<br>"
|
||||
|
||||
if (src.occupant.laws_object.zeroth)
|
||||
laws += "0: [src.occupant.laws_object.zeroth]<BR>"
|
||||
|
||||
var/number = 1
|
||||
for (var/index = 1, index <= src.occupant.laws_object.inherent.len, index++)
|
||||
var/law = src.occupant.laws_object.inherent[index]
|
||||
if (length(law) > 0)
|
||||
laws += "[number]: [law]<BR>"
|
||||
number++
|
||||
|
||||
for (var/index = 1, index <= src.occupant.laws_object.supplied.len, index++)
|
||||
var/law = src.occupant.laws_object.supplied[index]
|
||||
if (length(law) > 0)
|
||||
laws += "[number]: [law]<BR>"
|
||||
number++
|
||||
|
||||
dat += "Laws:<br>[laws]<br>"
|
||||
|
||||
if (src.occupant.stat == 2)
|
||||
dat += "<b>AI nonfunctional</b>"
|
||||
else
|
||||
dat += "<b>AI functional</b>"
|
||||
if (!src.active)
|
||||
dat += {"<br><br><A href='byond://?src=\ref[src];fix=1'>Begin Reconstruction</A>"}
|
||||
else
|
||||
dat += "<br><br>Reconstruction in process, please wait.<br>"
|
||||
dat += {" <A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/aifixer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
src.overlays = null
|
||||
return
|
||||
use_power(500)
|
||||
if (src.overlays == null)
|
||||
src.overlays += image('AIcore.dmi', "ai-fixer-empty")
|
||||
|
||||
src.updateDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/aifixer/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if (href_list["fix"])
|
||||
src.active = !src.active
|
||||
if (src.occupant.stat == 2)
|
||||
src.occupant.stat = 0
|
||||
src.overlays -= image('AIcore.dmi', "ai-fixer-404")
|
||||
src.overlays += image('AIcore.dmi', "ai-fixer-full")
|
||||
|
||||
src.overlays += image('AIcore.dmi', "ai-fixer-on")
|
||||
while (src.occupant.health < 100)
|
||||
src.occupant.oxyloss = max (src.occupant.oxyloss-1, 0)
|
||||
src.occupant.fireloss = max (src.occupant.fireloss-1, 0)
|
||||
src.occupant.toxloss = max (src.occupant.toxloss-1, 0)
|
||||
src.occupant.bruteloss = max (src.occupant.bruteloss-1, 0)
|
||||
sleep(10)
|
||||
src.active = 0
|
||||
src.overlays -= image('AIcore.dmi', "ai-fixer-on")
|
||||
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
src.fire.icon_state = "fire0"
|
||||
*/ //TODO: DEFERRED
|
||||
|
||||
if (src.health <= -100.0)
|
||||
if (src.health <= -100.0 && !istype(src.loc, /obj/machinery/computer/aifixer))
|
||||
death()
|
||||
return
|
||||
else if (src.health < 0)
|
||||
else if (src.health < 0 && !istype(src.loc, /obj/machinery/computer/aifixer))
|
||||
src.oxyloss++
|
||||
|
||||
if (src.machine)
|
||||
|
||||
@@ -88,6 +88,8 @@
|
||||
#define FILE_DIR "code/modules/power"
|
||||
#define FILE_DIR "code/modules/power/antimatter"
|
||||
#define FILE_DIR "code/unused"
|
||||
#define FILE_DIR "code/unused/modules"
|
||||
#define FILE_DIR "code/unused/modules/admin"
|
||||
#define FILE_DIR "code/WorkInProgress"
|
||||
#define FILE_DIR "code/WorkInProgress/computer2"
|
||||
#define FILE_DIR "code/WorkInProgress/optics"
|
||||
@@ -153,6 +155,7 @@
|
||||
#include "code\ATMOSPHERICS\components\unary\vent_pump.dm"
|
||||
#include "code\ATMOSPHERICS\components\unary\vent_scrubber.dm"
|
||||
#include "code\datums\ai_laws.dm"
|
||||
#include "code\datums\chemical.dm"
|
||||
#include "code\datums\computerfiles.dm"
|
||||
#include "code\datums\configuration.dm"
|
||||
#include "code\datums\datumvars.dm"
|
||||
@@ -189,6 +192,7 @@
|
||||
#include "code\defines\mob\living\carbon\alien_humanoid.dm"
|
||||
#include "code\defines\mob\living\carbon\alien_larva.dm"
|
||||
#include "code\defines\mob\living\carbon\carbon.dm"
|
||||
#include "code\defines\mob\living\carbon\changeling.dm"
|
||||
#include "code\defines\mob\living\carbon\human.dm"
|
||||
#include "code\defines\mob\living\carbon\monkey.dm"
|
||||
#include "code\defines\mob\living\silicon\ai.dm"
|
||||
@@ -338,12 +342,14 @@
|
||||
#include "code\game\machinery\bots\mulebot.dm"
|
||||
#include "code\game\machinery\bots\secbot.dm"
|
||||
#include "code\game\machinery\computer\AIcore.dm"
|
||||
#include "code\game\machinery\computer\aifixer.dm"
|
||||
#include "code\game\machinery\computer\arcade.dm"
|
||||
#include "code\game\machinery\computer\atmos.dm"
|
||||
#include "code\game\machinery\computer\buildandrepair.dm"
|
||||
#include "code\game\machinery\computer\communications.dm"
|
||||
#include "code\game\machinery\computer\computer.dm"
|
||||
#include "code\game\machinery\computer\crew.dm"
|
||||
#include "code\game\machinery\computer\engine.dm"
|
||||
#include "code\game\machinery\computer\hologram.dm"
|
||||
#include "code\game\machinery\computer\medical.dm"
|
||||
#include "code\game\machinery\computer\Operating.dm"
|
||||
@@ -357,6 +363,7 @@
|
||||
#include "code\game\machinery\doors\door.dm"
|
||||
#include "code\game\machinery\doors\firedoor.dm"
|
||||
#include "code\game\machinery\doors\poddoor.dm"
|
||||
#include "code\game\machinery\doors\shuttledoor.dm"
|
||||
#include "code\game\machinery\doors\windowdoor.dm"
|
||||
#include "code\game\machinery\embedded_controller\access_controller.dm"
|
||||
#include "code\game\machinery\embedded_controller\airlock_controller.dm"
|
||||
@@ -419,6 +426,7 @@
|
||||
#include "code\game\objects\closets\secure\security.dm"
|
||||
#include "code\game\objects\devices\aicard.dm"
|
||||
#include "code\game\objects\devices\chameleonproj.dm"
|
||||
#include "code\game\objects\devices\device.dm"
|
||||
#include "code\game\objects\devices\flash.dm"
|
||||
#include "code\game\objects\devices\flashlight.dm"
|
||||
#include "code\game\objects\devices\igniter.dm"
|
||||
@@ -485,6 +493,7 @@
|
||||
#include "code\game\verbs\ai_lockdown.dm"
|
||||
#include "code\game\verbs\AI_status.dm"
|
||||
#include "code\game\verbs\authorize.dm"
|
||||
#include "code\game\verbs\begin.dm"
|
||||
#include "code\game\verbs\checkkarma.dm"
|
||||
#include "code\game\verbs\ooc.dm"
|
||||
#include "code\game\verbs\suicide.dm"
|
||||
@@ -514,10 +523,12 @@
|
||||
#include "code\modules\mob\organs.dm"
|
||||
#include "code\modules\mob\say.dm"
|
||||
#include "code\modules\mob\transform_procs.dm"
|
||||
#include "code\modules\mob\dead\dead.dm"
|
||||
#include "code\modules\mob\dead\observer\hud.dm"
|
||||
#include "code\modules\mob\dead\observer\login.dm"
|
||||
#include "code\modules\mob\dead\observer\observer.dm"
|
||||
#include "code\modules\mob\dead\observer\say.dm"
|
||||
#include "code\modules\mob\living\living.dm"
|
||||
#include "code\modules\mob\living\say.dm"
|
||||
#include "code\modules\mob\living\carbon\carbon.dm"
|
||||
#include "code\modules\mob\living\carbon\alien\alien.dm"
|
||||
@@ -540,6 +551,10 @@
|
||||
#include "code\modules\mob\living\carbon\beast\beast.dm"
|
||||
#include "code\modules\mob\living\carbon\beast\bodypart.dm"
|
||||
#include "code\modules\mob\living\carbon\beast\death.dm"
|
||||
#include "code\modules\mob\living\carbon\beast\examine.dm"
|
||||
#include "code\modules\mob\living\carbon\beast\life.dm"
|
||||
#include "code\modules\mob\living\carbon\beast\login.dm"
|
||||
#include "code\modules\mob\living\carbon\beast\say.dm"
|
||||
#include "code\modules\mob\living\carbon\human\death.dm"
|
||||
#include "code\modules\mob\living\carbon\human\emote.dm"
|
||||
#include "code\modules\mob\living\carbon\human\examine.dm"
|
||||
@@ -601,6 +616,7 @@
|
||||
#include "code\modules\power\generator_type2.dm"
|
||||
#include "code\modules\power\lighting.dm"
|
||||
#include "code\modules\power\port_gen.dm"
|
||||
#include "code\modules\power\portable.dm"
|
||||
#include "code\modules\power\power.dm"
|
||||
#include "code\modules\power\sd_DynamicAreaLighting.dm"
|
||||
#include "code\modules\power\smes.dm"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 690 B After Width: | Height: | Size: 1.4 KiB |
+3329
-3328
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user