mirror of
https://github.com/Aurorastation/Aurora-Old.git
synced 2026-08-23 04:36:18 +01:00
Initial Commit
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
/obj/machinery/disease2/diseaseanalyser
|
||||
name = "Disease Analyser"
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "analyser"
|
||||
anchored = 1
|
||||
density = 1
|
||||
|
||||
var/scanning = 0
|
||||
var/pause = 0
|
||||
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
|
||||
/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\blue [user.name] inserts the [dish.name] in the [src.name]", 3)
|
||||
else
|
||||
user << "There is already a dish inserted"
|
||||
return
|
||||
|
||||
|
||||
/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()
|
||||
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.loc)
|
||||
P.info = r
|
||||
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")
|
||||
|
||||
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.name] buzzes")
|
||||
pause = 0
|
||||
return
|
||||
@@ -0,0 +1,52 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
// reserving some numbers for later special antigens
|
||||
var/global/const/ANTIGEN_A = 1
|
||||
var/global/const/ANTIGEN_B = 2
|
||||
var/global/const/ANTIGEN_RH = 4
|
||||
var/global/const/ANTIGEN_Q = 8
|
||||
var/global/const/ANTIGEN_U = 16
|
||||
var/global/const/ANTIGEN_V = 32
|
||||
var/global/const/ANTIGEN_X = 64
|
||||
var/global/const/ANTIGEN_Y = 128
|
||||
var/global/const/ANTIGEN_Z = 256
|
||||
var/global/const/ANTIGEN_M = 512
|
||||
var/global/const/ANTIGEN_N = 1024
|
||||
var/global/const/ANTIGEN_P = 2048
|
||||
var/global/const/ANTIGEN_O = 4096
|
||||
|
||||
var/global/list/ANTIGENS = list(
|
||||
"[ANTIGEN_A]" = "A",
|
||||
"[ANTIGEN_B]" = "B",
|
||||
"[ANTIGEN_RH]" = "RH",
|
||||
"[ANTIGEN_Q]" = "Q",
|
||||
"[ANTIGEN_U]" = "U",
|
||||
"[ANTIGEN_V]" = "V",
|
||||
"[ANTIGEN_Z]" = "Z",
|
||||
"[ANTIGEN_M]" = "M",
|
||||
"[ANTIGEN_N]" = "N",
|
||||
"[ANTIGEN_P]" = "P",
|
||||
"[ANTIGEN_O]" = "O"
|
||||
)
|
||||
|
||||
// pure concentrated antibodies
|
||||
datum/reagent/antibodies
|
||||
data = list("antibodies"=0)
|
||||
name = "Antibodies"
|
||||
id = "antibodies"
|
||||
reagent_state = LIQUID
|
||||
color = "#0050F0"
|
||||
|
||||
reaction_mob(var/mob/M, var/method=TOUCH, var/volume)
|
||||
if(istype(M,/mob/living/carbon))
|
||||
if(src.data && method == INGEST)
|
||||
if(M:virus2) if(src.data["antibodies"] & M:virus2.antigen)
|
||||
M:virus2.dead = 1
|
||||
M:antibodies |= src.data["antibodies"]
|
||||
return
|
||||
|
||||
// iterate over the list of antigens and see what matches
|
||||
/proc/antigens2string(var/antigens)
|
||||
var/code = ""
|
||||
for(var/V in ANTIGENS) if(text2num(V) & antigens) code += ANTIGENS[V]
|
||||
return code
|
||||
@@ -0,0 +1,20 @@
|
||||
/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/weapon/virusdish/,/obj/item/weapon/cureimplanter,/obj/item/weapon/diseasedisk,/obj/item/weapon/reagent_containers)
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/machinery/disease2/biodestroyer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
for(var/path in accepts)
|
||||
if(I.type in typesof(path))
|
||||
user.drop_item()
|
||||
del(I)
|
||||
overlays += image('icons/obj/pipes/disposal.dmi', "dispover-handle")
|
||||
return
|
||||
user.drop_item()
|
||||
I.loc = src.loc
|
||||
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue The [src.name] beeps", 2)
|
||||
@@ -0,0 +1,154 @@
|
||||
/obj/machinery/computer/centrifuge
|
||||
name = "Isolation Centrifuge"
|
||||
desc = "Used to separate things with different weight. Spin 'em round, round, right round."
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "centrifuge"
|
||||
var/curing
|
||||
var/isolating
|
||||
|
||||
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)
|
||||
|
||||
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
|
||||
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/centrifuge/update_icon()
|
||||
..()
|
||||
if(! (stat & (BROKEN|NOPOWER)) && (isolating || curing))
|
||||
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>"
|
||||
|
||||
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>"
|
||||
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>"
|
||||
|
||||
dat += "<hr>"
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/centrifuge/process()
|
||||
..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
|
||||
if(curing)
|
||||
curing -= 1
|
||||
if(curing == 0)
|
||||
if(sample)
|
||||
cure()
|
||||
update_icon()
|
||||
if(isolating)
|
||||
isolating -= 1
|
||||
if(isolating == 0)
|
||||
if(sample)
|
||||
isolate()
|
||||
update_icon()
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/centrifuge/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(usr) usr.set_machine(src)
|
||||
|
||||
switch(href_list["action"])
|
||||
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")
|
||||
|
||||
else if(sample.reagents.has_reagent("toxins"))
|
||||
state("\The [src.name] beeps, \"Pathogen purging speed above nominal.\"", "blue")
|
||||
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")
|
||||
|
||||
if("sample")
|
||||
if(sample)
|
||||
sample.loc = src.loc
|
||||
sample = null
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
attack_hand(usr)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/centrifuge/proc/cure()
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
|
||||
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)
|
||||
|
||||
state("\The [src.name] pings", "blue")
|
||||
|
||||
/obj/machinery/computer/centrifuge/proc/isolate()
|
||||
var/obj/item/weapon/virusdish/dish = new/obj/item/weapon/virusdish(src.loc)
|
||||
dish.virus2 = virus2
|
||||
|
||||
state("\The [src.name] pings", "blue")
|
||||
@@ -0,0 +1,113 @@
|
||||
/obj/machinery/computer/curer
|
||||
name = "Cure Research Machine"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "dna"
|
||||
var/curing
|
||||
var/virusing
|
||||
|
||||
var/obj/item/weapon/reagent_containers/container = null
|
||||
|
||||
/obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
return ..(I,user)
|
||||
if(istype(I,/obj/item/weapon/reagent_containers))
|
||||
var/mob/living/carbon/C = user
|
||||
if(!container)
|
||||
container = I
|
||||
C.drop_item()
|
||||
I.loc = src
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
if(virusing)
|
||||
user << "<b>The pathogen materializer is still recharging.."
|
||||
return
|
||||
var/obj/item/weapon/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"=0)
|
||||
data["virus2"] |= I:virus2
|
||||
product.reagents.add_reagent("blood",30,data)
|
||||
|
||||
virusing = 1
|
||||
spawn(1200) virusing = 0
|
||||
|
||||
state("The [src.name] Buzzes", "blue")
|
||||
return
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/curer/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/curer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
var/dat
|
||||
if(curing)
|
||||
dat = "Antibody production in progress"
|
||||
else if(virusing)
|
||||
dat = "Virus production in progress"
|
||||
else if(container)
|
||||
// see if there's any blood in the container
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in container.reagents.reagent_list
|
||||
|
||||
if(B)
|
||||
dat = "Blood sample inserted."
|
||||
var/code = ""
|
||||
for(var/V in ANTIGENS) if(text2num(V) & B.data["antibodies"]) code += ANTIGENS[V]
|
||||
dat += "<BR>Antibodies: [code]"
|
||||
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
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["antibody"])
|
||||
curing = 10
|
||||
else if(href_list["eject"])
|
||||
container.loc = src.loc
|
||||
container = null
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/curer/proc/createcure(var/obj/item/weapon/reagent_containers/container)
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/product = new(src.loc)
|
||||
|
||||
var/datum/reagent/blood/B = locate() in container.reagents.reagent_list
|
||||
|
||||
var/list/data = list()
|
||||
data["antibodies"] = B.data["antibodies"]
|
||||
product.reagents.add_reagent("antibodies",30,data)
|
||||
|
||||
state("\The [src.name] buzzes", "blue")
|
||||
@@ -0,0 +1,194 @@
|
||||
/datum/disease2/disease
|
||||
var/infectionchance = 70
|
||||
var/speed = 1
|
||||
var/spreadtype = "Contact" // Can also be "Airborne"
|
||||
var/stage = 1
|
||||
var/stageprob = 10
|
||||
var/dead = 0
|
||||
var/clicks = 0
|
||||
var/uniqueID = 0
|
||||
var/list/datum/disease2/effectholder/effects = list()
|
||||
var/antigen = 0 // 16 bits describing the antigens, when one bit is set, a cure with that bit can dock here
|
||||
var/max_stage = 4
|
||||
|
||||
/datum/disease2/disease/New()
|
||||
uniqueID = rand(0,10000)
|
||||
..()
|
||||
|
||||
/datum/disease2/disease/proc/makerandom(var/greater=0)
|
||||
for(var/i=1 ; i <= max_stage ; i++ )
|
||||
var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder
|
||||
holder.stage = i
|
||||
if(greater)
|
||||
holder.getrandomeffect(2)
|
||||
else
|
||||
holder.getrandomeffect()
|
||||
effects += holder
|
||||
uniqueID = rand(0,10000)
|
||||
infectionchance = rand(60,90)
|
||||
antigen |= text2num(pick(ANTIGENS))
|
||||
antigen |= text2num(pick(ANTIGENS))
|
||||
spreadtype = prob(70) ? "Airborne" : "Contact"
|
||||
|
||||
/datum/disease2/disease/proc/activate(var/mob/living/carbon/mob)
|
||||
if(dead)
|
||||
cure(mob)
|
||||
return
|
||||
|
||||
if(mob.stat == 2)
|
||||
return
|
||||
if(stage <= 1 && clicks == 0) // with a certain chance, the mob may become immune to the disease before it starts properly
|
||||
if(prob(5))
|
||||
mob.antibodies |= antigen // 20% immunity is a good chance IMO, because it allows finding an immune person easily
|
||||
|
||||
if(mob.radiation > 50)
|
||||
if(prob(1))
|
||||
majormutate()
|
||||
|
||||
//Space antibiotics stop disease completely (temporary)
|
||||
if(mob.reagents.has_reagent("spaceacillin"))
|
||||
return
|
||||
|
||||
//Virus food speeds up disease progress
|
||||
if(mob.reagents.has_reagent("virusfood"))
|
||||
mob.reagents.remove_reagent("virusfood",0.1)
|
||||
clicks += 10
|
||||
|
||||
//Moving to the next stage
|
||||
if(clicks > stage*100 && prob(10))
|
||||
if(stage == max_stage)
|
||||
src.cure(mob)
|
||||
mob.antibodies |= src.antigen
|
||||
stage++
|
||||
clicks = 0
|
||||
//Do nasty effects
|
||||
for(var/datum/disease2/effectholder/e in effects)
|
||||
e.runeffect(mob,stage)
|
||||
|
||||
//Short airborne spread
|
||||
if(src.spreadtype == "Airborne")
|
||||
for(var/mob/living/carbon/M in oview(1,mob))
|
||||
if(airborne_can_reach(get_turf(mob), get_turf(M)))
|
||||
infect_virus2(M,src)
|
||||
|
||||
//fever
|
||||
mob.bodytemperature = max(mob.bodytemperature, min(310+5*stage ,mob.bodytemperature+5*stage))
|
||||
clicks+=speed
|
||||
|
||||
/datum/disease2/disease/proc/cure(var/mob/living/carbon/mob)
|
||||
for(var/datum/disease2/effectholder/e in effects)
|
||||
e.effect.deactivate(mob)
|
||||
mob.virus2.Remove("[uniqueID]")
|
||||
|
||||
/datum/disease2/disease/proc/minormutate()
|
||||
//uniqueID = rand(0,10000)
|
||||
var/datum/disease2/effectholder/holder = pick(effects)
|
||||
holder.minormutate()
|
||||
infectionchance = min(50,infectionchance + rand(0,10))
|
||||
|
||||
/datum/disease2/disease/proc/majormutate()
|
||||
uniqueID = rand(0,10000)
|
||||
var/datum/disease2/effectholder/holder = pick(effects)
|
||||
holder.majormutate()
|
||||
if (prob(5))
|
||||
antigen = text2num(pick(ANTIGENS))
|
||||
antigen |= text2num(pick(ANTIGENS))
|
||||
|
||||
/datum/disease2/disease/proc/getcopy()
|
||||
var/datum/disease2/disease/disease = new /datum/disease2/disease
|
||||
disease.infectionchance = infectionchance
|
||||
disease.spreadtype = spreadtype
|
||||
disease.stageprob = stageprob
|
||||
disease.antigen = antigen
|
||||
disease.uniqueID = uniqueID
|
||||
for(var/datum/disease2/effectholder/holder in effects)
|
||||
var/datum/disease2/effectholder/newholder = new /datum/disease2/effectholder
|
||||
newholder.effect = new holder.effect.type
|
||||
newholder.chance = holder.chance
|
||||
newholder.cure = holder.cure
|
||||
newholder.multiplier = holder.multiplier
|
||||
newholder.happensonce = holder.happensonce
|
||||
newholder.stage = holder.stage
|
||||
disease.effects += newholder
|
||||
return disease
|
||||
|
||||
/datum/disease2/disease/proc/issame(var/datum/disease2/disease/disease)
|
||||
var/list/types = list()
|
||||
var/list/types2 = list()
|
||||
for(var/datum/disease2/effectholder/d in effects)
|
||||
types += d.effect.type
|
||||
var/equal = 1
|
||||
|
||||
for(var/datum/disease2/effectholder/d in disease.effects)
|
||||
types2 += d.effect.type
|
||||
|
||||
for(var/type in types)
|
||||
if(!(type in types2))
|
||||
equal = 0
|
||||
|
||||
if (antigen != disease.antigen)
|
||||
equal = 0
|
||||
return equal
|
||||
|
||||
/proc/virus_copylist(var/list/datum/disease2/disease/viruses)
|
||||
var/list/res = list()
|
||||
for (var/ID in viruses)
|
||||
var/datum/disease2/disease/V = viruses[ID]
|
||||
res["[V.uniqueID]"] = V.getcopy()
|
||||
return res
|
||||
|
||||
|
||||
var/global/list/virusDB = list()
|
||||
|
||||
/datum/disease2/disease/proc/name()
|
||||
.= "stamm #[add_zero("[uniqueID]", 4)]"
|
||||
if ("[uniqueID]" in virusDB)
|
||||
var/datum/data/record/V = virusDB["[uniqueID]"]
|
||||
.= 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]"
|
||||
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]."
|
||||
|
||||
r += "<BR>Antigen pattern: [antigens2string(antigen)]"
|
||||
return r
|
||||
|
||||
/datum/disease2/disease/proc/addToDB()
|
||||
if ("[uniqueID]" in virusDB)
|
||||
return 0
|
||||
var/datum/data/record/v = new()
|
||||
v.fields["id"] = uniqueID
|
||||
v.fields["name"] = name()
|
||||
v.fields["description"] = get_info()
|
||||
v.fields["antigen"] = antigens2string(antigen)
|
||||
v.fields["spread type"] = spreadtype
|
||||
virusDB["[uniqueID]"] = v
|
||||
return 1
|
||||
|
||||
proc/virus2_lesser_infection()
|
||||
var/list/candidates = list() //list of candidate keys
|
||||
|
||||
for(var/mob/living/carbon/human/G in player_list)
|
||||
if(G.client && G.stat != DEAD)
|
||||
candidates += G
|
||||
if(!candidates.len) return
|
||||
|
||||
candidates = shuffle(candidates)
|
||||
|
||||
infect_mob_random_lesser(candidates[1])
|
||||
|
||||
proc/virus2_greater_infection()
|
||||
var/list/candidates = list() //list of candidate keys
|
||||
|
||||
for(var/mob/living/carbon/human/G in player_list)
|
||||
if(G.client && G.stat != DEAD)
|
||||
candidates += G
|
||||
if(!candidates.len) return
|
||||
|
||||
candidates = shuffle(candidates)
|
||||
|
||||
infect_mob_random_greater(candidates[1])
|
||||
@@ -0,0 +1,147 @@
|
||||
/obj/machinery/computer/diseasesplicer
|
||||
name = "Disease Splicer"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "crew"
|
||||
|
||||
var/datum/disease2/effectholder/memorybank = null
|
||||
var/analysed = 0
|
||||
var/obj/item/weapon/virusdish/dish = null
|
||||
var/burning = 0
|
||||
|
||||
var/splicing = 0
|
||||
var/scanning = 0
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
return ..(I,user)
|
||||
if(istype(I,/obj/item/weapon/virusdish))
|
||||
var/mob/living/carbon/c = user
|
||||
if(!dish)
|
||||
|
||||
dish = I
|
||||
c.drop_item()
|
||||
I.loc = src
|
||||
if(istype(I,/obj/item/weapon/diseasedisk))
|
||||
user << "You upload the contents of the disk into the buffer"
|
||||
memorybank = I:effect
|
||||
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.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."
|
||||
else
|
||||
if(dish)
|
||||
dat = "Virus dish inserted."
|
||||
|
||||
dat += "<BR>Current DNA strand : "
|
||||
if(memorybank)
|
||||
dat += "<A href='?src=\ref[src];splice=1'>"
|
||||
if(analysed)
|
||||
dat += "[memorybank.effect.name] ([5-memorybank.effect.stage])"
|
||||
else
|
||||
dat += "Unknown DNA strand ([5-memorybank.effect.stage])"
|
||||
dat += "</a>"
|
||||
|
||||
dat += "<BR><A href='?src=\ref[src];disk=1'>Burn DNA Sequence to data storage disk</a>"
|
||||
else
|
||||
dat += "Empty."
|
||||
|
||||
dat += "<BR><BR>"
|
||||
|
||||
if(dish)
|
||||
if(dish.virus2)
|
||||
if(dish.growth >= 50)
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
dat += "<BR><A href='?src=\ref[src];grab=\ref[e]'> DNA strand"
|
||||
if(dish.analysed)
|
||||
dat += ": [e.effect.name]"
|
||||
dat += " (5-[e.effect.stage])</a>"
|
||||
else
|
||||
dat += "<BR>Insufficent cells to attempt gene splicing."
|
||||
else
|
||||
dat += "<BR>No virus found in dish."
|
||||
|
||||
dat += "<BR><BR><A href='?src=\ref[src];eject=1'>Eject disk</a>"
|
||||
else
|
||||
dat += "<BR>Please insert dish."
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
|
||||
if(scanning)
|
||||
scanning -= 1
|
||||
if(!scanning)
|
||||
state("The [src.name] beeps", "blue")
|
||||
if(splicing)
|
||||
splicing -= 1
|
||||
if(!splicing)
|
||||
state("The [src.name] pings", "blue")
|
||||
if(burning)
|
||||
burning -= 1
|
||||
if(!burning)
|
||||
var/obj/item/weapon/diseasedisk/d = new /obj/item/weapon/diseasedisk(src.loc)
|
||||
if(analysed)
|
||||
d.name = "[memorybank.effect.name] GNA disk (Stage: [5-memorybank.effect.stage])"
|
||||
else
|
||||
d.name = "Unknown GNA disk (Stage: [5-memorybank.effect.stage])"
|
||||
d.effect = memorybank
|
||||
state("The [src.name] zings", "blue")
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/diseasesplicer/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(usr) usr.set_machine(src)
|
||||
|
||||
if (href_list["grab"])
|
||||
memorybank = locate(href_list["grab"])
|
||||
analysed = dish.analysed
|
||||
del(dish)
|
||||
dish = null
|
||||
scanning = 10
|
||||
|
||||
else if(href_list["eject"])
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
|
||||
else 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
|
||||
splicing = 10
|
||||
// dish.virus2.spreadtype = "Blood"
|
||||
|
||||
else if(href_list["disk"])
|
||||
burning = 10
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -0,0 +1,168 @@
|
||||
/obj/machinery/disease2/incubator/
|
||||
name = "Pathogenic incubator"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "incubator"
|
||||
var/obj/item/weapon/virusdish/dish
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/radiation = 0
|
||||
|
||||
var/on = 0
|
||||
var/power = 0
|
||||
|
||||
var/foodsupply = 0
|
||||
var/toxins = 0
|
||||
|
||||
var/virusing
|
||||
|
||||
/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."
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
|
||||
user << "You add the syringe to the machine!"
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
user << "You add the beaker to the machine!"
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
if(istype(B,/obj/item/weapon/virusdish))
|
||||
if(src.dish)
|
||||
user << "A dish is already loaded into the machine."
|
||||
return
|
||||
|
||||
src.dish = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
if(istype(B,/obj/item/weapon/virusdish))
|
||||
user << "You add the dish to the machine!"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/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)
|
||||
return
|
||||
if (href_list["power"])
|
||||
on = !on
|
||||
if(on)
|
||||
icon_state = "incubator_on"
|
||||
else
|
||||
icon_state = "incubator"
|
||||
if (href_list["ejectdish"])
|
||||
if(dish)
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
if (href_list["rad"])
|
||||
radiation += 10
|
||||
if (href_list["flush"])
|
||||
radiation = 0
|
||||
toxins = 0
|
||||
foodsupply = 0
|
||||
|
||||
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
|
||||
|
||||
state("\The [src.name] pings, \"Injection complete.\"", "blue")
|
||||
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/disease2/incubator/attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
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
|
||||
|
||||
/obj/machinery/disease2/incubator/process()
|
||||
if(dish && on && dish.virus2)
|
||||
use_power(50,EQUIP)
|
||||
if(!powered(EQUIP))
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
if(foodsupply)
|
||||
foodsupply -= 1
|
||||
dish.growth += 3
|
||||
if(dish.growth >= 100)
|
||||
state("The [src.name] pings", "blue")
|
||||
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")
|
||||
|
||||
else if(prob(5))
|
||||
dish.virus2.minormutate()
|
||||
radiation -= 1
|
||||
if(toxins && prob(5))
|
||||
dish.virus2.infectionchance -= 1
|
||||
if(toxins > 50)
|
||||
dish.virus2 = null
|
||||
else if(!dish)
|
||||
on = 0
|
||||
icon_state = "incubator"
|
||||
|
||||
if(beaker)
|
||||
if(!beaker.reagents.remove_reagent("virusfood",5))
|
||||
foodsupply += 10
|
||||
if(!beaker.reagents.remove_reagent("toxin",1))
|
||||
toxins += 1
|
||||
|
||||
src.updateUsrDialog()
|
||||
@@ -0,0 +1,364 @@
|
||||
/datum/disease2/effectholder
|
||||
var/name = "Holder"
|
||||
var/datum/disease2/effect/effect
|
||||
var/chance = 0 //Chance in percentage each tick
|
||||
var/cure = "" //Type of cure it requires
|
||||
var/happensonce = 0
|
||||
var/multiplier = 1 //The chance the effects are WORSE
|
||||
var/stage = 0
|
||||
|
||||
/datum/disease2/effectholder/proc/runeffect(var/mob/living/carbon/human/mob,var/stage)
|
||||
if(happensonce > -1 && effect.stage <= stage && prob(chance))
|
||||
effect.activate(mob)
|
||||
if(happensonce == 1)
|
||||
happensonce = -1
|
||||
|
||||
/datum/disease2/effectholder/proc/getrandomeffect(var/badness = 1)
|
||||
var/list/datum/disease2/effect/list = list()
|
||||
for(var/e in (typesof(/datum/disease2/effect) - /datum/disease2/effect))
|
||||
var/datum/disease2/effect/f = new e
|
||||
if (f.badness > badness) //we don't want such strong effects
|
||||
continue
|
||||
if(f.stage == src.stage)
|
||||
list += f
|
||||
effect = pick(list)
|
||||
chance = rand(1,6)
|
||||
|
||||
/datum/disease2/effectholder/proc/minormutate()
|
||||
switch(pick(1,2,3,4,5))
|
||||
if(1)
|
||||
chance = rand(0,effect.chance_maxm)
|
||||
if(2)
|
||||
multiplier = rand(1,effect.maxm)
|
||||
|
||||
/datum/disease2/effectholder/proc/majormutate()
|
||||
getrandomeffect(2)
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
////////////////////////EFFECTS/////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/disease2/effect
|
||||
var/chance_maxm = 50
|
||||
var/name = "Blanking effect"
|
||||
var/stage = 4
|
||||
var/maxm = 1
|
||||
var/badness = 1
|
||||
proc/activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
proc/deactivate(var/mob/living/carbon/mob)
|
||||
|
||||
////////////////////////SPECIAL/////////////////////////////////
|
||||
/*/datum/disease2/effect/alien
|
||||
name = "Unidentified Foreign Body"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob << "\red You feel something tearing its way out of your stomach..."
|
||||
mob.adjustToxLoss(10)
|
||||
mob.updatehealth()
|
||||
if(prob(40))
|
||||
if(mob.client)
|
||||
mob.client.mob = new/mob/living/carbon/alien/larva(mob.loc)
|
||||
else
|
||||
new/mob/living/carbon/alien/larva(mob.loc)
|
||||
var/datum/disease2/disease/D = mob:virus2
|
||||
mob:gib()
|
||||
del D*/
|
||||
|
||||
/datum/disease2/effect/invisible
|
||||
name = "Waiting Syndrome"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
return
|
||||
|
||||
////////////////////////STAGE 4/////////////////////////////////
|
||||
|
||||
/datum/disease2/effect/gibbingtons
|
||||
name = "Gibbingtons Syndrome"
|
||||
stage = 4
|
||||
badness = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.gib()
|
||||
|
||||
/datum/disease2/effect/radian
|
||||
name = "Radian's Syndrome"
|
||||
stage = 4
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.radiation += (2*multiplier)
|
||||
|
||||
/datum/disease2/effect/deaf
|
||||
name = "Dead Ear Syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.ear_deaf += 20
|
||||
|
||||
/datum/disease2/effect/monkey
|
||||
name = "Monkism Syndrome"
|
||||
stage = 4
|
||||
badness = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/h = mob
|
||||
h.monkeyize()
|
||||
|
||||
/datum/disease2/effect/suicide
|
||||
name = "Suicidal Syndrome"
|
||||
stage = 4
|
||||
badness = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.suiciding = 1
|
||||
//instead of killing them instantly, just put them at -175 health and let 'em gasp for a while
|
||||
viewers(mob) << "\red <b>[mob.name] is holding \his breath. It looks like \he's trying to commit suicide.</b>"
|
||||
mob.adjustOxyLoss(175 - mob.getToxLoss() - mob.getFireLoss() - mob.getBruteLoss() - mob.getOxyLoss())
|
||||
mob.updatehealth()
|
||||
spawn(200) //in case they get revived by cryo chamber or something stupid like that, let them suicide again in 20 seconds
|
||||
mob.suiciding = 0
|
||||
|
||||
/datum/disease2/effect/killertoxins
|
||||
name = "Toxification Syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.adjustToxLoss(15*multiplier)
|
||||
|
||||
/datum/disease2/effect/dna
|
||||
name = "Reverse Pattern Syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.bodytemperature = max(mob.bodytemperature, 350)
|
||||
scramble(0,mob,10)
|
||||
mob.apply_damage(10, CLONE)
|
||||
|
||||
/datum/disease2/effect/organs
|
||||
name = "Shutdown Syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = mob
|
||||
var/organ = pick(list("r_arm","l_arm","r_leg","r_leg"))
|
||||
var/datum/organ/external/E = H.organs_by_name[organ]
|
||||
if (!(E.status & ORGAN_DEAD))
|
||||
E.status |= ORGAN_DEAD
|
||||
H << "<span class='notice'>You can't feel your [E.display_name] anymore...</span>"
|
||||
for (var/datum/organ/external/C in E.children)
|
||||
C.status |= ORGAN_DEAD
|
||||
H.update_body(1)
|
||||
mob.adjustToxLoss(15*multiplier)
|
||||
|
||||
deactivate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = mob
|
||||
for (var/datum/organ/external/E in H.organs)
|
||||
E.status &= ~ORGAN_DEAD
|
||||
for (var/datum/organ/external/C in E.children)
|
||||
C.status &= ~ORGAN_DEAD
|
||||
H.update_body(1)
|
||||
|
||||
/datum/disease2/effect/immortal
|
||||
name = "Longevity Syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = mob
|
||||
for (var/datum/organ/external/E in H.organs)
|
||||
if (E.status & ORGAN_BROKEN && prob(30))
|
||||
E.status ^= ORGAN_BROKEN
|
||||
var/heal_amt = -5*multiplier
|
||||
mob.apply_damages(heal_amt,heal_amt,heal_amt,heal_amt)
|
||||
|
||||
deactivate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = mob
|
||||
H << "<span class='notice'>You suddenly feel hurt and old...</span>"
|
||||
H.age += 8
|
||||
var/backlash_amt = 5*multiplier
|
||||
mob.apply_damages(backlash_amt,backlash_amt,backlash_amt,backlash_amt)
|
||||
|
||||
////////////////////////STAGE 3/////////////////////////////////
|
||||
|
||||
/datum/disease2/effect/bones
|
||||
name = "Fragile Bones Syndrome"
|
||||
stage = 4
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = mob
|
||||
for (var/datum/organ/external/E in H.organs)
|
||||
E.min_broken_damage = max(5, E.min_broken_damage - 30)
|
||||
|
||||
deactivate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = mob
|
||||
for (var/datum/organ/external/E in H.organs)
|
||||
E.min_broken_damage = initial(E.min_broken_damage)
|
||||
|
||||
/datum/disease2/effect/toxins
|
||||
name = "Hyperacidity"
|
||||
stage = 3
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.adjustToxLoss((2*multiplier))
|
||||
|
||||
/datum/disease2/effect/shakey
|
||||
name = "World Shaking Syndrome"
|
||||
stage = 3
|
||||
maxm = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
shake_camera(mob,5*multiplier)
|
||||
|
||||
/datum/disease2/effect/telepathic
|
||||
name = "Telepathy Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.dna.check_integrity()
|
||||
mob.dna.SetSEState(REMOTETALKBLOCK,1)
|
||||
domutcheck(mob, null)
|
||||
|
||||
/datum/disease2/effect/mind
|
||||
name = "Lazy Mind Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = mob
|
||||
var/datum/organ/internal/brain/B = H.internal_organs["brain"]
|
||||
B.take_damage(5)
|
||||
else
|
||||
mob.setBrainLoss(50)
|
||||
|
||||
/datum/disease2/effect/hallucinations
|
||||
name = "Hallucinational Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.hallucination += 25
|
||||
|
||||
/datum/disease2/effect/deaf
|
||||
name = "Hard of Hearing Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.ear_deaf = 5
|
||||
|
||||
/datum/disease2/effect/giggle
|
||||
name = "Uncontrolled Laughter Effect"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*giggle")
|
||||
|
||||
/datum/disease2/effect/confusion
|
||||
name = "Topographical Cretinism"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob << "<span class='notice'>You have trouble telling right and left apart all of a sudden.</span>"
|
||||
mob.confused += 10
|
||||
|
||||
/datum/disease2/effect/mutation
|
||||
name = "DNA Degradation"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.apply_damage(2, CLONE)
|
||||
|
||||
|
||||
/datum/disease2/effect/groan
|
||||
name = "Groaning Syndrome"
|
||||
stage = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*groan")
|
||||
////////////////////////STAGE 2/////////////////////////////////
|
||||
|
||||
/datum/disease2/effect/scream
|
||||
name = "Loudness Syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*scream")
|
||||
|
||||
/datum/disease2/effect/drowsness
|
||||
name = "Automated Sleeping Syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.drowsyness += 10
|
||||
|
||||
/datum/disease2/effect/sleepy
|
||||
name = "Resting Syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*collapse")
|
||||
|
||||
/datum/disease2/effect/blind
|
||||
name = "Blackout Syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.eye_blind = max(mob.eye_blind, 4)
|
||||
|
||||
/datum/disease2/effect/cough
|
||||
name = "Anima Syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*cough")
|
||||
for(var/mob/living/carbon/M in oview(2,mob))
|
||||
mob.spread_disease_to(M)
|
||||
|
||||
/datum/disease2/effect/hungry
|
||||
name = "Appetiser Effect"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.nutrition = max(0, mob.nutrition - 200)
|
||||
|
||||
/datum/disease2/effect/fridge
|
||||
name = "Refridgerator Syndrome"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*shiver")
|
||||
|
||||
/datum/disease2/effect/hair
|
||||
name = "Hair Loss"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = mob
|
||||
if(H.species.name == "Human" && !(H.h_style == "Bald") && !(H.h_style == "Balding Hair"))
|
||||
H << "<span class='danger'>Your hair starts to fall out in clumps...</span>"
|
||||
spawn(50)
|
||||
H.h_style = "Balding Hair"
|
||||
H.update_hair()
|
||||
|
||||
/datum/disease2/effect/stimulant
|
||||
name = "Adrenaline Extra"
|
||||
stage = 2
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob << "<span class='notice'>You feel a rush of energy inside you!</span>"
|
||||
if (mob.reagents.get_reagent_amount("hyperzine") < 10)
|
||||
mob.reagents.add_reagent("hyperzine", 4)
|
||||
if (prob(30))
|
||||
mob.jitteriness += 10
|
||||
|
||||
////////////////////////STAGE 1/////////////////////////////////
|
||||
|
||||
/datum/disease2/effect/sneeze
|
||||
name = "Coldingtons Effect"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*sneeze")
|
||||
if (prob(50))
|
||||
var/obj/effect/decal/cleanable/mucus/M = new(get_turf(mob))
|
||||
M.virus2 = virus_copylist(mob.virus2)
|
||||
|
||||
/datum/disease2/effect/gunck
|
||||
name = "Flemmingtons"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob << "\red Mucous runs down the back of your throat."
|
||||
|
||||
/datum/disease2/effect/drool
|
||||
name = "Saliva Effect"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*drool")
|
||||
|
||||
/datum/disease2/effect/twitch
|
||||
name = "Twitcher"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*twitch")
|
||||
|
||||
/datum/disease2/effect/headache
|
||||
name = "Headache"
|
||||
stage = 1
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob << "<span class = 'notice'> Your head hurts a bit</span>"
|
||||
@@ -0,0 +1,138 @@
|
||||
//Returns 1 if mob can be infected, 0 otherwise. Checks his clothing.
|
||||
proc/get_infection_chance(var/mob/living/carbon/M, var/vector = "Airborne")
|
||||
var/score = 0
|
||||
if (!istype(M))
|
||||
return 0
|
||||
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
|
||||
if (vector == "Airborne")
|
||||
if(M.internal) //not breathing infected air helps greatly
|
||||
score = 30
|
||||
if(M.wear_mask)
|
||||
score += 5
|
||||
if(istype(M:wear_mask, /obj/item/clothing/mask/surgical) && !M.internal)
|
||||
score += 10
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/space) && istype(M:head, /obj/item/clothing/head/helmet/space)) score += 15
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/bio_suit) && istype(M:head, /obj/item/clothing/head/bio_hood)) score += 15
|
||||
|
||||
|
||||
if (vector == "Contact")
|
||||
if(M:gloves) score += 15
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/space)) score += 10
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/bio_suit)) score += 10
|
||||
|
||||
// log_debug("[M]'s resistance to [vector] viruses: [score]")
|
||||
|
||||
if(score >= 30)
|
||||
return 0
|
||||
else if(score == 25 && prob(99))
|
||||
return 0
|
||||
else if(score == 20 && prob(95))
|
||||
return 0
|
||||
else if(score == 15 && prob(75))
|
||||
return 0
|
||||
else if(score == 10 && prob(55))
|
||||
return 0
|
||||
else if(score == 5 && prob(35))
|
||||
return 0
|
||||
// log_debug("Infection got through")
|
||||
return 1
|
||||
|
||||
//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.flags = FPRINT | TABLEPASS
|
||||
dummy.pass_flags = PASSTABLE
|
||||
|
||||
for(var/i=0, i<5, i++) if(!step_towards(dummy, target)) break
|
||||
|
||||
var/rval = (dummy.loc in range(1,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
|
||||
if(M.antibodies & disease.antigen != 0)
|
||||
return
|
||||
|
||||
// log_debug("Infecting [M]")
|
||||
|
||||
if(prob(disease.infectionchance) || forced)
|
||||
// certain clothes can prevent an infection
|
||||
if(!forced && !get_infection_chance(M, disease.spreadtype))
|
||||
return
|
||||
|
||||
var/datum/disease2/disease/D = disease.getcopy()
|
||||
D.minormutate()
|
||||
// log_debug("Adding virus")
|
||||
M.virus2["[D.uniqueID]"] = D
|
||||
|
||||
//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()
|
||||
D.infectionchance = 1
|
||||
M.virus2["[D.uniqueID]"] = 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(1)
|
||||
M.virus2["[D.uniqueID]"] = 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 "retardation"
|
||||
|
||||
// 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
|
||||
|
||||
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 (in_range(src, victim))
|
||||
// log_debug("In range, infecting")
|
||||
infect_virus2(victim,V)
|
||||
|
||||
//contact goes both ways
|
||||
if (victim.virus2.len > 0 && vector == "Contact")
|
||||
// log_debug("Spreading [vector] diseases from [victim] to [src]")
|
||||
var/nudity = 1
|
||||
|
||||
if (ishuman(victim))
|
||||
var/mob/living/carbon/human/H = victim
|
||||
var/datum/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
|
||||
infect_virus2(src,V)
|
||||
@@ -0,0 +1,97 @@
|
||||
/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
|
||||
|
||||
/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
|
||||
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
|
||||
icon_state = "isolator"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/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
|
||||
|
||||
/obj/machinery/disease2/isolator/process()
|
||||
if(isolating > 0)
|
||||
isolating -= 1
|
||||
if(isolating == 0)
|
||||
var/obj/item/weapon/virusdish/d = new /obj/item/weapon/virusdish(src.loc)
|
||||
d.virus2 = virus2.getcopy()
|
||||
virus2 = null
|
||||
icon_state = "isolator_in"
|
||||
@@ -0,0 +1,81 @@
|
||||
/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."
|
||||
icon_state = "health"
|
||||
w_class = 2.0
|
||||
item_state = "electronic"
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
|
||||
|
||||
/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(!C.antibodies)
|
||||
user << "<span class='notice'>Unable to detect antibodies.</span>"
|
||||
return
|
||||
var/code = antigens2string(M.antibodies)
|
||||
user << "<span class='notice'>[src] The antibody scanner displays a cryptic set of data: [code]</span>"
|
||||
|
||||
///////////////VIRUS DISH///////////////
|
||||
|
||||
/obj/item/weapon/virusdish
|
||||
name = "Virus containment/growth dish"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "implantcase-b"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/growth = 0
|
||||
var/info = 0
|
||||
var/analysed = 0
|
||||
|
||||
reagents = list()
|
||||
|
||||
/obj/item/weapon/virusdish/random
|
||||
name = "Virus Sample"
|
||||
|
||||
/obj/item/weapon/virusdish/random/New()
|
||||
..()
|
||||
src.virus2 = new /datum/disease2/disease
|
||||
src.virus2.makerandom()
|
||||
growth = rand(5, 50)
|
||||
|
||||
/obj/item/weapon/virusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob)
|
||||
if(istype(W,/obj/item/weapon/hand_labeler) || istype(W,/obj/item/weapon/reagent_containers/syringe))
|
||||
return
|
||||
..()
|
||||
if(prob(50))
|
||||
user << "The dish 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)))
|
||||
if(get_infection_chance(target))
|
||||
infect_virus2(target,src.virus2)
|
||||
del src
|
||||
|
||||
/obj/item/weapon/virusdish/examine()
|
||||
usr << "This is a virus containment dish"
|
||||
if(src.info)
|
||||
usr << "It has the following information about its contents"
|
||||
usr << src.info
|
||||
|
||||
///////////////GNA DISK///////////////
|
||||
|
||||
/obj/item/weapon/diseasedisk
|
||||
name = "Blank GNA disk"
|
||||
icon = 'icons/obj/cloning.dmi'
|
||||
icon_state = "datadisk0"
|
||||
var/datum/disease2/effectholder/effect = null
|
||||
var/stage = 1
|
||||
|
||||
/obj/item/weapon/diseasedisk/premade/New()
|
||||
name = "Blank GNA disk (stage: [5-stage])"
|
||||
effect = new /datum/disease2/effectholder
|
||||
effect.effect = new /datum/disease2/effect/invisible
|
||||
effect.stage = stage
|
||||
Reference in New Issue
Block a user