diff --git a/code/datums/diseases/vampire.dm b/code/datums/diseases/vampire.dm index 29b90816d3d..924c9b9c639 100644 --- a/code/datums/diseases/vampire.dm +++ b/code/datums/diseases/vampire.dm @@ -8,6 +8,7 @@ cure_prob = 8 severity = DANGEROUS can_immunity = FALSE + visibility_flags = HIDDEN_PANDEMIC /datum/disease/vampire/stage_act() if(!..()) diff --git a/code/datums/diseases/viruses/_virus.dm b/code/datums/diseases/viruses/_virus.dm index a560c24a097..f850fbb40ab 100644 --- a/code/datums/diseases/viruses/_virus.dm +++ b/code/datums/diseases/viruses/_virus.dm @@ -60,6 +60,9 @@ while(TRUE) if(V == T) var/a_type = (spread_range == 1) ? CONTACT : CONTACT|AIRBORNE + //if we wear bio suit, for example, we won't be able to contract anyone + if(affected_mob.CheckVirusProtection(src, a_type)) + return Contract(C, act_type = a_type, need_protection_check = TRUE) break var/turf/Temp = get_step_towards(V, T) diff --git a/code/datums/diseases/viruses/advance/advance.dm b/code/datums/diseases/viruses/advance/advance.dm index a0e1c579e45..13d9ce41175 100644 --- a/code/datums/diseases/viruses/advance/advance.dm +++ b/code/datums/diseases/viruses/advance/advance.dm @@ -82,6 +82,12 @@ GLOBAL_LIST_EMPTY(archive_diseases) /datum/disease/virus/advance/cure(id, need_immunity) ..(GetDiseaseID(), need_immunity) +/datum/disease/virus/advance/Contract(mob/living/M, act_type, is_carrier = FALSE, need_protection_check = FALSE, zone) + var/datum/disease/virus/advance/A = ..() + if(!istype(A)) + return FALSE + A.Refresh(update_properties = FALSE) + // Returns the advance disease with a different reference memory. /datum/disease/virus/advance/Copy() var/datum/disease/virus/advance/copy = new @@ -335,12 +341,12 @@ GLOBAL_LIST_EMPTY(archive_diseases) /proc/SetViruses(datum/reagent/R, list/data) if(data) var/list/preserve = list() - if(istype(data) && data["viruses"]) - for(var/datum/disease/virus/A in data["viruses"]) - preserve += A.Copy() + if(istype(data) && data["diseases"]) + for(var/datum/disease/D in data["diseases"]) + preserve += D.Copy() R.data = data.Copy() if(preserve.len) - R.data["viruses"] = preserve + R.data["diseases"] = preserve /proc/AdminCreateVirus(client/user) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index d33e99eea46..b9e443e19b0 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -394,7 +394,7 @@ var/datum/chemical_reaction/C = reaction var/total_required_reagents = length(C.required_reagents) var/total_matching_reagents = 0 - var/total_required_catalysts = length(C.required_catalysts) + var/total_required_catalysts = C.count_of_catalysts == -1 ? length(C.required_catalysts) : C.count_of_catalysts var/total_matching_catalysts = 0 var/matching_container = FALSE var/matching_other = FALSE @@ -414,9 +414,8 @@ total_matching_reagents++ multipliers += round(get_reagent_amount(B) / C.required_reagents[B]) for(var/B in C.required_catalysts) - if(!has_reagent(B, C.required_catalysts[B])) - break - total_matching_catalysts++ + if(has_reagent(B, C.required_catalysts[B])) + total_matching_catalysts++ if(!C.required_container) matching_container = TRUE @@ -437,7 +436,7 @@ if(min_temp == 0) min_temp = chem_temp - if(total_matching_reagents == total_required_reagents && total_matching_catalysts == total_required_catalysts && matching_container && matching_other && chem_temp <= max_temp && chem_temp >= min_temp) + if(total_matching_reagents == total_required_reagents && total_matching_catalysts >= total_required_catalysts && matching_container && matching_other && chem_temp <= max_temp && chem_temp >= min_temp) var/multiplier = min(multipliers) var/preserved_data = null for(var/B in C.required_reagents) @@ -807,11 +806,11 @@ // Technically we should probably copy all data lists, but // that could possibly eat up a lot of memory needlessly // if most data lists are read-only. - if(trans_data["viruses"]) + if(trans_data["diseases"]) var/list/temp = list() - for(var/datum/disease/v in trans_data["viruses"]) - temp.Add(v.Copy()) - trans_data["viruses"] = temp + for(var/datum/disease/D in trans_data["diseases"]) + temp += D.Copy() + trans_data["diseases"] = temp return trans_data /datum/reagents/proc/generate_taste_message(minimum_percent = TASTE_SENSITIVITY_NORMAL) diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index 799410ad9ec..26013cb1f57 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -23,26 +23,22 @@ overlays.Cut() stat |= BROKEN -/obj/machinery/computer/pandemic/proc/GetVirusByIndex(index) - if(beaker && beaker.reagents) - if(beaker.reagents.reagent_list.len) - var/datum/reagent/blood/BL = locate() in beaker.reagents.reagent_list - if(BL) - if(BL.data && BL.data["viruses"]) - var/list/viruses = BL.data["viruses"] - return viruses[index] +/obj/machinery/computer/pandemic/proc/GetDiseaseByIndex(index) + if(beaker?.reagents?.reagent_list.len) + for(var/datum/reagent/BL in beaker.reagents.reagent_list) + if(BL?.data && BL.data["diseases"]) + var/list/diseases = BL.data["diseases"] + return diseases[index] /obj/machinery/computer/pandemic/proc/GetResistancesByIndex(index) - if(beaker && beaker.reagents) - if(beaker.reagents.reagent_list.len) - var/datum/reagent/blood/BL = locate() in beaker.reagents.reagent_list - if(BL) - if(BL.data && BL.data["resistances"]) - var/list/resistances = BL.data["resistances"] - return resistances[index] - -/obj/machinery/computer/pandemic/proc/GetVirusTypeByIndex(index) - var/datum/disease/D = GetVirusByIndex(index) + if(beaker?.reagents?.reagent_list.len) + for(var/datum/reagent/BL in beaker.reagents.reagent_list) + if(BL?.data && BL.data["resistances"]) + var/list/resistances = BL.data["resistances"] + return resistances[index] + +/obj/machinery/computer/pandemic/proc/GetDiseaseTypeByIndex(index) + var/datum/disease/D = GetDiseaseByIndex(index) if(D) return D.GetDiseaseID() @@ -103,10 +99,10 @@ temp_html = "The replicator is not ready yet." updateUsrDialog() return - else if(href_list["create_virus_culture"]) + else if(href_list["create_disease_culture"]) if(!wait) - var/datum/disease/D = GetVirusByIndex(text2num(href_list["create_virus_culture"])) - var/datum/disease/copy = null + var/datum/disease/D = GetDiseaseByIndex(text2num(href_list["create_disease_culture"])) + var/datum/disease/copy if(istype(D, /datum/disease/virus/advance)) var/datum/disease/virus/advance/A = GLOB.archive_diseases[D.GetDiseaseID()] if(A) @@ -118,12 +114,12 @@ var/name = stripped_input(usr,"Name:","Name the culture",copy.name,MAX_NAME_LEN) if(name == null || wait) return - var/obj/item/reagent_containers/glass/bottle/B = new/obj/item/reagent_containers/glass/bottle(loc) + var/obj/item/reagent_containers/glass/bottle/B = new(loc) B.icon_state = "round_bottle" B.pixel_x = rand(-3, 3) B.pixel_y = rand(-3, 3) replicator_cooldown(50) - var/list/data = list("viruses"=list(copy)) + var/list/data = list("diseases"=list(copy)) B.name = "[name] culture bottle" B.desc = "A small bottle. Contains [copy.agent] culture in synthblood medium." B.reagents.add_reagent("blood",20,data) @@ -151,15 +147,15 @@ return if(..()) return - var/id = GetVirusTypeByIndex(text2num(href_list["name_disease"])) + var/id = GetDiseaseTypeByIndex(text2num(href_list["name_disease"])) if(GLOB.archive_diseases[id]) var/datum/disease/virus/advance/A = GLOB.archive_diseases[id] A.AssignName(new_name) for(var/datum/disease/virus/advance/AD in GLOB.active_diseases) - AD.Refresh() + AD.Refresh(update_properties = FALSE) updateUsrDialog() else if(href_list["print_form"]) - var/datum/disease/D = GetVirusByIndex(text2num(href_list["print_form"])) + var/datum/disease/D = GetDiseaseByIndex(text2num(href_list["print_form"])) D = GLOB.archive_diseases[D.GetDiseaseID()]//We know it's advanced no need to check print_form(D, usr) @@ -229,10 +225,13 @@ dat += "Закрыть" else var/datum/reagents/R = beaker.reagents - var/datum/reagent/blood/Blood = null - for(var/datum/reagent/blood/B in R.reagent_list) - if(B) + var/datum/reagent/Blood = null + + for(var/datum/reagent/B in R.reagent_list) + if(B.id in GLOB.diseases_carrier_reagents) Blood = B + if(!Blood.data) + continue break if(!R.total_volume||!R.reagent_list.len) dat += "Мензурка пуста
" @@ -246,54 +245,52 @@ dat += "Тип крови: [(Blood.data["blood_type"]||"нет")]
" dat += "Тип расовой крови: [(Blood.data["blood_species"]||"нет")]
" - - if(Blood.data["viruses"]) - var/list/vir = Blood.data["viruses"] - if(vir.len) - var/i = 0 - for(var/thing in Blood.data["viruses"]) - var/datum/disease/D = thing - i++ - if(!(D.visibility_flags & HIDDEN_PANDEMIC)) - - if(istype(D, /datum/disease/virus/advance)) - - var/datum/disease/virus/advance/A = D - D = GLOB.archive_diseases[A.GetDiseaseID()] - if(D) - if(D.name == "Unknown") - dat += "Назвать вирус
" - else - dat += "Напечатать форму выпуска
" - - if(!D) - CRASH("We weren't able to get the advance disease from the archive.") - - dat += "Болезнетворный агент: [D?"[D.agent] — Создать бутылёк с вирусной культурой":"нет"]
" - dat += "Общепринятое название: [(D.name||"нет")]
" - dat += "Описание: [(D.desc||"нет")]
" - dat += "Путь передачи: [(D.additional_info||"нет")]
" - dat += "Возможное лекарство: [(D.cure_text||"нет")]

" - dat += "Возможность выработки антител: [(D.can_immunity ? "Присутствует" : "Отсутствует")]

" - - if(istype(D, /datum/disease/virus/advance)) - var/datum/disease/virus/advance/A = D - dat += "Симптомы: " - var/english_symptoms = list() - for(var/datum/symptom/S in A.symptoms) - english_symptoms += S.name - dat += english_list(english_symptoms) - + dat += "

Данные о заболеваниях:

" + if(Blood.data["diseases"]) + var/i = 0 + for(var/datum/disease/D in Blood.data["diseases"]) + i++ + if(!(D.visibility_flags & HIDDEN_PANDEMIC)) + + dat += "Общепринятое название: " + + if(istype(D, /datum/disease/virus/advance)) + var/datum/disease/virus/advance/A = D + D = GLOB.archive_diseases[A.GetDiseaseID()] + if(D) + if(D.name == "Unknown") + dat += "Назвать вирус
" + else + dat += "[D.name] Напечатать форму выпуска
" else - dat += "В образце не обнаружен вирус." + dat += "[D.name]
" + + if(!D) + CRASH("We weren't able to get the advance disease from the archive.") + + dat += "Болезнетворный агент: [D?"[D.agent] — Создать образец":"нет"]
" + dat += "Описание: [(D.desc||"нет")]
" + dat += "Путь передачи: [(D.additional_info||"нет")]
" + dat += "Возможное лекарство: [(D.cure_text||"нет")]
" + dat += "Возможность выработки антител: [(D.can_immunity ? "Присутствует" : "Отсутствует")]
" + + if(istype(D, /datum/disease/virus/advance)) + var/datum/disease/virus/advance/A = D + dat += "
Симптомы: " + var/english_symptoms = list() + for(var/datum/symptom/S in A.symptoms) + english_symptoms += S.name + dat += english_list(english_symptoms) + dat += "
" + if(i == 0) + dat += "В образце не обнаружен вирус." else dat += "В образце не обнаружен вирус." - dat += "
Содержит антитела к: " if(Blood.data["resistances"]) var/list/res = Blood.data["resistances"] if(res.len) - dat += "