From 601ed40eb2e6adb7cff0e952ec1114b875dedf72 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 23 Mar 2024 18:39:03 -0400 Subject: [PATCH] Passives clamped at 75% --- src/engine/gameManager/FinalCombatManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/engine/gameManager/FinalCombatManager.java b/src/engine/gameManager/FinalCombatManager.java index 9c0303bf..6c847fe9 100644 --- a/src/engine/gameManager/FinalCombatManager.java +++ b/src/engine/gameManager/FinalCombatManager.java @@ -166,6 +166,12 @@ public class FinalCombatManager { float blockChance = ((AbstractCharacter) target).getPassiveChance("Block", attacker.getLevel(), true); float parryChance = ((AbstractCharacter) target).getPassiveChance("Parry", attacker.getLevel(), true); + // Passive chance clamped at 75 + + dodgeChance = Math.max(0, Math.min(75, dodgeChance)); + blockChance = Math.max(0, Math.min(75, blockChance)); + parryChance = Math.max(0, Math.min(75, parryChance)); + if (hitRoll < dodgeChance) passiveType = Enum.PassiveType.Dodge; else if (hitRoll < blockChance)