diff --git a/monkestation/code/modules/virology/disease/symptom_varients/base.dm b/monkestation/code/modules/virology/disease/symptom_varients/base.dm index 98908388dcfb..e42fec75ce8f 100644 --- a/monkestation/code/modules/virology/disease/symptom_varients/base.dm +++ b/monkestation/code/modules/virology/disease/symptom_varients/base.dm @@ -51,6 +51,7 @@ return FALSE host_symptom.run_effect(host_disease.affected_mob, host_disease) COOLDOWN_START(src, host_cooldown, cooldown_time) + return TRUE /datum/symptom_varient/proc/Copy(datum/symptom/new_symp) return new type(new_symp) diff --git a/monkestation/code/modules/virology/disease/symptom_varients/bluespace.dm b/monkestation/code/modules/virology/disease/symptom_varients/bluespace.dm index 1535df0d293e..e4f302d75da0 100644 --- a/monkestation/code/modules/virology/disease/symptom_varients/bluespace.dm +++ b/monkestation/code/modules/virology/disease/symptom_varients/bluespace.dm @@ -1,4 +1,4 @@ -GLOBAL_LIST_INIT(bluespace_varient_list, list()) +GLOBAL_LIST_EMPTY_TYPED(bluespace_varient_list, /datum/symptom_varient/bluespace) /datum/symptom_varient/bluespace name = "Quantumly Entangled" @@ -10,11 +10,12 @@ GLOBAL_LIST_INIT(bluespace_varient_list, list()) var/bluespace_id = 0 var/static/last_bluespace_id = 0 -/datum/symptom_varient/bluespace/New(datum/symptom/host) +/datum/symptom_varient/bluespace/New(datum/symptom/host, bluespace_id) . = ..() GLOB.bluespace_varient_list += src - last_bluespace_id++ - bluespace_id = last_bluespace_id + if(isnull(bluespace_id)) + bluespace_id = last_bluespace_id++ + src.bluespace_id = bluespace_id /datum/symptom_varient/bluespace/Destroy(force) GLOB.bluespace_varient_list -= src @@ -24,15 +25,11 @@ GLOBAL_LIST_INIT(bluespace_varient_list, list()) . = ..() RegisterSignal(host_symptom, COMSIG_SYMPTOM_TRIGGER, PROC_REF(propagate)) -/datum/symptom_varient/bluespace/proc/propagate() - for(var/datum/symptom_varient/bluespace/bluespace as anything in GLOB.bluespace_varient_list) - if(bluespace_id != bluespace.bluespace_id) - continue - COOLDOWN_START(bluespace, host_cooldown, cooldown_time) +/datum/symptom_varient/bluespace/Copy(datum/symptom/new_symp) + return new /datum/symptom_varient/bluespace(new_symp, bluespace_id) +/datum/symptom_varient/bluespace/proc/propagate() for(var/datum/symptom_varient/bluespace/bluespace as anything in GLOB.bluespace_varient_list) - if(bluespace_id != bluespace.bluespace_id) - continue - if(!bluespace.host_disease) + if(QDELETED(bluespace) || bluespace_id != bluespace.bluespace_id) continue - bluespace.host_symptom.run_effect(bluespace.host_disease.return_parent(), bluespace.host_disease) + bluespace.trigger_symptom() diff --git a/monkestation/code/modules/virology/disease/symptom_varients/recursive.dm b/monkestation/code/modules/virology/disease/symptom_varients/recursive.dm index 530f46aef0ab..8964be62b117 100644 --- a/monkestation/code/modules/virology/disease/symptom_varients/recursive.dm +++ b/monkestation/code/modules/virology/disease/symptom_varients/recursive.dm @@ -17,10 +17,9 @@ UnregisterSignal(host_symptom, COMSIG_SYMPTOM_TRIGGER) /datum/symptom_varient/recursive/proc/start_chain() - trigger_symptom() - - addtimer(CALLBACK(src, PROC_REF(trigger)), 2 SECONDS) - addtimer(CALLBACK(src, PROC_REF(trigger)), 4 SECONDS) + if(trigger_symptom()) + addtimer(CALLBACK(src, PROC_REF(trigger)), 2 SECONDS, TIMER_DELETE_ME) + addtimer(CALLBACK(src, PROC_REF(trigger)), 4 SECONDS, TIMER_DELETE_ME) /datum/symptom_varient/recursive/proc/trigger() host_symptom.run_effect(host_disease.affected_mob, host_disease) diff --git a/monkestation/code/modules/virology/disease/symtoms/_symptom.dm b/monkestation/code/modules/virology/disease/symtoms/_symptom.dm index 23764bd1bc00..6cde395c57e4 100644 --- a/monkestation/code/modules/virology/disease/symtoms/_symptom.dm +++ b/monkestation/code/modules/virology/disease/symtoms/_symptom.dm @@ -32,6 +32,9 @@ var/datum/symptom_varient/attached_varient // This is our attached varient used for updating desc and Symptom copy code. +/datum/symptom/Destroy(force) + QDEL_NULL(attached_varient) + return ..() /datum/symptom/proc/minormutate() if (prob(20)) diff --git a/monkestation/code/modules/virology/disease/symtoms/helpful/plasma_heal.dm b/monkestation/code/modules/virology/disease/symtoms/helpful/plasma_heal.dm index e03d47862812..66ac164d47b3 100644 --- a/monkestation/code/modules/virology/disease/symtoms/helpful/plasma_heal.dm +++ b/monkestation/code/modules/virology/disease/symtoms/helpful/plasma_heal.dm @@ -24,8 +24,9 @@ /datum/symptom/plasma_heal/first_activate(mob/living/carbon/mob, datum/disease/advanced/disease) . = ..() + if(!HAS_TRAIT(mob, TRAIT_PLASMA_LOVER_METABOLISM)) + to_chat(mob, span_notice("You suddenly love plasma.")) ADD_TRAIT(mob, TRAIT_PLASMA_LOVER_METABOLISM, type) - to_chat(mob, span_notice("You suddenly love plasma.")) /datum/symptom/plasma_heal/side_effect(mob/living/mob) . = ..()