mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
All credits to the author for this handy little script. I Committed the modified python script to tool directory. Although it needs to be in the root folder of your repo to work. To notice the improved compile times, in dreammaker go to Build > Preferences > and untick "automatically set file_dir for subfolders" If this commit inteferes with any large projects just revert it, do your thing, then rerun the script. Easy-peasy. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4488 316c924e-a436-60f5-8080-3fe189b3f50e
129 lines
3.7 KiB
Plaintext
129 lines
3.7 KiB
Plaintext
/obj/machinery/computer/curer
|
|
name = "Cure Research Machine"
|
|
icon = 'icons/obj/computer.dmi'
|
|
icon_state = "dna"
|
|
var/curing
|
|
var/virusing
|
|
|
|
var/obj/item/weapon/reagent_containers/container = null
|
|
|
|
/obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob)
|
|
if(istype(I, /obj/item/weapon/screwdriver))
|
|
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
|
if(do_after(user, 20))
|
|
if (src.stat & BROKEN)
|
|
user << "\blue The broken glass falls out."
|
|
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
|
new /obj/item/weapon/shard( src.loc )
|
|
//var/obj/item/weapon/circuitboard/curer/M = new /obj/item/weapon/circuitboard/curer( A )
|
|
for (var/obj/C in src)
|
|
C.loc = src.loc
|
|
//A.circuit = M
|
|
A.state = 3
|
|
A.icon_state = "3"
|
|
A.anchored = 1
|
|
del(src)
|
|
else
|
|
user << "\blue You disconnect the monitor."
|
|
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
|
//var/obj/item/weapon/circuitboard/curer/M = new /obj/item/weapon/circuitboard/curer( A )
|
|
for (var/obj/C in src)
|
|
C.loc = src.loc
|
|
//A.circuit = M
|
|
A.state = 4
|
|
A.icon_state = "4"
|
|
A.anchored = 1
|
|
del(src)
|
|
if(istype(I,/obj/item/weapon/reagent_containers))
|
|
var/mob/living/carbon/C = user
|
|
if(!container)
|
|
container = I
|
|
C.drop_item()
|
|
I.loc = src
|
|
|
|
//else
|
|
src.attack_hand(user)
|
|
return
|
|
|
|
/obj/machinery/computer/curer/attack_ai(var/mob/user as mob)
|
|
return src.attack_hand(user)
|
|
|
|
/obj/machinery/computer/curer/attack_paw(var/mob/user as mob)
|
|
|
|
return src.attack_hand(user)
|
|
return
|
|
|
|
/obj/machinery/computer/curer/attack_hand(var/mob/user as mob)
|
|
if(..())
|
|
return
|
|
user.machine = src
|
|
var/dat
|
|
if(curing)
|
|
dat = "Antibody production in progress"
|
|
else if(virusing)
|
|
dat = "Virus production in progress"
|
|
else if(container)
|
|
// see if there's any blood in the container
|
|
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in container.reagents.reagent_list
|
|
|
|
if(B)
|
|
dat = "Blood sample inserted."
|
|
dat += "<BR><A href='?src=\ref[src];antibody=1'>Begin antibody production</a>"
|
|
else
|
|
dat += "<BR>Please check container contents."
|
|
dat += "<BR><A href='?src=\ref[src];eject=1'>Eject container</a>"
|
|
else
|
|
dat = "Please insert a container."
|
|
|
|
user << browse(dat, "window=computer;size=400x500")
|
|
onclose(user, "computer")
|
|
return
|
|
|
|
/obj/machinery/computer/curer/process()
|
|
..()
|
|
|
|
if(stat & (NOPOWER|BROKEN))
|
|
return
|
|
use_power(500)
|
|
//src.updateDialog()
|
|
|
|
if(curing)
|
|
curing -= 1
|
|
if(curing == 0)
|
|
if(container)
|
|
createcure(container)
|
|
return
|
|
|
|
/obj/machinery/computer/curer/Topic(href, href_list)
|
|
if(..())
|
|
return
|
|
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
|
usr.machine = src
|
|
|
|
if (href_list["antibody"])
|
|
curing = 10
|
|
else if(href_list["eject"])
|
|
container.loc = src.loc
|
|
container = null
|
|
|
|
src.add_fingerprint(usr)
|
|
src.updateUsrDialog()
|
|
return
|
|
|
|
|
|
/obj/machinery/computer/curer/proc/createcure(var/obj/item/weapon/reagent_containers/container)
|
|
var/obj/item/weapon/reagent_containers/glass/beaker/product = new(src.loc)
|
|
|
|
var/datum/reagent/blood/B = locate() in container.reagents.reagent_list
|
|
|
|
var/list/data = list()
|
|
data["antibodies"] = B.data["antibodies"]
|
|
product.reagents.add_reagent("antibodies",30,data)
|
|
|
|
state("The [src.name] Buzzes", "blue")
|
|
|
|
/obj/machinery/computer/curer/proc/createvirus(var/datum/disease2/disease/virus2)
|
|
var/obj/item/weapon/cureimplanter/implanter = new /obj/item/weapon/cureimplanter(src.loc)
|
|
implanter.name = "Viral implanter (MAJOR BIOHAZARD)"
|
|
implanter.works = 3
|
|
state("The [src.name] Buzzes", "blue") |