From 595d0ba9ba403ddd6b12abc7aeb4a167e4467751 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 31 Mar 2024 12:00:56 -0500 Subject: [PATCH] hit chance issue resolved --- src/engine/gameManager/CombatManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index 90b2f910..06dfff7e 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -645,7 +645,10 @@ public enum CombatManager { errorTrack = 4; //Get hit chance - float smallChance = ((atr-((atr+defense)*0.33f))/((defense-((atr+defense)*0.33f))+(atr-((atr+defense)*0.33f)))); + float constant = (atr+defense)*0.315f; + float atrChance = atr - constant; + float defChance = defense - constant + atrChance; + float smallChance = atrChance/defChance; int chance = (int)(smallChance * 100); errorTrack = 5;