Cleanup Swords & Taming commands

This commit is contained in:
GJ 2013-01-22 10:48:10 -05:00
parent 65d71db72f
commit e048a6d0d0
17 changed files with 121 additions and 171 deletions

View File

@ -1,15 +1,12 @@
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.skills.swords.Swords;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Skills;
public class SwordsCommand extends SkillCommand { public class SwordsCommand extends SkillCommand {
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
private String counterAttackChance; private String counterAttackChance;
private String counterAttackChanceLucky; private String counterAttackChanceLucky;
private String bleedLength; private String bleedLength;
@ -18,19 +15,9 @@ public class SwordsCommand extends SkillCommand {
private String serratedStrikesLength; private String serratedStrikesLength;
private String serratedStrikesLengthEndurance; private String serratedStrikesLengthEndurance;
private int abilityLengthIncreaseLevel = advancedConfig.getAbilityLength();
private float bleedChanceMax = advancedConfig.getBleedChanceMax();
private float bleedMaxLevel = advancedConfig.getBleedMaxBonusLevel();
private int bleedMaxTicks = advancedConfig.getBleedMaxTicks();
private int bleedBaseTicks = advancedConfig.getBleedBaseTicks();
private float counterChanceMax = advancedConfig.getCounterChanceMax();
private float counterMaxLevel = advancedConfig.getCounterMaxBonusLevel();
private boolean canCounter; private boolean canCounter;
private boolean canSerratedStrike; private boolean canSerratedStrike;
private boolean canBleed; private boolean canBleed;
private boolean lucky;
private boolean endurance;
public SwordsCommand() { public SwordsCommand() {
super(SkillType.SWORDS); super(SkillType.SWORDS);
@ -38,43 +25,27 @@ public class SwordsCommand extends SkillCommand {
@Override @Override
protected void dataCalculations() { protected void dataCalculations() {
float bleedChanceF; //SERRATED STRIKES
float counterAttackChanceF; String[] serratedStrikesStrings = calculateLengthDisplayValues();
//Serrated Strikes serratedStrikesLength = serratedStrikesStrings[0];
int length = 2 + (int) ((double) skillValue / (double) abilityLengthIncreaseLevel); serratedStrikesLengthEndurance = serratedStrikesStrings[1];
serratedStrikesLength = String.valueOf(length);
if (Permissions.activationTwelve(player)) { //BLEED
length = length + 12; if (skillValue >= Swords.bleedMaxBonusLevel) {
bleedLength = String.valueOf(Swords.bleedMaxTicks);
} }
else if (Permissions.activationEight(player)) { else {
length = length + 8; bleedLength = String.valueOf(Swords.bleedBaseTicks);
} }
else if (Permissions.activationFour(player)) {
length = length + 4;
}
int maxLength = SkillType.SWORDS.getAbility().getMaxTicks();
if (maxLength != 0 && length > maxLength) {
length = maxLength;
}
serratedStrikesLengthEndurance = String.valueOf(length);
//Bleed String[] bleedStrings = calculateAbilityDisplayValues(Swords.bleedMaxBonusLevel, Swords.bleedMaxChance);
if (skillValue >= bleedMaxLevel) bleedLength = String.valueOf(bleedMaxTicks); bleedChance = bleedStrings[0];
else bleedLength = String.valueOf(bleedBaseTicks); bleedChanceLucky = bleedStrings[1];
if (skillValue >= bleedMaxLevel) bleedChanceF = bleedChanceMax; //COUNTER ATTACK
else bleedChanceF = (float) (((double) bleedChanceMax / (double) bleedMaxLevel) * skillValue); String[] counterAttackStrings = calculateAbilityDisplayValues(Swords.counterAttackMaxBonusLevel, Swords.counterAttackMaxChance);
bleedChance = percent.format(bleedChanceF / 100D); counterAttackChance = counterAttackStrings[0];
if (bleedChanceF * 1.3333D >= 100D) bleedChanceLucky = percent.format(1D); counterAttackChanceLucky = counterAttackStrings[1];
else bleedChanceLucky = percent.format(bleedChanceF * 1.3333D / 100D);
//Counter Attack
if (skillValue >= counterMaxLevel) counterAttackChanceF = counterChanceMax;
else counterAttackChanceF = (float) (((double) counterChanceMax / (double) counterMaxLevel) * skillValue);
counterAttackChance = percent.format(counterAttackChanceF / 100D);
if (counterAttackChanceF * 1.3333D >= 100D) counterAttackChanceLucky = percent.format(1D);
else counterAttackChanceLucky = percent.format(counterAttackChanceF * 1.3333D / 100D);
} }
@Override @Override
@ -82,8 +53,6 @@ public class SwordsCommand extends SkillCommand {
canBleed = Permissions.swordsBleed(player); canBleed = Permissions.swordsBleed(player);
canCounter = Permissions.counterAttack(player); canCounter = Permissions.counterAttack(player);
canSerratedStrike = Permissions.serratedStrikes(player); canSerratedStrike = Permissions.serratedStrikes(player);
lucky = Permissions.luckySwords(player);
endurance = Permissions.activationTwelve(player) || Permissions.activationEight(player) || Permissions.activationFour(player);
} }
@Override @Override
@ -93,18 +62,15 @@ public class SwordsCommand 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.SWORDS) }) }));
}
if (canCounter) { if (canCounter) {
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Swords.Effect.0"), LocaleLoader.getString("Swords.Effect.1") })); player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Swords.Effect.0"), LocaleLoader.getString("Swords.Effect.1", new Object[] {percent.format(100.D / Swords.counterAttackModifier)} ) }));
} }
if (canSerratedStrike) { if (canSerratedStrike) {
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Swords.Effect.2"), LocaleLoader.getString("Swords.Effect.3") })); player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Swords.Effect.2"), LocaleLoader.getString("Swords.Effect.3", new Object[] {percent.format(100.0D / Swords.serratedStrikesModifier)}) }));
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Swords.Effect.4"), LocaleLoader.getString("Swords.Effect.5") })); player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Swords.Effect.4"), LocaleLoader.getString("Swords.Effect.5", new Object[] {Swords.serratedStrikesBleedTicks}) }));
} }
if (canBleed) { if (canBleed) {
@ -120,26 +86,33 @@ public class SwordsCommand extends SkillCommand {
@Override @Override
protected void statsDisplay() { protected void statsDisplay() {
if (canCounter) { if (canCounter) {
if (lucky) if (isLucky) {
player.sendMessage(LocaleLoader.getString("Swords.Combat.Counter.Chance", new Object[] { counterAttackChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { counterAttackChanceLucky })); player.sendMessage(LocaleLoader.getString("Swords.Combat.Counter.Chance", new Object[] { counterAttackChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { counterAttackChanceLucky }));
else }
else {
player.sendMessage(LocaleLoader.getString("Swords.Combat.Counter.Chance", new Object[] { counterAttackChance })); player.sendMessage(LocaleLoader.getString("Swords.Combat.Counter.Chance", new Object[] { counterAttackChance }));
}
} }
if (canBleed) { if (canBleed) {
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Length", new Object[] { bleedLength })); player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Length", new Object[] { bleedLength }));
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Note")); player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Note"));
if (lucky)
if (isLucky) {
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Chance", new Object[] { bleedChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { bleedChanceLucky })); player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Chance", new Object[] { bleedChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { bleedChanceLucky }));
else }
else {
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Chance", new Object[] { bleedChance })); player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Chance", new Object[] { bleedChance }));
}
} }
if (canSerratedStrike) { if (canSerratedStrike) {
if (endurance) if (hasEndurance) {
player.sendMessage(LocaleLoader.getString("Swords.SS.Length", new Object[] { serratedStrikesLength }) + LocaleLoader.getString("Perks.activationtime.bonus", new Object[] { serratedStrikesLengthEndurance })); player.sendMessage(LocaleLoader.getString("Swords.SS.Length", new Object[] { serratedStrikesLength }) + LocaleLoader.getString("Perks.activationtime.bonus", new Object[] { serratedStrikesLengthEndurance }));
else }
else {
player.sendMessage(LocaleLoader.getString("Swords.SS.Length", new Object[] { serratedStrikesLength })); player.sendMessage(LocaleLoader.getString("Swords.SS.Length", new Object[] { serratedStrikesLength }));
}
} }
} }
} }

