Refactoring, removing useless variables, changing ints to doubles, etc.

This commit is contained in:
GJ
2013-01-14 12:41:39 -05:00
parent 8915a535c6
commit 348887f799
14 changed files with 54 additions and 69 deletions

View File

@ -35,13 +35,13 @@ public class AcrobaticsManager extends SkillManager {
randomChance = (int) (randomChance * 0.75);
}
float chance;
double chance;
if (eventHandler.isGraceful) {
chance = ((float) Acrobatics.maxGracefulRollChance / Acrobatics.maxGracefulRollBonusLevel) * eventHandler.skillModifier;
chance = (Acrobatics.gracefulRollMaxChance / Acrobatics.gracefulRollMaxBonusLevel) * eventHandler.skillModifier;
}
else {
chance = ((float) Acrobatics.maxRollChance / Acrobatics.maxRollBonusLevel) * eventHandler.skillModifier;
chance = (Acrobatics.rollMaxChance / Acrobatics.rollMaxBonusLevel) * eventHandler.skillModifier;
}
if (chance > Misc.getRandom().nextInt(randomChance) && !eventHandler.isFatal(eventHandler.modifiedDamage)) {
@ -71,7 +71,7 @@ public class AcrobaticsManager extends SkillManager {
randomChance = (int) (randomChance * 0.75);
}
float chance = ((float) Acrobatics.maxDodgeChance / Acrobatics.maxDodgeBonusLevel) * eventHandler.skillModifier;
double chance = (Acrobatics.dodgeMaxChance / Acrobatics.dodgeMaxBonusLevel) * eventHandler.skillModifier;
if (chance > Misc.getRandom().nextInt(randomChance) && !eventHandler.isFatal(eventHandler.modifiedDamage)) {
eventHandler.modifyEventDamage();