diff --git a/src/com/projectkorra/projectkorra/chiblocking/AcrobatStance.java b/src/com/projectkorra/projectkorra/chiblocking/AcrobatStance.java index 5facfa88..e9445c3e 100644 --- a/src/com/projectkorra/projectkorra/chiblocking/AcrobatStance.java +++ b/src/com/projectkorra/projectkorra/chiblocking/AcrobatStance.java @@ -15,6 +15,8 @@ public class AcrobatStance extends ChiAbility { @Attribute(Attribute.COOLDOWN) private long cooldown; + @Attribute(Attribute.DURATION) + private long duration; @Attribute(Attribute.SPEED) private int speed; @Attribute("Jump") @@ -30,6 +32,7 @@ public class AcrobatStance extends ChiAbility { return; } this.cooldown = getConfig().getLong("Abilities.Chi.AcrobatStance.Cooldown"); + this.duration = getConfig().getLong("Abilities.Chi.AcrobatStance.Duration"); this.speed = getConfig().getInt("Abilities.Chi.AcrobatStance.Speed") + 1; this.jump = getConfig().getInt("Abilities.Chi.AcrobatStance.Jump") + 1; this.chiBlockBoost = getConfig().getDouble("Abilities.Chi.AcrobatStance.ChiBlockBoost"); @@ -54,6 +57,9 @@ public class AcrobatStance extends ChiAbility { if (!this.bPlayer.canBendIgnoreBinds(this) || !this.bPlayer.hasElement(Element.CHI)) { this.remove(); return; + } else if (this.duration != 0 && System.currentTimeMillis() > this.getStartTime() + this.duration) { + remove(); + return; } if (!this.player.hasPotionEffect(PotionEffectType.SPEED)) { @@ -115,6 +121,14 @@ public class AcrobatStance extends ChiAbility { public void setJump(final int jump) { this.jump = jump; } + + public long getDuration() { + return this.duration; + } + + public void setDuration(final long duration) { + this.duration = duration; + } public double getChiBlockBoost() { return this.chiBlockBoost; diff --git a/src/com/projectkorra/projectkorra/chiblocking/WarriorStance.java b/src/com/projectkorra/projectkorra/chiblocking/WarriorStance.java index 4996d3c1..15c6c890 100644 --- a/src/com/projectkorra/projectkorra/chiblocking/WarriorStance.java +++ b/src/com/projectkorra/projectkorra/chiblocking/WarriorStance.java @@ -15,10 +15,13 @@ public class WarriorStance extends ChiAbility { @Attribute(Attribute.COOLDOWN) private long cooldown; + @Attribute(Attribute.DURATION) + private long duration; @Attribute("Strength") private int strength; @Attribute("Resistance") private int resistance; + public WarriorStance(final Player player) { super(player); @@ -26,6 +29,7 @@ public class WarriorStance extends ChiAbility { return; } this.cooldown = getConfig().getLong("Abilities.Chi.WarriorStance.Cooldown"); + this.duration = getConfig().getLong("Abilities.Chi.WarriorStance.Duration"); this.strength = getConfig().getInt("Abilities.Chi.WarriorStance.Strength") - 1; this.resistance = getConfig().getInt("Abilities.Chi.WarriorStance.Resistance"); @@ -48,6 +52,9 @@ public class WarriorStance extends ChiAbility { if (!this.bPlayer.canBendIgnoreBinds(this) || !this.bPlayer.hasElement(Element.CHI)) { this.remove(); return; + } else if (this.duration != 0 && System.currentTimeMillis() > this.getStartTime() + this.duration) { + remove(); + return; } if (!this.player.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)) { @@ -112,4 +119,12 @@ public class WarriorStance extends ChiAbility { this.resistance = resistance; } + public long getDuration() { + return this.duration; + } + + public void setDuration(final long duration) { + this.duration = duration; + } + } diff --git a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java index feffde3f..c296b3f4 100644 --- a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java +++ b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java @@ -1429,6 +1429,7 @@ public class ConfigManager { config.addDefault("Abilities.Chi.AcrobatStance.Enabled", true); config.addDefault("Abilities.Chi.AcrobatStance.Cooldown", 0); + config.addDefault("Abilities.Chi.AcrobatStance.Duration", 0); config.addDefault("Abilities.Chi.AcrobatStance.ChiBlockBoost", 3); config.addDefault("Abilities.Chi.AcrobatStance.Speed", 1); config.addDefault("Abilities.Chi.AcrobatStance.Jump", 1); @@ -1454,6 +1455,7 @@ public class ConfigManager { config.addDefault("Abilities.Chi.WarriorStance.Enabled", true); config.addDefault("Abilities.Chi.WarriorStance.Cooldown", 0); + config.addDefault("Abilities.Chi.WarriorStance.Duration", 0); config.addDefault("Abilities.Chi.WarriorStance.Strength", 1); config.addDefault("Abilities.Chi.WarriorStance.Resistance", -3);