You can now add multiple cures for one disease. To do so, simply add a New() proc to the disease that adds the vars for the cures you want to cure_list.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@870 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
crazyclonetheninja
2011-01-16 07:23:18 +00:00
parent e6a45538a6
commit f7e8ad1b03

View File

@@ -19,6 +19,7 @@ to null does not delete the object itself. Thank you.
var/max_stages = 0.0
var/cure = null
var/cure_id = null// reagent.id or list containing them
var/cure_list = null // allows for multiple possible cure combinations
var/cure_chance = 8//chance for the cure to do its job
var/spread = null //spread type description
var/spread_type = AIRBORNE
@@ -36,6 +37,10 @@ to null does not delete the object itself. Thank you.
var/severity = null//severity descr
var/longevity = 250//time in "ticks" the virus stays in inanimate object (blood stains, corpses, etc). In syringes, bottles and beakers it stays infinitely.
/datum/disease/New()
..()
cure_list = list(cure_id) // to add more cures, add more vars to this list in the actual disease's New()
/datum/disease/proc/stage_act()
var/cure_present = has_cure()
//world << "[cure_present]"
@@ -61,12 +66,22 @@ to null does not delete the object itself. Thank you.
/datum/disease/proc/has_cure()//check if affected_mob has required reagents.
if(!cure_id) return 0
var/result = 1
if(istype(cure_id, /list))
for(var/C_id in cure_id)
if(!affected_mob.reagents.has_reagent(C_id))
if(cure_list == list(cure_id))
if(istype(cure_id, /list))
for(var/C_id in cure_id)
if(!affected_mob.reagents.has_reagent(C_id))
result = 0
else if(!affected_mob.reagents.has_reagent(cure_id))
result = 0
else
for(var/C_list in cure_list)
if(istype(C_list, /list))
for(var/C_id in cure_id)
if(!affected_mob.reagents.has_reagent(C_id))
result = 0
else if(!affected_mob.reagents.has_reagent(C_list))
result = 0
else if(!affected_mob.reagents.has_reagent(cure_id))
result = 0
return result