Attribute implementation & various changes (#979)

## Additions
* Implements the Attribute annotation for all applicable fields in every ability class (some abilities have multiple classes)

## Fixes
* Fixes FireShield not dealing firetick (options weren't set as defaults in the config)

## Removals
* Removes all RPG references and the ProjectKorraRPG.jar from the libs folder in the project and as a maven dependency
* Removes all Items references and the ProjectKorraItems.jar from the libs folder in the project and as a maven dependency
* Removes all Spirits references and the ProjectKorraSpirits.jar from the libs folder in the project and as a maven dependency

## Misc. Changes
* Changes various config options and field names to be more self-explanatory
    > * In AirStream: `EntityHeight` and `EntityDuration` were changed to be `EntityCarry.Height` and `EntityCarry.Duration`  (also changed in AvatarState portion)
    > * In IceSpike: `SlowPower` was changed to `SlowPotency` (also in the Blast portion) and `Field.Push` was changed to `Field.Knockup`
    > * In WaterSpout.Wave: `FlightTimer` was changed to `FlightDuration`
    > * In Bloodbending: `ThrowFactor` was changed to `Knockback` and `HoldTime` was changed to `Duration`
    > * In HealingWaters: `Power` was changed to `PotionPotency` and `HealingDuration` was removed
    > * In Surge.Wave: `HorizontalPush` was changed to `Knockback` and `VerticalPush` was changed to `Knockup`
    > * In Torrent: `Push` was changed to `Knockback` and `MaxUpwardForce` was changed to `Knockup`
    > * In WaterArms: `Punch.PunchDamage` was changed to `Punch.Damage` and `Grab.HoldTime` was changed to `Grab.Duration` and `Spear.Sphere` was changed to `Spear.SphereRadius`
    > * In WaterManipulation: `Push` was changed to `Knockback`
    > * EarthSmash has been separated better into portions of `Flight`, `Grab`, and `Shoot`
    > * In EarthSmash: `RemoveTimer` was changed to `Duration`
    > * MetalClips has been separated better into portions of `Crush` and `Magnet`
    > * In EarthPillars: `Power` was changed to `Knockup`
    > * In Combustion: `Power` was changed to `ExplosivePower`
    > * In FireBlast: `Push` was changed to `Knockback`
    > * Added separate cooldown option for Charged FireBlast
* Changed some abilities constructor to allow Attribute system to work
This commit is contained in:
Simplicitee 2018-09-06 03:35:06 -04:00 committed by Christopher Martin
parent 19c5681a77
commit 016f48c415
96 changed files with 868 additions and 621 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

24
pom.xml
View file

@ -72,30 +72,6 @@
<scope>system</scope> <scope>system</scope>
<systemPath>${project.basedir}/lib/PreciousStones 10.6.1.jar</systemPath> <systemPath>${project.basedir}/lib/PreciousStones 10.6.1.jar</systemPath>
</dependency> </dependency>
<!-- PK RPG -->
<dependency>
<groupId>com.projectkorra</groupId>
<artifactId>rpg</artifactId>
<version>LATEST</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/ProjectKorraRPG.jar</systemPath>
</dependency>
<!-- PK ITEMS -->
<dependency>
<groupId>com.projectkorra</groupId>
<artifactId>items</artifactId>
<version>LATEST</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/ProjectKorraItems.jar</systemPath>
</dependency>
<!-- PK Spirits -->
<dependency>
<groupId>com.projectkorra</groupId>
<artifactId>spirits</artifactId>
<version>LATEST</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/ProjectKorraSpirits.jar</systemPath>
</dependency>
<!-- Residence --> <!-- Residence -->
<dependency> <dependency>
<groupId>com.bekvon.bukkit</groupId> <groupId>com.bekvon.bukkit</groupId>

View file

@ -18,7 +18,6 @@ import com.projectkorra.projectkorra.util.RevertChecker;
import com.projectkorra.projectkorra.util.TempArmor; import com.projectkorra.projectkorra.util.TempArmor;
import com.projectkorra.projectkorra.util.TempPotionEffect; import com.projectkorra.projectkorra.util.TempPotionEffect;
import com.projectkorra.projectkorra.waterbending.blood.Bloodbending; import com.projectkorra.projectkorra.waterbending.blood.Bloodbending;
import com.projectkorra.rpg.RPGMethods;
public class BendingManager implements Runnable { public class BendingManager implements Runnable {
@ -58,11 +57,6 @@ public class BendingManager implements Runnable {
this.times.put(world, false); this.times.put(world, false);
} }
} else { } else {
if (GeneralMethods.hasRPG()) {
if (RPGMethods.isFullMoon(world) || RPGMethods.isLunarEclipse(world) || RPGMethods.isSolarEclipse(world) || RPGMethods.isSozinsComet(world)) {
continue;
}
}
if (this.times.get(world) && !ElementalAbility.isDay(world)) { if (this.times.get(world) && !ElementalAbility.isDay(world)) {
// The hashmap says it is day, but it is not. // The hashmap says it is day, but it is not.
this.times.put(world, false); // Sets time to night. this.times.put(world, false); // Sets time to night.

View file

@ -278,10 +278,6 @@ public class BendingPlayer {
return false; return false;
} else if (GeneralMethods.isRegionProtectedFromBuild(this.player, ability.getName(), playerLoc)) { } else if (GeneralMethods.isRegionProtectedFromBuild(this.player, ability.getName(), playerLoc)) {
return false; return false;
} else if (ability instanceof FireAbility && ElementalAbility.isSolarEclipse(this.player.getWorld())) {
return false;
} else if (ability instanceof WaterAbility && ElementalAbility.isLunarEclipse(this.player.getWorld())) {
return false;
} }
return true; return true;

View file

@ -135,7 +135,6 @@ import com.projectkorra.projectkorra.earthbending.passive.FerroControl;
import com.projectkorra.projectkorra.event.EntityBendingDeathEvent; import com.projectkorra.projectkorra.event.EntityBendingDeathEvent;
import com.projectkorra.projectkorra.event.HorizontalVelocityChangeEvent; import com.projectkorra.projectkorra.event.HorizontalVelocityChangeEvent;
import com.projectkorra.projectkorra.event.PlayerChangeElementEvent; import com.projectkorra.projectkorra.event.PlayerChangeElementEvent;
import com.projectkorra.projectkorra.event.PlayerChangeElementEvent.Result;
import com.projectkorra.projectkorra.event.PlayerJumpEvent; import com.projectkorra.projectkorra.event.PlayerJumpEvent;
import com.projectkorra.projectkorra.firebending.Blaze; import com.projectkorra.projectkorra.firebending.Blaze;
import com.projectkorra.projectkorra.firebending.BlazeArc; import com.projectkorra.projectkorra.firebending.BlazeArc;
@ -184,7 +183,6 @@ import com.projectkorra.projectkorra.waterbending.ice.PhaseChange.PhaseChangeTyp
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms; import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms;
import com.projectkorra.projectkorra.waterbending.passive.FastSwim; import com.projectkorra.projectkorra.waterbending.passive.FastSwim;
import com.projectkorra.projectkorra.waterbending.passive.HydroSink; import com.projectkorra.projectkorra.waterbending.passive.HydroSink;
import com.projectkorra.rpg.RPGMethods;
public class PKListener implements Listener { public class PKListener implements Listener {
ProjectKorra plugin; ProjectKorra plugin;
@ -406,12 +404,6 @@ public class PKListener implements Listener {
player.setDisplayName(player.getName()); player.setDisplayName(player.getName());
player.setDisplayName(prefix + ChatColor.RESET + player.getDisplayName()); player.setDisplayName(prefix + ChatColor.RESET + player.getDisplayName());
} }
if (event.getResult() == Result.REMOVE) {
if (GeneralMethods.hasRPG()) {
RPGMethods.revokeAvatar(player.getUniqueId());
}
}
} }
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)

View file

@ -641,7 +641,7 @@ public abstract class CoreAbility implements Ability {
if (coreAbil instanceof PassiveAbility) { if (coreAbil instanceof PassiveAbility) {
coreAbil.setHiddenAbility(true); coreAbil.setHiddenAbility(true);
PassiveManager.getPassives().put(name, coreAbil); PassiveManager.getPassives().put(name, coreAbil);
if (!PassiveManager.getPassiveClasses().containsKey(coreAbil)) { if (!PassiveManager.getPassiveClasses().containsKey((PassiveAbility) coreAbil)) {
PassiveManager.getPassiveClasses().put((PassiveAbility) coreAbil, coreAbil.getClass()); PassiveManager.getPassiveClasses().put((PassiveAbility) coreAbil, coreAbil.getClass());
} }
PassiveManager.getPassiveClasses().put((PassiveAbility) coreAbil, coreAbil.getClass()); PassiveManager.getPassiveClasses().put((PassiveAbility) coreAbil, coreAbil.getClass());
@ -710,7 +710,7 @@ public abstract class CoreAbility implements Ability {
if (coreAbil instanceof PassiveAbility) { if (coreAbil instanceof PassiveAbility) {
coreAbil.setHiddenAbility(true); coreAbil.setHiddenAbility(true);
PassiveManager.getPassives().put(name, coreAbil); PassiveManager.getPassives().put(name, coreAbil);
if (!PassiveManager.getPassiveClasses().containsKey(coreAbil)) { if (!PassiveManager.getPassiveClasses().containsKey((PassiveAbility) coreAbil)) {
PassiveManager.getPassiveClasses().put((PassiveAbility) coreAbil, coreAbil.getClass()); PassiveManager.getPassiveClasses().put((PassiveAbility) coreAbil, coreAbil.getClass());
} }
} }
@ -983,7 +983,6 @@ public abstract class CoreAbility implements Ability {
} }
private void modifyAttributes() { private void modifyAttributes() {
System.out.println(attributeModifiers);
for (String attribute : attributeModifiers.keySet()) { for (String attribute : attributeModifiers.keySet()) {
Field field = ATTRIBUTE_FIELDS.get(getClass()).get(attribute); Field field = ATTRIBUTE_FIELDS.get(getClass()).get(attribute);
boolean accessibility = field.isAccessible(); boolean accessibility = field.isAccessible();

View file

@ -14,7 +14,6 @@ import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.rpg.event.EventManager;
/** /**
* ElementalAbility is used to hold methods that should be accessible by every * ElementalAbility is used to hold methods that should be accessible by every
@ -73,19 +72,10 @@ public abstract class ElementalAbility extends CoreAbility {
} }
public static boolean isFullMoon(final World world) { public static boolean isFullMoon(final World world) {
if (GeneralMethods.hasRPG()) { final double days = Math.ceil(world.getFullTime() / 24000) + 1;
final String event = EventManager.marker.get(world); final double phase = days % 8;
return event != null && event.equalsIgnoreCase("FullMoon");
} else {
final long days = world.getFullTime() / 24000;
final long phase = days % 8;
if (phase == 0) { return phase == 0;
return true;
}
return false;
}
} }
public static boolean isIce(final Block block) { public static boolean isIce(final Block block) {
@ -112,24 +102,6 @@ public abstract class ElementalAbility extends CoreAbility {
return getConfig().getStringList("Properties.Water.SnowBlocks").contains(material.toString()); return getConfig().getStringList("Properties.Water.SnowBlocks").contains(material.toString());
} }
public static boolean isLunarEclipse(final World world) {
if (world == null || !GeneralMethods.hasRPG()) {
return false;
}
final String event = EventManager.marker.get(world);
return event != null && event.equalsIgnoreCase("LunarEclipse");
}
public static boolean isSolarEclipse(final World world) {
if (world == null || !GeneralMethods.hasRPG() || !EventManager.marker.containsKey(world)) {
return false;
}
final String event = EventManager.marker.get(world);
return event != null && event.equalsIgnoreCase("SolarEclipse");
}
public static boolean isMeltable(final Block block) { public static boolean isMeltable(final Block block) {
if (block.getType() == Material.ICE || block.getType() == Material.SNOW) { if (block.getType() == Material.ICE || block.getType() == Material.SNOW) {
return true; return true;
@ -214,15 +186,6 @@ public abstract class ElementalAbility extends CoreAbility {
return getConfig().getStringList("Properties.Earth.SandBlocks").contains(material.toString()); return getConfig().getStringList("Properties.Earth.SandBlocks").contains(material.toString());
} }
public static boolean isSozinsComet(final World world) {
if (world == null || !GeneralMethods.hasRPG()) {
return false;
}
final String event = EventManager.marker.get(world);
return event != null && event.equalsIgnoreCase("SozinsComet");
}
public static boolean isTransparent(final Player player, final Block block) { public static boolean isTransparent(final Player player, final Block block) {
return isTransparent(player, null, block); return isTransparent(player, null, block);
} }

View file

@ -26,7 +26,6 @@ import com.projectkorra.projectkorra.firebending.BlazeArc;
import com.projectkorra.projectkorra.util.Information; import com.projectkorra.projectkorra.util.Information;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.ParticleEffect.ParticleData; import com.projectkorra.projectkorra.util.ParticleEffect.ParticleData;
import com.projectkorra.rpg.RPGMethods;
public abstract class FireAbility extends ElementalAbility { public abstract class FireAbility extends ElementalAbility {
@ -61,10 +60,6 @@ public abstract class FireAbility extends ElementalAbility {
} }
} }
public double getDayFactor(final double value) {
return this.player != null ? getDayFactor(value, this.player.getWorld()) : 1;
}
/** /**
* Returns if fire is allowed to completely replace blocks or if it should * Returns if fire is allowed to completely replace blocks or if it should
* place a temp fire block. * place a temp fire block.
@ -95,6 +90,10 @@ public abstract class FireAbility extends ElementalAbility {
loc.getBlock().setType(Material.FIRE); loc.getBlock().setType(Material.FIRE);
TEMP_FIRE.put(loc, info); TEMP_FIRE.put(loc, info);
} }
public double getDayFactor(final double value) {
return this.player != null ? value * getDayFactor() : 1;
}
public static double getDayFactor() { public static double getDayFactor() {
return getConfig().getDouble("Properties.Fire.DayFactor"); return getConfig().getDouble("Properties.Fire.DayFactor");
@ -113,17 +112,7 @@ public abstract class FireAbility extends ElementalAbility {
*/ */
public static double getDayFactor(final double value, final World world) { public static double getDayFactor(final double value, final World world) {
if (isDay(world)) { if (isDay(world)) {
if (GeneralMethods.hasRPG()) { return value * getDayFactor();
if (isSozinsComet(world)) {
return RPGMethods.getFactor("SozinsComet") * value;
} else if (isLunarEclipse(world)) {
return RPGMethods.getFactor("SolarEclipse") * value;
} else {
return value * getDayFactor();
}
} else {
return value * getDayFactor();
}
} }
return value; return value;
} }

View file

@ -25,7 +25,6 @@ import com.projectkorra.projectkorra.waterbending.SurgeWave;
import com.projectkorra.projectkorra.waterbending.WaterSpout; import com.projectkorra.projectkorra.waterbending.WaterSpout;
import com.projectkorra.projectkorra.waterbending.ice.PhaseChange; import com.projectkorra.projectkorra.waterbending.ice.PhaseChange;
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms; import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms;
import com.projectkorra.rpg.RPGMethods;
public abstract class WaterAbility extends ElementalAbility { public abstract class WaterAbility extends ElementalAbility {
@ -50,17 +49,6 @@ public abstract class WaterAbility extends ElementalAbility {
return getIceSourceBlock(this.player, range); return getIceSourceBlock(this.player, range);
} }
public double getNightFactor() {
if (this.getLocation() != null) {
return getNightFactor(this.getLocation().getWorld());
}
return this.player != null ? getNightFactor(this.player.getLocation().getWorld()) : 1;
}
public double getNightFactor(final double value) {
return this.player != null ? getNightFactor(value, this.player.getWorld()) : value;
}
public Block getPlantSourceBlock(final double range) { public Block getPlantSourceBlock(final double range) {
return this.getPlantSourceBlock(range, false); return this.getPlantSourceBlock(range, false);
} }
@ -87,6 +75,10 @@ public abstract class WaterAbility extends ElementalAbility {
ParticleEffect.BLOCK_CRACK.display(particleData, 1F, 1F, 1F, 0.1F, 10, collision.getLocationFirst(), 50); ParticleEffect.BLOCK_CRACK.display(particleData, 1F, 1F, 1F, 0.1F, 10, collision.getLocationFirst(), 50);
} }
} }
public double getNightFactor(final double value) {
return this.player != null ? value * getNightFactor() : 1;
}
public static boolean isBendableWaterTempBlock(final Block block) { // TODO: Will need to be done for earth as well. public static boolean isBendableWaterTempBlock(final Block block) { // TODO: Will need to be done for earth as well.
return isBendableWaterTempBlock(TempBlock.get(block)); return isBendableWaterTempBlock(TempBlock.get(block));
@ -153,27 +145,17 @@ public abstract class WaterAbility extends ElementalAbility {
} }
return null; return null;
} }
public static double getNightFactor() {
return getConfig().getDouble("Properties.Water.NightFactor");
}
public static double getNightFactor(final double value, final World world) { public static double getNightFactor(final double value, final World world) {
if (isNight(world)) { if (isNight(world)) {
if (GeneralMethods.hasRPG()) { return value * getNightFactor();
if (isLunarEclipse(world)) {
return RPGMethods.getFactor("LunarEclipse") * value;
} else if (isFullMoon(world)) {
return RPGMethods.getFactor("FullMoon") * value;
} else {
return getConfig().getDouble("Properties.Water.NightFactor") * value;
}
} else {
if (isFullMoon(world)) {
return getConfig().getDouble("Properties.Water.FullMoonFactor") * value;
} else {
return getConfig().getDouble("Properties.Water.NightFactor") * value;
}
}
} else {
return value;
} }
return value;
} }
public static double getNightFactor(final World world) { public static double getNightFactor(final World world) {

View file

@ -51,9 +51,9 @@ public class AirBlast extends AirAbility {
private double speedFactor; private double speedFactor;
@Attribute(Attribute.RANGE) @Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.POWER) @Attribute(Attribute.KNOCKBACK)
private double pushFactor; private double pushFactor;
@Attribute(Attribute.POWER) @Attribute(Attribute.KNOCKBACK + "Others")
private double pushFactorForOthers; private double pushFactorForOthers;
@Attribute(Attribute.DAMAGE) @Attribute(Attribute.DAMAGE)
private double damage; private double damage;

View file

@ -21,9 +21,10 @@ public class AirBurst extends AirAbility {
private float playerFallDistance; private float playerFallDistance;
@Attribute(Attribute.CHARGE_DURATION) @Attribute(Attribute.CHARGE_DURATION)
private long chargeTime; private long chargeTime;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private double fallThreshold; private double fallThreshold;
@Attribute(Attribute.POWER) @Attribute(Attribute.KNOCKBACK)
private double pushFactor; private double pushFactor;
@Attribute(Attribute.DAMAGE) @Attribute(Attribute.DAMAGE)
private double damage; private double damage;

View file

@ -24,7 +24,9 @@ public class AirScooter extends AirAbility {
private double radius; private double radius;
@Attribute(Attribute.COOLDOWN) @Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
@Attribute(Attribute.HEIGHT)
private double maxHeightFromGround; private double maxHeightFromGround;
private Block floorblock; private Block floorblock;
private Random random; private Random random;

View file

@ -22,15 +22,18 @@ import com.projectkorra.projectkorra.command.Commands;
public class AirShield extends AirAbility { public class AirShield extends AirAbility {
private boolean isToggledByAvatarState; private boolean isToggledByAvatarState;
@Attribute(Attribute.RADIUS) @Attribute("Max" + Attribute.RADIUS)
private double maxRadius; private double maxRadius;
@Attribute(Attribute.RADIUS) @Attribute("Initial" + Attribute.RADIUS)
private double initialRadius;
private double radius; private double radius;
@Attribute(Attribute.SPEED) @Attribute(Attribute.SPEED)
private double speed; private double speed;
private int streams; private int streams;
private int particles; private int particles;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
private Random random; private Random random;
private HashMap<Integer, Integer> angles; private HashMap<Integer, Integer> angles;
@ -38,9 +41,10 @@ public class AirShield extends AirAbility {
public AirShield(final Player player) { public AirShield(final Player player) {
super(player); super(player);
this.maxRadius = getConfig().getDouble("Abilities.Air.AirShield.Radius"); this.maxRadius = getConfig().getDouble("Abilities.Air.AirShield.MaxRadius");
this.initialRadius = getConfig().getDouble("Abilities.Air.AirShield.InitialRadius");
this.isToggledByAvatarState = getConfig().getBoolean("Abilities.Avatar.AvatarState.Air.AirShield.IsAvatarStateToggle"); this.isToggledByAvatarState = getConfig().getBoolean("Abilities.Avatar.AvatarState.Air.AirShield.IsAvatarStateToggle");
this.radius = this.maxRadius; this.radius = initialRadius;
this.cooldown = getConfig().getLong("Abilities.Air.AirShield.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Air.AirShield.Cooldown");
this.duration = getConfig().getLong("Abilities.Air.AirShield.Duration"); this.duration = getConfig().getLong("Abilities.Air.AirShield.Duration");
this.speed = getConfig().getDouble("Abilities.Air.AirShield.Speed"); this.speed = getConfig().getDouble("Abilities.Air.AirShield.Speed");

View file

@ -21,6 +21,7 @@ public class AirSpout extends AirAbility {
private int angle; private int angle;
private long animTime; private long animTime;
private long interval; private long interval;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
@Attribute(Attribute.COOLDOWN) @Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;

View file

@ -45,7 +45,7 @@ public class AirSuction extends AirAbility {
private double range; private double range;
@Attribute(Attribute.RADIUS) @Attribute(Attribute.RADIUS)
private double radius; private double radius;
@Attribute(Attribute.POWER) @Attribute(Attribute.KNOCKBACK)
private double pushFactor; private double pushFactor;
private Random random; private Random random;
private Location location; private Location location;

View file

@ -33,16 +33,18 @@ public class AirSwipe extends AirAbility {
private static final int MAX_AFFECTABLE_ENTITIES = 10; private static final int MAX_AFFECTABLE_ENTITIES = 10;
private boolean charging; private boolean charging;
@Attribute("Arc")
private int arc; private int arc;
private int particles; private int particles;
private int stepSize; @Attribute("ArcIncrement")
private int arcIncrement;
@Attribute(Attribute.CHARGE_DURATION) @Attribute(Attribute.CHARGE_DURATION)
private long maxChargeTime; private long maxChargeTime;
@Attribute(Attribute.COOLDOWN) @Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DAMAGE) @Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.POWER) @Attribute(Attribute.KNOCKBACK)
private double pushFactor; private double pushFactor;
@Attribute(Attribute.SPEED) @Attribute(Attribute.SPEED)
private double speed; private double speed;
@ -77,7 +79,7 @@ public class AirSwipe extends AirAbility {
this.origin = player.getEyeLocation(); this.origin = player.getEyeLocation();
this.particles = getConfig().getInt("Abilities.Air.AirSwipe.Particles"); this.particles = getConfig().getInt("Abilities.Air.AirSwipe.Particles");
this.arc = getConfig().getInt("Abilities.Air.AirSwipe.Arc"); this.arc = getConfig().getInt("Abilities.Air.AirSwipe.Arc");
this.stepSize = getConfig().getInt("Abilities.Air.AirSwipe.StepSize"); this.arcIncrement = getConfig().getInt("Abilities.Air.AirSwipe.StepSize");
this.maxChargeTime = getConfig().getLong("Abilities.Air.AirSwipe.MaxChargeTime"); this.maxChargeTime = getConfig().getLong("Abilities.Air.AirSwipe.MaxChargeTime");
this.cooldown = getConfig().getLong("Abilities.Air.AirSwipe.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Air.AirSwipe.Cooldown");
this.damage = getConfig().getDouble("Abilities.Air.AirSwipe.Damage"); this.damage = getConfig().getDouble("Abilities.Air.AirSwipe.Damage");
@ -239,7 +241,7 @@ public class AirSwipe extends AirAbility {
private void launch() { private void launch() {
this.bPlayer.addCooldown("AirSwipe", this.cooldown); this.bPlayer.addCooldown("AirSwipe", this.cooldown);
this.origin = this.player.getEyeLocation(); this.origin = this.player.getEyeLocation();
for (double i = -this.arc; i <= this.arc; i += this.stepSize) { for (double i = -this.arc; i <= this.arc; i += this.arcIncrement) {
final double angle = Math.toRadians(i); final double angle = Math.toRadians(i);
final Vector direction = this.player.getEyeLocation().getDirection().clone(); final Vector direction = this.player.getEyeLocation().getDirection().clone();
@ -443,12 +445,12 @@ public class AirSwipe extends AirAbility {
this.cooldown = cooldown; this.cooldown = cooldown;
} }
public int getStepSize() { public int getArcIncrement() {
return this.stepSize; return this.arcIncrement;
} }
public void setStepSize(final int stepSize) { public void setArcIncrement(final int arcIncrement) {
this.stepSize = stepSize; this.arcIncrement = arcIncrement;
} }
} }

View file

@ -102,7 +102,6 @@ public class Suffocate extends AirAbility {
this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Air.Suffocate.ChargeTime"); this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Air.Suffocate.ChargeTime");
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.Suffocate.Damage"); this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.Suffocate.Damage");
this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.Suffocate.Range"); this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.Suffocate.Range");
} }
if (this.particleCount < 1) { if (this.particleCount < 1) {

View file

@ -18,15 +18,17 @@ import com.projectkorra.projectkorra.command.Commands;
public class Tornado extends AirAbility { public class Tornado extends AirAbility {
private final long cooldown; @Attribute(Attribute.COOLDOWN)
private final long duration; private long cooldown;
@Attribute(Attribute.DURATION)
private long duration;
private int numberOfStreams; private int numberOfStreams;
private int particleCount; private int particleCount;
@Attribute(Attribute.SPEED) @Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute(Attribute.HEIGHT) @Attribute(Attribute.HEIGHT)
private double maxHeight; private double maxHeight;
@Attribute(Attribute.POWER) @Attribute(Attribute.KNOCKBACK)
private double playerPushFactor; private double playerPushFactor;
@Attribute(Attribute.RADIUS) @Attribute(Attribute.RADIUS)
private double radius; private double radius;

View file

@ -20,13 +20,17 @@ import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
public class AirStream extends AirAbility implements ComboAbility { public class AirStream extends AirAbility implements ComboAbility {
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long time; private long time;
@Attribute(Attribute.SPEED) @Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute(Attribute.RANGE) @Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute("EntityCarry" + Attribute.HEIGHT)
private double airStreamMaxEntityHeight; private double airStreamMaxEntityHeight;
@Attribute("EntityCarry" + Attribute.DURATION)
private double airStreamEntityCarryDuration; private double airStreamEntityCarryDuration;
private Location origin; private Location origin;
private Location currentLoc; private Location currentLoc;
@ -54,14 +58,14 @@ public class AirStream extends AirAbility implements ComboAbility {
this.range = getConfig().getDouble("Abilities.Air.AirStream.Range"); this.range = getConfig().getDouble("Abilities.Air.AirStream.Range");
this.speed = getConfig().getDouble("Abilities.Air.AirStream.Speed"); this.speed = getConfig().getDouble("Abilities.Air.AirStream.Speed");
this.cooldown = getConfig().getLong("Abilities.Air.AirStream.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Air.AirStream.Cooldown");
this.airStreamMaxEntityHeight = getConfig().getDouble("Abilities.Air.AirStream.EntityHeight"); this.airStreamMaxEntityHeight = getConfig().getDouble("Abilities.Air.AirStream.EntityCarry.Height");
this.airStreamEntityCarryDuration = getConfig().getLong("Abilities.Air.AirStream.EntityDuration"); this.airStreamEntityCarryDuration = getConfig().getLong("Abilities.Air.AirStream.EntityCarry.Duration");
if (this.bPlayer.isAvatarState()) { if (this.bPlayer.isAvatarState()) {
this.cooldown = 0; this.cooldown = 0;
this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirStream.Range"); this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirStream.Range");
this.airStreamMaxEntityHeight = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirStream.EntityHeight"); this.airStreamMaxEntityHeight = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirStream.EntityCarry.Height");
this.airStreamEntityCarryDuration = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirStream.EntityDuration"); this.airStreamEntityCarryDuration = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirStream.EntityCarry.Duration");
} }
this.bPlayer.addCooldown(this); this.bPlayer.addCooldown(this);

View file

@ -24,6 +24,7 @@ import com.projectkorra.projectkorra.util.DamageHandler;
public class AirSweep extends AirAbility implements ComboAbility { public class AirSweep extends AirAbility implements ComboAbility {
private int progressCounter; private int progressCounter;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DAMAGE) @Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@ -31,7 +32,7 @@ public class AirSweep extends AirAbility implements ComboAbility {
private double speed; private double speed;
@Attribute(Attribute.RANGE) @Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.POWER) @Attribute(Attribute.KNOCKBACK)
private double knockback; private double knockback;
private Location origin; private Location origin;
private Location currentLoc; private Location currentLoc;

View file

@ -22,6 +22,7 @@ public class Twister extends AirAbility implements ComboAbility {
TWISTER_MOVING, TWISTER_STATIONARY TWISTER_MOVING, TWISTER_STATIONARY
} }
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long time; private long time;
@Attribute(Attribute.DAMAGE) @Attribute(Attribute.DAMAGE)

View file

@ -26,6 +26,7 @@ import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager.MultiAbilityInfoSub; import com.projectkorra.projectkorra.ability.util.MultiAbilityManager.MultiAbilityInfoSub;
import com.projectkorra.projectkorra.airbending.AirScooter; import com.projectkorra.projectkorra.airbending.AirScooter;
import com.projectkorra.projectkorra.airbending.AirSpout; import com.projectkorra.projectkorra.airbending.AirSpout;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.firebending.FireJet; import com.projectkorra.projectkorra.firebending.FireJet;
import com.projectkorra.projectkorra.util.ActionBar; import com.projectkorra.projectkorra.util.ActionBar;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
@ -46,10 +47,18 @@ public class FlightMultiAbility extends FlightAbility implements MultiAbility {
SOAR, GLIDE, LEVITATE, ENDING; SOAR, GLIDE, LEVITATE, ENDING;
} }
public double speed = 1, baseSpeed, slowSpeed, fastSpeed, multiplier; private double speed;
public FlightMode mode = FlightMode.SOAR; private double slowSpeed;
public long prevCheck = 0, duration; private double fastSpeed;
public Vector prevDir; private double multiplier;
@Attribute(Attribute.SPEED)
private double baseSpeed;
private FlightMode mode = FlightMode.SOAR;
@Attribute(Attribute.DURATION)
private long duration;
@Attribute(Attribute.COOLDOWN)
private long cooldown;
private Vector prevDir;
public FlightMultiAbility(final Player player) { public FlightMultiAbility(final Player player) {
super(player); super(player);
@ -109,7 +118,10 @@ public class FlightMultiAbility extends FlightAbility implements MultiAbility {
flying.add(player.getUniqueId()); flying.add(player.getUniqueId());
this.prevDir = player.getEyeLocation().getDirection().clone(); this.prevDir = player.getEyeLocation().getDirection().clone();
this.duration = getConfig().getLong("Abilities.Air.Flight.Duration"); this.duration = getConfig().getLong("Abilities.Air.Flight.Duration");
this.cooldown = getConfig().getLong("Abilities.Air.Flight.Cooldown");
this.baseSpeed = getConfig().getDouble("Abilities.Air.Flight.BaseSpeed"); this.baseSpeed = getConfig().getDouble("Abilities.Air.Flight.BaseSpeed");
this.speed = 1;
this.slowSpeed = this.baseSpeed / 2; this.slowSpeed = this.baseSpeed / 2;
this.fastSpeed = this.baseSpeed * 2; this.fastSpeed = this.baseSpeed * 2;
this.multiplier = this.baseSpeed; this.multiplier = this.baseSpeed;
@ -118,7 +130,7 @@ public class FlightMultiAbility extends FlightAbility implements MultiAbility {
@Override @Override
public long getCooldown() { public long getCooldown() {
return getConfig().getLong("Abilities.Air.Flight.Cooldown"); return cooldown;
} }
@Override @Override
@ -209,11 +221,7 @@ public class FlightMultiAbility extends FlightAbility implements MultiAbility {
} }
this.prevDir = this.player.getEyeLocation().getDirection().clone(); this.prevDir = this.player.getEyeLocation().getDirection().clone();
}
this.particles();
if (this.speed > this.baseSpeed) {
for (final Entity e : GeneralMethods.getEntitiesAroundPoint(this.player.getLocation(), this.speed)) { for (final Entity e : GeneralMethods.getEntitiesAroundPoint(this.player.getLocation(), this.speed)) {
if (e instanceof LivingEntity && e.getEntityId() != this.player.getEntityId() && !this.player.getPassengers().contains(e)) { if (e instanceof LivingEntity && e.getEntityId() != this.player.getEntityId() && !this.player.getPassengers().contains(e)) {
if (!GeneralMethods.isRegionProtectedFromBuild(this.player, e.getLocation())) { if (!GeneralMethods.isRegionProtectedFromBuild(this.player, e.getLocation())) {
@ -225,6 +233,7 @@ public class FlightMultiAbility extends FlightAbility implements MultiAbility {
} }
} }
this.particles();
this.player.setVelocity(this.player.getEyeLocation().getDirection().clone().multiply(this.multiplier)); this.player.setVelocity(this.player.getEyeLocation().getDirection().clone().multiply(this.multiplier));
} else if (this.mode == FlightMode.GLIDE) { } else if (this.mode == FlightMode.GLIDE) {
this.player.setAllowFlight(false); this.player.setAllowFlight(false);

View file

@ -9,13 +9,16 @@ import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.ChiAbility; import com.projectkorra.projectkorra.ability.ChiAbility;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.PassiveAbility; import com.projectkorra.projectkorra.ability.PassiveAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.chiblocking.passive.ChiAgility; import com.projectkorra.projectkorra.chiblocking.passive.ChiAgility;
import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.configuration.ConfigManager;
public class AirAgility extends AirAbility implements PassiveAbility { public class AirAgility extends AirAbility implements PassiveAbility {
// Configurable variables. // Configurable variables.
@Attribute("Jump")
private int jumpPower; private int jumpPower;
@Attribute(Attribute.SPEED)
private int speedPower; private int speedPower;
// Instance related variables. // Instance related variables.

View file

@ -6,7 +6,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(value = { ElementType.FIELD }) @Target(ElementType.FIELD)
public @interface Attribute { public @interface Attribute {
public String value(); public String value();
@ -19,8 +19,9 @@ public @interface Attribute {
public static final String DURATION = "Duration"; public static final String DURATION = "Duration";
public static final String RADIUS = "Radius"; public static final String RADIUS = "Radius";
public static final String CHARGE_DURATION = "ChargeTime"; public static final String CHARGE_DURATION = "ChargeTime";
public static final String POWER = "Power";
public static final String WIDTH = "Width"; public static final String WIDTH = "Width";
public static final String HEIGHT = "Height"; public static final String HEIGHT = "Height";
public static final String KNOCKBACK = "Knockback";
public static final String KNOCKUP = "Knockup";
public static final String FIRE_TICK = "FireTicks";
} }

View file

@ -9,13 +9,19 @@ import org.bukkit.potion.PotionEffectType;
import com.projectkorra.projectkorra.Element; import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.ChiAbility; import com.projectkorra.projectkorra.ability.ChiAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
public class AcrobatStance extends ChiAbility { public class AcrobatStance extends ChiAbility {
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.SPEED)
private int speed; private int speed;
@Attribute("Jump")
private int jump; private int jump;
@Attribute("ChiBlockBoost")
private double chiBlockBoost; private double chiBlockBoost;
@Attribute("ParalyzeDodgeBoost")
private double paralyzeDodgeBoost; private double paralyzeDodgeBoost;
public AcrobatStance(final Player player) { public AcrobatStance(final Player player) {

View file

@ -19,6 +19,8 @@ public class Paralyze extends ChiAbility {
@Attribute(Attribute.COOLDOWN) @Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DURATION)
private long duration;
private Entity target; private Entity target;
public Paralyze(final Player sourceplayer, final Entity targetentity) { public Paralyze(final Player sourceplayer, final Entity targetentity) {
@ -28,6 +30,7 @@ public class Paralyze extends ChiAbility {
} }
this.target = targetentity; this.target = targetentity;
this.cooldown = getConfig().getLong("Abilities.Chi.Paralyze.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Chi.Paralyze.Cooldown");
this.duration = getConfig().getLong("Abilities.Chi.Paralyze.Duration");
this.start(); this.start();
} }
@ -46,7 +49,7 @@ public class Paralyze extends ChiAbility {
this.remove(); this.remove();
} }
private static void paralyze(final Entity entity) { private void paralyze(final Entity entity) {
if (entity instanceof Creature) { if (entity instanceof Creature) {
((Creature) entity).setTarget(null); ((Creature) entity).setTarget(null);
} }
@ -57,7 +60,7 @@ public class Paralyze extends ChiAbility {
} }
} }
final MovementHandler mh = new MovementHandler((LivingEntity) entity, CoreAbility.getAbility(Paralyze.class)); final MovementHandler mh = new MovementHandler((LivingEntity) entity, CoreAbility.getAbility(Paralyze.class));
mh.stopWithDuration(getDuration() / 1000 * 20, Element.CHI.getColor() + "* Paralyzed *"); mh.stopWithDuration(duration / 1000 * 20, Element.CHI.getColor() + "* Paralyzed *");
entity.getWorld().playSound(entity.getLocation(), Sound.ENTITY_ENDERDRAGON_HURT, 2, 0); entity.getWorld().playSound(entity.getLocation(), Sound.ENTITY_ENDERDRAGON_HURT, 2, 0);
} }
@ -86,10 +89,6 @@ public class Paralyze extends ChiAbility {
return false; return false;
} }
public static long getDuration() {
return getConfig().getLong("Abilities.Chi.Paralyze.Duration");
}
public Entity getTarget() { public Entity getTarget() {
return this.target; return this.target;
} }
@ -98,4 +97,7 @@ public class Paralyze extends ChiAbility {
this.target = target; this.target = target;
} }
public long getDuration() {
return duration;
}
} }

View file

@ -13,6 +13,7 @@ public class QuickStrike extends ChiAbility {
@Attribute(Attribute.DAMAGE) @Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute("ChiBlockChance")
private int blockChance; private int blockChance;
private Entity target; private Entity target;
@Attribute(Attribute.COOLDOWN) @Attribute(Attribute.COOLDOWN)

View file

@ -14,6 +14,7 @@ public class SwiftKick extends ChiAbility {
@Attribute(Attribute.DAMAGE) @Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute("ChiBlockChance")
private int blockChance; private int blockChance;
@Attribute(Attribute.COOLDOWN) @Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;

View file

@ -9,11 +9,15 @@ import org.bukkit.potion.PotionEffectType;
import com.projectkorra.projectkorra.Element; import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.ChiAbility; import com.projectkorra.projectkorra.ability.ChiAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
public class WarriorStance extends ChiAbility { public class WarriorStance extends ChiAbility {
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute("Strength")
private int strength; private int strength;
@Attribute("Resistance")
private int resistance; private int resistance;
public WarriorStance(final Player player) { public WarriorStance(final Player player) {

View file

@ -13,12 +13,15 @@ import com.projectkorra.projectkorra.ability.ChiAbility;
import com.projectkorra.projectkorra.ability.ComboAbility; import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.MovementHandler; import com.projectkorra.projectkorra.util.MovementHandler;
public class Immobilize extends ChiAbility implements ComboAbility { public class Immobilize extends ChiAbility implements ComboAbility {
@Attribute(Attribute.DURATION)
private long duration; private long duration;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private Entity target; private Entity target;

View file

@ -10,13 +10,16 @@ import com.projectkorra.projectkorra.ability.ChiAbility;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.PassiveAbility; import com.projectkorra.projectkorra.ability.PassiveAbility;
import com.projectkorra.projectkorra.airbending.passive.AirAgility; import com.projectkorra.projectkorra.airbending.passive.AirAgility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.chiblocking.AcrobatStance; import com.projectkorra.projectkorra.chiblocking.AcrobatStance;
import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.configuration.ConfigManager;
public class ChiAgility extends ChiAbility implements PassiveAbility { public class ChiAgility extends ChiAbility implements PassiveAbility {
// Configurable variables. // Configurable variables.
@Attribute("Jump")
private int jumpPower; private int jumpPower;
@Attribute(Attribute.SPEED)
private int speedPower; private int speedPower;
// Instance related variables. // Instance related variables.

View file

@ -9,7 +9,6 @@ import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.projectkorra.items.command.PKICommand;
import com.projectkorra.projectkorra.Element; import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AddonAbility; import com.projectkorra.projectkorra.ability.AddonAbility;
@ -18,7 +17,6 @@ import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.PassiveAbility; import com.projectkorra.projectkorra.ability.PassiveAbility;
import com.projectkorra.projectkorra.ability.util.ComboManager; import com.projectkorra.projectkorra.ability.util.ComboManager;
import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.rpg.commands.RPGCommand;
/** /**
* Executor for /bending help. Extends {@link PKCommand}. * Executor for /bending help. Extends {@link PKCommand}.
@ -37,6 +35,9 @@ public class HelpCommand extends PKCommand {
private final String avatar; private final String avatar;
private final String invalidTopic; private final String invalidTopic;
private final String usage; private final String usage;
private final String rpgUsage;
private final String spiritsUsage;
private final String itemsUsage;
public HelpCommand() { public HelpCommand() {
super("help", "/bending help <Page/Topic>", ConfigManager.languageConfig.get().getString("Commands.Help.Description"), new String[] { "help", "h" }); super("help", "/bending help <Page/Topic>", ConfigManager.languageConfig.get().getString("Commands.Help.Description"), new String[] { "help", "h" });
@ -53,6 +54,9 @@ public class HelpCommand extends PKCommand {
this.avatar = ConfigManager.languageConfig.get().getString("Commands.Help.Elements.Avatar"); this.avatar = ConfigManager.languageConfig.get().getString("Commands.Help.Elements.Avatar");
this.invalidTopic = ConfigManager.languageConfig.get().getString("Commands.Help.InvalidTopic"); this.invalidTopic = ConfigManager.languageConfig.get().getString("Commands.Help.InvalidTopic");
this.usage = ConfigManager.languageConfig.get().getString("Commands.Help.Usage"); this.usage = ConfigManager.languageConfig.get().getString("Commands.Help.Usage");
this.rpgUsage = ConfigManager.languageConfig.get().getString("Command.Help.RPGUsage");
this.spiritsUsage = ConfigManager.languageConfig.get().getString("Commands.Help.SpiritsUsage");
this.itemsUsage = ConfigManager.languageConfig.get().getString("Commands.Help.ItemsUsage");
} }
@Override @Override
@ -69,21 +73,13 @@ public class HelpCommand extends PKCommand {
} }
} }
if (GeneralMethods.hasItems()) { if (GeneralMethods.hasItems()) {
for (final PKICommand command : PKICommand.instances.values()) { strings.add(itemsUsage);
if (sender.hasPermission("bendingitems.command." + command.getName())) {
strings.add(command.getProperUse());
}
}
} }
if (GeneralMethods.hasRPG()) { if (GeneralMethods.hasRPG()) {
for (final RPGCommand command : RPGCommand.instances.values()) { strings.add(rpgUsage);
if (sender.hasPermission("bending.command.rpg." + command.getName())) {
strings.add(command.getProperUse());
}
}
} }
if (GeneralMethods.hasSpirits()) { if (GeneralMethods.hasSpirits()) {
// spirits commands being added (if needed). strings.add(spiritsUsage);
} }
Collections.sort(strings); Collections.sort(strings);
Collections.reverse(strings); Collections.reverse(strings);
@ -109,21 +105,13 @@ public class HelpCommand extends PKCommand {
strings.add(command.getProperUse()); strings.add(command.getProperUse());
} }
if (GeneralMethods.hasItems()) { if (GeneralMethods.hasItems()) {
for (final PKICommand command : PKICommand.instances.values()) { strings.add(itemsUsage);
if (sender.hasPermission("bendingitems.command." + command.getName())) {
strings.add(command.getProperUse());
}
}
} }
if (GeneralMethods.hasRPG()) { if (GeneralMethods.hasRPG()) {
for (final RPGCommand command : RPGCommand.instances.values()) { strings.add(rpgUsage);
if (sender.hasPermission("bending.command.rpg." + command.getName())) {
strings.add(command.getProperUse());
}
}
} }
if (GeneralMethods.hasSpirits()) { if (GeneralMethods.hasSpirits()) {
// spirits commands being added (if needed). strings.add(spiritsUsage);
} }
for (final String s : this.getPage(strings, ChatColor.GOLD + "Commands: <" + this.required + "> [" + this.optional + "]", Integer.valueOf(arg), true)) { for (final String s : this.getPage(strings, ChatColor.GOLD + "Commands: <" + this.required + "> [" + this.optional + "]", Integer.valueOf(arg), true)) {
if (firstMessage) { if (firstMessage) {

View file

@ -16,7 +16,6 @@ import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.event.PlayerChangeElementEvent; import com.projectkorra.projectkorra.event.PlayerChangeElementEvent;
import com.projectkorra.projectkorra.event.PlayerChangeElementEvent.Result; import com.projectkorra.projectkorra.event.PlayerChangeElementEvent.Result;
import com.projectkorra.projectkorra.event.PlayerChangeSubElementEvent; import com.projectkorra.projectkorra.event.PlayerChangeSubElementEvent;
import com.projectkorra.rpg.RPGMethods;
/** /**
* Executor for /bending remove. Extends {@link PKCommand}. * Executor for /bending remove. Extends {@link PKCommand}.
@ -135,9 +134,6 @@ public class RemoveCommand extends PKCommand {
GeneralMethods.saveElements(bPlayer); GeneralMethods.saveElements(bPlayer);
GeneralMethods.saveSubElements(bPlayer); GeneralMethods.saveSubElements(bPlayer);
GeneralMethods.removeUnusableAbilities(player.getName()); GeneralMethods.removeUnusableAbilities(player.getName());
if (GeneralMethods.hasRPG()) {
RPGMethods.revokeAvatar(bPlayer.getUUID());
}
if (!player.getName().equalsIgnoreCase(sender.getName())) { if (!player.getName().equalsIgnoreCase(sender.getName())) {
GeneralMethods.sendBrandingMessage(sender, ChatColor.YELLOW + this.succesfullyRemovedAllElementsTargetConfirm.replace("{target}", ChatColor.DARK_AQUA + player.getName() + ChatColor.YELLOW)); GeneralMethods.sendBrandingMessage(sender, ChatColor.YELLOW + this.succesfullyRemovedAllElementsTargetConfirm.replace("{target}", ChatColor.DARK_AQUA + player.getName() + ChatColor.YELLOW));
} }

View file

@ -29,9 +29,6 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.rpg.RPGMethods;
import com.projectkorra.spirits.SpiritElement;
import com.projectkorra.spirits.SpiritPlayer;
/** /**
* Executor for /bending who. Extends {@link PKCommand}. * Executor for /bending who. Extends {@link PKCommand}.
@ -309,18 +306,6 @@ public class WhoCommand extends PKCommand {
sender.sendMessage(element.getColor() + "" + (bPlayer.isElementToggled(element) ? "" : ChatColor.STRIKETHROUGH) + "- " + element.getName() + (element.getType() != null ? element.getType().getBender() : "")); sender.sendMessage(element.getColor() + "" + (bPlayer.isElementToggled(element) ? "" : ChatColor.STRIKETHROUGH) + "- " + element.getName() + (element.getType() != null ? element.getType().getBender() : ""));
if (player_ != null) { if (player_ != null) {
for (final SubElement subelement : Element.getSubElements(element)) { for (final SubElement subelement : Element.getSubElements(element)) {
if (GeneralMethods.hasSpirits()) {
final SpiritPlayer sPlayer = SpiritPlayer.getSpiritPlayer(player_);
if (subelement.equals(SpiritElement.DARK) && sPlayer.isLightSpirit()) {
sender.sendMessage(subelement.getColor() + " Is " + sPlayer.getSpirit().getName() + element.getName());
}
if (subelement.equals(SpiritElement.LIGHT) && sPlayer.isDarkSpirit()) {
sender.sendMessage(subelement.getColor() + " Is " + sPlayer.getSpirit().getName() + element.getName());
}
if (sPlayer.isSpirit()) {
continue;
}
}
if (bPlayer.canUseSubElement(subelement)) { if (bPlayer.canUseSubElement(subelement)) {
sender.sendMessage(subelement.getColor() + " Can " + (!subelement.getType().equals(ElementType.NO_SUFFIX) ? "" : "use ") + subelement.getName() + subelement.getType().getBend()); sender.sendMessage(subelement.getColor() + " Can " + (!subelement.getType().equals(ElementType.NO_SUFFIX) ? "" : "use ") + subelement.getName() + subelement.getType().getBend());
} }
@ -343,14 +328,6 @@ public class WhoCommand extends PKCommand {
} }
} }
if (GeneralMethods.hasRPG()) {
if (RPGMethods.isCurrentAvatar(player.getUniqueId())) {
sender.sendMessage(Element.AVATAR.getColor() + "Current Avatar");
} else if (RPGMethods.hasBeenAvatar(player.getUniqueId())) {
sender.sendMessage(Element.AVATAR.getColor() + "Former Avatar");
}
}
if (this.staff.containsKey(uuid.toString())) { if (this.staff.containsKey(uuid.toString())) {
sender.sendMessage(this.staff.get(uuid.toString())); sender.sendMessage(this.staff.get(uuid.toString()));
} }

View file

@ -165,6 +165,9 @@ public class ConfigManager {
config.addDefault("Commands.Help.Elements.LearnMore", "Learn more at our website! "); config.addDefault("Commands.Help.Elements.LearnMore", "Learn more at our website! ");
config.addDefault("Commands.Help.InvalidTopic", "That isn't a valid help topic. Use /bending help for more information."); config.addDefault("Commands.Help.InvalidTopic", "That isn't a valid help topic. Use /bending help for more information.");
config.addDefault("Commands.Help.Usage", "Usage: "); config.addDefault("Commands.Help.Usage", "Usage: ");
config.addDefault("Commands.Help.RPGUsage", "/bending rpg [argument]");
config.addDefault("Commands.Help.ItemsUsage", "/bending items [argument]");
config.addDefault("Commands.Help.SpiritsUsage", "/bending spirits [argument]");
config.addDefault("Commands.Display.Description", "This command will show you all of the elements you have bound if you do not specify an element. If you do specify an element (Air, Water, Earth, Fire, or Chi), it will show you all of the available abilities of that element installed on the server."); config.addDefault("Commands.Display.Description", "This command will show you all of the elements you have bound if you do not specify an element. If you do specify an element (Air, Water, Earth, Fire, or Chi), it will show you all of the available abilities of that element installed on the server.");
@ -619,8 +622,8 @@ public class ConfigManager {
config.addDefault("Abilities.Avatar.AvatarState.Air.Suffocate.Damage", 3); config.addDefault("Abilities.Avatar.AvatarState.Air.Suffocate.Damage", 3);
config.addDefault("Abilities.Avatar.AvatarState.Air.Suffocate.Range", 16); config.addDefault("Abilities.Avatar.AvatarState.Air.Suffocate.Range", 16);
config.addDefault("Abilities.Avatar.AvatarState.Air.AirStream.Range", 60); config.addDefault("Abilities.Avatar.AvatarState.Air.AirStream.Range", 60);
config.addDefault("Abilities.Avatar.AvatarState.Air.AirStream.EntityHeight", 21); config.addDefault("Abilities.Avatar.AvatarState.Air.AirStream.EntityCarry.Height", 21);
config.addDefault("Abilities.Avatar.AvatarState.Air.AirStream.EntityDuration", 20000); config.addDefault("Abilities.Avatar.AvatarState.Air.AirStream.EntityCarry.Duration", 20000);
config.addDefault("Abilities.Avatar.AvatarState.Air.AirSweep.Damage", 6); config.addDefault("Abilities.Avatar.AvatarState.Air.AirSweep.Damage", 6);
config.addDefault("Abilities.Avatar.AvatarState.Air.AirSweep.Range", 21); config.addDefault("Abilities.Avatar.AvatarState.Air.AirSweep.Range", 21);
config.addDefault("Abilities.Avatar.AvatarState.Air.AirSweep.Knockback", 4); config.addDefault("Abilities.Avatar.AvatarState.Air.AirSweep.Knockback", 4);
@ -709,14 +712,14 @@ public class ConfigManager {
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Range", 30); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Range", 30);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Push", 0.9); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Push", 0.9);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Height", 7); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Height", 7);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.SlowPower", 3); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.SlowPotency", 3);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.SlowDuration", 90); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.SlowDuration", 90);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Damage", 3); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Damage", 3);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Radius", 8); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Radius", 8);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Push", 1.2); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Push", 1.2);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.Range", 30); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.Range", 30);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.Damage", 3); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.Damage", 3);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.SlowPower", 3); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.SlowPotency", 3);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.SlowDuration", 90); config.addDefault("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.SlowDuration", 90);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceBullet.Damage", 4); config.addDefault("Abilities.Avatar.AvatarState.Water.IceBullet.Damage", 4);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceBullet.Range", 16); config.addDefault("Abilities.Avatar.AvatarState.Water.IceBullet.Range", 16);
@ -724,7 +727,7 @@ public class ConfigManager {
config.addDefault("Abilities.Avatar.AvatarState.Water.IceBullet.ShootTime", 12000); config.addDefault("Abilities.Avatar.AvatarState.Water.IceBullet.ShootTime", 12000);
config.addDefault("Abilities.Avatar.AvatarState.Water.IceWave.Damage", 4); config.addDefault("Abilities.Avatar.AvatarState.Water.IceWave.Damage", 4);
config.addDefault("Abilities.Avatar.AvatarState.Water.WaterSpout.Height", 20); config.addDefault("Abilities.Avatar.AvatarState.Water.WaterSpout.Height", 20);
config.addDefault("Abilities.Avatar.AvatarState.Water.WaterSpout.Wave.FlightTime", 5000); config.addDefault("Abilities.Avatar.AvatarState.Water.WaterSpout.Wave.FlightDuration", 5000);
config.addDefault("Abilities.Air.Passive.Factor", 0.3); config.addDefault("Abilities.Air.Passive.Factor", 0.3);
config.addDefault("Abilities.Air.Passive.AirAgility.Enabled", true); config.addDefault("Abilities.Air.Passive.AirAgility.Enabled", true);
@ -852,8 +855,8 @@ public class ConfigManager {
config.addDefault("Abilities.Air.AirStream.Enabled", true); config.addDefault("Abilities.Air.AirStream.Enabled", true);
config.addDefault("Abilities.Air.AirStream.Speed", 0.5); config.addDefault("Abilities.Air.AirStream.Speed", 0.5);
config.addDefault("Abilities.Air.AirStream.Range", 40); config.addDefault("Abilities.Air.AirStream.Range", 40);
config.addDefault("Abilities.Air.AirStream.EntityDuration", 4000); config.addDefault("Abilities.Air.AirStream.EntityCarry.Duration", 4000);
config.addDefault("Abilities.Air.AirStream.EntityHeight", 14); config.addDefault("Abilities.Air.AirStream.EntityCarry.Height", 14);
config.addDefault("Abilities.Air.AirStream.Cooldown", 7000); config.addDefault("Abilities.Air.AirStream.Cooldown", 7000);
config.addDefault("Abilities.Air.AirSweep.Enabled", true); config.addDefault("Abilities.Air.AirSweep.Enabled", true);
@ -872,9 +875,9 @@ public class ConfigManager {
config.addDefault("Abilities.Water.Bloodbending.Enabled", true); config.addDefault("Abilities.Water.Bloodbending.Enabled", true);
config.addDefault("Abilities.Water.Bloodbending.CanOnlyBeUsedAtNight", true); config.addDefault("Abilities.Water.Bloodbending.CanOnlyBeUsedAtNight", true);
config.addDefault("Abilities.Water.Bloodbending.CanBeUsedOnUndeadMobs", true); config.addDefault("Abilities.Water.Bloodbending.CanBeUsedOnUndeadMobs", true);
config.addDefault("Abilities.Water.Bloodbending.ThrowFactor", 2); config.addDefault("Abilities.Water.Bloodbending.Knockback", 2);
config.addDefault("Abilities.Water.Bloodbending.Range", 10); config.addDefault("Abilities.Water.Bloodbending.Range", 10);
config.addDefault("Abilities.Water.Bloodbending.HoldTime", 0); config.addDefault("Abilities.Water.Bloodbending.Duration", 0);
config.addDefault("Abilities.Water.Bloodbending.Cooldown", 3000); config.addDefault("Abilities.Water.Bloodbending.Cooldown", 3000);
config.addDefault("Abilities.Water.Bloodbending.CanOnlyBeUsedDuringFullMoon", true); config.addDefault("Abilities.Water.Bloodbending.CanOnlyBeUsedDuringFullMoon", true);
config.addDefault("Abilities.Water.Bloodbending.CanBloodbendOtherBloodbenders", false); config.addDefault("Abilities.Water.Bloodbending.CanBloodbendOtherBloodbenders", false);
@ -884,8 +887,7 @@ public class ConfigManager {
config.addDefault("Abilities.Water.HealingWaters.Range", 5); config.addDefault("Abilities.Water.HealingWaters.Range", 5);
config.addDefault("Abilities.Water.HealingWaters.Interval", 750); config.addDefault("Abilities.Water.HealingWaters.Interval", 750);
config.addDefault("Abilities.Water.HealingWaters.ChargeTime", 1000); config.addDefault("Abilities.Water.HealingWaters.ChargeTime", 1000);
config.addDefault("Abilities.Water.HealingWaters.Power", 1); config.addDefault("Abilities.Water.HealingWaters.PotionPotency", 1);
config.addDefault("Abilities.Water.HealingWaters.HealingDuration", 70);
config.addDefault("Abilities.Water.HealingWaters.Duration", 0); config.addDefault("Abilities.Water.HealingWaters.Duration", 0);
config.addDefault("Abilities.Water.HealingWaters.EnableParticles", true); config.addDefault("Abilities.Water.HealingWaters.EnableParticles", true);
@ -905,11 +907,11 @@ public class ConfigManager {
config.addDefault("Abilities.Water.IceSpike.Height", 6); config.addDefault("Abilities.Water.IceSpike.Height", 6);
config.addDefault("Abilities.Water.IceSpike.Speed", 25); config.addDefault("Abilities.Water.IceSpike.Speed", 25);
config.addDefault("Abilities.Water.IceSpike.SlowCooldown", 5000); config.addDefault("Abilities.Water.IceSpike.SlowCooldown", 5000);
config.addDefault("Abilities.Water.IceSpike.SlowPower", 2); config.addDefault("Abilities.Water.IceSpike.SlowPotency", 2);
config.addDefault("Abilities.Water.IceSpike.SlowDuration", 70); config.addDefault("Abilities.Water.IceSpike.SlowDuration", 70);
config.addDefault("Abilities.Water.IceSpike.Field.Damage", 2); config.addDefault("Abilities.Water.IceSpike.Field.Damage", 2);
config.addDefault("Abilities.Water.IceSpike.Field.Radius", 6); config.addDefault("Abilities.Water.IceSpike.Field.Radius", 6);
config.addDefault("Abilities.Water.IceSpike.Field.Push", 1); config.addDefault("Abilities.Water.IceSpike.Field.Knockup", 1);
config.addDefault("Abilities.Water.IceSpike.Field.Cooldown", 2000); config.addDefault("Abilities.Water.IceSpike.Field.Cooldown", 2000);
config.addDefault("Abilities.Water.IceSpike.Blast.Range", 20); config.addDefault("Abilities.Water.IceSpike.Blast.Range", 20);
config.addDefault("Abilities.Water.IceSpike.Blast.Damage", 1); config.addDefault("Abilities.Water.IceSpike.Blast.Damage", 1);
@ -917,7 +919,7 @@ public class ConfigManager {
config.addDefault("Abilities.Water.IceSpike.Blast.DeflectRange", 3); config.addDefault("Abilities.Water.IceSpike.Blast.DeflectRange", 3);
config.addDefault("Abilities.Water.IceSpike.Blast.Cooldown", 500); config.addDefault("Abilities.Water.IceSpike.Blast.Cooldown", 500);
config.addDefault("Abilities.Water.IceSpike.Blast.SlowCooldown", 5000); config.addDefault("Abilities.Water.IceSpike.Blast.SlowCooldown", 5000);
config.addDefault("Abilities.Water.IceSpike.Blast.SlowPower", 2); config.addDefault("Abilities.Water.IceSpike.Blast.SlowPotency", 2);
config.addDefault("Abilities.Water.IceSpike.Blast.SlowDuration", 70); config.addDefault("Abilities.Water.IceSpike.Blast.SlowDuration", 70);
config.addDefault("Abilities.Water.IceSpike.Blast.Interval", 20); config.addDefault("Abilities.Water.IceSpike.Blast.Interval", 20);
@ -948,8 +950,8 @@ public class ConfigManager {
config.addDefault("Abilities.Water.Surge.Wave.Radius", 3); config.addDefault("Abilities.Water.Surge.Wave.Radius", 3);
config.addDefault("Abilities.Water.Surge.Wave.Range", 20); config.addDefault("Abilities.Water.Surge.Wave.Range", 20);
config.addDefault("Abilities.Water.Surge.Wave.SelectRange", 12); config.addDefault("Abilities.Water.Surge.Wave.SelectRange", 12);
config.addDefault("Abilities.Water.Surge.Wave.HorizontalPush", 1); config.addDefault("Abilities.Water.Surge.Wave.Knockback", 1);
config.addDefault("Abilities.Water.Surge.Wave.VerticalPush", 0.2); config.addDefault("Abilities.Water.Surge.Wave.Knockup", 0.2);
config.addDefault("Abilities.Water.Surge.Wave.MaxFreezeRadius", 7); config.addDefault("Abilities.Water.Surge.Wave.MaxFreezeRadius", 7);
config.addDefault("Abilities.Water.Surge.Wave.Cooldown", 500); config.addDefault("Abilities.Water.Surge.Wave.Cooldown", 500);
config.addDefault("Abilities.Water.Surge.Wave.Interval", 30); config.addDefault("Abilities.Water.Surge.Wave.Interval", 30);
@ -968,10 +970,10 @@ public class ConfigManager {
config.addDefault("Abilities.Water.Torrent.SuccessiveDamage", 1); config.addDefault("Abilities.Water.Torrent.SuccessiveDamage", 1);
config.addDefault("Abilities.Water.Torrent.MaxLayer", 3); config.addDefault("Abilities.Water.Torrent.MaxLayer", 3);
config.addDefault("Abilities.Water.Torrent.MaxHits", 2); config.addDefault("Abilities.Water.Torrent.MaxHits", 2);
config.addDefault("Abilities.Water.Torrent.Push", 1); config.addDefault("Abilities.Water.Torrent.Knockback", 1);
config.addDefault("Abilities.Water.Torrent.Angle", 20); config.addDefault("Abilities.Water.Torrent.Angle", 20);
config.addDefault("Abilities.Water.Torrent.Radius", 3); config.addDefault("Abilities.Water.Torrent.Radius", 3);
config.addDefault("Abilities.Water.Torrent.MaxUpwardForce", 0.2); config.addDefault("Abilities.Water.Torrent.Knockup", 0.2);
config.addDefault("Abilities.Water.Torrent.Interval", 30); config.addDefault("Abilities.Water.Torrent.Interval", 30);
config.addDefault("Abilities.Water.Torrent.Cooldown", 0); config.addDefault("Abilities.Water.Torrent.Cooldown", 0);
config.addDefault("Abilities.Water.Torrent.Revert", true); config.addDefault("Abilities.Water.Torrent.Revert", true);
@ -1015,14 +1017,14 @@ public class ConfigManager {
config.addDefault("Abilities.Water.WaterArms.Whip.Pull.Multiplier", 0.15); config.addDefault("Abilities.Water.WaterArms.Whip.Pull.Multiplier", 0.15);
config.addDefault("Abilities.Water.WaterArms.Whip.Punch.PunchDamage", 0.5); config.addDefault("Abilities.Water.WaterArms.Whip.Punch.Damage", 0.5);
config.addDefault("Abilities.Water.WaterArms.Whip.Punch.MaxLength", 8); config.addDefault("Abilities.Water.WaterArms.Whip.Punch.MaxLength", 8);
config.addDefault("Abilities.Water.WaterArms.Whip.Punch.NightAugments.MaxLength.Normal", 11); config.addDefault("Abilities.Water.WaterArms.Whip.Punch.NightAugments.MaxLength.Normal", 11);
config.addDefault("Abilities.Water.WaterArms.Whip.Punch.NightAugments.MaxLength.FullMoon", 13); config.addDefault("Abilities.Water.WaterArms.Whip.Punch.NightAugments.MaxLength.FullMoon", 13);
config.addDefault("Abilities.Water.WaterArms.Whip.Grapple.RespectRegions", false); config.addDefault("Abilities.Water.WaterArms.Whip.Grapple.RespectRegions", false);
config.addDefault("Abilities.Water.WaterArms.Whip.Grab.HoldTime", 3500); config.addDefault("Abilities.Water.WaterArms.Whip.Grab.Duration", 3500);
config.addDefault("Abilities.Water.WaterArms.Freeze.Range", 20); config.addDefault("Abilities.Water.WaterArms.Freeze.Range", 20);
config.addDefault("Abilities.Water.WaterArms.Freeze.Damage", 2); config.addDefault("Abilities.Water.WaterArms.Freeze.Damage", 2);
@ -1030,7 +1032,7 @@ public class ConfigManager {
config.addDefault("Abilities.Water.WaterArms.Spear.Range", 30); config.addDefault("Abilities.Water.WaterArms.Spear.Range", 30);
config.addDefault("Abilities.Water.WaterArms.Spear.Damage", 3); config.addDefault("Abilities.Water.WaterArms.Spear.Damage", 3);
config.addDefault("Abilities.Water.WaterArms.Spear.DamageEnabled", true); config.addDefault("Abilities.Water.WaterArms.Spear.DamageEnabled", true);
config.addDefault("Abilities.Water.WaterArms.Spear.Sphere", 2); config.addDefault("Abilities.Water.WaterArms.Spear.SphereRadius", 2);
config.addDefault("Abilities.Water.WaterArms.Spear.Duration", 4500); config.addDefault("Abilities.Water.WaterArms.Spear.Duration", 4500);
config.addDefault("Abilities.Water.WaterArms.Spear.Length", 18); config.addDefault("Abilities.Water.WaterArms.Spear.Length", 18);
@ -1056,7 +1058,7 @@ public class ConfigManager {
config.addDefault("Abilities.Water.WaterManipulation.CollisionRadius", 1.5); config.addDefault("Abilities.Water.WaterManipulation.CollisionRadius", 1.5);
config.addDefault("Abilities.Water.WaterManipulation.DeflectRange", 3); config.addDefault("Abilities.Water.WaterManipulation.DeflectRange", 3);
config.addDefault("Abilities.Water.WaterManipulation.Speed", 35); config.addDefault("Abilities.Water.WaterManipulation.Speed", 35);
config.addDefault("Abilities.Water.WaterManipulation.Push", 0.3); config.addDefault("Abilities.Water.WaterManipulation.Knockback", 0.3);
config.addDefault("Abilities.Water.WaterManipulation.Cooldown", 1000); config.addDefault("Abilities.Water.WaterManipulation.Cooldown", 1000);
config.addDefault("Abilities.Water.WaterSpout.Enabled", true); config.addDefault("Abilities.Water.WaterSpout.Enabled", true);
@ -1074,7 +1076,7 @@ public class ConfigManager {
config.addDefault("Abilities.Water.WaterSpout.Wave.SelectRange", 6); config.addDefault("Abilities.Water.WaterSpout.Wave.SelectRange", 6);
config.addDefault("Abilities.Water.WaterSpout.Wave.AnimationSpeed", 1.2); config.addDefault("Abilities.Water.WaterSpout.Wave.AnimationSpeed", 1.2);
config.addDefault("Abilities.Water.WaterSpout.Wave.ChargeTime", 500); config.addDefault("Abilities.Water.WaterSpout.Wave.ChargeTime", 500);
config.addDefault("Abilities.Water.WaterSpout.Wave.FlightTime", 2500); config.addDefault("Abilities.Water.WaterSpout.Wave.FlightDuration", 2500);
config.addDefault("Abilities.Water.WaterSpout.Wave.Speed", 1.3); config.addDefault("Abilities.Water.WaterSpout.Wave.Speed", 1.3);
config.addDefault("Abilities.Water.WaterSpout.Wave.Cooldown", 6000); config.addDefault("Abilities.Water.WaterSpout.Wave.Cooldown", 6000);
@ -1185,37 +1187,37 @@ public class ConfigManager {
config.addDefault("Abilities.Earth.LavaFlow.RevertMaterial", "STONE"); config.addDefault("Abilities.Earth.LavaFlow.RevertMaterial", "STONE");
config.addDefault("Abilities.Earth.EarthSmash.Enabled", true); config.addDefault("Abilities.Earth.EarthSmash.Enabled", true);
config.addDefault("Abilities.Earth.EarthSmash.AllowGrab", true); config.addDefault("Abilities.Earth.EarthSmash.Duration", 30000);
config.addDefault("Abilities.Earth.EarthSmash.AllowFlight", true);
config.addDefault("Abilities.Earth.EarthSmash.GrabRange", 16);
config.addDefault("Abilities.Earth.EarthSmash.SelectRange", 12); config.addDefault("Abilities.Earth.EarthSmash.SelectRange", 12);
config.addDefault("Abilities.Earth.EarthSmash.ChargeTime", 1500); config.addDefault("Abilities.Earth.EarthSmash.ChargeTime", 1500);
config.addDefault("Abilities.Earth.EarthSmash.Cooldown", 3000); config.addDefault("Abilities.Earth.EarthSmash.Cooldown", 3000);
config.addDefault("Abilities.Earth.EarthSmash.ShootRange", 25);
config.addDefault("Abilities.Earth.EarthSmash.Damage", 5); config.addDefault("Abilities.Earth.EarthSmash.Damage", 5);
config.addDefault("Abilities.Earth.EarthSmash.Knockback", 3.5); config.addDefault("Abilities.Earth.EarthSmash.Knockback", 3.5);
config.addDefault("Abilities.Earth.EarthSmash.Knockup", 0.15); config.addDefault("Abilities.Earth.EarthSmash.Knockup", 0.15);
config.addDefault("Abilities.Earth.EarthSmash.FlightSpeed", 0.72); config.addDefault("Abilities.Earth.EarthSmash.Flight.Enabled", true);
config.addDefault("Abilities.Earth.EarthSmash.FlightTimer", 3000); config.addDefault("Abilities.Earth.EarthSmash.Flight.Speed", 0.72);
config.addDefault("Abilities.Earth.EarthSmash.RemoveTimer", 30000); config.addDefault("Abilities.Earth.EarthSmash.Flight.Duration", 3000);
config.addDefault("Abilities.Earth.EarthSmash.Flight.AnimationInterval", 0);
config.addDefault("Abilities.Earth.EarthSmash.Flight.DetectionRadius", 3.5);
config.addDefault("Abilities.Earth.EarthSmash.Grab.Enabled", true);
config.addDefault("Abilities.Earth.EarthSmash.Grab.Range", 16);
config.addDefault("Abilities.Earth.EarthSmash.Grab.DetectionRadius", 2.5);
config.addDefault("Abilities.Earth.EarthSmash.Shoot.Range", 25);
config.addDefault("Abilities.Earth.EarthSmash.Shoot.AnimationInterval", 25);
config.addDefault("Abilities.Earth.EarthSmash.RequiredBendableBlocks", 11); config.addDefault("Abilities.Earth.EarthSmash.RequiredBendableBlocks", 11);
config.addDefault("Abilities.Earth.EarthSmash.MaxBlocksToPassThrough", 3); config.addDefault("Abilities.Earth.EarthSmash.MaxBlocksToPassThrough", 3);
config.addDefault("Abilities.Earth.EarthSmash.ShootAnimationInterval", 25);
config.addDefault("Abilities.Earth.EarthSmash.FlightAnimationInterval", 0);
config.addDefault("Abilities.Earth.EarthSmash.LiftAnimationInterval", 30); config.addDefault("Abilities.Earth.EarthSmash.LiftAnimationInterval", 30);
config.addDefault("Abilities.Earth.EarthSmash.GrabDetectionRadius", 2.5);
config.addDefault("Abilities.Earth.EarthSmash.FlightDetectionRadius", 3.5);
config.addDefault("Abilities.Earth.MetalClips.Enabled", true); config.addDefault("Abilities.Earth.MetalClips.Enabled", true);
config.addDefault("Abilities.Earth.MetalClips.Damage", 2); config.addDefault("Abilities.Earth.MetalClips.Damage", 2);
config.addDefault("Abilities.Earth.MetalClips.CrushDamage", 1);
config.addDefault("Abilities.Earth.MetalClips.Range", 10); config.addDefault("Abilities.Earth.MetalClips.Range", 10);
config.addDefault("Abilities.Earth.MetalClips.MagnetRange", 20);
config.addDefault("Abilities.Earth.MetalClips.MagnetPower", 0.6);
config.addDefault("Abilities.Earth.MetalClips.Cooldown", 6000); config.addDefault("Abilities.Earth.MetalClips.Cooldown", 6000);
config.addDefault("Abilities.Earth.MetalClips.CrushCooldown", 2000);
config.addDefault("Abilities.Earth.MetalClips.MagnetCooldown", 1000);
config.addDefault("Abilities.Earth.MetalClips.Duration", 10000); config.addDefault("Abilities.Earth.MetalClips.Duration", 10000);
config.addDefault("Abilities.Earth.MetalClips.Magnet.Range", 20);
config.addDefault("Abilities.Earth.MetalClips.Magnet.Speed", 0.6);
config.addDefault("Abilities.Earth.MetalClips.Magnet.Cooldown", 1000);
config.addDefault("Abilities.Earth.MetalClips.Crush.Damage", 1);
config.addDefault("Abilities.Earth.MetalClips.Crush.Cooldown", 2000);
config.addDefault("Abilities.Earth.MetalClips.ThrowEnabled", true); config.addDefault("Abilities.Earth.MetalClips.ThrowEnabled", true);
config.addDefault("Abilities.Earth.RaiseEarth.Enabled", true); config.addDefault("Abilities.Earth.RaiseEarth.Enabled", true);
@ -1247,7 +1249,7 @@ public class ConfigManager {
config.addDefault("Abilities.Earth.EarthPillars.Enabled", true); config.addDefault("Abilities.Earth.EarthPillars.Enabled", true);
config.addDefault("Abilities.Earth.EarthPillars.Cooldown", 8000); config.addDefault("Abilities.Earth.EarthPillars.Cooldown", 8000);
config.addDefault("Abilities.Earth.EarthPillars.Radius", 9); config.addDefault("Abilities.Earth.EarthPillars.Radius", 9);
config.addDefault("Abilities.Earth.EarthPillars.Power", 1.2); config.addDefault("Abilities.Earth.EarthPillars.Knockup", 1.2);
config.addDefault("Abilities.Earth.EarthPillars.Damage.Enabled", true); config.addDefault("Abilities.Earth.EarthPillars.Damage.Enabled", true);
config.addDefault("Abilities.Earth.EarthPillars.Damage.Value", 2); config.addDefault("Abilities.Earth.EarthPillars.Damage.Value", 2);
config.addDefault("Abilities.Earth.EarthPillars.FallThreshold", 12); config.addDefault("Abilities.Earth.EarthPillars.FallThreshold", 12);
@ -1264,7 +1266,7 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.Combustion.Enabled", true); config.addDefault("Abilities.Fire.Combustion.Enabled", true);
config.addDefault("Abilities.Fire.Combustion.Cooldown", 10000); config.addDefault("Abilities.Fire.Combustion.Cooldown", 10000);
config.addDefault("Abilities.Fire.Combustion.BreakBlocks", false); config.addDefault("Abilities.Fire.Combustion.BreakBlocks", false);
config.addDefault("Abilities.Fire.Combustion.Power", 1.0); config.addDefault("Abilities.Fire.Combustion.ExplosivePower", 1.0);
config.addDefault("Abilities.Fire.Combustion.Damage", 4); config.addDefault("Abilities.Fire.Combustion.Damage", 4);
config.addDefault("Abilities.Fire.Combustion.Radius", 4); config.addDefault("Abilities.Fire.Combustion.Radius", 4);
config.addDefault("Abilities.Fire.Combustion.Range", 35); config.addDefault("Abilities.Fire.Combustion.Range", 35);
@ -1274,7 +1276,7 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.FireBlast.Speed", 20); config.addDefault("Abilities.Fire.FireBlast.Speed", 20);
config.addDefault("Abilities.Fire.FireBlast.Range", 20); config.addDefault("Abilities.Fire.FireBlast.Range", 20);
config.addDefault("Abilities.Fire.FireBlast.CollisionRadius", 1.5); config.addDefault("Abilities.Fire.FireBlast.CollisionRadius", 1.5);
config.addDefault("Abilities.Fire.FireBlast.Push", 0.3); config.addDefault("Abilities.Fire.FireBlast.Knockback", 0.3);
config.addDefault("Abilities.Fire.FireBlast.Damage", 3); config.addDefault("Abilities.Fire.FireBlast.Damage", 3);
config.addDefault("Abilities.Fire.FireBlast.Cooldown", 1500); config.addDefault("Abilities.Fire.FireBlast.Cooldown", 1500);
config.addDefault("Abilities.Fire.FireBlast.Dissipate", false); config.addDefault("Abilities.Fire.FireBlast.Dissipate", false);
@ -1282,6 +1284,7 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.FireBlast.SmokeParticleRadius", 0.3); config.addDefault("Abilities.Fire.FireBlast.SmokeParticleRadius", 0.3);
config.addDefault("Abilities.Fire.FireBlast.FlameParticleRadius", 0.275); config.addDefault("Abilities.Fire.FireBlast.FlameParticleRadius", 0.275);
config.addDefault("Abilities.Fire.FireBlast.Charged.ChargeTime", 3000); config.addDefault("Abilities.Fire.FireBlast.Charged.ChargeTime", 3000);
config.addDefault("Abilities.Fire.FireBlast.Charged.Cooldown", 2000);
config.addDefault("Abilities.Fire.FireBlast.Charged.CollisionRadius", 2); config.addDefault("Abilities.Fire.FireBlast.Charged.CollisionRadius", 2);
config.addDefault("Abilities.Fire.FireBlast.Charged.Damage", 4); config.addDefault("Abilities.Fire.FireBlast.Charged.Damage", 4);
config.addDefault("Abilities.Fire.FireBlast.Charged.DamageRadius", 4); config.addDefault("Abilities.Fire.FireBlast.Charged.DamageRadius", 4);
@ -1326,8 +1329,8 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.FireShield.Disc.Radius", 1.5); config.addDefault("Abilities.Fire.FireShield.Disc.Radius", 1.5);
config.addDefault("Abilities.Fire.FireShield.Disc.Duration", 1000); config.addDefault("Abilities.Fire.FireShield.Disc.Duration", 1000);
config.addDefault("Abilities.Fire.FireShield.Disc.Cooldown", 500); config.addDefault("Abilities.Fire.FireShield.Disc.Cooldown", 500);
config.addDefault("Abilities.Fire.FireShield.Interval", 100); config.addDefault("Abilities.Fire.FireShield.Shield.FireTicks", 2);
config.addDefault("Abilities.Fire.FireShield.FireTicks", 2); config.addDefault("Abilities.Fire.FireShield.Disc.FireTicks", 2);
config.addDefault("Abilities.Fire.HeatControl.Enabled", true); config.addDefault("Abilities.Fire.HeatControl.Enabled", true);
config.addDefault("Abilities.Fire.HeatControl.Cook.Interval", 1000); config.addDefault("Abilities.Fire.HeatControl.Cook.Interval", 1000);

View file

@ -13,12 +13,14 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.ParticleEffect.BlockData; import com.projectkorra.projectkorra.util.ParticleEffect.BlockData;
public class Catapult extends EarthAbility { public class Catapult extends EarthAbility {
private double stageTimeMult; private double stageTimeMult;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private Location origin; private Location origin;
private Location target; private Location target;

View file

@ -11,16 +11,21 @@ import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
public class Collapse extends EarthAbility { public class Collapse extends EarthAbility {
private int distance; private int distance;
@Attribute(Attribute.HEIGHT)
private int height; private int height;
private long time; private long time;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.SELECT_RANGE)
private double selectRange; private double selectRange;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
private Location origin; private Location origin;
private Location location; private Location location;

View file

@ -11,14 +11,19 @@ import org.bukkit.entity.Player;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
public class CollapseWall extends EarthAbility { public class CollapseWall extends EarthAbility {
@Attribute(Attribute.SELECT_RANGE)
private int selectRange; private int selectRange;
@Attribute(Attribute.HEIGHT)
private int height; private int height;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.RADIUS)
private double radius; private double radius;
private Location location; private Location location;
private Map<Block, Block> blocks; private Map<Block, Block> blocks;

View file

@ -21,6 +21,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.command.Commands; import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempArmor; import com.projectkorra.projectkorra.util.TempArmor;
@ -31,9 +32,12 @@ public class EarthArmor extends EarthAbility {
private boolean formed; private boolean formed;
private MaterialData headData; private MaterialData headData;
private MaterialData legsData; private MaterialData legsData;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long interval; private long interval;
@Attribute(Attribute.DURATION)
private long maxDuration; private long maxDuration;
@Attribute(Attribute.SELECT_RANGE)
private double selectRange; private double selectRange;
private Block headBlock; private Block headBlock;
private Block legsBlock; private Block legsBlock;
@ -42,6 +46,7 @@ public class EarthArmor extends EarthAbility {
private boolean active; private boolean active;
private PotionEffect oldAbsorbtion = null; private PotionEffect oldAbsorbtion = null;
private float goldHearts; private float goldHearts;
@Attribute("GoldHearts")
private int maxGoldHearts; private int maxGoldHearts;
private TempArmor armor; private TempArmor armor;

View file

@ -15,6 +15,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.earthbending.passive.DensityShift; import com.projectkorra.projectkorra.earthbending.passive.DensityShift;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
@ -27,12 +28,19 @@ public class EarthBlast extends EarthAbility {
private boolean canHitSelf; private boolean canHitSelf;
private long time; private long time;
private long interval; private long interval;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute(Attribute.KNOCKBACK)
private double pushFactor; private double pushFactor;
@Attribute(Attribute.SELECT_RANGE)
private double selectRange; private double selectRange;
@Attribute("DeflectRange")
private double deflectRange; private double deflectRange;
private double collisionRadius; private double collisionRadius;
private byte sourceData; private byte sourceData;

View file

@ -12,14 +12,18 @@ import org.bukkit.entity.Player;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
public class EarthDome extends EarthAbility { public class EarthDome extends EarthAbility {
public Location center; private Location center;
public double radius; @Attribute(Attribute.RADIUS)
public int height; private double radius;
public Set<Block> checked = new HashSet<>(); @Attribute(Attribute.HEIGHT)
public Set<Block> corners = new HashSet<>(); private int height;
@Attribute(Attribute.COOLDOWN)
private long cooldown;
private Set<Block> checked;
public EarthDome(final Player player, final Location center) { public EarthDome(final Player player, final Location center) {
super(player); super(player);
@ -31,26 +35,10 @@ public class EarthDome extends EarthAbility {
this.center = center; this.center = center;
this.radius = getConfig().getDouble("Abilities.Earth.EarthDome.Radius"); this.radius = getConfig().getDouble("Abilities.Earth.EarthDome.Radius");
this.height = getConfig().getInt("Abilities.Earth.EarthDome.Height"); this.height = getConfig().getInt("Abilities.Earth.EarthDome.Height");
this.cooldown = getConfig().getLong("Abilities.Earth.EarthDome.Cooldown");
this.checked = new HashSet<>();
for (int i = 0; i < 2; i++) { start();
for (final Location check : this.getCircle(center, this.radius + i, 10)) {
Block b = check.getBlock();
if (this.checked.contains(b)) {
continue;
}
b = this.getAppropriateBlock(b);
if (b == null) {
continue;
}
new RaiseEarth(player, b.getLocation(), Math.round(this.height - i));
this.checked.add(b);
}
}
this.bPlayer.addCooldown("EarthDome", this.getCooldown());
} }
public EarthDome(final Player player) { public EarthDome(final Player player) {
@ -81,6 +69,26 @@ public class EarthDome extends EarthAbility {
@Override @Override
public void progress() { public void progress() {
for (int i = 0; i < 2; i++) {
for (final Location check : this.getCircle(center, this.radius + i, 10)) {
Block currBlock = check.getBlock();
if (this.checked.contains(currBlock)) {
continue;
}
currBlock = this.getAppropriateBlock(currBlock);
if (currBlock == null) {
continue;
}
new RaiseEarth(player, currBlock.getLocation(), Math.round(this.height - i));
this.checked.add(currBlock);
}
}
this.bPlayer.addCooldown("EarthDome", this.getCooldown());
this.remove();
} }
@Override @Override
@ -95,7 +103,7 @@ public class EarthDome extends EarthAbility {
@Override @Override
public long getCooldown() { public long getCooldown() {
return getConfig().getLong("Abilities.Earth.EarthDome.Cooldown"); return cooldown;
} }
@Override @Override

View file

@ -27,6 +27,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.MovementHandler; import com.projectkorra.projectkorra.util.MovementHandler;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
@ -38,8 +39,18 @@ import com.projectkorra.projectkorra.util.TempBlock;
public class EarthGrab extends EarthAbility { public class EarthGrab extends EarthAbility {
private LivingEntity target; private LivingEntity target;
private long cooldown, lastHit = 0, interval; @Attribute(Attribute.COOLDOWN)
private double range, dragSpeed, trapHP, trappedHP, damageThreshold; private long cooldown;
private long lastHit;
private long interval;
@Attribute(Attribute.RANGE)
private double range;
@Attribute(Attribute.SPEED)
private double dragSpeed;
@Attribute("TrapHealth")
private double trapHP;
private double trappedHP;
private double damageThreshold;
private GrabMode mode; private GrabMode mode;
private boolean initiated = false; private boolean initiated = false;
private MovementHandler mHandler; private MovementHandler mHandler;
@ -83,6 +94,7 @@ public class EarthGrab extends EarthAbility {
this.damageThreshold = getConfig().getDouble("Abilities.Earth.EarthGrab.DamageThreshold"); this.damageThreshold = getConfig().getDouble("Abilities.Earth.EarthGrab.DamageThreshold");
this.origin = this.player.getLocation().clone(); this.origin = this.player.getLocation().clone();
this.direction = this.player.getLocation().getDirection().setY(0).normalize(); this.direction = this.player.getLocation().getDirection().setY(0).normalize();
this.lastHit = 0;
} }
@Override @Override

View file

@ -16,6 +16,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.BendingPlayer; import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
@ -27,27 +28,40 @@ public class EarthSmash extends EarthAbility {
START, LIFTING, LIFTED, GRABBED, SHOT, FLYING, REMOVED START, LIFTING, LIFTED, GRABBED, SHOT, FLYING, REMOVED
} }
@Attribute("AllowGrab")
private boolean allowGrab; private boolean allowGrab;
@Attribute("AllowFlight")
private boolean allowFlight; private boolean allowFlight;
private int animationCounter; private int animationCounter;
private int progressCounter; private int progressCounter;
private int requiredBendableBlocks; private int requiredBendableBlocks;
private int maxBlocksToPassThrough; private int maxBlocksToPassThrough;
private long delay; private long delay;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.CHARGE_DURATION)
private long chargeTime; private long chargeTime;
private long removeTimer; @Attribute(Attribute.DURATION)
private long flightRemoveTimer; private long duration;
@Attribute("Flight" + Attribute.DURATION)
private long flightDuration;
private long flightStartTime; private long flightStartTime;
private long shootAnimationInterval; private long shootAnimationInterval;
private long flightAnimationInterval; private long flightAnimationInterval;
private long liftAnimationInterval; private long liftAnimationInterval;
@Attribute(Attribute.SELECT_RANGE)
private double selectRange; private double selectRange;
@Attribute("GrabRange")
private double grabRange; private double grabRange;
@Attribute("ShootRange")
private double shootRange; private double shootRange;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.KNOCKBACK)
private double knockback; private double knockback;
@Attribute(Attribute.KNOCKUP)
private double knockup; private double knockup;
@Attribute(Attribute.SPEED)
private double flightSpeed; private double flightSpeed;
private double grabbedDistance; private double grabbedDistance;
private double grabDetectionRadius; private double grabDetectionRadius;
@ -125,42 +139,42 @@ public class EarthSmash extends EarthAbility {
public void setFields() { public void setFields() {
final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(this.player); final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(this.player);
this.shootAnimationInterval = getConfig().getLong("Abilities.Earth.EarthSmash.ShootAnimationInterval"); this.shootAnimationInterval = getConfig().getLong("Abilities.Earth.EarthSmash.Shoot.AnimationInterval");
this.flightAnimationInterval = getConfig().getLong("Abilities.Earth.EarthSmash.FlightAnimationInterval"); this.flightAnimationInterval = getConfig().getLong("Abilities.Earth.EarthSmash.Flight.AnimationInterval");
this.liftAnimationInterval = getConfig().getLong("Abilities.Earth.EarthSmash.LiftAnimationInterval"); this.liftAnimationInterval = getConfig().getLong("Abilities.Earth.EarthSmash.LiftAnimationInterval");
this.grabDetectionRadius = getConfig().getDouble("Abilities.Earth.EarthSmash.GrabDetectionRadius"); this.grabDetectionRadius = getConfig().getDouble("Abilities.Earth.EarthSmash.Grab.DetectionRadius");
this.flightDetectionRadius = getConfig().getDouble("Abilities.Earth.EarthSmash.FlightDetectionRadius"); this.flightDetectionRadius = getConfig().getDouble("Abilities.Earth.EarthSmash.Flight.DetectionRadius");
this.allowGrab = getConfig().getBoolean("Abilities.Earth.EarthSmash.AllowGrab"); this.allowGrab = getConfig().getBoolean("Abilities.Earth.EarthSmash.Grab.Enabled");
this.allowFlight = getConfig().getBoolean("Abilities.Earth.EarthSmash.AllowFlight"); this.allowFlight = getConfig().getBoolean("Abilities.Earth.EarthSmash.Flight.Enabled");
this.selectRange = getConfig().getDouble("Abilities.Earth.EarthSmash.SelectRange"); this.selectRange = getConfig().getDouble("Abilities.Earth.EarthSmash.SelectRange");
this.grabRange = getConfig().getDouble("Abilities.Earth.EarthSmash.GrabRange"); this.grabRange = getConfig().getDouble("Abilities.Earth.EarthSmash.Grab.Range");
this.shootRange = getConfig().getDouble("Abilities.Earth.EarthSmash.ShootRange"); this.shootRange = getConfig().getDouble("Abilities.Earth.EarthSmash.Shoot.Range");
this.damage = getConfig().getDouble("Abilities.Earth.EarthSmash.Damage"); this.damage = getConfig().getDouble("Abilities.Earth.EarthSmash.Damage");
this.knockback = getConfig().getDouble("Abilities.Earth.EarthSmash.Knockback"); this.knockback = getConfig().getDouble("Abilities.Earth.EarthSmash.Knockback");
this.knockup = getConfig().getDouble("Abilities.Earth.EarthSmash.Knockup"); this.knockup = getConfig().getDouble("Abilities.Earth.EarthSmash.Knockup");
this.flightSpeed = getConfig().getDouble("Abilities.Earth.EarthSmash.FlightSpeed"); this.flightSpeed = getConfig().getDouble("Abilities.Earth.EarthSmash.Flight.Speed");
this.chargeTime = getConfig().getLong("Abilities.Earth.EarthSmash.ChargeTime"); this.chargeTime = getConfig().getLong("Abilities.Earth.EarthSmash.ChargeTime");
this.cooldown = getConfig().getLong("Abilities.Earth.EarthSmash.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Earth.EarthSmash.Cooldown");
this.flightRemoveTimer = getConfig().getLong("Abilities.Earth.EarthSmash.FlightTimer"); this.flightDuration = getConfig().getLong("Abilities.Earth.EarthSmash.Flight.Duration");
this.removeTimer = getConfig().getLong("Abilities.Earth.EarthSmash.RemoveTimer"); this.duration = getConfig().getLong("Abilities.Earth.EarthSmash.Duration");
if (bPlayer.isAvatarState()) { if (bPlayer.isAvatarState()) {
this.selectRange = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.SelectRange"); this.selectRange = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.SelectRange");
this.grabRange = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.GrabRange"); this.grabRange = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.Grab.Range");
this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Earth.EarthSmash.ChargeTime"); this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Earth.EarthSmash.ChargeTime");
this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Earth.EarthSmash.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Earth.EarthSmash.Cooldown");
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.Damage"); this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.Damage");
this.knockback = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.Knockback"); this.knockback = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.Knockback");
this.flightSpeed = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.FlightSpeed"); this.flightSpeed = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.Flight.Speed");
this.flightRemoveTimer = getConfig().getLong("Abilities.Avatar.AvatarState.Earth.EarthSmash.FlightTimer"); this.flightDuration = getConfig().getLong("Abilities.Avatar.AvatarState.Earth.EarthSmash.Flight.Duration");
this.shootRange = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.ShootRange"); this.shootRange = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.EarthSmash.Shoot.Range");
} }
} }
@Override @Override
public void progress() { public void progress() {
this.progressCounter++; this.progressCounter++;
if (this.state == State.LIFTED && this.removeTimer > 0 && System.currentTimeMillis() - this.getStartTime() > this.removeTimer) { if (this.state == State.LIFTED && this.duration > 0 && System.currentTimeMillis() - this.getStartTime() > this.duration) {
this.remove(); this.remove();
return; return;
} }
@ -287,7 +301,7 @@ public class EarthSmash extends EarthAbility {
} }
this.draw(); this.draw();
} }
if (System.currentTimeMillis() - this.flightStartTime > this.flightRemoveTimer) { if (System.currentTimeMillis() - this.flightStartTime > this.flightDuration) {
this.remove(); this.remove();
return; return;
} }
@ -782,20 +796,20 @@ public class EarthSmash extends EarthAbility {
this.chargeTime = chargeTime; this.chargeTime = chargeTime;
} }
public long getRemoveTimer() { public long getDuration() {
return this.removeTimer; return this.duration;
} }
public void setRemoveTimer(final long removeTimer) { public void setDuration(final long duration) {
this.removeTimer = removeTimer; this.duration = duration;
} }
public long getFlightRemoveTimer() { public long getFlightDuration() {
return this.flightRemoveTimer; return this.flightDuration;
} }
public void setFlightRemoveTimer(final long flightRemoveTimer) { public void setFlightDuration(final long flightDuration) {
this.flightRemoveTimer = flightRemoveTimer; this.flightDuration = flightDuration;
} }
public long getFlightStartTime() { public long getFlightStartTime() {

View file

@ -16,6 +16,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.ElementalAbility; import com.projectkorra.projectkorra.ability.ElementalAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
@ -23,11 +24,15 @@ public class EarthTunnel extends EarthAbility {
private long interval; private long interval;
private long time; private long time;
@Attribute("Depth")
private double depth; private double depth;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private double radius; private double radius;
private double angle; private double angle;
@Attribute(Attribute.RADIUS)
private double maxRadius; private double maxRadius;
@Attribute(Attribute.RANGE)
private double range; private double range;
private double radiusIncrement; private double radiusIncrement;
private boolean revert; private boolean revert;

View file

@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
@ -22,11 +23,15 @@ public class RaiseEarth extends EarthAbility {
private static final Map<Block, Block> ALL_AFFECTED_BLOCKS = new ConcurrentHashMap<>(); private static final Map<Block, Block> ALL_AFFECTED_BLOCKS = new ConcurrentHashMap<>();
private int distance; private int distance;
@Attribute(Attribute.HEIGHT)
private int height; private int height;
private long time; private long time;
private long interval; private long interval;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.SELECT_RANGE)
private double selectRange; private double selectRange;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
private Block block; private Block block;
private Vector direction; private Vector direction;

View file

@ -8,14 +8,19 @@ import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
public class RaiseEarthWall extends EarthAbility { public class RaiseEarthWall extends EarthAbility {
@Attribute(Attribute.SELECT_RANGE)
private int selectRange; private int selectRange;
@Attribute(Attribute.HEIGHT)
private int height; private int height;
@Attribute(Attribute.WIDTH)
private int width; private int width;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private Location location; private Location location;
@ -35,6 +40,40 @@ public class RaiseEarthWall extends EarthAbility {
this.width = getConfig().getInt("Abilities.Avatar.AvatarState.Earth.RaiseEarth.Wall.Width"); this.width = getConfig().getInt("Abilities.Avatar.AvatarState.Earth.RaiseEarth.Wall.Width");
} }
start();
}
private static Vector getDegreeRoundedVector(Vector vec, final double degreeIncrement) {
if (vec == null) {
return null;
}
vec = vec.normalize();
final double[] dims = { vec.getX(), vec.getY(), vec.getZ() };
for (int i = 0; i < dims.length; i++) {
final double dim = dims[i];
final int sign = dim >= 0 ? 1 : -1;
final int dimDivIncr = (int) (dim / degreeIncrement);
final double lowerBound = dimDivIncr * degreeIncrement;
final double upperBound = (dimDivIncr + (1 * sign)) * degreeIncrement;
if (Math.abs(dim - lowerBound) < Math.abs(dim - upperBound)) {
dims[i] = lowerBound;
} else {
dims[i] = upperBound;
}
}
return new Vector(dims[0], dims[1], dims[2]);
}
@Override
public String getName() {
return "RaiseEarth";
}
@Override
public void progress() {
final Vector direction = player.getEyeLocation().getDirection().normalize(); final Vector direction = player.getEyeLocation().getDirection().normalize();
double ox, oy, oz; double ox, oy, oz;
direction.setY(0); direction.setY(0);
@ -90,39 +129,7 @@ public class RaiseEarthWall extends EarthAbility {
if (shouldAddCooldown) { if (shouldAddCooldown) {
this.bPlayer.addCooldown("RaiseEarthWall", this.cooldown); this.bPlayer.addCooldown("RaiseEarthWall", this.cooldown);
} }
} this.remove();
private static Vector getDegreeRoundedVector(Vector vec, final double degreeIncrement) {
if (vec == null) {
return null;
}
vec = vec.normalize();
final double[] dims = { vec.getX(), vec.getY(), vec.getZ() };
for (int i = 0; i < dims.length; i++) {
final double dim = dims[i];
final int sign = dim >= 0 ? 1 : -1;
final int dimDivIncr = (int) (dim / degreeIncrement);
final double lowerBound = dimDivIncr * degreeIncrement;
final double upperBound = (dimDivIncr + (1 * sign)) * degreeIncrement;
if (Math.abs(dim - lowerBound) < Math.abs(dim - upperBound)) {
dims[i] = lowerBound;
} else {
dims[i] = upperBound;
}
}
return new Vector(dims[0], dims[1], dims[2]);
}
@Override
public String getName() {
return "RaiseEarth";
}
@Override
public void progress() {
} }
@Override @Override

View file

@ -17,6 +17,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
@ -26,8 +27,11 @@ public class Ripple extends EarthAbility {
private int step; private int step;
private int maxStep; private int maxStep;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.KNOCKBACK)
private double knockback; private double knockback;
private Vector direction; private Vector direction;
private Location origin; private Location origin;

View file

@ -7,14 +7,18 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
public class Shockwave extends EarthAbility { public class Shockwave extends EarthAbility {
private boolean charged; private boolean charged;
@Attribute(Attribute.CHARGE_DURATION)
private long chargeTime; private long chargeTime;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private double angle; private double angle;
private double threshold; private double threshold;
@Attribute(Attribute.RANGE)
private double range; private double range;
public Shockwave(final Player player, final boolean fall) { public Shockwave(final Player player, final boolean fall) {

View file

@ -14,6 +14,7 @@ import org.bukkit.entity.Player;
import com.projectkorra.projectkorra.BendingPlayer; import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
public class Tremorsense extends EarthAbility { public class Tremorsense extends EarthAbility {
@ -21,10 +22,14 @@ public class Tremorsense extends EarthAbility {
private static final Map<Block, Player> BLOCKS = new ConcurrentHashMap<Block, Player>(); private static final Map<Block, Player> BLOCKS = new ConcurrentHashMap<Block, Player>();
private byte lightThreshold; private byte lightThreshold;
@Attribute("Depth")
private int maxDepth; private int maxDepth;
@Attribute(Attribute.RADIUS)
private int radius; private int radius;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private Block block; private Block block;
@Attribute(Attribute.RANGE)
private int stickyRange; private int stickyRange;
public Tremorsense(final Player player, final boolean clicked) { public Tremorsense(final Player player, final boolean clicked) {

View file

@ -10,15 +10,18 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.earthbending.EarthDome; import com.projectkorra.projectkorra.earthbending.EarthDome;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.ParticleEffect.BlockData; import com.projectkorra.projectkorra.util.ParticleEffect.BlockData;
public class EarthDomeOthers extends EarthAbility { public class EarthDomeOthers extends EarthAbility {
public Vector direction; private Vector direction;
public double range = 0, maxRange; private double range;
public Location loc; @Attribute(Attribute.RANGE)
private double maxRange;
private Location loc;
public EarthDomeOthers(final Player player) { public EarthDomeOthers(final Player player) {
super(player); super(player);
@ -34,6 +37,7 @@ public class EarthDomeOthers extends EarthAbility {
if (!isEarthbendable(this.loc.getBlock().getRelative(BlockFace.DOWN).getType(), true, true, true)) { if (!isEarthbendable(this.loc.getBlock().getRelative(BlockFace.DOWN).getType(), true, true, true)) {
return; return;
} }
this.range = 0;
this.direction = this.loc.getDirection().setY(0); this.direction = this.loc.getDirection().setY(0);
this.maxRange = getConfig().getDouble("Abilities.Earth.EarthDome.Range"); this.maxRange = getConfig().getDouble("Abilities.Earth.EarthDome.Range");
this.start(); this.start();

View file

@ -16,6 +16,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.ComboAbility; import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.earthbending.RaiseEarth; import com.projectkorra.projectkorra.earthbending.RaiseEarth;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
@ -23,9 +24,17 @@ import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.ParticleEffect.BlockData; import com.projectkorra.projectkorra.util.ParticleEffect.BlockData;
public class EarthPillars extends EarthAbility implements ComboAbility { public class EarthPillars extends EarthAbility implements ComboAbility {
public double radius, damage, power, fallThreshold;
public boolean damaging; @Attribute(Attribute.RADIUS)
public Map<RaiseEarth, LivingEntity> entities; private double radius;
@Attribute(Attribute.DAMAGE)
private double damage;
@Attribute(Attribute.KNOCKUP)
private double knockup;
private double fallThreshold;
private boolean damaging;
private boolean firstTime;
private Map<RaiseEarth, LivingEntity> entities;
public EarthPillars(final Player player, final boolean fall) { public EarthPillars(final Player player, final boolean fall) {
super(player); super(player);
@ -40,17 +49,8 @@ public class EarthPillars extends EarthAbility implements ComboAbility {
return; return;
} }
} }
for (final Entity e : GeneralMethods.getEntitiesAroundPoint(player.getLocation(), this.radius)) { this.firstTime = true;
if (e instanceof LivingEntity && e.getEntityId() != player.getEntityId() && isEarthbendable(e.getLocation().getBlock().getRelative(BlockFace.DOWN).getType(), true, true, false)) {
ParticleEffect.BLOCK_DUST.display(new BlockData(e.getLocation().clone().subtract(0, 1, 0).getBlock().getType(), (byte) 0), 1f, 0.1f, 1f, 0, 6, e.getLocation(), 255);
this.affect((LivingEntity) e);
}
}
if (this.entities.isEmpty()) {
return;
}
this.start(); this.start();
} }
@ -58,16 +58,16 @@ public class EarthPillars extends EarthAbility implements ComboAbility {
private void setFields(final boolean fall) { private void setFields(final boolean fall) {
this.radius = getConfig().getDouble("Abilities.Earth.EarthPillars.Radius"); this.radius = getConfig().getDouble("Abilities.Earth.EarthPillars.Radius");
this.damage = getConfig().getDouble("Abilities.Earth.EarthPillars.Damage.Value"); this.damage = getConfig().getDouble("Abilities.Earth.EarthPillars.Damage.Value");
this.power = getConfig().getDouble("Abilities.Earth.EarthPillars.Power"); this.knockup = getConfig().getDouble("Abilities.Earth.EarthPillars.Knockup");
this.damaging = getConfig().getBoolean("Abilities.Earth.EarthPillars.Damage.Enabled"); this.damaging = getConfig().getBoolean("Abilities.Earth.EarthPillars.Damage.Enabled");
this.entities = new HashMap<>(); this.entities = new HashMap<>();
if (fall) { if (fall) {
this.fallThreshold = getConfig().getDouble("Abilities.Earth.EarthPillars.FallThreshold"); this.fallThreshold = getConfig().getDouble("Abilities.Earth.EarthPillars.FallThreshold");
this.damaging = true; this.damaging = true;
this.damage *= this.power; this.damage *= this.knockup;
this.radius = this.fallThreshold; this.radius = this.fallThreshold;
this.power += (this.player.getFallDistance() > this.fallThreshold ? this.player.getFallDistance() : this.fallThreshold) / 100; this.knockup += (this.player.getFallDistance() > this.fallThreshold ? this.player.getFallDistance() : this.fallThreshold) / 100;
} }
} }
@ -78,6 +78,20 @@ public class EarthPillars extends EarthAbility implements ComboAbility {
@Override @Override
public void progress() { public void progress() {
if (firstTime) {
for (final Entity e : GeneralMethods.getEntitiesAroundPoint(player.getLocation(), this.radius)) {
if (e instanceof LivingEntity && e.getEntityId() != player.getEntityId() && isEarthbendable(e.getLocation().getBlock().getRelative(BlockFace.DOWN).getType(), true, true, false)) {
ParticleEffect.BLOCK_DUST.display(new BlockData(e.getLocation().clone().subtract(0, 1, 0).getBlock().getType(), (byte) 0), 1f, 0.1f, 1f, 0, 6, e.getLocation(), 255);
this.affect((LivingEntity) e);
}
}
if (this.entities.isEmpty()) {
return;
}
firstTime = false;
}
final List<RaiseEarth> removal = new ArrayList<>(); final List<RaiseEarth> removal = new ArrayList<>();
for (final RaiseEarth abil : this.entities.keySet()) { for (final RaiseEarth abil : this.entities.keySet()) {
if (abil.isRemoved() && abil.isStarted()) { if (abil.isRemoved() && abil.isStarted()) {
@ -87,7 +101,7 @@ public class EarthPillars extends EarthAbility implements ComboAbility {
continue; continue;
} }
lent.setVelocity(new Vector(0, this.power, 0)); lent.setVelocity(new Vector(0, this.knockup, 0));
} }
if (this.damaging) { if (this.damaging) {
DamageHandler.damageEntity(lent, this.damage, this); DamageHandler.damageEntity(lent, this.damage, this);

View file

@ -18,6 +18,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.LavaAbility; import com.projectkorra.projectkorra.ability.LavaAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
@ -44,8 +45,10 @@ public class LavaFlow extends LavaAbility {
private long time; private long time;
private long clickLavaDelay; private long clickLavaDelay;
private long clickLandDelay; private long clickLandDelay;
@Attribute("Click" + Attribute.COOLDOWN)
private long clickLavaCooldown; private long clickLavaCooldown;
private long clickLandCooldown; private long clickLandCooldown;
@Attribute("Shift" + Attribute.COOLDOWN)
private long shiftCooldown; private long shiftCooldown;
private long clickLavaCleanupDelay; private long clickLavaCleanupDelay;
private long clickLandCleanupDelay; private long clickLandCleanupDelay;
@ -53,14 +56,20 @@ public class LavaFlow extends LavaAbility {
private double particleOffset; private double particleOffset;
private double currentRadius; private double currentRadius;
private double shiftPlatformRadius; private double shiftPlatformRadius;
@Attribute("Shift" + Attribute.RADIUS)
private double shiftMaxRadius; private double shiftMaxRadius;
@Attribute("Shift" + Attribute.SPEED)
private double shiftFlowSpeed; private double shiftFlowSpeed;
private double shiftRemoveSpeed; private double shiftRemoveSpeed;
private double shiftRemoveDelay; private double shiftRemoveDelay;
@Attribute(Attribute.RANGE)
private double clickRange; private double clickRange;
@Attribute("Click" + Attribute.RADIUS)
private double clickLavaRadius; private double clickLavaRadius;
private double clickLandRadius; private double clickLandRadius;
@Attribute("ClickLava" + Attribute.SPEED)
private double lavaCreateSpeed; private double lavaCreateSpeed;
@Attribute("ClickLand" + Attribute.SPEED)
private double landCreateSpeed; private double landCreateSpeed;
private AbilityType type; private AbilityType type;
private Location origin; private Location origin;

View file

@ -11,12 +11,17 @@ import org.bukkit.inventory.ItemStack;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.MetalAbility; import com.projectkorra.projectkorra.ability.MetalAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
public class Extraction extends MetalAbility { public class Extraction extends MetalAbility {
@Attribute("DoubleChance")
private int doubleChance; private int doubleChance;
@Attribute("TripleChance")
private int tripleChance; private int tripleChance;
@Attribute(Attribute.SELECT_RANGE)
private int selectRange; private int selectRange;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private Block originBlock; private Block originBlock;

View file

@ -20,6 +20,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.MetalAbility; import com.projectkorra.projectkorra.ability.MetalAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempArmor; import com.projectkorra.projectkorra.util.TempArmor;
@ -31,23 +32,35 @@ public class MetalClips extends MetalAbility {
private boolean isBeingWorn; private boolean isBeingWorn;
private boolean isControlling; private boolean isControlling;
@Attribute("CanThrow")
private boolean canThrow; private boolean canThrow;
private boolean isMagnetized; private boolean isMagnetized;
@Attribute("CanUse4Clips")
private boolean canUse4Clips; private boolean canUse4Clips;
@Attribute("CanLoot")
private boolean canLoot; private boolean canLoot;
private boolean hasSnuck; private boolean hasSnuck;
private int metalClipsCount; private int metalClipsCount;
private int abilityType; private int abilityType;
private int armorTime; private int armorTime;
@Attribute("Magnet" + Attribute.RANGE)
private int magnetRange; private int magnetRange;
private long armorStartTime; private long armorStartTime;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute("Shoot" + Attribute.COOLDOWN)
private long shootCooldown; private long shootCooldown;
@Attribute("Crush" + Attribute.COOLDOWN)
private long crushCooldown; private long crushCooldown;
@Attribute("Magnet" + Attribute.COOLDOWN)
private long magnetCooldown; private long magnetCooldown;
private double magnetPower; @Attribute("Magnet" + Attribute.SPEED)
private double magnetSpeed;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute("Crush" + Attribute.DAMAGE)
private double crushDamage; private double crushDamage;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
private LivingEntity targetEntity; private LivingEntity targetEntity;
private List<Item> trackedIngots; private List<Item> trackedIngots;
@ -65,11 +78,11 @@ public class MetalClips extends MetalAbility {
this.range = getConfig().getDouble("Abilities.Earth.MetalClips.Range"); this.range = getConfig().getDouble("Abilities.Earth.MetalClips.Range");
this.cooldown = getConfig().getLong("Abilities.Earth.MetalClips.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Earth.MetalClips.Cooldown");
this.shootCooldown = 600; this.shootCooldown = 600;
this.crushCooldown = getConfig().getLong("Abilities.Earth.MetalClips.CrushCooldown"); this.crushCooldown = getConfig().getLong("Abilities.Earth.MetalClips.Crush.Cooldown");
this.magnetCooldown = getConfig().getLong("Abilities.Earth.MetalClips.MagnetCooldown"); this.magnetCooldown = getConfig().getLong("Abilities.Earth.MetalClips.Magnet.Cooldown");
this.magnetRange = getConfig().getInt("Abilities.Earth.MetalClips.MagnetRange"); this.magnetRange = getConfig().getInt("Abilities.Earth.MetalClips.Magnet.Range");
this.magnetPower = getConfig().getDouble("Abilities.Earth.MetalClips.MagnetPower"); this.magnetSpeed = getConfig().getDouble("Abilities.Earth.MetalClips.Magnet.Speed");
this.crushDamage = getConfig().getDouble("Abilities.Earth.MetalClips.CrushDamage"); this.crushDamage = getConfig().getDouble("Abilities.Earth.MetalClips.Crush.Damage");
this.damage = getConfig().getDouble("Abilities.Earth.MetalClips.Damage"); this.damage = getConfig().getDouble("Abilities.Earth.MetalClips.Damage");
this.canThrow = (getConfig().getBoolean("Abilities.Earth.MetalClips.ThrowEnabled") && player.hasPermission("bending.ability.metalclips.throw")); this.canThrow = (getConfig().getBoolean("Abilities.Earth.MetalClips.ThrowEnabled") && player.hasPermission("bending.ability.metalclips.throw"));
this.trackedIngots = new ArrayList<>(); this.trackedIngots = new ArrayList<>();
@ -333,7 +346,7 @@ public class MetalClips extends MetalAbility {
final Item iron = (Item) entity; final Item iron = (Item) entity;
if (Arrays.asList(METAL_ITEMS).contains(iron.getItemStack().getType())) { if (Arrays.asList(METAL_ITEMS).contains(iron.getItemStack().getType())) {
iron.setVelocity(vector.normalize().multiply(this.magnetPower).add(new Vector(0, 0.2, 0))); iron.setVelocity(vector.normalize().multiply(this.magnetSpeed).add(new Vector(0, 0.2, 0)));
} }
} }
} }
@ -639,12 +652,12 @@ public class MetalClips extends MetalAbility {
this.armorStartTime = armorStartTime; this.armorStartTime = armorStartTime;
} }
public double getMagnetPower() { public double getMagnetSpeed() {
return this.magnetPower; return this.magnetSpeed;
} }
public void setMagnetPower(final double magnetPower) { public void setMagnetSpeed(final double magnetSpeed) {
this.magnetPower = magnetPower; this.magnetSpeed = magnetSpeed;
} }
public double getRange() { public double getRange() {

View file

@ -5,13 +5,18 @@ import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.avatar.AvatarState;
public class Blaze extends FireAbility { public class Blaze extends FireAbility {
@Attribute("Arc")
private int arc; private int arc;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
public Blaze(final Player player) { public Blaze(final Player player) {

View file

@ -14,6 +14,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth; import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
public class BlazeArc extends FireAbility { public class BlazeArc extends FireAbility {
@ -26,7 +27,9 @@ public class BlazeArc extends FireAbility {
private long time; private long time;
private long interval; private long interval;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
private Location origin; private Location origin;
private Location location; private Location location;

View file

@ -5,10 +5,13 @@ import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
public class BlazeRing extends FireAbility { public class BlazeRing extends FireAbility {
@Attribute(Attribute.RANGE)
private int range; private int range;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private double angleIncrement; private double angleIncrement;
private Location location; private Location location;

View file

@ -30,6 +30,7 @@ public class FireBlast extends FireAbility {
private static final int MAX_TICKS = 10000; private static final int MAX_TICKS = 10000;
@Attribute("PowerFurnace")
private boolean powerFurnace; private boolean powerFurnace;
private boolean showParticles; private boolean showParticles;
private boolean dissipate; private boolean dissipate;
@ -38,7 +39,6 @@ public class FireBlast extends FireAbility {
private int ticks; private int ticks;
@Attribute(Attribute.COOLDOWN) @Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.SPEED)
private double speedFactor; private double speedFactor;
@Attribute(Attribute.RANGE) @Attribute(Attribute.RANGE)
private double range; private double range;
@ -47,8 +47,10 @@ public class FireBlast extends FireAbility {
@Attribute(Attribute.SPEED) @Attribute(Attribute.SPEED)
private double speed; private double speed;
private double collisionRadius; private double collisionRadius;
@Attribute(Attribute.FIRE_TICK)
private double fireTicks; private double fireTicks;
private double pushFactor; @Attribute(Attribute.KNOCKBACK)
private double knockback;
private Random random; private Random random;
private Location location; private Location location;
private Location origin; private Location origin;
@ -109,7 +111,7 @@ public class FireBlast extends FireAbility {
this.speed = getConfig().getDouble("Abilities.Fire.FireBlast.Speed"); this.speed = getConfig().getDouble("Abilities.Fire.FireBlast.Speed");
this.collisionRadius = getConfig().getDouble("Abilities.Fire.FireBlast.CollisionRadius"); this.collisionRadius = getConfig().getDouble("Abilities.Fire.FireBlast.CollisionRadius");
this.fireTicks = getConfig().getDouble("Abilities.Fire.FireBlast.FireTicks"); this.fireTicks = getConfig().getDouble("Abilities.Fire.FireBlast.FireTicks");
this.pushFactor = getConfig().getDouble("Abilities.Fire.FireBlast.Push"); this.knockback = getConfig().getDouble("Abilities.Fire.FireBlast.Knockback");
this.random = new Random(); this.random = new Random();
} }
@ -131,9 +133,9 @@ public class FireBlast extends FireAbility {
private void affect(final Entity entity) { private void affect(final Entity entity) {
if (entity.getUniqueId() != this.player.getUniqueId()) { if (entity.getUniqueId() != this.player.getUniqueId()) {
if (this.bPlayer.isAvatarState()) { if (this.bPlayer.isAvatarState()) {
GeneralMethods.setVelocity(entity, this.direction.clone().multiply(AvatarState.getValue(this.pushFactor))); GeneralMethods.setVelocity(entity, this.direction.clone().multiply(AvatarState.getValue(this.knockback)));
} else { } else {
GeneralMethods.setVelocity(entity, this.direction.clone().multiply(this.pushFactor)); GeneralMethods.setVelocity(entity, this.direction.clone().multiply(this.knockback));
} }
if (entity instanceof LivingEntity) { if (entity instanceof LivingEntity) {
entity.setFireTicks((int) (this.fireTicks * 20)); entity.setFireTicks((int) (this.fireTicks * 20));
@ -365,11 +367,11 @@ public class FireBlast extends FireAbility {
} }
public double getPushFactor() { public double getPushFactor() {
return this.pushFactor; return this.knockback;
} }
public void setPushFactor(final double pushFactor) { public void setPushFactor(final double pushFactor) {
this.pushFactor = pushFactor; this.knockback = pushFactor;
} }
public Random getRandom() { public Random getRandom() {

View file

@ -20,6 +20,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
@ -33,14 +34,22 @@ public class FireBlastCharged extends FireAbility {
private boolean canDamageBlocks; private boolean canDamageBlocks;
private boolean dissipate; private boolean dissipate;
private long time; private long time;
@Attribute(Attribute.CHARGE_DURATION)
private long chargeTime; private long chargeTime;
@Attribute(Attribute.COOLDOWN)
private long cooldown;
private long interval; private long interval;
@Attribute(Attribute.DAMAGE)
private double maxDamage; private double maxDamage;
@Attribute(Attribute.RANGE)
private double range; private double range;
private double collisionRadius; private double collisionRadius;
@Attribute(Attribute.DAMAGE + Attribute.RANGE)
private double damageRadius; private double damageRadius;
@Attribute("Explosion" + Attribute.RANGE)
private double explosionRadius; private double explosionRadius;
private double innerRadius; private double innerRadius;
@Attribute(Attribute.FIRE_TICK)
private double fireTicks; private double fireTicks;
private TNTPrimed explosion; private TNTPrimed explosion;
private Location origin; private Location origin;
@ -59,6 +68,7 @@ public class FireBlastCharged extends FireAbility {
this.canDamageBlocks = getConfig().getBoolean("Abilities.Fire.FireBlast.Charged.DamageBlocks"); this.canDamageBlocks = getConfig().getBoolean("Abilities.Fire.FireBlast.Charged.DamageBlocks");
this.dissipate = getConfig().getBoolean("Abilities.Fire.FireBlast.Dissipate"); this.dissipate = getConfig().getBoolean("Abilities.Fire.FireBlast.Dissipate");
this.chargeTime = getConfig().getLong("Abilities.Fire.FireBlast.Charged.ChargeTime"); this.chargeTime = getConfig().getLong("Abilities.Fire.FireBlast.Charged.ChargeTime");
this.cooldown = getConfig().getLong("Abilities.Fire.FireBlast.Charged.Cooldown");
this.time = System.currentTimeMillis(); this.time = System.currentTimeMillis();
this.interval = 25; this.interval = 25;
this.collisionRadius = getConfig().getDouble("Abilities.Fire.FireBlast.Charged.CollisionRadius"); this.collisionRadius = getConfig().getDouble("Abilities.Fire.FireBlast.Charged.CollisionRadius");
@ -238,10 +248,10 @@ public class FireBlastCharged extends FireAbility {
@Override @Override
public void progress() { public void progress() {
if (!this.bPlayer.canBendIgnoreBindsCooldowns(this) && !this.launched) { if (!this.bPlayer.canBendIgnoreBinds(this) && !this.launched) {
this.remove(); this.remove();
return; return;
} else if (!this.bPlayer.canBend(CoreAbility.getAbility("FireBlast")) && !this.launched) { } else if (!this.bPlayer.canBendIgnoreCooldowns(CoreAbility.getAbility("FireBlast")) && !this.launched) {
this.remove(); this.remove();
return; return;
} else if (!this.player.isSneaking() && !this.charged) { } else if (!this.player.isSneaking() && !this.charged) {
@ -297,6 +307,12 @@ public class FireBlastCharged extends FireAbility {
} }
} }
@Override
public void remove() {
super.remove();
bPlayer.addCooldown(this);
}
@Override @Override
public String getName() { public String getName() {
return "FireBlast"; return "FireBlast";
@ -309,7 +325,7 @@ public class FireBlastCharged extends FireAbility {
@Override @Override
public long getCooldown() { public long getCooldown() {
return 0; return cooldown;
} }
@Override @Override

View file

@ -13,13 +13,19 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
public class FireBurst extends FireAbility { public class FireBurst extends FireAbility {
@Attribute("Charged")
private boolean charged; private boolean charged;
@Attribute(Attribute.DAMAGE)
private int damage; private int damage;
@Attribute(Attribute.CHARGE_DURATION)
private long chargeTime; private long chargeTime;
@Attribute(Attribute.RANGE)
private long range; private long range;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private double angleTheta; private double angleTheta;
private double anglePhi; private double anglePhi;
@ -46,7 +52,7 @@ public class FireBurst extends FireAbility {
if (isDay(player.getWorld())) { if (isDay(player.getWorld())) {
this.chargeTime /= getDayFactor(); this.chargeTime /= getDayFactor();
} }
if (this.bPlayer.isAvatarState() || isSozinsComet(player.getWorld())) { if (this.bPlayer.isAvatarState()) {
this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.FireBurst.Damage"); this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.FireBurst.Damage");
this.damage = getConfig().getInt("Abilities.Avatar.AvatarState.Fire.FireBurst.Damage"); this.damage = getConfig().getInt("Abilities.Avatar.AvatarState.Fire.FireBurst.Damage");
this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.FireBurst.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.FireBurst.Cooldown");

View file

@ -10,14 +10,19 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.airbending.AirSpout; import com.projectkorra.projectkorra.airbending.AirSpout;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
public class FireJet extends FireAbility { public class FireJet extends FireAbility {
@Attribute("AvatarStateToggle")
private boolean avatarStateToggled; private boolean avatarStateToggled;
private long time; private long time;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
private Random random; private Random random;

View file

@ -15,21 +15,30 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.firebending.util.FireDamageTimer; import com.projectkorra.projectkorra.firebending.util.FireDamageTimer;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
public class FireShield extends FireAbility { public class FireShield extends FireAbility {
private boolean shield; private boolean shield;
@Attribute("IgniteEntities")
private boolean ignite; private boolean ignite;
@Attribute("Disc" + Attribute.DURATION)
private long discDuration; private long discDuration;
@Attribute("Shield" + Attribute.DURATION)
private long shieldDuration; private long shieldDuration;
private long interval; @Attribute("Disc" + Attribute.COOLDOWN)
private long discCooldown; private long discCooldown;
@Attribute("Shield" + Attribute.COOLDOWN)
private long shieldCooldown; private long shieldCooldown;
private double radius; @Attribute("Shield" + Attribute.RADIUS)
private double shieldRadius;
@Attribute("Disc" + Attribute.RADIUS)
private double discRadius; private double discRadius;
@Attribute("Disc" + Attribute.FIRE_TICK)
private double discFireTicks; private double discFireTicks;
@Attribute("Shield" + Attribute.FIRE_TICK)
private double shieldFireTicks; private double shieldFireTicks;
private Location location; private Location location;
private Random random; private Random random;
@ -50,7 +59,7 @@ public class FireShield extends FireAbility {
this.discFireTicks = getConfig().getDouble("Abilities.Fire.FireShield.Disc.FireTicks"); this.discFireTicks = getConfig().getDouble("Abilities.Fire.FireShield.Disc.FireTicks");
this.shieldCooldown = getConfig().getLong("Abilities.Fire.FireShield.Shield.Cooldown"); this.shieldCooldown = getConfig().getLong("Abilities.Fire.FireShield.Shield.Cooldown");
this.shieldDuration = getConfig().getLong("Abilities.Fire.FireShield.Shield.Duration"); this.shieldDuration = getConfig().getLong("Abilities.Fire.FireShield.Shield.Duration");
this.radius = getConfig().getDouble("Abilities.Fire.FireShield.Shield.Radius"); this.shieldRadius = getConfig().getDouble("Abilities.Fire.FireShield.Shield.Radius");
this.shieldFireTicks = getConfig().getDouble("Abilities.Fire.FireShield.Shield.FireTicks"); this.shieldFireTicks = getConfig().getDouble("Abilities.Fire.FireShield.Shield.FireTicks");
this.random = new Random(); this.random = new Random();
@ -76,7 +85,7 @@ public class FireShield extends FireAbility {
if (fshield.shield) { if (fshield.shield) {
if (!playerLoc.getWorld().equals(loc.getWorld())) { if (!playerLoc.getWorld().equals(loc.getWorld())) {
return false; return false;
} else if (playerLoc.distanceSquared(loc) <= fshield.radius * fshield.radius) { } else if (playerLoc.distanceSquared(loc) <= fshield.shieldRadius * fshield.shieldRadius) {
return true; return true;
} }
} else { } else {
@ -112,7 +121,7 @@ public class FireShield extends FireAbility {
final double rphi = Math.toRadians(phi); final double rphi = Math.toRadians(phi);
final double rtheta = Math.toRadians(theta); final double rtheta = Math.toRadians(theta);
final Location display = this.location.clone().add(this.radius / 1.5 * Math.cos(rphi) * Math.sin(rtheta), this.radius / 1.5 * Math.cos(rtheta), this.radius / 1.5 * Math.sin(rphi) * Math.sin(rtheta)); final Location display = this.location.clone().add(this.shieldRadius / 1.5 * Math.cos(rphi) * Math.sin(rtheta), this.shieldRadius / 1.5 * Math.cos(rtheta), this.shieldRadius / 1.5 * Math.sin(rphi) * Math.sin(rtheta));
if (this.random.nextInt(6) == 0) { if (this.random.nextInt(6) == 0) {
ParticleEffect.SMOKE.display(display, 0, 0, 0, 0, 1); ParticleEffect.SMOKE.display(display, 0, 0, 0, 0, 1);
} }
@ -130,14 +139,14 @@ public class FireShield extends FireAbility {
this.increment = 20; this.increment = 20;
} }
for (final Block testblock : GeneralMethods.getBlocksAroundPoint(this.player.getLocation(), this.radius)) { for (final Block testblock : GeneralMethods.getBlocksAroundPoint(this.player.getLocation(), this.shieldRadius)) {
if (testblock.getType() == Material.FIRE) { if (testblock.getType() == Material.FIRE) {
testblock.setType(Material.AIR); testblock.setType(Material.AIR);
testblock.getWorld().playEffect(testblock.getLocation(), Effect.EXTINGUISH, 0); testblock.getWorld().playEffect(testblock.getLocation(), Effect.EXTINGUISH, 0);
} }
} }
for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(this.location, this.radius)) { for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(this.location, this.shieldRadius)) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation())) { if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation())) {
continue; continue;
} else if (entity instanceof LivingEntity) { } else if (entity instanceof LivingEntity) {
@ -152,12 +161,12 @@ public class FireShield extends FireAbility {
} else { } else {
this.location = this.player.getEyeLocation().clone(); this.location = this.player.getEyeLocation().clone();
final Vector direction = this.location.getDirection(); final Vector direction = this.location.getDirection();
this.location = this.location.clone().add(direction.multiply(this.radius)); this.location.add(direction.multiply(this.shieldRadius));
ParticleEffect.FLAME.display(this.location, 0.2f, 0.2f, 0.2f, 0.023f, 3); ParticleEffect.FLAME.display(this.location, 0.2f, 0.2f, 0.2f, 0.00023f, 3);
for (double theta = 0; theta < 360; theta += 20) { for (double theta = 0; theta < 360; theta += 20) {
final Vector vector = GeneralMethods.getOrthogonalVector(direction, theta, this.discRadius / 1.5); final Vector vector = GeneralMethods.getOrthogonalVector(direction, theta, this.discRadius / 1.5);
final Location display = this.location.clone().add(vector); final Location display = this.location.add(vector);
if (this.random.nextInt(6) == 0) { if (this.random.nextInt(6) == 0) {
ParticleEffect.SMOKE.display(display, 0, 0, 0, 0, 1); ParticleEffect.SMOKE.display(display, 0, 0, 0, 0, 1);
} }
@ -165,9 +174,10 @@ public class FireShield extends FireAbility {
if (this.random.nextInt(4) == 0) { if (this.random.nextInt(4) == 0) {
playFirebendingSound(display); playFirebendingSound(display);
} }
this.location.subtract(vector);
} }
for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(this.location, this.discRadius)) { for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(this.location, this.discRadius + 1)) {
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation())) { if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation())) {
continue; continue;
} else if (entity instanceof LivingEntity) { } else if (entity instanceof LivingEntity) {
@ -209,7 +219,7 @@ public class FireShield extends FireAbility {
@Override @Override
public double getCollisionRadius() { public double getCollisionRadius() {
return this.shield ? this.radius : this.discRadius; return this.shield ? this.shieldRadius : this.discRadius;
} }
public boolean isShield() { public boolean isShield() {
@ -240,20 +250,12 @@ public class FireShield extends FireAbility {
this.shieldDuration = duration; this.shieldDuration = duration;
} }
public long getInterval() { public double getShieldRadius() {
return this.interval; return this.shieldRadius;
} }
public void setInterval(final long interval) { public void setShieldRadius(final double shieldRadius) {
this.interval = interval; this.shieldRadius = shieldRadius;
}
public double getRadius() {
return this.radius;
}
public void setRadius(final double radius) {
this.radius = radius;
} }
public double getDiscRadius() { public double getDiscRadius() {

View file

@ -24,6 +24,7 @@ import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.earthbending.lava.LavaFlow; import com.projectkorra.projectkorra.earthbending.lava.LavaFlow;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.ReflectionHandler.PackageType; import com.projectkorra.projectkorra.util.ReflectionHandler.PackageType;
@ -47,15 +48,20 @@ public class HeatControl extends FireAbility {
private HeatControlType heatControlType; private HeatControlType heatControlType;
// HeatControl Cook variables. // HeatControl Cook variables.
@Attribute("CookTime")
private long cookTime; private long cookTime;
private long cookInterval; private long cookInterval;
// HeatControl Extinguish variables. // HeatControl Extinguish variables.
@Attribute("Extinguish" + Attribute.COOLDOWN)
private long extinguishCooldown; private long extinguishCooldown;
@Attribute("Extinguish" + Attribute.RADIUS)
private double extinguishRadius; private double extinguishRadius;
// HeatControl Melt variables. // HeatControl Melt variables.
@Attribute("Melt" + Attribute.RANGE)
private double meltRange; private double meltRange;
@Attribute("Melt" + Attribute.RADIUS)
private double meltRadius; private double meltRadius;
private Location meltLocation; private Location meltLocation;
private static final Map<Block, TempBlock> MELTED_BLOCKS = new HashMap<>(); private static final Map<Block, TempBlock> MELTED_BLOCKS = new HashMap<>();
@ -65,7 +71,9 @@ public class HeatControl extends FireAbility {
private long solidifyDelay; private long solidifyDelay;
private long solidifyLastBlockTime; private long solidifyLastBlockTime;
private long solidifyRevertTime; private long solidifyRevertTime;
@Attribute("Solidify" + Attribute.RADIUS)
private double solidifyMaxRadius; private double solidifyMaxRadius;
@Attribute("Solidify" + Attribute.RANGE)
private double solidifyRange; private double solidifyRange;
private boolean solidifyRevert; private boolean solidifyRevert;
private boolean solidifying; private boolean solidifying;

View file

@ -12,6 +12,7 @@ import org.bukkit.entity.Player;
import com.projectkorra.projectkorra.Element; import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
public class Illumination extends FireAbility { public class Illumination extends FireAbility {
@ -19,7 +20,9 @@ public class Illumination extends FireAbility {
private static final Map<TempBlock, Player> BLOCKS = new ConcurrentHashMap<>(); private static final Map<TempBlock, Player> BLOCKS = new ConcurrentHashMap<>();
private byte normalData; private byte normalData;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.RANGE)
private double range; private double range;
private int lightThreshold; private int lightThreshold;
private Material normalType; private Material normalType;

View file

@ -14,6 +14,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.firebending.util.FireDamageTimer; import com.projectkorra.projectkorra.firebending.util.FireDamageTimer;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
@ -24,15 +25,22 @@ public class WallOfFire extends FireAbility {
private boolean active; private boolean active;
private int damageTick; private int damageTick;
private int intervalTick; private int intervalTick;
@Attribute(Attribute.RANGE)
private int range; private int range;
@Attribute(Attribute.HEIGHT)
private int height; private int height;
@Attribute(Attribute.WIDTH)
private int width; private int width;
private int damage; @Attribute(Attribute.DAMAGE)
private double damage;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long damageInterval; private long damageInterval;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
private long time; private long time;
private long interval; private long interval;
@Attribute(Attribute.FIRE_TICK)
private double fireTicks; private double fireTicks;
private double maxAngle; private double maxAngle;
private Random random; private Random random;
@ -48,7 +56,7 @@ public class WallOfFire extends FireAbility {
this.range = getConfig().getInt("Abilities.Fire.WallOfFire.Range"); this.range = getConfig().getInt("Abilities.Fire.WallOfFire.Range");
this.height = getConfig().getInt("Abilities.Fire.WallOfFire.Height"); this.height = getConfig().getInt("Abilities.Fire.WallOfFire.Height");
this.width = getConfig().getInt("Abilities.Fire.WallOfFire.Width"); this.width = getConfig().getInt("Abilities.Fire.WallOfFire.Width");
this.damage = getConfig().getInt("Abilities.Fire.WallOfFire.Damage"); this.damage = getConfig().getDouble("Abilities.Fire.WallOfFire.Damage");
this.cooldown = getConfig().getLong("Abilities.Fire.WallOfFire.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Fire.WallOfFire.Cooldown");
this.damageInterval = getConfig().getLong("Abilities.Fire.WallOfFire.DamageInterval"); this.damageInterval = getConfig().getLong("Abilities.Fire.WallOfFire.DamageInterval");
this.duration = getConfig().getLong("Abilities.Fire.WallOfFire.Duration"); this.duration = getConfig().getLong("Abilities.Fire.WallOfFire.Duration");
@ -284,7 +292,7 @@ public class WallOfFire extends FireAbility {
this.width = width; this.width = width;
} }
public int getDamage() { public double getDamage() {
return this.damage; return this.damage;
} }

View file

@ -16,13 +16,18 @@ import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
public class FireKick extends FireAbility implements ComboAbility { public class FireKick extends FireAbility implements ComboAbility {
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute(Attribute.RANGE)
private double range; private double range;
private Location location; private Location location;
private Location destination; private Location destination;

View file

@ -17,14 +17,20 @@ import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
public class FireSpin extends FireAbility implements ComboAbility { public class FireSpin extends FireAbility implements ComboAbility {
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.KNOCKBACK)
private double knockback; private double knockback;
private Location destination; private Location destination;
private ArrayList<LivingEntity> affectedEntities; private ArrayList<LivingEntity> affectedEntities;

View file

@ -17,6 +17,7 @@ import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.ElementalAbility; import com.projectkorra.projectkorra.ability.ElementalAbility;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.firebending.util.FireDamageTimer; import com.projectkorra.projectkorra.firebending.util.FireDamageTimer;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
@ -27,12 +28,18 @@ public class FireWheel extends FireAbility implements ComboAbility {
private Location origin; private Location origin;
private Location location; private Location location;
private Vector direction; private Vector direction;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.HEIGHT)
private int height; private int height;
private int radius; private int radius;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute(Attribute.FIRE_TICK)
private double fireTicks; private double fireTicks;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
private ArrayList<LivingEntity> affectedEntities; private ArrayList<LivingEntity> affectedEntities;

View file

@ -10,6 +10,7 @@ import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.ComboAbility; import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.firebending.FireJet; import com.projectkorra.projectkorra.firebending.FireJet;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
@ -18,15 +19,18 @@ public class JetBlast extends FireAbility implements ComboAbility {
private boolean firstTime; private boolean firstTime;
private long time; private long time;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
private ArrayList<FireComboStream> tasks; private ArrayList<FireComboStream> tasks;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
public JetBlast(final Player player) { public JetBlast(final Player player) {
super(player); super(player);
if (!this.bPlayer.canBendIgnoreBindsCooldowns(this)) { if (!this.bPlayer.canBendIgnoreBinds(this)) {
return; return;
} }

View file

@ -12,6 +12,7 @@ import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.ComboAbility; import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.firebending.FireJet; import com.projectkorra.projectkorra.firebending.FireJet;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
@ -21,19 +22,24 @@ public class JetBlaze extends FireAbility implements ComboAbility {
private boolean firstTime; private boolean firstTime;
private int progressCounter; private int progressCounter;
private long time; private long time;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute(Attribute.FIRE_TICK)
private double fireTicks; private double fireTicks;
private Vector direction; private Vector direction;
private ArrayList<LivingEntity> affectedEntities; private ArrayList<LivingEntity> affectedEntities;
private ArrayList<FireComboStream> tasks; private ArrayList<FireComboStream> tasks;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
public JetBlaze(final Player player) { public JetBlaze(final Player player) {
super(player); super(player);
if (!this.bPlayer.canBendIgnoreBindsCooldowns(this)) { if (!this.bPlayer.canBendIgnoreBinds(this)) {
return; return;
} }

View file

@ -13,6 +13,7 @@ import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CombustionAbility; import com.projectkorra.projectkorra.ability.CombustionAbility;
import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
@ -23,11 +24,17 @@ public class Combustion extends CombustionAbility {
private boolean breakBlocks; private boolean breakBlocks;
private int ticks; private int ticks;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private float power; @Attribute("ExplosivePower")
private float explosivePower;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.RADIUS)
private double radius; private double radius;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute(Attribute.RANGE)
private double range; private double range;
private double speedFactor; private double speedFactor;
private Location location; private Location location;
@ -43,7 +50,7 @@ public class Combustion extends CombustionAbility {
this.ticks = 0; this.ticks = 0;
this.breakBlocks = getConfig().getBoolean("Abilities.Fire.Combustion.BreakBlocks"); this.breakBlocks = getConfig().getBoolean("Abilities.Fire.Combustion.BreakBlocks");
this.power = (float) getConfig().getDouble("Abilities.Fire.Combustion.Power"); this.explosivePower = (float) getConfig().getDouble("Abilities.Fire.Combustion.ExplosivePower");
this.cooldown = getConfig().getLong("Abilities.Fire.Combustion.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Fire.Combustion.Cooldown");
this.damage = getConfig().getDouble("Abilities.Fire.Combustion.Damage"); this.damage = getConfig().getDouble("Abilities.Fire.Combustion.Damage");
this.radius = getConfig().getDouble("Abilities.Fire.Combustion.Radius"); this.radius = getConfig().getDouble("Abilities.Fire.Combustion.Radius");
@ -72,7 +79,7 @@ public class Combustion extends CombustionAbility {
public static void explode(final Player player) { public static void explode(final Player player) {
final Combustion combustion = getAbility(player, Combustion.class); final Combustion combustion = getAbility(player, Combustion.class);
if (combustion != null) { if (combustion != null) {
combustion.createExplosion(combustion.location, combustion.power, combustion.breakBlocks); combustion.createExplosion(combustion.location, combustion.explosivePower, combustion.breakBlocks);
ParticleEffect.EXPLODE.display(combustion.location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 3); ParticleEffect.EXPLODE.display(combustion.location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 3);
} }
} }
@ -140,14 +147,14 @@ public class Combustion extends CombustionAbility {
final Block block = this.location.getBlock(); final Block block = this.location.getBlock();
if (block != null) { if (block != null) {
if (block.getType() != Material.AIR && !isWater(block)) { if (block.getType() != Material.AIR && !isWater(block)) {
this.createExplosion(block.getLocation(), this.power, this.breakBlocks); this.createExplosion(block.getLocation(), this.explosivePower, this.breakBlocks);
} }
} }
for (final Entity entity : this.location.getWorld().getEntities()) { for (final Entity entity : this.location.getWorld().getEntities()) {
if (entity instanceof LivingEntity) { if (entity instanceof LivingEntity) {
if (entity.getLocation().distanceSquared(this.location) <= 4 && !entity.equals(this.player)) { if (entity.getLocation().distanceSquared(this.location) <= 4 && !entity.equals(this.player)) {
this.createExplosion(this.location, this.power, this.breakBlocks); this.createExplosion(this.location, this.explosivePower, this.breakBlocks);
} }
} }
} }
@ -203,12 +210,12 @@ public class Combustion extends CombustionAbility {
this.ticks = ticks; this.ticks = ticks;
} }
public float getPower() { public float getExplosivePower() {
return this.power; return this.explosivePower;
} }
public void setPower(final float power) { public void setExplosivePower(final float explosivePower) {
this.power = power; this.explosivePower = explosivePower;
} }
public double getDamage() { public double getDamage() {

View file

@ -15,6 +15,7 @@ import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.LightningAbility; import com.projectkorra.projectkorra.ability.LightningAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.MovementHandler; import com.projectkorra.projectkorra.util.MovementHandler;
@ -26,26 +27,40 @@ public class Lightning extends LightningAbility {
private static final int POINT_GENERATION = 5; private static final int POINT_GENERATION = 5;
@Attribute("Charged")
private boolean charged; private boolean charged;
private boolean hitWater; private boolean hitWater;
private boolean hitIce; private boolean hitIce;
private boolean selfHitWater; private boolean selfHitWater;
private boolean selfHitClose; private boolean selfHitClose;
@Attribute("ArcOnIce")
private boolean arcOnIce; private boolean arcOnIce;
private int waterArcs; private int waterArcs;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.CHARGE_DURATION)
private double chargeTime; private double chargeTime;
@Attribute("SubArcChance")
private double subArcChance; private double subArcChance;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute("MaxChainArcs")
private double maxChainArcs; private double maxChainArcs;
@Attribute("Chain" + Attribute.RANGE)
private double chainRange; private double chainRange;
@Attribute("WaterArc" + Attribute.RANGE)
private double waterArcRange; private double waterArcRange;
@Attribute("ChainArcChance")
private double chainArcChance; private double chainArcChance;
@Attribute("StunChance")
private double stunChance; private double stunChance;
@Attribute("Stun" + Attribute.DURATION)
private double stunDuration; private double stunDuration;
@Attribute("MaxArcAngle")
private double maxArcAngle; private double maxArcAngle;
private double particleRotation; private double particleRotation;
private long time; private long time;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private State state; private State state;
private Location origin; private Location origin;
@ -108,10 +123,6 @@ public class Lightning extends LightningAbility {
this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.Lightning.ChargeTime"); this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.Lightning.ChargeTime");
this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.Lightning.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.Lightning.Cooldown");
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.Lightning.Damage"); this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.Lightning.Damage");
} else if (isSozinsComet(player.getWorld())) {
this.chargeTime = 0;
this.cooldown = 0;
} }
this.start(); this.start();
} }

View file

@ -17,6 +17,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
@ -36,7 +37,9 @@ public class OctopusForm extends WaterAbility {
private boolean settingUp; private boolean settingUp;
private boolean forming; private boolean forming;
private boolean formed; private boolean formed;
@Attribute(Attribute.RANGE)
private int range; private int range;
@Attribute(Attribute.DAMAGE)
private int damage; private int damage;
private int currentAnimationStep; private int currentAnimationStep;
private int stepCounter; private int stepCounter;
@ -44,11 +47,17 @@ public class OctopusForm extends WaterAbility {
private long time; private long time;
private long startTime; private long startTime;
private long interval; private long interval;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
@Attribute("Attack" + Attribute.RANGE)
private double attackRange; private double attackRange;
@Attribute("Usage" + Attribute.COOLDOWN)
private long usageCooldown; private long usageCooldown;
@Attribute(Attribute.KNOCKBACK)
private double knockback; private double knockback;
@Attribute(Attribute.RADIUS)
private double radius; private double radius;
private double startAngle; private double startAngle;
private double angle; private double angle;

View file

@ -18,6 +18,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.BendingPlayer; import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.firebending.FireBlast; import com.projectkorra.projectkorra.firebending.FireBlast;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
@ -38,9 +39,13 @@ public class SurgeWall extends WaterAbility {
private boolean frozen; private boolean frozen;
private long time; private long time;
private long interval; private long interval;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
@Attribute(Attribute.RADIUS)
private double radius; private double radius;
@Attribute(Attribute.RANGE)
private double range; private double range;
private Block sourceBlock; private Block sourceBlock;
private Location location; private Location location;

View file

@ -18,6 +18,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.firebending.FireBlast; import com.projectkorra.projectkorra.firebending.FireBlast;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
@ -34,15 +35,23 @@ public class SurgeWave extends WaterAbility {
private boolean progressing; private boolean progressing;
private boolean canHitSelf; private boolean canHitSelf;
private long time; private long time;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long interval; private long interval;
@Attribute("IceRevertTime")
private long iceRevertTime; private long iceRevertTime;
private double currentRadius; private double currentRadius;
@Attribute(Attribute.RADIUS)
private double maxRadius; private double maxRadius;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.SELECT_RANGE)
private double selectRange; private double selectRange;
private double pushFactor; @Attribute(Attribute.KNOCKBACK)
private double verticalFactor; private double knockback;
@Attribute(Attribute.KNOCKUP)
private double knockup;
@Attribute("Freeze" + Attribute.RADIUS)
private double maxFreezeRadius; private double maxFreezeRadius;
private Block sourceBlock; private Block sourceBlock;
private Location location; private Location location;
@ -68,8 +77,8 @@ public class SurgeWave extends WaterAbility {
this.cooldown = getConfig().getLong("Abilities.Water.Surge.Wave.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Water.Surge.Wave.Cooldown");
this.interval = getConfig().getLong("Abilities.Water.Surge.Wave.Interval"); this.interval = getConfig().getLong("Abilities.Water.Surge.Wave.Interval");
this.maxRadius = getConfig().getDouble("Abilities.Water.Surge.Wave.Radius"); this.maxRadius = getConfig().getDouble("Abilities.Water.Surge.Wave.Radius");
this.pushFactor = getConfig().getDouble("Abilities.Water.Surge.Wave.HorizontalPush"); this.knockback = getConfig().getDouble("Abilities.Water.Surge.Wave.Knockback");
this.verticalFactor = getConfig().getDouble("Abilities.Water.Surge.Wave.VerticalPush"); this.knockup = getConfig().getDouble("Abilities.Water.Surge.Wave.Knockup");
this.maxFreezeRadius = getConfig().getDouble("Abilities.Water.Surge.Wave.MaxFreezeRadius"); this.maxFreezeRadius = getConfig().getDouble("Abilities.Water.Surge.Wave.MaxFreezeRadius");
this.iceRevertTime = getConfig().getLong("Abilities.Water.Surge.Wave.IceRevertTime"); this.iceRevertTime = getConfig().getLong("Abilities.Water.Surge.Wave.IceRevertTime");
this.range = getConfig().getDouble("Abilities.Water.Surge.Wave.Range"); this.range = getConfig().getDouble("Abilities.Water.Surge.Wave.Range");
@ -201,7 +210,7 @@ public class SurgeWave extends WaterAbility {
this.range = this.getNightFactor(this.range); this.range = this.getNightFactor(this.range);
if (this.bPlayer.isAvatarState()) { if (this.bPlayer.isAvatarState()) {
this.pushFactor = AvatarState.getValue(this.pushFactor); this.knockback = AvatarState.getValue(this.knockback);
} }
final Entity target = GeneralMethods.getTargetedEntity(this.player, this.range); final Entity target = GeneralMethods.getTargetedEntity(this.player, this.range);
@ -321,8 +330,8 @@ public class SurgeWave extends WaterAbility {
} }
if (knockback) { if (knockback) {
final Vector dir = direction.clone(); final Vector dir = direction.clone();
dir.setY(dir.getY() * this.verticalFactor); dir.setY(dir.getY() * this.knockup);
GeneralMethods.setVelocity(entity, entity.getVelocity().clone().add(dir.clone().multiply(this.getNightFactor(this.pushFactor)))); GeneralMethods.setVelocity(entity, entity.getVelocity().clone().add(dir.clone().multiply(this.getNightFactor(this.knockback))));
entity.setFallDistance(0); entity.setFallDistance(0);
if (entity.getFireTicks() > 0) { if (entity.getFireTicks() > 0) {
@ -541,20 +550,20 @@ public class SurgeWave extends WaterAbility {
this.range = range; this.range = range;
} }
public double getPushFactor() { public double getKnockback() {
return this.pushFactor; return this.knockback;
} }
public void setPushFactor(final double pushFactor) { public void setKnockback(final double knockback) {
this.pushFactor = pushFactor; this.knockback = knockback;
} }
public double getVerticalFactor() { public double getKnockup() {
return this.verticalFactor; return this.knockup;
} }
public void setVerticalFactor(final double verticalFactor) { public void setKnockup(final double knockup) {
this.verticalFactor = verticalFactor; this.knockup = knockup;
} }
public double getMaxFreezeRadius() { public double getMaxFreezeRadius() {

View file

@ -18,6 +18,7 @@ import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
@ -46,17 +47,26 @@ public class Torrent extends WaterAbility {
private int hits = 1; private int hits = 1;
private long time; private long time;
private long interval; private long interval;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long revertTime; private long revertTime;
private double startAngle; private double startAngle;
private double angle; private double angle;
@Attribute(Attribute.RADIUS)
private double radius; private double radius;
private double push; @Attribute(Attribute.KNOCKBACK)
private double maxUpwardForce; private double knockback;
@Attribute(Attribute.KNOCKUP)
private double knockup;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute("Successive" + Attribute.DAMAGE)
private double successiveDamage; private double successiveDamage;
@Attribute("Deflect" + Attribute.DAMAGE)
private double deflectDamage; private double deflectDamage;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.SELECT_RANGE)
private double selectRange; private double selectRange;
private Block sourceBlock; private Block sourceBlock;
private TempBlock source; private TempBlock source;
@ -71,10 +81,10 @@ public class Torrent extends WaterAbility {
this.layer = 0; this.layer = 0;
this.startAngle = 0; this.startAngle = 0;
this.maxLayer = getConfig().getInt("Abilities.Water.Torrent.MaxLayer"); this.maxLayer = getConfig().getInt("Abilities.Water.Torrent.MaxLayer");
this.push = getConfig().getDouble("Abilities.Water.Torrent.Push"); this.knockback = getConfig().getDouble("Abilities.Water.Torrent.Knockback");
this.angle = getConfig().getDouble("Abilities.Water.Torrent.Angle"); this.angle = getConfig().getDouble("Abilities.Water.Torrent.Angle");
this.radius = getConfig().getDouble("Abilities.Water.Torrent.Radius"); this.radius = getConfig().getDouble("Abilities.Water.Torrent.Radius");
this.maxUpwardForce = getConfig().getDouble("Abilities.Water.Torrent.MaxUpwardForce"); this.knockup = getConfig().getDouble("Abilities.Water.Torrent.Knockup");
this.interval = getConfig().getLong("Abilities.Water.Torrent.Interval"); this.interval = getConfig().getLong("Abilities.Water.Torrent.Interval");
this.damage = getConfig().getDouble("Abilities.Water.Torrent.InitialDamage"); this.damage = getConfig().getDouble("Abilities.Water.Torrent.InitialDamage");
this.successiveDamage = getConfig().getDouble("Abilities.Water.Torrent.SuccessiveDamage"); this.successiveDamage = getConfig().getDouble("Abilities.Water.Torrent.SuccessiveDamage");
@ -105,7 +115,7 @@ public class Torrent extends WaterAbility {
} }
if (this.bPlayer.isAvatarState()) { if (this.bPlayer.isAvatarState()) {
this.push = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Torrent.Push"); this.knockback = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Torrent.Push");
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Torrent.InitialDamage"); this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Torrent.InitialDamage");
this.successiveDamage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Torrent.SuccessiveDamage"); this.successiveDamage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Torrent.SuccessiveDamage");
this.maxHits = getConfig().getInt("Abilities.Avatar.AvatarState.Water.Torrent.MaxHits"); this.maxHits = getConfig().getInt("Abilities.Avatar.AvatarState.Water.Torrent.MaxHits");
@ -540,7 +550,7 @@ public class Torrent extends WaterAbility {
vx = (x * Math.cos(angle) - z * Math.sin(angle)) / mag; vx = (x * Math.cos(angle) - z * Math.sin(angle)) / mag;
vz = (x * Math.sin(angle) + z * Math.cos(angle)) / mag; vz = (x * Math.sin(angle) + z * Math.cos(angle)) / mag;
final Vector vec = new Vector(vx, 0, vz).normalize().multiply(this.push); final Vector vec = new Vector(vx, 0, vz).normalize().multiply(this.knockback);
final Vector velocity = entity.getVelocity(); final Vector velocity = entity.getVelocity();
if (this.bPlayer.isAvatarState()) { if (this.bPlayer.isAvatarState()) {
@ -564,11 +574,11 @@ public class Torrent extends WaterAbility {
if (entity.getEntityId() == this.player.getEntityId()) { if (entity.getEntityId() == this.player.getEntityId()) {
return; return;
} }
if (direction.getY() > this.maxUpwardForce) { if (direction.getY() > this.knockup) {
direction.setY(this.maxUpwardForce); direction.setY(this.knockup);
} }
if (!this.freeze) { if (!this.freeze) {
entity.setVelocity(direction.multiply(this.push)); entity.setVelocity(direction.multiply(this.knockback));
} }
if (entity instanceof LivingEntity && !this.hurtEntities.contains(entity)) { if (entity instanceof LivingEntity && !this.hurtEntities.contains(entity)) {
double damageDealt = this.getNightFactor(this.damage); double damageDealt = this.getNightFactor(this.damage);
@ -810,19 +820,19 @@ public class Torrent extends WaterAbility {
} }
public double getPush() { public double getPush() {
return this.push; return this.knockback;
} }
public void setPush(final double push) { public void setPush(final double push) {
this.push = push; this.knockback = push;
} }
public double getMaxUpwardForce() { public double getMaxUpwardForce() {
return this.maxUpwardForce; return this.knockup;
} }
public void setMaxUpwardForce(final double maxUpwardForce) { public void setMaxUpwardForce(final double maxUpwardForce) {
this.maxUpwardForce = maxUpwardForce; this.knockup = maxUpwardForce;
} }
public double getDamage() { public double getDamage() {

View file

@ -15,6 +15,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.util.WaterReturn; import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
@ -22,11 +23,16 @@ public class TorrentWave extends WaterAbility {
private long time; private long time;
private long interval; private long interval;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private double radius; private double radius;
@Attribute(Attribute.RADIUS)
private double maxRadius; private double maxRadius;
@Attribute(Attribute.KNOCKBACK)
private double knockback; private double knockback;
@Attribute(Attribute.HEIGHT)
private double maxHeight; private double maxHeight;
@Attribute("Grow" + Attribute.SPEED)
private double growSpeed; private double growSpeed;
private Location origin; private Location origin;
private ArrayList<TempBlock> blocks; private ArrayList<TempBlock> blocks;

View file

@ -15,15 +15,20 @@ import org.bukkit.material.MaterialData;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
public class WaterBubble extends WaterAbility { public class WaterBubble extends WaterAbility {
private static long clickDuration; // How long the click variant lasts. @Attribute("Click" + Attribute.DURATION)
private static double maxRadius; private long clickDuration;
private static double speed; @Attribute(Attribute.RADIUS)
private static boolean requireAir = false; private double maxRadius;
@Attribute(Attribute.SPEED)
private double speed;
@Attribute("RequireAir")
private boolean requireAir;
private boolean isShift; private boolean isShift;
private double radius; private double radius;

View file

@ -20,6 +20,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
@ -40,12 +41,20 @@ public class WaterManipulation extends WaterAbility {
private boolean prepared; private boolean prepared;
private int dispelRange; private int dispelRange;
private long time; private long time;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long interval; private long interval;
private double selectRange, range; @Attribute(Attribute.SELECT_RANGE)
private double pushFactor; private double selectRange;
@Attribute(Attribute.RANGE)
private double range;
@Attribute(Attribute.KNOCKBACK)
private double knockback;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute("Deflect" + Attribute.RANGE)
private double deflectRange; private double deflectRange;
private double collisionRadius; private double collisionRadius;
private Block sourceBlock; private Block sourceBlock;
@ -73,7 +82,7 @@ public class WaterManipulation extends WaterAbility {
this.cooldown = getConfig().getLong("Abilities.Water.WaterManipulation.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Water.WaterManipulation.Cooldown");
this.selectRange = getConfig().getDouble("Abilities.Water.WaterManipulation.SelectRange"); this.selectRange = getConfig().getDouble("Abilities.Water.WaterManipulation.SelectRange");
this.range = getConfig().getDouble("Abilities.Water.WaterManipulation.Range"); this.range = getConfig().getDouble("Abilities.Water.WaterManipulation.Range");
this.pushFactor = getConfig().getDouble("Abilities.Water.WaterManipulation.Push"); this.knockback = getConfig().getDouble("Abilities.Water.WaterManipulation.Knockback");
this.damage = getConfig().getDouble("Abilities.Water.WaterManipulation.Damage"); this.damage = getConfig().getDouble("Abilities.Water.WaterManipulation.Damage");
this.speed = getConfig().getDouble("Abilities.Water.WaterManipulation.Speed"); this.speed = getConfig().getDouble("Abilities.Water.WaterManipulation.Speed");
this.deflectRange = getConfig().getDouble("Abilities.Water.WaterManipulation.DeflectRange"); this.deflectRange = getConfig().getDouble("Abilities.Water.WaterManipulation.DeflectRange");
@ -271,7 +280,7 @@ public class WaterManipulation extends WaterAbility {
if (entity instanceof LivingEntity && entity.getEntityId() != this.player.getEntityId()) { if (entity instanceof LivingEntity && entity.getEntityId() != this.player.getEntityId()) {
final Location location = this.player.getEyeLocation(); final Location location = this.player.getEyeLocation();
final Vector vector = location.getDirection(); final Vector vector = location.getDirection();
entity.setVelocity(vector.normalize().multiply(this.pushFactor)); entity.setVelocity(vector.normalize().multiply(this.knockback));
if (this.bPlayer.isAvatarState()) { if (this.bPlayer.isAvatarState()) {
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.WaterManipulation.Damage"); this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.WaterManipulation.Damage");
@ -678,11 +687,11 @@ public class WaterManipulation extends WaterAbility {
} }
public double getPushFactor() { public double getPushFactor() {
return this.pushFactor; return this.knockback;
} }
public void setPushFactor(final double pushFactor) { public void setPushFactor(final double pushFactor) {
this.pushFactor = pushFactor; this.knockback = pushFactor;
} }
public double getDamage() { public double getDamage() {

View file

@ -24,6 +24,7 @@ public class WaterSpout extends WaterAbility {
private static final Map<Block, Block> AFFECTED_BLOCKS = new ConcurrentHashMap<Block, Block>(); private static final Map<Block, Block> AFFECTED_BLOCKS = new ConcurrentHashMap<Block, Block>();
private final List<TempBlock> blocks = new ArrayList<TempBlock>(); private final List<TempBlock> blocks = new ArrayList<TempBlock>();
@Attribute("CanBendOnPackedIce")
private boolean canBendOnPackedIce; private boolean canBendOnPackedIce;
private boolean useParticles; private boolean useParticles;
private boolean useBlockSpiral; private boolean useBlockSpiral;
@ -32,10 +33,12 @@ public class WaterSpout extends WaterAbility {
private long interval; private long interval;
@Attribute(Attribute.COOLDOWN) @Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
private long startTime; private long startTime;
private double rotation; private double rotation;
private double height; private double height;
@Attribute(Attribute.HEIGHT)
private double maxHeight; private double maxHeight;
private Block base; private Block base;
private TempBlock baseBlock; private TempBlock baseBlock;

View file

@ -22,6 +22,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.combo.IceWave; import com.projectkorra.projectkorra.waterbending.combo.IceWave;
@ -39,6 +40,7 @@ public class WaterSpoutWave extends WaterAbility {
private static final Map<Block, TempBlock> FROZEN_BLOCKS = new ConcurrentHashMap<>(); private static final Map<Block, TempBlock> FROZEN_BLOCKS = new ConcurrentHashMap<>();
@Attribute(Attribute.RADIUS)
private double radius; private double radius;
private boolean charging; private boolean charging;
private boolean iceWave; private boolean iceWave;
@ -49,14 +51,22 @@ public class WaterSpoutWave extends WaterAbility {
private boolean revertIceSphere; private boolean revertIceSphere;
private int progressCounter; private int progressCounter;
private long time; private long time;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long revertSphereTime; private long revertSphereTime;
@Attribute(Attribute.SELECT_RANGE)
private double selectRange; private double selectRange;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute(Attribute.CHARGE_DURATION)
private double chargeTime; private double chargeTime;
private double flightTime; @Attribute("Flight" + Attribute.DURATION)
private double flightDuration;
@Attribute("Wave" + Attribute.RADIUS)
private double waveRadius; private double waveRadius;
@Attribute("Thaw" + Attribute.RADIUS)
private double thawRadius; private double thawRadius;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
private double animationSpeed; private double animationSpeed;
private AbilityType type; private AbilityType type;
@ -84,7 +94,7 @@ public class WaterSpoutWave extends WaterAbility {
this.speed = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.Speed"); this.speed = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.Speed");
this.damage = getConfig().getDouble("Abilities.Water.IceWave.Damage"); this.damage = getConfig().getDouble("Abilities.Water.IceWave.Damage");
this.chargeTime = getConfig().getLong("Abilities.Water.WaterSpout.Wave.ChargeTime"); this.chargeTime = getConfig().getLong("Abilities.Water.WaterSpout.Wave.ChargeTime");
this.flightTime = getConfig().getLong("Abilities.Water.WaterSpout.Wave.FlightTime"); this.flightDuration = getConfig().getLong("Abilities.Water.WaterSpout.Wave.FlightDuration");
this.cooldown = getConfig().getLong("Abilities.Water.WaterSpout.Wave.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Water.WaterSpout.Wave.Cooldown");
this.revertSphereTime = getConfig().getLong("Abilities.Water.IceWave.RevertSphereTime"); this.revertSphereTime = getConfig().getLong("Abilities.Water.IceWave.RevertSphereTime");
this.revertIceSphere = getConfig().getBoolean("Abilities.Water.IceWave.RevertSphere"); this.revertIceSphere = getConfig().getBoolean("Abilities.Water.IceWave.RevertSphere");
@ -100,7 +110,7 @@ public class WaterSpoutWave extends WaterAbility {
if (this.bPlayer.isAvatarState()) { if (this.bPlayer.isAvatarState()) {
this.chargeTime = 0; this.chargeTime = 0;
this.flightTime = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.WaterWave.FlightTime"); this.flightDuration = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.WaterWave.FlightDuration");
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceWave.Damage"); this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceWave.Damage");
this.cooldown = 0; this.cooldown = 0;
} }
@ -263,13 +273,13 @@ public class WaterSpoutWave extends WaterAbility {
} else { } else {
this.moving = true; this.moving = true;
this.collidable = true; this.collidable = true;
if ((System.currentTimeMillis() - this.time > this.flightTime && !this.bPlayer.isAvatarState()) || this.player.isSneaking()) { if ((System.currentTimeMillis() - this.time > this.flightDuration && !this.bPlayer.isAvatarState()) || this.player.isSneaking()) {
this.remove(); this.remove();
return; return;
} }
this.player.setFallDistance(0f); this.player.setFallDistance(0f);
double currentSpeed = this.speed - (this.speed * (System.currentTimeMillis() - this.time) / this.flightTime); double currentSpeed = this.speed - (this.speed * (System.currentTimeMillis() - this.time) / this.flightDuration);
final double nightSpeed = this.getNightFactor(currentSpeed * 0.9); final double nightSpeed = this.getNightFactor(currentSpeed * 0.9);
currentSpeed = nightSpeed > currentSpeed ? nightSpeed : currentSpeed; currentSpeed = nightSpeed > currentSpeed ? nightSpeed : currentSpeed;
if (this.bPlayer.isAvatarState()) { if (this.bPlayer.isAvatarState()) {
@ -607,12 +617,12 @@ public class WaterSpoutWave extends WaterAbility {
this.chargeTime = chargeTime; this.chargeTime = chargeTime;
} }
public double getFlightTime() { public double getFlightDuration() {
return this.flightTime; return this.flightDuration;
} }
public void setFlightTime(final double flightTime) { public void setFlightDuration(final double flightDuration) {
this.flightTime = flightTime; this.flightDuration = flightDuration;
} }
public double getWaveRadius() { public double getWaveRadius() {

View file

@ -20,6 +20,7 @@ import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.BloodAbility; import com.projectkorra.projectkorra.ability.BloodAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker; import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
@ -30,14 +31,20 @@ public class Bloodbending extends BloodAbility {
private static final Map<Entity, Player> TARGETED_ENTITIES = new ConcurrentHashMap<Entity, Player>(); private static final Map<Entity, Player> TARGETED_ENTITIES = new ConcurrentHashMap<Entity, Player>();
private boolean canOnlyBeUsedAtNight; private boolean canOnlyBeUsedAtNight;
@Attribute("CanBeUsedOnUndeadMobs")
private boolean canBeUsedOnUndeadMobs; private boolean canBeUsedOnUndeadMobs;
private boolean onlyUsableDuringMoon; private boolean onlyUsableDuringMoon;
@Attribute("CanBloodbendOtherBloodbenders")
private boolean canBloodbendOtherBloodbenders; private boolean canBloodbendOtherBloodbenders;
@Attribute(Attribute.RANGE)
private int range; private int range;
private long time; private long time;
private long holdTime; @Attribute(Attribute.DURATION)
private long duration;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private double throwFactor; @Attribute(Attribute.KNOCKBACK)
private double knockback;
private Entity target; private Entity target;
private Vector vector; private Vector vector;
@ -55,9 +62,9 @@ public class Bloodbending extends BloodAbility {
this.onlyUsableDuringMoon = getConfig().getBoolean("Abilities.Water.Bloodbending.CanOnlyBeUsedDuringFullMoon"); this.onlyUsableDuringMoon = getConfig().getBoolean("Abilities.Water.Bloodbending.CanOnlyBeUsedDuringFullMoon");
this.canBloodbendOtherBloodbenders = getConfig().getBoolean("Abilities.Water.Bloodbending.CanBloodbendOtherBloodbenders"); this.canBloodbendOtherBloodbenders = getConfig().getBoolean("Abilities.Water.Bloodbending.CanBloodbendOtherBloodbenders");
this.range = getConfig().getInt("Abilities.Water.Bloodbending.Range"); this.range = getConfig().getInt("Abilities.Water.Bloodbending.Range");
this.holdTime = getConfig().getInt("Abilities.Water.Bloodbending.HoldTime"); this.duration = getConfig().getInt("Abilities.Water.Bloodbending.Duration");
this.cooldown = getConfig().getInt("Abilities.Water.Bloodbending.Cooldown"); this.cooldown = getConfig().getInt("Abilities.Water.Bloodbending.Cooldown");
this.throwFactor = getConfig().getDouble("Abilities.Water.Bloodbending.ThrowFactor"); this.knockback = getConfig().getDouble("Abilities.Water.Bloodbending.Knockback");
this.vector = new Vector(0, 0, 0); this.vector = new Vector(0, 0, 0);
if (this.canOnlyBeUsedAtNight && !isNight(player.getWorld()) && !this.bPlayer.canBloodbendAtAnytime()) { if (this.canOnlyBeUsedAtNight && !isNight(player.getWorld()) && !this.bPlayer.canBloodbendAtAnytime()) {
@ -150,7 +157,7 @@ public class Bloodbending extends BloodAbility {
vector = GeneralMethods.getDirection(location, GeneralMethods.getTargetedLocation(this.player, location.distance(target))); vector = GeneralMethods.getDirection(location, GeneralMethods.getTargetedLocation(this.player, location.distance(target)));
} }
vector.normalize(); vector.normalize();
entity.setVelocity(vector.multiply(this.throwFactor)); entity.setVelocity(vector.multiply(this.knockback));
new HorizontalVelocityTracker(entity, this.player, 200, this); new HorizontalVelocityTracker(entity, this.player, 200, this);
} }
this.remove(); this.remove();
@ -164,7 +171,7 @@ public class Bloodbending extends BloodAbility {
if (!this.player.isSneaking()) { if (!this.player.isSneaking()) {
this.remove(); this.remove();
return; return;
} else if (this.holdTime > 0 && System.currentTimeMillis() - this.time > this.holdTime) { } else if (this.duration > 0 && System.currentTimeMillis() - this.time > this.duration) {
this.remove(); this.remove();
this.bPlayer.addCooldown(this); this.bPlayer.addCooldown(this);
return; return;
@ -417,20 +424,20 @@ public class Bloodbending extends BloodAbility {
this.time = time; this.time = time;
} }
public long getHoldTime() { public long getDuration() {
return this.holdTime; return this.duration;
} }
public void setHoldTime(final long holdTime) { public void setDuration(final long duration) {
this.holdTime = holdTime; this.duration = duration;
} }
public double getThrowFactor() { public double getKnockback() {
return this.throwFactor; return this.knockback;
} }
public void setThrowFactor(final double throwFactor) { public void setKnockback(final double knockback) {
this.throwFactor = throwFactor; this.knockback = knockback;
} }
public Entity getTarget() { public Entity getTarget() {

View file

@ -23,6 +23,7 @@ import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.IceAbility; import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.firebending.combo.FireComboStream; import com.projectkorra.projectkorra.firebending.combo.FireComboStream;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
@ -40,14 +41,20 @@ public class IceBullet extends IceAbility implements ComboAbility {
private int leftClicks; private int leftClicks;
private int rightClicks; private int rightClicks;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.RADIUS)
private double radius; private double radius;
private double shootTime; private double shootTime;
private double shots; private double shots;
@Attribute("MaxShots")
private double maxShots; private double maxShots;
private double animationSpeed; private double animationSpeed;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long time; private long time;
private String name; private String name;

View file

@ -11,6 +11,7 @@ import org.bukkit.entity.Player;
import com.projectkorra.projectkorra.ability.ComboAbility; import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.IceAbility; import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.WaterSpoutWave; import com.projectkorra.projectkorra.waterbending.WaterSpoutWave;
@ -19,6 +20,7 @@ public class IceWave extends IceAbility implements ComboAbility {
private static final Map<Block, TempBlock> FROZEN_BLOCKS = new ConcurrentHashMap<>(); private static final Map<Block, TempBlock> FROZEN_BLOCKS = new ConcurrentHashMap<>();
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private Location origin; private Location origin;

View file

@ -18,6 +18,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.ElementalAbility; import com.projectkorra.projectkorra.ability.ElementalAbility;
import com.projectkorra.projectkorra.ability.HealingAbility; import com.projectkorra.projectkorra.ability.HealingAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.chiblocking.Smokescreen; import com.projectkorra.projectkorra.chiblocking.Smokescreen;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.util.WaterReturn; import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
@ -25,12 +26,16 @@ import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
public class HealingWaters extends HealingAbility { public class HealingWaters extends HealingAbility {
// Configurable Variables. // Configurable Variables.
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.RANGE)
private double range; private double range;
private long interval; private long interval;
@Attribute(Attribute.CHARGE_DURATION)
private long chargeTime; private long chargeTime;
private int power; @Attribute("PotionPotency")
private int potDuration; private int potionPotency;
@Attribute(Attribute.DURATION)
private long duration; private long duration;
private boolean enableParticles; private boolean enableParticles;
@ -76,8 +81,7 @@ public class HealingWaters extends HealingAbility {
this.range = getConfig().getDouble("Abilities.Water.HealingWaters.Range"); this.range = getConfig().getDouble("Abilities.Water.HealingWaters.Range");
this.interval = getConfig().getLong("Abilities.Water.HealingWaters.Interval"); this.interval = getConfig().getLong("Abilities.Water.HealingWaters.Interval");
this.chargeTime = getConfig().getLong("Abilities.Water.HealingWaters.ChargeTime"); this.chargeTime = getConfig().getLong("Abilities.Water.HealingWaters.ChargeTime");
this.power = getConfig().getInt("Abilities.Water.HealingWaters.Power"); this.potionPotency = getConfig().getInt("Abilities.Water.HealingWaters.PotionPotency");
this.potDuration = getConfig().getInt("Abilities.Water.HealingWaters.HealingDuration");
this.duration = getConfig().getLong("Abilities.Water.HealingWaters.Duration"); this.duration = getConfig().getLong("Abilities.Water.HealingWaters.Duration");
this.enableParticles = getConfig().getBoolean("Abilities.Water.HealingWaters.EnableParticles"); this.enableParticles = getConfig().getBoolean("Abilities.Water.HealingWaters.EnableParticles");
this.hex = "00ffff"; this.hex = "00ffff";
@ -210,7 +214,7 @@ public class HealingWaters extends HealingAbility {
private void applyHealing(final Player player) { private void applyHealing(final Player player) {
if (!GeneralMethods.isRegionProtectedFromBuild(player, "HealingWaters", player.getLocation())) { if (!GeneralMethods.isRegionProtectedFromBuild(player, "HealingWaters", player.getLocation())) {
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, this.potDuration, this.power)); player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 30, this.potionPotency));
AirAbility.breakBreathbendingHold(player); AirAbility.breakBreathbendingHold(player);
this.healing = true; this.healing = true;
this.healingSelf = true; this.healingSelf = true;
@ -219,7 +223,7 @@ public class HealingWaters extends HealingAbility {
private void applyHealing(final LivingEntity livingEntity) { private void applyHealing(final LivingEntity livingEntity) {
if (livingEntity.getHealth() < livingEntity.getMaxHealth()) { if (livingEntity.getHealth() < livingEntity.getMaxHealth()) {
livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, this.potDuration, this.power)); livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 30, this.potionPotency));
AirAbility.breakBreathbendingHold(livingEntity); AirAbility.breakBreathbendingHold(livingEntity);
this.healing = true; this.healing = true;
this.healingSelf = false; this.healingSelf = false;

View file

@ -18,6 +18,7 @@ import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.IceAbility; import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.BlockSource; import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
@ -33,11 +34,15 @@ public class IceBlast extends IceAbility {
private boolean progressing; private boolean progressing;
private byte data; private byte data;
private long time; private long time;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long interval; private long interval;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
private double collisionRadius; private double collisionRadius;
@Attribute("Deflect" + Attribute.RANGE)
private double deflectRange; private double deflectRange;
private Block sourceBlock; private Block sourceBlock;
private Location location; private Location location;

View file

@ -17,6 +17,7 @@ import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.IceAbility; import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.util.TempPotionEffect; import com.projectkorra.projectkorra.util.TempPotionEffect;
@ -29,15 +30,22 @@ public class IceSpikeBlast extends IceAbility {
private boolean settingUp; private boolean settingUp;
private boolean progressing; private boolean progressing;
private byte data; private byte data;
private int slowPower; @Attribute("SlowPotency")
private int slowPotency;
@Attribute("Slow" + Attribute.DURATION)
private int slowDuration; private int slowDuration;
private long time; private long time;
private long interval; private long interval;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute("Slow" + Attribute.COOLDOWN)
private long slowCooldown; private long slowCooldown;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
private double collisionRadius; private double collisionRadius;
@Attribute("Deflect" + Attribute.RANGE)
private double deflectRange; private double deflectRange;
private Block sourceBlock; private Block sourceBlock;
private Location location; private Location location;
@ -60,7 +68,7 @@ public class IceSpikeBlast extends IceAbility {
this.range = getConfig().getDouble("Abilities.Water.IceSpike.Blast.Range"); this.range = getConfig().getDouble("Abilities.Water.IceSpike.Blast.Range");
this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Blast.Damage"); this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Blast.Damage");
this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Blast.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Blast.Cooldown");
this.slowPower = getConfig().getInt("Abilities.Water.IceSpike.Blast.SlowPower"); this.slowPotency = getConfig().getInt("Abilities.Water.IceSpike.Blast.SlowPotency");
this.slowDuration = getConfig().getInt("Abilities.Water.IceSpike.Blast.SlowDuration"); this.slowDuration = getConfig().getInt("Abilities.Water.IceSpike.Blast.SlowDuration");
if (!this.bPlayer.canBend(this) || !this.bPlayer.canIcebend()) { if (!this.bPlayer.canBend(this) || !this.bPlayer.canIcebend()) {
@ -72,14 +80,14 @@ public class IceSpikeBlast extends IceAbility {
this.slowCooldown = 0; this.slowCooldown = 0;
this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.Range"); this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.Range");
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.Damage"); this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.Damage");
this.slowPower = getConfig().getInt("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.SlowPower"); this.slowPotency = getConfig().getInt("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.SlowPotency");
this.slowDuration = getConfig().getInt("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.SlowDuration"); this.slowDuration = getConfig().getInt("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.SlowDuration");
} }
block(player); block(player);
this.range = this.getNightFactor(this.range); this.range = this.getNightFactor(this.range);
this.damage = this.getNightFactor(this.damage); this.damage = this.getNightFactor(this.damage);
this.slowPower = (int) this.getNightFactor(this.slowPower); this.slowPotency = (int) this.getNightFactor(this.slowPotency);
this.sourceBlock = getWaterSourceBlock(player, this.range, this.bPlayer.canPlantbend()); this.sourceBlock = getWaterSourceBlock(player, this.range, this.bPlayer.canPlantbend());
if (this.sourceBlock == null) { if (this.sourceBlock == null) {
this.sourceBlock = getIceSourceBlock(player, this.range); this.sourceBlock = getIceSourceBlock(player, this.range);
@ -101,13 +109,13 @@ public class IceSpikeBlast extends IceAbility {
return; return;
} }
if (targetBPlayer.canBeSlowed()) { if (targetBPlayer.canBeSlowed()) {
final PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, this.slowDuration, this.slowPower); final PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, this.slowDuration, this.slowPotency);
new TempPotionEffect(entity, effect); new TempPotionEffect(entity, effect);
targetBPlayer.slow(this.slowCooldown); targetBPlayer.slow(this.slowCooldown);
DamageHandler.damageEntity(entity, this.damage, this); DamageHandler.damageEntity(entity, this.damage, this);
} }
} else { } else {
final PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, this.slowDuration, this.slowPower); final PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, this.slowDuration, this.slowPotency);
new TempPotionEffect(entity, effect); new TempPotionEffect(entity, effect);
DamageHandler.damageEntity(entity, this.damage, this); DamageHandler.damageEntity(entity, this.damage, this);
} }
@ -479,12 +487,12 @@ public class IceSpikeBlast extends IceAbility {
this.data = data; this.data = data;
} }
public int getSlowPower() { public int getSlowPotency() {
return this.slowPower; return this.slowPotency;
} }
public void setSlowPower(final int slowPower) { public void setSlowPotency(final int slowPotency) {
this.slowPower = slowPower; this.slowPotency = slowPotency;
} }
public int getSlowDuration() { public int getSlowDuration() {

View file

@ -20,6 +20,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.IceAbility; import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.util.TempPotionEffect; import com.projectkorra.projectkorra.util.TempPotionEffect;
@ -29,18 +30,27 @@ public class IceSpikePillar extends IceAbility {
/** The list of blocks IceSpike uses */ /** The list of blocks IceSpike uses */
private final Map<Block, TempBlock> ice_blocks = new HashMap<Block, TempBlock>(); private final Map<Block, TempBlock> ice_blocks = new HashMap<Block, TempBlock>();
@Attribute(Attribute.HEIGHT)
private int height; private int height;
private int progress; private int progress;
@Attribute("SlowPotency")
private int slowPower; private int slowPower;
@Attribute("Slow" + Attribute.DURATION)
private int slowDuration; private int slowDuration;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long time; private long time;
private long removeTimestamp; private long removeTimestamp;
private long removeTimer; @Attribute(Attribute.DURATION)
private long duration;
private long interval; private long interval;
@Attribute("Slow" + Attribute.COOLDOWN)
private long slowCooldown; private long slowCooldown;
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.RANGE)
private double range; private double range;
@Attribute(Attribute.SPEED)
private double speed; private double speed;
private Block source_block; // The block clicked on. private Block source_block; // The block clicked on.
private Block base_block; // The block at the bottom of the pillar. private Block base_block; // The block at the bottom of the pillar.
@ -194,7 +204,7 @@ public class IceSpikePillar extends IceAbility {
this.removeTimestamp = System.currentTimeMillis(); this.removeTimestamp = System.currentTimeMillis();
} else { } else {
// If it's time to remove. // If it's time to remove.
if (this.removeTimestamp != 0 && this.removeTimestamp + this.removeTimer <= System.currentTimeMillis()) { if (this.removeTimestamp != 0 && this.removeTimestamp + this.duration <= System.currentTimeMillis()) {
if (!this.sinkPillar()) { if (!this.sinkPillar()) {
this.remove(); this.remove();
return; return;
@ -344,12 +354,12 @@ public class IceSpikePillar extends IceAbility {
this.removeTimestamp = removeTimestamp; this.removeTimestamp = removeTimestamp;
} }
public long getRemoveTimer() { public long getDuration() {
return this.removeTimer; return this.duration;
} }
public void setRemoveTimer(final long removeTimer) { public void setDuration(final long duration) {
this.removeTimer = removeTimer; this.duration = duration;
} }
public long getInterval() { public long getInterval() {

View file

@ -16,14 +16,21 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.IceAbility; import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
public class IceSpikePillarField extends IceAbility { public class IceSpikePillarField extends IceAbility {
@Attribute(Attribute.DAMAGE)
private double damage; private double damage;
@Attribute(Attribute.RADIUS)
private double radius; private double radius;
@Attribute("NumberOfSpikes")
private int numberOfSpikes; private int numberOfSpikes;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
@Attribute(Attribute.KNOCKUP)
private double knockup;
private Vector thrownForce; private Vector thrownForce;
public IceSpikePillarField(final Player player) { public IceSpikePillarField(final Player player) {
@ -36,16 +43,25 @@ public class IceSpikePillarField extends IceAbility {
this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Field.Damage"); this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Field.Damage");
this.radius = getConfig().getDouble("Abilities.Water.IceSpike.Field.Radius"); this.radius = getConfig().getDouble("Abilities.Water.IceSpike.Field.Radius");
this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Field.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Field.Cooldown");
this.thrownForce = new Vector(0, getConfig().getDouble("Abilities.Water.IceSpike.Field.Push"), 0); this.knockup = getConfig().getDouble("Abilities.Water.IceSpike.Field.Knockup");
if (this.bPlayer.isAvatarState()) { if (this.bPlayer.isAvatarState()) {
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Damage"); this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Damage");
this.radius = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Radius"); this.radius = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Radius");
this.thrownForce = new Vector(0, getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Push"), 0);
} }
this.numberOfSpikes = (int) (((this.radius * 2) * (this.radius * 2)) / 16); this.numberOfSpikes = (int) (((this.radius) * (this.radius)) / 4);
start();
}
@Override
public String getName() {
return "IceSpike";
}
@Override
public void progress() {
this.thrownForce = new Vector(0, knockup, 0);
final Random random = new Random(); final Random random = new Random();
final int locX = player.getLocation().getBlockX(); final int locX = player.getLocation().getBlockX();
final int locY = player.getLocation().getBlockY(); final int locY = player.getLocation().getBlockY();
@ -99,22 +115,13 @@ public class IceSpikePillarField extends IceAbility {
} }
if (targetBlock.getRelative(BlockFace.UP).getType() != Material.ICE) { if (targetBlock.getRelative(BlockFace.UP).getType() != Material.ICE) {
final IceSpikePillar pillar = new IceSpikePillar(player, targetBlock.getLocation(), (int) this.damage, this.thrownForce, this.cooldown); final IceSpikePillar pillar = new IceSpikePillar(player, targetBlock.getLocation(), (int) this.damage, this.thrownForce, this.cooldown);
pillar.inField = true; pillar.inField = true;
this.bPlayer.addCooldown("IceSpikePillarField", this.cooldown);
iceBlocks.remove(targetBlock); iceBlocks.remove(targetBlock);
} }
} }
} this.bPlayer.addCooldown("IceSpikePillarField", this.cooldown);
this.remove();
@Override
public String getName() {
return "IceSpike";
}
@Override
public void progress() {
} }
@Override @Override

View file

@ -16,6 +16,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.IceAbility; import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.SurgeWall; import com.projectkorra.projectkorra.waterbending.SurgeWall;
import com.projectkorra.projectkorra.waterbending.SurgeWave; import com.projectkorra.projectkorra.waterbending.SurgeWave;
@ -46,19 +47,27 @@ public class PhaseChange extends IceAbility {
private final CopyOnWriteArrayList<TempBlock> blocks = new CopyOnWriteArrayList<>(); private final CopyOnWriteArrayList<TempBlock> blocks = new CopyOnWriteArrayList<>();
private final Random r = new Random(); private final Random r = new Random();
@Attribute(Attribute.SELECT_RANGE)
private int sourceRange = 8; private int sourceRange = 8;
// Freeze Variables. // Freeze Variables.
@Attribute("Freeze" + Attribute.COOLDOWN)
private long freezeCooldown = 500; private long freezeCooldown = 500;
@Attribute("Freeze" + Attribute.RADIUS)
private int freezeRadius = 3; private int freezeRadius = 3;
@Attribute("FreezeDepth")
private int depth = 1; private int depth = 1;
@Attribute("Control" + Attribute.RADIUS)
private double controlRadius = 25; private double controlRadius = 25;
// Melt Variables. // Melt Variables.
private Location meltLoc; private Location meltLoc;
@Attribute("Melt" + Attribute.COOLDOWN)
private long meltCooldown = 7000; private long meltCooldown = 7000;
private int meltRadius; private int meltRadius;
@Attribute("Melt" + Attribute.RADIUS)
private int meltMaxRadius = 7; private int meltMaxRadius = 7;
@Attribute("Melt" + Attribute.SPEED)
private double meltSpeed = 8; private double meltSpeed = 8;
private double meltTicks = 0; private double meltTicks = 0;
private boolean allowMeltFlow; private boolean allowMeltFlow;

View file

@ -18,6 +18,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager; import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.firebending.lightning.Lightning; import com.projectkorra.projectkorra.firebending.lightning.Lightning;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
@ -43,19 +44,29 @@ public class WaterArms extends WaterAbility {
private boolean fullSource; // used to determine whip length in WaterArmsWhip. private boolean fullSource; // used to determine whip length in WaterArmsWhip.
private boolean leftArmConsumed; private boolean leftArmConsumed;
private boolean rightArmConsumed; private boolean rightArmConsumed;
@Attribute("CanUsePlantSource")
private boolean canUsePlantSource; private boolean canUsePlantSource;
@Attribute("CanLightningStrikeArms")
private boolean lightningEnabled; private boolean lightningEnabled;
@Attribute("LightningOneHitKO")
private boolean lightningKill; private boolean lightningKill;
private int lengthReduction; private int lengthReduction;
@Attribute("InitialLength")
private int initLength; private int initLength;
@Attribute(Attribute.SELECT_RANGE)
private int sourceGrabRange; private int sourceGrabRange;
@Attribute("MaxPunches")
private int maxPunches; private int maxPunches;
@Attribute("MaxIceBlasts")
private int maxIceBlasts; private int maxIceBlasts;
@Attribute("MaxUses")
private int maxUses; private int maxUses;
private int selectedSlot; private int selectedSlot;
private int freezeSlot; private int freezeSlot;
@Attribute(Attribute.COOLDOWN)
private long cooldown; private long cooldown;
private long lastClickTime; private long lastClickTime;
@Attribute("LightningDamage")
private double lightningDamage; private double lightningDamage;
private World world; private World world;
private String sneakMsg; private String sneakMsg;
@ -653,22 +664,6 @@ public class WaterArms extends WaterAbility {
return false; return false;
} }
public boolean isCooldownLeft() {
return this.cooldownLeft;
}
public void setCooldownLeft(final boolean cooldownLeft) {
this.cooldownLeft = cooldownLeft;
}
public boolean isCooldownRight() {
return this.cooldownRight;
}
public void setCooldownRight(final boolean cooldownRight) {
this.cooldownRight = cooldownRight;
}
public boolean isCanUsePlantSource() { public boolean isCanUsePlantSource() {
return this.canUsePlantSource; return this.canUsePlantSource;
} }

View file

@ -13,6 +13,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.IceAbility; import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
@ -23,9 +24,12 @@ public class WaterArmsFreeze extends IceAbility {
private boolean cancelled; private boolean cancelled;
private boolean usageCooldownEnabled; private boolean usageCooldownEnabled;
@Attribute(Attribute.RANGE)
private int iceRange; private int iceRange;
private int distanceTravelled; private int distanceTravelled;
@Attribute(Attribute.DAMAGE)
private double iceDamage; private double iceDamage;
@Attribute(Attribute.COOLDOWN)
private long usageCooldown; private long usageCooldown;
private Arm arm; private Arm arm;
private Location location; private Location location;

View file

@ -17,6 +17,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms.Arm; import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms.Arm;
@ -28,19 +29,26 @@ public class WaterArmsSpear extends WaterAbility {
private boolean hitEntity; private boolean hitEntity;
private boolean canFreeze; private boolean canFreeze;
private boolean usageCooldownEnabled; private boolean usageCooldownEnabled;
@Attribute("DamageEnabled")
private boolean spearDamageEnabled; private boolean spearDamageEnabled;
@Attribute("Length")
private int spearLength; private int spearLength;
@Attribute(Attribute.RANGE)
private int spearRange; private int spearRange;
private int spearRangeNight; private int spearRangeNight;
private int spearRangeFullMoon; private int spearRangeFullMoon;
private int spearSphere; @Attribute("SphereRadius")
private int spearSphereRadius;
private int spearSphereNight; private int spearSphereNight;
private int spearSphereFullMoon; private int spearSphereFullMoon;
private int distanceTravelled; private int distanceTravelled;
@Attribute(Attribute.DURATION)
private long spearDuration; private long spearDuration;
private long spearDurationNight; private long spearDurationNight;
private long spearDurationFullMoon; private long spearDurationFullMoon;
@Attribute(Attribute.COOLDOWN)
private long usageCooldown; private long usageCooldown;
@Attribute(Attribute.DAMAGE)
private double spearDamage; private double spearDamage;
private Arm arm; private Arm arm;
private Location location; private Location location;
@ -58,7 +66,7 @@ public class WaterArmsSpear extends WaterAbility {
this.spearRange = getConfig().getInt("Abilities.Water.WaterArms.Spear.Range"); this.spearRange = getConfig().getInt("Abilities.Water.WaterArms.Spear.Range");
this.spearRangeNight = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Range.Normal"); this.spearRangeNight = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Range.Normal");
this.spearRangeFullMoon = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Range.FullMoon"); this.spearRangeFullMoon = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Range.FullMoon");
this.spearSphere = getConfig().getInt("Abilities.Water.WaterArms.Spear.Sphere"); this.spearSphereRadius = getConfig().getInt("Abilities.Water.WaterArms.Spear.SphereRadius");
this.spearSphereNight = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Sphere.Normal"); this.spearSphereNight = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Sphere.Normal");
this.spearSphereFullMoon = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Sphere.FullMoon"); this.spearSphereFullMoon = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Sphere.FullMoon");
this.spearDuration = getConfig().getLong("Abilities.Water.WaterArms.Spear.Duration"); this.spearDuration = getConfig().getLong("Abilities.Water.WaterArms.Spear.Duration");
@ -75,30 +83,14 @@ public class WaterArmsSpear extends WaterAbility {
private void getNightAugments() { private void getNightAugments() {
final World world = this.player.getWorld(); final World world = this.player.getWorld();
if (isNight(world)) { if (isNight(world)) {
if (GeneralMethods.hasRPG()) { if (isFullMoon(world) && !GeneralMethods.hasRPG()) {
if (isLunarEclipse(world)) { this.spearRange = this.spearRangeFullMoon;
this.spearRange = this.spearRangeFullMoon; this.spearSphereRadius = this.spearSphereFullMoon;
this.spearSphere = this.spearSphereFullMoon; this.spearDuration = this.spearDurationFullMoon;
this.spearDuration = this.spearDurationFullMoon;
} else if (isFullMoon(world)) {
this.spearRange = this.spearRangeFullMoon;
this.spearSphere = this.spearSphereFullMoon;
this.spearDuration = this.spearDurationFullMoon;
} else {
this.spearRange = this.spearRangeNight;
this.spearSphere = this.spearSphereNight;
this.spearDuration = this.spearDurationNight;
}
} else { } else {
if (isFullMoon(world)) { this.spearRange = this.spearRangeNight;
this.spearRange = this.spearRangeFullMoon; this.spearSphereRadius = this.spearSphereNight;
this.spearSphere = this.spearSphereFullMoon; this.spearDuration = this.spearDurationNight;
this.spearDuration = this.spearDurationFullMoon;
} else {
this.spearRange = this.spearRangeNight;
this.spearSphere = this.spearSphereNight;
this.spearDuration = this.spearDurationNight;
}
} }
} }
} }
@ -231,13 +223,13 @@ public class WaterArmsSpear extends WaterAbility {
} }
private void createIceBall() { private void createIceBall() {
if (this.spearSphere <= 0) { if (this.spearSphereRadius <= 0) {
if (this.canFreeze) { if (this.canFreeze) {
this.createSpear(); this.createSpear();
} }
return; return;
} }
for (final Block block : GeneralMethods.getBlocksAroundPoint(this.location, this.spearSphere)) { for (final Block block : GeneralMethods.getBlocksAroundPoint(this.location, this.spearSphereRadius)) {
if (isTransparent(this.player, block) && block.getType() != Material.ICE && !WaterArms.isUnbreakable(block)) { if (isTransparent(this.player, block) && block.getType() != Material.ICE && !WaterArms.isUnbreakable(block)) {
playIcebendingSound(block.getLocation()); playIcebendingSound(block.getLocation());
new TempBlock(block, Material.ICE, (byte) 0); new TempBlock(block, Material.ICE, (byte) 0);
@ -364,11 +356,11 @@ public class WaterArmsSpear extends WaterAbility {
} }
public int getSpearSphere() { public int getSpearSphere() {
return this.spearSphere; return this.spearSphereRadius;
} }
public void setSpearSphere(final int spearSphere) { public void setSpearSphere(final int spearSphere) {
this.spearSphere = spearSphere; this.spearSphereRadius = spearSphere;
} }
public int getSpearSphereNight() { public int getSpearSphereNight() {

View file

@ -15,6 +15,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager; import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.command.Commands; import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
@ -37,20 +38,27 @@ public class WaterArmsWhip extends WaterAbility {
private boolean grabbed; private boolean grabbed;
private boolean grappleRespectRegions; private boolean grappleRespectRegions;
private boolean usageCooldownEnabled; private boolean usageCooldownEnabled;
@Attribute("WhipLength")
private int whipLength; private int whipLength;
private int whipLengthWeak; private int whipLengthWeak;
private int whipLengthNight; private int whipLengthNight;
private int whipLengthFullMoon; private int whipLengthFullMoon;
@Attribute("InitialLength")
private int initLength; private int initLength;
@Attribute("PunchLength")
private int punchLength; private int punchLength;
private int punchLengthNight; private int punchLengthNight;
private int punchLengthFullMoon; private int punchLengthFullMoon;
private int activeLength; private int activeLength;
@Attribute("WhipSpeed")
private int whipSpeed; private int whipSpeed;
private long holdTime; @Attribute("GrabDuration")
private long grabDuration;
@Attribute(Attribute.COOLDOWN)
private long usageCooldown; private long usageCooldown;
private long time; private long time;
private double pullMultiplier; private double pullMultiplier;
@Attribute("PunchDamage")
private double punchDamage; private double punchDamage;
private double playerHealth; private double playerHealth;
private Arm arm; private Arm arm;
@ -79,12 +87,11 @@ public class WaterArmsWhip extends WaterAbility {
this.punchLengthFullMoon = getConfig().getInt("Abilities.Water.WaterArms.Whip.Punch.NightAugments.MaxLength.FullMoon"); this.punchLengthFullMoon = getConfig().getInt("Abilities.Water.WaterArms.Whip.Punch.NightAugments.MaxLength.FullMoon");
this.activeLength = this.initLength; this.activeLength = this.initLength;
this.whipSpeed = 1; this.whipSpeed = 1;
this.holdTime = getConfig().getLong("Abilities.Water.WaterArms.Whip.Grab.HoldTime"); this.grabDuration = getConfig().getLong("Abilities.Water.WaterArms.Whip.Grab.Duration");
this.pullMultiplier = getConfig().getDouble("Abilities.Water.WaterArms.Whip.Pull.Multiplier"); this.pullMultiplier = getConfig().getDouble("Abilities.Water.WaterArms.Whip.Pull.Multiplier");
this.punchDamage = getConfig().getDouble("Abilities.Water.WaterArms.Whip.Punch.PunchDamage"); this.punchDamage = getConfig().getDouble("Abilities.Water.WaterArms.Whip.Punch.Damage");
switch (ability) { switch (ability) {
case PULL: case PULL:
this.usageCooldown = getConfig().getLong("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Pull"); this.usageCooldown = getConfig().getLong("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Pull");
break; break;
@ -126,39 +133,17 @@ public class WaterArmsWhip extends WaterAbility {
} }
final World world = this.player.getWorld(); final World world = this.player.getWorld();
if (isNight(world)) { if (isNight(world)) {
if (GeneralMethods.hasRPG()) { if (this.ability.equals(Whip.PUNCH)) {
if (isLunarEclipse(world)) { if (isFullMoon(world) && !GeneralMethods.hasRPG()) {
if (this.ability.equals(Whip.PUNCH)) { this.whipLength = this.punchLengthFullMoon;
this.whipLength = this.punchLengthFullMoon;
} else {
this.whipLength = this.whipLengthFullMoon;
}
} else if (isFullMoon(world)) {
if (this.ability.equals(Whip.PUNCH)) {
this.whipLength = this.punchLengthFullMoon;
} else {
this.whipLength = this.whipLengthFullMoon;
}
} else { } else {
if (this.ability.equals(Whip.PUNCH)) { this.whipLength = this.punchLengthNight;
this.whipLength = this.punchLengthNight;
} else {
this.whipLength = this.whipLengthNight;
}
} }
} else { } else {
if (isFullMoon(world)) { if (isFullMoon(world) && !GeneralMethods.hasRPG()) {
if (this.ability.equals(Whip.PUNCH)) { this.whipLength = this.whipLengthFullMoon;
this.whipLength = this.punchLengthFullMoon;
} else {
this.whipLength = this.whipLengthFullMoon;
}
} else { } else {
if (this.ability.equals(Whip.PUNCH)) { this.whipLength = this.whipLengthNight;
this.whipLength = this.punchLengthNight;
} else {
this.whipLength = this.whipLengthNight;
}
} }
} }
} }
@ -169,7 +154,7 @@ public class WaterArmsWhip extends WaterAbility {
if (this.waterArms != null) { if (this.waterArms != null) {
this.waterArms.switchPreferredArm(); this.waterArms.switchPreferredArm();
this.arm = this.waterArms.getActiveArm(); this.arm = this.waterArms.getActiveArm();
this.time = System.currentTimeMillis() + this.holdTime; this.time = System.currentTimeMillis() + this.grabDuration;
this.playerHealth = this.player.getHealth(); this.playerHealth = this.player.getHealth();
if (this.arm.equals(Arm.LEFT)) { if (this.arm.equals(Arm.LEFT)) {
@ -598,12 +583,12 @@ public class WaterArmsWhip extends WaterAbility {
this.whipSpeed = whipSpeed; this.whipSpeed = whipSpeed;
} }
public long getHoldTime() { public long getGrabDuration() {
return this.holdTime; return this.grabDuration;
} }
public void setHoldTime(final long holdTime) { public void setGrabDuration(final long grabDuration) {
this.holdTime = holdTime; this.grabDuration = grabDuration;
} }
public long getUsageCooldown() { public long getUsageCooldown() {