View File

@ -1,27 +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.config.Config; import com.gmail.nossr50.config.Config;
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.taming.Taming;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Skills;
public class TamingCommand extends SkillCommand { public class TamingCommand extends SkillCommand {
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
private String goreChance; private String goreChance;
private String goreChanceLucky; private String goreChanceLucky;
private float goreChanceMax = advancedConfig.getGoreChanceMax();
private float goreMaxLevel = advancedConfig.getGoreMaxBonusLevel();
private int fastFoodUnlock = advancedConfig.getFastFoodUnlock();
private float fastFoodChance = advancedConfig.getFastFoodChance();
private int enviromentallyAwareUnlock = advancedConfig.getEnviromentallyAwareUnlock();
private int thickFurUnlock = advancedConfig.getThickFurUnlock();
private int shockProofUnlock = advancedConfig.getShockProofUnlock();
private int sharpenedClawUnlock = advancedConfig.getSharpenedClawsUnlock();
private boolean canBeastLore; private boolean canBeastLore;
private boolean canGore; private boolean canGore;
private boolean canSharpenedClaws; private boolean canSharpenedClaws;
@ -30,7 +19,6 @@ public class TamingCommand extends SkillCommand {
private boolean canShockProof; private boolean canShockProof;
private boolean canCallWild; private boolean canCallWild;
private boolean canFastFood; private boolean canFastFood;
private boolean lucky;
public TamingCommand() { public TamingCommand() {
super(SkillType.TAMING); super(SkillType.TAMING);
@ -38,12 +26,9 @@ public class TamingCommand extends SkillCommand {
@Override @Override
protected void dataCalculations() { protected void dataCalculations() {
float goreChanceF; String[] goreStrings = calculateAbilityDisplayValues(Taming.goreMaxBonusLevel, Taming.goreMaxChance);
if (skillValue >= goreMaxLevel) goreChanceF = (goreChanceMax); goreChance = goreStrings[0];
else goreChanceF = (float) (((double) goreChanceMax / (double) goreMaxLevel) * skillValue); goreChanceLucky = goreStrings[1];
goreChance = percent.format(goreChanceF / 100D);
if (goreChanceF * 1.3333D >= 100D) goreChanceLucky = percent.format(1D);
else goreChanceLucky = percent.format(goreChanceF * 1.3333D / 100D);
} }
@Override @Override
@ -56,7 +41,6 @@ public class TamingCommand extends SkillCommand {
canSharpenedClaws = Permissions.sharpenedClaws(player); canSharpenedClaws = Permissions.sharpenedClaws(player);
canShockProof = Permissions.shockProof(player); canShockProof = Permissions.shockProof(player);
canThickFur = Permissions.thickFur(player); canThickFur = Permissions.thickFur(player);
lucky = Permissions.luckyTaming(player);
} }
@Override @Override
@ -66,12 +50,7 @@ public class TamingCommand 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.TAMING) }) }));
}
Config configInstance = Config.getInstance();
if (canBeastLore) { if (canBeastLore) {
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.0"), LocaleLoader.getString("Taming.Effect.1") })); player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.0"), LocaleLoader.getString("Taming.Effect.1") }));
@ -103,8 +82,8 @@ public class TamingCommand extends SkillCommand {
if (canCallWild) { if (canCallWild) {
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.12"), LocaleLoader.getString("Taming.Effect.13") })); player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.12"), LocaleLoader.getString("Taming.Effect.13") }));
player.sendMessage(LocaleLoader.getString("Taming.Effect.14", new Object[] { configInstance.getTamingCOTWOcelotCost() })); player.sendMessage(LocaleLoader.getString("Taming.Effect.14", new Object[] { Config.getInstance().getTamingCOTWOcelotCost() }));
player.sendMessage(LocaleLoader.getString("Taming.Effect.15", new Object[] { configInstance.getTamingCOTWWolfCost() })); player.sendMessage(LocaleLoader.getString("Taming.Effect.15", new Object[] { Config.getInstance().getTamingCOTWWolfCost() }));
} }
} }
@ -116,17 +95,17 @@ public class TamingCommand extends SkillCommand {
@Override @Override
protected void statsDisplay() { protected void statsDisplay() {
if (canFastFood) { if (canFastFood) {
if (skillValue < fastFoodUnlock) { if (skillValue < Taming.fastFoodServiceUnlockLevel) {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.4", new Object[] { fastFoodUnlock } ) })); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.4", new Object[] { Taming.fastFoodServiceUnlockLevel } ) }));
} }
else { else {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.8"), LocaleLoader.getString("Taming.Ability.Bonus.9", new Object[] { fastFoodChance } ) })); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.8"), LocaleLoader.getString("Taming.Ability.Bonus.9", new Object[] { percent.format(Taming.fastFoodServiceActivationChance) } ) }));
} }
} }
if (canEnvironmentallyAware) { if (canEnvironmentallyAware) {
if (skillValue < enviromentallyAwareUnlock) { if (skillValue < Taming.environmentallyAwareUnlockLevel) {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.0", new Object[] { enviromentallyAwareUnlock } ) })); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.0", new Object[] { Taming.environmentallyAwareUnlockLevel } ) }));
} }
else { else {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.0"), LocaleLoader.getString("Taming.Ability.Bonus.1") })); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.0"), LocaleLoader.getString("Taming.Ability.Bonus.1") }));
@ -134,37 +113,39 @@ public class TamingCommand extends SkillCommand {
} }
if (canThickFur) { if (canThickFur) {
if (skillValue < thickFurUnlock) { if (skillValue < Taming.thickFurUnlockLevel) {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.1", new Object[] { thickFurUnlock } ) })); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.1", new Object[] { Taming.thickFurUnlockLevel } ) }));
} }
else { else {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.2"), LocaleLoader.getString("Taming.Ability.Bonus.3") })); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.2"), LocaleLoader.getString("Taming.Ability.Bonus.3", new Object[] { Taming.thickFurModifier }) }));
} }
} }
if (canShockProof) { if (canShockProof) {
if (skillValue < shockProofUnlock) { if (skillValue < Taming.shockProofUnlockLevel) {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.2", new Object[] { shockProofUnlock } ) })); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.2", new Object[] { Taming.shockProofUnlockLevel } ) }));
} }
else { else {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.4"), LocaleLoader.getString("Taming.Ability.Bonus.5") })); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.4"), LocaleLoader.getString("Taming.Ability.Bonus.5", new Object[] { Taming.shockProofModifier }) }));
} }
} }
if (canSharpenedClaws) { if (canSharpenedClaws) {
if (skillValue < sharpenedClawUnlock) { if (skillValue < Taming.sharpenedClawsUnlockLevel) {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.3", new Object[] { sharpenedClawUnlock } ) })); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.3", new Object[] { Taming.sharpenedClawsUnlockLevel } ) }));
} }
else { else {
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.6"), LocaleLoader.getString("Taming.Ability.Bonus.7") })); player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.6"), LocaleLoader.getString("Taming.Ability.Bonus.7", new Object[] { Taming.sharpenedClawsBonusDamage }) }));
} }
} }
if (canGore) { if (canGore) {
if (lucky) if (isLucky) {
player.sendMessage(LocaleLoader.getString("Taming.Combat.Chance.Gore", new Object[] { goreChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { goreChanceLucky })); player.sendMessage(LocaleLoader.getString("Taming.Combat.Chance.Gore", new Object[] { goreChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { goreChanceLucky }));
else }
else {
player.sendMessage(LocaleLoader.getString("Taming.Combat.Chance.Gore", new Object[] { goreChance })); player.sendMessage(LocaleLoader.getString("Taming.Combat.Chance.Gore", new Object[] { goreChance }));
}
} }
} }
} }

View File

@ -136,12 +136,12 @@ public class AdvancedConfig extends ConfigLoader {
public int getArcaneForgingRankLevels4() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_4", 750); } public int getArcaneForgingRankLevels4() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_4", 750); }
/* SWORDS */ /* SWORDS */
public int getBleedChanceMax() { return config.getInt("Skills.Swords.Bleed_ChanceMax", 75); } public double getBleedChanceMax() { return config.getDouble("Skills.Swords.Bleed_ChanceMax", 75.0D); }
public int getBleedMaxBonusLevel() { return config.getInt("Skills.Swords.Bleed_MaxBonusLevel", 750); } public int getBleedMaxBonusLevel() { return config.getInt("Skills.Swords.Bleed_MaxBonusLevel", 750); }
public int getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed_MaxTicks", 3); } public int getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed_MaxTicks", 3); }
public int getBleedBaseTicks() { return config.getInt("Skills.Swords.Bleed_BaseTicks", 2); } public int getBleedBaseTicks() { return config.getInt("Skills.Swords.Bleed_BaseTicks", 2); }
public int getCounterChanceMax() { return config.getInt("Skills.Swords.Counter_ChanceMax", 30); } public double getCounterChanceMax() { return config.getDouble("Skills.Swords.Counter_ChanceMax", 30.0D); }
public int getCounterMaxBonusLevel() { return config.getInt("Skills.Swords.Counter_MaxBonusLevel", 600); } public int getCounterMaxBonusLevel() { return config.getInt("Skills.Swords.Counter_MaxBonusLevel", 600); }
public int getCounterModifier() { return config.getInt("Skills.Swords.Counter_DamageModifier", 2); } public int getCounterModifier() { return config.getInt("Skills.Swords.Counter_DamageModifier", 2); }
@ -149,13 +149,13 @@ public class AdvancedConfig extends ConfigLoader {
public int getSerratedStrikesTicks() { return config.getInt("Skills.Swords.SerratedStrikes_BleedTicks", 5); } public int getSerratedStrikesTicks() { return config.getInt("Skills.Swords.SerratedStrikes_BleedTicks", 5); }
/* TAMING */ /* TAMING */
public int getGoreChanceMax() { return config.getInt("Skills.Taming.Gore_ChanceMax", 100); } public double getGoreChanceMax() { return config.getInt("Skills.Taming.Gore_ChanceMax", 100); }
public int getGoreMaxBonusLevel() { return config.getInt("Skills.Taming.Gore_MaxBonusLevel", 1000); } public int getGoreMaxBonusLevel() { return config.getInt("Skills.Taming.Gore_MaxBonusLevel", 1000); }
public int getGoreBleedTicks() { return config.getInt("Skills.Taming.Gore_BleedTicks", 2); } public int getGoreBleedTicks() { return config.getInt("Skills.Taming.Gore_BleedTicks", 2); }
public int getGoreModifier() { return config.getInt("Skills.Taming.Gore_Modifier", 2); } public int getGoreModifier() { return config.getInt("Skills.Taming.Gore_Modifier", 2); }
public int getFastFoodUnlock() { return config.getInt("Skills.Taming.FastFood_UnlockLevel", 50); } public int getFastFoodUnlock() { return config.getInt("Skills.Taming.FastFood_UnlockLevel", 50); }
public int getFastFoodChance() { return config.getInt("Skills.Taming.FastFood_Chance", 50); } public double getFastFoodChance() { return config.getInt("Skills.Taming.FastFood_Chance", 50); }
public int getEnviromentallyAwareUnlock() { return config.getInt("Skills.Taming.EnvironmentallyAware_UnlockLevel", 100); } public int getEnviromentallyAwareUnlock() { return config.getInt("Skills.Taming.EnvironmentallyAware_UnlockLevel", 100); }

View File

@ -23,17 +23,17 @@ public class BleedEventHandler {
} }
protected void calculateSkillModifier() { protected void calculateSkillModifier() {
this.skillModifier = Misc.skillCheck(skillLevel, Swords.BLEED_MAX_BONUS_LEVEL); this.skillModifier = Misc.skillCheck(skillLevel, Swords.bleedMaxBonusLevel);
} }
protected void addBleedTicks() { protected void addBleedTicks() {
int bleedTicks; int bleedTicks;
if (skillLevel >= Swords.BLEED_MAX_BONUS_LEVEL) { if (skillLevel >= Swords.bleedMaxBonusLevel) {
bleedTicks = Swords.MAX_BLEED_TICKS; bleedTicks = Swords.bleedMaxTicks;
} }
else { else {
bleedTicks = Swords.BASE_BLEED_TICKS; bleedTicks = Swords.bleedBaseTicks;
} }
BleedTimer.add(defender, bleedTicks); BleedTimer.add(defender, bleedTicks);

View File

@ -31,11 +31,11 @@ public class CounterAttackEventHandler {
} }
protected void calculateSkillModifier() { protected void calculateSkillModifier() {
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Swords.COUNTER_ATTACK_MAX_BONUS_LEVEL); this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Swords.counterAttackMaxBonusLevel);
} }
protected void dealDamage() { protected void dealDamage() {
Combat.dealDamage(attacker, damage / Swords.COUNTER_ATTACK_MODIFIER); Combat.dealDamage(attacker, damage / Swords.counterAttackModifier);
} }
protected void sendAbilityMessages() { protected void sendAbilityMessages() {

View File

@ -19,7 +19,7 @@ public class SerratedStrikesEventHandler {
} }
protected void applyAbilityEffects() { protected void applyAbilityEffects() {
Combat.applyAbilityAoE(player, target, damage / Swords.SERRATED_STRIKES_MODIFIER, SkillType.SWORDS); Combat.applyAbilityAoE(player, target, damage / Swords.serratedStrikesModifier, SkillType.SWORDS);
BleedTimer.add(target, Swords.SERRATED_STRIKES_BLEED_TICKS); BleedTimer.add(target, Swords.serratedStrikesBleedTicks);
} }
} }

