From 3e918a56589651c7a02e09155d7a030d7db8c40b Mon Sep 17 00:00:00 2001 From: Mqiib <43766432+Mqiib@users.noreply.github.com> Date: Fri, 10 Feb 2023 17:58:25 -0500 Subject: [PATCH] Unstupidify (#17819) --- code/modules/zombie/items.dm | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/code/modules/zombie/items.dm b/code/modules/zombie/items.dm index 75000b0581f2..3f9303242006 100644 --- a/code/modules/zombie/items.dm +++ b/code/modules/zombie/items.dm @@ -18,12 +18,7 @@ damtype = "brute" var/inserted_organ = /obj/item/organ/zombie_infection var/infect_chance = 100 //Before armor calculations - var/scaled_infect_chance = FALSE //Does infection chance scale with damage? (100% of infect chance at 50% health(Crit, humans have 200% health!), 0% at max health) - //Approx chances, with 100 infect_chance - //20% at 40 damage - //40% at 60 damage - //70% at 80 damage - //100% at 100 damage + var/scaled_infect_chance = FALSE //Do we use steeper armor infection block chance or linear? /obj/item/zombie_hand/Initialize() . = ..() @@ -76,19 +71,10 @@ if(H.health <= HEALTH_THRESHOLD_FULLCRIT || (L && L.status != BODYPART_ROBOTIC))//no more infecting via metal limbs unless they're in hard crit and probably going to die var/flesh_wound = ran_zone(user.zone_selected) if(scaled_infect_chance) - var/mob/living/mob_target = M - var/total_damage = mob_target.get_damage_amount(BRUTE) - - var/infect_modifier = (total_damage ** 2) / 100 - - infect_modifier = clamp(infect_modifier, 0, 100) - - if(prob(infect_modifier)) - if(prob(infect_chance - H.getarmor(flesh_wound, MELEE))) - if(!H.stat) - try_to_zombie_infect(M, inserted_organ) - - else + var/scaled_infection = ((100 - H.getarmor(flesh_wound, MELEE))/100) ^ 1.5 //20 armor -> 71.5% chance of infection + if(prob(infect_chance * scaled_infection)) //40 armor -> 46.5% chance + try_to_zombie_infect(M, inserted_organ) //60 armor -> 25.3% chance + else //80 armor -> 8.9% chance if(prob(infect_chance - H.getarmor(flesh_wound, MELEE))) try_to_zombie_infect(M, inserted_organ) else