Browse Source

new ATR vs DEF formula for spells

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
8b01f80231
  1. 16
      src/engine/gameManager/PowersManager.java

16
src/engine/gameManager/PowersManager.java

@ -2329,17 +2329,11 @@ public enum PowersManager { @@ -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);

Loading…
Cancel
Save