custom hit chance formula

This commit is contained in:
2024-09-05 21:26:21 -05:00
parent 3fb29f8e2b
commit db5a4195ad
+2 -2
View File
@@ -1444,10 +1444,10 @@ public enum CombatManager {
}
public static boolean LandHit(int atr, int defense){
int roll = ThreadLocalRandom.current().nextInt(100);
int roll = ThreadLocalRandom.current().nextInt(101);
float chance = (float)((atr-((atr+defense)*0.315))/((defense-((atr+defense)*0.315))+(atr-((atr+defense)*0.315))));
boolean hit = false;
if(chance > roll)
if((chance * 100) > roll)
hit = true;
return hit;
}