Copy-pasta code is bad.

This commit is contained in:
GJ
2013-01-21 20:01:33 -05:00
parent 67fd45ef25
commit ddbf5a559a
16 changed files with 69 additions and 149 deletions

View File

@ -47,14 +47,9 @@ public class AxeManager extends SkillManager {
return;
}
int randomChance = 100;
if (Permissions.luckyAxes(player)) {
randomChance = 75;
}
double chance = (Axes.criticalHitMaxChance / Axes.criticalHitMaxBonusLevel) * eventHandler.skillModifier;
if (chance > Misc.getRandom().nextInt(randomChance) && !eventHandler.defender.isDead()) {
if (chance > Misc.getRandom().nextInt(activationChance) && !eventHandler.defender.isDead()) {
eventHandler.modifyEventDamage();
eventHandler.sendAbilityMessages();
}

View File

@ -62,12 +62,7 @@ public class ImpactEventHandler {
return;
}
int randomChance = 100;
if (Permissions.luckyAxes(player)) {
randomChance = 75;
}
if (Misc.getRandom().nextInt(randomChance) <= Axes.greaterImpactChance) {
if (Misc.getRandom().nextInt(manager.getActivationChance()) <= Axes.greaterImpactChance) {
handleGreaterImpactEffect();
sendAbilityMessge();
}