mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +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))
|
||||
return FALSE
|
||||
|
||||
if(species.virus_immune && !global_flag_check(D.virus_modifiers, BYPASSES_IMMUNITY))
|
||||
return FALSE
|
||||
|
||||
var/obj/item/clothing/Cl = null
|
||||
var/passed = TRUE
|
||||
|
||||
|
||||
@@ -72,15 +72,11 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
||||
return TRUE
|
||||
|
||||
/datum/disease/advance/IsSame(datum/disease/advance/D)
|
||||
if(ispath(D))
|
||||
return FALSE
|
||||
|
||||
if(!istype(D, /datum/disease/advance))
|
||||
return FALSE
|
||||
|
||||
if(GetDiseaseID() != D.GetDiseaseID())
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/datum/disease/advance/cure(resistance = TRUE)
|
||||
@@ -91,14 +87,27 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
||||
remove_virus()
|
||||
qdel(src)
|
||||
|
||||
/datum/disease/advance/Copy(process = 0)
|
||||
return new /datum/disease/advance(process, src, 1)
|
||||
/datum/disease/advance/Copy()
|
||||
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)
|
||||
if(!(IsSame(D)))
|
||||
var/list/possible_symptoms = shuffle(D.symptoms)
|
||||
for(var/datum/symptom/S in possible_symptoms)
|
||||
AddSymptom(new S.type)
|
||||
AddSymptom(S.Copy())
|
||||
|
||||
/datum/disease/advance/proc/HasSymptom(datum/symptom/S)
|
||||
for(var/datum/symptom/symp in symptoms)
|
||||
@@ -180,12 +189,12 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
||||
var/c2sev
|
||||
var/c3sev
|
||||
|
||||
for(var/datum/symptom/S as() in symptoms)
|
||||
for(var/datum/symptom/S as anything in symptoms)
|
||||
resistance += S.resistance
|
||||
stealth += S.stealth
|
||||
stage_rate += S.stage_speed
|
||||
transmission += S.transmission
|
||||
for(var/datum/symptom/S as() in symptoms)
|
||||
for(var/datum/symptom/S as anything in symptoms)
|
||||
S.severityset(src)
|
||||
switch(S.severity)
|
||||
if(-INFINITY to 0)
|
||||
@@ -303,6 +312,9 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
||||
if(!id)
|
||||
var/list/L = list()
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
if(S.neutered)
|
||||
L += "[S.id]N"
|
||||
else
|
||||
L += S.id
|
||||
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in.
|
||||
var/result = jointext(L, ":")
|
||||
@@ -325,7 +337,7 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
||||
else
|
||||
RemoveSymptom(pick(symptoms))
|
||||
symptoms += S
|
||||
return
|
||||
Refresh()
|
||||
|
||||
// Simply removes the symptom.
|
||||
/datum/disease/advance/proc/RemoveSymptom(datum/symptom/S)
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
for(var/guaranteed_symptom in guaranteed_symptoms)
|
||||
symptoms += new guaranteed_symptom
|
||||
Finalize()
|
||||
Refresh()
|
||||
|
||||
/datum/disease/advance/random/macrophage
|
||||
setsymptom = /datum/symptom/macrophage
|
||||
|
||||
@@ -77,7 +77,7 @@ BONUS
|
||||
if(!..())
|
||||
return
|
||||
if(!used)
|
||||
for(var/datum/symptom/S as() in A.symptoms)
|
||||
for(var/datum/symptom/S as anything in A.symptoms)
|
||||
if(S == src)
|
||||
return
|
||||
S.power += power
|
||||
@@ -156,13 +156,13 @@ BONUS
|
||||
if(!..())
|
||||
return
|
||||
if(A.stage >= 5)
|
||||
for(var/datum/symptom/S as() in captives)
|
||||
for(var/datum/symptom/S as anything in captives)
|
||||
S.stopped = FALSE
|
||||
captives -= S
|
||||
if(!LAZYLEN(captives))
|
||||
stopped = TRUE
|
||||
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)
|
||||
continue
|
||||
if(S == src)
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
traits["name"] = disease.name
|
||||
traits["is_adv"] = TRUE
|
||||
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["resistance"] = adv_disease.resistance
|
||||
traits["stealth"] = adv_disease.stealth
|
||||
@@ -286,7 +286,6 @@
|
||||
/obj/machinery/computer/pandemic/proc/create_culture_bottle(index)
|
||||
var/id = get_virus_id_by_index(text2num(index))
|
||||
var/datum/disease/advance/adv_disease = GLOB.archive_diseases[id]
|
||||
var/old_name = adv_disease.name
|
||||
|
||||
if(!istype(adv_disease))
|
||||
to_chat(usr, span_warning("ERROR: Cannot replicate virus strain."))
|
||||
@@ -294,7 +293,9 @@
|
||||
|
||||
if(!beaker.reagents.has_reagent(REAGENT_ID_BLOOD, 10))
|
||||
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)
|
||||
adv_disease = adv_disease.Copy()
|
||||
|
||||
Reference in New Issue
Block a user