mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
commit
c819b359a2
5 changed files with 31 additions and 76 deletions
|
@ -1134,39 +1134,6 @@ public class PKListener implements Listener {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
Location from = event.getFrom();
|
||||
Location to = event.getTo();
|
||||
|
||||
if (from.getBlock() == to.getBlock() && (from.getBlock() != null && to.getBlock() != null)) return;
|
||||
|
||||
if (from.getBlockY() < to.getBlockY()) {// Jump
|
||||
ComboManager.addComboAbility(player, ClickType.JUMP);
|
||||
return;
|
||||
}
|
||||
|
||||
Vector toRight = GeneralMethods.getDirection(player.getLocation(), GeneralMethods.getRightSide(player.getLocation(), 1));
|
||||
Vector toLeft = GeneralMethods.getDirection(player.getLocation(), GeneralMethods.getLeftSide(player.getLocation(), 1));
|
||||
Location loc = player.getLocation();
|
||||
loc.setYaw(0);
|
||||
loc.setPitch(0);
|
||||
Vector forwards = loc.getDirection().normalize();
|
||||
Vector backwards = forwards.multiply(-1);
|
||||
Vector current = player.getLocation().toVector().normalize();
|
||||
|
||||
if (current.distance(forwards) < 0.5 && current.distance(forwards) > -0.5) {
|
||||
ComboManager.addComboAbility(player, ClickType.MOVE_FORWARDS);
|
||||
} else if (current.distance(backwards) < 0.5 && current.distance(backwards) > -0.5) {
|
||||
ComboManager.addComboAbility(player, ClickType.MOVE_BACKWARDS);
|
||||
} else if (current.distance(toLeft) < 0.5 && current.distance(toLeft) > -0.5) {
|
||||
ComboManager.addComboAbility(player, ClickType.MOVE_LEFT);
|
||||
} else if (current.distance(toRight) < 0.5 && current.distance(toRight) > -0.5) {
|
||||
ComboManager.addComboAbility(player, ClickType.MOVE_RIGHT);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
|
|
@ -319,7 +319,8 @@ public class FireCombo extends FireAbility implements ComboAbility {
|
|||
ParticleEffect.LARGE_EXPLODE.display(player.getLocation(), spread, spread, spread, 0, 1);
|
||||
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 15, 0F);
|
||||
}
|
||||
player.setVelocity(player.getVelocity().normalize().multiply(speed));
|
||||
FireJet fj = getAbility(player, FireJet.class);
|
||||
fj.setSpeed(speed);
|
||||
FireComboStream fs = new FireComboStream(this,
|
||||
player.getVelocity().clone().multiply(-1), player.getLocation(), 3, 0.5, "JetBlast");
|
||||
|
||||
|
@ -343,7 +344,8 @@ public class FireCombo extends FireAbility implements ComboAbility {
|
|||
return;
|
||||
} else if (hasAbility(player, FireJet.class)) {
|
||||
direction = player.getVelocity().clone().multiply(-1);
|
||||
player.setVelocity(player.getVelocity().normalize().multiply(speed));
|
||||
FireJet fj = getAbility(player, FireJet.class);
|
||||
fj.setSpeed(speed);
|
||||
|
||||
FireComboStream fs = new FireComboStream(this, direction, player.getLocation(), 5, 1, "JetBlaze");
|
||||
fs.setDensity(8);
|
||||
|
|
|
@ -8,30 +8,10 @@ public enum ClickType {
|
|||
* Use this to call your own click type.
|
||||
*/
|
||||
CUSTOM,
|
||||
/**
|
||||
* The player has jumped
|
||||
*/
|
||||
JUMP,
|
||||
/**
|
||||
* Player has swung their arm.
|
||||
*/
|
||||
LEFT_CLICK,
|
||||
/**
|
||||
* The player has moved backwards
|
||||
*/
|
||||
MOVE_BACKWARDS,
|
||||
/**
|
||||
* The player has moved forwards
|
||||
*/
|
||||
MOVE_FORWARDS,
|
||||
/**
|
||||
* The player has moved left
|
||||
*/
|
||||
MOVE_LEFT,
|
||||
/**
|
||||
* The player has moved right
|
||||
*/
|
||||
MOVE_RIGHT,
|
||||
/**
|
||||
* For any instance of right clicking that isn't with an entity or a block (Right clicking air will not work).
|
||||
*/
|
||||
|
|
|
@ -35,6 +35,7 @@ public class Bloodbending extends BloodAbility {
|
|||
private long holdTime;
|
||||
private long cooldown;
|
||||
private double throwFactor;
|
||||
private Entity target;
|
||||
|
||||
public Bloodbending(Player player) {
|
||||
super(player);
|
||||
|
@ -99,7 +100,7 @@ public class Bloodbending extends BloodAbility {
|
|||
if (entities == null || entities.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Entity target = entities.get(0);
|
||||
target = entities.get(0);
|
||||
|
||||
if (target == null || !(target instanceof LivingEntity)
|
||||
|| GeneralMethods.isRegionProtectedFromBuild(this, target.getLocation())
|
||||
|
@ -156,10 +157,12 @@ public class Bloodbending extends BloodAbility {
|
|||
PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, 60, 1);
|
||||
|
||||
if (!player.isSneaking()) {
|
||||
TARGETED_ENTITIES.remove(target);
|
||||
remove();
|
||||
return;
|
||||
} else if (holdTime > 0 && System.currentTimeMillis() - this.time > holdTime) {
|
||||
remove();
|
||||
TARGETED_ENTITIES.remove(target);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -172,12 +175,15 @@ public class Bloodbending extends BloodAbility {
|
|||
}
|
||||
|
||||
if (onlyUsableDuringMoon && !isFullMoon(player.getWorld()) && !bPlayer.canBloodbendAtAnytime()) {
|
||||
TARGETED_ENTITIES.remove(target);
|
||||
remove();
|
||||
return;
|
||||
} else if (canOnlyBeUsedAtNight && !isNight(player.getWorld()) && !bPlayer.canBloodbendAtAnytime()) {
|
||||
TARGETED_ENTITIES.remove(target);
|
||||
remove();
|
||||
return;
|
||||
} else if (!bPlayer.canBendIgnoreCooldowns(this)) {
|
||||
TARGETED_ENTITIES.remove(target);
|
||||
remove();
|
||||
return;
|
||||
}
|
||||
|
@ -374,6 +380,10 @@ public class Bloodbending extends BloodAbility {
|
|||
public void setThrowFactor(double throwFactor) {
|
||||
this.throwFactor = throwFactor;
|
||||
}
|
||||
|
||||
public Entity getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setCooldown(long cooldown) {
|
||||
this.cooldown = cooldown;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.projectkorra.projectkorra.waterbending;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
|
@ -15,10 +15,10 @@ import org.bukkit.entity.Player;
|
|||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class WaterSpoutWave extends WaterAbility {
|
||||
|
||||
|
@ -141,7 +141,7 @@ public class WaterSpoutWave extends WaterAbility {
|
|||
remove();
|
||||
return;
|
||||
} else if (player.isSneaking()) {
|
||||
new WaterSpoutWave(player, AbilityType.SHIFT);
|
||||
setType(AbilityType.SHIFT);
|
||||
return;
|
||||
}
|
||||
playFocusWaterEffect(origin.getBlock());
|
||||
|
@ -158,25 +158,21 @@ public class WaterSpoutWave extends WaterAbility {
|
|||
|
||||
charging = true;
|
||||
animation = AnimateState.RISE;
|
||||
if(!getType(player, AbilityType.CLICK).isEmpty()) {
|
||||
WaterSpoutWave clickWave = getType(player, AbilityType.CLICK).get(0);
|
||||
origin = clickWave.origin.clone();
|
||||
location = origin.clone();
|
||||
location = origin.clone();
|
||||
|
||||
if (isPlant(origin.getBlock())) {
|
||||
new PlantRegrowth(player, origin.getBlock());
|
||||
}
|
||||
if (isPlant(origin.getBlock())) {
|
||||
new PlantRegrowth(player, origin.getBlock());
|
||||
}
|
||||
}
|
||||
|
||||
removeOldType(player, AbilityType.CLICK);
|
||||
if (!player.isSneaking()) {
|
||||
if (System.currentTimeMillis() - time > chargeTime) {
|
||||
WaterSpoutWave wave = new WaterSpoutWave(player, AbilityType.RELEASE);
|
||||
wave.animation = AnimateState.SHRINK;
|
||||
wave.direction = direction;
|
||||
setType(AbilityType.RELEASE);
|
||||
setAnimation(AnimateState.SHRINK);
|
||||
} else {
|
||||
remove();
|
||||
}
|
||||
remove();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue