diff --git a/src/com/projectkorra/ProjectKorra/ConfigManager.java b/src/com/projectkorra/ProjectKorra/ConfigManager.java index 944e06ac..e50ee58e 100644 --- a/src/com/projectkorra/ProjectKorra/ConfigManager.java +++ b/src/com/projectkorra/ProjectKorra/ConfigManager.java @@ -154,6 +154,7 @@ public class ConfigManager { config.addDefault("Abilities.Air.AirBurst.FallThreshold", 10); config.addDefault("Abilities.Air.AirBurst.PushFactor", 1.5); config.addDefault("Abilities.Air.AirBurst.ChargeTime", 1750); + config.addDefault("Abilities.Air.AirBurst.Damage", 0); config.addDefault("Abilities.Air.AirScooter.Enabled", true); config.addDefault("Abilities.Air.AirScooter.Description", "AirScooter is a fast means of transportation. To use, sprint, jump then click with " diff --git a/src/com/projectkorra/ProjectKorra/airbending/AirBlast.java b/src/com/projectkorra/ProjectKorra/airbending/AirBlast.java index ea086c0d..d8b8e113 100644 --- a/src/com/projectkorra/ProjectKorra/airbending/AirBlast.java +++ b/src/com/projectkorra/ProjectKorra/airbending/AirBlast.java @@ -9,6 +9,7 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -46,6 +47,7 @@ public class AirBlast { private double speedfactor; private double range = defaultrange; private double pushfactor = defaultpushfactor; + private double damage = 0; private boolean otherorigin = false; private int ticks = 0; @@ -260,8 +262,17 @@ public class AirBlast { entity.getWorld().playEffect(entity.getLocation(), Effect.EXTINGUISH, 0); entity.setFireTicks(0); Methods.breakBreathbendingHold(entity); + + if (damage > 0 && entity instanceof LivingEntity && !entity.equals(player) && !affectedentities.contains(entity)) { + Methods.damageEntity(player, entity, damage); + affectedentities.add(entity); + } } } + + public void setDamage(double dmg) { + this.damage = dmg; + } public static void progressAll() { for (int id : instances.keySet()) diff --git a/src/com/projectkorra/ProjectKorra/airbending/AirBurst.java b/src/com/projectkorra/ProjectKorra/airbending/AirBurst.java index 8fe17cb5..7251b232 100644 --- a/src/com/projectkorra/ProjectKorra/airbending/AirBurst.java +++ b/src/com/projectkorra/ProjectKorra/airbending/AirBurst.java @@ -22,6 +22,7 @@ public class AirBurst { private static double threshold = config.getDouble("Abilities.Air.AirBurst.FallThreshold"); private static double pushfactor = config.getDouble("Abilities.Air.AirBurst.PushFactor"); + private static double damage = config.getDouble("Abilities.Air.AirBurst.Damage"); private static double deltheta = 10; private static double delphi = 10; @@ -70,8 +71,9 @@ public class AirBurst { z = r * Math.cos(rtheta); Vector direction = new Vector(x, z, y); if (direction.angle(vector) <= angle) { - new AirBlast(location, direction.normalize(), player, + AirBlast blast = new AirBlast(location, direction.normalize(), player, pushfactor, this); + blast.setDamage(damage); } } } @@ -93,8 +95,9 @@ public class AirBurst { y = r * Math.sin(rphi) * Math.sin(rtheta); z = r * Math.cos(rtheta); Vector direction = new Vector(x, z, y); - new AirBlast(location, direction.normalize(), player, + AirBlast blast = new AirBlast(location, direction.normalize(), player, pushfactor, this); + blast.setDamage(damage); } } } @@ -131,8 +134,9 @@ public class AirBurst { y = r * Math.sin(rphi) * Math.sin(rtheta); z = r * Math.cos(rtheta); Vector direction = new Vector(x, z, y); - new AirBlast(location, direction.normalize(), player, + AirBlast blast = new AirBlast(location, direction.normalize(), player, pushfactor, new AirBurst()); + blast.setDamage(damage); } } }