mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user