View File

@ -3,17 +3,15 @@ package com.gmail.nossr50.skills.swords;
import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.AdvancedConfig;
public class Swords { public class Swords {
static AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); public static double bleedMaxChance = AdvancedConfig.getInstance().getBleedChanceMax();
public static int bleedMaxBonusLevel = AdvancedConfig.getInstance().getBleedMaxBonusLevel();
public static int bleedMaxTicks = AdvancedConfig.getInstance().getBleedMaxTicks();
public static int bleedBaseTicks = AdvancedConfig.getInstance().getBleedBaseTicks();
public static final int BLEED_CHANCE_MAX = AdvancedConfig.getInstance().getBleedChanceMax(); public static double counterAttackMaxChance = AdvancedConfig.getInstance().getCounterChanceMax();
public static final int BLEED_MAX_BONUS_LEVEL = advancedConfig.getBleedMaxBonusLevel(); public static int counterAttackMaxBonusLevel = AdvancedConfig.getInstance().getCounterMaxBonusLevel();
public static final int MAX_BLEED_TICKS = advancedConfig.getBleedMaxTicks(); public static int counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier();
public static final int BASE_BLEED_TICKS = advancedConfig.getBleedBaseTicks();
public static final int COUNTER_ATTACK_CHANCE_MAX = advancedConfig.getCounterChanceMax(); public static int serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier();
public static final int COUNTER_ATTACK_MAX_BONUS_LEVEL = advancedConfig.getCounterMaxBonusLevel(); public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks();
public static final int COUNTER_ATTACK_MODIFIER = advancedConfig.getCounterModifier();
public static final int SERRATED_STRIKES_MODIFIER = advancedConfig.getSerratedStrikesModifier();
public static final int SERRATED_STRIKES_BLEED_TICKS = advancedConfig.getSerratedStrikesTicks();
} }

