new curved map for hit chances
This commit is contained in:
@@ -1519,7 +1519,8 @@ public enum CombatManager {
|
|||||||
//if(roll >= 95)//always 5% chance to hit
|
//if(roll >= 95)//always 5% chance to hit
|
||||||
// return true;
|
// return true;
|
||||||
|
|
||||||
return PlayerCombatStats.getHitChance(ATR,DEF) >= roll;
|
float chance = PlayerCombatStats.getHitChance(ATR,DEF);
|
||||||
|
return chance >= roll;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean specialCaseHitRoll(int powerID){
|
public static boolean specialCaseHitRoll(int powerID){
|
||||||
|
|||||||
@@ -853,9 +853,9 @@ public class PlayerCombatStats {
|
|||||||
} // PERFECT DO NOT TOUCH
|
} // PERFECT DO NOT TOUCH
|
||||||
|
|
||||||
public static float getHitChance(int atr,int def){
|
public static float getHitChance(int atr,int def){
|
||||||
float key = atr / def;
|
float key = (float)((float)atr / def);
|
||||||
BigDecimal bd = new BigDecimal(key).setScale(2, RoundingMode.HALF_UP);
|
BigDecimal bd = new BigDecimal(key).setScale(2, RoundingMode.HALF_UP);
|
||||||
key = bd.floatValue();
|
key = bd.floatValue(); // handles rounding for mandatory 2 decimal places
|
||||||
if(key < 0.40f)
|
if(key < 0.40f)
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
if(key > 2.50f)
|
if(key > 2.50f)
|
||||||
|
|||||||
Reference in New Issue
Block a user