Merge pull request #155 from FinnBueno/master

Cooldowns added to WaterWave and Immobilize
This commit is contained in:
OmniCypher 2015-06-28 15:22:58 -07:00
commit 88ae2ef113
3 changed files with 12 additions and 3 deletions

View file

@ -25,6 +25,7 @@ public class ChiComboManager
public static List<Entity> paralyzed = new ArrayList<Entity>();
public static HashMap<Entity, Location> paralyzedLocations = new HashMap<Entity, Location>();
public static long paralysisDuration = ProjectKorra.plugin.getConfig().getLong("Abilities.Chi.ChiCombo.ParalyzeDuration");
public static long cooldown = ProjectKorra.plugin.getConfig().getLong("Abilities.Chi.ChiCombo.Cooldown");
public ChiComboManager()
{
@ -47,7 +48,6 @@ public class ChiComboManager
if(instances.get(player).size() > 4)
instances.put(player, shiftList(instances.get(player)));
//ProjectKorra.log.info(instances.get(player).toString());
checkForValidCombo(player);
@ -98,8 +98,11 @@ public class ChiComboManager
&& combo.get(2) == ChiCombo.QuickStrike
&& combo.get(3) == ChiCombo.QuickStrike)
{
if(!GeneralMethods.getBendingPlayer(player.getName()).isOnCooldown("Immobilize")){
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("Immobilize", cooldown);
paralyzeTarget(player, paralysisDuration);
}
}
instances.remove(player);
return true;

View file

@ -504,6 +504,7 @@ public class ConfigManager {
config.addDefault("Abilities.Water.WaterSpout.Wave.ChargeTime", 1000);
config.addDefault("Abilities.Water.WaterSpout.Wave.FlightTime", 2000);
config.addDefault("Abilities.Water.WaterSpout.Wave.Speed", 1.2);
config.addDefault("Abilities.Water.WaterSpout.Wave.Cooldown", 2000);
config.addDefault("Abilities.Water.WaterCombo.Enabled", true);
config.addDefault("Abilities.Water.WaterCombo.IceWave.Damage", 3);
@ -889,6 +890,7 @@ public class ConfigManager {
config.addDefault("Abilities.Chi.SwiftKick.ChiBlockChance", 30);
config.addDefault("Abilities.Chi.ChiCombo.ParalyzeDuration", 10000);
config.addDefault("Abilities.Chi.ChiCombo.Cooldown", 20000);
config.addDefault("Storage.engine", "sqlite");

View file

@ -45,6 +45,8 @@ public class WaterWave {
"Abilities.Water.WaterSpout.Wave.ChargeTime");
public static long FLIGHT_TIME = ProjectKorra.plugin.getConfig().getLong(
"Abilities.Water.WaterSpout.Wave.FlightTime");
public static long COOLDOWN = ProjectKorra.plugin.getConfig().getLong(
"Abilities.Water.WaterSpout.Wave.Cooldown");
public static double WAVE_RADIUS = 1.5;
public static double ICE_WAVE_DAMAGE = ProjectKorra.plugin.getConfig().getDouble(
"Abilities.Water.WaterCombo.IceWave.Damage");
@ -65,12 +67,13 @@ public class WaterWave {
private double flightTime = FLIGHT_TIME;
private double waveRadius = WAVE_RADIUS;
private double damage = ICE_WAVE_DAMAGE;
private long cooldown = COOLDOWN;
private ConcurrentHashMap<Block, TempBlock> affectedBlocks = new ConcurrentHashMap<Block, TempBlock>();
private ArrayList<Entity> affectedEntities = new ArrayList<Entity>();
private ArrayList<BukkitRunnable> tasks = new ArrayList<BukkitRunnable>();
public WaterWave(Player player, AbilityType type) {
if (!ENABLED)
if (!ENABLED || GeneralMethods.getBendingPlayer(player.getName()).isOnCooldown("WaterSpout"))
return;
this.player = player;
@ -302,6 +305,7 @@ public class WaterWave {
public void remove() {
instances.remove(this);
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("WaterSpout", cooldown);
revertBlocks();
for (BukkitRunnable task : tasks)
task.cancel();