-More work to advance diseases.

The Pandemic should be more compatible with advance diseases. Currently it's pretty ugly but when I get rid of the broken diseases and convert the rest to advance diseases I will clean up the pandemic.

Vaccines will now work properly with advance diseases.

Soon I'll add a system so that you are able to name your own diseases, as I've added ways for me to do that with the archive_diseases list.

Gave names to symptoms for the Pandemic.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4989 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-11-01 23:59:27 +00:00
parent 687532597b
commit bd67128dac
16 changed files with 77 additions and 18 deletions

View File

@@ -94,7 +94,7 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease - /datum/disease/ad
return result
/datum/disease/proc/spread(var/atom/source=null, var/airborne_range = 2, var/force_spread)
/datum/disease/proc/spread(var/atom/source=null, var/airborne_range = 3, var/force_spread)
//world << "Disease [src] proc spread was called from holder [source]"
// If we're overriding how we spread, say so here
@@ -118,9 +118,10 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease - /datum/disease/ad
var/check_range = airborne_range//defaults to airborne - range 2
if(how_spread != AIRBORNE && how_spread != SPECIAL)
check_range = 0 // everything else, like infect-on-contact things, only infect things on top of it
check_range = 1 // everything else, like infect-on-contact things, only infect things on top of it
for(var/mob/living/carbon/M in oview(check_range, source))
if(AStar(affected_mob.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range))
M.contract_disease(src)
return

View File

@@ -9,6 +9,8 @@
#define RANDOM_STARTING_LEVEL 2
var/list/archive_diseases = list()
/*
PROPERTIES
@@ -36,6 +38,13 @@
*/
/datum/disease/advance/New(var/process = 1, var/datum/disease/advance/D)
// Setup our dictionary if it hasn't already.
if(!dictionary_symptoms.len)
for(var/symp in list_symptoms)
var/datum/symptom/S = new symp
dictionary_symptoms[S.id] = symp
if(!istype(D))
D = null
// Generate symptoms if we weren't given any.
@@ -70,7 +79,7 @@
if(affected_mob)
var/id = "[GetDiseaseID()]"
if(resistance && !(id in affected_mob.resistances))
affected_mob.resistances[id] = /datum/disease/advance
affected_mob.resistances[id] = id
affected_mob.viruses -= src //remove the datum from the list
del(src) //delete the datum to stop it processing
return
@@ -119,6 +128,7 @@
//world << "[src.name] \ref[src] - REFRESH!"
var/list/properties = GenerateProperties()
AssignProperties(properties)
archive_diseases[GetDiseaseID()] = src
//Generate disease properties based on the effects. Returns an associated list.
/datum/disease/advance/proc/GenerateProperties()

View File

@@ -16,6 +16,7 @@ Bonus
/datum/symptom/confusion
name = "Confusion"
stealth = 1
resistance = -1
stage_speed = -3

View File

@@ -16,6 +16,7 @@ BONUS
/datum/symptom/cough
name = "Cough"
stealth = -1
resistance = 0
stage_speed = 0

View File

@@ -16,6 +16,7 @@ Bonus
/datum/symptom/damage_converter // Not the egg
name = "Toxic Compensation"
stealth = 1
resistance = -5
stage_speed = -5

View File

@@ -16,6 +16,7 @@ Bonus
/datum/symptom/dizzy // Not the egg
name = "Dizziness"
stealth = 1
resistance = -2
stage_speed = -3

View File

@@ -17,6 +17,7 @@ BONUS
/datum/symptom/cough
name = "Headache"
stealth = -1
resistance = 4
stage_speed = 0

View File

@@ -17,6 +17,7 @@ Bonus
/datum/symptom/sneeze
name = "Sneezing"
stealth = -2
resistance = -1
stage_speed = 0
@@ -31,5 +32,5 @@ Bonus
M.emote("sniffs")
else
M.emote("sneeze")
A.spread(A.holder, 4, AIRBORNE)
A.spread(A.holder, 5, AIRBORNE)
return

View File

@@ -1,11 +1,13 @@
// Symptoms are the effects that engineered advanced diseases do.
var/list/list_symptoms = typesof(/datum/symptom) - /datum/symptom
var/list/dictionary_symptoms = list()
var/global/const/SYMPTOM_ACTIVATION_PROB = 1
/datum/symptom
// Buffs/Debuffs the symptom has to the overall engineered disease.
var/name = ""
var/stealth = 0
var/resistance = 0
var/stage_speed = 0

View File

