diff --git a/code/WorkInProgress/Chemistry-Machinery.dm b/code/WorkInProgress/Chemistry-Machinery.dm index 7da3c6f851..c3dd3b082e 100644 --- a/code/WorkInProgress/Chemistry-Machinery.dm +++ b/code/WorkInProgress/Chemistry-Machinery.dm @@ -387,6 +387,9 @@ dat += "Blood Type: [(Blood.data["blood_type"]||"none")]
" var/datum/disease/D = Blood.data["virus"] dat += "Agent of disease: [D?"[D.agent] - Create virus culture bottle":"none"]
" + if(D) + dat += "Common name: [(D.name||"none")]
" + dat += "Possible cure: [(D.cure||"none")]
" dat += "Contains antibodies to: " if(Blood.data["resistances"]) var/list/res = Blood.data["resistances"] diff --git a/code/WorkInProgress/Chemistry-Reagents.dm b/code/WorkInProgress/Chemistry-Reagents.dm index 78ebf35ea0..e57253fd1f 100644 --- a/code/WorkInProgress/Chemistry-Reagents.dm +++ b/code/WorkInProgress/Chemistry-Reagents.dm @@ -74,9 +74,9 @@ datum var/datum/disease/V = self.data["virus"] if(M.resistances.Find(V.type)) return if(method == TOUCH)//respect all protective clothing... - M.contract_disease(new V.type) + M.contract_disease(V) else //injected - M.contract_disease(new V.type, 1) + M.contract_disease(V, 1) return @@ -84,6 +84,7 @@ datum var/datum/reagent/blood/self = src src = null if(!istype(T, /turf/simulated/)) return + var/datum/disease/D = self.data["virus"] if(istype(self.data["donor"], /mob/living/carbon/human) || !self.data["donor"]) var/turf/simulated/source2 = T var/list/objsonturf = range(0,T) @@ -94,19 +95,36 @@ datum var/obj/decal/cleanable/blood/blood_prop = new /obj/decal/cleanable/blood(source2) blood_prop.blood_DNA = self.data["blood_DNA"] blood_prop.blood_type = self.data["blood_type"] - blood_prop.virus = self.data["virus"] + if(D) + blood_prop.virus = new D.type + blood_prop.virus.holder = blood_prop + if(istype(T, /turf/simulated/floor)) + blood_prop.virus.spread_type = CONTACT_FEET + else + blood_prop.virus.spread_type = CONTACT_HANDS else if(istype(self.data["donor"], /mob/living/carbon/monkey)) var/turf/simulated/source1 = T var/obj/decal/cleanable/blood/blood_prop = new /obj/decal/cleanable/blood(source1) blood_prop.blood_DNA = self.data["blood_DNA"] - blood_prop.virus = self.data["virus"] + if(D) + blood_prop.virus = new D.type + blood_prop.virus.holder = blood_prop + if(istype(T, /turf/simulated/floor)) + blood_prop.virus.spread_type = CONTACT_FEET + else + blood_prop.virus.spread_type = CONTACT_HANDS else if(istype(self.data["donor"], /mob/living/carbon/alien)) var/turf/simulated/source2 = T var/obj/decal/cleanable/xenoblood/blood_prop = new /obj/decal/cleanable/xenoblood(source2) - blood_prop.virus = self.data["virus"] - + if(D) + blood_prop.virus = new D.type + blood_prop.virus.holder = blood_prop + if(istype(T, /turf/simulated/floor)) + blood_prop.virus.spread_type = CONTACT_FEET + else + blood_prop.virus.spread_type = CONTACT_HANDS return vaccine @@ -119,8 +137,8 @@ datum var/datum/reagent/vaccine/self = src src = null if(self.data&&method == INGEST) - if(M.resistances.Find(self.data)) return - M.resistances += self.data + if(M.virus&&M.virus.type == self.data) + M.virus.cure() return @@ -967,9 +985,9 @@ datum reaction_mob(var/mob/M, var/method=TOUCH, var/volume) src = null if( (prob(10) && method==TOUCH) || method==INGEST) - if(!M.virus) - M.virus = new /datum/disease/robotic_transformation - M.virus.affected_mob = M + var/datum/disease/D = new /datum/disease/robotic_transformation + M.contract_disease(D,1) + del(D) xenomicrobes name = "Xenomicrobes" @@ -979,9 +997,9 @@ datum reaction_mob(var/mob/M, var/method=TOUCH, var/volume) src = null if( (prob(10) && method==TOUCH) || method==INGEST) - if(!M.virus) - M.virus = new /datum/disease/xeno_transformation - M.virus.affected_mob = M + var/datum/disease/D = new /datum/disease/xeno_transformation + M.contract_disease(D,1) + del(D) //foam precursor @@ -1804,4 +1822,4 @@ datum if(data >= 55 && prob(33)) if (!M.confused) M.confused = 1 M.confused += 2 - ..() \ No newline at end of file + ..() diff --git a/code/WorkInProgress/Chemistry-Tools.dm b/code/WorkInProgress/Chemistry-Tools.dm index 6f8affa56b..1d766d94ca 100644 --- a/code/WorkInProgress/Chemistry-Tools.dm +++ b/code/WorkInProgress/Chemistry-Tools.dm @@ -357,6 +357,18 @@ amount_per_transfer_from_this = 10 flags = FPRINT | TABLEPASS | OPENCONTAINER + var/list/can_be_placed_into = list( + /obj/machinery/chem_master/, + /obj/table, + /obj/secure_closet, + /obj/closet, + /obj/item/weapon/storage, + /obj/machinery/atmospherics/unary/cryo_cell, + /obj/item/weapon/chem_grenade, + /obj/machinery/bot/medbot, + /obj/machinery/pandemic, + /obj/item/weapon/secstorage/ssafe) + examine() set src in view(2) ..() @@ -374,7 +386,8 @@ R.my_atom = src afterattack(obj/target, mob/user , flag) - + if(src.can_be_placed_into.Find(target.type)) + return if(ismob(target) && target.reagents && reagents.total_volume) user << "\blue You splash the solution onto [target]." for(var/mob/O in viewers(world.view, user)) @@ -407,7 +420,7 @@ var/trans = src.reagents.trans_to(target, 10) user << "\blue You transfer [trans] units of the solution to [target]." - else if(reagents.total_volume && !istype(target,/obj/machinery/chem_master/) && !istype(target,/obj/table) && !istype(target,/obj/secure_closet) && !istype(target,/obj/closet) && !istype(target,/obj/item/weapon/storage) && !istype(target, /obj/machinery/atmospherics/unary/cryo_cell) && !istype(target, /obj/item/weapon/chem_grenade) && !istype(target, /obj/machinery/bot/medbot) &&!istype(target, /obj/machinery/pandemic)) + else if(reagents.total_volume) user << "\blue You splash the solution onto [target]." src.reagents.reaction(target, TOUCH) spawn(5) src.reagents.clear_reagents() @@ -547,7 +560,7 @@ B.volume = amount //set reagent data B.data["donor"] = T - if(T.virus) + if(T.virus && T.virus.spread_type != SPECIAL) B.data["virus"] = new T.virus.type B.data["blood_DNA"] = copytext(T.dna.unique_enzymes,1,0) if(T.resistances&&T.resistances.len) diff --git a/code/datums/disease.dm b/code/datums/disease.dm index ca8f4078f1..3d249f8f1b 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -1,3 +1,18 @@ +#define SPECIAL 0 +#define CONTACT_GENERAL 1 +#define CONTACT_HANDS 2 +#define CONTACT_FEET 3 +#define AIRBORNE 4 + +/* + +IMPORTANT NOTE: Please delete the diseases by using cure() proc or del() instruction. +Diseases are referenced in global list, so simply setting mob or obj vars +to null does not delete the object itself. Thank you. + +*/ + + /datum/disease var/name = "No disease" var/stage = 1 //all diseases start at stage 1 @@ -6,14 +21,19 @@ var/cure_id = null// reagent.id or list containing them var/cure_chance = 8//chance for the cure to do its job var/spread = null + var/spread_type = AIRBORNE + var/contagious_period = 0//the disease stage when it can be spread var/list/affected_species = list() var/mob/affected_mob = null + var/holder = null var/carrier = 0.0 //there will be a small chance that the person will be a carrier var/curable = 1 //can this disease be cured? (By itself...) var/list/strain_data = list() //This is passed on to infectees var/stage_prob = 5 // probability of advancing to next stage, default 5% per check var/agent = "some microbes"//name of the disease agent - var/permeability_mod = 0//permeability modifier. Positive gives better chance, negative - worse. + var/permeability_mod = 1//permeability modifier coefficient. + var/desc = null//description. Leave it null and this disease won't show in med records. + var/severity = null//severity descr /datum/disease/proc/stage_act() @@ -32,9 +52,8 @@ stage++ if(stage != 1 && (prob(1) || (cure_present && prob(cure_chance)))) stage-- - else if(stage == 1 && ((prob(1) && affected_mob.virus.curable) || (cure_present && prob(cure_chance)))) - affected_mob.resistances += affected_mob.virus.type - affected_mob.virus = null + else if(stage <= 1 && ((prob(1) && src.curable) || (cure_present && prob(cure_chance)))) + src.cure() return return @@ -51,18 +70,25 @@ /mob/proc/contract_disease(var/datum/disease/virus, var/skip_this = 0) + world << "Contract_disease called by [src] with virus [virus]" - if(src.resistances.Find(virus.type)) - if(prob(99)) return - src.resistances.Remove(virus.type)//the resistance is futile - - //For alien egg and stuff if(skip_this == 1) - src.virus = virus + if(src.virus) + src.virus.cure(0) + src.virus = new virus.type src.virus.affected_mob = src + src.virus.strain_data = virus.strain_data.Copy() + src.virus.holder = src if(prob(5)) src.virus.carrier = 1 return + + if(src.virus) return + + if(src.resistances.Find(virus.type)) + if(prob(99.9)) return + src.resistances.Remove(virus.type)//the resistance is futile + /* var/list/clothing_areas = list() var/list/covers = list(UPPER_TORSO,LOWER_TORSO,LEGS,FEET,ARMS,HANDS) @@ -76,11 +102,36 @@ clothing_areas[Covers] += Clothing */ - if(prob(15)) return + if(prob(15/virus.permeability_mod)) return var/obj/item/clothing/Cl = null var/passed = 1 - var/target_zone = pick(1,2,50;3,50;4)//1 - head, 2 - body, 3 - hands, 4- feet + + //chances to target this zone + var/head_ch + var/body_ch + var/hands_ch + var/feet_ch + + switch(virus.spread_type) + if(CONTACT_HANDS) + head_ch = 0 + body_ch = 0 + hands_ch = 100 + feet_ch = 0 + if(CONTACT_FEET) + head_ch = 0 + body_ch = 0 + hands_ch = 0 + feet_ch = 100 + else + head_ch = 100 + body_ch = 100 + hands_ch = 25 + feet_ch = 25 + + + var/target_zone = pick(head_ch;1,body_ch;2,hands_ch;3,feet_ch;4)//1 - head, 2 - body, 3 - hands, 4- feet if(istype(src, /mob/living/carbon/human)) var/mob/living/carbon/human/H = src @@ -89,38 +140,38 @@ if(1) if(H.head) Cl = H.head - passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod) + passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) //world << "Head pass [passed]" if(passed && H.wear_mask) Cl = H.wear_mask - passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod) + passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) //world << "Mask pass [passed]" if(2)//arms and legs included if(H.wear_suit) Cl = H.wear_suit - passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod) + passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) //world << "Suit pass [passed]" if(passed && H.slot_w_uniform) Cl = H.slot_w_uniform - passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod) + passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) //world << "Uniform pass [passed]" if(3) if(H.wear_suit && H.wear_suit.body_parts_covered&HANDS) Cl = H.wear_suit - passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod) + passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) if(passed && H.gloves) Cl = H.gloves - passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod) + passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) //world << "Gloves pass [passed]" if(4) if(H.wear_suit && H.wear_suit.body_parts_covered&FEET) Cl = H.wear_suit - passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod) + passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) if(passed && H.shoes) Cl = H.shoes - passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod) + passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) //world << "Shoes pass [passed]" else src << "Something strange's going on, something's wrong." @@ -141,8 +192,8 @@ passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod) //world << "Mask pass [passed]" - if(passed && virus.spread=="Airborne" && src.internals) - passed = prob(60) + if(passed && virus.spread_type == AIRBORNE && src.internals) + passed = (prob(50*virus.permeability_mod)) if(passed) // world << "Infection in the mob [src]. YAY" @@ -175,9 +226,64 @@ else if(prob(15)) return else*/ - src.virus = virus + src.virus = new virus.type + src.virus.strain_data = virus.strain_data.Copy() src.virus.affected_mob = src + src.virus.holder = src if(prob(5)) src.virus.carrier = 1 return return + + +/datum/disease/proc/spread(var/source=null) + //world << "Disease [src] proc spread was called from holder [source]" + if(src.spread_type == SPECIAL)//does not spread + return + + if(src.stage < src.contagious_period) //the disease is not contagious at this stage + return + + if(!source)//no holder specified + if(src.affected_mob)//no mob affected holder + source = src.affected_mob + else //no source and no mob affected. Rogue disease. Break + return + + + var/check_range = AIRBORNE//defaults to airborne - range 4 + if(src.spread_type != AIRBORNE) + check_range = 1 + + for(var/mob/living/carbon/M in oviewers(check_range, source)) + for(var/name in src.affected_species) + var/mob_type = text2path("/mob/living/carbon/[lowertext(name)]") + if(mob_type && istype(M, mob_type)) + M.contract_disease(src) + break + return + + +/datum/disease/proc/process() + if(!src.holder) return + if(prob(40)) + src.spread(holder) + if(src.holder == src.affected_mob) + src.stage_act() + return + +/datum/disease/proc/cure(var/resistance=1) + var/datum/disease/D = src + src = null + if(resistance && src.affected_mob && !affected_mob.resistances.Find(D.type)) + affected_mob.resistances += D.type + del(D) + + +/datum/disease/New() + active_diseases += src + +/* +/datum/disease/Del() + active_diseases.Remove(src) +*/ diff --git a/code/datums/diseases/alien_embryo.dm b/code/datums/diseases/alien_embryo.dm index 41c67e0b32..7c1e74137b 100644 --- a/code/datums/diseases/alien_embryo.dm +++ b/code/datums/diseases/alien_embryo.dm @@ -10,10 +10,12 @@ name = "Unidentified Foreign Body" max_stages = 5 spread = "None" + spread_type = SPECIAL cure = "Unknown" cure_id = list("lexorin","toxin","gargleblaster") cure_chance = 20 affected_species = list("Human", "Monkey") + permeability_mod = 3//likely to infect /datum/disease/alien_embryo/stage_act() ..() diff --git a/code/datums/diseases/brainrot.dm b/code/datums/diseases/brainrot.dm index 0195c48e7c..b7609444a7 100644 --- a/code/datums/diseases/brainrot.dm +++ b/code/datums/diseases/brainrot.dm @@ -1,13 +1,16 @@ /datum/disease/brainrot name = "Brainrot" max_stages = 4 - spread = "Airborne" + spread = "On contact" + spread_type = CONTACT_GENERAL cure = "Spaceacillin & Alkysine" cure_id = list("alkysine","spaceacillin") agent = "Cryptococcus Cosmosis" affected_species = list("Human") curable = 0 - cure_chance = 10 + cure_chance = 15//higher chance to cure, since two reagents are required + desc = "This disease destroys the braincells, causing brain fever, brain necrosis and general intoxication." + severity = "Major" /datum/disease/brainrot/stage_act() //Removed toxloss because damaging diseases are pretty horrible. Last round it killed the entire station because the cure didn't work -- Urist ..() diff --git a/code/datums/diseases/cold.dm b/code/datums/diseases/cold.dm index 82c4483dd7..1a58ce20f1 100644 --- a/code/datums/diseases/cold.dm +++ b/code/datums/diseases/cold.dm @@ -2,11 +2,13 @@ name = "The Cold" max_stages = 3 spread = "Airborne" - cure = "Rest" - cure = "spaceacillin" + cure = "Rest & Spaceacillin" + cure_id = "spaceacillin" agent = "XY-rhinovirus" affected_species = list("Human", "Monkey") - permeability_mod = -10 + permeability_mod = 0.5 + desc = "If left untreated the subject will contract the flu." + severity = "Minor" /datum/disease/cold/stage_act() ..() @@ -14,13 +16,11 @@ if(2) if(affected_mob.sleeping && prob(40)) affected_mob << "\blue You feel better." - affected_mob.resistances += affected_mob.virus.type - affected_mob.virus = null + affected_mob.virus.cure() return if(prob(1) && prob(10)) affected_mob << "\blue You feel better." - affected_mob.resistances += affected_mob.virus.type - affected_mob.virus = null + affected_mob.virus.cure() return if(prob(1)) affected_mob.emote("sneeze") @@ -33,13 +33,11 @@ if(3) if(affected_mob.sleeping && prob(25)) affected_mob << "\blue You feel better." - affected_mob.resistances += affected_mob.virus.type - affected_mob.virus = null + affected_mob.virus.cure() return if(prob(1) && prob(10)) affected_mob << "\blue You feel better." - affected_mob.resistances += affected_mob.virus.type - affected_mob.virus = null + affected_mob.virus.cure() if(prob(1)) affected_mob.emote("sneeze") if(prob(1)) @@ -49,4 +47,6 @@ if(prob(1)) affected_mob << "\red Mucous runs down the back of your throat." if(prob(1) && prob(50)) - affected_mob.contract_disease(new /datum/disease/flu) + var/datum/disease/Flu = new /datum/disease/flu + affected_mob.contract_disease(Flu,1) + del(Flu) diff --git a/code/datums/diseases/dna_spread.dm b/code/datums/diseases/dna_spread.dm index d75c9a9e7a..23ad82b4c0 100644 --- a/code/datums/diseases/dna_spread.dm +++ b/code/datums/diseases/dna_spread.dm @@ -1,7 +1,8 @@ /datum/disease/dnaspread name = "Space Retrovirus" max_stages = 4 - spread = "Airborne" + spread = "On contact" + spread_type = CONTACT_GENERAL cure = "Ryetalin" cure = "ryetalyn" curable = 0 @@ -9,6 +10,8 @@ affected_species = list("Human") var/list/original_dna = list() var/transformed = 0 + desc = "This disease transplants the genetic code of the intial vector into new hosts." + severity = "Medium" /datum/disease/dnaspread/stage_act() @@ -32,7 +35,7 @@ if(4) if(!src.transformed) if ((!strain_data["name"]) || (!strain_data["UI"]) || (!strain_data["SE"])) - affected_mob.virus = null + del(affected_mob.virus) return //Save original dna for when the disease is cured. diff --git a/code/datums/diseases/fake_gbs.dm b/code/datums/diseases/fake_gbs.dm index 51935d1a80..3a264f5ca0 100644 --- a/code/datums/diseases/fake_gbs.dm +++ b/code/datums/diseases/fake_gbs.dm @@ -1,11 +1,14 @@ /datum/disease/fake_gbs name = "GBS" max_stages = 5 - spread = "Airborne" + spread = "On contact" + spread_type = CONTACT_GENERAL cure = "Synaptizine & Sulfur" cure_id = list("synaptizine","sulfur") agent = "Gravitokinetic Bipotential SADS-" affected_species = list("Human") + desc = "If left untreated death will occur." + severity = "Major" /datum/disease/fake_gbs/stage_act() ..() diff --git a/code/datums/diseases/flu.dm b/code/datums/diseases/flu.dm index 1d2353fb79..90b4b840cc 100644 --- a/code/datums/diseases/flu.dm +++ b/code/datums/diseases/flu.dm @@ -4,10 +4,12 @@ spread = "Airborne" cure = "Spaceacillin" cure_id = "spaceacillin" + cure_chance = 10 agent = "H13N1 flu virion" affected_species = list("Human") - curable = 0 - permeability_mod = -5 + permeability_mod = 0.75 + desc = "If left untreated the subject will feel quite unwell." + severity = "Medium" /datum/disease/flu/stage_act() ..() diff --git a/code/datums/diseases/gbs.dm b/code/datums/diseases/gbs.dm index 2540517153..954370bac1 100644 --- a/code/datums/diseases/gbs.dm +++ b/code/datums/diseases/gbs.dm @@ -1,7 +1,8 @@ /datum/disease/gbs name = "GBS" max_stages = 5 - spread = "Airborne" + spread = "On contact" + spread_type = CONTACT_GENERAL cure = "Synaptizine & Sulfur" cure_id = list("synaptizine","sulfur") agent = "Gravitokinetic Bipotential SADS+" diff --git a/code/datums/diseases/jungle_fever.dm b/code/datums/diseases/jungle_fever.dm index 29ee0cdb9b..72e218a28f 100644 --- a/code/datums/diseases/jungle_fever.dm +++ b/code/datums/diseases/jungle_fever.dm @@ -2,6 +2,9 @@ name = "Jungle Fever" max_stages = 1 cure = "None" - spread = "Airborne" + spread = "Bites" + spread_type = SPECIAL affected_species = list("Monkey") - curable = 0 \ No newline at end of file + curable = 0 + desc = "Monkies with this disease will bite humans, causing humans to spontaneously mutate into a monkey." + severity = "Medium" diff --git a/code/datums/diseases/magnitis.dm b/code/datums/diseases/magnitis.dm index 8ea3f820bd..fb9fe042b8 100644 --- a/code/datums/diseases/magnitis.dm +++ b/code/datums/diseases/magnitis.dm @@ -7,6 +7,9 @@ agent = "Fukkos Miracos" affected_species = list("Human") curable = 0 + permeability_mod = 0.75 + desc = "This disease disrupts the magnetic field of your body, making it act as if a powerful magnet. Injections of iron help stabilize the field." + severity = "Medium" /datum/disease/magnitis/stage_act() ..() diff --git a/code/datums/diseases/robotic_transformation.dm b/code/datums/diseases/robotic_transformation.dm index b2e70069b6..ba5a81000b 100644 --- a/code/datums/diseases/robotic_transformation.dm +++ b/code/datums/diseases/robotic_transformation.dm @@ -4,9 +4,12 @@ name = "Robotic Transformation" max_stages = 5 spread = "Syringe" + spread_type = SPECIAL cure = "None" agent = "R2D2 Nanomachines" affected_species = list("Human") + desc = "This disease, actually acute nanomachine infection, converts the victim into a cyborg." + severity = "Major" /datum/disease/robotic_transformation/stage_act() ..() diff --git a/code/datums/diseases/wizarditis.dm b/code/datums/diseases/wizarditis.dm index 0875f19fd4..10baaf5d77 100644 --- a/code/datums/diseases/wizarditis.dm +++ b/code/datums/diseases/wizarditis.dm @@ -7,7 +7,9 @@ agent = "Rincewindus Vulgaris" affected_species = list("Human") curable = 0 - permeability_mod = -5 + permeability_mod = 0.75 + desc = "Some speculate, that this virus is the cause of Wizard Federation existance. Subjects affected show the signs of mental retardation, yelling obscure sentences or total gibberish. On late stages subjects sometime express the feelings of inner power, and, cite, 'the ability to control the forces of cosmos themselves!' A gulp of strong, manly spirits usually reverts them to normal, humanlike, condition." + severity = "Minor" /* BIRUZ BENNAR @@ -24,7 +26,7 @@ STI KALY - blind switch(stage) if(2) if(prob(4)) - affected_mob.say(pick("You shall not pass!", "Expeliarmus!", "By Merlins beard!", "")) + affected_mob.say(pick("You shall not pass!", "Expeliarmus!", "By Merlins beard!", "Feel the power of the Dark Side!")) if(prob(2)) affected_mob << "\red You feel [pick("that you don't have enough mana.", "that the winds of magic are gone.", "an urge to summon familiar.")]" @@ -43,70 +45,88 @@ STI KALY - blind return if(prob(2)) affected_mob << "\red You feel [pick("the tidal wave of raw power building inside","that this location gives you a +2 to INT and +1 to WIS","an urge to teleport")]." - /* if(prob(5)) + if(prob(5)) + teleport() - var/list/theareas = new/list() - for(var/area/AR in world) - if(theareas.Find(AR)) continue - var/turf/picked = pick(get_area_turfs(AR.type)) - if (picked.z == affected_mob.z) - theareas += AR - - var/area/thearea = pick(theareas) - affected_mob.say("SCYAR NILA [uppertext(thearea.name)]") - - var/datum/effects/system/harmless_smoke_spread/smoke = new /datum/effects/system/harmless_smoke_spread() - smoke.set_up(5, 0, affected_mob.loc) - smoke.attach(affected_mob) - smoke.start() - var/list/L = list() - for(var/turf/T in get_area_turfs(thearea.type)) - if(T.z != affected_mob.z) continue - if(!T.density) - var/clear = 1 - for(var/obj/O in T) - if(O.density) - clear = 0 - break - if(clear) - L+=T - - affected_mob.loc = pick(L) - smoke.start() -//Apparently it created a lagspike every time it was called -- Urist - return */ return /datum/disease/wizarditis/proc/spawn_wizard_clothes(var/chance=5) - var/mob/living/carbon/human/H = affected_mob - if(prob(chance)) - if(!istype(H.head, /obj/item/clothing/head/wizard)) - if(H.head) - H.drop_from_slot(H.head) - H.head = new /obj/item/clothing/head/wizard(H) - H.head.layer = 20 - return - if(prob(chance)) - if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe)) - if(H.wear_suit) - H.drop_from_slot(H.wear_suit) - H.wear_suit = new /obj/item/clothing/suit/wizrobe(H) - H.wear_suit.layer = 20 - return - if(prob(chance)) - if(!istype(H.shoes, /obj/item/clothing/shoes/sandal)) - if(H.shoes) - H.drop_from_slot(H.shoes) - H.shoes = new /obj/item/clothing/shoes/sandal(H) - H.shoes.layer = 20 - return - if(prob(chance)) - if(!istype(H.r_hand, /obj/item/weapon/staff)) - if(H.r_hand) - H.drop_from_slot(H.r_hand) - H.r_hand = new /obj/item/weapon/staff(H) - H.r_hand.layer = 20 - return + if(istype(affected_mob, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = affected_mob + if(prob(chance)) + if(!istype(H.head, /obj/item/clothing/head/wizard)) + if(H.head) + H.drop_from_slot(H.head) + H.head = new /obj/item/clothing/head/wizard(H) + H.head.layer = 20 + return + if(prob(chance)) + if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe)) + if(H.wear_suit) + H.drop_from_slot(H.wear_suit) + H.wear_suit = new /obj/item/clothing/suit/wizrobe(H) + H.wear_suit.layer = 20 + return + if(prob(chance)) + if(!istype(H.shoes, /obj/item/clothing/shoes/sandal)) + if(H.shoes) + H.drop_from_slot(H.shoes) + H.shoes = new /obj/item/clothing/shoes/sandal(H) + H.shoes.layer = 20 + return + else + var/mob/living/carbon/H = affected_mob + if(prob(chance)) + if(!istype(H.r_hand, /obj/item/weapon/staff)) + if(H.r_hand) + H.drop_from_slot(H.r_hand) + H.r_hand = new /obj/item/weapon/staff(H) + H.r_hand.layer = 20 + return return + + + +/datum/disease/wizarditis/proc/teleport() +/* + var/list/theareas = new/list() + for(var/area/AR in world) + if(theareas.Find(AR)) continue + var/turf/picked = pick(get_area_turfs(AR.type) + if (picked && picked.z == affected_mob.z) + theareas += AR + + var/area/thearea = pick(theareas) +*/ + + var/list/theareas = new/list() + for(var/area/AR in orange(80, affected_mob)) + if(theareas.Find(AR)) continue + theareas += AR + + var/area/thearea = pick(theareas) + + var/datum/effects/system/harmless_smoke_spread/smoke = new /datum/effects/system/harmless_smoke_spread() + smoke.set_up(5, 0, affected_mob.loc) + smoke.attach(affected_mob) + smoke.start() + + var/list/L = list() + for(var/turf/T in get_area_turfs(thearea.type)) + if(T.z != affected_mob.z) continue + if(!T.density) + var/clear = 1 + for(var/obj/O in T) + if(O.density) + clear = 0 + break + if(clear) + L+=T + + affected_mob.say("SCYAR NILA [uppertext(thearea.name)]!") + affected_mob.loc = pick(L) + smoke.start() +//Apparently it created a lagspike every time it was called -- Urist + return \ No newline at end of file diff --git a/code/datums/diseases/xeno_transformation.dm b/code/datums/diseases/xeno_transformation.dm index e827601552..72fd2b9874 100644 --- a/code/datums/diseases/xeno_transformation.dm +++ b/code/datums/diseases/xeno_transformation.dm @@ -4,6 +4,7 @@ name = "Xenomorph Transformation" max_stages = 5 spread = "Syringe" + spread_type = SPECIAL cure = "None" agent = "Rip-LEY Alien Microbes" affected_species = list("Human") diff --git a/code/defines/global.dm b/code/defines/global.dm index b3fccdae07..e1d4bbe24c 100644 --- a/code/defines/global.dm +++ b/code/defines/global.dm @@ -7,6 +7,7 @@ var/global list/machines = list() list/processing_items = list() + list/active_diseases = list() //items that ask to be called every cycle defer_powernet_rebuild = 0 // true if net rebuild will be called manually after an event diff --git a/code/defines/obj/decal.dm b/code/defines/obj/decal.dm index 35a3a1bded..1fd30a0a27 100644 --- a/code/defines/obj/decal.dm +++ b/code/defines/obj/decal.dm @@ -28,6 +28,11 @@ blood_DNA = null blood_type = null + Del() + if(virus) + virus.cure(0) + ..() + /obj/decal/cleanable/xenoblood name = "Xeno blood" desc = "It's green." @@ -39,6 +44,11 @@ random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7") var/datum/disease/virus = null + Del() + if(virus) + virus.cure(0) + ..() + /obj/decal/cleanable/blood/splatter random_icon_states = list("gibbl1", "gibbl2", "gibbl3", "gibbl4", "gibbl5") @@ -89,6 +99,11 @@ var/datum/disease/virus = null random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7") + Del() + if(virus) + virus.cure(0) + ..() + /obj/decal/cleanable/oil/streak random_icon_states = list("streak1", "streak2", "streak3", "streak4", "streak5") diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index d956db9edb..4410644fab 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -101,7 +101,8 @@ var/obj/decal/cleanable/blood/this = new /obj/decal/cleanable/blood(source2) this.blood_DNA = M.dna.unique_enzymes this.blood_type = M.b_type - this.virus = M.virus + this.virus = new M.virus.type + this.virus.holder = this else if (istype(src, /mob/living/carbon/human)) src.blood_DNA = M.dna.unique_enzymes src.blood_type = M.b_type @@ -124,19 +125,22 @@ var/turf/simulated/source1 = src var/obj/decal/cleanable/blood/this = new /obj/decal/cleanable/blood(source1) this.blood_DNA = M.dna.unique_enzymes - this.virus = M.virus + this.virus = new M.virus.type + this.virus.holder = this else if( istype(M, /mob/living/carbon/alien )) if( istype(src, /turf/simulated) ) var/turf/simulated/source2 = src var/obj/decal/cleanable/xenoblood/this = new /obj/decal/cleanable/xenoblood(source2) - this.virus = M.virus + this.virus = new M.virus.type + this.virus.holder = this else if( istype(M, /mob/living/silicon/robot )) if( istype(src, /turf/simulated) ) var/turf/simulated/source2 = src var/obj/decal/cleanable/oil/this = new /obj/decal/cleanable/oil(source2) - this.virus = M.virus + this.virus = new M.virus.type + this.virus.holder = this /atom/proc/clean_blood() diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 7307435c48..1f18cd6deb 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -83,17 +83,15 @@ dat += text("New Record

