Because NuclearW said I was wrong...

"Final is final unless it's not really final."
This commit is contained in:
gmcferrin 2013-01-10 23:15:53 -05:00
parent a8abfdae5e
commit 487e67d208
10 changed files with 36 additions and 41 deletions

View File

@ -3,17 +3,15 @@ package com.gmail.nossr50.skills.acrobatics;
import com.gmail.nossr50.config.AdvancedConfig;
public class Acrobatics {
private static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
public static int maxDodgeChance = AdvancedConfig.getInstance().getDodgeChanceMax();
public static int maxDodgeBonusLevel = AdvancedConfig.getInstance().getDodgeMaxBonusLevel();
public static int dodgeXpModifier = AdvancedConfig.getInstance().getDodgeXPModifier();
public static final int DODGE_MAX_CHANCE = advancedConfig.getDodgeChanceMax();
public static final int DODGE_MAX_BONUS_LEVEL = advancedConfig.getDodgeMaxBonusLevel();
public static final int DODGE_XP_MODIFIER = advancedConfig.getDodgeXPModifier();
public static int maxRollChance = AdvancedConfig.getInstance().getRollChanceMax();
public static int maxRollBonusLevel = AdvancedConfig.getInstance().getRollMaxBonusLevel();
public static int maxGracefulRollChance = AdvancedConfig.getInstance().getGracefulRollChanceMax();
public static int maxGracefulRollBonusLevel = AdvancedConfig.getInstance().getGracefulRollMaxBonusLevel();
public static final int ROLL_MAX_CHANCE = advancedConfig.getRollChanceMax();
public static final int ROLL_MAX_BONUS_LEVEL = advancedConfig.getRollMaxBonusLevel();
public static final int GRACEFUL_MAX_CHANCE = advancedConfig.getGracefulRollChanceMax();
public static final int GRACEFUL_MAX_BONUS_LEVEL = advancedConfig.getGracefulRollMaxBonusLevel();
public static final int ROLL_XP_MODIFIER = advancedConfig.getRollXPModifier();
public static final int FALL_XP_MODIFIER = advancedConfig.getFallXPModifier();
public static int rollXpModifier = AdvancedConfig.getInstance().getRollXPModifier();
public static int fallXpModifier = AdvancedConfig.getInstance().getFallXPModifier();
}

View File

@ -10,8 +10,6 @@ import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
public class AcrobaticsManager extends SkillManager {
private static Config config = Config.getInstance();
public AcrobaticsManager (Player player) {
super(player, SkillType.ACROBATICS);
}
@ -26,7 +24,7 @@ public class AcrobaticsManager extends SkillManager {
return;
}
if (config.getAcrobaticsAFKDisabled() && player.isInsideVehicle()) {
if (Config.getInstance().getAcrobaticsAFKDisabled() && player.isInsideVehicle()) {
return;
}
@ -40,19 +38,19 @@ public class AcrobaticsManager extends SkillManager {
float chance;
if (eventHandler.isGraceful) {
chance = ((float) Acrobatics.GRACEFUL_MAX_CHANCE / Acrobatics.GRACEFUL_MAX_BONUS_LEVEL) * eventHandler.skillModifier;
chance = ((float) Acrobatics.maxGracefulRollChance / Acrobatics.maxGracefulRollBonusLevel) * eventHandler.skillModifier;
}
else {
chance = ((float) Acrobatics.ROLL_MAX_CHANCE / Acrobatics.ROLL_MAX_BONUS_LEVEL) * eventHandler.skillModifier;
chance = ((float) Acrobatics.maxRollChance / Acrobatics.maxRollBonusLevel) * eventHandler.skillModifier;
}
if (chance > Misc.getRandom().nextInt(randomChance) && !eventHandler.isFatal(eventHandler.modifiedDamage)) {
eventHandler.modifyEventDamage();
eventHandler.sendAbilityMessage();
eventHandler.processXPGain(eventHandler.damage * Acrobatics.ROLL_XP_MODIFIER);
eventHandler.processXPGain(eventHandler.damage * Acrobatics.rollXpModifier);
}
else if (!eventHandler.isFatal(event.getDamage())) {
eventHandler.processXPGain(eventHandler.damage * Acrobatics.FALL_XP_MODIFIER);
eventHandler.processXPGain(eventHandler.damage * Acrobatics.fallXpModifier);
}
}
@ -73,12 +71,12 @@ public class AcrobaticsManager extends SkillManager {
randomChance = (int) (randomChance * 0.75);
}
float chance = ((float) Acrobatics.DODGE_MAX_CHANCE / Acrobatics.DODGE_MAX_BONUS_LEVEL) * eventHandler.skillModifier;
float chance = ((float) Acrobatics.maxDodgeChance / Acrobatics.maxDodgeBonusLevel) * eventHandler.skillModifier;
if (chance > Misc.getRandom().nextInt(randomChance) && !eventHandler.isFatal(eventHandler.modifiedDamage)) {
eventHandler.modifyEventDamage();
eventHandler.sendAbilityMessage();
eventHandler.processXPGain(eventHandler.damage * Acrobatics.DODGE_XP_MODIFIER);
eventHandler.processXPGain(eventHandler.damage * Acrobatics.dodgeXpModifier);
}
}
}

View File

@ -18,7 +18,7 @@ public class DodgeEventHandler extends AcrobaticsEventHandler {
@Override
protected void calculateSkillModifier() {
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Acrobatics.DODGE_MAX_BONUS_LEVEL);
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Acrobatics.maxDodgeBonusLevel);
}
@Override

View File

