diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm index beb3fb476f..f33d8ec87a 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -13,7 +13,7 @@ var/max_severity = 3 -/datum/round_event/disease_outbreak/announce() +/datum/round_event/disease_outbreak/announce(fake) priority_announce("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/ai/outbreak7.ogg') /datum/round_event/disease_outbreak/setup() @@ -33,7 +33,7 @@ var/turf/T = get_turf(H) if(!T) continue - if(T.z != ZLEVEL_STATION_PRIMARY) + if(!(T.z in GLOB.station_z_levels)) continue if(!H.client) continue @@ -51,7 +51,7 @@ var/datum/disease/D if(!advanced_virus) if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. - if(!H.dna || (H.has_disability(BLIND))) //A blindness disease would be the worst. + if(!H.dna || (H.has_disability(DISABILITY_BLIND))) //A blindness disease would be the worst. continue D = new virus_type() var/datum/disease/dnaspread/DS = D @@ -64,4 +64,33 @@ D = make_virus(max_severity, max_severity) D.carrier = TRUE H.AddDisease(D) + + if(advanced_virus) + var/datum/disease/advance/A = D + var/list/name_symptoms = list() //for feedback + for(var/datum/symptom/S in A.symptoms) + name_symptoms += S.name + message_admins("An event has triggered a random advanced virus outbreak on [key_name_admin(H)]! It has these symptoms: [english_list(name_symptoms)]") + log_game("An event has triggered a random advanced virus outbreak on [key_name(H)]! It has these symptoms: [english_list(name_symptoms)]") break + +/datum/round_event/disease_outbreak/proc/make_virus(max_symptoms, max_level) + if(max_symptoms > SYMPTOM_LIMIT) + max_symptoms = SYMPTOM_LIMIT + var/datum/disease/advance/A = new(FALSE, null) + A.symptoms = list() + var/list/datum/symptom/possible_symptoms = list() + for(var/symptom in subtypesof(/datum/symptom)) + var/datum/symptom/S = symptom + if(initial(S.level) > max_level) + continue + if(initial(S.level) <= 0) //unobtainable symptoms + continue + possible_symptoms += S + for(var/i in 1 to max_symptoms) + var/datum/symptom/chosen_symptom = pick_n_take(possible_symptoms) + if(chosen_symptom) + var/datum/symptom/S = new chosen_symptom + A.symptoms += S + A.Refresh() //just in case someone already made and named the same disease + return A