diff --git a/Changelog.txt b/Changelog.txt index b6e128512..32e41accf 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -12,9 +12,10 @@ Version 1.4.00-dev Version 1.3.14 + Added new Hylian Luck skill to Herbalism. + Added new cancellable McMMOPlayerDisarmEvent for Citizens compatibility - fires whenever a player is disarmed. - = Fixed a memory leak involving mob tracking - = Fixed ArrayIndexOutOfBoundsException resulting from being unranked in a skill when using FlatFile. - ! Changed how Tree Feller is handled, it should now put less stress on the CPU + = Fixed a memory leak involving mob tracking + = Fixed ArrayIndexOutOfBoundsException resulting from being unranked in a skill when using FlatFile + = Fixed bug where Impact was applied incorrectly due to an inverted method call + ! Changed how Tree Feller is handled, it should now put less stress on the CPU - Removed extra durability loss from Leaf Blower Version 1.3.13 diff --git a/src/main/java/com/gmail/nossr50/commands/SkillCommand.java b/src/main/java/com/gmail/nossr50/commands/SkillCommand.java index 26121e2d1..56d8300b7 100644 --- a/src/main/java/com/gmail/nossr50/commands/SkillCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/SkillCommand.java @@ -12,6 +12,8 @@ import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Page; +import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; import com.gmail.nossr50.util.Users; public abstract class SkillCommand implements CommandExecutor { @@ -22,6 +24,8 @@ public abstract class SkillCommand implements CommandExecutor { protected Player player; protected PlayerProfile profile; protected float skillValue; + protected boolean isLucky; + protected boolean hasEndurance; protected DecimalFormat percent = new DecimalFormat("##0.00%"); @@ -50,6 +54,9 @@ public abstract class SkillCommand implements CommandExecutor { } skillValue = profile.getSkillLevel(skill); + isLucky = Permissions.lucky(player, skill); + hasEndurance = (Permissions.activationTwelve(player) || Permissions.activationEight(player) || Permissions.activationFour(player)); + dataCalculations(); permissionsCheck(); @@ -74,6 +81,65 @@ public abstract class SkillCommand implements CommandExecutor { return true; } + protected String[] calculateAbilityDisplayValues(int maxBonusLevel, double maxChance) { + double abilityChance; + double luckyChance; + + if (skillValue >= maxBonusLevel) { + abilityChance = maxChance; + } + else { + abilityChance = (maxChance / maxBonusLevel) * skillValue; + } + + if (isLucky) { + luckyChance = abilityChance * 1.3333D; + + if (luckyChance >= 100D) { + return new String[] { percent.format(abilityChance / 100.0D), percent.format(1.0D) }; + } + + return new String[] { percent.format(abilityChance / 100.0D), percent.format(luckyChance / 100.0D) }; + } + + return new String[] { percent.format(abilityChance / 100.0D), null }; + } + + protected String[] calculateLengthDisplayValues() { + int maxLength = skill.getAbility().getMaxTicks(); + int length = 2 + (int) (skillValue / Misc.abilityLengthIncreaseLevel); + int enduranceLength = 0; + + if (Permissions.activationTwelve(player)) { + enduranceLength = length + 12; + } + else if (Permissions.activationEight(player)) { + enduranceLength = length + 8; + } + else if (Permissions.activationFour(player)) { + enduranceLength = length + 4; + } + + if (maxLength != 0) { + if (length > maxLength) { + length = maxLength; + } + + if (enduranceLength > maxLength) { + enduranceLength = maxLength; + } + } + + return new String[] { String.valueOf(length), String.valueOf(enduranceLength) }; + } + + protected void luckyEffectsDisplay() { + if (isLucky) { + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(skill) }) })); + } + } + protected abstract void dataCalculations(); protected abstract void permissionsCheck(); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java index d152a4a95..63b038e84 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.acrobatics.Acrobatics; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.Skills; public class AcrobaticsCommand extends SkillCommand { private String dodgeChance; @@ -18,7 +17,6 @@ public class AcrobaticsCommand extends SkillCommand { private boolean canDodge; private boolean canRoll; private boolean canGracefulRoll; - private boolean lucky; public AcrobaticsCommand() { super(SkillType.ACROBATICS); @@ -26,30 +24,20 @@ public class AcrobaticsCommand extends SkillCommand { @Override protected void dataCalculations() { - float dodgeChanceF; - float rollChanceF; - float gracefulRollChanceF; + //DODGE + String[] dodgeStrings = calculateAbilityDisplayValues(Acrobatics.dodgeMaxBonusLevel, Acrobatics.dodgeMaxChance); + dodgeChance = dodgeStrings[0]; + dodgeChanceLucky = dodgeStrings[1]; - // DODGE - if (skillValue >= Acrobatics.dodgeMaxBonusLevel) dodgeChanceF = (float) Acrobatics.dodgeMaxChance; - else dodgeChanceF = (float) ((Acrobatics.dodgeMaxChance / Acrobatics.dodgeMaxBonusLevel) * skillValue); - dodgeChance = percent.format(dodgeChanceF / 100D); - if (dodgeChanceF * 1.3333D >= 100D) dodgeChanceLucky = percent.format(1D); - else dodgeChanceLucky = percent.format(dodgeChanceF * 1.3333D / 100D); + //ROLL + String[] rollStrings = calculateAbilityDisplayValues(Acrobatics.rollMaxBonusLevel, Acrobatics.rollMaxChance); + rollChance = rollStrings[0]; + rollChanceLucky = rollStrings[1]; - // ROLL - if (skillValue >= Acrobatics.rollMaxBonusLevel) rollChanceF = (float) Acrobatics.rollMaxChance; - else rollChanceF = (float) ((Acrobatics.rollMaxChance / Acrobatics.rollMaxBonusLevel) * skillValue); - rollChance = percent.format(rollChanceF / 100D); - if (rollChanceF * 1.3333D >= 100D) rollChanceLucky = percent.format(1D); - else rollChanceLucky = percent.format(rollChanceF * 1.3333D / 100D); - - // GRACEFULROLL - if (skillValue >= Acrobatics.gracefulRollMaxBonusLevel) gracefulRollChanceF = (float) Acrobatics.gracefulRollMaxChance; - else gracefulRollChanceF = (float) ((Acrobatics.gracefulRollMaxChance / Acrobatics.gracefulRollMaxBonusLevel) * skillValue); - gracefulRollChance = percent.format(gracefulRollChanceF / 100D); - if (gracefulRollChanceF * 1.3333D >= 100D) gracefulRollChanceLucky = percent.format(1D); - else gracefulRollChanceLucky = percent.format(gracefulRollChanceF * 1.3333D / 100D); + //GRACEFUL ROLL + String[] gracefulRollStrings = calculateAbilityDisplayValues(Acrobatics.gracefulRollMaxBonusLevel, Acrobatics.gracefulRollMaxChance); + rollChance = gracefulRollStrings[0]; + rollChanceLucky = gracefulRollStrings[1]; } @Override @@ -57,7 +45,6 @@ public class AcrobaticsCommand extends SkillCommand { canDodge = Permissions.dodge(player); canRoll = Permissions.roll(player); canGracefulRoll = Permissions.gracefulRoll(player); - lucky = Permissions.luckyAcrobatics(player); } @Override @@ -67,10 +54,7 @@ public class AcrobaticsCommand extends SkillCommand { @Override protected void effectsDisplay() { - if (lucky) { - String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.ACROBATICS) }) })); - } + luckyEffectsDisplay(); if (canRoll) { player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Acrobatics.Effect.0"), LocaleLoader.getString("Acrobatics.Effect.1") })); @@ -93,24 +77,30 @@ public class AcrobaticsCommand extends SkillCommand { @Override protected void statsDisplay() { if (canRoll) { - if (lucky) + if (isLucky) { player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Chance", new Object[] { rollChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { rollChanceLucky })); - else + } + else { player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Chance", new Object[] { rollChance })); + } } if (canGracefulRoll) { - if (lucky) + if (isLucky) { player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.GraceChance", new Object[] { gracefulRollChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { gracefulRollChanceLucky })); - else + } + else { player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.GraceChance", new Object[] { gracefulRollChance })); + } } if (canDodge) { - if (lucky) + if (isLucky) { player.sendMessage(LocaleLoader.getString("Acrobatics.DodgeChance", new Object[] { dodgeChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { dodgeChanceLucky })); - else + } + else { player.sendMessage(LocaleLoader.getString("Acrobatics.DodgeChance", new Object[] { dodgeChance })); + } } } } \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java index 1fc9d9500..191e279cf 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.archery.Archery; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.Skills; public class ArcheryCommand extends SkillCommand { private String skillShotBonus; @@ -17,7 +16,6 @@ public class ArcheryCommand extends SkillCommand { private boolean canSkillShot; private boolean canDaze; private boolean canRetrieve; - private boolean lucky; public ArcheryCommand() { super(SkillType.ARCHERY); @@ -25,27 +23,25 @@ public class ArcheryCommand extends SkillCommand { @Override protected void dataCalculations() { - float dazeChanceF; - float retrieveChanceF; + //SKILL SHOT + double bonus = (skillValue / Archery.skillShotIncreaseLevel) * Archery.skillShotIncreasePercentage; - // SkillShot - double bonus = (int)((double) skillValue / (double) Archery.skillShotIncreaseLevel) * Archery.skillShotIncreasePercentage; - if (bonus > Archery.skillShotMaxBonusPercentage) skillShotBonus = percent.format(Archery.skillShotMaxBonusPercentage); - else skillShotBonus = percent.format(bonus); + if (bonus > Archery.skillShotMaxBonusPercentage) { + skillShotBonus = percent.format(Archery.skillShotMaxBonusPercentage); + } + else { + skillShotBonus = percent.format(bonus); + } - // Daze - if (skillValue >= Archery.dazeMaxBonusLevel) dazeChanceF = (float) Archery.dazeMaxBonus; - else dazeChanceF = (float) (( Archery.dazeMaxBonus / Archery.dazeMaxBonusLevel) * skillValue); - dazeChance = percent.format(dazeChanceF / 100D); - if (dazeChanceF * 1.3333D >= 100D) dazeChanceLucky = percent.format(1D); - else dazeChanceLucky = percent.format(dazeChanceF * 1.3333D / 100D); + //DAZE + String[] dazeStrings = calculateAbilityDisplayValues(Archery.dazeMaxBonusLevel, Archery.dazeMaxBonus); + dazeChance = dazeStrings[0]; + dazeChanceLucky = dazeStrings[1]; - // Retrieve - if (skillValue >= Archery.retrieveMaxBonusLevel) retrieveChanceF = (float) Archery.retrieveMaxChance; - else retrieveChanceF = (float) ((Archery.retrieveMaxChance / Archery.retrieveMaxBonusLevel) * skillValue); - retrieveChance = percent.format(retrieveChanceF / 100D); - if (retrieveChanceF * 1.3333D >= 100D) retrieveChanceLucky = percent.format(1D); - else retrieveChanceLucky = percent.format(retrieveChanceF * 1.3333D / 100D); + //RETRIEVE + String[] retrieveStrings = calculateAbilityDisplayValues(Archery.retrieveMaxBonusLevel, Archery.retrieveMaxChance); + retrieveChance = retrieveStrings[0]; + retrieveChanceLucky = retrieveStrings[1]; } @Override @@ -53,7 +49,6 @@ public class ArcheryCommand extends SkillCommand { canSkillShot = Permissions.archeryBonus(player); canDaze = Permissions.daze(player); canRetrieve = Permissions.trackArrows(player); - lucky = Permissions.luckyArchery(player); } @Override @@ -63,17 +58,14 @@ public class ArcheryCommand extends SkillCommand { @Override protected void effectsDisplay() { - if (lucky) { - String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.ARCHERY) }) })); - } + luckyEffectsDisplay(); if (canSkillShot) { player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Archery.Effect.0"), LocaleLoader.getString("Archery.Effect.1") })); } if (canDaze) { - player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Archery.Effect.2"), LocaleLoader.getString("Archery.Effect.3") })); + player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Archery.Effect.2"), LocaleLoader.getString("Archery.Effect.3", new Object[] {Archery.dazeModifier}) })); } if (canRetrieve) { @@ -93,17 +85,21 @@ public class ArcheryCommand extends SkillCommand { } if (canDaze) { - if (lucky) + if (isLucky) { player.sendMessage(LocaleLoader.getString("Archery.Combat.DazeChance", new Object[] { dazeChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { dazeChanceLucky })); - else + } + else { player.sendMessage(LocaleLoader.getString("Archery.Combat.DazeChance", new Object[] { dazeChance })); + } } if (canRetrieve) { - if (lucky) + if (isLucky) { player.sendMessage(LocaleLoader.getString("Archery.Combat.RetrieveChance", new Object[] { retrieveChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { retrieveChanceLucky })); - else + } + else { player.sendMessage(LocaleLoader.getString("Archery.Combat.RetrieveChance", new Object[] { retrieveChance })); + } } } } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java index 055576ff3..ea7f058b1 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java @@ -4,9 +4,7 @@ import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.axes.Axes; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.Skills; public class AxesCommand extends SkillCommand { private String critChance; @@ -22,8 +20,6 @@ public class AxesCommand extends SkillCommand { private boolean canBonusDamage; private boolean canImpact; private boolean canGreaterImpact; - private boolean lucky; - private boolean endurance; public AxesCommand() { super(SkillType.AXES); @@ -31,41 +27,27 @@ public class AxesCommand extends SkillCommand { @Override protected void dataCalculations() { - float critChanceF; - int skillCheck = Misc.skillCheck((int) skillValue, Axes.criticalHitMaxBonusLevel); - - //Armor Impact - impactDamage = String.valueOf(1 + ((double) skillValue / (double) Axes.impactIncreaseLevel)); - //Skull Splitter - int length = 2 + (int) ((double) skillValue / (double) Misc.abilityLengthIncreaseLevel); - skullSplitterLength = String.valueOf(length); - - if (Permissions.activationTwelve(player)) { - length = length + 12; - } - else if (Permissions.activationEight(player)) { - length = length + 8; - } - else if (Permissions.activationFour(player)) { - length = length + 4; - } - int maxLength = SkillType.AXES.getAbility().getMaxTicks(); - if (maxLength != 0 && length > maxLength) { - length = maxLength; - } - skullSplitterLengthEndurance = String.valueOf(length); - - //Greater Impact + //IMPACT + impactDamage = String.valueOf(1 + (skillValue / Axes.impactIncreaseLevel)); greaterImpactDamage = String.valueOf(Axes.greaterImpactBonusDamage); - //Critical Strikes - if (skillValue >= Axes.criticalHitMaxBonusLevel) critChanceF = (float) Axes.criticalHitMaxChance; - else critChanceF = (float) ((Axes.criticalHitMaxChance / Axes.criticalHitMaxBonusLevel) * skillCheck); - critChance = percent.format(critChanceF / 100D); - if (critChanceF * 1.3333D >= 100D) critChanceLucky = percent.format(1D); - else critChanceLucky = percent.format(critChanceF * 1.3333D / 100D); - //Axe Mastery - if (skillValue >= Axes.bonusDamageMaxBonusLevel) bonusDamage = String.valueOf(Axes.bonusDamageMaxBonus); - else bonusDamage = String.valueOf(skillValue / ((double) Axes.bonusDamageMaxBonusLevel / (double) Axes.bonusDamageMaxBonus)); + + //SKULL SPLITTER + String[] skullSplitterStrings = calculateLengthDisplayValues(); + skullSplitterLength = skullSplitterStrings[0]; + skullSplitterLengthEndurance = skullSplitterStrings[1]; + + //CRITICAL STRIKES + String[] criticalStrikeStrings = calculateAbilityDisplayValues(Axes.criticalHitMaxBonusLevel, Axes.criticalHitMaxChance); + critChance = criticalStrikeStrings[0]; + critChanceLucky = criticalStrikeStrings[1]; + + //AXE MASTERY + if (skillValue >= Axes.bonusDamageMaxBonusLevel) { + bonusDamage = String.valueOf(Axes.bonusDamageMaxBonus); + } + else { + bonusDamage = String.valueOf(skillValue / Axes.bonusDamageMaxBonusLevel / Axes.bonusDamageMaxBonus); + } } @Override @@ -75,8 +57,6 @@ public class AxesCommand extends SkillCommand { canBonusDamage = Permissions.axeBonus(player); canImpact = Permissions.impact(player); canGreaterImpact = Permissions.greaterImpact(player); - lucky = Permissions.luckyAxes(player); - endurance = Permissions.activationTwelve(player) || Permissions.activationEight(player) || Permissions.activationFour(player); } @Override @@ -86,10 +66,7 @@ public class AxesCommand extends SkillCommand { @Override protected void effectsDisplay() { - if (lucky) { - String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.AXES) }) })); - } + luckyEffectsDisplay(); if (canSkullSplitter) { player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Axes.Effect.0"), LocaleLoader.getString("Axes.Effect.1") })); @@ -132,17 +109,21 @@ public class AxesCommand extends SkillCommand { } if (canCritical) { - if (lucky) + if (isLucky) { player.sendMessage(LocaleLoader.getString("Axes.Combat.CritChance", new Object[] { critChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { critChanceLucky })); - else + } + else { player.sendMessage(LocaleLoader.getString("Axes.Combat.CritChance", new Object[] { critChance })); + } } if (canSkullSplitter) { - if (endurance) + if (hasEndurance) { player.sendMessage(LocaleLoader.getString("Axes.Combat.SS.Length", new Object[] { skullSplitterLength }) + LocaleLoader.getString("Perks.activationtime.bonus", new Object[] { skullSplitterLengthEndurance })); - else + } + else { player.sendMessage(LocaleLoader.getString("Axes.Combat.SS.Length", new Object[] { skullSplitterLength })); + } } } } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index 174583e94..77a3a97dc 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -1,23 +1,16 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.commands.SkillCommand; -import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.Skills; public class ExcavationCommand extends SkillCommand { - AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); private String gigaDrillBreakerLength; private String gigaDrillBreakerLengthEndurance; - private int abilityLengthIncreaseLevel = advancedConfig.getAbilityLength(); - private boolean canGigaDrill; private boolean canTreasureHunt; - private boolean lucky; - private boolean endurance; public ExcavationCommand() { super(SkillType.EXCAVATION); @@ -25,31 +18,16 @@ public class ExcavationCommand extends SkillCommand { @Override protected void dataCalculations() { - int length = 2 + (int) ((double) skillValue / (double) abilityLengthIncreaseLevel); - gigaDrillBreakerLength = String.valueOf(length); - - if (Permissions.activationTwelve(player)) { - length = length + 12; - } - else if (Permissions.activationEight(player)) { - length = length + 8; - } - else if (Permissions.activationFour(player)) { - length = length + 4; - } - int maxLength = SkillType.EXCAVATION.getAbility().getMaxTicks(); - if (maxLength != 0 && length > maxLength) { - length = maxLength; - } - gigaDrillBreakerLengthEndurance = String.valueOf(length); + //GIGA DRILL BREAKER + String gigaDrillStrings[] = calculateLengthDisplayValues(); + gigaDrillBreakerLength = gigaDrillStrings[0]; + gigaDrillBreakerLengthEndurance = gigaDrillStrings[1]; } @Override protected void permissionsCheck() { canGigaDrill = Permissions.gigaDrillBreaker(player); canTreasureHunt = Permissions.excavationTreasures(player); - lucky = Permissions.luckyExcavation(player); - endurance = Permissions.activationTwelve(player) || Permissions.activationEight(player) || Permissions.activationFour(player); } @Override @@ -59,10 +37,7 @@ public class ExcavationCommand extends SkillCommand { @Override protected void effectsDisplay() { - if (lucky) { - String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.EXCAVATION) }) })); - } + luckyEffectsDisplay(); if (canGigaDrill) { player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Excavation.Effect.0"), LocaleLoader.getString("Excavation.Effect.1") })); @@ -81,10 +56,12 @@ public class ExcavationCommand extends SkillCommand { @Override protected void statsDisplay() { if (canGigaDrill) { - if (endurance) + if (hasEndurance) { player.sendMessage(LocaleLoader.getString("Excavation.Effect.Length", new Object[] { gigaDrillBreakerLength }) + LocaleLoader.getString("Perks.activationtime.bonus", new Object[] { gigaDrillBreakerLengthEndurance })); - else + } + else { player.sendMessage(LocaleLoader.getString("Excavation.Effect.Length", new Object[] { gigaDrillBreakerLength })); + } } } } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index 425999885..d01c75865 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -38,9 +38,10 @@ public class FishingCommand extends SkillCommand { @Override protected void dataCalculations() { + //TREASURE HUNTER raining = player.getWorld().hasStorm(); chanceRaining = ""; - //Treasure Hunter + lootTier = Fishing.getFishingLootTier(profile); double magicChanceD = lootTier * magicHunterMultiplier; if (raining) { diff --git a/src/main/java/com/gmail/nossr50/skills/axes/AxeManager.java b/src/main/java/com/gmail/nossr50/skills/axes/AxeManager.java index fd1f420ba..260570b28 100644 --- a/src/main/java/com/gmail/nossr50/skills/axes/AxeManager.java +++ b/src/main/java/com/gmail/nossr50/skills/axes/AxeManager.java @@ -71,7 +71,7 @@ public class AxeManager extends SkillManager { return; } - if (!Misc.hasArmor(eventHandler.livingDefender)) { + if (Misc.hasArmor(eventHandler.livingDefender)) { eventHandler.damageArmor(); } else { diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index f378663e6..97ee87a6f 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -39,7 +39,7 @@ Archery.Combat.SkillshotBonus=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0} Archery.Effect.0=Skill Shot Archery.Effect.1=Increases damage done with bows Archery.Effect.2=Daze (Players) -Archery.Effect.3=Disorients foes and deals 4 DMG +Archery.Effect.3=Disorients foes and deals {0} DMG Archery.Effect.4=Arrow Retrieval Archery.Effect.5=Chance to retrieve arrows from corpses Archery.Listener=Archery: