From 686b7e4872542fc42f0973681008ab3d85b58be0 Mon Sep 17 00:00:00 2001 From: panurgomatic Date: Fri, 22 Oct 2010 00:37:12 +0000 Subject: [PATCH] - Disease & related fixes. - Wizarditis should not teleport you to space. But still can teleport you to areas with no air. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@344 316c924e-a436-60f5-8080-3fe189b3f50e --- code/WorkInProgress/Chemistry-Machinery.dm | 4 ++-- code/WorkInProgress/Chemistry-Reagents.dm | 10 +++++++++- code/datums/disease.dm | 18 +++++++++++------- code/datums/diseases/wizarditis.dm | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/code/WorkInProgress/Chemistry-Machinery.dm b/code/WorkInProgress/Chemistry-Machinery.dm index c3dd3b082e5f..99fde968fd37 100644 --- a/code/WorkInProgress/Chemistry-Machinery.dm +++ b/code/WorkInProgress/Chemistry-Machinery.dm @@ -298,7 +298,7 @@ if (href_list["create_vaccine"]) if(!src.wait) var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc) - var/vaccine_type = href_list["create_vaccine"] + var/vaccine_type = text2path(href_list["create_vaccine"])//the path is received as string - converting var/datum/disease/D = new vaccine_type var/name = input(usr,"Name:","Name the vaccine",D.name) if(!name || name == " ") name = D.name @@ -316,7 +316,7 @@ if(!wait) var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc) B.icon_state = "bottle3" - var/type = href_list["create_virus_culture"] + var/type = text2path(href_list["create_virus_culture"])//the path is received as string - converting var/datum/disease/D = new type var/list/data = list("virus"=D) var/name = input(usr,"Name:","Name the culture",D.name) diff --git a/code/WorkInProgress/Chemistry-Reagents.dm b/code/WorkInProgress/Chemistry-Reagents.dm index e57253fd1ffd..3b7d8cba5db8 100644 --- a/code/WorkInProgress/Chemistry-Reagents.dm +++ b/code/WorkInProgress/Chemistry-Reagents.dm @@ -127,6 +127,14 @@ datum blood_prop.virus.spread_type = CONTACT_HANDS return +/* Must check the transfering of reagents and their data first. They all can point to one disease datum. + + Del() + if(src.data["virus"]) + var/datum/disease/D = src.data["virus"] + D.cure(0) + ..() +*/ vaccine //data must contain virus type name = "Vaccine" @@ -137,7 +145,7 @@ datum var/datum/reagent/vaccine/self = src src = null if(self.data&&method == INGEST) - if(M.virus&&M.virus.type == self.data) + if(M.virus && M.virus.type == self.data) M.virus.cure() return diff --git a/code/datums/disease.dm b/code/datums/disease.dm index d07932ab9a67..265af50c6b54 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -53,6 +53,7 @@ to null does not delete the object itself. Thank you. if(stage != 1 && (prob(1) || (cure_present && prob(cure_chance)))) stage-- else if(stage <= 1 && ((prob(1) && src.curable) || (cure_present && prob(cure_chance)))) +// world << "Cured as stage act" src.cure() return return @@ -72,7 +73,7 @@ to null does not delete the object itself. Thank you. /mob/proc/contract_disease(var/datum/disease/virus, var/skip_this = 0) //world << "Contract_disease called by [src] with virus [virus]" - if(skip_this == 1) + if(skip_this == 1)//be wary, it replaces the current disease... if(src.virus) src.virus.cure(0) src.virus = new virus.type @@ -102,7 +103,7 @@ to null does not delete the object itself. Thank you. clothing_areas[Covers] += Clothing */ - if(prob(15/virus.permeability_mod)) return + if(prob(15/virus.permeability_mod)) return //the power of immunity compels this disease! var/obj/item/clothing/Cl = null var/passed = 1 @@ -273,11 +274,14 @@ to null does not delete the object itself. Thank you. 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) + if(resistance && src.affected_mob && !affected_mob.resistances.Find(src.type)) +// world << "Setting res to [src]" + var/type = "[src.type]"//copy the value, not create the reference to it, so when the object is deleted, the value remains. + affected_mob.resistances += text2path(type) +// world << "Removing [src]" + spawn(0) + del(src) + return /datum/disease/New() diff --git a/code/datums/diseases/wizarditis.dm b/code/datums/diseases/wizarditis.dm index 10baaf5d776d..34b9209c59a9 100644 --- a/code/datums/diseases/wizarditis.dm +++ b/code/datums/diseases/wizarditis.dm @@ -103,7 +103,7 @@ STI KALY - blind var/list/theareas = new/list() for(var/area/AR in orange(80, affected_mob)) - if(theareas.Find(AR)) continue + if(theareas.Find(AR) || AR.name == "Space") continue theareas += AR var/area/thearea = pick(theareas)