From 8b01f802312d1287f898d207f0b55de5db3352f4 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 5 Apr 2024 21:27:26 -0500 Subject: [PATCH] new ATR vs DEF formula for spells --- src/engine/gameManager/PowersManager.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index 927523ff..20ca99a8 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -2329,17 +2329,11 @@ public enum PowersManager { ChatManager.chatSystemInfo(pc, smsg); } - int chance; - - if (atr > defense || defense == 0) - chance = 94; - else { - float dif = atr / defense; - if (dif <= 0.8f) - chance = 4; - else - chance = ((int) (450 * (dif - 0.8f)) + 4); - } + float constant = (atr+defense)*0.315f; + float atrChance = atr - constant; + float defChance = defense - constant + atrChance; + float smallChance = atrChance/defChance; + int chance = (int)(smallChance * 100); // calculate hit/miss int roll = ThreadLocalRandom.current().nextInt(100);