mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
Virology - NanoUI, gameplay tweaks, bugfixes
Conflicts: .gitignore code/game/machinery/kitchen/smartfridge.dm code/game/machinery/machinery.dm code/modules/food/recipes_microwave.dm code/modules/reagents/Chemistry-Holder.dm code/modules/reagents/Chemistry-Reagents.dm code/modules/virus2/isolator.dm nano/js/nano_base_helpers.js
This commit is contained in:
committed by
ZomgPonies
parent
f93c7d320a
commit
f43ef06431
@@ -4,7 +4,11 @@
|
||||
*.rsc
|
||||
*.dmb
|
||||
*.lk
|
||||
<<<<<<< HEAD
|
||||
|
||||
#ignore any files in config/, except those in subdirectories.
|
||||
/config/*
|
||||
!/config/*/*
|
||||
=======
|
||||
data/
|
||||
>>>>>>> 16f787a... Virology - NanoUI, gameplay tweaks, bugfixes
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
if(!isbroken)
|
||||
icon_state = icon_off
|
||||
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
@@ -83,6 +82,8 @@
|
||||
user.visible_message("<span class='notice'>[user] has added \the [O] to \the [src].", \
|
||||
"<span class='notice'>You add \the [O] to \the [src].")
|
||||
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
else if(istype(O, /obj/item/weapon/storage/bag/plants))
|
||||
var/obj/item/weapon/storage/bag/plants/P = O
|
||||
var/plants_loaded = 0
|
||||
@@ -100,81 +101,88 @@
|
||||
plants_loaded++
|
||||
if(plants_loaded)
|
||||
|
||||
user.visible_message("<span class='notice'>[user] loads \the [src] with \the [P].</span>", \
|
||||
"<span class='notice'>You load \the [src] with \the [P].</span>")
|
||||
user.visible_message( \
|
||||
"<span class='notice'>[user] loads \the [src] with \the [P].</span>", \
|
||||
"<span class='notice'>You load \the [src] with \the [P].</span>")
|
||||
if(P.contents.len > 0)
|
||||
user << "<span class='notice'>Some items are refused.</span>"
|
||||
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
else
|
||||
user << "<span class='notice'>\The [src] smartly refuses [O].</span>"
|
||||
return 1
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/smartfridge/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/smartfridge/attack_ai(mob/user as mob)
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
ui_interact(user)
|
||||
|
||||
/*******************
|
||||
* SmartFridge Menu
|
||||
********************/
|
||||
|
||||
/obj/machinery/smartfridge/interact(mob/user as mob)
|
||||
if(!src.ispowered)
|
||||
return
|
||||
/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = "<TT><b>Select an item:</b><br>"
|
||||
var/data[0]
|
||||
data["contents"] = null
|
||||
|
||||
if (contents.len == 0)
|
||||
dat += "<font color = 'red'>No product loaded!</font>"
|
||||
else
|
||||
for (var/O in item_quants)
|
||||
if(item_quants[O] > 0)
|
||||
var/N = item_quants[O]
|
||||
dat += "<FONT color = 'blue'><B>[capitalize(O)]</B>:"
|
||||
dat += " [N] </font>"
|
||||
dat += "<a href='byond://?src=\ref[src];vend=[O];amount=1'>Vend</A> "
|
||||
if(N > 5)
|
||||
dat += "(<a href='byond://?src=\ref[src];vend=[O];amount=5'>x5</A>)"
|
||||
if(N > 10)
|
||||
dat += "(<a href='byond://?src=\ref[src];vend=[O];amount=10'>x10</A>)"
|
||||
if(N > 25)
|
||||
dat += "(<a href='byond://?src=\ref[src];vend=[O];amount=25'>x25</A>)"
|
||||
if(N > 1)
|
||||
dat += "(<a href='?src=\ref[src];vend=[O];amount=[N]'>All</A>)"
|
||||
dat += "<br>"
|
||||
var/list/items[0]
|
||||
for (var/i=1 to length(item_quants))
|
||||
var/K = item_quants[i]
|
||||
var/count = item_quants[K]
|
||||
if (count > 0)
|
||||
items.Add(list(list("display_name" = html_encode(capitalize(K)), "vend" = i, "quantity" = count)))
|
||||
|
||||
dat += "</TT>"
|
||||
user << browse("<HEAD><TITLE>[src] Supplies</TITLE></HEAD><TT>[dat]</TT>", "window=smartfridge")
|
||||
onclose(user, "smartfridge")
|
||||
return
|
||||
if (items.len > 0)
|
||||
data["contents"] = items
|
||||
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "smartfridge.tmpl", src.name, 400, 500)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/smartfridge/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
if (..()) return 0
|
||||
|
||||
var/N = href_list["vend"]
|
||||
var/amount = text2num(href_list["amount"])
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
||||
|
||||
if(item_quants[N] <= 0) // Sanity check, there are probably ways to press the button when it shouldn't be possible.
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
|
||||
item_quants[N] = max(item_quants[N] - amount, 0)
|
||||
if (href_list["close"])
|
||||
user.unset_machine()
|
||||
ui.close()
|
||||
return 0
|
||||
|
||||
var/i = amount
|
||||
for(var/obj/O in contents)
|
||||
if(O.name == N)
|
||||
O.loc = src.loc
|
||||
i--
|
||||
if(i <= 0)
|
||||
break
|
||||
if (href_list["vend"])
|
||||
var/index = text2num(href_list["vend"])
|
||||
var/amount = text2num(href_list["amount"])
|
||||
var/K = item_quants[index]
|
||||
var/count = item_quants[K]
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
// Sanity check, there are probably ways to press the button when it shouldn't be possible.
|
||||
if(count > 0)
|
||||
item_quants[K] = max(count - amount, 0)
|
||||
|
||||
var/i = amount
|
||||
for(var/obj/O in contents)
|
||||
if (O.name == K)
|
||||
O.loc = loc
|
||||
i--
|
||||
if (i <= 0)
|
||||
return 1
|
||||
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
@@ -277,3 +277,15 @@ Class Procs:
|
||||
panel_open = 0
|
||||
icon_state = icon_state_closed
|
||||
user << "<span class='notice'>You close the maintenance hatch of [src].</span>"
|
||||
|
||||
/obj/machinery/proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] <span class = 'notice'>[msg]</span>", 2)
|
||||
|
||||
/obj/machinery/proc/ping(text=null)
|
||||
if (!text)
|
||||
text = "\The [src] pings."
|
||||
|
||||
state(text, "blue")
|
||||
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
|
||||
|
||||
|
||||
@@ -1318,6 +1318,14 @@
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sashimi
|
||||
|
||||
// Fuck Science!
|
||||
/datum/recipe/ruinedvirusdish
|
||||
items = list(
|
||||
/obj/item/weapon/virusdish
|
||||
)
|
||||
result = /obj/item/weapon/ruinedvirusdish
|
||||
|
||||
|
||||
//////////////////////////////////////////
|
||||
// bs12 food port stuff
|
||||
//////////////////////////////////////////
|
||||
|
||||
@@ -110,7 +110,7 @@ datum
|
||||
continue
|
||||
var/current_reagent_transfer = current_reagent.volume * part
|
||||
if(preserve_data)
|
||||
trans_data = current_reagent.data
|
||||
trans_data = copy_data(current_reagent)
|
||||
|
||||
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
|
||||
src.remove_reagent(current_reagent.id, current_reagent_transfer)
|
||||
@@ -181,8 +181,8 @@ datum
|
||||
for (var/datum/reagent/current_reagent in src.reagent_list)
|
||||
var/current_reagent_transfer = current_reagent.volume * part
|
||||
if(preserve_data)
|
||||
trans_data = current_reagent.data
|
||||
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
|
||||
trans_data = copy_data(current_reagent)
|
||||
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data, safety = 1) //safety check so all chemicals are transferred before reacting
|
||||
|
||||
src.update_total()
|
||||
R.update_total()
|
||||
@@ -204,7 +204,7 @@ datum
|
||||
for (var/datum/reagent/current_reagent in src.reagent_list)
|
||||
if(current_reagent.id == reagent)
|
||||
if(preserve_data)
|
||||
trans_data = current_reagent.data
|
||||
trans_data = copy_data(current_reagent)
|
||||
R.add_reagent(current_reagent.id, amount, trans_data)
|
||||
src.remove_reagent(current_reagent.id, amount, 1)
|
||||
break
|
||||
@@ -604,6 +604,24 @@ datum
|
||||
if(my_atom)
|
||||
my_atom.reagents = null
|
||||
|
||||
copy_data(var/datum/reagent/current_reagent)
|
||||
if (!current_reagent || !current_reagent.data) return null
|
||||
if (!istype(current_reagent.data, /list)) return current_reagent.data
|
||||
|
||||
var/list/trans_data = current_reagent.data.Copy()
|
||||
|
||||
// We do this so that introducing a virus to a blood sample
|
||||
// doesn't automagically infect all other blood samples from
|
||||
// the same donor.
|
||||
//
|
||||
// Technically we should probably copy all data lists, but
|
||||
// that could possibly eat up a lot of memory needlessly
|
||||
// if most data lists are read-only.
|
||||
if (trans_data["virus2"])
|
||||
var/list/v = trans_data["virus2"]
|
||||
trans_data["virus2"] = v.Copy()
|
||||
|
||||
return trans_data
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -2236,7 +2236,6 @@ datum
|
||||
return
|
||||
|
||||
|
||||
|
||||
/////////////////////////Food Reagents////////////////////////////
|
||||
// Part of the food code. Nutriment is used instead of the old "heal_amt" code. Also is where all the food
|
||||
// condiments, additives, and such go.
|
||||
@@ -3869,4 +3868,7 @@ datum
|
||||
M.adjustBrainLoss(10*REM)
|
||||
return
|
||||
|
||||
|
||||
*/
|
||||
// Undefine the alias for REAGENTS_EFFECT_MULTIPLER
|
||||
#undef REM
|
||||
|
||||
@@ -10,43 +10,46 @@
|
||||
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
|
||||
/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\blue [user.name] inserts the [dish.name] in the [src.name]", 3)
|
||||
else
|
||||
user << "There is already a dish inserted"
|
||||
return
|
||||
/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/O as obj, var/mob/user as mob)
|
||||
if(!istype(O,/obj/item/weapon/virusdish)) return
|
||||
|
||||
if(dish)
|
||||
user << "\The [src] is already loaded."
|
||||
return
|
||||
|
||||
dish = O
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
|
||||
user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!")
|
||||
|
||||
/obj/machinery/disease2/diseaseanalyser/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
//use_power(500)
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(scanning == 0)
|
||||
var/r = dish.virus2.get_info()
|
||||
if (dish.virus2.addToDB())
|
||||
ping("\The [src] pings, \"New pathogen added to data bank.\"")
|
||||
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.loc)
|
||||
P.info = r
|
||||
P.name = "paper - [dish.virus2.name()]"
|
||||
|
||||
var/r = dish.virus2.get_info()
|
||||
P.info = {"
|
||||
[virology_letterhead("Post-Analysis Memo")]
|
||||
[r]
|
||||
<hr>
|
||||
<u>Additional Notes:</u>
|
||||
"}
|
||||
dish.info = r
|
||||
dish.analysed = 1
|
||||
if (dish.virus2.addToDB())
|
||||
src.state("\The [src.name] states, \"Added new pathogen to database.\"")
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
icon_state = "analyser"
|
||||
|
||||
src.state("\The [src.name] prints a sheet of paper")
|
||||
icon_state = "analyser"
|
||||
src.state("\The [src] prints a sheet of paper.")
|
||||
|
||||
else if(dish && !scanning && !pause)
|
||||
if(dish.virus2 && dish.growth > 50)
|
||||
@@ -58,6 +61,7 @@
|
||||
spawn(25)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
src.state("\The [src.name] buzzes")
|
||||
|
||||
src.state("\The [src] buzzes, \"Insufficient growth density to complete analysis.\"")
|
||||
pause = 0
|
||||
return
|
||||
|
||||
@@ -9,19 +9,23 @@
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/vial/sample = null
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
|
||||
/obj/machinery/computer/centrifuge/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
return ..(I,user)
|
||||
/obj/machinery/computer/centrifuge/attackby(var/obj/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/screwdriver))
|
||||
return ..(O,user)
|
||||
|
||||
if(istype(I,/obj/item/weapon/reagent_containers/glass/beaker/vial))
|
||||
var/mob/living/carbon/C = user
|
||||
if(!sample)
|
||||
sample = I
|
||||
C.drop_item()
|
||||
I.loc = src
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass/beaker/vial))
|
||||
if(sample)
|
||||
user << "\The [src] is already loaded."
|
||||
return
|
||||
|
||||
sample = O
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
|
||||
user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!")
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/centrifuge/update_icon()
|
||||
..()
|
||||
@@ -29,126 +33,181 @@
|
||||
icon_state = "centrifuge_moving"
|
||||
|
||||
/obj/machinery/computer/centrifuge/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat= ""
|
||||
if(curing)
|
||||
dat = "Antibody isolation in progress"
|
||||
else if(isolating)
|
||||
dat = "Pathogen isolation in progress"
|
||||
else
|
||||
dat += "<BR>Blood sample:"
|
||||
dat += "<br><table cellpadding='10'><tr><td>"
|
||||
if(sample)
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
|
||||
if(B)
|
||||
dat += "Sample inserted."
|
||||
if (B.data["antibodies"])
|
||||
dat += "</td></tr><tr><td>"
|
||||
dat += "Antibodies: [antigens2string(B.data["antibodies"])]"
|
||||
dat += "</td><td><A href='?src=\ref[src];action=antibody'>Isolate</a>"
|
||||
if(..()) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/centrifuge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
data["antibodies"] = null
|
||||
data["pathogens"] = null
|
||||
data["is_antibody_sample"] = null
|
||||
|
||||
if (curing)
|
||||
data["busy"] = "Isolating antibodies..."
|
||||
else if (isolating)
|
||||
data["busy"] = "Isolating pathogens..."
|
||||
else
|
||||
data["sample_inserted"] = !!sample
|
||||
|
||||
if (sample)
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
|
||||
if (B)
|
||||
data["antibodies"] = B.data["antibodies"] ? antigens2string(B.data["antibodies"]) : null
|
||||
|
||||
var/list/pathogens[0]
|
||||
var/list/virus = B.data["virus2"]
|
||||
for (var/ID in virus)
|
||||
var/datum/disease2/disease/V = virus[ID]
|
||||
dat += " </td></tr><tr><td> pathogen [V.name()]"
|
||||
dat += "</td><td><A href='?src=\ref[src];action=isolate;isolate=[V.uniqueID]'>Isolate</a>"
|
||||
pathogens.Add(list(list("name" = V.name(), "spread_type" = V.spreadtype, "reference" = "\ref[V]")))
|
||||
|
||||
if (pathogens.len > 0)
|
||||
data["pathogens"] = pathogens
|
||||
|
||||
else
|
||||
dat += "Please check container contents."
|
||||
dat += "</td></tr><tr><td><A href='?src=\ref[src];action=sample'>Eject container</a>"
|
||||
else
|
||||
dat = "Please insert a container."
|
||||
dat += "</td></tr></table><br>"
|
||||
var/datum/reagent/antibodies/A = locate(/datum/reagent/antibodies) in sample.reagents.reagent_list
|
||||
data["antibodies"] = A && A.data["antibodies"] ? antigens2string(A.data["antibodies"]) : null
|
||||
data["is_antibody_sample"] = 1
|
||||
|
||||
dat += "<hr>"
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "isolation_centrifuge.tmpl", src.name, 400, 500)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/centrifuge/process()
|
||||
..()
|
||||
if (stat & (NOPOWER|BROKEN)) return
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
//use_power(500)
|
||||
|
||||
if(curing)
|
||||
if (curing)
|
||||
curing -= 1
|
||||
if(curing == 0)
|
||||
if(sample)
|
||||
cure()
|
||||
update_icon()
|
||||
if(isolating)
|
||||
if (curing == 0)
|
||||
cure()
|
||||
|
||||
if (isolating)
|
||||
isolating -= 1
|
||||
if(isolating == 0)
|
||||
if(sample)
|
||||
isolate()
|
||||
update_icon()
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
isolate()
|
||||
|
||||
/obj/machinery/computer/centrifuge/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if (..()) return 0
|
||||
|
||||
if(usr) usr.set_machine(src)
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
||||
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if (href_list["close"])
|
||||
user.unset_machine()
|
||||
ui.close()
|
||||
return 0
|
||||
|
||||
if (href_list["print"])
|
||||
print(user)
|
||||
return 1
|
||||
|
||||
if(href_list["isolate"])
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
|
||||
if (B)
|
||||
var/datum/disease2/disease/virus = locate(href_list["isolate"])
|
||||
virus2 = virus.getcopy()
|
||||
isolating = 40
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
switch(href_list["action"])
|
||||
if("antibody")
|
||||
if ("antibody")
|
||||
var/delay = 20
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
|
||||
if (!B)
|
||||
state("\The [src.name] buzzes, \"No antibody carrier detected.\"", "blue")
|
||||
state("\The [src] buzzes, \"No antibody carrier detected.\"", "blue")
|
||||
return 1
|
||||
|
||||
else if(sample.reagents.has_reagent("toxins"))
|
||||
state("\The [src.name] beeps, \"Pathogen purging speed above nominal.\"", "blue")
|
||||
delay = delay/2
|
||||
var/has_toxins = locate(/datum/reagent/toxin) in sample.reagents.reagent_list
|
||||
var/has_radium = sample.reagents.has_reagent("radium")
|
||||
if (has_toxins || has_radium)
|
||||
state("\The [src] beeps, \"Pathogen purging speed above nominal.\"", "blue")
|
||||
if (has_toxins)
|
||||
delay = delay/2
|
||||
if (has_radium)
|
||||
delay = delay/2
|
||||
|
||||
else
|
||||
curing = delay
|
||||
playsound(src.loc, 'sound/machines/juicer.ogg', 50, 1)
|
||||
update_icon()
|
||||
|
||||
if("isolate")
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
|
||||
if (B)
|
||||
var/list/virus = virus_copylist(B.data["virus2"])
|
||||
var/choice = href_list["isolate"]
|
||||
if (choice in virus)
|
||||
virus2 = virus[choice]
|
||||
isolating = 40
|
||||
update_icon()
|
||||
else
|
||||
state("\The [src.name] buzzes, \"No such pathogen detected.\"", "blue")
|
||||
curing = round(delay)
|
||||
playsound(src.loc, 'sound/machines/juicer.ogg', 50, 1)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
if("sample")
|
||||
if(sample)
|
||||
sample.loc = src.loc
|
||||
sample = null
|
||||
return 1
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
attack_hand(usr)
|
||||
return
|
||||
|
||||
return 0
|
||||
|
||||
/obj/machinery/computer/centrifuge/proc/cure()
|
||||
if (!sample) return
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
|
||||
if (!B)
|
||||
return
|
||||
if (!B) return
|
||||
|
||||
var/list/data = list("antibodies" = B.data["antibodies"])
|
||||
var/amt= sample.reagents.get_reagent_amount("blood")
|
||||
sample.reagents.remove_reagent("blood",amt)
|
||||
sample.reagents.add_reagent("antibodies",amt,data)
|
||||
sample.reagents.remove_reagent("blood", amt)
|
||||
sample.reagents.add_reagent("antibodies", amt, data)
|
||||
|
||||
state("\The [src.name] pings", "blue")
|
||||
nanomanager.update_uis(src)
|
||||
update_icon()
|
||||
ping("\The [src] pings, \"Antibody isolated.\"")
|
||||
|
||||
/obj/machinery/computer/centrifuge/proc/isolate()
|
||||
var/obj/item/weapon/virusdish/dish = new/obj/item/weapon/virusdish(src.loc)
|
||||
if (!sample) return
|
||||
var/obj/item/weapon/virusdish/dish = new/obj/item/weapon/virusdish(loc)
|
||||
dish.virus2 = virus2
|
||||
virus2 = null
|
||||
|
||||
state("\The [src.name] pings", "blue")
|
||||
nanomanager.update_uis(src)
|
||||
update_icon()
|
||||
ping("\The [src] pings, \"Pathogen isolated.\"")
|
||||
|
||||
/obj/machinery/computer/centrifuge/proc/print(var/mob/user)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
|
||||
P.name = "paper - Pathology Report"
|
||||
P.info = {"
|
||||
[virology_letterhead("Pathology Report")]
|
||||
<large><u>Sample:</u></large> [sample.name]<br>
|
||||
"}
|
||||
|
||||
if (user)
|
||||
P.info += "<u>Generated By:</u> [user.name]<br>"
|
||||
|
||||
P.info += "<hr>"
|
||||
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
|
||||
if (B)
|
||||
P.info += "<u>Antibodies:</u> "
|
||||
P.info += B.data["antibodies"] ? antigens2string(B.data["antibodies"]) : "None"
|
||||
P.info += "<br>"
|
||||
|
||||
var/list/virus = B.data["virus2"]
|
||||
P.info += "<u>Pathogens:</u> <br>"
|
||||
if (virus.len > 0)
|
||||
for (var/ID in virus)
|
||||
var/datum/disease2/disease/V = virus[ID]
|
||||
P.info += "[V.name()]<br>"
|
||||
else
|
||||
P.info += "None<br>"
|
||||
|
||||
else
|
||||
var/datum/reagent/antibodies/A = locate(/datum/reagent/antibodies) in sample.reagents.reagent_list
|
||||
if (A)
|
||||
P.info += "The following antibodies have been isolated from the blood sample: "
|
||||
P.info += A.data["antibodies"] ? antigens2string(A.data["antibodies"]) : "None"
|
||||
P.info += "<br>"
|
||||
|
||||
P.info += {"
|
||||
<hr>
|
||||
<u>Additional Notes:</u> <field>
|
||||
"}
|
||||
|
||||
state("The nearby computer prints out a pathology report.")
|
||||
|
||||
@@ -177,17 +177,21 @@ var/global/list/virusDB = list()
|
||||
.= V.fields["name"]
|
||||
|
||||
/datum/disease2/disease/proc/get_info()
|
||||
var/r = "GNAv2 based virus lifeform - [name()], #[add_zero("[uniqueID]", 4)]"
|
||||
r += "<BR>Infection rate : [infectionchance * 10]"
|
||||
r += "<BR>Spread form : [spreadtype]"
|
||||
r += "<BR>Progress Speed : [stageprob * 10]"
|
||||
r += "<BR>Affected species:"
|
||||
for(var/S in affected_species)
|
||||
r += "<BR>[S]"
|
||||
for(var/datum/disease2/effectholder/E in effects)
|
||||
r += "<BR>Effect:[E.effect.name]. Strength : [E.multiplier * 8]. Verosity : [E.chance * 15]. Type : [5-E.stage]."
|
||||
var/r = {"
|
||||
<small>Analysis determined the existence of a GNAv2-based viral lifeform.</small><br>
|
||||
<u>Designation:</u> [name()]<br>
|
||||
<u>Antigen:</u> [antigens2string(antigen)]<br>
|
||||
<u>Transmitted By:</u> [spreadtype]<br>
|
||||
<u>Rate of Progression:</u> [stageprob * 10]<br>
|
||||
<u>Species Affected:</u> [list2text(affected_species, ", ")]<br>
|
||||
"}
|
||||
|
||||
r += "<u>Symptoms:</u><br>"
|
||||
for(var/datum/disease2/effectholder/E in effects)
|
||||
r += "([E.stage]) [E.effect.name] "
|
||||
r += "<small><u>Strength:</u> [E.multiplier >= 3 ? "Severe" : E.multiplier > 1 ? "Above Average" : "Average"] "
|
||||
r += "<u>Verosity:</u> [E.chance * 15]</small><br>"
|
||||
|
||||
r += "<BR>Antigen pattern: [antigens2string(antigen)]"
|
||||
return r
|
||||
|
||||
/datum/disease2/disease/proc/addToDB()
|
||||
@@ -226,3 +230,10 @@ proc/virus2_greater_infection()
|
||||
candidates = shuffle(candidates)
|
||||
|
||||
infect_mob_random_greater(candidates[1])
|
||||
|
||||
proc/virology_letterhead(var/report_name)
|
||||
return {"
|
||||
<center><h1><b>[report_name]</b></h1></center>
|
||||
<center><small><i>[station_name()] Virology Lab</i></small></center>
|
||||
<hr>
|
||||
"}
|
||||
|
||||
@@ -4,145 +4,179 @@
|
||||
icon_state = "crew"
|
||||
|
||||
var/datum/disease2/effectholder/memorybank = null
|
||||
var/list/species_buffer = null
|
||||
var/analysed = 0
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
var/burning = 0
|
||||
|
||||
var/splicing = 0
|
||||
var/scanning = 0
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
return ..(I,user)
|
||||
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
if (dish)
|
||||
user << "\The [src] is already loaded."
|
||||
return
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
if(istype(I,/obj/item/weapon/diseasedisk))
|
||||
user << "You upload the contents of the disk into the buffer"
|
||||
user << "You upload the contents of the disk onto the buffer."
|
||||
memorybank = I:effect
|
||||
species_buffer = I:species
|
||||
analysed = I:analysed
|
||||
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
if(..()) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if(splicing)
|
||||
dat = "Splicing in progress."
|
||||
else if(scanning)
|
||||
dat = "Splicing in progress."
|
||||
else if(burning)
|
||||
dat = "Data disk burning in progress."
|
||||
|
||||
var/data[0]
|
||||
data["dish_inserted"] = !!dish
|
||||
data["growth"] = 0
|
||||
data["affected_species"] = null
|
||||
|
||||
if (memorybank)
|
||||
data["buffer"] = list("name" = (analysed ? memorybank.effect.name : "Unknown Symptom"), "stage" = memorybank.stage)
|
||||
if (species_buffer)
|
||||
data["species_buffer"] = analysed ? list2text(species_buffer, ", ") : "Unknown Species"
|
||||
|
||||
if (splicing)
|
||||
data["busy"] = "Splicing..."
|
||||
else if (scanning)
|
||||
data["busy"] = "Scanning..."
|
||||
else if (burning)
|
||||
data["busy"] = "Copying data to disk..."
|
||||
else if (dish)
|
||||
data["growth"] = min(dish.growth, 100)
|
||||
|
||||
if (dish.virus2)
|
||||
if (dish.virus2.affected_species)
|
||||
data["affected_species"] = dish.analysed ? list2text(dish.virus2.affected_species, ", ") : "Unknown"
|
||||
|
||||
if (dish.growth >= 50)
|
||||
var/list/effects[0]
|
||||
for (var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
effects.Add(list(list("name" = (dish.analysed ? e.effect.name : "Unknown"), "stage" = (e.stage), "reference" = "\ref[e]")))
|
||||
data["effects"] = effects
|
||||
else
|
||||
data["info"] = "Insufficient cell growth for gene splicing."
|
||||
else
|
||||
data["info"] = "No virus detected."
|
||||
else
|
||||
if(dish)
|
||||
dat = "Virus dish inserted."
|
||||
data["info"] = "No dish loaded."
|
||||
|
||||
dat += "<BR>Current DNA strand : "
|
||||
if(memorybank)
|
||||
dat += "<A href='?src=\ref[src];splice=1'>"
|
||||
if(analysed)
|
||||
dat += "[memorybank.effect.name] ([5-memorybank.effect.stage])"
|
||||
else
|
||||
dat += "Unknown DNA strand ([5-memorybank.effect.stage])"
|
||||
dat += "</a>"
|
||||
|
||||
dat += "<BR><A href='?src=\ref[src];disk=1'>Burn DNA Sequence to data storage disk</a>"
|
||||
else
|
||||
dat += "Empty."
|
||||
|
||||
dat += "<BR><BR>"
|
||||
|
||||
if(dish)
|
||||
if(dish.virus2)
|
||||
if(dish.growth >= 50)
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
dat += "<BR><A href='?src=\ref[src];grab=\ref[e]'> DNA strand"
|
||||
if(dish.analysed)
|
||||
dat += ": [e.effect.name]"
|
||||
dat += " (5-[e.effect.stage])</a>"
|
||||
else
|
||||
dat += "<BR>Insufficent cells to attempt gene splicing."
|
||||
else
|
||||
dat += "<BR>No virus found in dish."
|
||||
|
||||
dat += "<BR><BR><A href='?src=\ref[src];eject=1'>Eject disk</a>"
|
||||
else
|
||||
dat += "<BR>Please insert dish."
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "disease_splicer.tmpl", src.name, 400, 600)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
//use_power(500)
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(!scanning)
|
||||
state("The [src.name] beeps", "blue")
|
||||
ping("\The [src] pings, \"Analysis complete.\"")
|
||||
nanomanager.update_uis(src)
|
||||
if(splicing)
|
||||
splicing -= 1
|
||||
if(!splicing)
|
||||
state("The [src.name] pings", "blue")
|
||||
ping("\The [src] pings, \"Splicing operation complete.\"")
|
||||
nanomanager.update_uis(src)
|
||||
if(burning)
|
||||
burning -= 1
|
||||
if(!burning)
|
||||
var/obj/item/weapon/diseasedisk/d = new /obj/item/weapon/diseasedisk(src.loc)
|
||||
d.analysed = analysed
|
||||
if(analysed)
|
||||
d.name = "[memorybank.effect.name] GNA disk (Stage: [5-memorybank.effect.stage])"
|
||||
if (memorybank)
|
||||
d.name = "[memorybank.effect.name] GNA disk (Stage: [memorybank.effect.stage])"
|
||||
d.effect = memorybank
|
||||
else if (species_buffer)
|
||||
d.name = "[list2text(species_buffer, ", ")] GNA disk"
|
||||
d.species = species_buffer
|
||||
else
|
||||
d.name = "Unknown GNA disk (Stage: [5-memorybank.effect.stage])"
|
||||
d.effect = memorybank
|
||||
state("The [src.name] zings", "blue")
|
||||
if (memorybank)
|
||||
d.name = "Unknown GNA disk (Stage: [memorybank.effect.stage])"
|
||||
d.effect = memorybank
|
||||
else if (species_buffer)
|
||||
d.name = "Unknown Species GNA disk"
|
||||
d.species = species_buffer
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
ping("\The [src] pings, \"Backup disk saved.\"")
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(..()) return 0
|
||||
|
||||
if(usr) usr.set_machine(src)
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
||||
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if (href_list["close"])
|
||||
user.unset_machine()
|
||||
ui.close()
|
||||
return 0
|
||||
|
||||
if (href_list["grab"])
|
||||
memorybank = locate(href_list["grab"])
|
||||
analysed = dish.analysed
|
||||
del(dish)
|
||||
dish = null
|
||||
scanning = 10
|
||||
if (dish)
|
||||
memorybank = locate(href_list["grab"])
|
||||
species_buffer = null
|
||||
analysed = dish.analysed
|
||||
dish = null
|
||||
scanning = 10
|
||||
return 1
|
||||
|
||||
else if(href_list["eject"])
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
if (href_list["affected_species"])
|
||||
if (dish)
|
||||
memorybank = null
|
||||
species_buffer = dish.virus2.affected_species
|
||||
analysed = dish.analysed
|
||||
dish = null
|
||||
scanning = 10
|
||||
return 1
|
||||
|
||||
else if(href_list["splice"])
|
||||
if(href_list["eject"])
|
||||
if (dish)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
return 1
|
||||
|
||||
if(href_list["splice"])
|
||||
if(dish)
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
if(e.stage == memorybank.stage)
|
||||
e.effect = memorybank.effect
|
||||
if (memorybank)
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
if(e.stage == memorybank.stage)
|
||||
e.effect = memorybank.effect
|
||||
|
||||
if (species_buffer)
|
||||
dish.virus2.affected_species = species_buffer
|
||||
|
||||
splicing = 10
|
||||
dish.virus2.uniqueID = rand(0,10000)
|
||||
// dish.virus2.spreadtype = "Blood"
|
||||
return 1
|
||||
|
||||
else if(href_list["disk"])
|
||||
if(href_list["disk"])
|
||||
burning = 10
|
||||
return 1
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
return 0
|
||||
|
||||
@@ -14,120 +14,79 @@
|
||||
var/foodsupply = 0
|
||||
var/toxins = 0
|
||||
|
||||
var/virusing
|
||||
/obj/machinery/disease2/incubator/attackby(var/obj/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/glass) || istype(O,/obj/item/weapon/reagent_containers/syringe))
|
||||
|
||||
/obj/machinery/disease2/incubator/attackby(var/obj/B as obj, var/mob/user as mob)
|
||||
if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
|
||||
if(src.beaker)
|
||||
if(istype(beaker,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "A syringe is already loaded into the machine."
|
||||
else
|
||||
user << "A beaker is already loaded into the machine."
|
||||
if(beaker)
|
||||
user << "\The [src] is already loaded."
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
beaker = O
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "You add the syringe to the machine!"
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
user << "You add the beaker to the machine!"
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
if(istype(B,/obj/item/weapon/virusdish))
|
||||
if(src.dish)
|
||||
user << "A dish is already loaded into the machine."
|
||||
return
|
||||
O.loc = src
|
||||
|
||||
src.dish = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/virusdish))
|
||||
user << "You add the dish to the machine!"
|
||||
src.updateUsrDialog()
|
||||
user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!")
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
/obj/machinery/disease2/incubator/Topic(href, href_list)
|
||||
if(..()) return
|
||||
|
||||
if(usr) usr.set_machine(src)
|
||||
|
||||
if (href_list["ejectchem"])
|
||||
if(beaker)
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
if(!dish)
|
||||
src.attack_hand(user)
|
||||
return
|
||||
if (href_list["power"])
|
||||
on = !on
|
||||
if(on)
|
||||
icon_state = "incubator_on"
|
||||
else
|
||||
icon_state = "incubator"
|
||||
if (href_list["ejectdish"])
|
||||
|
||||
if(istype(O, /obj/item/weapon/virusdish))
|
||||
|
||||
if(dish)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
if (href_list["rad"])
|
||||
radiation += 10
|
||||
if (href_list["flush"])
|
||||
radiation = 0
|
||||
toxins = 0
|
||||
foodsupply = 0
|
||||
user << "The dish tray is aleady full!"
|
||||
return
|
||||
|
||||
if(href_list["virus"])
|
||||
if (!dish)
|
||||
state("\The [src.name] buzzes, \"No viral culture sample detected.\"", "blue")
|
||||
else
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in beaker.reagents.reagent_list
|
||||
if (!B)
|
||||
state("\The [src.name] buzzes, \"No suitable breeding enviroment detected.\"", "blue")
|
||||
else
|
||||
if (!B.data["virus2"])
|
||||
B.data["virus2"] = list()
|
||||
var/list/virus = list("[dish.virus2.uniqueID]" = dish.virus2.getcopy())
|
||||
B.data["virus2"] = virus
|
||||
dish = O
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
|
||||
state("\The [src.name] pings, \"Injection complete.\"", "blue")
|
||||
user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!")
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/disease2/incubator/attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/disease2/incubator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
user.set_machine(src)
|
||||
var/dat = ""
|
||||
if(!dish)
|
||||
dat = "Please insert dish into the incubator.<BR>"
|
||||
var/string = "Off"
|
||||
if(on)
|
||||
string = "On"
|
||||
dat += "Power status : <A href='?src=\ref[src];power=1'>[string]</a>"
|
||||
dat += "<BR>"
|
||||
dat += "Food supply : [foodsupply]"
|
||||
dat += "<BR>"
|
||||
dat += "Radiation Levels : [radiation] RADS : <A href='?src=\ref[src];rad=1'>Radiate</a>"
|
||||
dat += "<BR>"
|
||||
dat += "Toxins : [toxins]"
|
||||
dat += "<BR><BR>"
|
||||
if(beaker)
|
||||
dat += "Eject chemicals : <A href='?src=\ref[src];ejectchem=1'> Eject</a>"
|
||||
dat += "<BR>"
|
||||
if(dish)
|
||||
dat += "Eject Virus dish : <A href='?src=\ref[src];ejectdish=1'> Eject</a>"
|
||||
dat += "<BR>"
|
||||
if(beaker)
|
||||
dat += "Breed viral culture in beaker : <A href='?src=\ref[src];virus=1'> Start</a>"
|
||||
dat += "<BR>"
|
||||
dat += "<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];flush=1'>Flush system</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse("<TITLE>Pathogenic incubator</TITLE>incubator menu:<BR><BR>[dat]", "window=incubator;size=575x400")
|
||||
onclose(user, "incubator")
|
||||
return
|
||||
|
||||
var/data[0]
|
||||
data["chemicals_inserted"] = !!beaker
|
||||
data["dish_inserted"] = !!dish
|
||||
data["food_supply"] = foodsupply
|
||||
data["radiation"] = radiation
|
||||
data["toxins"] = min(toxins, 100)
|
||||
data["on"] = on
|
||||
data["system_in_use"] = foodsupply > 0 || radiation > 0 || toxins > 0
|
||||
data["chemical_volume"] = beaker ? beaker.reagents.total_volume : 0
|
||||
data["max_chemical_volume"] = beaker ? beaker.volume : 1
|
||||
data["virus"] = dish ? dish.virus2 : null
|
||||
data["growth"] = dish ? min(dish.growth, 100) : 0
|
||||
data["infection_rate"] = dish && dish.virus2 ? dish.virus2.infectionchance * 10 : 0
|
||||
data["analysed"] = dish && dish.analysed ? 1 : 0
|
||||
data["can_breed_virus"] = null
|
||||
data["blood_already_infected"] = null
|
||||
|
||||
if (beaker)
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in beaker.reagents.reagent_list
|
||||
data["can_breed_virus"] = dish && dish.virus2 && B
|
||||
|
||||
if (B)
|
||||
if (!B.data["virus2"])
|
||||
B.data["virus2"] = list()
|
||||
|
||||
var/list/virus = B.data["virus2"]
|
||||
for (var/ID in virus)
|
||||
data["blood_already_infected"] = virus[ID]
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "dish_incubator.tmpl", src.name, 400, 600)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/disease2/incubator/process()
|
||||
if(dish && on && dish.virus2)
|
||||
@@ -135,34 +94,105 @@
|
||||
if(!powered(EQUIP))
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
|
||||
if(foodsupply)
|
||||
if(dish.growth + 3 >= 100 && dish.growth < 100)
|
||||
ping("\The [src] pings, \"Sufficient viral growth density achieved.\"")
|
||||
|
||||
foodsupply -= 1
|
||||
dish.growth += 3
|
||||
if(dish.growth >= 100)
|
||||
state("The [src.name] pings", "blue")
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
if(radiation)
|
||||
if(radiation > 50 & prob(5))
|
||||
dish.virus2.majormutate()
|
||||
if(dish.info)
|
||||
dish.info = "OUTDATED : [dish.info]"
|
||||
dish.analysed = 0
|
||||
state("The [src.name] beeps", "blue")
|
||||
|
||||
ping("\The [src] pings, \"Mutant viral strain detected.\"")
|
||||
else if(prob(5))
|
||||
dish.virus2.minormutate()
|
||||
radiation -= 1
|
||||
nanomanager.update_uis(src)
|
||||
if(toxins && prob(5))
|
||||
dish.virus2.infectionchance -= 1
|
||||
nanomanager.update_uis(src)
|
||||
if(toxins > 50)
|
||||
dish.growth = 0
|
||||
dish.virus2 = null
|
||||
nanomanager.update_uis(src)
|
||||
else if(!dish)
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
if(beaker)
|
||||
if(!beaker.reagents.remove_reagent("virusfood",5))
|
||||
foodsupply += 10
|
||||
if(!beaker.reagents.remove_reagent("toxin",1))
|
||||
toxins += 1
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
src.updateUsrDialog()
|
||||
if (locate(/datum/reagent/toxin) in beaker.reagents.reagent_list)
|
||||
for(var/datum/reagent/toxin/T in beaker.reagents.reagent_list)
|
||||
//toxins += max(T.toxpwr,1)
|
||||
beaker.reagents.remove_reagent(T.id,1)
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
/obj/machinery/disease2/incubator/Topic(href, href_list)
|
||||
if (..()) return 0
|
||||
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
||||
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if (href_list["close"])
|
||||
user.unset_machine()
|
||||
ui.close()
|
||||
return 0
|
||||
|
||||
if (href_list["ejectchem"])
|
||||
if(beaker)
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
return 1
|
||||
|
||||
if (href_list["power"])
|
||||
if (dish)
|
||||
on = !on
|
||||
icon_state = on ? "incubator_on" : "incubator"
|
||||
return 1
|
||||
|
||||
if (href_list["ejectdish"])
|
||||
if(dish)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
return 1
|
||||
|
||||
if (href_list["rad"])
|
||||
radiation += 10
|
||||
return 1
|
||||
|
||||
if (href_list["flush"])
|
||||
radiation = 0
|
||||
toxins = 0
|
||||
foodsupply = 0
|
||||
return 1
|
||||
|
||||
if(href_list["virus"])
|
||||
if (!dish)
|
||||
return 1
|
||||
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in beaker.reagents.reagent_list
|
||||
if (!B)
|
||||
return 1
|
||||
|
||||
if (!B.data["virus2"])
|
||||
B.data["virus2"] = list()
|
||||
|
||||
var/list/virus = list("[dish.virus2.uniqueID]" = dish.virus2.getcopy())
|
||||
B.data["virus2"] += virus
|
||||
|
||||
ping("\The [src] pings, \"Injection complete.\"")
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
+218
-87
@@ -1,102 +1,233 @@
|
||||
// UI menu navigation
|
||||
#define HOME "home"
|
||||
#define LIST "list"
|
||||
#define ENTRY "entry"
|
||||
|
||||
/obj/machinery/disease2/isolator/
|
||||
name = "Pathogenic Isolator"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "isolator"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/isolating = 0
|
||||
var/beaker = null
|
||||
var/state = HOME
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/datum/data/record/entry = null
|
||||
var/obj/item/weapon/reagent_containers/syringe/sample = null
|
||||
|
||||
/obj/machinery/disease2/isolator/attackby(var/W as obj, var/mob/user)
|
||||
if(!istype(W,/obj/item/weapon/reagent_containers/syringe))
|
||||
return
|
||||
|
||||
var/obj/item/weapon/reagent_containers/syringe/B = W
|
||||
|
||||
if(src.beaker)
|
||||
user << "A syringe is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "You add the syringe to the machine!"
|
||||
src.updateUsrDialog()
|
||||
icon_state = "isolator_in"
|
||||
|
||||
/obj/machinery/disease2/isolator/Topic(href, href_list)
|
||||
if(..()) return
|
||||
|
||||
usr.machine = src
|
||||
if(!beaker) return
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
|
||||
if (href_list["isolate"])
|
||||
var/datum/reagent/blood/Blood
|
||||
for(var/datum/reagent/blood/B in R.reagent_list)
|
||||
if(B)
|
||||
Blood = B
|
||||
break
|
||||
// /vg/: Try to fix isolators
|
||||
if(!Blood)
|
||||
usr << "\red ERROR: Unable to locate blood within the beaker. Bug?"
|
||||
testing("Unable to locate blood in [beaker]!")
|
||||
return
|
||||
var/list/virus = virus_copylist(Blood.data["virus2"])
|
||||
var/choice = text2num(href_list["isolate"]);
|
||||
for (var/datum/disease2/disease/V in virus)
|
||||
if (V.uniqueID == choice)
|
||||
virus2 = virus
|
||||
isolating = 40
|
||||
icon_state = "isolator_processing"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
else if (href_list["main"])
|
||||
attack_hand(usr)
|
||||
return
|
||||
else if (href_list["eject"])
|
||||
beaker:loc = src.loc
|
||||
beaker = null
|
||||
/obj/machinery/disease2/isolator/update_icon()
|
||||
if (stat & (BROKEN|NOPOWER))
|
||||
icon_state = "isolator"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
if (isolating)
|
||||
icon_state = "isolator_processing"
|
||||
else if (sample)
|
||||
icon_state = "isolator_in"
|
||||
else
|
||||
icon_state = "isolator"
|
||||
|
||||
/obj/machinery/disease2/isolator/attackby(var/obj/O as obj, var/mob/user)
|
||||
if(!istype(O,/obj/item/weapon/reagent_containers/syringe)) return
|
||||
var/obj/item/weapon/reagent_containers/syringe/S = O
|
||||
|
||||
if(sample)
|
||||
user << "\The [src] is already loaded."
|
||||
return
|
||||
|
||||
sample = S
|
||||
user.drop_item()
|
||||
S.loc = src
|
||||
|
||||
user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!")
|
||||
nanomanager.update_uis(src)
|
||||
update_icon()
|
||||
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/disease2/isolator/attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
if(!beaker)
|
||||
dat = "Please insert sample into the isolator.<BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A>"
|
||||
else if(isolating)
|
||||
dat = "Isolating"
|
||||
else
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
dat += "<A href='?src=\ref[src];eject=1'>Eject</A><BR><BR>"
|
||||
if(!R.total_volume)
|
||||
dat += "[beaker] is empty."
|
||||
else
|
||||
dat += "Contained reagents:<BR>"
|
||||
for(var/datum/reagent/blood/G in R.reagent_list)
|
||||
if(G.data["virus2"])
|
||||
var/list/virus = G.data["virus2"]
|
||||
for (var/datum/disease2/disease/V in virus)
|
||||
dat += " <br> [G.name]: <A href='?src=\ref[src];isolate=[V.uniqueID]'>Isolate pathogen #[V.uniqueID]</a>"
|
||||
else
|
||||
dat += " <b>No pathogen</b>"
|
||||
user << browse("<TITLE>Pathogenic Isolator</TITLE>Isolator menu:<BR><BR>[dat]", "window=isolator;size=575x400")
|
||||
onclose(user, "isolator")
|
||||
return
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/disease2/isolator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
data["syringe_inserted"] = !!sample
|
||||
data["isolating"] = isolating
|
||||
data["pathogen_pool"] = null
|
||||
data["state"] = state
|
||||
data["entry"] = entry
|
||||
data["can_print"] = (state != HOME || sample) && !isolating
|
||||
|
||||
switch (state)
|
||||
if (HOME)
|
||||
if (sample)
|
||||
var/list/pathogen_pool[0]
|
||||
for(var/datum/reagent/blood/B in sample.reagents.reagent_list)
|
||||
var/list/virus = B.data["virus2"]
|
||||
for (var/ID in virus)
|
||||
var/datum/disease2/disease/V = virus[ID]
|
||||
var/datum/data/record/R = null
|
||||
if (ID in virusDB)
|
||||
R = virusDB[ID]
|
||||
|
||||
var/mob/living/carbon/human/D = B.data["donor"]
|
||||
pathogen_pool.Add(list(list(\
|
||||
"name" = "[D.get_species()] [B.name]", \
|
||||
"dna" = B.data["blood_DNA"], \
|
||||
"unique_id" = V.uniqueID, \
|
||||
"reference" = "\ref[V]", \
|
||||
"is_in_database" = !!R, \
|
||||
"record" = "\ref[R]")))
|
||||
|
||||
if (pathogen_pool.len > 0)
|
||||
data["pathogen_pool"] = pathogen_pool
|
||||
|
||||
if (LIST)
|
||||
var/list/db[0]
|
||||
for (var/ID in virusDB)
|
||||
var/datum/data/record/r = virusDB[ID]
|
||||
db.Add(list(list("name" = r.fields["name"], "record" = "\ref[r]")))
|
||||
|
||||
if (db.len > 0)
|
||||
data["database"] = db
|
||||
|
||||
if (ENTRY)
|
||||
if (entry)
|
||||
var/desc = entry.fields["description"]
|
||||
data["entry"] = list(\
|
||||
"name" = entry.fields["name"], \
|
||||
"description" = replacetext(desc, "\n", ""))
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "pathogenic_isolator.tmpl", src.name, 400, 500)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/disease2/isolator/process()
|
||||
if(isolating > 0)
|
||||
if (isolating > 0)
|
||||
isolating -= 1
|
||||
if(isolating == 0)
|
||||
var/obj/item/weapon/virusdish/d = new /obj/item/weapon/virusdish(src.loc)
|
||||
d.virus2 = virus2.getcopy()
|
||||
virus2 = null
|
||||
icon_state = "isolator_in"
|
||||
if (isolating == 0)
|
||||
if (virus2)
|
||||
var/obj/item/weapon/virusdish/d = new /obj/item/weapon/virusdish(src.loc)
|
||||
d.virus2 = virus2.getcopy()
|
||||
virus2 = null
|
||||
ping("\The [src] pings, \"Viral strain isolated.\"")
|
||||
|
||||
nanomanager.update_uis(src)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/disease2/isolator/Topic(href, href_list)
|
||||
if (..()) return 0
|
||||
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
||||
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if (href_list["close"])
|
||||
user.unset_machine()
|
||||
ui.close()
|
||||
return 0
|
||||
|
||||
if (href_list[HOME])
|
||||
state = HOME
|
||||
return 1
|
||||
|
||||
if (href_list[LIST])
|
||||
state = LIST
|
||||
return 1
|
||||
|
||||
if (href_list[ENTRY])
|
||||
if (istype(locate(href_list["view"]), /datum/data/record))
|
||||
entry = locate(href_list["view"])
|
||||
|
||||
state = ENTRY
|
||||
return 1
|
||||
|
||||
if (href_list["print"])
|
||||
print(user)
|
||||
return 1
|
||||
|
||||
if(!sample) return 1
|
||||
|
||||
if (href_list["isolate"])
|
||||
var/datum/disease2/disease/V = locate(href_list["isolate"])
|
||||
if (V)
|
||||
virus2 = V
|
||||
isolating = 20
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
if (href_list["eject"])
|
||||
sample.loc = src.loc
|
||||
sample = null
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/machinery/disease2/isolator/proc/print(var/mob/user)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
|
||||
|
||||
switch (state)
|
||||
if (HOME)
|
||||
if (!sample) return
|
||||
P.name = "paper - Patient Diagnostic Report"
|
||||
P.info = {"
|
||||
[virology_letterhead("Patient Diagnostic Report")]
|
||||
<center><small><font color='red'><b>CONFIDENTIAL MEDICAL REPORT</b></font></small></center><br>
|
||||
<large><u>Sample:</u></large> [sample.name]<br>
|
||||
"}
|
||||
|
||||
if (user)
|
||||
P.info += "<u>Generated By:</u> [user.name]<br>"
|
||||
|
||||
P.info += "<hr>"
|
||||
|
||||
for(var/datum/reagent/blood/B in sample.reagents.reagent_list)
|
||||
var/mob/living/carbon/human/D = B.data["donor"]
|
||||
P.info += "<large><u>[D.get_species()] [B.name]:</u></large><br>[B.data["blood_DNA"]]<br>"
|
||||
|
||||
var/list/virus = B.data["virus2"]
|
||||
P.info += "<u>Pathogens:</u> <br>"
|
||||
if (virus.len > 0)
|
||||
for (var/ID in virus)
|
||||
var/datum/disease2/disease/V = virus[ID]
|
||||
P.info += "[V.name()]<br>"
|
||||
else
|
||||
P.info += "None<br>"
|
||||
|
||||
P.info += {"
|
||||
<hr>
|
||||
<u>Additional Notes:</u>
|
||||
"}
|
||||
|
||||
if (LIST)
|
||||
P.name = "paper - Virus List"
|
||||
P.info = {"
|
||||
[virology_letterhead("Virus List")]
|
||||
"}
|
||||
|
||||
var/i = 0
|
||||
for (var/ID in virusDB)
|
||||
i++
|
||||
var/datum/data/record/r = virusDB[ID]
|
||||
P.info += "[i]. " + r.fields["name"]
|
||||
P.info += "<br>"
|
||||
|
||||
P.info += {"
|
||||
<hr>
|
||||
<u>Additional Notes:</u>
|
||||
"}
|
||||
|
||||
if (ENTRY)
|
||||
P.name = "paper - Viral Profile"
|
||||
P.info = {"
|
||||
[virology_letterhead("Viral Profile")]
|
||||
[entry.fields["description"]]
|
||||
<hr>
|
||||
<u>Additional Notes:</u>
|
||||
"}
|
||||
|
||||
state("The nearby computer prints out a report.")
|
||||
|
||||
@@ -1,33 +1,42 @@
|
||||
/obj/machinery/proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] <span class = 'notice'>[msg]</span>", 2)
|
||||
|
||||
///////////////ANTIBODY SCANNER///////////////
|
||||
|
||||
/obj/item/device/antibody_scanner
|
||||
name = "Antibody Scanner"
|
||||
desc = "Used to scan living beings for antibodies in their blood."
|
||||
name = "\improper Antibody Scanner"
|
||||
desc = "Scans living beings for antibodies in their blood."
|
||||
icon_state = "health"
|
||||
w_class = 2.0
|
||||
item_state = "electronic"
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
|
||||
/obj/item/device/antibody_scanner/attack(mob/M as mob, mob/user as mob)
|
||||
if(!istype(M,/mob/living/carbon/))
|
||||
report("Scan aborted: Incompatible target.", user)
|
||||
return
|
||||
|
||||
/obj/item/device/antibody_scanner/attack(mob/living/carbon/M as mob, mob/user as mob)
|
||||
if(!istype(M))
|
||||
user << "<span class='notice'>Incompatible object, scan aborted.</span>"
|
||||
return
|
||||
var/mob/living/carbon/C = M
|
||||
if (istype(C,/mob/living/carbon/human/))
|
||||
var/mob/living/carbon/human/H = C
|
||||
if(H.species && H.species.flags & NO_BLOOD)
|
||||
report("Scan aborted: The target does not have blood.", user)
|
||||
return
|
||||
|
||||
if(!C.antibodies)
|
||||
user << "<span class='notice'>Unable to detect antibodies.</span>"
|
||||
report("Scan Complete: No antibodies detected.", user)
|
||||
return
|
||||
var/code = antigens2string(M.antibodies)
|
||||
user << "<span class='notice'>[src] The antibody scanner displays a cryptic set of data: [code]</span>"
|
||||
|
||||
if (M_CLUMSY in user.mutations && prob(50))
|
||||
// I was tempted to be really evil and rot13 the output.
|
||||
report("Antibodies detected: [reverse_text(antigens2string(C.antibodies))]", user)
|
||||
else
|
||||
report("Antibodies detected: [antigens2string(C.antibodies)]", user)
|
||||
|
||||
/obj/item/device/antibody_scanner/proc/report(var/text, mob/user as mob)
|
||||
user << "\blue \icon[src] \The [src] beeps, \"[text]\""
|
||||
|
||||
///////////////VIRUS DISH///////////////
|
||||
|
||||
/obj/item/weapon/virusdish
|
||||
name = "Virus containment/growth dish"
|
||||
name = "virus containment/growth dish"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "implantcase-b"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
@@ -35,10 +44,8 @@
|
||||
var/info = 0
|
||||
var/analysed = 0
|
||||
|
||||
reagents = list()
|
||||
|
||||
/obj/item/weapon/virusdish/random
|
||||
name = "Virus Sample"
|
||||
name = "virus sample"
|
||||
|
||||
/obj/item/weapon/virusdish/random/New()
|
||||
..()
|
||||
@@ -51,7 +58,7 @@
|
||||
return
|
||||
..()
|
||||
if(prob(50))
|
||||
user << "The dish shatters"
|
||||
user << "\The [src] shatters!"
|
||||
if(virus2.infectionchance > 0)
|
||||
for(var/mob/living/carbon/target in view(1, get_turf(src)))
|
||||
if(airborne_can_reach(get_turf(src), get_turf(target)))
|
||||
@@ -60,22 +67,38 @@
|
||||
del src
|
||||
|
||||
/obj/item/weapon/virusdish/examine()
|
||||
usr << "This is a virus containment dish"
|
||||
usr << "This is a virus containment dish."
|
||||
if(src.info)
|
||||
usr << "It has the following information about its contents"
|
||||
usr << "It has the following information about its contents:"
|
||||
usr << src.info
|
||||
|
||||
/obj/item/weapon/ruinedvirusdish
|
||||
name = "ruined virus sample"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "implantcase-b"
|
||||
desc = "The bacteria in the dish are completely dead."
|
||||
|
||||
/obj/item/weapon/ruinedvirusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob)
|
||||
if(istype(W,/obj/item/weapon/hand_labeler) || istype(W,/obj/item/weapon/reagent_containers/syringe))
|
||||
return ..()
|
||||
|
||||
if(prob(50))
|
||||
user << "\The [src] shatters!"
|
||||
del src
|
||||
|
||||
///////////////GNA DISK///////////////
|
||||
|
||||
/obj/item/weapon/diseasedisk
|
||||
name = "Blank GNA disk"
|
||||
name = "blank GNA disk"
|
||||
icon = 'icons/obj/cloning.dmi'
|
||||
icon_state = "datadisk0"
|
||||
var/datum/disease2/effectholder/effect = null
|
||||
var/list/species = null
|
||||
var/stage = 1
|
||||
var/analysed = 1
|
||||
|
||||
/obj/item/weapon/diseasedisk/premade/New()
|
||||
name = "Blank GNA disk (stage: [5-stage])"
|
||||
name = "blank GNA disk (stage: [stage])"
|
||||
effect = new /datum/disease2/effectholder
|
||||
effect.effect = new /datum/disease2/effect/invisible
|
||||
effect.stage = stage
|
||||
effect.stage = stage
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
/obj/machinery/disease2/diseaseanalyser
|
||||
name = "Disease Analyser"
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "analyser"
|
||||
anchored = 1
|
||||
density = 1
|
||||
|
||||
var/scanning = 0
|
||||
var/pause = 0
|
||||
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
|
||||
/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\blue [user.name] inserts the [dish.name] in the [src.name]", 3)
|
||||
|
||||
|
||||
else
|
||||
user << "There is already a dish inserted"
|
||||
|
||||
//else
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/disease2/diseaseanalyser/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
src.updateDialog()
|
||||
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(scanning == 0)
|
||||
var/r = "GNAv2 based virus lifeform"
|
||||
r += "<BR>Infection rate : [dish.virus2.infectionchance * 10]"
|
||||
r += "<BR>Spread form : [dish.virus2.spreadtype]"
|
||||
r += "<BR>Progress Speed : [dish.virus2.stageprob * 10]"
|
||||
for(var/datum/disease2/effectholder/E in dish.virus2.effects)
|
||||
r += "<BR>Effect:[E.effect.name]. Strength : [E.multiplier * 8]. Verosity : [E.chance * 15]. Type : [5-E.stage]."
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.loc)
|
||||
P.info = r
|
||||
dish.info = r
|
||||
dish.analysed = 1
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
icon_state = "analyser"
|
||||
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue The [src.name] prints a sheet of paper", 3)
|
||||
else if(dish && !scanning && !pause)
|
||||
if(dish.virus2 && dish.growth > 50)
|
||||
dish.growth -= 10
|
||||
scanning = 25
|
||||
icon_state = "analyser_processing"
|
||||
else
|
||||
pause = 1
|
||||
spawn(25)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\icon[src] \blue The [src.name] buzzes", 2)
|
||||
pause = 0
|
||||
|
||||
|
||||
|
||||
return
|
||||
@@ -1,331 +0,0 @@
|
||||
//To simplify, all diseases have 4 stages, with effects starting at stage 2
|
||||
//Stage 1 = Rest,Minor disease
|
||||
//Stage 2 = Minimal effect
|
||||
//Stage 3 = Medium effect
|
||||
//Stage 4 = Death/Really Really really bad effect
|
||||
|
||||
|
||||
/proc/infect_virus2(var/mob/living/carbon/M,var/datum/disease2/disease/disease,var/forced = 0)
|
||||
if(prob(disease.infectionchance))
|
||||
if(M.virus2)
|
||||
return
|
||||
else
|
||||
var/score = 0
|
||||
if(!forced)
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
if(M:gloves)
|
||||
score += 5
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/space)) score += 10
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/bio_suit)) score += 10
|
||||
if(istype(M:head, /obj/item/clothing/head/helmet/space)) score += 5
|
||||
if(istype(M:head, /obj/item/clothing/head/bio_hood)) score += 5
|
||||
if(M.wear_mask)
|
||||
score += 5
|
||||
if((istype(M:wear_mask, /obj/item/clothing/mask) || istype(M:wear_mask, /obj/item/clothing/mask/surgical)) && !M.internal)
|
||||
score += 5
|
||||
if(M.internal)
|
||||
score += 5
|
||||
|
||||
if(score > 15)
|
||||
return
|
||||
// else if(score == 20 && prob(95))
|
||||
// return
|
||||
else if(score == 15 && prob(75))
|
||||
return
|
||||
else if(score == 10 && prob(55))
|
||||
return
|
||||
else if(score == 5 && prob(35))
|
||||
return
|
||||
|
||||
M.virus2 = disease.getcopy()
|
||||
M.virus2.minormutate()
|
||||
|
||||
for(var/datum/disease2/resistance/res in M.resistances)
|
||||
if(res.resistsdisease(M.virus2))
|
||||
M.virus2 = null
|
||||
|
||||
|
||||
|
||||
/datum/disease2/resistance
|
||||
var/list/datum/disease2/effect/resistances = list()
|
||||
|
||||
proc/resistsdisease(var/datum/disease2/disease/virus2)
|
||||
var/list/res2 = list()
|
||||
for(var/datum/disease2/effect/e in resistances)
|
||||
res2 += e.type
|
||||
for(var/datum/disease2/effectholder/holder in virus2)
|
||||
if(!(holder.effect.type in res2))
|
||||
return 0
|
||||
else
|
||||
res2 -= holder.effect.type
|
||||
if(res2.len > 0)
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
||||
New(var/datum/disease2/disease/virus2)
|
||||
for(var/datum/disease2/effectholder/h in virus2.effects)
|
||||
resistances += h.effect.type
|
||||
|
||||
|
||||
/proc/infect_mob_random(var/mob/living/carbon/M)
|
||||
if(!M.virus2)
|
||||
M.virus2 = new /datum/disease2/disease
|
||||
M.virus2.makerandom()
|
||||
|
||||
/datum/disease2/disease
|
||||
var/infectionchance = 10
|
||||
var/spreadtype = "Blood" // Can also be "Airborne"
|
||||
var/stage = 1
|
||||
var/stageprob = 2
|
||||
var/dead = 0
|
||||
var/clicks = 0
|
||||
|
||||
var/uniqueID = 0
|
||||
var/list/datum/disease2/effectholder/effects = list()
|
||||
proc/makerandom()
|
||||
var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder
|
||||
holder.stage = 1
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
holder = new /datum/disease2/effectholder
|
||||
holder.stage = 2
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
holder = new /datum/disease2/effectholder
|
||||
holder.stage = 3
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
holder = new /datum/disease2/effectholder
|
||||
holder.stage = 4
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
uniqueID = rand(0,10000)
|
||||
infectionchance = rand(1,10)
|
||||
spreadtype = "Airborne"
|
||||
proc/minormutate()
|
||||
var/datum/disease2/effectholder/holder = pick(effects)
|
||||
holder.minormutate()
|
||||
infectionchance = min(10,infectionchance + rand(0,1))
|
||||
proc/issame(var/datum/disease2/disease/disease)
|
||||
var/list/types = list()
|
||||
var/list/types2 = list()
|
||||
for(var/datum/disease2/effectholder/d in effects)
|
||||
types += d.effect.type
|
||||
var/equal = 1
|
||||
|
||||
for(var/datum/disease2/effectholder/d in disease.effects)
|
||||
types2 += d.effect.type
|
||||
|
||||
for(var/type in types)
|
||||
if(!(type in types2))
|
||||
equal = 0
|
||||
return equal
|
||||
|
||||
proc/activate(var/mob/living/carbon/mob)
|
||||
if(dead)
|
||||
mob.virus2 = null
|
||||
return
|
||||
if(mob.stat == 2)
|
||||
return
|
||||
if(mob.radiation > 50)
|
||||
if(prob(1))
|
||||
majormutate()
|
||||
if(mob.reagents.has_reagent("spaceacillin"))
|
||||
return
|
||||
if(prob(stageprob) && prob(25 + (clicks/100)) && stage != 4)
|
||||
stage++
|
||||
clicks = 0
|
||||
for(var/datum/disease2/effectholder/e in effects)
|
||||
e.runeffect(mob,stage)
|
||||
|
||||
proc/cure_added(var/datum/disease2/resistance/res)
|
||||
if(res.resistsdisease(src))
|
||||
dead = 1
|
||||
|
||||
proc/majormutate()
|
||||
var/datum/disease2/effectholder/holder = pick(effects)
|
||||
holder.majormutate()
|
||||
|
||||
|
||||
proc/getcopy()
|
||||
// world << "getting copy"
|
||||
var/datum/disease2/disease/disease = new /datum/disease2/disease
|
||||
disease.infectionchance = infectionchance
|
||||
disease.spreadtype = spreadtype
|
||||
disease.stageprob = stageprob
|
||||
for(var/datum/disease2/effectholder/holder in effects)
|
||||
// world << "adding effects"
|
||||
var/datum/disease2/effectholder/newholder = new /datum/disease2/effectholder
|
||||
newholder.effect = new holder.effect.type
|
||||
newholder.chance = holder.chance
|
||||
newholder.cure = holder.cure
|
||||
newholder.multiplier = holder.multiplier
|
||||
newholder.happensonce = holder.happensonce
|
||||
newholder.stage = holder.stage
|
||||
disease.effects += newholder
|
||||
// world << "[newholder.effect.name]"
|
||||
// world << "[disease]"
|
||||
return disease
|
||||
|
||||
/datum/disease2/effect
|
||||
var/name = "Blanking effect"
|
||||
var/stage = 4
|
||||
var/maxm = 1
|
||||
proc/activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
|
||||
/datum/disease2/effect/gibbingtons
|
||||
name = "Gibbingtons Syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.gib()
|
||||
|
||||
/datum/disease2/effect/radian
|
||||
name = "Radian's syndrome"
|
||||
stage = 4
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.radiation += (2*multiplier)
|
||||
|
||||
/datum/disease2/effect/toxins
|
||||
name = "Hyperacid Syndrome"
|
||||
stage = 3
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.adjustToxLoss(2*multiplier)
|
||||
|
||||
/datum/disease2/effect/scream
|
||||
name = "Random screaming syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*scream")
|
||||
|
||||
/datum/disease2/effect/drowsness
|
||||
name = "Automated sleeping syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.drowsyness += 10
|
||||
|
||||
/datum/disease2/effect/shakey
|
||||
name = "World Shaking syndrome"
|
||||
stage = 3
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
shake_camera(mob,5*multiplier)
|
||||
|
||||
/datum/disease2/effect/deaf
|
||||
name = "Hard of hearing syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.ear_deaf += 20
|
||||
|
||||
/datum/disease2/effect/invisible
|
||||
name = "Waiting Syndrome"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
return
|
||||
/*
|
||||
/datum/disease2/effect/telepathic
|
||||
name = "Telepathy Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.mutations |= 512
|
||||
*/
|
||||
/datum/disease2/effect/noface
|
||||
name = "Identity Loss syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.real_name = "Unknown"
|
||||
|
||||
/datum/disease2/effect/monkey
|
||||
name = "Monkism syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/h = mob
|
||||
h.monkeyize()
|
||||
|
||||
/datum/disease2/effect/sneeze
|
||||
name = "Coldingtons Effect"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*sneeze")
|
||||
|
||||
/datum/disease2/effect/gunck
|
||||
name = "Flemmingtons"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob << "\red Mucous runs down the back of your throat."
|
||||
|
||||
/datum/disease2/effect/killertoxins
|
||||
name = "Toxification syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.adjustToxLoss(15)
|
||||
/*
|
||||
/datum/disease2/effect/hallucinations
|
||||
name = "Hallucinational Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.hallucination += 25
|
||||
*/
|
||||
/datum/disease2/effect/sleepy
|
||||
name = "Resting syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*collapse")
|
||||
|
||||
/datum/disease2/effect/mind
|
||||
name = "Lazy mind syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.setBrainLoss(50)
|
||||
|
||||
/datum/disease2/effect/suicide
|
||||
name = "Suicidal syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.suiciding = 1
|
||||
//instead of killing them instantly, just put them at -175 health and let 'em gasp for a while
|
||||
viewers(mob) << "\red <b>[mob.name] is attempting to bite off \his tongue. It looks like \he's trying to commit suicide.</b>"
|
||||
mob.oxyloss = max(175 - mob.getToxLoss() - mob.getFireLoss() - mob.getBruteLoss(), mob.getOxyLoss())
|
||||
mob.updatehealth()
|
||||
spawn(200) //in case they get revived by cryo chamber or something stupid like that, let them suicide again in 20 seconds
|
||||
mob.suiciding = 0
|
||||
|
||||
/datum/disease2/effectholder
|
||||
var/name = "Holder"
|
||||
var/datum/disease2/effect/effect
|
||||
var/chance = 0 //Chance in percentage each tick
|
||||
var/cure = "" //Type of cure it requires
|
||||
var/happensonce = 0
|
||||
var/multiplier = 1 //The chance the effects are WORSE
|
||||
var/stage = 0
|
||||
|
||||
proc/runeffect(var/mob/living/carbon/human/mob,var/stage)
|
||||
if(happensonce > -1 && effect.stage <= stage && prob(chance))
|
||||
effect.activate(mob)
|
||||
if(happensonce == 1)
|
||||
happensonce = -1
|
||||
|
||||
proc/getrandomeffect()
|
||||
var/list/datum/disease2/effect/list = list()
|
||||
for(var/e in (typesof(/datum/disease2/effect) - /datum/disease2/effect))
|
||||
// world << "Making [e]"
|
||||
var/datum/disease2/effect/f = new e
|
||||
if(f.stage == src.stage)
|
||||
list += f
|
||||
effect = pick(list)
|
||||
chance = rand(1,6)
|
||||
|
||||
proc/minormutate()
|
||||
switch(pick(1,2,3,4,5))
|
||||
if(1)
|
||||
chance = rand(0,100)
|
||||
if(2)
|
||||
multiplier = rand(1,effect.maxm)
|
||||
proc/majormutate()
|
||||
getrandomeffect()
|
||||
|
||||
/proc/dprob(var/p)
|
||||
return(prob(sqrt(p)) && prob(sqrt(p)))
|
||||
@@ -1,20 +0,0 @@
|
||||
/obj/machinery/disease2/biodestroyer
|
||||
name = "Biohazard destroyer"
|
||||
icon = 'icons/obj/pipes/disposal.dmi'
|
||||
icon_state = "disposal"
|
||||
var/list/accepts = list(/obj/item/clothing,/obj/item/weapon/virusdish/,/obj/item/weapon/cureimplanter,/obj/item/weapon/diseasedisk)
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/machinery/disease2/biodestroyer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
for(var/path in accepts)
|
||||
if(I.type in typesof(path))
|
||||
user.drop_item()
|
||||
del(I)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-handle")
|
||||
return
|
||||
user.drop_item()
|
||||
I.loc = src.loc
|
||||
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue The [src.name] beeps", 2)
|
||||
@@ -1,202 +0,0 @@
|
||||
/obj/machinery/computer/diseasesplicer
|
||||
name = "Disease Splicer"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "crew"
|
||||
//brightnessred = 0
|
||||
// brightnessgreen = 2
|
||||
// brightnessblue = 2
|
||||
// broken_icon
|
||||
|
||||
var/datum/disease2/effectholder/memorybank = null
|
||||
var/analysed = 0
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
var/burning = 0
|
||||
|
||||
var/splicing = 0
|
||||
var/scanning = 0
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/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/diseasesplicer/M = new /obj/item/weapon/circuitboard/diseasesplicer( 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/diseasesplicer/M = new /obj/item/weapon/circuitboard/diseasesplicer( 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/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
if(istype(I,/obj/item/weapon/diseasedisk))
|
||||
user << "You upload the contents of the disk into the buffer"
|
||||
memorybank = I:effect
|
||||
|
||||
|
||||
//else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
var/dat
|
||||
if(splicing)
|
||||
dat = "Splicing in progress"
|
||||
else if(scanning)
|
||||
dat = "Splicing in progress"
|
||||
else if(burning)
|
||||
dat = "Data disk burning in progress"
|
||||
else
|
||||
if(dish)
|
||||
dat = "Virus dish inserted"
|
||||
|
||||
dat += "<BR>Current DNA strand : "
|
||||
if(memorybank)
|
||||
dat += "<A href='?src=\ref[src];splice=1'>"
|
||||
if(analysed)
|
||||
dat += "[memorybank.effect.name] ([5-memorybank.effect.stage])"
|
||||
else
|
||||
dat += "Unknown DNA strand ([5-memorybank.effect.stage])"
|
||||
dat += "</a>"
|
||||
|
||||
dat += "<BR><A href='?src=\ref[src];disk=1'>Burn DNA Sequence to data storage disk</a>"
|
||||
else
|
||||
dat += "Empty"
|
||||
|
||||
dat += "<BR><BR>"
|
||||
|
||||
if(dish)
|
||||
if(dish.virus2)
|
||||
if(dish.growth >= 50)
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
dat += "<BR><A href='?src=\ref[src];grab=\ref[e]'> DNA strand"
|
||||
if(dish.analysed)
|
||||
dat += ": [e.effect.name]"
|
||||
dat += " (5-[e.effect.stage])</a>"
|
||||
else
|
||||
dat += "<BR>Insufficent cells to attempt gene splicing"
|
||||
else
|
||||
dat += "<BR>No virus found in dish"
|
||||
|
||||
dat += "<BR><BR><A href='?src=\ref[src];eject=1'>Eject disk</a>"
|
||||
else
|
||||
dat += "<BR>Please insert dish"
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
src.updateDialog()
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(!scanning)
|
||||
state("The [src.name] beeps")
|
||||
icon_state = "crew"
|
||||
if(splicing)
|
||||
splicing -= 1
|
||||
if(!splicing)
|
||||
state("The [src.name] pings")
|
||||
icon_state = "crew"
|
||||
if(burning)
|
||||
burning -= 1
|
||||
if(!burning)
|
||||
var/obj/item/weapon/diseasedisk/d = new /obj/item/weapon/diseasedisk(src.loc)
|
||||
if(analysed)
|
||||
d.name = "[memorybank.effect.name] GNA disk (Stage: [5-memorybank.effect.stage])"
|
||||
else
|
||||
d.name = "Unknown GNA disk (Stage: [5-memorybank.effect.stage])"
|
||||
d.effect = memorybank
|
||||
state("The [src.name] zings")
|
||||
icon_state = "crew"
|
||||
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/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["grab"])
|
||||
memorybank = locate(href_list["grab"])
|
||||
analysed = dish.analysed
|
||||
del(dish)
|
||||
dish = null
|
||||
scanning = 30
|
||||
icon_state = "crew"
|
||||
|
||||
else if(href_list["eject"])
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
|
||||
else if(href_list["splice"])
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
if(e.stage == memorybank.stage)
|
||||
e.effect = memorybank.effect
|
||||
splicing = 50
|
||||
dish.virus2.spreadtype = "Blood"
|
||||
icon_state = "crew"
|
||||
|
||||
else if(href_list["disk"])
|
||||
burning = 20
|
||||
icon_state = "crew"
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue [msg]", 2)
|
||||
|
||||
|
||||
/obj/item/weapon/diseasedisk
|
||||
name = "Blank GNA disk"
|
||||
icon = 'icons/obj/cloning.dmi'
|
||||
icon_state = "datadisk2"
|
||||
var/datum/disease2/effectholder/effect = null
|
||||
var/stage = 1
|
||||
|
||||
/obj/item/weapon/diseasedisk/premade/New()
|
||||
name = "Blank GNA disk (stage: [5-stage])"
|
||||
effect = new /datum/disease2/effectholder
|
||||
effect.effect = new /datum/disease2/effect/invisible
|
||||
effect.stage = stage
|
||||
@@ -1,176 +0,0 @@
|
||||
/obj/machinery/disease2/incubator/
|
||||
name = "Pathogenic incubator"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "incubator"
|
||||
var/obj/item/weapon/virusdish/dish
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/radiation = 0
|
||||
|
||||
var/on = 0
|
||||
var/power = 0
|
||||
|
||||
var/foodsupply = 0
|
||||
var/toxins = 0
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
|
||||
blob_act()
|
||||
if (prob(25))
|
||||
del(src)
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
attackby(var/obj/B as obj, var/mob/user as mob)
|
||||
if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
|
||||
if(src.beaker)
|
||||
if(istype(beaker,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "A syringe is already loaded into the machine."
|
||||
else
|
||||
user << "A beaker is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "You add the syringe to the machine!"
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
user << "You add the beaker to the machine!"
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
if(istype(B,/obj/item/weapon/virusdish))
|
||||
if(src.dish)
|
||||
user << "A dish is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.dish = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/virusdish))
|
||||
user << "You add the dish to the machine!"
|
||||
src.updateUsrDialog()
|
||||
|
||||
Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.machine = src
|
||||
if(!dish) return
|
||||
|
||||
if (href_list["power"])
|
||||
on = !on
|
||||
if(on)
|
||||
icon_state = "incubator_on"
|
||||
else
|
||||
icon_state = "incubator"
|
||||
if (href_list["ejectchem"])
|
||||
if(beaker)
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
if (href_list["ejectdish"])
|
||||
if(dish)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
if (href_list["rad"])
|
||||
radiation += 10
|
||||
if (href_list["flush"])
|
||||
radiation = 0
|
||||
toxins = 0
|
||||
foodsupply = 0
|
||||
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
if(!dish)
|
||||
dat = "Please insert dish into the incubator.<BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A>"
|
||||
var/string = "Off"
|
||||
if(on)
|
||||
string = "On"
|
||||
dat += "Power status : <A href='?src=\ref[src];power=1'>[string]</a>"
|
||||
dat += "<BR>"
|
||||
dat += "Food supply : [foodsupply]"
|
||||
dat += "<BR>"
|
||||
dat += "Radiation Levels : [radiation] RADS : <A href='?src=\ref[src];rad=1'>Radiate</a>"
|
||||
dat += "<BR>"
|
||||
dat += "Toxins : [toxins]"
|
||||
dat += "<BR><BR>"
|
||||
if(beaker)
|
||||
dat += "Eject chemicals : <A href='?src=\ref[src];ejectchem=1'> Eject</a>"
|
||||
dat += "<BR>"
|
||||
if(dish)
|
||||
dat += "Eject Virus dish : <A href='?src=\ref[src];ejectdish=1'> Eject</a>"
|
||||
dat += "<BR>"
|
||||
dat += "<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];flush=1'>Flush system</a>"
|
||||
|
||||
|
||||
user << browse("<TITLE>Pathogenic incubator</TITLE>incubator menu:<BR><BR>[dat]", "window=incubator;size=575x400")
|
||||
onclose(user, "incubator")
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
process()
|
||||
|
||||
if(dish && on && dish.virus2)
|
||||
use_power(50,EQUIP)
|
||||
if(!powered(EQUIP))
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
if(foodsupply)
|
||||
foodsupply -= 1
|
||||
dish.growth += 1
|
||||
if(dish.growth == 100)
|
||||
state("The [src.name] pings")
|
||||
if(radiation)
|
||||
if(radiation > 50 & prob(5))
|
||||
dish.virus2.majormutate()
|
||||
if(dish.info)
|
||||
dish.info = "OUTDATED : [dish.info]"
|
||||
dish.analysed = 0
|
||||
state("The [src.name] beeps")
|
||||
|
||||
else if(prob(5))
|
||||
dish.virus2.minormutate()
|
||||
radiation -= 1
|
||||
if(toxins && prob(5))
|
||||
dish.virus2.infectionchance -= 1
|
||||
if(toxins > 50)
|
||||
dish.virus2 = null
|
||||
else if(!dish)
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
|
||||
|
||||
if(beaker)
|
||||
if(!beaker.reagents.remove_reagent("virusfood",5))
|
||||
foodsupply += 20
|
||||
if(!beaker.reagents.remove_reagent("toxins",1))
|
||||
toxins += 1
|
||||
|
||||
proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue [msg]", 2)
|
||||
@@ -1,139 +0,0 @@
|
||||
/obj/machinery/disease2/isolator/
|
||||
name = "Pathogenic Isolator"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "isolator"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/isolating = 0
|
||||
var/beaker = null
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
|
||||
blob_act()
|
||||
if (prob(25))
|
||||
del(src)
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
attackby(var/obj/item/weapon/reagent_containers/glass/B as obj, var/mob/user as mob)
|
||||
if(!istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
return
|
||||
|
||||
if(src.beaker)
|
||||
user << "A syringe is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "You add the syringe to the machine!"
|
||||
src.updateUsrDialog()
|
||||
icon_state = "isolator_in"
|
||||
|
||||
Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.machine = src
|
||||
if(!beaker) return
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
|
||||
if (href_list["isolate"])
|
||||
var/datum/reagent/blood/Blood
|
||||
for(var/datum/reagent/blood/B in R.reagent_list)
|
||||
if(B)
|
||||
Blood = B
|
||||
break
|
||||
|
||||
if(Blood.data["virus2"])
|
||||
virus2 = Blood.data["virus2"]
|
||||
isolating = 40
|
||||
icon_state = "isolator_processing"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
else if (href_list["main"])
|
||||
attack_hand(usr)
|
||||
return
|
||||
else if (href_list["eject"])
|
||||
beaker:loc = src.loc
|
||||
beaker = null
|
||||
icon_state = "isolator"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
if(!beaker)
|
||||
dat = "Please insert sample into the isolator.<BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A>"
|
||||
else if(isolating)
|
||||
dat = "Isolating"
|
||||
else
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
dat += "<A href='?src=\ref[src];eject=1'>Eject</A><BR><BR>"
|
||||
if(!R.total_volume)
|
||||
dat += "[beaker] is empty."
|
||||
else
|
||||
dat += "Contained reagents:<BR>"
|
||||
for(var/datum/reagent/blood/G in R.reagent_list)
|
||||
dat += " [G.name]: <A href='?src=\ref[src];isolate=[G.id]'>Isolate</a>"
|
||||
user << browse("<TITLE>Pathogenic Isolator</TITLE>Isolator menu:<BR><BR>[dat]", "window=isolator;size=575x400")
|
||||
onclose(user, "isolator")
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
process()
|
||||
if(isolating > 0)
|
||||
isolating -= 1
|
||||
if(isolating == 0)
|
||||
var/obj/item/weapon/virusdish/d = new /obj/item/weapon/virusdish(src.loc)
|
||||
d.virus2 = virus2.getcopy()
|
||||
virus2 = null
|
||||
icon_state = "isolator_in"
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/virusdish
|
||||
name = "Virus containment/growth dish"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "implantcase-b"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/growth = 0
|
||||
var/info = 0
|
||||
var/analysed = 0
|
||||
|
||||
/obj/item/weapon/virusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob)
|
||||
if(istype(W,/obj/item/weapon/hand_labeler))
|
||||
return
|
||||
..()
|
||||
if(prob(50))
|
||||
user << "The dish shatters"
|
||||
if(virus2.infectionchance > 0)
|
||||
infect_virus2(user,virus2)
|
||||
del src
|
||||
|
||||
/obj/item/weapon/virusdish/examine()
|
||||
usr << "This is a virus containment dish"
|
||||
if(src.info)
|
||||
usr << "It has the following information about its contents"
|
||||
usr << src.info
|
||||
@@ -1,17 +1,17 @@
|
||||
// NanoBaseHelpers is where the base template helpers (common to all templates) are stored
|
||||
NanoBaseHelpers = function ()
|
||||
NanoBaseHelpers = function ()
|
||||
{
|
||||
var _urlParameters = {}; // This is populated with the base url parameters (used by all links), which is probaby just the "src" parameter
|
||||
|
||||
var init = function ()
|
||||
|
||||
var init = function ()
|
||||
{
|
||||
var body = $('body'); // We store data in the body tag, it's as good a place as any
|
||||
|
||||
|
||||
_urlParameters = body.data('urlParameters');
|
||||
|
||||
|
||||
initHelpers();
|
||||
};
|
||||
|
||||
|
||||
var initHelpers = function ()
|
||||
{
|
||||
$.views.tags({
|
||||
@@ -50,7 +50,7 @@ NanoBaseHelpers = function ()
|
||||
},
|
||||
// Generate a Byond link
|
||||
link: function( text, icon, parameters, status, elementClass, elementId) {
|
||||
|
||||
|
||||
var iconHtml = '';
|
||||
var iconClass = 'noIcon';
|
||||
if (typeof icon != 'undefined' && icon)
|
||||
@@ -58,23 +58,23 @@ NanoBaseHelpers = function ()
|
||||
iconHtml = '<div class="uiLinkPendingIcon"></div><div class="uiIcon16 icon-' + icon + '"></div>';
|
||||
iconClass = 'hasIcon';
|
||||
}
|
||||
|
||||
|
||||
if (typeof elementClass == 'undefined' || !elementClass)
|
||||
{
|
||||
elementClass = '';
|
||||
}
|
||||
|
||||
|
||||
var elementIdHtml = '';
|
||||
if (typeof elementId != 'undefined' && elementId)
|
||||
{
|
||||
elementIdHtml = 'id="' + elementId + '"';
|
||||
}
|
||||
|
||||
|
||||
if (typeof status != 'undefined' && status)
|
||||
{
|
||||
return '<div unselectable="on" class="link ' + iconClass + ' ' + elementClass + ' ' + status + '" ' + elementIdHtml + '>' + iconHtml + text + '</div>';
|
||||
}
|
||||
|
||||
|
||||
return '<div unselectable="on" class="link linkActive ' + iconClass + ' ' + elementClass + '" data-href="' + generateHref(parameters) + '" ' + elementIdHtml + '>' + iconHtml + text + '</div>';
|
||||
},
|
||||
// Since jsrender breaks the ^ operator
|
||||
@@ -82,7 +82,7 @@ NanoBaseHelpers = function ()
|
||||
return number ^ bit;
|
||||
},
|
||||
// Round a number to the nearest integer
|
||||
round: function(number) {
|
||||
round: function(number) {
|
||||
return Math.round(number);
|
||||
},
|
||||
// Round a number to X decimal places.
|
||||
@@ -93,21 +93,21 @@ NanoBaseHelpers = function ()
|
||||
return (Math.round(value * multiplier) / multiplier);
|
||||
},
|
||||
// Round a number down to integer
|
||||
floor: function(number) {
|
||||
floor: function(number) {
|
||||
return Math.floor(number);
|
||||
},
|
||||
// Round a number up to integer
|
||||
ceil: function(number) {
|
||||
ceil: function(number) {
|
||||
return Math.ceil(number);
|
||||
},
|
||||
// Format a string (~string("Hello {0}, how are {1}?", 'Martin', 'you') becomes "Hello Martin, how are you?")
|
||||
string: function() {
|
||||
string: function() {
|
||||
if (arguments.length == 0)
|
||||
{
|
||||
{
|
||||
return '';
|
||||
}
|
||||
else if (arguments.length == 1)
|
||||
{
|
||||
{
|
||||
return arguments[0];
|
||||
}
|
||||
else if (arguments.length > 1)
|
||||
@@ -115,15 +115,21 @@ NanoBaseHelpers = function ()
|
||||
stringArgs = [];
|
||||
for (var i = 1; i < arguments.length; i++)
|
||||
{
|
||||
stringArgs.push(arguments[i]);
|
||||
stringArgs.push(arguments[i]);
|
||||
}
|
||||
return arguments[0].format(stringArgs);
|
||||
}
|
||||
return '';
|
||||
},
|
||||
formatNumber: function(x) {
|
||||
// From http://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript
|
||||
var parts = x.toString().split(".");
|
||||
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
return parts.join(".");
|
||||
},
|
||||
// Display a bar. Used to show health, capacity, etc.
|
||||
displayBar: function(value, rangeMin, rangeMax, styleClass, showText) {
|
||||
|
||||
displayBar: function(value, rangeMin, rangeMax, styleClass, showText) {
|
||||
|
||||
if (rangeMin < rangeMax)
|
||||
{
|
||||
if (value < rangeMin)
|
||||
@@ -145,20 +151,20 @@ NanoBaseHelpers = function ()
|
||||
{
|
||||
value = rangeMax;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (typeof styleClass == 'undefined' || !styleClass)
|
||||
{
|
||||
styleClass = '';
|
||||
}
|
||||
|
||||
|
||||
if (typeof showText == 'undefined' || !showText)
|
||||
{
|
||||
showText = '';
|
||||
}
|
||||
|
||||
|
||||
var percentage = Math.round((value - rangeMin) / (rangeMax - rangeMin) * 100);
|
||||
|
||||
|
||||
return '<div class="displayBar ' + styleClass + '"><div class="displayBarFill ' + styleClass + '" style="width: ' + percentage + '%;"></div><div class="displayBarText ' + styleClass + '">' + showText + '</div></div>';
|
||||
},
|
||||
// Convert danger level to class (for the air alarm)
|
||||
@@ -168,14 +174,14 @@ NanoBaseHelpers = function ()
|
||||
return 'bad';
|
||||
},
|
||||
// Display DNA Blocks (for the DNA Modifier UI)
|
||||
displayDNABlocks: function(dnaString, selectedBlock, selectedSubblock, blockSize, paramKey) {
|
||||
displayDNABlocks: function(dnaString, selectedBlock, selectedSubblock, blockSize, paramKey) {
|
||||
if (!dnaString)
|
||||
{
|
||||
return '<div class="notice">Please place a valid subject into the DNA modifier.</div>';
|
||||
}
|
||||
|
||||
|
||||
var characters = dnaString.split('');
|
||||
|
||||
|
||||
var html = '<div class="dnaBlock"><div class="link dnaBlockNumber">1</div>';
|
||||
var block = 1;
|
||||
var subblock = 1;
|
||||
@@ -185,7 +191,7 @@ NanoBaseHelpers = function ()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
var parameters;
|
||||
if (paramKey.toUpperCase() == 'UI')
|
||||
{
|
||||
@@ -194,41 +200,47 @@ NanoBaseHelpers = function ()
|
||||
else
|
||||
{
|
||||
parameters = { 'selectSEBlock' : block, 'selectSESubblock' : subblock };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var status = 'linkActive';
|
||||
if (block == selectedBlock && subblock == selectedSubblock)
|
||||
{
|
||||
status = 'selected';
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
html += '<div class="link ' + status + ' dnaSubBlock" data-href="' + generateHref(parameters) + '" id="dnaBlock' + index + '">' + characters[index] + '</div>';
|
||||
|
||||
=======
|
||||
|
||||
html += '<div class="link ' + status + ' dnaSubBlock" data-href="' + generateHref(parameters) + '" id="dnaBlock' + index + '">' + characters[index] + '</div>'
|
||||
|
||||
>>>>>>> 16f787a... Virology - NanoUI, gameplay tweaks, bugfixes
|
||||
index++;
|
||||
if (index % blockSize == 0 && index < characters.length)
|
||||
{
|
||||
block++;
|
||||
subblock = 1;
|
||||
html += '</div><div class="dnaBlock"><div class="link dnaBlockNumber">' + block + '</div>';
|
||||
html += '</div><div class="dnaBlock"><div class="link dnaBlockNumber">' + block + '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
subblock++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
html += '</div>';
|
||||
|
||||
|
||||
return html;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// generate a Byond href, combines _urlParameters with parameters
|
||||
var generateHref = function (parameters)
|
||||
{
|
||||
var queryString = '?';
|
||||
|
||||
|
||||
for (var key in _urlParameters)
|
||||
{
|
||||
if (_urlParameters.hasOwnProperty(key))
|
||||
@@ -240,7 +252,7 @@ NanoBaseHelpers = function ()
|
||||
queryString += key + '=' + _urlParameters[key];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (var key in parameters)
|
||||
{
|
||||
if (parameters.hasOwnProperty(key))
|
||||
@@ -256,14 +268,14 @@ NanoBaseHelpers = function ()
|
||||
};
|
||||
|
||||
return {
|
||||
init: function ()
|
||||
init: function ()
|
||||
{
|
||||
init();
|
||||
}
|
||||
};
|
||||
} ();
|
||||
|
||||
$(document).ready(function()
|
||||
$(document).ready(function()
|
||||
{
|
||||
NanoBaseHelpers.init();
|
||||
});
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
<div class="item">
|
||||
<div class="itemContent">
|
||||
{{:~link('Close', 'gear', {'close' : 1}, null, 'fixedLeft')}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if busy}}
|
||||
<h5 class='average'>The Splicer is currently busy.</h5>
|
||||
<div class='notice'>
|
||||
<center><span class='bad'>{{:busy}}</span></center>
|
||||
</div>
|
||||
<p>
|
||||
Thank you for your patience!
|
||||
</p>
|
||||
{{else}}
|
||||
<div class="item">
|
||||
<h2>Virus Dish</h2>
|
||||
</div>
|
||||
<div class="item">
|
||||
{{:~link('Eject Dish', 'eject', { 'eject' : 1 }, dish_inserted ? null : 'disabled')}}
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
<b>Growth Density:</b>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:~displayBar(growth, 0, 100, growth >= 50 ? 'good' : growth >= 25 ? 'average' : 'bad', growth + '%' )}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="statusDisplay" style="height: 145px; overflow: auto;">
|
||||
<div class='item'>
|
||||
{{if !info}}
|
||||
<div class='itemLabel'>
|
||||
<span class='good'>Symptoms:</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class='itemContent' style="width: 100%;">
|
||||
{{if info}}
|
||||
<span class='average'>{{:info}}</span>
|
||||
{{else}}
|
||||
{{for effects}}
|
||||
<div>
|
||||
<div class="highlight">
|
||||
({{:stage}}) {{:name}}
|
||||
{{if badness > 1}}
|
||||
<span class='bad'><b>Dangerous</b></span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/for}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{if affected_species && !info}}
|
||||
<div class='item'>
|
||||
<div class='itemLabelWide'>
|
||||
<span class='good'>Affected Species:</span>
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
<span class='highlight'>{{:affected_species}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{if effects}}
|
||||
<div class='item'>
|
||||
<span class="bad"><i>CAUTION: Reverse engineering will destroy the viral sample.</i></span>
|
||||
</div>
|
||||
<div class='item'>
|
||||
<div class='itemLabelWide'>
|
||||
Reverse Engineering:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{for effects}}
|
||||
{{:~link(stage, 'transferthick-e-w', { 'grab' : reference })}}
|
||||
{{/for}}
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{:~link('Species', 'transferthick-e-w', { 'affected_species' : 1 })}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="item">
|
||||
<h2>Storage</h2>
|
||||
</div>
|
||||
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
<b>Memory Buffer:</b>
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{if buffer}}
|
||||
{{:buffer.name}} ({{:buffer.stage}})
|
||||
{{else}}
|
||||
{{if species_buffer}}
|
||||
{{:species_buffer}}
|
||||
{{else}}
|
||||
Empty
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{:~link('Save To Disk', 'disk', { 'disk' : 1 }, (buffer || species_buffer) ? null : 'disabled')}}
|
||||
{{:~link('Splice Onto Dish', 'pencil', { 'splice' : 1 }, (buffer || species_buffer) && !info ? null : 'disabled')}}
|
||||
{{/if}}
|
||||
@@ -0,0 +1,123 @@
|
||||
<div class="item">
|
||||
<div class="itemContent">
|
||||
{{:~link('Close', 'gear', {'close' : '1'}, null, 'fixedLeft')}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<h2>Environmental Conditions</h2>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Power:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:~link('On', 'power', { 'power' : 1 }, !dish_inserted ? 'disabled' : on ? 'selected' : null)}}{{:~link('Off', 'close', { 'power' : 1 }, on ? null : 'selected')}}
|
||||
</div>
|
||||
</div>
|
||||
<div class='item'>
|
||||
{{:~link('Add Radiation', 'radiation', {'rad' : 1})}}
|
||||
{{:~link('Flush System', 'trash', {'flush' : 1}, system_in_use ? null : 'disabled')}}
|
||||
</div>
|
||||
|
||||
<div class="statusDisplay" style="height: 100px; overflow: auto;">
|
||||
<div class='item'>
|
||||
<div class="itemLabel">
|
||||
<span class='good'>Virus Food:</span>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:~displayBar(food_supply, 0, 100, 'good', food_supply)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class='item'>
|
||||
<div class="itemLabel">
|
||||
<span class='good'>Radiation Level:</span>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:~displayBar(radiation, 0, 100, radiation >= 50 ? 'bad' : growth >= 25 ? 'average' : 'good')}}
|
||||
<br/>
|
||||
{{:~formatNumber(radiation * 10000)}} <acronym title='In microSieverts'>µSv</acronym>
|
||||
</div>
|
||||
</div>
|
||||
<div class='item'>
|
||||
<div class="itemLabel">
|
||||
<span class='good'>Toxicity:</span>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:~displayBar(toxins, 0, 100, toxins >= 50 ? 'bad' : toxins >= 25 ? 'average' : 'good', toxins + '%')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<h2>Chemicals</h2>
|
||||
</div>
|
||||
<div class='item'>
|
||||
{{:~link('Eject Chemicals', 'eject', { 'ejectchem' : 1 }, chemicals_inserted ? null : 'disabled')}}
|
||||
{{:~link('Breed Virus', 'circle-arrow-s', { 'virus' : 1 }, can_breed_virus ? null : 'disabled')}}
|
||||
</div>
|
||||
|
||||
{{if chemicals_inserted}}
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
Volume:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{:~displayBar(chemical_volume, 0, max_chemical_volume, 'good', chemical_volume + ' / ' + max_chemical_volume)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
Breeding Environment:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
<span class='{{:can_breed_virus ? "good" : "average"}}'>
|
||||
{{:!dish_inserted ? 'N/A' : can_breed_virus ? 'Suitable' : 'No hemolytic samples detected'}}
|
||||
</span>
|
||||
{{if blood_already_infected}}
|
||||
<br/>
|
||||
<span class='bad'><i>CAUTION: Viral infection detected in blood sample.</i></span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class='item'>
|
||||
<span class='average'>No chemicals inserted.</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="item">
|
||||
<h2>Virus Dish</h2>
|
||||
</div>
|
||||
<div class='item'>
|
||||
{{:~link('Eject Dish', 'eject', {'ejectdish' : 1}, dish_inserted ? null : 'disabled')}}
|
||||
</div>
|
||||
|
||||
{{if dish_inserted}}
|
||||
{{if virus}}
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
<b>Growth Density:</b>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:~displayBar(growth, 0, 100, growth >= 50 ? 'good' : growth >= 25 ? 'average' : 'bad', growth + '%' )}}
|
||||
</div>
|
||||
</div>
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
<b>Infection Rate:</b>
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{:analysed ? infection_rate : "Unknown"}}
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="item">
|
||||
<span class='average'>No virus detected.</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<div class="item">
|
||||
<span class='average'>No dish loaded.</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
@@ -0,0 +1,81 @@
|
||||
<div class="item">
|
||||
{{:~link('Close', 'gear', {'close' : 1}, null, 'fixedLeft')}}
|
||||
{{:~link('Print', 'print', { 'print' : 1 }, antibodies || pathogens ? null : 'disabled', 'fixedLeft')}}
|
||||
</div>
|
||||
|
||||
{{if busy}}
|
||||
<h5 class='average'>The Centrifuge is currently busy.</h5>
|
||||
<div class='notice'>
|
||||
<center><span class='bad'>{{:busy}}</span></center>
|
||||
</div>
|
||||
<p>
|
||||
Thank you for your patience!
|
||||
</p>
|
||||
{{else}}
|
||||
<div class="item">
|
||||
<h2>{{:is_antibody_sample ? 'Antibody Sample' : 'Blood Sample'}}</h2>
|
||||
</div>
|
||||
<div class='item'>
|
||||
{{:~link('Eject Vial', 'eject', { 'action' : 'sample' }, sample_inserted ? null : 'disabled')}}
|
||||
</div>
|
||||
{{if sample_inserted}}
|
||||
{{if antibodies || pathogens}}
|
||||
<div class="statusDisplay">
|
||||
{{if antibodies}}
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
<span class='good'>Antibodies:</span>
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{:antibodies}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{if pathogens}}
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
<span class='good'>Pathogens:</span>
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{for pathogens}}
|
||||
<div class='highlight'>
|
||||
{{:name}} ({{:spread_type}})
|
||||
</div>
|
||||
{{/for}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class='item'>
|
||||
<span class='average'>No antibodies or viral strains detected.</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<div class='item'>
|
||||
<span class='average'>No vial detected.</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{if antibodies && !is_antibody_sample}}
|
||||
<div class='item'>
|
||||
<div class='itemLabelWide'>
|
||||
Isolate Antibodies:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{:~link(antibodies, 'pencil', { 'action' : 'antibody' })}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{if pathogens}}
|
||||
<div class='item'>
|
||||
<div class='itemLabelWide'>
|
||||
Isolate Strain:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{for pathogens}}
|
||||
{{:~link(name, 'pencil', { 'isolate' : reference })}}
|
||||
{{/for}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
@@ -0,0 +1,107 @@
|
||||
<div class='item'>
|
||||
<h2>Menu</h2>
|
||||
</div>
|
||||
<div class="item">
|
||||
{{if !isolating}}
|
||||
{{:~link('Home', 'home', {'home' : 1}, state == 'home' ? 'disabled' : null, 'fixedLeft')}}
|
||||
{{:~link('List', 'note', {'list' : 1}, state == 'list' ? 'disabled' : null, 'fixedLeft')}}
|
||||
{{:~link('Pathogen', 'folder-open', {'entry' : 1}, state == 'entry' ? 'disabled' : null, 'fixedLeft')}}
|
||||
{{/if}}
|
||||
<br>
|
||||
{{:~link('Close', 'gear', {'close' : 1}, null, 'fixedLeft')}}
|
||||
{{:~link('Print', 'print', { 'print' : 1 }, can_print ? null : 'disabled', 'fixedLeft')}}
|
||||
</div>
|
||||
|
||||
{{if isolating}}
|
||||
<h5 class='average'>The Isolator is currently busy.</h5>
|
||||
<div class='notice'>
|
||||
<center><span class='bad'>Isolating pathogens...</span></center>
|
||||
</div>
|
||||
<p>
|
||||
Thank you for your patience!
|
||||
</p>
|
||||
{{else}}
|
||||
{{if state =="home"}}
|
||||
<div class="item">
|
||||
<h2>Blood Sample</h2>
|
||||
</div>
|
||||
<div class='item'>
|
||||
{{:~link('Eject Syringe', 'eject', { 'eject' : 1 }, syringe_inserted ? null : 'disabled')}}
|
||||
</div>
|
||||
|
||||
{{if syringe_inserted}}
|
||||
<div class='statusDisplay'>
|
||||
<span class='good'><b>Pathogens:</b></span>
|
||||
{{if pathogen_pool}}
|
||||
{{for pathogen_pool}}
|
||||
<div class='item'>
|
||||
<span class='highlight'><b><u>{{:#index + 1}}. #{{:unique_id}}</u> {{:is_in_database ? "(Analysed)" : ""}}</b></span><br>
|
||||
<span class='average'>{{:name}}:</span> {{:dna}}
|
||||
</div>
|
||||
{{/for}}
|
||||
{{else}}
|
||||
No pathogens detected.
|
||||
{{/if}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class='item'>
|
||||
<span class='average'>No syringe loaded.</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{if pathogen_pool}}
|
||||
<div class='item'>
|
||||
<div class='itemLabelWide'>
|
||||
Isolate Pathogens:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{for pathogen_pool}}
|
||||
{{:~link('#' + unique_id, 'pencil', { 'isolate' : reference }, null, 'fixedLeft')}}
|
||||
{{/for}}
|
||||
</div>
|
||||
</div>
|
||||
<div class='item'>
|
||||
<div class='itemLabelWide'>
|
||||
Database Lookup:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{for pathogen_pool}}
|
||||
{{if is_in_database}}
|
||||
{{:~link('#' + unique_id, 'info', { 'entry' : 1, 'view' : record }, null, 'fixedLeft')}}
|
||||
{{/if}}
|
||||
{{/for}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{if state == "list"}}
|
||||
<div class='item'>
|
||||
<h2>View Database</h2>
|
||||
</div>
|
||||
<div class='item'>
|
||||
{{if database}}
|
||||
{{for database}}
|
||||
<div class='itemContent'>
|
||||
<div class='highlight fixedLeft'>{{:name}}</div>
|
||||
{{:~link('Details', 'circle-arrow-s', { 'entry' : 1, 'view' : record }, null, 'fixedLeft')}}
|
||||
</div>
|
||||
{{/for}}
|
||||
{{else}}
|
||||
<span class='average'>The viral database is empty.</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{if state == "entry"}}
|
||||
{{if entry}}
|
||||
<div class='item'>
|
||||
<h2>{{:entry.name}}</h2>
|
||||
</div>
|
||||
<div class='statusDisplay'>
|
||||
{{:entry.description}}
|
||||
</div>
|
||||
{{else}}
|
||||
<span class='average'>No virus selected.</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
@@ -0,0 +1,79 @@
|
||||
<div class='item'>
|
||||
{{:~link('Close', 'gear', {'close' : 1}, null, 'fixedLeft')}}
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<h2>Storage</h2>
|
||||
{{if secure}}
|
||||
<span class='notice'>
|
||||
{{:locked == -1 ? "Sec.re ACC_** //):securi_nt.diag=>##'or 1=1'%($..." : "Secure Access: Please have your identification ready."}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class='item'>
|
||||
{{if contents}}
|
||||
{{for contents}}
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
<span class='highlight'>{{:display_name}} ({{:quantity}}):</span>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:~link('Vend', 'circle-arrow-s', { "vend" : vend, "amount" : 1 }, null, 'statusValue')}}
|
||||
{{if quantity >= 5}}
|
||||
{{:~link('x5', 'circle-arrow-s', { "vend" : vend, "amount" : 5 }, null, 'statusValue')}}
|
||||
{{/if}}
|
||||
{{if quantity >= 10}}
|
||||
{{:~link('x10', 'circle-arrow-s', { "vend" : vend, "amount" : 10 }, null, 'statusValue')}}
|
||||
{{/if}}
|
||||
{{if quantity >= 25}}
|
||||
{{:~link('x25', 'circle-arrow-s', { "vend" : vend, "amount" : 25 }, null, 'statusValue')}}
|
||||
{{/if}}
|
||||
{{if quantity > 1}}
|
||||
{{:~link('All', 'circle-arrow-s', { "vend" : vend, "amount" : quantity }, null, 'statusValue')}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/for}}
|
||||
{{else}}
|
||||
<span class='average'>No products loaded.</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{if panel_open}}
|
||||
<div class='item'>
|
||||
<h2>Access Panel</h2>
|
||||
</div>
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
<span class='good'>Wires:</span>
|
||||
</div>
|
||||
<div class='itemContentWide'>
|
||||
{{for wires}}
|
||||
<div class='item'>
|
||||
<div class='itemLabel' style='color: {{:wire}};'>
|
||||
{{:wire}} wire:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
{{if cut}}
|
||||
{{:~link('Mend', 'plus', {'cutwire' : index})}}
|
||||
{{else}}
|
||||
{{:~link('Cut', 'minus', {'cutwire' : index})}}
|
||||
{{:~link('Pulse', 'signal-diag', {'pulsewire' : index})}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/for}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='statusDisplay'>
|
||||
The orange light is <span class='{{:electrified ? "good" : "bad"}}'><b>{{:electrified ? "on" : "off"}}</b></span>.<br>
|
||||
The red light is <span class='{{:shoot_inventory ? "good" : "bad"}}'><b>{{:shoot_inventory ? "on" : "off"}}</b></span>.<br>
|
||||
{{if secure}}
|
||||
The green light is
|
||||
<span class='{{:locked == 1 ? "bad" : locked == -1 ? "average" : "good"}}'>
|
||||
{{:locked == 1 ? "off" : locked == -1 ? "blinking" : "on"}}
|
||||
</span>.<br>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
Reference in New Issue
Block a user