|
|
|
@ -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); |
|
|
|
|