") dat += text("\nPrint Record
\nBack
", src, src) if(5.0) - dat += {"
Virus Database
-
GBS -
Common Cold -
Flu -
Jungle Fever -
Clowning Around -
Plasmatoid -
Space Rhinovirus -
Robot Transformation -
Magnitis -
Back"} + dat += "
Virus Database
" + for(var/Dt in typesof(/datum/disease/)) + var/datum/disease/Dis = new Dt + if(!Dis.desc) + del(Dis) + continue + dat += "
[Dis.name]" + del(Dis) + dat += "
Back" if(6.0) dat += "
Medical Robot Monitor
" dat += "Back" @@ -170,97 +168,21 @@ src.active2 = null if(href_list["vir"]) - switch(href_list["vir"]) - if("gbs") - src.temp = {"Name: GBS -
Number of stages: 5 -
Spread: Airborne Transmission -
Possible Cure: Spaceacillin -
Affected Species: Human + var/type = href_list["vir"] + var/datum/disease/Dis = new type + var/AfS = "" + for(var/Str in Dis.affected_species) + AfS += " [Str];" + src.temp = {"Name: [Dis.name] +
Number of stages: [Dis.max_stages] +
Spread: [Dis.spread] Transmission +
Possible Cure: [(Dis.cure||"none")] +
Affected Species:[AfS]
-
Notes: If left untreated death will occur. +
Notes: [Dis.desc]
-
Severity: Major"} - if("cc") - src.temp = {"Name: Common Cold -
Number of stages: 3 -
Spread: Airborne Transmission -
Possible Cure: Rest -
Affected Species: Human -
-
Notes: If left untreated the subject will contract the flu. -
-
Severity: Minor"} - if("f") - src.temp = {"Name: The Flu -
Number of stages: 3 -
Spread: Airborne Transmission -
Possible Cure: Rest -
Affected Species: Human -
-
Notes: If left untreated the subject will feel quite unwell. -
-
Severity: Medium"} - if("jf") - src.temp = {"Name: Jungle Fever -
Number of stages: 1 -
Spread: Airborne Transmission -
Possible Cure: None -
Affected Species: Monkey -
-
Notes: Monkies with this disease will bite humans, causing humans to spontaneously to mutate into a monkey. -
-
Severity: Medium"} - if("ca") - src.temp = {"Name: Clowning Around -
Number of stages: 4 -
Spread: Airborne Transmission -
Possible Cure: Spaceacillin -
Affected Species: Human -
-
Notes: Subjects are affected by rampant honking and a fondness for shenanigans. They may also spontaneously phase through closed airlocks. -
-
Severity: Laughable"} - if("p") - src.temp = {"Name: Plasmatoid -
Number of stages: 3 -
Spread: Airborne Transmission -
Possible Cure: Inaprovaline -
Affected Species: Human and Monkey -
-
Notes: With this disease the victim will need plasma to breathe. -
-
Severity: Major"} - if("dna") - src.temp = {"Name: Space Rhinovirus -
Number of stages: 4 -
Spread: Airborne Transmission -
Possible Cure: Spaceacillin -
Affected Species: Human -
-
Notes: This disease transplants the genetic code of the intial vector into new hosts. -
-
Severity: Medium"} - if("bot") - src.temp = {"Name: Robot Transformation -
Number of stages: 5 -
Spread: Infected food -
Possible Cure: None -
Affected Species: Human -
-
Notes: This disease, actually acute nanomachine infection, converts the victim into a cyborg. -
-
Severity: Major"} - if("mgn") - src.temp = {"Name: Magnitis -
Number of stages: 4 -
Spread: Airborne -
Possible Cure: Iron -
Affected Species: Human -
-
Notes: This disease disrupts the magnetic field of your body, making it act as if a powerful magnet. Injections of iron help stabilize the field. -
-
Severity: Medium"} +
Severity: [Dis.severity]"} + del(Dis) if (href_list["del_all"]) src.temp = text("Are you sure you wish to delete all records?
\n\tYes
\n\tNo
", src, src) diff --git a/code/game/master_controller.dm b/code/game/master_controller.dm index 661701081b..e0fa398f40 100644 --- a/code/game/master_controller.dm +++ b/code/game/master_controller.dm @@ -68,6 +68,9 @@ datum/controller/game_controller sleep(-1) + for(var/datum/disease/D in active_diseases) + D.process() + for(var/obj/machinery/machine in machines) machine.process() diff --git a/code/game/objects/alien/facehugger.dm b/code/game/objects/alien/facehugger.dm index 7f1dca320e..3dccd52ce1 100644 --- a/code/game/objects/alien/facehugger.dm +++ b/code/game/objects/alien/facehugger.dm @@ -247,7 +247,7 @@ target.alien_egg_flag = 1 var/mob/trg = target src.death() - trg.contract_disease(new /datum/disease/alien_embryo, 1) + trg.contract_disease(new /datum/disease/alien_embryo) return else sleep(50) diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 6176a80060..2a54e80016 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -280,8 +280,8 @@ //This is fine for the alien handle_virus_updates() if(src.bodytemperature > 406) - src.resistances += src.virus - src.virus = null + src.virus.cure() + return if(!src.virus) if(prob(40)) @@ -354,4 +354,4 @@ snippets plcheck = src.t_plasma oxcheck = src.t_oxygen G.turf_add(T, G.total_moles()) -*/ \ No newline at end of file +*/ diff --git a/code/modules/mob/living/carbon/alien/humanoid/life_new.dm b/code/modules/mob/living/carbon/alien/humanoid/life_new.dm index f35eba53fb..b80dcbb7f7 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life_new.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life_new.dm @@ -534,8 +534,8 @@ handle_virus_updates() if(src.bodytemperature > 406) - src.resistances += src.virus - src.virus = null + src.virus.cure() + return if(!src.virus) if(prob(40)) diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 83d2fb169a..df4f984d8e 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -456,7 +456,7 @@ handle_virus_updates() if(src.bodytemperature > 406) src.resistances += src.virus - src.virus = null + del(src.virus) if(!src.virus) if(prob(40)) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 11355ca2eb..4c75990d0c 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -801,39 +801,9 @@ handle_virus_updates() if(src.bodytemperature > 406) - src.resistances += src.virus - src.virus = null + src.virus.cure() + return - if(!src.virus) - if(prob(40)) - for(var/mob/living/carbon/M in oviewers(4, src)) - if(M.virus && M.virus.spread == "Airborne") - if(M.virus.affected_species.Find("Human")) - if(src.resistances.Find(M.virus.type)) - continue - var/datum/disease/D = new M.virus.type //Making sure strain_data is preserved - D.strain_data = M.virus.strain_data - src.contract_disease(D) - - for(var/obj/decal/cleanable/blood/B in view(4, src)) - if(B.virus && B.virus.spread == "Airborne") - if(B.virus.affected_species.Find("Human")) - if(src.resistances.Find(B.virus.type)) - continue - var/datum/disease/D = new B.virus.type - D.strain_data = B.virus.strain_data - src.contract_disease(D) - - for(var/obj/decal/cleanable/xenoblood/X in view(4, src)) - if(X.virus && X.virus.spread == "Airborne") - if(X.virus.affected_species.Find("Human")) - if(src.resistances.Find(X.virus.type)) - continue - var/datum/disease/D = new X.virus.type - D.strain_data = X.virus.strain_data - src.contract_disease(D) - else - src.virus.stage_act() check_if_buckled() if (src.buckled) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index f1630e182a..118b5229f9 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -554,39 +554,8 @@ handle_virus_updates() if(src.bodytemperature > 406) - src.resistances += src.virus - src.virus = null - - if(!src.virus) - if(prob(40)) - for(var/mob/living/carbon/M in oviewers(4, src)) - if(M.virus && M.virus.spread == "Airborne") - if(M.virus.affected_species.Find("Monkey")) - if(src.resistances.Find(M.virus.type)) - continue - var/datum/disease/D = new M.virus.type //Making sure strain_data is preserved - D.strain_data = M.virus.strain_data - src.contract_disease(D) - - for(var/obj/decal/cleanable/blood/B in view(4, src)) - if(B.virus && B.virus.spread == "Airborne") - if(B.virus.affected_species.Find("Monkey")) - if(src.resistances.Find(B.virus.type)) - continue - var/datum/disease/D = new B.virus.type - D.strain_data = B.virus.strain_data - src.contract_disease(D) - - for(var/obj/decal/cleanable/xenoblood/X in view(4, src)) - if(X.virus && X.virus.spread == "Airborne") - if(X.virus.affected_species.Find("Monkey")) - if(src.resistances.Find(X.virus.type)) - continue - var/datum/disease/D = new X.virus.type - D.strain_data = X.virus.strain_data - src.contract_disease(D) - else - src.virus.stage_act() + src.virus.cure() + return check_if_buckled() if (src.buckled)