[MIRROR] Fix TRAIT_PERFECT_ATTACKER (#1636)

* Fix randomness in combat test (#54874)

* Fix TRAIT_PERFECT_ATTACKER

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-11-08 19:29:36 +00:00
committed by GitHub
co-authored by Jared-Fogle
parent c5bfa9704a
commit 46f9ef7cc6
@@ -1340,7 +1340,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
var/miss_chance = 100//calculate the odds that a punch misses entirely. considers stamina and brute damage of the puncher. punches miss by default to prevent weird cases
if(user.dna.species.punchdamagelow)
if(atk_verb == ATTACK_EFFECT_KICK || HAS_TRAIT(src, TRAIT_PERFECT_ATTACKER)) //kicks never miss (provided your species deals more than 0 damage)
if(atk_verb == ATTACK_EFFECT_KICK || HAS_TRAIT(user, TRAIT_PERFECT_ATTACKER)) //kicks never miss (provided your species deals more than 0 damage)
miss_chance = 0
else
miss_chance = min((user.dna.species.punchdamagehigh/user.dna.species.punchdamagelow) + user.getStaminaLoss() + (user.getBruteLoss()*0.5), 100) //old base chance for a miss + various damage. capped at 100 to prevent weirdness in prob()