From 13c474f2af08623e48344481d3d9348f87dbe356 Mon Sep 17 00:00:00 2001 From: necromanceranne Date: Wed, 1 Apr 2020 22:05:22 +1100 Subject: [PATCH] brawling just got mathematical? --- code/modules/mob/living/carbon/human/species.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 199f9de4a1..3f7b7d5914 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1479,6 +1479,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) var/damage = rand(user.dna.species.punchdamagelow, user.dna.species.punchdamagehigh) var/puncherstam = user.getStaminaLoss() var/puncherbrute = user.getBruteLoss() + var/punchedstam = target.getStaminaLoss() + var/punchedbrute = target.getBruteLoss() //CITADEL CHANGES - makes resting and disabled combat mode reduce punch damage, makes being out of combat mode result in you taking more damage if(!(target.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE) && damage < user.dna.species.punchstunthreshold) @@ -1496,7 +1498,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(atk_verb == ATTACK_EFFECT_KICK) //kicks never miss (provided your species deals more than 0 damage) miss_chance = 0 else - miss_chance = min(puncherstam + (puncherbrute*0.5), 100) //probability of miss based on stamina + half of brute. capped at 100 to prevent weirdness in prob() + miss_chance = min(clamp(((puncherstam + puncherbrute)*0.5) - ((punchedstam + punchedbrute)*0.5), 0, 100)) //probability of miss based on half your stamina and brute total against half their stamina and brute total. Capped at max 100 and min 0 to prevent weirdness in prob() if(!damage || !affecting || prob(miss_chance))//future-proofing for species that have 0 damage/weird cases where no zone is targeted playsound(target.loc, user.dna.species.miss_sound, 25, TRUE, -1)