View File

@ -31,8 +31,8 @@ public class SwordsManager extends SkillManager {
if (Combat.shouldBeAffected(player, defender)) { if (Combat.shouldBeAffected(player, defender)) {
BleedEventHandler eventHandler = new BleedEventHandler(this, defender); BleedEventHandler eventHandler = new BleedEventHandler(this, defender);
float chance = (float) (((double) Swords.BLEED_CHANCE_MAX / (double) Swords.BLEED_MAX_BONUS_LEVEL) * skillLevel); float chance = (float) ((Swords.bleedMaxChance / Swords.bleedMaxBonusLevel) * skillLevel);
if (chance > Swords.BLEED_CHANCE_MAX) chance = Swords.BLEED_CHANCE_MAX; if (chance > Swords.bleedMaxChance) chance = (float) Swords.bleedMaxChance;
if (chance > Misc.getRandom().nextInt(activationChance)) { if (chance > Misc.getRandom().nextInt(activationChance)) {
eventHandler.addBleedTicks(); eventHandler.addBleedTicks();
@ -54,8 +54,8 @@ public class SwordsManager extends SkillManager {
if (eventHandler.isHoldingSword()) { if (eventHandler.isHoldingSword()) {
eventHandler.calculateSkillModifier(); eventHandler.calculateSkillModifier();
float chance = (float) (((double) Swords.COUNTER_ATTACK_CHANCE_MAX / (double) Swords.COUNTER_ATTACK_MAX_BONUS_LEVEL) * skillLevel); float chance = (float) ((Swords.counterAttackMaxChance / Swords.counterAttackMaxBonusLevel) * skillLevel);
if (chance > Swords.COUNTER_ATTACK_CHANCE_MAX) chance = Swords.COUNTER_ATTACK_CHANCE_MAX; if (chance > Swords.counterAttackMaxChance) chance = (float) Swords.counterAttackMaxChance;
if (chance > Misc.getRandom().nextInt(activationChance)) { if (chance > Misc.getRandom().nextInt(activationChance)) {
eventHandler.dealDamage(); eventHandler.dealDamage();

View File

@ -23,11 +23,11 @@ public class GoreEventHandler {
} }
protected void calculateSkillModifier() { protected void calculateSkillModifier() {
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Taming.GORE_MAX_BONUS_LEVEL); this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Taming.goreMaxBonusLevel);
} }
protected void modifyEventDamage() { protected void modifyEventDamage() {
event.setDamage(event.getDamage() * Taming.GORE_MULTIPLIER); event.setDamage(event.getDamage() * Taming.goreModifier);
} }
protected void sendAbilityMessage() { protected void sendAbilityMessage() {
@ -39,6 +39,6 @@ public class GoreEventHandler {
} }
protected void applyBleed() { protected void applyBleed() {
BleedTimer.add((LivingEntity) entity, Taming.GORE_BLEED_TICKS); BleedTimer.add((LivingEntity) entity, Taming.goreBleedTicks);
} }
} }

View File

@ -10,6 +10,6 @@ public class SharpenedClawsEventHandler {
} }
protected void modifyEventDamage() { protected void modifyEventDamage() {
event.setDamage(event.getDamage() + Taming.SHARPENED_CLAWS_BONUS); event.setDamage(event.getDamage() + Taming.sharpenedClawsBonusDamage);
} }
} }

View File

@ -10,6 +10,6 @@ public class ShockProofEventHandler {
} }
protected void modifyEventDamage() { protected void modifyEventDamage() {
event.setDamage(event.getDamage() / Taming.SHOCK_PROOF_MODIFIER); event.setDamage(event.getDamage() / Taming.shockProofModifier);
} }
} }

