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] 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