@ -29,7 +29,7 @@ public class RollEventHandler extends AcrobaticsEventHandler {
skillModifer = skillModifer * 2;
}
skillModifer = Misc.skillCheck(skillModifer, Acrobatics.ROLL_MAX_BONUS_LEVEL);
skillModifer = Misc.skillCheck(skillModifer, Acrobatics.maxRollBonusLevel);
this.skillModifier = skillModifer;
}

View File

@ -12,19 +12,18 @@ import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.util.Misc;
public class Archery {
private static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
private static List<TrackedEntity> trackedEntities = new ArrayList<TrackedEntity>();
public static final int ARROW_TRACKING_MAX_BONUS_LEVEL = advancedConfig.getRetrieveMaxBonusLevel();
public static final int ARROW_TRACKING_MAX_BONUS = advancedConfig.getRetrieveBonusMax();
public static int arrowTrackingMaxBonusLevel = AdvancedConfig.getInstance().getRetrieveMaxBonusLevel();
public static int arrowTrackingMaxBonus = AdvancedConfig.getInstance().getRetrieveBonusMax();
public static final int BONUS_DAMAGE_INCREASE_LEVEL = advancedConfig.getSkillShotIncreaseLevel();
public static final double BONUS_DAMAGE_INCREASE_PERCENT = advancedConfig.getSkillShotIncreasePercentage();
public static final double BONUS_DAMAGE_MAX_BONUS_PERCENTAGE = advancedConfig.getSkillShotBonusMax();
public static int skillShotIncreaseLevel = AdvancedConfig.getInstance().getSkillShotIncreaseLevel();
public static double skillShotIncreasePercentage = AdvancedConfig.getInstance().getSkillShotIncreasePercentage();
public static double skillShotMaxBonusPercentage = AdvancedConfig.getInstance().getSkillShotBonusMax();
public static final int DAZE_MAX_BONUS_LEVEL = advancedConfig.getDazeMaxBonusLevel();
public static final int DAZE_MAX_BONUS = advancedConfig.getDazeBonusMax();
public static final int DAZE_MODIFIER = advancedConfig.getDazeModifier();
public static int dazeMaxBonusLevel = AdvancedConfig.getInstance().getDazeMaxBonusLevel();
public static int dazeMaxBonus = AdvancedConfig.getInstance().getDazeBonusMax();
public static int dazeModifier = AdvancedConfig.getInstance().getDazeModifier();
protected static void incrementTrackerValue(LivingEntity livingEntity) {
for (TrackedEntity trackedEntity : trackedEntities) {

View File

@ -14,10 +14,10 @@ public class ArcheryBonusDamageEventHandler {
}
protected void calculateDamageBonus() {
this.damageBonusPercent = ((manager.getSkillLevel() / Archery.BONUS_DAMAGE_INCREASE_LEVEL) * Archery.BONUS_DAMAGE_INCREASE_PERCENT);
this.damageBonusPercent = ((manager.getSkillLevel() / Archery.skillShotIncreaseLevel) * Archery.skillShotIncreasePercentage);
if (damageBonusPercent > Archery.BONUS_DAMAGE_MAX_BONUS_PERCENTAGE) {
damageBonusPercent = Archery.BONUS_DAMAGE_MAX_BONUS_PERCENTAGE;
if (damageBonusPercent > Archery.skillShotMaxBonusPercentage) {
damageBonusPercent = Archery.skillShotMaxBonusPercentage;
}
}

View File

@ -31,7 +31,7 @@ public class ArcheryManager extends SkillManager {
randomChance = (int) (randomChance * 0.75);
}
float chance = ((float) Archery.ARROW_TRACKING_MAX_BONUS / Archery.ARROW_TRACKING_MAX_BONUS_LEVEL) * eventHandler.skillModifier;
float chance = ((float) Archery.arrowTrackingMaxBonus / Archery.arrowTrackingMaxBonusLevel) * eventHandler.skillModifier;
if (chance > Misc.getRandom().nextInt(randomChance)) {
eventHandler.addToTracker();
@ -56,7 +56,7 @@ public class ArcheryManager extends SkillManager {
randomChance = (int) (randomChance * 0.75);
}
float chance = ((float) Archery.DAZE_MAX_BONUS / Archery.DAZE_MAX_BONUS_LEVEL) * eventHandler.skillModifier;
float chance = ((float) Archery.dazeMaxBonus / Archery.dazeMaxBonusLevel) * eventHandler.skillModifier;
if (chance > Misc.getRandom().nextInt(randomChance)) {
eventHandler.handleDazeEffect();
@ -74,7 +74,7 @@ public class ArcheryManager extends SkillManager {
return;
}
if (skillLevel >= Archery.BONUS_DAMAGE_INCREASE_LEVEL) {
if (skillLevel >= Archery.skillShotIncreaseLevel) {
ArcheryBonusDamageEventHandler eventHandler = new ArcheryBonusDamageEventHandler(this, event);
eventHandler.calculateDamageBonus();

View File

@ -18,7 +18,7 @@ public class ArrowTrackingEventHandler {
}
protected void calculateSkillModifier() {
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Archery.ARROW_TRACKING_MAX_BONUS_LEVEL);
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Archery.arrowTrackingMaxBonusLevel);
}
protected void addToTracker() {

View File

@ -25,7 +25,7 @@ public class DazeEventHandler {
}
protected void calculateSkillModifier() {
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Archery.DAZE_MAX_BONUS_LEVEL);
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Archery.dazeMaxBonusLevel);
}
protected void handleDazeEffect() {
@ -39,7 +39,7 @@ public class DazeEventHandler {
}
defender.teleport(location);
event.setDamage(event.getDamage() + Archery.DAZE_MODIFIER);
event.setDamage(event.getDamage() + Archery.dazeModifier);
}
protected void sendAbilityMessages() {