Lots of bugs fixed for advance diseases.

Fixed advance diseases using the same reference in mobs.
Fixed advance diseases referencing other advance diseases' symptoms, instead of just copying it.

I tested it more thoroughly this time and I can't find any issues but if you do please add them to the bug tracker and or contact me on #coderbus.

Added a new reaction which will remove symptoms from a disease. Needs blood and synaptizine.
Added a new symptom, shivering will make you cold.

Tweaked and balanced some symptoms.

Removed the "flex" emote that hulks will do randomly.
Reduced the change to speak for hulks and brain damaged mobs. ( 7% -> 3% chance)

Please let me know if anything is out of place or wrong.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5048 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-11-13 00:28:07 +00:00
parent 9999a1d65e
commit 7955d348d8
23 changed files with 170 additions and 579 deletions
+7 -2
View File
@@ -30,6 +30,7 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
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/initial_spread = null
var/spread_type = AIRBORNE
var/contagious_period = 0//the disease stage when it can be spread
var/list/affected_species = list()
@@ -58,7 +59,7 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
//world << "[affected_mob] is carrier"
return
spread = (cure_present?"Remissive":initial(spread))
spread = (cure_present?"Remissive":initial_spread)
if(stage > max_stages)
stage = max_stages
@@ -94,7 +95,7 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
return result
/datum/disease/proc/spread(var/atom/source=null, var/airborne_range = 3, var/force_spread)
/datum/disease/proc/spread(var/atom/source=null, var/airborne_range = 2, var/force_spread)
//world << "Disease [src] proc spread was called from holder [source]"
// If we're overriding how we spread, say so here
@@ -174,12 +175,16 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
cure_list = list(cure_id) // to add more cures, add more vars to this list in the actual disease's New()
if(process) // Viruses in list are considered active.
active_diseases += src
initial_spread = spread
/datum/disease/proc/IsSame(var/datum/disease/D)
if(istype(src, D.type))
return 1
return 0
/datum/disease/proc/Copy()
return new type(0, src)
/*
/datum/disease/Del()
active_diseases.Remove(src)
+44 -9
View File
@@ -11,6 +11,7 @@
var/list/archive_diseases = list()
/*
PROPERTIES
@@ -54,7 +55,8 @@ var/list/archive_diseases = list()
if(!D || !D.symptoms || !D.symptoms.len)
symptoms = GenerateSymptoms()
else
symptoms = D.symptoms
for(var/datum/symptom/S in D.symptoms)
symptoms += new S.type
name = D.name
Refresh(!copy)
@@ -93,6 +95,9 @@ var/list/archive_diseases = list()
del(src) //delete the datum to stop it processing
return
// Returns the advance disease with a different reference memory.
/datum/disease/advance/Copy()
return new /datum/disease/advance(0, src, 1)
/*
@@ -178,7 +183,7 @@ var/list/archive_diseases = list()
hidden = list( (properties["stealth"] > 2), (properties["stealth"] > 3) )
// The more symptoms we have, the less transmittable it is but some symptoms can make up for it.
SetSpread(max(BLOOD, min(properties["transmittable"] - symptoms.len, AIRBORNE)))
permeability_mod = round(0.5 * properties["transmittable"])
permeability_mod = max(round(0.5 * properties["transmittable"]), 1)
stage_prob = max(properties["stage_rate"], 1)
SetSeverity(properties["severity"])
GenerateCure(properties)
@@ -250,12 +255,18 @@ var/list/archive_diseases = list()
cure_id = "ethylredoxrazine"
if(6)
cure_id = "silver"
cure_id = "synaptizine"
if(7)
cure_id = "gold"
cure_id = "silver"
if(8)
cure_id = "gold"
if(9)
cure_id = "mindbreaker"
else
cure_id = "plasma"
// Get the cure name from the cure_id
@@ -267,12 +278,21 @@ var/list/archive_diseases = list()
// Randomly generate a symptom, has a chance to lose or gain a symptom.
/datum/disease/advance/proc/Evolve(var/level = 2)
var/s = safe_pick_list(GenerateSymptoms(level, 1))
var/s = safepick(GenerateSymptoms(level, 1))
if(s)
AddSymptom(s)
Refresh()
return
// Randomly remove a symptom.
/datum/disease/advance/proc/Devolve()
if(symptoms.len > 1)
var/s = safepick(symptoms)
if(s)
RemoveSymptom(s)
Refresh()
return
// Name the disease.
/datum/disease/advance/proc/AssignName(var/name = "Unknown")
src.name = name
@@ -293,7 +313,7 @@ var/list/archive_diseases = list()
if(HasSymptom(S))
return
if(symptoms.len < 4 + rand(-1, 1))
if(symptoms.len < 3 + rand(-1, 1))
symptoms += S
else
RemoveSymptom(pick(symptoms))
@@ -314,9 +334,13 @@ var/list/archive_diseases = list()
// Mix a list of advance diseases and return the mixed result.
/proc/Advance_Mix(var/list/D_list)
//world << "Mixing!!!!"
var/list/diseases = list()
for(var/datum/disease/advance/A in D_list)
diseases += A
for(var/datum/disease/advance/A in D_list.Copy())
diseases += A.Copy()
if(!diseases.len)
return null
if(diseases.len <= 1)
@@ -330,15 +354,26 @@ var/list/archive_diseases = list()
var/datum/disease/advance/D1 = pick(diseases)
diseases -= D1
D_list -= D1
var/datum/disease/advance/D2 = pick(diseases)
D2.Mix(D1)
// Should be only 1 entry left, but if not let's only return a single entry
//world << "END MIXING!!!!!"
var/datum/disease/advance/to_return = pick(diseases)
to_return.Refresh()
return to_return
/proc/SetViruses(var/datum/reagent/R, var/list/data)
if(data)
var/list/preserve = list()
if(istype(data) && data["viruses"])
for(var/datum/disease/A in data["viruses"])
preserve += A.Copy()
R.data = data.Copy()
else
R.data = data
if(preserve.len)
R.data["viruses"] = preserve
#undef RANDOM_STARTING_LEVEL
@@ -30,7 +30,7 @@ BONUS
var/mob/living/M = A.affected_mob
switch(A.stage)
if(1, 2, 3)
M << "<span notice='notice'>[pick("You swallow excess mucus.", "You lightly cough .")]</span>"
M << "<span notice='notice'>[pick("You swallow excess mucus.", "You lightly cough.")]</span>"
else
M.emote("cough")
M.drop_item()
@@ -29,6 +29,6 @@ Bonus
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/carbon/M = A.affected_mob
M << "<span class='notice'>[pick("You feel hot.", "You feel like you're burning.")]</span>"
M.bodytemperature += 30 * A.stage
M.bodytemperature += 20 * A.stage
return
@@ -0,0 +1,34 @@
/*
//////////////////////////////////////
Shivering
No change to hidden.
Increases resistance.
Increases stage speed.
Little transmittable.
Low level.
Bonus
Cools down your body.
//////////////////////////////////////
*/
/datum/symptom/shivering
name = "Shivering"
stealth = 0
resistance = 2
stage_speed = 2
transmittable = 1
level = 2
/datum/symptom/shivering/Activate(var/datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB))
var/mob/living/carbon/M = A.affected_mob
M << "<span class='notice'>[pick("You feel cold.", "You start shaking from the cold.")]</span>"
M.bodytemperature -= 20 * A.stage
return
@@ -31,7 +31,7 @@ Bonus
var/mob/living/M = A.affected_mob
switch(A.stage)
if(1, 2, 3)
M.visible_message("<B>[M]</B> sniffs.")
M.emote("sniff")
else
M.emote("sneeze")
A.spread(A.holder, 5, AIRBORNE)
@@ -3,7 +3,7 @@
var/list/list_symptoms = typesof(/datum/symptom) - /datum/symptom
var/list/dictionary_symptoms = list()
var/global/const/SYMPTOM_ACTIVATION_PROB = 1
var/global/const/SYMPTOM_ACTIVATION_PROB = 3
/datum/symptom
// Buffs/Debuffs the symptom has to the overall engineered disease.
@@ -91,5 +91,5 @@ Bonus
M.adjustBruteLoss(3)
var/turf/pos = get_turf(M)
pos.add_vomit_floor(M)
pos.add_blood_floor(M)
playsound(pos, 'sound/effects/splat.ogg', 50, 1)
@@ -73,6 +73,7 @@ Bonus
if(1, 2, 3, 4)
M << "<span class='notice'>[pick("You feel hungry.", "You crave for food.")]</span>"
else
M << "<span class='notice'>Your stomach rumbles.</span>"
M.overeatduration = max(M.overeatduration - 100, 0)
M.nutrition = max(M.nutrition - 100, 0)