mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-22 16:05:01 +00:00
Alex's Awesome Update (#729)
* Fix chi abilities appearing to strike twice, implement catapult 2.0, and fix water sources being removed by breaking them * Small changes for loony (visual and time) * Completely rewrite catapult functions and repair water abilities allowing plant sources to be broken upon selection * Increase length of moveEarth call in Catapult and add more configuration options * Fix my dumb mistake of using a bitwise operator * Allow tempblock usage for iceblast
This commit is contained in:
parent
2fa49c945c
commit
2cb73c71ec
12 changed files with 173 additions and 204 deletions
|
@ -168,7 +168,6 @@ import com.projectkorra.projectkorra.waterbending.SurgeWave;
|
||||||
import com.projectkorra.projectkorra.waterbending.Torrent;
|
import com.projectkorra.projectkorra.waterbending.Torrent;
|
||||||
import com.projectkorra.projectkorra.waterbending.WaterManipulation;
|
import com.projectkorra.projectkorra.waterbending.WaterManipulation;
|
||||||
import com.projectkorra.projectkorra.waterbending.WaterSpout;
|
import com.projectkorra.projectkorra.waterbending.WaterSpout;
|
||||||
import com.projectkorra.projectkorra.waterbending.WaterSpoutWave;
|
|
||||||
import com.projectkorra.projectkorra.waterbending.blood.Bloodbending;
|
import com.projectkorra.projectkorra.waterbending.blood.Bloodbending;
|
||||||
import com.projectkorra.projectkorra.waterbending.healing.HealingWaters;
|
import com.projectkorra.projectkorra.waterbending.healing.HealingWaters;
|
||||||
import com.projectkorra.projectkorra.waterbending.ice.IceBlast;
|
import com.projectkorra.projectkorra.waterbending.ice.IceBlast;
|
||||||
|
@ -201,10 +200,22 @@ public class PKListener implements Listener {
|
||||||
|
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (SurgeWall.wasBrokenFor(player, block) || OctopusForm.wasBrokenFor(player, block) || Torrent.wasBrokenFor(player, block) || WaterSpoutWave.wasBrokenFor(player, block)) {
|
String abil = BendingPlayer.getBendingPlayer(player).getBoundAbilityName();
|
||||||
|
CoreAbility ability = null;
|
||||||
|
if (abil != null && abil.equalsIgnoreCase("Surge")) {
|
||||||
|
ability = CoreAbility.getAbility(SurgeWall.class);
|
||||||
|
}
|
||||||
|
else if (abil != null && abil.equalsIgnoreCase("Torrent")) {
|
||||||
|
ability = CoreAbility.getAbility(Torrent.class);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ability = CoreAbility.getAbility(abil);
|
||||||
|
}
|
||||||
|
if (ability != null && ability instanceof WaterAbility && !((WaterAbility)ability).allowBreakPlants() && WaterAbility.isPlantbendable(player, block.getType(), false)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EarthBlast blast = EarthBlast.getBlastFromSource(block);
|
EarthBlast blast = EarthBlast.getBlastFromSource(block);
|
||||||
if (blast != null) {
|
if (blast != null) {
|
||||||
blast.remove();
|
blast.remove();
|
||||||
|
@ -865,10 +876,13 @@ public class PKListener implements Listener {
|
||||||
new Paralyze(sourcePlayer, targetPlayer);
|
new Paralyze(sourcePlayer, targetPlayer);
|
||||||
} else if (boundAbil.equalsIgnoreCase("QuickStrike")) {
|
} else if (boundAbil.equalsIgnoreCase("QuickStrike")) {
|
||||||
new QuickStrike(sourcePlayer, targetPlayer);
|
new QuickStrike(sourcePlayer, targetPlayer);
|
||||||
|
e.setCancelled(true);
|
||||||
} else if (boundAbil.equalsIgnoreCase("SwiftKick")) {
|
} else if (boundAbil.equalsIgnoreCase("SwiftKick")) {
|
||||||
new SwiftKick(sourcePlayer, targetPlayer);
|
new SwiftKick(sourcePlayer, targetPlayer);
|
||||||
|
e.setCancelled(true);
|
||||||
} else if (boundAbil.equalsIgnoreCase("RapidPunch")) {
|
} else if (boundAbil.equalsIgnoreCase("RapidPunch")) {
|
||||||
new RapidPunch(sourcePlayer, targetPlayer);
|
new RapidPunch(sourcePlayer, targetPlayer);
|
||||||
|
e.setCancelled(true);
|
||||||
} else {
|
} else {
|
||||||
if (ChiPassive.willChiBlock(sourcePlayer, targetPlayer)) {
|
if (ChiPassive.willChiBlock(sourcePlayer, targetPlayer)) {
|
||||||
ChiPassive.blockChi(targetPlayer);
|
ChiPassive.blockChi(targetPlayer);
|
||||||
|
@ -1335,7 +1349,11 @@ public class PKListener implements Listener {
|
||||||
|
|
||||||
if (coreAbil instanceof EarthAbility && bPlayer.isElementToggled(Element.EARTH) == true) {
|
if (coreAbil instanceof EarthAbility && bPlayer.isElementToggled(Element.EARTH) == true) {
|
||||||
if (bPlayer.canCurrentlyBendWithWeapons()) {
|
if (bPlayer.canCurrentlyBendWithWeapons()) {
|
||||||
if (abil.equalsIgnoreCase("EarthBlast")) {
|
if (abil.equalsIgnoreCase("Catapult"))
|
||||||
|
{
|
||||||
|
new Catapult(player);
|
||||||
|
}
|
||||||
|
else if (abil.equalsIgnoreCase("EarthBlast")) {
|
||||||
new EarthBlast(player);
|
new EarthBlast(player);
|
||||||
} else if (abil.equalsIgnoreCase("EarthArmor")) {
|
} else if (abil.equalsIgnoreCase("EarthArmor")) {
|
||||||
new EarthArmor(player);
|
new EarthArmor(player);
|
||||||
|
|
|
@ -126,6 +126,10 @@ public abstract class WaterAbility extends ElementalAbility {
|
||||||
public boolean isWaterbendable(Player player, Block block) {
|
public boolean isWaterbendable(Player player, Block block) {
|
||||||
return isWaterbendable(player, null, block);
|
return isWaterbendable(player, null, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean allowBreakPlants() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isWaterbendable(Material material) {
|
public static boolean isWaterbendable(Material material) {
|
||||||
return isWater(material) || isIce(material) || isPlant(material) || isSnow(material);
|
return isWater(material) || isIce(material) || isPlant(material) || isSnow(material);
|
||||||
|
|
|
@ -96,5 +96,4 @@ public class QuickStrike extends ChiAbility {
|
||||||
public void setTarget(Entity target) {
|
public void setTarget(Entity target) {
|
||||||
this.target = target;
|
this.target = target;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
|
@ -314,8 +314,8 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Water.Passive.Hydrosink.Description", "Hydrosink is a passive ability for waterbenders enabling them to softly land on any waterbendable surface, cancelling all damage.");
|
config.addDefault("Abilities.Water.Passive.Hydrosink.Description", "Hydrosink is a passive ability for waterbenders enabling them to softly land on any waterbendable surface, cancelling all damage.");
|
||||||
|
|
||||||
config.addDefault("Commands.Help.Elements.Earth", "Earth is the element of substance. Earthbenders share many of the same fundamental techniques as Waterbenders, but their domain is quite different and more readily accessible. Earthbenders dominate the ground and subterranean, having abilities to pull columns of rock straight up from the earth or drill their way through the mountain. They can also launch themselves through the air using pillars of rock, and will not hurt themselves assuming they land on something they can bend. The more skilled Earthbenders can even bend metal.");
|
config.addDefault("Commands.Help.Elements.Earth", "Earth is the element of substance. Earthbenders share many of the same fundamental techniques as Waterbenders, but their domain is quite different and more readily accessible. Earthbenders dominate the ground and subterranean, having abilities to pull columns of rock straight up from the earth or drill their way through the mountain. They can also launch themselves through the air using pillars of rock, and will not hurt themselves assuming they land on something they can bend. The more skilled Earthbenders can even bend metal.");
|
||||||
config.addDefault("Abilities.Earth.Catapult.Description", "Catapult is the greatest mobility move in an earthbender's arsenal. It requires practice to be able to control yourself to land where you wish, but once mastered it's credibly useful for earthbenders.");
|
config.addDefault("Abilities.Earth.Catapult.Description", "Catapult is an advanced earthbending ability that allows you to forcefully push yourself using earth, reaching great heights. This technique is best used when travelling, but it can also be used to quickly escape a battle.");
|
||||||
config.addDefault("Abilities.Earth.Catapult.Instructions", "Left click while looking in the direction you want to be launched to be propelled forward. Additionally, you can hold sneak and left click to be propelled with less power.");
|
config.addDefault("Abilities.Earth.Catapult.Instructions", "Hold sneak until you see particles and hear a sound and then release to be propelled in the direction you're looking. Additionally, you can left-click to be propelled with less power.");
|
||||||
config.addDefault("Abilities.Earth.Collapse.Description", "This ability is a basic earthbending ability that allows the earthbender great utility. It allows them to control earth blocks by compressing earth. Players and mobs can be trapped and killed if earth is collapsed and they're stuck inside it, meaning this move is deadly when in cave systems.");
|
config.addDefault("Abilities.Earth.Collapse.Description", "This ability is a basic earthbending ability that allows the earthbender great utility. It allows them to control earth blocks by compressing earth. Players and mobs can be trapped and killed if earth is collapsed and they're stuck inside it, meaning this move is deadly when in cave systems.");
|
||||||
config.addDefault("Abilities.Earth.Collapse.Instructions", "Left click an earthbendable block. If there's space under that block, it will be collapsed. Alternatively, you can tap sneak to collapse multiple blocks at a time.");
|
config.addDefault("Abilities.Earth.Collapse.Instructions", "Left click an earthbendable block. If there's space under that block, it will be collapsed. Alternatively, you can tap sneak to collapse multiple blocks at a time.");
|
||||||
config.addDefault("Abilities.Earth.Collapse.DeathMessage", "{victim} was suffocated by {attacker}'s {ability}");
|
config.addDefault("Abilities.Earth.Collapse.DeathMessage", "{victim} was suffocated by {attacker}'s {ability}");
|
||||||
|
@ -556,8 +556,7 @@ 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.Earth.Catapult.Length", 10);
|
config.addDefault("Abilities.Avatar.AvatarState.Earth.Catapult.MaxDistance", 80);
|
||||||
config.addDefault("Abilities.Avatar.AvatarState.Earth.Catapult.Push", 8);
|
|
||||||
config.addDefault("Abilities.Avatar.AvatarState.Earth.Catapult.Cooldown", 0);
|
config.addDefault("Abilities.Avatar.AvatarState.Earth.Catapult.Cooldown", 0);
|
||||||
config.addDefault("Abilities.Avatar.AvatarState.Earth.LavaFlow.ShiftCooldown", 1500);
|
config.addDefault("Abilities.Avatar.AvatarState.Earth.LavaFlow.ShiftCooldown", 1500);
|
||||||
config.addDefault("Abilities.Avatar.AvatarState.Earth.LavaFlow.ClickLavaCooldown", 1500);
|
config.addDefault("Abilities.Avatar.AvatarState.Earth.LavaFlow.ClickLavaCooldown", 1500);
|
||||||
|
@ -958,10 +957,10 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Earth.Passive.FerroControl.Enabled", true);
|
config.addDefault("Abilities.Earth.Passive.FerroControl.Enabled", true);
|
||||||
|
|
||||||
config.addDefault("Abilities.Earth.Catapult.Enabled", true);
|
config.addDefault("Abilities.Earth.Catapult.Enabled", true);
|
||||||
config.addDefault("Abilities.Earth.Catapult.Length", 6);
|
config.addDefault("Abilities.Earth.Catapult.MaxDistance", 40);
|
||||||
config.addDefault("Abilities.Earth.Catapult.Push", 4);
|
config.addDefault("Abilities.Earth.Catapult.Cooldown", 7000);
|
||||||
config.addDefault("Abilities.Earth.Catapult.ShiftModifier", 2);
|
config.addDefault("Abilities.Earth.Catapult.StageMult", 0.25);
|
||||||
config.addDefault("Abilities.Earth.Catapult.Cooldown", 1500);
|
config.addDefault("Abilities.Earth.Catapult.StageTimeMult", 2.0);
|
||||||
|
|
||||||
config.addDefault("Abilities.Earth.Collapse.Enabled", true);
|
config.addDefault("Abilities.Earth.Collapse.Enabled", true);
|
||||||
config.addDefault("Abilities.Earth.Collapse.SelectRange", 20);
|
config.addDefault("Abilities.Earth.Collapse.SelectRange", 20);
|
||||||
|
|
|
@ -1,170 +1,135 @@
|
||||||
package com.projectkorra.projectkorra.earthbending;
|
package com.projectkorra.projectkorra.earthbending;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.GeneralMethods;
|
import java.util.Random;
|
||||||
import com.projectkorra.projectkorra.ability.EarthAbility;
|
|
||||||
|
|
||||||
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class Catapult extends EarthAbility {
|
import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
|
import com.projectkorra.projectkorra.ability.EarthAbility;
|
||||||
|
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||||
|
import com.projectkorra.projectkorra.util.ParticleEffect.BlockData;
|
||||||
|
|
||||||
private boolean catapult;
|
public class Catapult extends EarthAbility {
|
||||||
private boolean moving;
|
|
||||||
private boolean flying;
|
private int maxDistance;
|
||||||
private int length;
|
private double stageMult;
|
||||||
|
private double stageTimeMult;
|
||||||
private int distance;
|
private int distance;
|
||||||
private long cooldown;
|
private long cooldown;
|
||||||
private double push;
|
|
||||||
private double shiftModifier;
|
|
||||||
private Location origin;
|
private Location origin;
|
||||||
private Location location;
|
private Location target;
|
||||||
private Vector direction;
|
|
||||||
|
private int stage;
|
||||||
|
private long stageStart;
|
||||||
|
private boolean charging;
|
||||||
|
private boolean activationHandled;
|
||||||
|
|
||||||
public Catapult(Player player) {
|
public Catapult(Player player) {
|
||||||
super(player);
|
super(player);
|
||||||
setFields();
|
setFields();
|
||||||
this.origin = player.getEyeLocation().clone();
|
|
||||||
this.direction = origin.getDirection().clone().normalize();
|
|
||||||
|
|
||||||
if (!bPlayer.canBend(this)) {
|
if (!bPlayer.canBend(this)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (bPlayer.isAvatarState()) {
|
||||||
Vector neg = direction.clone().multiply(-1);
|
this.maxDistance = getConfig().getInt("Abilities.Avatar.AvatarState.Earth.Catapult.MaxDistance");
|
||||||
Block block;
|
this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Earth.Catapult.Cooldown");
|
||||||
distance = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i <= length; i++) {
|
|
||||||
location = origin.clone().add(neg.clone().multiply((double) i));
|
|
||||||
block = location.getBlock();
|
|
||||||
if (isEarthbendable(block)) {
|
|
||||||
distance = getEarthbendableBlocksLength(block, neg, length - i);
|
|
||||||
break;
|
|
||||||
} else if (!isTransparent(block)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (distance != 0) {
|
|
||||||
if ((double) distance * distance >= location.distanceSquared(origin)) {
|
|
||||||
catapult = true;
|
|
||||||
}
|
|
||||||
if (player.isSneaking()) {
|
|
||||||
distance = (int) (distance / shiftModifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
moving = true;
|
|
||||||
|
|
||||||
if (bPlayer.isAvatarState()) {
|
|
||||||
this.length = getConfig().getInt("Abilities.Avatar.AvatarState.Earth.Catapult.Length");
|
|
||||||
this.push = getConfig().getDouble("Abilities.Avatar.AvatarState.Earth.Catapult.Push");
|
|
||||||
this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Earth.Catapult.Cooldown");
|
|
||||||
|
|
||||||
}
|
|
||||||
start();
|
|
||||||
bPlayer.addCooldown(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Catapult(Player player, Catapult source) {
|
|
||||||
super(player);
|
|
||||||
flying = true;
|
|
||||||
moving = false;
|
|
||||||
setFields();
|
|
||||||
location = source.location.clone();
|
|
||||||
direction = source.direction.clone();
|
|
||||||
distance = source.distance;
|
|
||||||
|
|
||||||
start();
|
start();
|
||||||
playEarthbendingSound(player.getLocation());
|
|
||||||
fly();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setFields() {
|
private void setFields() {
|
||||||
this.length = getConfig().getInt("Abilities.Earth.Catapult.Length");
|
this.maxDistance = getConfig().getInt("Abilities.Earth.Catapult.MaxDistance");
|
||||||
this.push = getConfig().getDouble("Abilities.Earth.Catapult.Push");
|
this.stageMult = getConfig().getDouble("Abilities.Earth.Catapult.StageMult");
|
||||||
this.shiftModifier = getConfig().getDouble("Abilities.Earth.Catapult.ShiftModifier");
|
this.stageTimeMult = getConfig().getDouble("Abilities.Earth.Catapult.StageTimeMult");
|
||||||
this.distance = 0;
|
this.distance = 0;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Earth.Catapult.Cooldown");
|
this.cooldown = getConfig().getLong("Abilities.Earth.Catapult.Cooldown");
|
||||||
this.catapult = false;
|
this.activationHandled = false;
|
||||||
this.moving = false;
|
this.stage = 1;
|
||||||
this.flying = false;
|
this.stageStart = System.currentTimeMillis();
|
||||||
|
this.charging = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fly() {
|
private void moveEarth(Vector apply, Vector direction) {
|
||||||
if (player.isDead() || !player.isOnline()) {
|
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(origin, 2)) {
|
||||||
remove();
|
if (entity.getEntityId() != player.getEntityId()) {
|
||||||
return;
|
entity.setVelocity(apply);
|
||||||
} else if (!player.getWorld().equals(location.getWorld())) {
|
|
||||||
remove();
|
|
||||||
return;
|
|
||||||
} else if (player.getLocation().distanceSquared(location) < 9) {
|
|
||||||
if (!moving) {
|
|
||||||
flying = false;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Block block : GeneralMethods.getBlocksAroundPoint(player.getLocation(), 1.5)) {
|
|
||||||
if ((GeneralMethods.isSolid(block) || block.isLiquid())) {
|
|
||||||
flying = false;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
moveEarth(this.origin.clone().subtract(direction), direction, 3, false);
|
||||||
Vector vector = direction.clone().multiply(push * distance / length);
|
|
||||||
vector.setY(player.getVelocity().getY());
|
|
||||||
player.setVelocity(vector);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean moveEarth() {
|
|
||||||
location = location.clone().add(direction);
|
|
||||||
if (catapult) {
|
|
||||||
if (location.getWorld().equals(origin.getWorld()) && location.distance(origin) < 0.5) {
|
|
||||||
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(origin, 2)) {
|
|
||||||
if (entity instanceof Player) {
|
|
||||||
Player target = (Player) entity;
|
|
||||||
new Catapult(target, this);
|
|
||||||
}
|
|
||||||
entity.setVelocity(direction.clone().multiply(push * distance / length));
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
double lengthSquared = (length - distance) * (length - distance);
|
|
||||||
if (location.distanceSquared(origin) <= lengthSquared) {
|
|
||||||
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, 2)) {
|
|
||||||
entity.setVelocity(direction.clone().multiply(push * distance / length));
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
moveEarth(location.clone().subtract(direction), direction, distance, false);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void progress() {
|
public void progress() {
|
||||||
|
if (player.getEyeLocation().getPitch() > -20f) {
|
||||||
|
remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!bPlayer.canBendIgnoreBindsCooldowns(this)) {
|
if (!bPlayer.canBendIgnoreBindsCooldowns(this)) {
|
||||||
remove();
|
remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moving) {
|
if (charging)
|
||||||
if (!moveEarth()) {
|
{
|
||||||
moving = false;
|
if (stage == 4 || !player.isSneaking())
|
||||||
|
{
|
||||||
|
charging = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((System.currentTimeMillis() - this.stageStart) >= ((Math.max(0, this.stageTimeMult * (this.stage - 1))) * 1000))
|
||||||
|
{
|
||||||
|
this.stage++;
|
||||||
|
this.stageStart = System.currentTimeMillis();
|
||||||
|
Random random = new Random();
|
||||||
|
ParticleEffect.BLOCK_DUST.display(new BlockData(Material.DIRT, (byte)0), random.nextFloat(), random.nextFloat(), random.nextFloat(), 0, 20, player.getLocation(), 257);
|
||||||
|
ParticleEffect.BLOCK_DUST.display(new BlockData(Material.DIRT, (byte)0), random.nextFloat(), random.nextFloat(), random.nextFloat(), 0, 20, player.getLocation().add(0, 0.5, 0), 257);
|
||||||
|
player.getWorld().playEffect(player.getLocation(), Effect.GHAST_SHOOT, 0, 10);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector direction = null;
|
||||||
|
if (!this.activationHandled)
|
||||||
|
{
|
||||||
|
this.origin = player.getLocation().clone();
|
||||||
|
direction = player.getEyeLocation().getDirection().clone().normalize();
|
||||||
|
|
||||||
if (flying) {
|
if (!bPlayer.canBend(this)) {
|
||||||
fly();
|
this.activationHandled = true;
|
||||||
} else if (!moving) {
|
remove();
|
||||||
remove();
|
return;
|
||||||
return;
|
}
|
||||||
|
|
||||||
|
if (isEarthbendable(player.getLocation().getBlock()) || isEarthbendable(player.getLocation().getBlock().getRelative(BlockFace.DOWN))) {
|
||||||
|
distance = this.maxDistance;
|
||||||
|
}
|
||||||
|
if (distance != 0) {
|
||||||
|
distance = (int) (distance * (this.stageMult * this.stage));
|
||||||
|
this.activationHandled = true;
|
||||||
|
bPlayer.addCooldown(this);
|
||||||
|
} else {
|
||||||
|
remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Location tar = this.origin.clone();
|
||||||
|
while (tar.distanceSquared(this.origin) <= Math.pow(this.distance, 2))
|
||||||
|
{
|
||||||
|
tar.add(direction.clone().normalize());
|
||||||
|
}
|
||||||
|
this.target = tar;
|
||||||
|
Vector apply = this.target.clone().toVector().subtract(this.origin.clone().toVector());
|
||||||
|
player.setVelocity(apply);
|
||||||
|
moveEarth(apply, direction);
|
||||||
|
remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -202,45 +167,13 @@ public class Catapult extends EarthAbility {
|
||||||
public void setOrigin(Location origin) {
|
public void setOrigin(Location origin) {
|
||||||
this.origin = origin;
|
this.origin = origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector getDirection() {
|
public Location getTarget() {
|
||||||
return direction;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDirection(Vector direction) {
|
public void setTarget(Location target) {
|
||||||
this.direction = direction;
|
this.target = target;
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCatapult() {
|
|
||||||
return catapult;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCatapult(boolean catapult) {
|
|
||||||
this.catapult = catapult;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMoving() {
|
|
||||||
return moving;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMoving(boolean moving) {
|
|
||||||
this.moving = moving;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isFlying() {
|
|
||||||
return flying;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFlying(boolean flying) {
|
|
||||||
this.flying = flying;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLength() {
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLength(int length) {
|
|
||||||
this.length = length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDistance() {
|
public int getDistance() {
|
||||||
|
@ -251,20 +184,7 @@ public class Catapult extends EarthAbility {
|
||||||
this.distance = distance;
|
this.distance = distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getPush() {
|
|
||||||
return push;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPush(double push) {
|
|
||||||
this.push = push;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocation(Location location) {
|
|
||||||
this.location = location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCooldown(long cooldown) {
|
public void setCooldown(long cooldown) {
|
||||||
this.cooldown = cooldown;
|
this.cooldown = cooldown;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
|
@ -8,6 +8,7 @@ import com.projectkorra.projectkorra.Element;
|
||||||
import com.projectkorra.projectkorra.ability.CoreAbility;
|
import com.projectkorra.projectkorra.ability.CoreAbility;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
||||||
|
import com.projectkorra.projectkorra.earthbending.Tremorsense;
|
||||||
import com.projectkorra.projectkorra.firebending.Illumination;
|
import com.projectkorra.projectkorra.firebending.Illumination;
|
||||||
|
|
||||||
public class FirePassive {
|
public class FirePassive {
|
||||||
|
@ -23,12 +24,12 @@ public class FirePassive {
|
||||||
player.setFireTicks(80);
|
player.setFireTicks(80);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bPlayer != null && !CoreAbility.hasAbility(player, Illumination.class) && bPlayer.canBendIgnoreBinds(CoreAbility.getAbility("Illumination")) && ConfigManager.defaultConfig.get().getBoolean("Abilities.Fire.Illumination.Passive")) {
|
if (bPlayer != null && !CoreAbility.hasAbility(player, Illumination.class) && !CoreAbility.hasAbility(player, Tremorsense.class) && bPlayer.canBendIgnoreBinds(CoreAbility.getAbility("Illumination")) && ConfigManager.defaultConfig.get().getBoolean("Abilities.Fire.Illumination.Passive")) {
|
||||||
if (!bPlayer.isTremorSensing()) {
|
if (bPlayer.isIlluminating()) {
|
||||||
new Illumination(player);
|
new Illumination(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -175,5 +175,4 @@ public class TempBlock {
|
||||||
}.runTaskTimer(ProjectKorra.plugin, 0, 1);
|
}.runTaskTimer(ProjectKorra.plugin, 0, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
|
@ -185,6 +185,11 @@ public class OctopusForm extends WaterAbility {
|
||||||
AirAbility.breakBreathbendingHold(entity);
|
AirAbility.breakBreathbendingHold(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean allowBreakPlants() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void progress() {
|
public void progress() {
|
||||||
|
|
|
@ -361,6 +361,11 @@ public class SurgeWall extends WaterAbility {
|
||||||
AFFECTED_BLOCKS.put(block, block);
|
AFFECTED_BLOCKS.put(block, block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean allowBreakPlants() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static void form(Player player) {
|
public static void form(Player player) {
|
||||||
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
||||||
|
|
|
@ -669,6 +669,12 @@ public class Torrent extends WaterAbility {
|
||||||
public boolean isCollidable() {
|
public boolean isCollidable() {
|
||||||
return forming || formed || launch || launching;
|
return forming || formed || launch || launching;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean allowBreakPlants()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Location> getLocations() {
|
public List<Location> getLocations() {
|
||||||
|
@ -889,5 +895,4 @@ public class Torrent extends WaterAbility {
|
||||||
public void setLocation(Location location) {
|
public void setLocation(Location location) {
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
|
@ -681,5 +681,9 @@ public class WaterSpoutWave extends WaterAbility {
|
||||||
public void setLocation(Location location) {
|
public void setLocation(Location location) {
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
|
public boolean allowBreakPlants() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -68,7 +68,7 @@ public class IceBlast extends IceAbility {
|
||||||
|
|
||||||
if (sourceBlock == null) {
|
if (sourceBlock == null) {
|
||||||
return;
|
return;
|
||||||
} else if (TempBlock.isTempBlock(sourceBlock) || GeneralMethods.isRegionProtectedFromBuild(this, sourceBlock.getLocation())) {
|
} else if (GeneralMethods.isRegionProtectedFromBuild(this, sourceBlock.getLocation())) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
prepare(sourceBlock);
|
prepare(sourceBlock);
|
||||||
|
@ -195,9 +195,14 @@ public class IceBlast extends IceAbility {
|
||||||
progressing = true;
|
progressing = true;
|
||||||
settingUp = true;
|
settingUp = true;
|
||||||
prepared = false;
|
prepared = false;
|
||||||
|
|
||||||
new TempBlock(sourceBlock, Material.AIR, (byte) 0);
|
if (TempBlock.isTempBlock(sourceBlock)) {
|
||||||
source = new TempBlock(sourceBlock, Material.PACKED_ICE, data);
|
TempBlock.get(sourceBlock).setType(Material.PACKED_ICE, data);
|
||||||
|
source = TempBlock.get(sourceBlock);
|
||||||
|
} else {
|
||||||
|
new TempBlock(sourceBlock, Material.AIR, (byte) 0);
|
||||||
|
source = new TempBlock(sourceBlock, Material.PACKED_ICE, data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -285,7 +290,12 @@ public class IceBlast extends IceAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceBlock = block;
|
sourceBlock = block;
|
||||||
source = new TempBlock(sourceBlock, Material.PACKED_ICE, data);
|
if (TempBlock.isTempBlock(sourceBlock)) {
|
||||||
|
TempBlock.get(sourceBlock).setType(Material.PACKED_ICE, data);
|
||||||
|
source = TempBlock.get(sourceBlock);
|
||||||
|
} else {
|
||||||
|
source = new TempBlock(sourceBlock, Material.PACKED_ICE, data);
|
||||||
|
}
|
||||||
|
|
||||||
for (int x = 0; x < 10; x++) {
|
for (int x = 0; x < 10; x++) {
|
||||||
ParticleEffect.ITEM_CRACK.display(new ParticleEffect.ItemData(Material.ICE, (byte) 0), new Vector(((Math.random() - 0.5) * .5), ((Math.random() - 0.5) * .5), ((Math.random() - 0.5) * .5)), .5f, location, 255.0);
|
ParticleEffect.ITEM_CRACK.display(new ParticleEffect.ItemData(Material.ICE, (byte) 0), new Vector(((Math.random() - 0.5) * .5), ((Math.random() - 0.5) * .5), ((Math.random() - 0.5) * .5)), .5f, location, 255.0);
|
||||||
|
|
Loading…
Reference in a new issue