mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] Various virology fixes (#10871)
Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2acde41fab
commit
92b1bc3f74
@@ -79,6 +79,9 @@
|
|||||||
if(!CanContractDisease(D))
|
if(!CanContractDisease(D))
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
|
if(species.virus_immune && !global_flag_check(D.virus_modifiers, BYPASSES_IMMUNITY))
|
||||||
|
return FALSE
|
||||||
|
|
||||||
var/obj/item/clothing/Cl = null
|
var/obj/item/clothing/Cl = null
|
||||||
var/passed = TRUE
|
var/passed = TRUE
|
||||||
|
|
||||||
|
|||||||
@@ -72,15 +72,11 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
|||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
/datum/disease/advance/IsSame(datum/disease/advance/D)
|
/datum/disease/advance/IsSame(datum/disease/advance/D)
|
||||||
if(ispath(D))
|
|
||||||
return FALSE
|
|
||||||
|
|
||||||
if(!istype(D, /datum/disease/advance))
|
if(!istype(D, /datum/disease/advance))
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
if(GetDiseaseID() != D.GetDiseaseID())
|
if(GetDiseaseID() != D.GetDiseaseID())
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
/datum/disease/advance/cure(resistance = TRUE)
|
/datum/disease/advance/cure(resistance = TRUE)
|
||||||
@@ -91,14 +87,27 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
|||||||
remove_virus()
|
remove_virus()
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
/datum/disease/advance/Copy(process = 0)
|
/datum/disease/advance/Copy()
|
||||||
return new /datum/disease/advance(process, src, 1)
|
var/datum/disease/advance/A = ..()
|
||||||
|
QDEL_LIST(A.symptoms)
|
||||||
|
for(var/datum/symptom/S as anything in symptoms)
|
||||||
|
A.symptoms += S.Copy()
|
||||||
|
A.disease_flags = disease_flags
|
||||||
|
A.resistance = resistance
|
||||||
|
A.stealth = stealth
|
||||||
|
A.stage_rate = stage_rate
|
||||||
|
A.transmission = transmission
|
||||||
|
A.severity = severity
|
||||||
|
A.speed = speed
|
||||||
|
A.id = id
|
||||||
|
A.Refresh()
|
||||||
|
return A
|
||||||
|
|
||||||
/datum/disease/advance/proc/Mix(datum/disease/advance/D)
|
/datum/disease/advance/proc/Mix(datum/disease/advance/D)
|
||||||
if(!(IsSame(D)))
|
if(!(IsSame(D)))
|
||||||
var/list/possible_symptoms = shuffle(D.symptoms)
|
var/list/possible_symptoms = shuffle(D.symptoms)
|
||||||
for(var/datum/symptom/S in possible_symptoms)
|
for(var/datum/symptom/S in possible_symptoms)
|
||||||
AddSymptom(new S.type)
|
AddSymptom(S.Copy())
|
||||||
|
|
||||||
/datum/disease/advance/proc/HasSymptom(datum/symptom/S)
|
/datum/disease/advance/proc/HasSymptom(datum/symptom/S)
|
||||||
for(var/datum/symptom/symp in symptoms)
|
for(var/datum/symptom/symp in symptoms)
|
||||||
@@ -180,12 +189,12 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
|||||||
var/c2sev
|
var/c2sev
|
||||||
var/c3sev
|
var/c3sev
|
||||||
|
|
||||||
for(var/datum/symptom/S as() in symptoms)
|
for(var/datum/symptom/S as anything in symptoms)
|
||||||
resistance += S.resistance
|
resistance += S.resistance
|
||||||
stealth += S.stealth
|
stealth += S.stealth
|
||||||
stage_rate += S.stage_speed
|
stage_rate += S.stage_speed
|
||||||
transmission += S.transmission
|
transmission += S.transmission
|
||||||
for(var/datum/symptom/S as() in symptoms)
|
for(var/datum/symptom/S as anything in symptoms)
|
||||||
S.severityset(src)
|
S.severityset(src)
|
||||||
switch(S.severity)
|
switch(S.severity)
|
||||||
if(-INFINITY to 0)
|
if(-INFINITY to 0)
|
||||||
@@ -303,6 +312,9 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
|||||||
if(!id)
|
if(!id)
|
||||||
var/list/L = list()
|
var/list/L = list()
|
||||||
for(var/datum/symptom/S in symptoms)
|
for(var/datum/symptom/S in symptoms)
|
||||||
|
if(S.neutered)
|
||||||
|
L += "[S.id]N"
|
||||||
|
else
|
||||||
L += S.id
|
L += S.id
|
||||||
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in.
|
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in.
|
||||||
var/result = jointext(L, ":")
|
var/result = jointext(L, ":")
|
||||||
@@ -325,7 +337,7 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
|||||||
else
|
else
|
||||||
RemoveSymptom(pick(symptoms))
|
RemoveSymptom(pick(symptoms))
|
||||||
symptoms += S
|
symptoms += S
|
||||||
return
|
Refresh()
|
||||||
|
|
||||||
// Simply removes the symptom.
|
// Simply removes the symptom.
|
||||||
/datum/disease/advance/proc/RemoveSymptom(datum/symptom/S)
|
/datum/disease/advance/proc/RemoveSymptom(datum/symptom/S)
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
for(var/guaranteed_symptom in guaranteed_symptoms)
|
for(var/guaranteed_symptom in guaranteed_symptoms)
|
||||||
symptoms += new guaranteed_symptom
|
symptoms += new guaranteed_symptom
|
||||||
Finalize()
|
Finalize()
|
||||||
Refresh()
|
|
||||||
|
|
||||||
/datum/disease/advance/random/macrophage
|
/datum/disease/advance/random/macrophage
|
||||||
setsymptom = /datum/symptom/macrophage
|
setsymptom = /datum/symptom/macrophage
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ BONUS
|
|||||||
if(!..())
|
if(!..())
|
||||||
return
|
return
|
||||||
if(!used)
|
if(!used)
|
||||||
for(var/datum/symptom/S as() in A.symptoms)
|
for(var/datum/symptom/S as anything in A.symptoms)
|
||||||
if(S == src)
|
if(S == src)
|
||||||
return
|
return
|
||||||
S.power += power
|
S.power += power
|
||||||
@@ -156,13 +156,13 @@ BONUS
|
|||||||
if(!..())
|
if(!..())
|
||||||
return
|
return
|
||||||
if(A.stage >= 5)
|
if(A.stage >= 5)
|
||||||
for(var/datum/symptom/S as() in captives)
|
for(var/datum/symptom/S as anything in captives)
|
||||||
S.stopped = FALSE
|
S.stopped = FALSE
|
||||||
captives -= S
|
captives -= S
|
||||||
if(!LAZYLEN(captives))
|
if(!LAZYLEN(captives))
|
||||||
stopped = TRUE
|
stopped = TRUE
|
||||||
else if(!used)
|
else if(!used)
|
||||||
for(var/datum/symptom/S as() in A.symptoms)
|
for(var/datum/symptom/S as anything in A.symptoms)
|
||||||
if(S.neutered)
|
if(S.neutered)
|
||||||
continue
|
continue
|
||||||
if(S == src)
|
if(S == src)
|
||||||
|
|||||||
@@ -226,7 +226,7 @@
|
|||||||
traits["name"] = disease.name
|
traits["name"] = disease.name
|
||||||
traits["is_adv"] = TRUE
|
traits["is_adv"] = TRUE
|
||||||
traits["symptoms"] = list()
|
traits["symptoms"] = list()
|
||||||
for(var/datum/symptom/symptom as() in adv_disease.symptoms)
|
for(var/datum/symptom/symptom as anything in adv_disease.symptoms)
|
||||||
traits["symptoms"] += list(symptom.get_symptom_data())
|
traits["symptoms"] += list(symptom.get_symptom_data())
|
||||||
traits["resistance"] = adv_disease.resistance
|
traits["resistance"] = adv_disease.resistance
|
||||||
traits["stealth"] = adv_disease.stealth
|
traits["stealth"] = adv_disease.stealth
|
||||||
@@ -286,7 +286,6 @@
|
|||||||
/obj/machinery/computer/pandemic/proc/create_culture_bottle(index)
|
/obj/machinery/computer/pandemic/proc/create_culture_bottle(index)
|
||||||
var/id = get_virus_id_by_index(text2num(index))
|
var/id = get_virus_id_by_index(text2num(index))
|
||||||
var/datum/disease/advance/adv_disease = GLOB.archive_diseases[id]
|
var/datum/disease/advance/adv_disease = GLOB.archive_diseases[id]
|
||||||
var/old_name = adv_disease.name
|
|
||||||
|
|
||||||
if(!istype(adv_disease))
|
if(!istype(adv_disease))
|
||||||
to_chat(usr, span_warning("ERROR: Cannot replicate virus strain."))
|
to_chat(usr, span_warning("ERROR: Cannot replicate virus strain."))
|
||||||
@@ -294,7 +293,9 @@
|
|||||||
|
|
||||||
if(!beaker.reagents.has_reagent(REAGENT_ID_BLOOD, 10))
|
if(!beaker.reagents.has_reagent(REAGENT_ID_BLOOD, 10))
|
||||||
to_chat(usr, span_warning("ERROR: Not enough blood in the sample."))
|
to_chat(usr, span_warning("ERROR: Not enough blood in the sample."))
|
||||||
return FALSE
|
return
|
||||||
|
|
||||||
|
var/old_name = adv_disease.name
|
||||||
|
|
||||||
use_power(active_power_usage)
|
use_power(active_power_usage)
|
||||||
adv_disease = adv_disease.Copy()
|
adv_disease = adv_disease.Copy()
|
||||||
|
|||||||
Reference in New Issue
Block a user