View File

@ -3,24 +3,22 @@ package com.gmail.nossr50.skills.taming;
import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.AdvancedConfig;
public class Taming { public class Taming {
static AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); public static int environmentallyAwareUnlockLevel = AdvancedConfig.getInstance().getEnviromentallyAwareUnlock();
public static final int ENVIRONMENTALLY_AWARE_ACTIVATION_LEVEL = advancedConfig.getEnviromentallyAwareUnlock(); public static double fastFoodServiceActivationChance = AdvancedConfig.getInstance().getFastFoodChance();
public static int fastFoodServiceUnlockLevel = AdvancedConfig.getInstance().getFastFoodUnlock();
public static final int FAST_FOOD_SERVICE_ACTIVATION_CHANCE = advancedConfig.getFastFoodChance(); public static double goreMaxChance = AdvancedConfig.getInstance().getGoreChanceMax();
public static final int FAST_FOOD_SERVICE_ACTIVATION_LEVEL = advancedConfig.getFastFoodUnlock(); public static int goreBleedTicks = AdvancedConfig.getInstance().getGoreBleedTicks();
public static int goreMaxBonusLevel = AdvancedConfig.getInstance().getGoreMaxBonusLevel();
public static int goreModifier = AdvancedConfig.getInstance().getGoreModifier();
public static final int GORE_CHANCE_MAX = AdvancedConfig.getInstance().getGoreChanceMax(); public static int sharpenedClawsUnlockLevel = AdvancedConfig.getInstance().getSharpenedClawsUnlock();
public static final int GORE_BLEED_TICKS = advancedConfig.getGoreBleedTicks(); public static int sharpenedClawsBonusDamage = AdvancedConfig.getInstance().getSharpenedClawsBonus();
public static final int GORE_MAX_BONUS_LEVEL = advancedConfig.getGoreMaxBonusLevel();
public static final int GORE_MULTIPLIER = advancedConfig.getGoreModifier();
public static final int SHARPENED_CLAWS_ACTIVATION_LEVEL = advancedConfig.getSharpenedClawsUnlock(); public static int shockProofUnlockLevel = AdvancedConfig.getInstance().getShockProofUnlock();
public static final int SHARPENED_CLAWS_BONUS = advancedConfig.getSharpenedClawsBonus(); public static int shockProofModifier = AdvancedConfig.getInstance().getShockProofModifier();
public static final int SHOCK_PROOF_ACTIVATION_LEVEL = advancedConfig.getShockProofUnlock(); public static int thickFurUnlockLevel = AdvancedConfig.getInstance().getThickFurUnlock();
public static final int SHOCK_PROOF_MODIFIER = advancedConfig.getShockProofModifier(); public static int thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier();
public static final int THICK_FUR_ACTIVATION_LEVEL = advancedConfig.getThickFurUnlock();
public static final int THICK_FUR_MODIFIER = advancedConfig.getThickFurModifier();
} }

