mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Cleanup Swords & Taming commands
This commit is contained in:
parent
65d71db72f
commit
e048a6d0d0
@ -1,15 +1,12 @@
|
||||
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.skills.swords.Swords;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.Skills;
|
||||
|
||||
public class SwordsCommand extends SkillCommand {
|
||||
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
|
||||
private String counterAttackChance;
|
||||
private String counterAttackChanceLucky;
|
||||
private String bleedLength;
|
||||
@ -18,19 +15,9 @@ public class SwordsCommand extends SkillCommand {
|
||||
private String serratedStrikesLength;
|
||||
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 canSerratedStrike;
|
||||
private boolean canBleed;
|
||||
private boolean lucky;
|
||||
private boolean endurance;
|
||||
|
||||
public SwordsCommand() {
|
||||
super(SkillType.SWORDS);
|
||||
@ -38,43 +25,27 @@ public class SwordsCommand extends SkillCommand {
|
||||
|
||||
@Override
|
||||
protected void dataCalculations() {
|
||||
float bleedChanceF;
|
||||
float counterAttackChanceF;
|
||||
//Serrated Strikes
|
||||
int length = 2 + (int) ((double) skillValue / (double) abilityLengthIncreaseLevel);
|
||||
serratedStrikesLength = String.valueOf(length);
|
||||
//SERRATED STRIKES
|
||||
String[] serratedStrikesStrings = calculateLengthDisplayValues();
|
||||
serratedStrikesLength = serratedStrikesStrings[0];
|
||||
serratedStrikesLengthEndurance = serratedStrikesStrings[1];
|
||||
|
||||
if (Permissions.activationTwelve(player)) {
|
||||
length = length + 12;
|
||||
//BLEED
|
||||
if (skillValue >= Swords.bleedMaxBonusLevel) {
|
||||
bleedLength = String.valueOf(Swords.bleedMaxTicks);
|
||||
}
|
||||
else if (Permissions.activationEight(player)) {
|
||||
length = length + 8;
|
||||
else {
|
||||
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
|
||||
if (skillValue >= bleedMaxLevel) bleedLength = String.valueOf(bleedMaxTicks);
|
||||
else bleedLength = String.valueOf(bleedBaseTicks);
|
||||
String[] bleedStrings = calculateAbilityDisplayValues(Swords.bleedMaxBonusLevel, Swords.bleedMaxChance);
|
||||
bleedChance = bleedStrings[0];
|
||||
bleedChanceLucky = bleedStrings[1];
|
||||
|
||||
if (skillValue >= bleedMaxLevel) bleedChanceF = bleedChanceMax;
|
||||
else bleedChanceF = (float) (((double) bleedChanceMax / (double) bleedMaxLevel) * skillValue);
|
||||
bleedChance = percent.format(bleedChanceF / 100D);
|
||||
if (bleedChanceF * 1.3333D >= 100D) bleedChanceLucky = percent.format(1D);
|
||||
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);
|
||||
//COUNTER ATTACK
|
||||
String[] counterAttackStrings = calculateAbilityDisplayValues(Swords.counterAttackMaxBonusLevel, Swords.counterAttackMaxChance);
|
||||
counterAttackChance = counterAttackStrings[0];
|
||||
counterAttackChanceLucky = counterAttackStrings[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -82,8 +53,6 @@ public class SwordsCommand extends SkillCommand {
|
||||
canBleed = Permissions.swordsBleed(player);
|
||||
canCounter = Permissions.counterAttack(player);
|
||||
canSerratedStrike = Permissions.serratedStrikes(player);
|
||||
lucky = Permissions.luckySwords(player);
|
||||
endurance = Permissions.activationTwelve(player) || Permissions.activationEight(player) || Permissions.activationFour(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -93,18 +62,15 @@ public class SwordsCommand 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.SWORDS) }) }));
|
||||
}
|
||||
luckyEffectsDisplay();
|
||||
|
||||
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) {
|
||||
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.4"), LocaleLoader.getString("Swords.Effect.5") }));
|
||||
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", new Object[] {Swords.serratedStrikesBleedTicks}) }));
|
||||
}
|
||||
|
||||
if (canBleed) {
|
||||
@ -120,26 +86,33 @@ public class SwordsCommand extends SkillCommand {
|
||||
@Override
|
||||
protected void statsDisplay() {
|
||||
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 }));
|
||||
else
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Swords.Combat.Counter.Chance", new Object[] { counterAttackChance }));
|
||||
}
|
||||
}
|
||||
|
||||
if (canBleed) {
|
||||
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Length", new Object[] { bleedLength }));
|
||||
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 }));
|
||||
else
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Chance", new Object[] { bleedChance }));
|
||||
}
|
||||
}
|
||||
|
||||
if (canSerratedStrike) {
|
||||
if (endurance)
|
||||
if (hasEndurance) {
|
||||
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 }));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +1,16 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.commands.SkillCommand;
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.taming.Taming;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.Skills;
|
||||
|
||||
public class TamingCommand extends SkillCommand {
|
||||
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
private String goreChance;
|
||||
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 canGore;
|
||||
private boolean canSharpenedClaws;
|
||||
@ -30,7 +19,6 @@ public class TamingCommand extends SkillCommand {
|
||||
private boolean canShockProof;
|
||||
private boolean canCallWild;
|
||||
private boolean canFastFood;
|
||||
private boolean lucky;
|
||||
|
||||
public TamingCommand() {
|
||||
super(SkillType.TAMING);
|
||||
@ -38,12 +26,9 @@ public class TamingCommand extends SkillCommand {
|
||||
|
||||
@Override
|
||||
protected void dataCalculations() {
|
||||
float goreChanceF;
|
||||
if (skillValue >= goreMaxLevel) goreChanceF = (goreChanceMax);
|
||||
else goreChanceF = (float) (((double) goreChanceMax / (double) goreMaxLevel) * skillValue);
|
||||
goreChance = percent.format(goreChanceF / 100D);
|
||||
if (goreChanceF * 1.3333D >= 100D) goreChanceLucky = percent.format(1D);
|
||||
else goreChanceLucky = percent.format(goreChanceF * 1.3333D / 100D);
|
||||
String[] goreStrings = calculateAbilityDisplayValues(Taming.goreMaxBonusLevel, Taming.goreMaxChance);
|
||||
goreChance = goreStrings[0];
|
||||
goreChanceLucky = goreStrings[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -56,7 +41,6 @@ public class TamingCommand extends SkillCommand {
|
||||
canSharpenedClaws = Permissions.sharpenedClaws(player);
|
||||
canShockProof = Permissions.shockProof(player);
|
||||
canThickFur = Permissions.thickFur(player);
|
||||
lucky = Permissions.luckyTaming(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,12 +50,7 @@ public class TamingCommand 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.TAMING) }) }));
|
||||
}
|
||||
|
||||
Config configInstance = Config.getInstance();
|
||||
luckyEffectsDisplay();
|
||||
|
||||
if (canBeastLore) {
|
||||
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) {
|
||||
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.15", new Object[] { configInstance.getTamingCOTWWolfCost() }));
|
||||
player.sendMessage(LocaleLoader.getString("Taming.Effect.14", new Object[] { Config.getInstance().getTamingCOTWOcelotCost() }));
|
||||
player.sendMessage(LocaleLoader.getString("Taming.Effect.15", new Object[] { Config.getInstance().getTamingCOTWWolfCost() }));
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,17 +95,17 @@ public class TamingCommand extends SkillCommand {
|
||||
@Override
|
||||
protected void statsDisplay() {
|
||||
if (canFastFood) {
|
||||
if (skillValue < fastFoodUnlock) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.4", new Object[] { fastFoodUnlock } ) }));
|
||||
if (skillValue < Taming.fastFoodServiceUnlockLevel) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.4", new Object[] { Taming.fastFoodServiceUnlockLevel } ) }));
|
||||
}
|
||||
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 (skillValue < enviromentallyAwareUnlock) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.0", new Object[] { enviromentallyAwareUnlock } ) }));
|
||||
if (skillValue < Taming.environmentallyAwareUnlockLevel) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.0", new Object[] { Taming.environmentallyAwareUnlockLevel } ) }));
|
||||
}
|
||||
else {
|
||||
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 (skillValue < thickFurUnlock) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.1", new Object[] { thickFurUnlock } ) }));
|
||||
if (skillValue < Taming.thickFurUnlockLevel) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.1", new Object[] { Taming.thickFurUnlockLevel } ) }));
|
||||
}
|
||||
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 (skillValue < shockProofUnlock) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.2", new Object[] { shockProofUnlock } ) }));
|
||||
if (skillValue < Taming.shockProofUnlockLevel) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.2", new Object[] { Taming.shockProofUnlockLevel } ) }));
|
||||
}
|
||||
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 (skillValue < sharpenedClawUnlock) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.3", new Object[] { sharpenedClawUnlock } ) }));
|
||||
if (skillValue < Taming.sharpenedClawsUnlockLevel) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.3", new Object[] { Taming.sharpenedClawsUnlockLevel } ) }));
|
||||
}
|
||||
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 (lucky)
|
||||
if (isLucky) {
|
||||
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 }));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -136,12 +136,12 @@ public class AdvancedConfig extends ConfigLoader {
|
||||
public int getArcaneForgingRankLevels4() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_4", 750); }
|
||||
|
||||
/* 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 getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed_MaxTicks", 3); }
|
||||
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 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); }
|
||||
|
||||
/* 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 getGoreBleedTicks() { return config.getInt("Skills.Taming.Gore_BleedTicks", 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 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); }
|
||||
|
||||
|
@ -23,17 +23,17 @@ public class BleedEventHandler {
|
||||
}
|
||||
|
||||
protected void calculateSkillModifier() {
|
||||
this.skillModifier = Misc.skillCheck(skillLevel, Swords.BLEED_MAX_BONUS_LEVEL);
|
||||
this.skillModifier = Misc.skillCheck(skillLevel, Swords.bleedMaxBonusLevel);
|
||||
}
|
||||
|
||||
protected void addBleedTicks() {
|
||||
int bleedTicks;
|
||||
|
||||
if (skillLevel >= Swords.BLEED_MAX_BONUS_LEVEL) {
|
||||
bleedTicks = Swords.MAX_BLEED_TICKS;
|
||||
if (skillLevel >= Swords.bleedMaxBonusLevel) {
|
||||
bleedTicks = Swords.bleedMaxTicks;
|
||||
}
|
||||
else {
|
||||
bleedTicks = Swords.BASE_BLEED_TICKS;
|
||||
bleedTicks = Swords.bleedBaseTicks;
|
||||
}
|
||||
|
||||
BleedTimer.add(defender, bleedTicks);
|
||||
|
@ -31,11 +31,11 @@ public class CounterAttackEventHandler {
|
||||
}
|
||||
|
||||
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() {
|
||||
Combat.dealDamage(attacker, damage / Swords.COUNTER_ATTACK_MODIFIER);
|
||||
Combat.dealDamage(attacker, damage / Swords.counterAttackModifier);
|
||||
}
|
||||
|
||||
protected void sendAbilityMessages() {
|
||||
|
@ -19,7 +19,7 @@ public class SerratedStrikesEventHandler {
|
||||
}
|
||||
|
||||
protected void applyAbilityEffects() {
|
||||
Combat.applyAbilityAoE(player, target, damage / Swords.SERRATED_STRIKES_MODIFIER, SkillType.SWORDS);
|
||||
BleedTimer.add(target, Swords.SERRATED_STRIKES_BLEED_TICKS);
|
||||
Combat.applyAbilityAoE(player, target, damage / Swords.serratedStrikesModifier, SkillType.SWORDS);
|
||||
BleedTimer.add(target, Swords.serratedStrikesBleedTicks);
|
||||
}
|
||||
}
|
||||
|
@ -3,17 +3,15 @@ package com.gmail.nossr50.skills.swords;
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
|
||||
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 final int BLEED_MAX_BONUS_LEVEL = advancedConfig.getBleedMaxBonusLevel();
|
||||
public static final int MAX_BLEED_TICKS = advancedConfig.getBleedMaxTicks();
|
||||
public static final int BASE_BLEED_TICKS = advancedConfig.getBleedBaseTicks();
|
||||
public static double counterAttackMaxChance = AdvancedConfig.getInstance().getCounterChanceMax();
|
||||
public static int counterAttackMaxBonusLevel = AdvancedConfig.getInstance().getCounterMaxBonusLevel();
|
||||
public static int counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier();
|
||||
|
||||
public static final int COUNTER_ATTACK_CHANCE_MAX = advancedConfig.getCounterChanceMax();
|
||||
public static final int COUNTER_ATTACK_MAX_BONUS_LEVEL = advancedConfig.getCounterMaxBonusLevel();
|
||||
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();
|
||||
public static int serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier();
|
||||
public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks();
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ public class SwordsManager extends SkillManager {
|
||||
if (Combat.shouldBeAffected(player, defender)) {
|
||||
BleedEventHandler eventHandler = new BleedEventHandler(this, defender);
|
||||
|
||||
float chance = (float) (((double) Swords.BLEED_CHANCE_MAX / (double) Swords.BLEED_MAX_BONUS_LEVEL) * skillLevel);
|
||||
if (chance > Swords.BLEED_CHANCE_MAX) chance = Swords.BLEED_CHANCE_MAX;
|
||||
float chance = (float) ((Swords.bleedMaxChance / Swords.bleedMaxBonusLevel) * skillLevel);
|
||||
if (chance > Swords.bleedMaxChance) chance = (float) Swords.bleedMaxChance;
|
||||
|
||||
if (chance > Misc.getRandom().nextInt(activationChance)) {
|
||||
eventHandler.addBleedTicks();
|
||||
@ -54,8 +54,8 @@ public class SwordsManager extends SkillManager {
|
||||
if (eventHandler.isHoldingSword()) {
|
||||
eventHandler.calculateSkillModifier();
|
||||
|
||||
float chance = (float) (((double) Swords.COUNTER_ATTACK_CHANCE_MAX / (double) Swords.COUNTER_ATTACK_MAX_BONUS_LEVEL) * skillLevel);
|
||||
if (chance > Swords.COUNTER_ATTACK_CHANCE_MAX) chance = Swords.COUNTER_ATTACK_CHANCE_MAX;
|
||||
float chance = (float) ((Swords.counterAttackMaxChance / Swords.counterAttackMaxBonusLevel) * skillLevel);
|
||||
if (chance > Swords.counterAttackMaxChance) chance = (float) Swords.counterAttackMaxChance;
|
||||
|
||||
if (chance > Misc.getRandom().nextInt(activationChance)) {
|
||||
eventHandler.dealDamage();
|
||||
|
@ -23,11 +23,11 @@ public class GoreEventHandler {
|
||||
}
|
||||
|
||||
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() {
|
||||
event.setDamage(event.getDamage() * Taming.GORE_MULTIPLIER);
|
||||
event.setDamage(event.getDamage() * Taming.goreModifier);
|
||||
}
|
||||
|
||||
protected void sendAbilityMessage() {
|
||||
@ -39,6 +39,6 @@ public class GoreEventHandler {
|
||||
}
|
||||
|
||||
protected void applyBleed() {
|
||||
BleedTimer.add((LivingEntity) entity, Taming.GORE_BLEED_TICKS);
|
||||
BleedTimer.add((LivingEntity) entity, Taming.goreBleedTicks);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,6 @@ public class SharpenedClawsEventHandler {
|
||||
}
|
||||
|
||||
protected void modifyEventDamage() {
|
||||
event.setDamage(event.getDamage() + Taming.SHARPENED_CLAWS_BONUS);
|
||||
event.setDamage(event.getDamage() + Taming.sharpenedClawsBonusDamage);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,6 @@ public class ShockProofEventHandler {
|
||||
}
|
||||
|
||||
protected void modifyEventDamage() {
|
||||
event.setDamage(event.getDamage() / Taming.SHOCK_PROOF_MODIFIER);
|
||||
event.setDamage(event.getDamage() / Taming.shockProofModifier);
|
||||
}
|
||||
}
|
||||
|
@ -3,24 +3,22 @@ package com.gmail.nossr50.skills.taming;
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
|
||||
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 final int FAST_FOOD_SERVICE_ACTIVATION_LEVEL = advancedConfig.getFastFoodUnlock();
|
||||
public static double goreMaxChance = AdvancedConfig.getInstance().getGoreChanceMax();
|
||||
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 final int GORE_BLEED_TICKS = advancedConfig.getGoreBleedTicks();
|
||||
public static final int GORE_MAX_BONUS_LEVEL = advancedConfig.getGoreMaxBonusLevel();
|
||||
public static final int GORE_MULTIPLIER = advancedConfig.getGoreModifier();
|
||||
public static int sharpenedClawsUnlockLevel = AdvancedConfig.getInstance().getSharpenedClawsUnlock();
|
||||
public static int sharpenedClawsBonusDamage = AdvancedConfig.getInstance().getSharpenedClawsBonus();
|
||||
|
||||
public static final int SHARPENED_CLAWS_ACTIVATION_LEVEL = advancedConfig.getSharpenedClawsUnlock();
|
||||
public static final int SHARPENED_CLAWS_BONUS = advancedConfig.getSharpenedClawsBonus();
|
||||
public static int shockProofUnlockLevel = AdvancedConfig.getInstance().getShockProofUnlock();
|
||||
public static int shockProofModifier = AdvancedConfig.getInstance().getShockProofModifier();
|
||||
|
||||
public static final int SHOCK_PROOF_ACTIVATION_LEVEL = advancedConfig.getShockProofUnlock();
|
||||
public static final int SHOCK_PROOF_MODIFIER = advancedConfig.getShockProofModifier();
|
||||
|
||||
public static final int THICK_FUR_ACTIVATION_LEVEL = advancedConfig.getThickFurUnlock();
|
||||
public static final int THICK_FUR_MODIFIER = advancedConfig.getThickFurModifier();
|
||||
public static int thickFurUnlockLevel = AdvancedConfig.getInstance().getThickFurUnlock();
|
||||
public static int thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier();
|
||||
}
|
||||
|
@ -36,8 +36,8 @@ public class TamingManager extends SkillManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (skillLevel >= Taming.FAST_FOOD_SERVICE_ACTIVATION_LEVEL) {
|
||||
if (Misc.getRandom().nextInt(activationChance) < Taming.FAST_FOOD_SERVICE_ACTIVATION_CHANCE) {
|
||||
if (skillLevel >= Taming.fastFoodServiceUnlockLevel) {
|
||||
if (Misc.getRandom().nextInt(activationChance) < Taming.fastFoodServiceActivationChance) {
|
||||
FastFoodServiceEventHandler eventHandler = new FastFoodServiceEventHandler(wolf);
|
||||
|
||||
eventHandler.modifyHealth(damage);
|
||||
@ -58,7 +58,7 @@ public class TamingManager extends SkillManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (skillLevel >= Taming.SHARPENED_CLAWS_ACTIVATION_LEVEL) {
|
||||
if (skillLevel >= Taming.sharpenedClawsUnlockLevel) {
|
||||
SharpenedClawsEventHandler eventHandler = new SharpenedClawsEventHandler(event);
|
||||
|
||||
eventHandler.modifyEventDamage();
|
||||
@ -80,8 +80,8 @@ public class TamingManager extends SkillManager {
|
||||
|
||||
GoreEventHandler eventHandler = new GoreEventHandler(this, event);
|
||||
|
||||
float chance = (float) (((double) Taming.GORE_CHANCE_MAX / (double) Taming.GORE_MAX_BONUS_LEVEL) * skillLevel);
|
||||
if (chance > Taming.GORE_CHANCE_MAX) chance = Taming.GORE_CHANCE_MAX;
|
||||
float chance = (float) ((Taming.goreMaxChance / Taming.goreMaxBonusLevel) * skillLevel);
|
||||
if (chance > Taming.goreMaxChance) chance = (float) Taming.goreMaxChance;
|
||||
|
||||
if (chance > Misc.getRandom().nextInt(activationChance)) {
|
||||
eventHandler.modifyEventDamage();
|
||||
@ -203,7 +203,7 @@ public class TamingManager extends SkillManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (skillLevel >= Taming.ENVIRONMENTALLY_AWARE_ACTIVATION_LEVEL) {
|
||||
if (skillLevel >= Taming.environmentallyAwareUnlockLevel) {
|
||||
EnvironmentallyAwareEventHandler eventHandler = new EnvironmentallyAwareEventHandler(this, event);
|
||||
|
||||
switch (cause) {
|
||||
@ -238,7 +238,7 @@ public class TamingManager extends SkillManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (skillLevel >= Taming.THICK_FUR_ACTIVATION_LEVEL) {
|
||||
if (skillLevel >= Taming.thickFurUnlockLevel) {
|
||||
ThickFurEventHandler eventHandler = new ThickFurEventHandler(event, cause);
|
||||
|
||||
eventHandler.modifyEventDamage();
|
||||
@ -258,7 +258,7 @@ public class TamingManager extends SkillManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (skillLevel >= Taming.SHOCK_PROOF_ACTIVATION_LEVEL) {
|
||||
if (skillLevel >= Taming.shockProofUnlockLevel) {
|
||||
ShockProofEventHandler eventHandler = new ShockProofEventHandler(event);
|
||||
|
||||
eventHandler.modifyEventDamage();
|
||||
|
@ -23,7 +23,7 @@ public class ThickFurEventHandler {
|
||||
|
||||
case ENTITY_ATTACK:
|
||||
case PROJECTILE:
|
||||
event.setDamage(event.getDamage() / Taming.THICK_FUR_MODIFIER);
|
||||
event.setDamage(event.getDamage() / Taming.thickFurModifier);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -351,7 +351,7 @@ public class Combat {
|
||||
((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;
|
||||
|
||||
|
@ -200,7 +200,7 @@ Skills:
|
||||
Swords:
|
||||
# Bleed_ChanceMax: Maximum chance of triggering bleeding
|
||||
# Bleed_MaxBonusLevel: On this level, the chance to cause Bleeding will be Bleed_ChanceMax
|
||||
Bleed_ChanceMax: 75
|
||||
Bleed_ChanceMax: 75.0
|
||||
Bleed_MaxBonusLevel: 750
|
||||
# These settings determine how long the Bleeding effect lasts
|
||||
Bleed_MaxTicks: 3
|
||||
@ -208,7 +208,7 @@ Skills:
|
||||
|
||||
# Counter_ChanceMax: Maximum chance of triggering a counter attack
|
||||
# Counter_MaxBonusLevel: On this level, the chance to Counter will be Counter_ChanceMax
|
||||
Counter_ChanceMax: 30
|
||||
Counter_ChanceMax: 30.0
|
||||
Counter_MaxBonusLevel: 600
|
||||
|
||||
# Counter_DamageModifier: Damaged caused by the damager will get divided by this modifier and dealt back to the damager
|
||||
|
@ -261,11 +261,11 @@ Swords.Combat.Counter.Hit=[[DARK_RED]]Hit with a counter-attack!
|
||||
Swords.Combat.Countered=[[GREEN]]**COUNTER-ATTACKED**
|
||||
Swords.Combat.SS.Struck=[[DARK_RED]]Struck by SERRATED STRIKES!
|
||||
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.3=25% DMG AoE, Bleed+ AoE
|
||||
Swords.Effect.3={0} DMG AoE, Bleed+ AoE
|
||||
Swords.Effect.4=Serrated Strikes Bleed+
|
||||
Swords.Effect.5=5 Tick Bleed
|
||||
Swords.Effect.5={0} Tick Bleed
|
||||
Swords.Effect.6=Bleed
|
||||
Swords.Effect.7=Apply a bleed DoT
|
||||
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.1=Wolves avoid danger
|
||||
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.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.7=+2 Damage
|
||||
Taming.Ability.Bonus.7=+{0} Damage
|
||||
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.1=LOCKED UNTIL {0}+ SKILL (THICK FUR)
|
||||
Taming.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (SHOCK PROOF)
|
||||
|
Loading…
Reference in New Issue
Block a user