new hit chance scaling

This commit is contained in:
2025-02-05 20:02:45 -06:00
parent 8b2c018103
commit 7728a800d9
2 changed files with 236 additions and 7 deletions
+7 -7
View File
@@ -1508,18 +1508,18 @@ public enum CombatManager {
public static boolean LandHit(int ATR, int DEF){
float chance = (ATR-((ATR+DEF) * 0.315f)) / ((DEF-((ATR+DEF) * 0.315f)) + (ATR-((ATR+DEF) * 0.315f)));
float convertedChance = chance * 100;
//float chance = (ATR-((ATR+DEF) * 0.315f)) / ((DEF-((ATR+DEF) * 0.315f)) + (ATR-((ATR+DEF) * 0.315f)));
//float convertedChance = chance * 100;
int roll = ThreadLocalRandom.current().nextInt(101);
if(roll <= 5)//always 5% chance to miss
return false;
//if(roll <= 5)//always 5% chance to miss
// return false;
if(roll >= 95)//always 5% chance to hit
return true;
//if(roll >= 95)//always 5% chance to hit
// return true;
return roll <= convertedChance;
return PlayerCombatStats.getHitChance(ATR,DEF) >= roll;
}
public static boolean specialCaseHitRoll(int powerID){