mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] Better Viro (#9421)
Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b76e8aa897
commit
6c05f5da45
@@ -1,222 +0,0 @@
|
||||
/datum/disease2/disease/Topic(href, href_list)
|
||||
. = ..()
|
||||
if(.) return
|
||||
|
||||
if(href_list["info"])
|
||||
// spawn or admin privileges to see info about viruses
|
||||
if(!check_rights(R_ADMIN|R_SPAWN|R_EVENT)) return
|
||||
|
||||
to_chat(usr, "Infection chance: [infectionchance]; Speed: [speed]; Spread type: [spreadtype]")
|
||||
to_chat(usr, "Affected species: [english_list(affected_species)]")
|
||||
to_chat(usr, "Effects:")
|
||||
for(var/datum/disease2/effectholder/E in effects)
|
||||
to_chat(usr, "[E.stage]: [E.effect.name]; chance=[E.chance]; multiplier=[E.multiplier]")
|
||||
to_chat(usr, "Antigens: [antigens2string(antigen)]; Resistance: [resistance]")
|
||||
|
||||
return 1
|
||||
|
||||
/datum/disease2/disease/vv_get_header()
|
||||
. = list()
|
||||
for(var/datum/disease2/effectholder/E in effects)
|
||||
. += "[E.stage]: [E.effect.name]"
|
||||
. = list({"
|
||||
<b>[name()]</b><br><font size=1>
|
||||
[jointext(., "<br>")]</font>
|
||||
"})
|
||||
|
||||
/datum/disease2/disease/get_view_variables_options()
|
||||
return ..() + {"
|
||||
<option value='?src=\ref[src];info=1'>Show info</option>
|
||||
"}
|
||||
|
||||
/datum/admins/var/datum/virus2_editor/virus2_editor_datum = new
|
||||
/client/proc/virus2_editor()
|
||||
set name = "Virus Editor"
|
||||
set category = "Admin.Events"
|
||||
if(!holder || !check_rights(R_SPAWN)) return // spawn privileges to create viruses
|
||||
|
||||
holder.virus2_editor_datum.show_ui(src)
|
||||
|
||||
/datum/virus2_editor
|
||||
var/list/s = list(/datum/disease2/effect/invisible,/datum/disease2/effect/invisible,/datum/disease2/effect/invisible,/datum/disease2/effect/invisible)
|
||||
var/list/s_chance = list(1,1,1,1)
|
||||
var/list/s_multiplier = list(1,1,1,1)
|
||||
var/species = list()
|
||||
var/infectionchance = 70
|
||||
var/spreadtype = "Contact"
|
||||
var/list/antigens = list()
|
||||
var/speed = 1
|
||||
var/resistance = 10
|
||||
var/mob/living/carbon/infectee = null
|
||||
|
||||
// this holds spawned viruses so that the "Info" links work after the proc exits
|
||||
var/list/spawned_viruses = list()
|
||||
|
||||
/datum/virus2_editor/proc/select(mob/user, stage)
|
||||
if(stage < 1 || stage > 4) return
|
||||
|
||||
var/list/L = list()
|
||||
|
||||
for(var/datum/disease2/effect/f as anything in subtypesof(/datum/disease2/effect))
|
||||
if(initial(f.stage) <= stage)
|
||||
L[initial(f.name)] = f
|
||||
|
||||
var/datum/disease2/effect/Eff = s[stage]
|
||||
|
||||
var/C = tgui_input_list(usr, "Select effect for stage [stage]:", "Stage [stage]", L, Eff)
|
||||
if(!C) return
|
||||
return L[C]
|
||||
|
||||
/datum/virus2_editor/proc/show_ui(mob/user)
|
||||
var/H = {"
|
||||
<center><h3>Virus2 Virus Editor</h3></center><br />
|
||||
<b>Effects:</b><br />
|
||||
"}
|
||||
for(var/i = 1 to 4)
|
||||
var/datum/disease2/effect/Eff = s[i]
|
||||
H += {"
|
||||
<a href='?src=\ref[src];[HrefToken()];what=effect;stage=[i];effect=1'>[initial(Eff.name)]</a>
|
||||
Chance: <a href='?src=\ref[src];[HrefToken()];what=effect;stage=[i];chance=1'>[s_chance[i]]</a>
|
||||
Multiplier: <a href='?src=\ref[src];[HrefToken()];what=effect;stage=[i];multiplier=1'>[s_multiplier[i]]</a>
|
||||
<br />
|
||||
"}
|
||||
H += {"
|
||||
<br />
|
||||
<b>Infectable Species:</b><br />
|
||||
"}
|
||||
var/f = 1
|
||||
for(var/k in GLOB.all_species)
|
||||
var/datum/species/S = GLOB.all_species[k]
|
||||
if(S.get_virus_immune())
|
||||
continue
|
||||
if(!f) H += " | "
|
||||
else f = 0
|
||||
H += "<a href='?src=\ref[src];[HrefToken()];what=species;toggle=[k]' style='color:[(k in species) ? "#006600" : "#ff0000"]'>[k]</a>"
|
||||
H += {"
|
||||
<a href="?src=\ref[src];[HrefToken()];what=species;reset=1" style="color:#0000aa">Reset</a>
|
||||
<br />
|
||||
<b>Infection Chance:</b> <a href="?src=\ref[src];[HrefToken()];what=ichance">[infectionchance]</a><br />
|
||||
<b>Spread Type:</b> <a href="?src=\ref[src];[HrefToken()];what=stype">[spreadtype]</a><br />
|
||||
<b>Speed:</b> <a href="?src=\ref[src];[HrefToken()];what=speed">[speed]</a><br />
|
||||
<b>Resistance:</b> <a href="?src=\ref[src];[HrefToken()];what=resistance">[resistance]</a><br />
|
||||
<br />
|
||||
"}
|
||||
f = 1
|
||||
for(var/k in ALL_ANTIGENS)
|
||||
if(!f) H += " | "
|
||||
else f = 0
|
||||
H += "<a href='?src=\ref[src];[HrefToken()];what=antigen;toggle=[k]' style='color:[(k in antigens) ? "#006600" : "#ff0000"]'>[k]</a>"
|
||||
H += {"
|
||||
<a href="?src=\ref[src];[HrefToken()];what=antigen;reset=1" style="color:#0000aa">Reset</a>
|
||||
<br />
|
||||
<hr />
|
||||
<b>Initial infectee:</b> <a href="?src=\ref[src];[HrefToken()];what=infectee">[infectee ? infectee : "(choose)"]</a>
|
||||
<a href="?src=\ref[src];[HrefToken()];what=go" style="color:#ff0000">RELEASE</a>
|
||||
"}
|
||||
|
||||
user << browse(H, "window=virus2edit")
|
||||
|
||||
/datum/virus2_editor/Topic(href, href_list)
|
||||
switch(href_list["what"])
|
||||
if("effect")
|
||||
var/stage = text2num(href_list["stage"])
|
||||
if(href_list["effect"])
|
||||
var/datum/disease2/effect/E = select(usr,stage)
|
||||
if(!E) return
|
||||
s[stage] = E
|
||||
// set a default chance and multiplier of half the maximum (roughly average)
|
||||
s_chance[stage] = max(1, round(initial(E.chance_maxm)/2))
|
||||
s_multiplier[stage] = max(1, round(initial(E.maxm)/2))
|
||||
else if(href_list["chance"])
|
||||
var/datum/disease2/effect/Eff = s[stage]
|
||||
var/I = tgui_input_number(usr, "Chance, per tick, of this effect happening (min 0, max [initial(Eff.chance_maxm)])", "Effect Chance", s_chance[stage], initial(Eff.chance_maxm), 0)
|
||||
if(I == null || I < 0 || I > initial(Eff.chance_maxm)) return
|
||||
s_chance[stage] = I
|
||||
else if(href_list["multiplier"])
|
||||
var/datum/disease2/effect/Eff = s[stage]
|
||||
var/I = tgui_input_number(usr, "Multiplier for this effect (min 1, max [initial(Eff.maxm)])", "Effect Multiplier", s_multiplier[stage], initial(Eff.maxm), 1)
|
||||
if(I == null || I < 1 || I > initial(Eff.maxm)) return
|
||||
s_multiplier[stage] = I
|
||||
if("species")
|
||||
if(href_list["toggle"])
|
||||
var/T = href_list["toggle"]
|
||||
if(T in species)
|
||||
species -= T
|
||||
else
|
||||
species |= T
|
||||
else if(href_list["reset"])
|
||||
species = list()
|
||||
if(infectee)
|
||||
if(!infectee.species || !(infectee.species.get_bodytype() in species))
|
||||
infectee = null
|
||||
if("ichance")
|
||||
var/I = tgui_input_number(usr, "Input infection chance", "Infection Chance", infectionchance, 100)
|
||||
if(!I) return
|
||||
infectionchance = I
|
||||
if("stype")
|
||||
var/S = tgui_alert(usr, "Which spread type?", "Spread Type", list("Contact", "Airborne", "Blood"))
|
||||
if(!S) return
|
||||
spreadtype = S
|
||||
if("speed")
|
||||
var/S = tgui_input_number(usr, "Input speed", "Speed", speed)
|
||||
if(!S) return
|
||||
speed = S
|
||||
if("antigen")
|
||||
if(href_list["toggle"])
|
||||
var/T = href_list["toggle"]
|
||||
if(length(T) != 1) return
|
||||
if(T in antigens)
|
||||
antigens -= T
|
||||
else
|
||||
antigens |= T
|
||||
else if(href_list["reset"])
|
||||
antigens = list()
|
||||
if("resistance")
|
||||
var/S = tgui_input_number(usr, "Input % resistance to antibiotics", "Resistance", resistance, 100)
|
||||
if(!S) return
|
||||
resistance = S
|
||||
if("infectee")
|
||||
var/list/candidates = list()
|
||||
for(var/mob/living/carbon/G in living_mob_list)
|
||||
if(G.stat != DEAD && G.species && !isbelly(G.loc))
|
||||
if(G.species.get_bodytype() in species)
|
||||
candidates["[G.name][G.client ? "" : " (no client)"]"] = G
|
||||
else
|
||||
candidates["[G.name] ([G.species.get_bodytype()])[G.client ? "" : " (no client)"]"] = G
|
||||
if(!candidates.len)
|
||||
to_chat(usr, "No possible candidates found!")
|
||||
|
||||
var/I = tgui_input_list(usr, "Choose initial infectee", "Infectee", candidates)
|
||||
if(!I || !candidates[I]) return
|
||||
infectee = candidates[I]
|
||||
species |= infectee.species.get_bodytype()
|
||||
if("go")
|
||||
if(!antigens.len)
|
||||
var/a = tgui_alert(usr, "This disease has no antigens; it will be impossible to permanently immunise anyone without them.\
|
||||
It is strongly recommended to set at least one antigen. Do you want to go back and edit your virus?", "Antigens", list("Yes", "No"))
|
||||
if(!a || a == "Yes") return
|
||||
var/datum/disease2/disease/D = new
|
||||
D.infectionchance = infectionchance
|
||||
D.spreadtype = spreadtype
|
||||
D.antigen = antigens
|
||||
D.affected_species = species
|
||||
D.speed = speed
|
||||
D.resistance = resistance
|
||||
for(var/i in 1 to 4)
|
||||
var/datum/disease2/effectholder/E = new
|
||||
var/Etype = s[i]
|
||||
E.effect = new Etype()
|
||||
E.effect.generate()
|
||||
E.chance = s_chance[i]
|
||||
E.multiplier = s_multiplier[i]
|
||||
E.stage = i
|
||||
|
||||
D.effects += E
|
||||
|
||||
spawned_viruses += D
|
||||
|
||||
message_admins(span_danger("[key_name_admin(usr)] infected [key_name_admin(infectee)] with a virus (<a href='?src=\ref[D];[HrefToken()];info=1'>Info</a>)"))
|
||||
log_admin("[key_name_admin(usr)] infected [key_name_admin(infectee)] with a virus!")
|
||||
infect_virus2(infectee, D, forced=1)
|
||||
|
||||
show_ui(usr)
|
||||
@@ -1,73 +0,0 @@
|
||||
/obj/machinery/disease2/diseaseanalyser
|
||||
name = "disease analyser"
|
||||
desc = "Analyzes diseases to find out information about them!"
|
||||
icon = 'icons/obj/virology_vr.dmi' //VOREStation Edit
|
||||
icon_state = "analyser"
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
|
||||
var/scanning = 0
|
||||
var/pause = 0
|
||||
|
||||
var/obj/item/virusdish/dish = null
|
||||
|
||||
/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/O as obj, var/mob/user as mob)
|
||||
if(default_unfasten_wrench(user, O, 20))
|
||||
return
|
||||
|
||||
else if(!istype(O,/obj/item/virusdish)) return
|
||||
|
||||
if(dish)
|
||||
to_chat(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
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(scanning == 0)
|
||||
if (dish.virus2.addToDB())
|
||||
ping("\The [src] pings, \"New pathogen added to data bank.\"")
|
||||
|
||||
var/obj/item/paper/P = new /obj/item/paper(src.loc)
|
||||
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.basic_info = dish.virus2.get_basic_info()
|
||||
dish.info = r
|
||||
dish.name = "[initial(dish.name)] ([dish.virus2.name()])"
|
||||
dish.analysed = 1
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
|
||||
icon_state = "analyser"
|
||||
src.state("\The [src] prints a sheet of paper.")
|
||||
|
||||
else if(dish && !scanning && !pause)
|
||||
if(dish.virus2 && dish.growth > 50)
|
||||
dish.growth -= 10
|
||||
scanning = 5
|
||||
icon_state = "analyser_processing"
|
||||
else
|
||||
pause = 1
|
||||
spawn(25)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
|
||||
src.state("\The [src] buzzes, \"Insufficient growth density to complete analysis.\"")
|
||||
pause = 0
|
||||
return
|
||||
@@ -1,26 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
var/global/list/ALL_ANTIGENS = list(
|
||||
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
|
||||
)
|
||||
|
||||
/hook/startup/proc/randomise_antigens_order()
|
||||
ALL_ANTIGENS = shuffle(ALL_ANTIGENS)
|
||||
return 1
|
||||
|
||||
// iterate over the list of antigens and see what matches
|
||||
/proc/antigens2string(list/antigens, none="None")
|
||||
if(!istype(antigens))
|
||||
CRASH("Illegal type!")
|
||||
if(!antigens.len)
|
||||
return none
|
||||
|
||||
var/code = ""
|
||||
for(var/V in ALL_ANTIGENS)
|
||||
if(V in antigens)
|
||||
code += V
|
||||
|
||||
if(!code)
|
||||
return none
|
||||
|
||||
return code
|
||||
@@ -1,20 +0,0 @@
|
||||
/obj/machinery/disease2/biodestroyer
|
||||
name = "Biohazard destroyer"
|
||||
icon = 'icons/obj/pipes/disposal.dmi'
|
||||
icon_state = "disposalbio"
|
||||
var/list/accepts = list(/obj/item/clothing,/obj/item/virusdish/,/obj/item/cureimplanter,/obj/item/diseasedisk,/obj/item/reagent_containers)
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
|
||||
/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()
|
||||
qdel(I)
|
||||
add_overlay("dispover-handle")
|
||||
return
|
||||
user.drop_item()
|
||||
I.loc = src.loc
|
||||
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(span_blue("[icon2html(src, O.client)] The [src.name] beeps."), 2)
|
||||
@@ -1,105 +0,0 @@
|
||||
/obj/machinery/computer/curer
|
||||
name = "cure research machine"
|
||||
icon_keyboard = "med_key"
|
||||
icon_screen = "dna"
|
||||
circuit = /obj/item/circuitboard/curefab
|
||||
var/curing
|
||||
var/virusing
|
||||
|
||||
var/obj/item/reagent_containers/container = null
|
||||
|
||||
/obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I,/obj/item/reagent_containers))
|
||||
var/mob/living/carbon/C = user
|
||||
if(!container)
|
||||
container = I
|
||||
C.drop_item()
|
||||
I.loc = src
|
||||
return
|
||||
if(istype(I,/obj/item/virusdish))
|
||||
if(virusing)
|
||||
to_chat(user, span_infoplain(span_bold("The pathogen materializer is still recharging...")))
|
||||
return
|
||||
var/obj/item/reagent_containers/glass/beaker/product = new(src.loc)
|
||||
|
||||
var/list/data = list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=null,"resistances"=null,"trace_chem"=null,"virus2"=list(),"antibodies"=list())
|
||||
data["virus2"] |= I:virus2
|
||||
product.reagents.add_reagent("blood",30,data)
|
||||
|
||||
virusing = 1
|
||||
spawn(1200) virusing = 0
|
||||
|
||||
state("The [src.name] Buzzes", "blue")
|
||||
return
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/curer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
var/dat
|
||||
if(curing)
|
||||
dat = "Antibody production in progress"
|
||||
else if(virusing)
|
||||
dat = "Virus production in progress"
|
||||
else if(container)
|
||||
// see if there's any blood in the container
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in container.reagents.reagent_list
|
||||
|
||||
if(B)
|
||||
dat = "Blood sample inserted."
|
||||
dat += "<BR>Antibodies: [antigens2string(B.data["antibodies"])]"
|
||||
dat += "<BR><A href='?src=\ref[src];antibody=1'>Begin antibody production</a>"
|
||||
else
|
||||
dat += "<BR>Please check container contents."
|
||||
dat += "<BR><A href='?src=\ref[src];eject=1'>Eject container</a>"
|
||||
else
|
||||
dat = "Please insert a container."
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/process()
|
||||
..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
|
||||
if(curing)
|
||||
curing -= 1
|
||||
if(curing == 0)
|
||||
if(container)
|
||||
createcure(container)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["antibody"])
|
||||
curing = 10
|
||||
else if(href_list["eject"])
|
||||
container.loc = src.loc
|
||||
container = null
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
|
||||
|
||||
/obj/machinery/computer/curer/proc/createcure(var/obj/item/reagent_containers/container)
|
||||
var/obj/item/reagent_containers/glass/beaker/product = new(src.loc)
|
||||
|
||||
var/datum/reagent/blood/B = locate() in container.reagents.reagent_list
|
||||
|
||||
var/list/data = list()
|
||||
data["antibodies"] = B.data["antibodies"]
|
||||
product.reagents.add_reagent("antibodies",30,data)
|
||||
|
||||
state("\The [src.name] buzzes", "blue")
|
||||
@@ -1,193 +0,0 @@
|
||||
/obj/machinery/computer/diseasesplicer
|
||||
name = "disease splicer"
|
||||
icon_keyboard = "med_key"
|
||||
icon_screen = "crew"
|
||||
|
||||
var/datum/disease2/effectholder/memorybank = null
|
||||
var/list/species_buffer = null
|
||||
var/analysed = 0
|
||||
var/obj/item/virusdish/dish = null
|
||||
var/burning = 0
|
||||
var/splicing = 0
|
||||
var/scanning = 0
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attackby(var/obj/item/I as obj, var/mob/user as mob)
|
||||
if(I.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
return ..(I,user)
|
||||
|
||||
if(default_unfasten_wrench(user, I, 20))
|
||||
return
|
||||
|
||||
if(istype(I,/obj/item/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(dish)
|
||||
to_chat(user, "\The [src] is already loaded.")
|
||||
return
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
|
||||
if(istype(I,/obj/item/diseasedisk))
|
||||
to_chat(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)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return TRUE
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/tgui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "DiseaseSplicer", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/tgui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["dish_inserted"] = !!dish
|
||||
|
||||
data["buffer"] = null
|
||||
if(memorybank)
|
||||
data["buffer"] = list("name" = (analysed ? memorybank.effect.name : "Unknown Symptom"), "stage" = memorybank.effect.stage)
|
||||
data["species_buffer"] = null
|
||||
if(species_buffer)
|
||||
data["species_buffer"] = analysed ? jointext(species_buffer, ", ") : "Unknown Species"
|
||||
|
||||
data["effects"] = null
|
||||
data["info"] = null
|
||||
data["growth"] = 0
|
||||
data["affected_species"] = null
|
||||
data["busy"] = null
|
||||
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 ? dish.virus2.affected_species : list()
|
||||
|
||||
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]", "badness" = e.effect.badness)))
|
||||
data["effects"] = effects
|
||||
else
|
||||
data["info"] = "Insufficient cell growth for gene splicing."
|
||||
else
|
||||
data["info"] = "No virus detected."
|
||||
else
|
||||
data["info"] = "No dish loaded."
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(!scanning)
|
||||
ping("\The [src] pings, \"Analysis complete.\"")
|
||||
SStgui.update_uis(src)
|
||||
if(splicing)
|
||||
splicing -= 1
|
||||
if(!splicing)
|
||||
ping("\The [src] pings, \"Splicing operation complete.\"")
|
||||
SStgui.update_uis(src)
|
||||
if(burning)
|
||||
burning -= 1
|
||||
if(!burning)
|
||||
var/obj/item/diseasedisk/d = new /obj/item/diseasedisk(src.loc)
|
||||
d.analysed = analysed
|
||||
if(analysed)
|
||||
if(memorybank)
|
||||
d.name = "[memorybank.effect.name] GNA disk (Stage: [memorybank.effect.stage])"
|
||||
d.effect = memorybank
|
||||
else if(species_buffer)
|
||||
d.name = "[jointext(species_buffer, ", ")] GNA disk"
|
||||
d.species = species_buffer
|
||||
else
|
||||
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
|
||||
|
||||
ping("\The [src] pings, \"Backup disk saved.\"")
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/mob/user = usr
|
||||
add_fingerprint(user)
|
||||
|
||||
switch(action)
|
||||
if("grab")
|
||||
if(dish)
|
||||
memorybank = locate(params["grab"])
|
||||
species_buffer = null
|
||||
analysed = dish.analysed
|
||||
dish = null
|
||||
scanning = 10
|
||||
. = TRUE
|
||||
|
||||
if("affected_species")
|
||||
if(dish)
|
||||
memorybank = null
|
||||
species_buffer = dish.virus2.affected_species
|
||||
analysed = dish.analysed
|
||||
dish = null
|
||||
scanning = 10
|
||||
. = TRUE
|
||||
|
||||
if("eject")
|
||||
if(dish)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
. = TRUE
|
||||
|
||||
if("splice")
|
||||
if(dish)
|
||||
var/target = text2num(params["splice"]) // target = 1 to 4 for effects, 5 for species
|
||||
if(memorybank && 0 < target && target <= 4)
|
||||
if(target < memorybank.effect.stage) return // too powerful, catching this for href exploit prevention
|
||||
|
||||
var/datum/disease2/effectholder/target_holder
|
||||
var/list/illegal_types = list()
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
if(e.stage == target)
|
||||
target_holder = e
|
||||
else
|
||||
illegal_types += e.effect.type
|
||||
if(memorybank.effect.type in illegal_types) return
|
||||
target_holder.effect = memorybank.effect
|
||||
|
||||
else if(species_buffer && target == 5)
|
||||
dish.virus2.affected_species = species_buffer
|
||||
|
||||
else
|
||||
return
|
||||
|
||||
splicing = 10
|
||||
dish.virus2.uniqueID = rand(0,10000)
|
||||
. = TRUE
|
||||
|
||||
if("disk")
|
||||
burning = 10
|
||||
. = TRUE
|
||||
@@ -1,201 +0,0 @@
|
||||
/obj/machinery/disease2/incubator/
|
||||
name = "pathogenic incubator"
|
||||
desc = "Encourages the growth of diseases. This model comes with a dispenser system and a small radiation generator."
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
icon = 'icons/obj/virology_vr.dmi' //VOREStation Edit
|
||||
icon_state = "incubator"
|
||||
var/obj/item/virusdish/dish
|
||||
var/obj/item/reagent_containers/glass/beaker = null
|
||||
var/radiation = 0
|
||||
|
||||
var/on = 0
|
||||
var/power = 0
|
||||
|
||||
var/foodsupply = 0
|
||||
var/toxins = 0
|
||||
|
||||
/obj/machinery/disease2/incubator/attackby(var/obj/O as obj, var/mob/user as mob)
|
||||
if(default_unfasten_wrench(user, O, 20))
|
||||
return
|
||||
|
||||
if(istype(O, /obj/item/reagent_containers/glass) || istype(O,/obj/item/reagent_containers/syringe))
|
||||
|
||||
if(beaker)
|
||||
to_chat(user, "\The [src] is already loaded.")
|
||||
return
|
||||
|
||||
beaker = O
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
|
||||
user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!")
|
||||
SStgui.update_uis(src)
|
||||
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
if(istype(O, /obj/item/virusdish))
|
||||
|
||||
if(dish)
|
||||
to_chat(user, "The dish tray is aleady full!")
|
||||
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]!")
|
||||
SStgui.update_uis(src)
|
||||
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/disease2/incubator/attack_hand(mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/disease2/incubator/tgui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "DishIncubator", name)
|
||||
ui.set_autoupdate(FALSE)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/disease2/incubator/tgui_data(mob/user)
|
||||
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]
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/disease2/incubator/process()
|
||||
if(dish && on && dish.virus2)
|
||||
use_power(50,EQUIP)
|
||||
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
|
||||
SStgui.update_uis(src)
|
||||
|
||||
if(radiation)
|
||||
if(radiation > 50 & prob(5))
|
||||
dish.virus2.majormutate()
|
||||
if(dish.info)
|
||||
dish.info = "OUTDATED : [dish.info]"
|
||||
dish.basic_info = "OUTDATED: [dish.basic_info]"
|
||||
dish.analysed = 0
|
||||
ping("\The [src] pings, \"Mutant viral strain detected.\"")
|
||||
else if(prob(5))
|
||||
dish.virus2.minormutate()
|
||||
radiation -= 1
|
||||
SStgui.update_uis(src)
|
||||
if(toxins && prob(5))
|
||||
dish.virus2.infectionchance -= 1
|
||||
SStgui.update_uis(src)
|
||||
if(toxins > 50)
|
||||
dish.growth = 0
|
||||
dish.virus2 = null
|
||||
SStgui.update_uis(src)
|
||||
else if(!dish)
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
SStgui.update_uis(src)
|
||||
|
||||
if(beaker)
|
||||
if(foodsupply < 100 && beaker.reagents.remove_reagent("virusfood",5))
|
||||
if(foodsupply + 10 <= 100)
|
||||
foodsupply += 10
|
||||
SStgui.update_uis(src)
|
||||
|
||||
if(locate(/datum/reagent/toxin) in beaker.reagents.reagent_list && toxins < 100)
|
||||
for(var/datum/reagent/toxin/T in beaker.reagents.reagent_list)
|
||||
toxins += max(T.strength,1)
|
||||
beaker.reagents.remove_reagent(T.id,1)
|
||||
if(toxins > 100)
|
||||
toxins = 100
|
||||
break
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/obj/machinery/disease2/incubator/tgui_act(action, params)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/mob/user = usr
|
||||
add_fingerprint(user)
|
||||
switch(action)
|
||||
if("ejectchem")
|
||||
if(beaker)
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
. = TRUE
|
||||
|
||||
if("power")
|
||||
if(dish)
|
||||
on = !on
|
||||
icon_state = on ? "incubator_on" : "incubator"
|
||||
. = TRUE
|
||||
|
||||
if("ejectdish")
|
||||
if(dish)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
. = TRUE
|
||||
|
||||
if("rad")
|
||||
radiation = min(100, radiation + 10)
|
||||
. = TRUE
|
||||
|
||||
if("flush")
|
||||
radiation = 0
|
||||
toxins = 0
|
||||
foodsupply = 0
|
||||
. = TRUE
|
||||
|
||||
if("virus")
|
||||
if(!dish)
|
||||
return TRUE
|
||||
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in beaker.reagents.reagent_list
|
||||
if(!B)
|
||||
return TRUE
|
||||
|
||||
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.\"")
|
||||
. = TRUE
|
||||
@@ -1,181 +0,0 @@
|
||||
//Returns 1 if mob can be infected, 0 otherwise.
|
||||
/proc/infection_check(var/mob/living/carbon/M, var/vector = "Airborne")
|
||||
if (!istype(M))
|
||||
return 0
|
||||
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(istype(H) && H.species.get_virus_immune(H))
|
||||
return 0
|
||||
|
||||
var/protection = M.getarmor(null, "bio") //gets the full body bio armour value, weighted by body part coverage.
|
||||
var/score = round(0.06*protection) //scales 100% protection to 6.
|
||||
|
||||
switch(vector)
|
||||
if("Airborne")
|
||||
if(M.internal) //not breathing infected air helps greatly
|
||||
return 0
|
||||
var/obj/item/I = M.wear_mask
|
||||
//masks provide a small bonus and can replace overall bio protection
|
||||
if(I)
|
||||
score = max(score, round(0.06*I.armor["bio"]))
|
||||
if (istype(I, /obj/item/clothing/mask))
|
||||
score += 1 //this should be added after
|
||||
|
||||
if("Contact")
|
||||
if(istype(H))
|
||||
//gloves provide a larger bonus
|
||||
if (istype(H.gloves, /obj/item/clothing/gloves))
|
||||
score += 2
|
||||
|
||||
if(score >= 6)
|
||||
return 0
|
||||
else if(score >= 5 && prob(99))
|
||||
return 0
|
||||
else if(score >= 4 && prob(95))
|
||||
return 0
|
||||
else if(score >= 3 && prob(75))
|
||||
return 0
|
||||
else if(score >= 2 && prob(55))
|
||||
return 0
|
||||
else if(score >= 1 && prob(35))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
//Similar to infection check, but used for when M is spreading the virus.
|
||||
/proc/infection_spreading_check(var/mob/living/carbon/M, var/vector = "Airborne")
|
||||
if (!istype(M))
|
||||
return 0
|
||||
|
||||
var/protection = M.getarmor(null, "bio") //gets the full body bio armour value, weighted by body part coverage.
|
||||
|
||||
if (vector == "Airborne")
|
||||
var/obj/item/I = M.wear_mask
|
||||
if (istype(I))
|
||||
protection = max(protection, I.armor["bio"])
|
||||
|
||||
return prob(protection)
|
||||
|
||||
//Checks if table-passing table can reach target (5 tile radius)
|
||||
/proc/airborne_can_reach(turf/source, turf/target)
|
||||
var/obj/dummy = new(source)
|
||||
dummy.pass_flags = PASSTABLE
|
||||
|
||||
for(var/i=0, i<5, i++) if(!step_towards(dummy, target)) break
|
||||
|
||||
var/rval = dummy.Adjacent(target)
|
||||
dummy.loc = null
|
||||
dummy = null
|
||||
return rval
|
||||
|
||||
//Attemptes to infect mob M with virus. Set forced to 1 to ignore protective clothnig
|
||||
/proc/infect_virus2(var/mob/living/carbon/M,var/datum/disease2/disease/disease,var/forced = 0)
|
||||
if(!istype(disease))
|
||||
// log_debug("Bad virus")
|
||||
return
|
||||
if(!istype(M))
|
||||
// log_debug("Bad mob")
|
||||
return
|
||||
if ("[disease.uniqueID]" in M.virus2)
|
||||
return
|
||||
// if one of the antibodies in the mob's body matches one of the disease's antigens, don't infect
|
||||
var/list/antibodies_in_common = M.antibodies & disease.antigen
|
||||
if(antibodies_in_common.len)
|
||||
return
|
||||
if(M.chem_effects[CE_ANTIBIOTIC])
|
||||
if(prob(disease.resistance))
|
||||
var/datum/disease2/disease/D = disease.getcopy()
|
||||
D.minormutate()
|
||||
D.resistance += rand(1,9)
|
||||
// log_debug("Adding virus")
|
||||
M.virus2["[D.uniqueID]"] = D
|
||||
BITSET(M.hud_updateflag, STATUS_HUD)
|
||||
else
|
||||
return //Virus prevented by antibiotics
|
||||
|
||||
if(!disease.affected_species.len)
|
||||
return
|
||||
|
||||
if (!(M.species.get_bodytype() in disease.affected_species))
|
||||
if (forced)
|
||||
disease.affected_species[1] = M.species.get_bodytype()
|
||||
else
|
||||
return //not compatible with this species
|
||||
|
||||
// log_debug("Infecting [M]")
|
||||
|
||||
if(forced || (infection_check(M, disease.spreadtype) && prob(disease.infectionchance)))
|
||||
var/datum/disease2/disease/D = disease.getcopy()
|
||||
D.minormutate()
|
||||
// log_debug("Adding virus")
|
||||
M.virus2["[D.uniqueID]"] = D
|
||||
BITSET(M.hud_updateflag, STATUS_HUD)
|
||||
|
||||
|
||||
//Infects mob M with disease D
|
||||
/proc/infect_mob(var/mob/living/carbon/M, var/datum/disease2/disease/D)
|
||||
infect_virus2(M,D,1)
|
||||
M.hud_updateflag |= 1 << STATUS_HUD
|
||||
|
||||
//Infects mob M with random lesser disease, if he doesn't have one
|
||||
/proc/infect_mob_random_lesser(var/mob/living/carbon/M)
|
||||
var/datum/disease2/disease/D = new /datum/disease2/disease
|
||||
|
||||
D.makerandom(1)
|
||||
infect_mob(M, D)
|
||||
|
||||
//Infects mob M with random greated disease, if he doesn't have one
|
||||
/proc/infect_mob_random_greater(var/mob/living/carbon/M)
|
||||
var/datum/disease2/disease/D = new /datum/disease2/disease
|
||||
|
||||
D.makerandom(2)
|
||||
infect_mob(M, D)
|
||||
|
||||
//Fancy prob() function.
|
||||
/proc/dprob(var/p)
|
||||
return(prob(sqrt(p)) && prob(sqrt(p)))
|
||||
|
||||
/mob/living/carbon/proc/spread_disease_to(var/mob/living/carbon/victim, var/vector = "Airborne")
|
||||
if (src == victim)
|
||||
return "Neurodegeneration"
|
||||
|
||||
// log_debug("Spreading [vector] diseases from [src] to [victim]")
|
||||
if (virus2.len > 0)
|
||||
for (var/ID in virus2)
|
||||
// log_debug("Attempting virus [ID]")
|
||||
var/datum/disease2/disease/V = virus2[ID]
|
||||
if(V.spreadtype != vector) continue
|
||||
|
||||
//It's hard to get other people sick if you're in an airtight suit.
|
||||
if(!infection_spreading_check(src, V.spreadtype)) continue
|
||||
|
||||
if (vector == "Airborne")
|
||||
if(airborne_can_reach(get_turf(src), get_turf(victim)))
|
||||
// log_debug("In range, infecting")
|
||||
infect_virus2(victim,V)
|
||||
// else
|
||||
// log_debug("Could not reach target")
|
||||
|
||||
if (vector == "Contact")
|
||||
if (Adjacent(victim))
|
||||
// log_debug("In range, infecting")
|
||||
infect_virus2(victim,V)
|
||||
|
||||
//contact goes both ways
|
||||
if (victim.virus2.len > 0 && vector == "Contact" && Adjacent(victim))
|
||||
// log_debug("Spreading [vector] diseases from [victim] to [src]")
|
||||
var/nudity = 1
|
||||
|
||||
if (ishuman(victim))
|
||||
var/mob/living/carbon/human/H = victim
|
||||
var/obj/item/organ/external/select_area = H.get_organ(src.zone_sel.selecting)
|
||||
var/list/clothes = list(H.head, H.wear_mask, H.wear_suit, H.w_uniform, H.gloves, H.shoes)
|
||||
for(var/obj/item/clothing/C in clothes)
|
||||
if(C && istype(C))
|
||||
if(C.body_parts_covered & select_area.body_part)
|
||||
nudity = 0
|
||||
if (nudity)
|
||||
for (var/ID in victim.virus2)
|
||||
var/datum/disease2/disease/V = victim.virus2[ID]
|
||||
if(V && V.spreadtype != vector) continue
|
||||
if(!infection_spreading_check(victim, V.spreadtype)) continue
|
||||
infect_virus2(src,V)
|
||||
@@ -1,211 +0,0 @@
|
||||
/obj/machinery/disease2/isolator/
|
||||
name = "pathogenic isolator"
|
||||
desc = "Used to isolate and identify diseases, allowing for comparison with a remote database."
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
icon = 'icons/obj/virology_vr.dmi' //VOREStation Edit
|
||||
icon_state = "isolator"
|
||||
var/isolating = 0
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/obj/item/reagent_containers/syringe/sample = null
|
||||
|
||||
/obj/machinery/disease2/isolator/update_icon()
|
||||
if (stat & (BROKEN|NOPOWER))
|
||||
icon_state = "isolator"
|
||||
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(default_unfasten_wrench(user, O, 20))
|
||||
return
|
||||
|
||||
else if(!istype(O,/obj/item/reagent_containers/syringe)) return
|
||||
var/obj/item/reagent_containers/syringe/S = O
|
||||
|
||||
if(sample)
|
||||
to_chat(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]!")
|
||||
SStgui.update_uis(src)
|
||||
update_icon()
|
||||
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/disease2/isolator/attack_hand(mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/disease2/isolator/tgui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "PathogenicIsolator", name)
|
||||
ui.open()
|
||||
|
||||
|
||||
/obj/machinery/disease2/isolator/tgui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["syringe_inserted"] = !!sample
|
||||
data["isolating"] = isolating
|
||||
data["pathogen_pool"] = null
|
||||
data["can_print"] = !isolating
|
||||
|
||||
var/list/pathogen_pool = list()
|
||||
if(sample)
|
||||
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" = "[istype(D) ? "[D.get_species()] " : ""][B.name]", \
|
||||
"dna" = B.data["blood_DNA"], \
|
||||
"unique_id" = V.uniqueID, \
|
||||
"reference" = "\ref[V]", \
|
||||
"is_in_database" = !!R, \
|
||||
"record" = "\ref[R]")))
|
||||
data["pathogen_pool"] = pathogen_pool
|
||||
|
||||
var/list/db = list()
|
||||
for(var/ID in virusDB)
|
||||
var/datum/data/record/r = virusDB[ID]
|
||||
db.Add(list(list("name" = r.fields["name"], "record" = "\ref[r]")))
|
||||
data["database"] = db
|
||||
data["modal"] = tgui_modal_data(src)
|
||||
return data
|
||||
|
||||
/obj/machinery/disease2/isolator/process()
|
||||
if (isolating > 0)
|
||||
isolating -= 1
|
||||
if (isolating == 0)
|
||||
if (virus2)
|
||||
var/obj/item/virusdish/d = new /obj/item/virusdish(src.loc)
|
||||
d.virus2 = virus2.getcopy()
|
||||
virus2 = null
|
||||
ping("\The [src] pings, \"Viral strain isolated.\"")
|
||||
|
||||
SStgui.update_uis(src)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/disease2/isolator/tgui_act(action, list/params)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/mob/user = usr
|
||||
add_fingerprint(user)
|
||||
|
||||
. = TRUE
|
||||
switch(tgui_modal_act(src, action, params))
|
||||
if(TGUI_MODAL_ANSWER)
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("view_entry")
|
||||
var/datum/data/record/v = locate(params["vir"])
|
||||
if(!istype(v))
|
||||
return FALSE
|
||||
tgui_modal_message(src, "virus", "", null, v.fields["tgui_description"])
|
||||
return TRUE
|
||||
|
||||
if("print")
|
||||
print(user, params)
|
||||
return TRUE
|
||||
|
||||
if("isolate")
|
||||
var/datum/disease2/disease/V = locate(params["isolate"])
|
||||
if (V)
|
||||
virus2 = V
|
||||
isolating = 20
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
if("eject")
|
||||
if(!sample)
|
||||
return FALSE
|
||||
sample.forceMove(loc)
|
||||
sample = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/disease2/isolator/proc/print(mob/user, list/params)
|
||||
var/obj/item/paper/P = new /obj/item/paper(loc)
|
||||
|
||||
switch(params["type"])
|
||||
if("patient_diagnosis")
|
||||
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("virus_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("virus_record")
|
||||
var/datum/data/record/v = locate(params["vir"])
|
||||
if(!istype(v))
|
||||
return FALSE
|
||||
P.name = "paper - Viral Profile"
|
||||
P.info = {"
|
||||
[virology_letterhead("Viral Profile")]
|
||||
[v.fields["description"]]
|
||||
<hr>
|
||||
<u>Additional Notes:</u>
|
||||
"}
|
||||
|
||||
state("The nearby computer prints out a report.")
|
||||
@@ -1,114 +0,0 @@
|
||||
///////////////ANTIBODY SCANNER///////////////
|
||||
|
||||
/obj/item/antibody_scanner
|
||||
name = "antibody scanner"
|
||||
desc = "Scans living beings for antibodies in their blood."
|
||||
icon = 'icons/obj/device_vr.dmi'
|
||||
icon_state = "antibody"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
item_state = "electronic"
|
||||
|
||||
/obj/item/antibody_scanner/attack(mob/M as mob, mob/user as mob)
|
||||
if(!istype(M,/mob/living/carbon/))
|
||||
report("Scan aborted: Incompatible target.", user)
|
||||
return
|
||||
|
||||
var/mob/living/carbon/C = M
|
||||
if (istype(C,/mob/living/carbon/human/))
|
||||
var/mob/living/carbon/human/H = C
|
||||
if(!H.should_have_organ(O_HEART))
|
||||
report("Scan aborted: The target does not have blood.", user)
|
||||
return
|
||||
|
||||
if(!C.antibodies.len)
|
||||
report("Scan Complete: No antibodies detected.", user)
|
||||
return
|
||||
|
||||
if (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/antibody_scanner/proc/report(var/text, mob/user as mob)
|
||||
to_chat(user, "[span_blue("[icon2html(src, user.client)] \The [src] beeps,")] \"[span_blue("[text]")]\"")
|
||||
|
||||
///////////////VIRUS DISH///////////////
|
||||
|
||||
/obj/item/virusdish
|
||||
name = "virus dish"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "virussample"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/growth = 0
|
||||
var/basic_info = null
|
||||
var/info = 0
|
||||
var/analysed = 0
|
||||
|
||||
/obj/item/virusdish/random
|
||||
name = "virus sample"
|
||||
|
||||
/obj/item/virusdish/random/New()
|
||||
..()
|
||||
src.virus2 = new /datum/disease2/disease
|
||||
src.virus2.makerandom()
|
||||
growth = rand(5, 50)
|
||||
|
||||
/obj/item/virusdish/attackby(var/obj/item/W as obj,var/mob/living/carbon/user as mob)
|
||||
if(istype(W,/obj/item/hand_labeler) || istype(W,/obj/item/reagent_containers/syringe))
|
||||
//VOREstation edit - Actually functional virus dishes
|
||||
// Originally this returns, THEN calls ..() instead of returning the value of ..()
|
||||
return ..()
|
||||
//VOREstation edit end
|
||||
if(prob(50))
|
||||
to_chat(user, span_danger("\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)))
|
||||
infect_virus2(target, src.virus2)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/virusdish/examine(mob/user)
|
||||
. = ..()
|
||||
if(basic_info)
|
||||
. += "[basic_info] : <a href='?src=\ref[src];info=1'>More Information</a>"
|
||||
|
||||
/obj/item/virusdish/Topic(href, href_list)
|
||||
. = ..()
|
||||
if(.) return 1
|
||||
|
||||
if(href_list["info"])
|
||||
usr << browse(info, "window=info_\ref[src]")
|
||||
return 1
|
||||
|
||||
/obj/item/ruinedvirusdish
|
||||
name = "ruined virus sample"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "virussample-ruined"
|
||||
desc = "The bacteria in the dish are completely dead."
|
||||
|
||||
/obj/item/ruinedvirusdish/attackby(var/obj/item/W as obj,var/mob/living/carbon/user as mob)
|
||||
if(istype(W,/obj/item/hand_labeler) || istype(W,/obj/item/reagent_containers/syringe))
|
||||
return ..()
|
||||
|
||||
if(prob(50))
|
||||
to_chat(user, "\The [src] shatters!")
|
||||
qdel(src)
|
||||
|
||||
///////////////GNA DISK///////////////
|
||||
|
||||
/obj/item/diseasedisk
|
||||
name = "blank GNA disk"
|
||||
icon = 'icons/obj/cloning.dmi'
|
||||
icon_state = "datadisk0"
|
||||
w_class = ITEMSIZE_TINY
|
||||
var/datum/disease2/effectholder/effect = null
|
||||
var/list/species = null
|
||||
var/stage = 1
|
||||
var/analysed = 1
|
||||
|
||||
/obj/item/diseasedisk/premade/New()
|
||||
name = "blank GNA disk (stage: [stage])"
|
||||
effect = new /datum/disease2/effectholder
|
||||
effect.effect = new /datum/disease2/effect/invisible
|
||||
effect.stage = stage
|
||||
Reference in New Issue
Block a user