View File

@ -36,8 +36,8 @@ public class TamingManager extends SkillManager {
return; return;
} }
if (skillLevel >= Taming.FAST_FOOD_SERVICE_ACTIVATION_LEVEL) { if (skillLevel >= Taming.fastFoodServiceUnlockLevel) {
if (Misc.getRandom().nextInt(activationChance) < Taming.FAST_FOOD_SERVICE_ACTIVATION_CHANCE) { if (Misc.getRandom().nextInt(activationChance) < Taming.fastFoodServiceActivationChance) {
FastFoodServiceEventHandler eventHandler = new FastFoodServiceEventHandler(wolf); FastFoodServiceEventHandler eventHandler = new FastFoodServiceEventHandler(wolf);
eventHandler.modifyHealth(damage); eventHandler.modifyHealth(damage);
@ -58,7 +58,7 @@ public class TamingManager extends SkillManager {
return; return;
} }
if (skillLevel >= Taming.SHARPENED_CLAWS_ACTIVATION_LEVEL) { if (skillLevel >= Taming.sharpenedClawsUnlockLevel) {
SharpenedClawsEventHandler eventHandler = new SharpenedClawsEventHandler(event); SharpenedClawsEventHandler eventHandler = new SharpenedClawsEventHandler(event);
eventHandler.modifyEventDamage(); eventHandler.modifyEventDamage();
@ -80,8 +80,8 @@ public class TamingManager extends SkillManager {
GoreEventHandler eventHandler = new GoreEventHandler(this, event); GoreEventHandler eventHandler = new GoreEventHandler(this, event);
float chance = (float) (((double) Taming.GORE_CHANCE_MAX / (double) Taming.GORE_MAX_BONUS_LEVEL) * skillLevel); float chance = (float) ((Taming.goreMaxChance / Taming.goreMaxBonusLevel) * skillLevel);
if (chance > Taming.GORE_CHANCE_MAX) chance = Taming.GORE_CHANCE_MAX; if (chance > Taming.goreMaxChance) chance = (float) Taming.goreMaxChance;
if (chance > Misc.getRandom().nextInt(activationChance)) { if (chance > Misc.getRandom().nextInt(activationChance)) {
eventHandler.modifyEventDamage(); eventHandler.modifyEventDamage();
@ -203,7 +203,7 @@ public class TamingManager extends SkillManager {
return; return;
} }
if (skillLevel >= Taming.ENVIRONMENTALLY_AWARE_ACTIVATION_LEVEL) { if (skillLevel >= Taming.environmentallyAwareUnlockLevel) {
EnvironmentallyAwareEventHandler eventHandler = new EnvironmentallyAwareEventHandler(this, event); EnvironmentallyAwareEventHandler eventHandler = new EnvironmentallyAwareEventHandler(this, event);
switch (cause) { switch (cause) {
@ -238,7 +238,7 @@ public class TamingManager extends SkillManager {
return; return;
} }
if (skillLevel >= Taming.THICK_FUR_ACTIVATION_LEVEL) { if (skillLevel >= Taming.thickFurUnlockLevel) {
ThickFurEventHandler eventHandler = new ThickFurEventHandler(event, cause); ThickFurEventHandler eventHandler = new ThickFurEventHandler(event, cause);
eventHandler.modifyEventDamage(); eventHandler.modifyEventDamage();
@ -258,7 +258,7 @@ public class TamingManager extends SkillManager {
return; return;
} }
if (skillLevel >= Taming.SHOCK_PROOF_ACTIVATION_LEVEL) { if (skillLevel >= Taming.shockProofUnlockLevel) {
ShockProofEventHandler eventHandler = new ShockProofEventHandler(event); ShockProofEventHandler eventHandler = new ShockProofEventHandler(event);
eventHandler.modifyEventDamage(); eventHandler.modifyEventDamage();

View File

@ -23,7 +23,7 @@ public class ThickFurEventHandler {
case ENTITY_ATTACK: case ENTITY_ATTACK:
case PROJECTILE: case PROJECTILE:
event.setDamage(event.getDamage() / Taming.THICK_FUR_MODIFIER); event.setDamage(event.getDamage() / Taming.thickFurModifier);
break; break;
default: default:

View File

@ -351,7 +351,7 @@ public class Combat {
((Player) entity).sendMessage(LocaleLoader.getString("Swords.Combat.SS.Struck")); ((Player) entity).sendMessage(LocaleLoader.getString("Swords.Combat.SS.Struck"));
} }
BleedTimer.add((LivingEntity) entity, Swords.SERRATED_STRIKES_BLEED_TICKS); BleedTimer.add((LivingEntity) entity, Swords.serratedStrikesBleedTicks);
break; break;

View File

@ -200,7 +200,7 @@ Skills:
Swords: Swords:
# Bleed_ChanceMax: Maximum chance of triggering bleeding # Bleed_ChanceMax: Maximum chance of triggering bleeding
# Bleed_MaxBonusLevel: On this level, the chance to cause Bleeding will be Bleed_ChanceMax # Bleed_MaxBonusLevel: On this level, the chance to cause Bleeding will be Bleed_ChanceMax
Bleed_ChanceMax: 75 Bleed_ChanceMax: 75.0
Bleed_MaxBonusLevel: 750 Bleed_MaxBonusLevel: 750
# These settings determine how long the Bleeding effect lasts # These settings determine how long the Bleeding effect lasts
Bleed_MaxTicks: 3 Bleed_MaxTicks: 3
@ -208,7 +208,7 @@ Skills:
# Counter_ChanceMax: Maximum chance of triggering a counter attack # Counter_ChanceMax: Maximum chance of triggering a counter attack
# Counter_MaxBonusLevel: On this level, the chance to Counter will be Counter_ChanceMax # Counter_MaxBonusLevel: On this level, the chance to Counter will be Counter_ChanceMax
Counter_ChanceMax: 30 Counter_ChanceMax: 30.0
Counter_MaxBonusLevel: 600 Counter_MaxBonusLevel: 600
# Counter_DamageModifier: Damaged caused by the damager will get divided by this modifier and dealt back to the damager # Counter_DamageModifier: Damaged caused by the damager will get divided by this modifier and dealt back to the damager

View File

@ -261,11 +261,11 @@ Swords.Combat.Counter.Hit=[[DARK_RED]]Hit with a counter-attack!
Swords.Combat.Countered=[[GREEN]]**COUNTER-ATTACKED** Swords.Combat.Countered=[[GREEN]]**COUNTER-ATTACKED**
Swords.Combat.SS.Struck=[[DARK_RED]]Struck by SERRATED STRIKES! Swords.Combat.SS.Struck=[[DARK_RED]]Struck by SERRATED STRIKES!
Swords.Effect.0=Counter Attack Swords.Effect.0=Counter Attack
Swords.Effect.1=Reflect 50% of damage taken Swords.Effect.1=Reflect {0} of damage taken
Swords.Effect.2=Serrated Strikes (ABILITY) Swords.Effect.2=Serrated Strikes (ABILITY)
Swords.Effect.3=25% DMG AoE, Bleed+ AoE Swords.Effect.3={0} DMG AoE, Bleed+ AoE
Swords.Effect.4=Serrated Strikes Bleed+ Swords.Effect.4=Serrated Strikes Bleed+
Swords.Effect.5=5 Tick Bleed Swords.Effect.5={0} Tick Bleed
Swords.Effect.6=Bleed Swords.Effect.6=Bleed
Swords.Effect.7=Apply a bleed DoT Swords.Effect.7=Apply a bleed DoT
Swords.Listener=Swords: Swords.Listener=Swords:
@ -282,13 +282,13 @@ Swords.SS.Length=[[RED]]Serrated Strikes Length: [[YELLOW]]{0}s
Taming.Ability.Bonus.0=Environmentally Aware Taming.Ability.Bonus.0=Environmentally Aware
Taming.Ability.Bonus.1=Wolves avoid danger Taming.Ability.Bonus.1=Wolves avoid danger
Taming.Ability.Bonus.2=Thick Fur Taming.Ability.Bonus.2=Thick Fur
Taming.Ability.Bonus.3=1/2 Damage, Fire Resistance Taming.Ability.Bonus.3=1/{0} Damage, Fire Resistance
Taming.Ability.Bonus.4=Shock Proof Taming.Ability.Bonus.4=Shock Proof
Taming.Ability.Bonus.5=Explosives do 1/6 normal damage Taming.Ability.Bonus.5=Explosives do 1/{0} normal damage
Taming.Ability.Bonus.6=Sharpened Claws Taming.Ability.Bonus.6=Sharpened Claws
Taming.Ability.Bonus.7=+2 Damage Taming.Ability.Bonus.7=+{0} Damage
Taming.Ability.Bonus.8=Fast Food Service Taming.Ability.Bonus.8=Fast Food Service
Taming.Ability.Bonus.9={0}% Chance for heal on attack Taming.Ability.Bonus.9={0} Chance for heal on attack
Taming.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (ENVIRONMENTALLY AWARE) Taming.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (ENVIRONMENTALLY AWARE)
Taming.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (THICK FUR) Taming.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (THICK FUR)
Taming.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (SHOCK PROOF) Taming.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (SHOCK PROOF)