mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-25 18:17:46 +01:00
Fixed an inverted check on Impact.
This commit is contained in:
parent
946d845987
commit
3cc9672ff3
@ -13,7 +13,8 @@ Version 1.3.14
|
|||||||
+ Added new Hylian Luck skill to Herbalism.
|
+ Added new Hylian Luck skill to Herbalism.
|
||||||
+ Added new cancellable McMMOPlayerDisarmEvent for Citizens compatibility - fires whenever a player is disarmed.
|
+ Added new cancellable McMMOPlayerDisarmEvent for Citizens compatibility - fires whenever a player is disarmed.
|
||||||
= Fixed a memory leak involving mob tracking
|
= Fixed a memory leak involving mob tracking
|
||||||
= Fixed ArrayIndexOutOfBoundsException resulting from being unranked in a skill when using FlatFile.
|
= 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
|
! Changed how Tree Feller is handled, it should now put less stress on the CPU
|
||||||
- Removed extra durability loss from Leaf Blower
|
- Removed extra durability loss from Leaf Blower
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@ import com.gmail.nossr50.datatypes.SkillType;
|
|||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Skills;
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public abstract class SkillCommand implements CommandExecutor {
|
public abstract class SkillCommand implements CommandExecutor {
|
||||||
@ -22,6 +24,8 @@ public abstract class SkillCommand implements CommandExecutor {
|
|||||||
protected Player player;
|
protected Player player;
|
||||||
protected PlayerProfile profile;
|
protected PlayerProfile profile;
|
||||||
protected float skillValue;
|
protected float skillValue;
|
||||||
|
protected boolean isLucky;
|
||||||
|
protected boolean hasEndurance;
|
||||||
|
|
||||||
protected DecimalFormat percent = new DecimalFormat("##0.00%");
|
protected DecimalFormat percent = new DecimalFormat("##0.00%");
|
||||||
|
|
||||||
@ -50,6 +54,9 @@ public abstract class SkillCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
skillValue = profile.getSkillLevel(skill);
|
skillValue = profile.getSkillLevel(skill);
|
||||||
|
isLucky = Permissions.lucky(player, skill);
|
||||||
|
hasEndurance = (Permissions.activationTwelve(player) || Permissions.activationEight(player) || Permissions.activationFour(player));
|
||||||
|
|
||||||
dataCalculations();
|
dataCalculations();
|
||||||
permissionsCheck();
|
permissionsCheck();
|
||||||
|
|
||||||
@ -74,6 +81,65 @@ public abstract class SkillCommand implements CommandExecutor {
|
|||||||
return true;
|
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 dataCalculations();
|
||||||
|
|
||||||
protected abstract void permissionsCheck();
|
protected abstract void permissionsCheck();
|
||||||
|
@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.SkillType;
|
|||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.acrobatics.Acrobatics;
|
import com.gmail.nossr50.skills.acrobatics.Acrobatics;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.Skills;
|
|
||||||
|
|
||||||
public class AcrobaticsCommand extends SkillCommand {
|
public class AcrobaticsCommand extends SkillCommand {
|
||||||
private String dodgeChance;
|
private String dodgeChance;
|
||||||
@ -18,7 +17,6 @@ public class AcrobaticsCommand extends SkillCommand {
|
|||||||
private boolean canDodge;
|
private boolean canDodge;
|
||||||
private boolean canRoll;
|
private boolean canRoll;
|
||||||
private boolean canGracefulRoll;
|
private boolean canGracefulRoll;
|
||||||
private boolean lucky;
|
|
||||||
|
|
||||||
public AcrobaticsCommand() {
|
public AcrobaticsCommand() {
|
||||||
super(SkillType.ACROBATICS);
|
super(SkillType.ACROBATICS);
|
||||||
@ -26,30 +24,20 @@ public class AcrobaticsCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dataCalculations() {
|
protected void dataCalculations() {
|
||||||
float dodgeChanceF;
|
|
||||||
float rollChanceF;
|
|
||||||
float gracefulRollChanceF;
|
|
||||||
|
|
||||||
//DODGE
|
//DODGE
|
||||||
if (skillValue >= Acrobatics.dodgeMaxBonusLevel) dodgeChanceF = (float) Acrobatics.dodgeMaxChance;
|
String[] dodgeStrings = calculateAbilityDisplayValues(Acrobatics.dodgeMaxBonusLevel, Acrobatics.dodgeMaxChance);
|
||||||
else dodgeChanceF = (float) ((Acrobatics.dodgeMaxChance / Acrobatics.dodgeMaxBonusLevel) * skillValue);
|
dodgeChance = dodgeStrings[0];
|
||||||
dodgeChance = percent.format(dodgeChanceF / 100D);
|
dodgeChanceLucky = dodgeStrings[1];
|
||||||
if (dodgeChanceF * 1.3333D >= 100D) dodgeChanceLucky = percent.format(1D);
|
|
||||||
else dodgeChanceLucky = percent.format(dodgeChanceF * 1.3333D / 100D);
|
|
||||||
|
|
||||||
//ROLL
|
//ROLL
|
||||||
if (skillValue >= Acrobatics.rollMaxBonusLevel) rollChanceF = (float) Acrobatics.rollMaxChance;
|
String[] rollStrings = calculateAbilityDisplayValues(Acrobatics.rollMaxBonusLevel, Acrobatics.rollMaxChance);
|
||||||
else rollChanceF = (float) ((Acrobatics.rollMaxChance / Acrobatics.rollMaxBonusLevel) * skillValue);
|
rollChance = rollStrings[0];
|
||||||
rollChance = percent.format(rollChanceF / 100D);
|
rollChanceLucky = rollStrings[1];
|
||||||
if (rollChanceF * 1.3333D >= 100D) rollChanceLucky = percent.format(1D);
|
|
||||||
else rollChanceLucky = percent.format(rollChanceF * 1.3333D / 100D);
|
|
||||||
|
|
||||||
//GRACEFUL ROLL
|
//GRACEFUL ROLL
|
||||||
if (skillValue >= Acrobatics.gracefulRollMaxBonusLevel) gracefulRollChanceF = (float) Acrobatics.gracefulRollMaxChance;
|
String[] gracefulRollStrings = calculateAbilityDisplayValues(Acrobatics.gracefulRollMaxBonusLevel, Acrobatics.gracefulRollMaxChance);
|
||||||
else gracefulRollChanceF = (float) ((Acrobatics.gracefulRollMaxChance / Acrobatics.gracefulRollMaxBonusLevel) * skillValue);
|
rollChance = gracefulRollStrings[0];
|
||||||
gracefulRollChance = percent.format(gracefulRollChanceF / 100D);
|
rollChanceLucky = gracefulRollStrings[1];
|
||||||
if (gracefulRollChanceF * 1.3333D >= 100D) gracefulRollChanceLucky = percent.format(1D);
|
|
||||||
else gracefulRollChanceLucky = percent.format(gracefulRollChanceF * 1.3333D / 100D);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -57,7 +45,6 @@ public class AcrobaticsCommand extends SkillCommand {
|
|||||||
canDodge = Permissions.dodge(player);
|
canDodge = Permissions.dodge(player);
|
||||||
canRoll = Permissions.roll(player);
|
canRoll = Permissions.roll(player);
|
||||||
canGracefulRoll = Permissions.gracefulRoll(player);
|
canGracefulRoll = Permissions.gracefulRoll(player);
|
||||||
lucky = Permissions.luckyAcrobatics(player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -67,10 +54,7 @@ public class AcrobaticsCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void effectsDisplay() {
|
protected void effectsDisplay() {
|
||||||
if (lucky) {
|
luckyEffectsDisplay();
|
||||||
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) }) }));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (canRoll) {
|
if (canRoll) {
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Acrobatics.Effect.0"), LocaleLoader.getString("Acrobatics.Effect.1") }));
|
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
|
@Override
|
||||||
protected void statsDisplay() {
|
protected void statsDisplay() {
|
||||||
if (canRoll) {
|
if (canRoll) {
|
||||||
if (lucky)
|
if (isLucky) {
|
||||||
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Chance", new Object[] { rollChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { rollChanceLucky }));
|
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 }));
|
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Chance", new Object[] { rollChance }));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (canGracefulRoll) {
|
if (canGracefulRoll) {
|
||||||
if (lucky)
|
if (isLucky) {
|
||||||
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.GraceChance", new Object[] { gracefulRollChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { gracefulRollChanceLucky }));
|
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 }));
|
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.GraceChance", new Object[] { gracefulRollChance }));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (canDodge) {
|
if (canDodge) {
|
||||||
if (lucky)
|
if (isLucky) {
|
||||||
player.sendMessage(LocaleLoader.getString("Acrobatics.DodgeChance", new Object[] { dodgeChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { dodgeChanceLucky }));
|
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 }));
|
player.sendMessage(LocaleLoader.getString("Acrobatics.DodgeChance", new Object[] { dodgeChance }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.SkillType;
|
|||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.archery.Archery;
|
import com.gmail.nossr50.skills.archery.Archery;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.Skills;
|
|
||||||
|
|
||||||
public class ArcheryCommand extends SkillCommand {
|
public class ArcheryCommand extends SkillCommand {
|
||||||
private String skillShotBonus;
|
private String skillShotBonus;
|
||||||
@ -17,7 +16,6 @@ public class ArcheryCommand extends SkillCommand {
|
|||||||
private boolean canSkillShot;
|
private boolean canSkillShot;
|
||||||
private boolean canDaze;
|
private boolean canDaze;
|
||||||
private boolean canRetrieve;
|
private boolean canRetrieve;
|
||||||
private boolean lucky;
|
|
||||||
|
|
||||||
public ArcheryCommand() {
|
public ArcheryCommand() {
|
||||||
super(SkillType.ARCHERY);
|
super(SkillType.ARCHERY);
|
||||||
@ -25,27 +23,25 @@ public class ArcheryCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dataCalculations() {
|
protected void dataCalculations() {
|
||||||
float dazeChanceF;
|
//SKILL SHOT
|
||||||
float retrieveChanceF;
|
double bonus = (skillValue / Archery.skillShotIncreaseLevel) * Archery.skillShotIncreasePercentage;
|
||||||
|
|
||||||
// SkillShot
|
if (bonus > Archery.skillShotMaxBonusPercentage) {
|
||||||
double bonus = (int)((double) skillValue / (double) Archery.skillShotIncreaseLevel) * Archery.skillShotIncreasePercentage;
|
skillShotBonus = percent.format(Archery.skillShotMaxBonusPercentage);
|
||||||
if (bonus > Archery.skillShotMaxBonusPercentage) skillShotBonus = percent.format(Archery.skillShotMaxBonusPercentage);
|
}
|
||||||
else skillShotBonus = percent.format(bonus);
|
else {
|
||||||
|
skillShotBonus = percent.format(bonus);
|
||||||
|
}
|
||||||
|
|
||||||
// Daze
|
//DAZE
|
||||||
if (skillValue >= Archery.dazeMaxBonusLevel) dazeChanceF = (float) Archery.dazeMaxBonus;
|
String[] dazeStrings = calculateAbilityDisplayValues(Archery.dazeMaxBonusLevel, Archery.dazeMaxBonus);
|
||||||
else dazeChanceF = (float) (( Archery.dazeMaxBonus / Archery.dazeMaxBonusLevel) * skillValue);
|
dazeChance = dazeStrings[0];
|
||||||
dazeChance = percent.format(dazeChanceF / 100D);
|
dazeChanceLucky = dazeStrings[1];
|
||||||
if (dazeChanceF * 1.3333D >= 100D) dazeChanceLucky = percent.format(1D);
|
|
||||||
else dazeChanceLucky = percent.format(dazeChanceF * 1.3333D / 100D);
|
|
||||||
|
|
||||||
// Retrieve
|
//RETRIEVE
|
||||||
if (skillValue >= Archery.retrieveMaxBonusLevel) retrieveChanceF = (float) Archery.retrieveMaxChance;
|
String[] retrieveStrings = calculateAbilityDisplayValues(Archery.retrieveMaxBonusLevel, Archery.retrieveMaxChance);
|
||||||
else retrieveChanceF = (float) ((Archery.retrieveMaxChance / Archery.retrieveMaxBonusLevel) * skillValue);
|
retrieveChance = retrieveStrings[0];
|
||||||
retrieveChance = percent.format(retrieveChanceF / 100D);
|
retrieveChanceLucky = retrieveStrings[1];
|
||||||
if (retrieveChanceF * 1.3333D >= 100D) retrieveChanceLucky = percent.format(1D);
|
|
||||||
else retrieveChanceLucky = percent.format(retrieveChanceF * 1.3333D / 100D);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -53,7 +49,6 @@ public class ArcheryCommand extends SkillCommand {
|
|||||||
canSkillShot = Permissions.archeryBonus(player);
|
canSkillShot = Permissions.archeryBonus(player);
|
||||||
canDaze = Permissions.daze(player);
|
canDaze = Permissions.daze(player);
|
||||||
canRetrieve = Permissions.trackArrows(player);
|
canRetrieve = Permissions.trackArrows(player);
|
||||||
lucky = Permissions.luckyArchery(player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -63,17 +58,14 @@ public class ArcheryCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void effectsDisplay() {
|
protected void effectsDisplay() {
|
||||||
if (lucky) {
|
luckyEffectsDisplay();
|
||||||
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) }) }));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (canSkillShot) {
|
if (canSkillShot) {
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Archery.Effect.0"), LocaleLoader.getString("Archery.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Archery.Effect.0"), LocaleLoader.getString("Archery.Effect.1") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canDaze) {
|
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) {
|
if (canRetrieve) {
|
||||||
@ -93,17 +85,21 @@ public class ArcheryCommand extends SkillCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (canDaze) {
|
if (canDaze) {
|
||||||
if (lucky)
|
if (isLucky) {
|
||||||
player.sendMessage(LocaleLoader.getString("Archery.Combat.DazeChance", new Object[] { dazeChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { dazeChanceLucky }));
|
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 }));
|
player.sendMessage(LocaleLoader.getString("Archery.Combat.DazeChance", new Object[] { dazeChance }));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (canRetrieve) {
|
if (canRetrieve) {
|
||||||
if (lucky)
|
if (isLucky) {
|
||||||
player.sendMessage(LocaleLoader.getString("Archery.Combat.RetrieveChance", new Object[] { retrieveChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { retrieveChanceLucky }));
|
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 }));
|
player.sendMessage(LocaleLoader.getString("Archery.Combat.RetrieveChance", new Object[] { retrieveChance }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -4,9 +4,7 @@ import com.gmail.nossr50.commands.SkillCommand;
|
|||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.axes.Axes;
|
import com.gmail.nossr50.skills.axes.Axes;
|
||||||
import com.gmail.nossr50.util.Misc;
|
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.Skills;
|
|
||||||
|
|
||||||
public class AxesCommand extends SkillCommand {
|
public class AxesCommand extends SkillCommand {
|
||||||
private String critChance;
|
private String critChance;
|
||||||
@ -22,8 +20,6 @@ public class AxesCommand extends SkillCommand {
|
|||||||
private boolean canBonusDamage;
|
private boolean canBonusDamage;
|
||||||
private boolean canImpact;
|
private boolean canImpact;
|
||||||
private boolean canGreaterImpact;
|
private boolean canGreaterImpact;
|
||||||
private boolean lucky;
|
|
||||||
private boolean endurance;
|
|
||||||
|
|
||||||
public AxesCommand() {
|
public AxesCommand() {
|
||||||
super(SkillType.AXES);
|
super(SkillType.AXES);
|
||||||
@ -31,41 +27,27 @@ public class AxesCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dataCalculations() {
|
protected void dataCalculations() {
|
||||||
float critChanceF;
|
//IMPACT
|
||||||
int skillCheck = Misc.skillCheck((int) skillValue, Axes.criticalHitMaxBonusLevel);
|
impactDamage = String.valueOf(1 + (skillValue / Axes.impactIncreaseLevel));
|
||||||
|
|
||||||
//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
|
|
||||||
greaterImpactDamage = String.valueOf(Axes.greaterImpactBonusDamage);
|
greaterImpactDamage = String.valueOf(Axes.greaterImpactBonusDamage);
|
||||||
//Critical Strikes
|
|
||||||
if (skillValue >= Axes.criticalHitMaxBonusLevel) critChanceF = (float) Axes.criticalHitMaxChance;
|
//SKULL SPLITTER
|
||||||
else critChanceF = (float) ((Axes.criticalHitMaxChance / Axes.criticalHitMaxBonusLevel) * skillCheck);
|
String[] skullSplitterStrings = calculateLengthDisplayValues();
|
||||||
critChance = percent.format(critChanceF / 100D);
|
skullSplitterLength = skullSplitterStrings[0];
|
||||||
if (critChanceF * 1.3333D >= 100D) critChanceLucky = percent.format(1D);
|
skullSplitterLengthEndurance = skullSplitterStrings[1];
|
||||||
else critChanceLucky = percent.format(critChanceF * 1.3333D / 100D);
|
|
||||||
//Axe Mastery
|
//CRITICAL STRIKES
|
||||||
if (skillValue >= Axes.bonusDamageMaxBonusLevel) bonusDamage = String.valueOf(Axes.bonusDamageMaxBonus);
|
String[] criticalStrikeStrings = calculateAbilityDisplayValues(Axes.criticalHitMaxBonusLevel, Axes.criticalHitMaxChance);
|
||||||
else bonusDamage = String.valueOf(skillValue / ((double) Axes.bonusDamageMaxBonusLevel / (double) Axes.bonusDamageMaxBonus));
|
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
|
@Override
|
||||||
@ -75,8 +57,6 @@ public class AxesCommand extends SkillCommand {
|
|||||||
canBonusDamage = Permissions.axeBonus(player);
|
canBonusDamage = Permissions.axeBonus(player);
|
||||||
canImpact = Permissions.impact(player);
|
canImpact = Permissions.impact(player);
|
||||||
canGreaterImpact = Permissions.greaterImpact(player);
|
canGreaterImpact = Permissions.greaterImpact(player);
|
||||||
lucky = Permissions.luckyAxes(player);
|
|
||||||
endurance = Permissions.activationTwelve(player) || Permissions.activationEight(player) || Permissions.activationFour(player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -86,10 +66,7 @@ public class AxesCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void effectsDisplay() {
|
protected void effectsDisplay() {
|
||||||
if (lucky) {
|
luckyEffectsDisplay();
|
||||||
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) }) }));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (canSkullSplitter) {
|
if (canSkullSplitter) {
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Axes.Effect.0"), LocaleLoader.getString("Axes.Effect.1") }));
|
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 (canCritical) {
|
||||||
if (lucky)
|
if (isLucky) {
|
||||||
player.sendMessage(LocaleLoader.getString("Axes.Combat.CritChance", new Object[] { critChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { critChanceLucky }));
|
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 }));
|
player.sendMessage(LocaleLoader.getString("Axes.Combat.CritChance", new Object[] { critChance }));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (canSkullSplitter) {
|
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 }));
|
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 }));
|
player.sendMessage(LocaleLoader.getString("Axes.Combat.SS.Length", new Object[] { skullSplitterLength }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -1,23 +1,16 @@
|
|||||||
package com.gmail.nossr50.commands.skills;
|
package com.gmail.nossr50.commands.skills;
|
||||||
|
|
||||||
import com.gmail.nossr50.commands.SkillCommand;
|
import com.gmail.nossr50.commands.SkillCommand;
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.Skills;
|
|
||||||
|
|
||||||
public class ExcavationCommand extends SkillCommand {
|
public class ExcavationCommand extends SkillCommand {
|
||||||
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
|
||||||
private String gigaDrillBreakerLength;
|
private String gigaDrillBreakerLength;
|
||||||
private String gigaDrillBreakerLengthEndurance;
|
private String gigaDrillBreakerLengthEndurance;
|
||||||
|
|
||||||
private int abilityLengthIncreaseLevel = advancedConfig.getAbilityLength();
|
|
||||||
|
|
||||||
private boolean canGigaDrill;
|
private boolean canGigaDrill;
|
||||||
private boolean canTreasureHunt;
|
private boolean canTreasureHunt;
|
||||||
private boolean lucky;
|
|
||||||
private boolean endurance;
|
|
||||||
|
|
||||||
public ExcavationCommand() {
|
public ExcavationCommand() {
|
||||||
super(SkillType.EXCAVATION);
|
super(SkillType.EXCAVATION);
|
||||||
@ -25,31 +18,16 @@ public class ExcavationCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dataCalculations() {
|
protected void dataCalculations() {
|
||||||
int length = 2 + (int) ((double) skillValue / (double) abilityLengthIncreaseLevel);
|
//GIGA DRILL BREAKER
|
||||||
gigaDrillBreakerLength = String.valueOf(length);
|
String gigaDrillStrings[] = calculateLengthDisplayValues();
|
||||||
|
gigaDrillBreakerLength = gigaDrillStrings[0];
|
||||||
if (Permissions.activationTwelve(player)) {
|
gigaDrillBreakerLengthEndurance = gigaDrillStrings[1];
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck() {
|
protected void permissionsCheck() {
|
||||||
canGigaDrill = Permissions.gigaDrillBreaker(player);
|
canGigaDrill = Permissions.gigaDrillBreaker(player);
|
||||||
canTreasureHunt = Permissions.excavationTreasures(player);
|
canTreasureHunt = Permissions.excavationTreasures(player);
|
||||||
lucky = Permissions.luckyExcavation(player);
|
|
||||||
endurance = Permissions.activationTwelve(player) || Permissions.activationEight(player) || Permissions.activationFour(player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -59,10 +37,7 @@ public class ExcavationCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void effectsDisplay() {
|
protected void effectsDisplay() {
|
||||||
if (lucky) {
|
luckyEffectsDisplay();
|
||||||
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) }) }));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (canGigaDrill) {
|
if (canGigaDrill) {
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Excavation.Effect.0"), LocaleLoader.getString("Excavation.Effect.1") }));
|
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
|
@Override
|
||||||
protected void statsDisplay() {
|
protected void statsDisplay() {
|
||||||
if (canGigaDrill) {
|
if (canGigaDrill) {
|
||||||
if (endurance)
|
if (hasEndurance) {
|
||||||
player.sendMessage(LocaleLoader.getString("Excavation.Effect.Length", new Object[] { gigaDrillBreakerLength }) + LocaleLoader.getString("Perks.activationtime.bonus", new Object[] { gigaDrillBreakerLengthEndurance }));
|
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 }));
|
player.sendMessage(LocaleLoader.getString("Excavation.Effect.Length", new Object[] { gigaDrillBreakerLength }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -38,9 +38,10 @@ public class FishingCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dataCalculations() {
|
protected void dataCalculations() {
|
||||||
|
//TREASURE HUNTER
|
||||||
raining = player.getWorld().hasStorm();
|
raining = player.getWorld().hasStorm();
|
||||||
chanceRaining = "";
|
chanceRaining = "";
|
||||||
//Treasure Hunter
|
|
||||||
lootTier = Fishing.getFishingLootTier(profile);
|
lootTier = Fishing.getFishingLootTier(profile);
|
||||||
double magicChanceD = lootTier * magicHunterMultiplier;
|
double magicChanceD = lootTier * magicHunterMultiplier;
|
||||||
if (raining) {
|
if (raining) {
|
||||||
|
@ -71,7 +71,7 @@ public class AxeManager extends SkillManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Misc.hasArmor(eventHandler.livingDefender)) {
|
if (Misc.hasArmor(eventHandler.livingDefender)) {
|
||||||
eventHandler.damageArmor();
|
eventHandler.damageArmor();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -39,7 +39,7 @@ Archery.Combat.SkillshotBonus=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}
|
|||||||
Archery.Effect.0=Skill Shot
|
Archery.Effect.0=Skill Shot
|
||||||
Archery.Effect.1=Increases damage done with bows
|
Archery.Effect.1=Increases damage done with bows
|
||||||
Archery.Effect.2=Daze (Players)
|
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.4=Arrow Retrieval
|
||||||
Archery.Effect.5=Chance to retrieve arrows from corpses
|
Archery.Effect.5=Chance to retrieve arrows from corpses
|
||||||
Archery.Listener=Archery:
|
Archery.Listener=Archery:
|
||||||
|
Loading…
Reference in New Issue
Block a user