From 18621258c817d81e2d6943967ab719f46a7f84b4 Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:41:06 -0400 Subject: [PATCH 1/8] init --- code/datums/disease.dm | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/code/datums/disease.dm b/code/datums/disease.dm index e9c399c7b8bf..aec33a44dac5 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -121,10 +121,11 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease check_range = 1 // everything else, like infect-on-contact things, only infect things on top of it if(isturf(source.loc)) - for(var/mob/living/carbon/M in oview(check_range, source)) - if(isturf(M.loc)) - if(AStar(source.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range)) - M.contract_disease(src, 0, 1, force_spread) + for(var/mob/living/carbon/victim in oview(check_range, source)) + if(isturf(victim.loc) && !locate(src) in victim.viruses) + if(AStar(source.loc, victim.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range)) + if(get_infection_chance(victim)) + victim.contract_disease(src, 0, 1, force_spread) return @@ -173,6 +174,22 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease var/mob/living/carbon/human/H = affected_mob H.med_hud_set_status() +/datum/disease/proc/get_infection_chance(mob/living/carbon/human/victim) + if(ishuman(victim)) + var/protection = 5 //Our current credit protection on how good are we protected from any sort of disease. Five acts as base protection. + if(istype(victim.wear_mask, /obj/item/clothing/mask/surgical)) + protection += 30 + if(istype(victim.gloves, /obj/item/clothing/gloves/latex)) + protection += 20 + if(istype(victim.head, /obj/item/clothing/head/bio_hood) && istype(victim.wear_suit, /obj/item/clothing/suit/bio_suit)) + protection += 80 // biosuit is VERY helpfull + else if(istype(victim.head, /obj/item/clothing/head/helmet/space) && istype(victim.wear_suit, /obj/item/clothing/suit/space)) + protection += 60 // not as usefull but still very helpfull + to_chat(victim, protection) + protection = clamp(protection, 0, 100) + if(prob(protection)) + return FALSE + return TRUE /datum/disease/New(process=TRUE)//process = 1 - adding the object to global list. List is processed by master controller. From 2901094fd1a74de228d3085add72c33cbb02d94e Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:43:09 -0400 Subject: [PATCH 2/8] Oops --- code/datums/disease.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/datums/disease.dm b/code/datums/disease.dm index aec33a44dac5..d5a4e56e63c4 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -185,7 +185,6 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease protection += 80 // biosuit is VERY helpfull else if(istype(victim.head, /obj/item/clothing/head/helmet/space) && istype(victim.wear_suit, /obj/item/clothing/suit/space)) protection += 60 // not as usefull but still very helpfull - to_chat(victim, protection) protection = clamp(protection, 0, 100) if(prob(protection)) return FALSE From 53b7aba7b256201d7c56bcce170d85f355811c3d Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:50:04 -0400 Subject: [PATCH 3/8] Important too --- code/datums/disease.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/datums/disease.dm b/code/datums/disease.dm index d5a4e56e63c4..577a12f945ac 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -185,8 +185,8 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease protection += 80 // biosuit is VERY helpfull else if(istype(victim.head, /obj/item/clothing/head/helmet/space) && istype(victim.wear_suit, /obj/item/clothing/suit/space)) protection += 60 // not as usefull but still very helpfull - protection = clamp(protection, 0, 100) - if(prob(protection)) + protection = clamp(protection, 5, 100) + if(prob(protection)-5) return FALSE return TRUE From f1a03d6d245cdc0798aba101b08cf195e43d12f5 Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:55:44 -0400 Subject: [PATCH 4/8] what is astar --- code/datums/disease.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/datums/disease.dm b/code/datums/disease.dm index 577a12f945ac..92da2315e534 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -122,8 +122,8 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease if(isturf(source.loc)) for(var/mob/living/carbon/victim in oview(check_range, source)) - if(isturf(victim.loc) && !locate(src) in victim.viruses) - if(AStar(source.loc, victim.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range)) + if(isturf(victim.loc)) + if(source.Adjacent(victim) && !locate(src) in victim.viruses) if(get_infection_chance(victim)) victim.contract_disease(src, 0, 1, force_spread) From c4ac03e80f630273ccec205391085e3a976a570a Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:18:30 -0400 Subject: [PATCH 5/8] astar is good, sorry astar --- code/datums/disease.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/disease.dm b/code/datums/disease.dm index 92da2315e534..fefc48905bb5 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -123,7 +123,7 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease if(isturf(source.loc)) for(var/mob/living/carbon/victim in oview(check_range, source)) if(isturf(victim.loc)) - if(source.Adjacent(victim) && !locate(src) in victim.viruses) + if(AStar(source.loc, victim.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range) && !locate(src) in victim.viruses) if(get_infection_chance(victim)) victim.contract_disease(src, 0, 1, force_spread) From 0a596ceb4e6f3151c27044109f53bbb4b3631673 Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:57:51 -0400 Subject: [PATCH 6/8] zero --- code/datums/disease.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/disease.dm b/code/datums/disease.dm index fefc48905bb5..6a860bfefcae 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -176,7 +176,7 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease /datum/disease/proc/get_infection_chance(mob/living/carbon/human/victim) if(ishuman(victim)) - var/protection = 5 //Our current credit protection on how good are we protected from any sort of disease. Five acts as base protection. + var/protection = 0 //Our current credit protection on how good are we protected from any sort of disease. if(istype(victim.wear_mask, /obj/item/clothing/mask/surgical)) protection += 30 if(istype(victim.gloves, /obj/item/clothing/gloves/latex)) From 08814f06e566de3f9062a630f5ae7eea5d59d5ea Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Wed, 27 Sep 2023 12:09:23 -0400 Subject: [PATCH 7/8] I wasnt the smartest --- code/datums/disease.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/datums/disease.dm b/code/datums/disease.dm index 6a860bfefcae..945c7de652e8 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -185,8 +185,8 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease protection += 80 // biosuit is VERY helpfull else if(istype(victim.head, /obj/item/clothing/head/helmet/space) && istype(victim.wear_suit, /obj/item/clothing/suit/space)) protection += 60 // not as usefull but still very helpfull - protection = clamp(protection, 5, 100) - if(prob(protection)-5) + protection = clamp(protection, 5, 95) + if(prob(protection)) return FALSE return TRUE From c22e59bfef73c2b62c956ee70dd64d18ac833331 Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Fri, 29 Sep 2023 13:48:50 -0400 Subject: [PATCH 8/8] mob_procs + tweaks --- code/datums/disease.dm | 22 ++------------ code/datums/diseases/mob_procs.dm | 30 +++++++++---------- code/modules/clothing/gloves/miscellaneous.dm | 2 +- code/modules/clothing/masks/gasmask.dm | 2 +- code/modules/clothing/masks/miscellaneous.dm | 2 +- code/modules/clothing/suits/bio.dm | 4 +-- 6 files changed, 22 insertions(+), 40 deletions(-) diff --git a/code/datums/disease.dm b/code/datums/disease.dm index 945c7de652e8..92986b668b47 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -123,9 +123,8 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease if(isturf(source.loc)) for(var/mob/living/carbon/victim in oview(check_range, source)) if(isturf(victim.loc)) - if(AStar(source.loc, victim.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range) && !locate(src) in victim.viruses) - if(get_infection_chance(victim)) - victim.contract_disease(src, 0, 1, force_spread) + if(AStar(source.loc, victim.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range)) + victim.contract_disease(src, 0, 1, force_spread) return @@ -174,23 +173,6 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease var/mob/living/carbon/human/H = affected_mob H.med_hud_set_status() -/datum/disease/proc/get_infection_chance(mob/living/carbon/human/victim) - if(ishuman(victim)) - var/protection = 0 //Our current credit protection on how good are we protected from any sort of disease. - if(istype(victim.wear_mask, /obj/item/clothing/mask/surgical)) - protection += 30 - if(istype(victim.gloves, /obj/item/clothing/gloves/latex)) - protection += 20 - if(istype(victim.head, /obj/item/clothing/head/bio_hood) && istype(victim.wear_suit, /obj/item/clothing/suit/bio_suit)) - protection += 80 // biosuit is VERY helpfull - else if(istype(victim.head, /obj/item/clothing/head/helmet/space) && istype(victim.wear_suit, /obj/item/clothing/suit/space)) - protection += 60 // not as usefull but still very helpfull - protection = clamp(protection, 5, 95) - if(prob(protection)) - return FALSE - return TRUE - - /datum/disease/New(process=TRUE)//process = 1 - adding the object to global list. List is processed by master controller. cure_list = list(cure_id) // to add more cures, add more vars to this list in the actual disease's New() if(process) // Viruses in list are considered active. diff --git a/code/datums/diseases/mob_procs.dm b/code/datums/diseases/mob_procs.dm index 7f9704c46f47..c27efecdff84 100644 --- a/code/datums/diseases/mob_procs.dm +++ b/code/datums/diseases/mob_procs.dm @@ -80,9 +80,6 @@ passed = check_disease_pass_clothes(target_zone) - if(!passed && spread_type == AIRBORNE && !internal) - passed = (prob((50*virus.permeability_mod) - 1)) - if(passed) AddDisease(virus) @@ -111,36 +108,39 @@ /mob/living/carbon/human/check_disease_pass_clothes(target_zone) var/obj/item/clothing/Cl + var/protection = 0 switch(target_zone) if(1) if(isobj(head) && !istype(head, /obj/item/paper)) Cl = head - . = prob((Cl.permeability_coefficient*100) - 1) - if(. && wear_mask) - . = prob((Cl.permeability_coefficient*100) - 1) + protection += (Cl.permeability_coefficient*100)-100 + if(isobj(wear_mask)) + Cl = wear_mask + protection += (Cl.permeability_coefficient*100)-100 if(2)//arms and legs included if(isobj(wear_suit)) Cl = wear_suit - . = prob((Cl.permeability_coefficient*100) - 1) - if(. && isobj(WEAR_BODY)) + protection += (Cl.permeability_coefficient*100)-100 + if(isobj(WEAR_BODY)) Cl = WEAR_BODY - . = prob((Cl.permeability_coefficient*100) - 1) + protection += (Cl.permeability_coefficient*100)-100 if(3) if(isobj(wear_suit) && wear_suit.flags_armor_protection & BODY_FLAG_HANDS) Cl = wear_suit - . = prob((Cl.permeability_coefficient*100) - 1) + protection += (Cl.permeability_coefficient*100)-100 - if(. && isobj(gloves)) + if(isobj(gloves)) Cl = gloves - . = prob((Cl.permeability_coefficient*100) - 1) + protection += (Cl.permeability_coefficient*100)-100 if(4) if(isobj(wear_suit) && wear_suit.flags_armor_protection & BODY_FLAG_FEET) Cl = wear_suit - . = prob((Cl.permeability_coefficient*100) - 1) + protection += (Cl.permeability_coefficient*100)-100 - if(. && isobj(shoes)) + if(isobj(shoes)) Cl = shoes - . = prob((Cl.permeability_coefficient*100) - 1) + protection += (Cl.permeability_coefficient*100)-100 else to_chat(src, "Something bad happened with disease target zone code, tell a dev or admin ") + return prob(clamp(protection, 5, 90)) diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm index 9d18c44affe8..e6c8391ac0a1 100644 --- a/code/modules/clothing/gloves/miscellaneous.dm +++ b/code/modules/clothing/gloves/miscellaneous.dm @@ -46,7 +46,7 @@ icon_state = "latex" item_state = "lgloves" siemens_coefficient = 0.30 - permeability_coefficient = 0.01 + permeability_coefficient = 0.35 /obj/item/clothing/gloves/botanic_leather desc = "These leather gloves protect against thorns, barbs, prickles, spikes and other harmful objects of floral origin." diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 8d6a2b4ac0ca..36c11b194cc7 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -11,7 +11,7 @@ w_class = SIZE_SMALL item_state = "gas_alt" gas_transfer_coefficient = 0.01 - permeability_coefficient = 0.01 + permeability_coefficient = 0.9 armor_melee = CLOTHING_ARMOR_NONE armor_bullet = CLOTHING_ARMOR_NONE armor_laser = CLOTHING_ARMOR_NONE diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index 0d4572c7297f..c39e6a620833 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -17,7 +17,7 @@ flags_inventory = COVERMOUTH flags_armor_protection = 0 gas_transfer_coefficient = 0.90 - permeability_coefficient = 0.01 + permeability_coefficient = 0.3 armor_melee = CLOTHING_ARMOR_NONE armor_bullet = CLOTHING_ARMOR_NONE armor_laser = CLOTHING_ARMOR_NONE diff --git a/code/modules/clothing/suits/bio.dm b/code/modules/clothing/suits/bio.dm index 3bf0b3fe74b2..741e6a475312 100644 --- a/code/modules/clothing/suits/bio.dm +++ b/code/modules/clothing/suits/bio.dm @@ -3,7 +3,7 @@ name = "bio hood" icon_state = "bio" desc = "A hood that protects the head and face from biological contaminants." - permeability_coefficient = 0.01 + permeability_coefficient = 0.2 armor_melee = CLOTHING_ARMOR_NONE armor_bullet = CLOTHING_ARMOR_NONE armor_laser = CLOTHING_ARMOR_NONE @@ -24,7 +24,7 @@ item_state = "bio_suit" w_class = SIZE_LARGE//bulky item gas_transfer_coefficient = 0.01 - permeability_coefficient = 0.01 + permeability_coefficient = 0.2 flags_armor_protection = BODY_FLAG_CHEST|BODY_FLAG_GROIN|BODY_FLAG_LEGS|BODY_FLAG_FEET|BODY_FLAG_ARMS|BODY_FLAG_HANDS slowdown = 1 armor_melee = CLOTHING_ARMOR_NONE