@@ -20,6 +20,7 @@ Bonus
/datum/symptom/vomit
name = "Vomiting"
stealth = -2
resistance = -1
stage_speed = 0
@@ -69,6 +70,7 @@ Bonus
/datum/symptom/vomit/blood
name = "Blood Vomiting"
stealth = -2
resistance = -1
stage_speed = -1

View File

@@ -500,7 +500,6 @@ As such, it's hard-coded for now. No reason for it not to be, really.
equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_r_store)
equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_l_store)
equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store)
resistances += "alien_embryo"
return 1
//=======//HELPER PROCS//=======//

View File

@@ -188,7 +188,7 @@
M:appendix_op_stage = 6.0
for(var/datum/disease/appendicitis in M.viruses)
appendicitis.cure()
M.resistances += appendicitis
M.resistances += appendicitis.type
return
if (user.zone_sel.selecting == "eyes")

View File

@@ -181,5 +181,4 @@ var/global/sent_strike_team = 0
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
resistances += "alien_embryo"
return 1

View File

@@ -178,5 +178,4 @@ var/global/sent_syndicate_strike_team = 0
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
resistances += "alien_embryo"
return 1

View File

@@ -495,8 +495,16 @@
if(!src.wait)
var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
if(B)
var/vaccine_type = text2path(href_list["create_vaccine"])//the path is received as string - converting
var/datum/disease/D = new vaccine_type
var/path = href_list["create_vaccine"]
var/vaccine_type = text2path(path)
var/datum/disease/D = null
if(!vaccine_type)
D = archive_diseases[path]
vaccine_type = path
else
D = new vaccine_type(0, null)
if(D)
B.name = "[D.name] vaccine bottle"
B.reagents.add_reagent("vaccine",15,vaccine_type)
@@ -520,7 +528,12 @@
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 = text2path(href_list["create_virus_culture"])//the path is received as string - converting
var/datum/disease/D = new type
var/datum/disease/D = null
if(!type)
var/datum/disease/advance/A = archive_diseases[href_list["create_virus_culture"]]
D = new A.type(0, A)
else
D = new type(0, null)
var/list/data = list("viruses"=list(D))
var/name = sanitize(input(usr,"Name:","Name the culture",D.name))
if(!name || name == " ") name = D.name
@@ -596,20 +609,43 @@
for(var/datum/disease/D in Blood.data["viruses"])
if(!D.hidden[PANDEMIC])
dat += "<b>Disease Agent:</b> [D?"[D.agent] - <A href='?src=\ref[src];create_virus_culture=[D.type]'>Create virus culture bottle</A>":"none"]<BR>"
var/disease_creation = D.type
if(istype(D, /datum/disease/advance))
var/datum/disease/advance/A = D
D = archive_diseases[A.GetDiseaseID()]
disease_creation = A.GetDiseaseID()
dat += "<b>Disease Agent:</b> [D?"[D.agent] - <A href='?src=\ref[src];create_virus_culture=[disease_creation]'>Create virus culture bottle</A>":"none"]<BR>"
dat += "<b>Common name:</b> [(D.name||"none")]<BR>"
dat += "<b>Description: </b> [(D.desc||"none")]<BR>"
dat += "<b>Possible cure:</b> [(D.cure||"none")]<BR><BR>"
if(istype(D, /datum/disease/advance))
var/datum/disease/advance/A = D
dat += "<b>Symptoms:</b>"
for(var/datum/symptom/S in A.symptoms)
dat += " [S.name] "
dat += "<b>Contains antibodies to:</b> "
if(Blood.data["resistances"])
var/list/res = Blood.data["resistances"]
if(res.len)
dat += "<ul>"
for(var/type in Blood.data["resistances"])
var/datum/disease/DR = new type
dat += "<li>[DR.name] - <A href='?src=\ref[src];create_vaccine=[type]'>Create vaccine bottle</A></li>"
del(DR)
var/disease_name = "Unknown"
if(!ispath(type))
var/datum/disease/advance/A = archive_diseases[type]
if(A)
disease_name = A.name
else
var/datum/disease/D = new type(0, null)
disease_name = D.name
dat += "<li>[disease_name] - <A href='?src=\ref[src];create_vaccine=[type]'>Create vaccine bottle</A></li>"
dat += "</ul><BR>"
else
dat += "nothing<BR>"

View File

@@ -194,6 +194,11 @@ datum
src = null
if(self.data&&method == INGEST)
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/advance))
var/datum/disease/advance/A = D
if(A.GetDiseaseID() == self.data)
D.cure()
else
if(D.type == self.data)
D.cure()