mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-18 22:24:35 +00:00
Cooldowns
Cooldown on waterspout wave and on the chi combo immobilize. WaterSpout 2 seconds. (default) Immobilize 20 seconds. (default)
This commit is contained in:
parent
cdc9f7ad80
commit
3383b6d41c
3 changed files with 12 additions and 3 deletions
|
@ -25,6 +25,7 @@ public class ChiComboManager
|
||||||
public static List<Entity> paralyzed = new ArrayList<Entity>();
|
public static List<Entity> paralyzed = new ArrayList<Entity>();
|
||||||
public static HashMap<Entity, Location> paralyzedLocations = new HashMap<Entity, Location>();
|
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 paralysisDuration = ProjectKorra.plugin.getConfig().getLong("Abilities.Chi.ChiCombo.ParalyzeDuration");
|
||||||
|
public static long cooldown = ProjectKorra.plugin.getConfig().getLong("Abilities.Chi.ChiCombo.Cooldown");
|
||||||
|
|
||||||
public ChiComboManager()
|
public ChiComboManager()
|
||||||
{
|
{
|
||||||
|
@ -47,7 +48,6 @@ public class ChiComboManager
|
||||||
|
|
||||||
if(instances.get(player).size() > 4)
|
if(instances.get(player).size() > 4)
|
||||||
instances.put(player, shiftList(instances.get(player)));
|
instances.put(player, shiftList(instances.get(player)));
|
||||||
|
|
||||||
//ProjectKorra.log.info(instances.get(player).toString());
|
//ProjectKorra.log.info(instances.get(player).toString());
|
||||||
|
|
||||||
checkForValidCombo(player);
|
checkForValidCombo(player);
|
||||||
|
@ -98,7 +98,10 @@ public class ChiComboManager
|
||||||
&& combo.get(2) == ChiCombo.QuickStrike
|
&& combo.get(2) == ChiCombo.QuickStrike
|
||||||
&& combo.get(3) == ChiCombo.QuickStrike)
|
&& combo.get(3) == ChiCombo.QuickStrike)
|
||||||
{
|
{
|
||||||
paralyzeTarget(player, paralysisDuration);
|
if(!GeneralMethods.getBendingPlayer(player.getName()).isOnCooldown("Immobilize")){
|
||||||
|
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("Immobilize", cooldown);
|
||||||
|
paralyzeTarget(player, paralysisDuration);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
instances.remove(player);
|
instances.remove(player);
|
||||||
|
|
|
@ -504,6 +504,7 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Water.WaterSpout.Wave.ChargeTime", 1000);
|
config.addDefault("Abilities.Water.WaterSpout.Wave.ChargeTime", 1000);
|
||||||
config.addDefault("Abilities.Water.WaterSpout.Wave.FlightTime", 2000);
|
config.addDefault("Abilities.Water.WaterSpout.Wave.FlightTime", 2000);
|
||||||
config.addDefault("Abilities.Water.WaterSpout.Wave.Speed", 1.2);
|
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.Enabled", true);
|
||||||
config.addDefault("Abilities.Water.WaterCombo.IceWave.Damage", 3);
|
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.SwiftKick.ChiBlockChance", 30);
|
||||||
|
|
||||||
config.addDefault("Abilities.Chi.ChiCombo.ParalyzeDuration", 10000);
|
config.addDefault("Abilities.Chi.ChiCombo.ParalyzeDuration", 10000);
|
||||||
|
config.addDefault("Abilities.Chi.ChiCombo.Cooldown", 20000);
|
||||||
|
|
||||||
config.addDefault("Storage.engine", "sqlite");
|
config.addDefault("Storage.engine", "sqlite");
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,8 @@ public class WaterWave {
|
||||||
"Abilities.Water.WaterSpout.Wave.ChargeTime");
|
"Abilities.Water.WaterSpout.Wave.ChargeTime");
|
||||||
public static long FLIGHT_TIME = ProjectKorra.plugin.getConfig().getLong(
|
public static long FLIGHT_TIME = ProjectKorra.plugin.getConfig().getLong(
|
||||||
"Abilities.Water.WaterSpout.Wave.FlightTime");
|
"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 WAVE_RADIUS = 1.5;
|
||||||
public static double ICE_WAVE_DAMAGE = ProjectKorra.plugin.getConfig().getDouble(
|
public static double ICE_WAVE_DAMAGE = ProjectKorra.plugin.getConfig().getDouble(
|
||||||
"Abilities.Water.WaterCombo.IceWave.Damage");
|
"Abilities.Water.WaterCombo.IceWave.Damage");
|
||||||
|
@ -65,12 +67,13 @@ public class WaterWave {
|
||||||
private double flightTime = FLIGHT_TIME;
|
private double flightTime = FLIGHT_TIME;
|
||||||
private double waveRadius = WAVE_RADIUS;
|
private double waveRadius = WAVE_RADIUS;
|
||||||
private double damage = ICE_WAVE_DAMAGE;
|
private double damage = ICE_WAVE_DAMAGE;
|
||||||
|
private long cooldown = COOLDOWN;
|
||||||
private ConcurrentHashMap<Block, TempBlock> affectedBlocks = new ConcurrentHashMap<Block, TempBlock>();
|
private ConcurrentHashMap<Block, TempBlock> affectedBlocks = new ConcurrentHashMap<Block, TempBlock>();
|
||||||
private ArrayList<Entity> affectedEntities = new ArrayList<Entity>();
|
private ArrayList<Entity> affectedEntities = new ArrayList<Entity>();
|
||||||
private ArrayList<BukkitRunnable> tasks = new ArrayList<BukkitRunnable>();
|
private ArrayList<BukkitRunnable> tasks = new ArrayList<BukkitRunnable>();
|
||||||
|
|
||||||
public WaterWave(Player player, AbilityType type) {
|
public WaterWave(Player player, AbilityType type) {
|
||||||
if (!ENABLED)
|
if (!ENABLED || GeneralMethods.getBendingPlayer(player.getName()).isOnCooldown("WaterSpout"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.player = player;
|
this.player = player;
|
||||||
|
@ -302,6 +305,7 @@ public class WaterWave {
|
||||||
|
|
||||||
public void remove() {
|
public void remove() {
|
||||||
instances.remove(this);
|
instances.remove(this);
|
||||||
|
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("WaterSpout", cooldown);
|
||||||
revertBlocks();
|
revertBlocks();
|
||||||
for (BukkitRunnable task : tasks)
|
for (BukkitRunnable task : tasks)
|
||||||
task.cancel();
|
task.cancel();
|
||||||
|
|
Loading…
Reference in a new issue