new ATR vs DEF formula for spells

This commit is contained in:
2024-04-05 21:27:26 -05:00
parent 7fee52c861
commit 8b01f80231
+5 -11
View File
@@ -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);