mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 00:15:05 +00:00
Passive fixes (#708)
* Passive fixes * Fixed Air & Chi Saturation not being toggled with /b t * Renamed Hodor to FerroControl
This commit is contained in:
parent
14bdf056e4
commit
011a047559
11 changed files with 167 additions and 22 deletions
|
@ -256,7 +256,7 @@ public class BendingPlayer {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUsePassive(Element element) {
|
public boolean canUsePassive(Element element) {
|
||||||
if (!isToggled() || !isElementToggled(element)) {
|
if (!isToggled() || !isElementToggled(element)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.projectkorra.projectkorra;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -13,6 +14,7 @@ import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.Statistic;
|
import org.bukkit.Statistic;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
@ -128,6 +130,7 @@ import com.projectkorra.projectkorra.earthbending.metal.Extraction;
|
||||||
import com.projectkorra.projectkorra.earthbending.metal.MetalClips;
|
import com.projectkorra.projectkorra.earthbending.metal.MetalClips;
|
||||||
import com.projectkorra.projectkorra.earthbending.passive.DensityShift;
|
import com.projectkorra.projectkorra.earthbending.passive.DensityShift;
|
||||||
import com.projectkorra.projectkorra.earthbending.passive.EarthPassive;
|
import com.projectkorra.projectkorra.earthbending.passive.EarthPassive;
|
||||||
|
import com.projectkorra.projectkorra.earthbending.passive.FerroControl;
|
||||||
import com.projectkorra.projectkorra.earthbending.sand.SandSpout;
|
import com.projectkorra.projectkorra.earthbending.sand.SandSpout;
|
||||||
import com.projectkorra.projectkorra.event.EntityBendingDeathEvent;
|
import com.projectkorra.projectkorra.event.EntityBendingDeathEvent;
|
||||||
import com.projectkorra.projectkorra.event.HorizontalVelocityChangeEvent;
|
import com.projectkorra.projectkorra.event.HorizontalVelocityChangeEvent;
|
||||||
|
@ -764,27 +767,27 @@ public class PKListener implements Listener {
|
||||||
|
|
||||||
if (!event.isCancelled() && bPlayer.hasElement(Element.AIR) && event.getCause() == DamageCause.FALL && bPlayer.canBendPassive(Element.AIR)) {
|
if (!event.isCancelled() && bPlayer.hasElement(Element.AIR) && event.getCause() == DamageCause.FALL && bPlayer.canBendPassive(Element.AIR)) {
|
||||||
new AirBurst(player, true);
|
new AirBurst(player, true);
|
||||||
if (CoreAbility.getAbility(GracefulDescent.class).isEnabled()) {
|
if (CoreAbility.getAbility(GracefulDescent.class).isEnabled() && PassiveManager.hasPassive(player, CoreAbility.getAbility(GracefulDescent.class))) {
|
||||||
event.setDamage(0D);
|
event.setDamage(0D);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!event.isCancelled() && bPlayer.hasElement(Element.WATER) && event.getCause() == DamageCause.FALL && bPlayer.canBendPassive(Element.WATER) && CoreAbility.getAbility(Hydrosink.class).isEnabled()) {
|
if (!event.isCancelled() && bPlayer.hasElement(Element.WATER) && event.getCause() == DamageCause.FALL && bPlayer.canBendPassive(Element.WATER) && CoreAbility.getAbility(Hydrosink.class).isEnabled() && PassiveManager.hasPassive(player, CoreAbility.getAbility(Hydrosink.class))) {
|
||||||
if (WaterPassive.applyNoFall(player)) {
|
if (WaterPassive.applyNoFall(player)) {
|
||||||
event.setDamage(0D);
|
event.setDamage(0D);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!event.isCancelled() && bPlayer.hasElement(Element.EARTH) && event.getCause() == DamageCause.FALL && bPlayer.canBendPassive(Element.EARTH) && CoreAbility.getAbility(DensityShift.class).isEnabled()) {
|
if (!event.isCancelled() && bPlayer.hasElement(Element.EARTH) && event.getCause() == DamageCause.FALL && bPlayer.canBendPassive(Element.EARTH) && CoreAbility.getAbility(DensityShift.class).isEnabled() && PassiveManager.hasPassive(player, CoreAbility.getAbility(DensityShift.class))) {
|
||||||
if (EarthPassive.softenLanding(player)) {
|
if (EarthPassive.softenLanding(player)) {
|
||||||
event.setDamage(0D);
|
event.setDamage(0D);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!event.isCancelled() && bPlayer.hasElement(Element.CHI) && event.getCause() == DamageCause.FALL && bPlayer.canBendPassive(Element.CHI) && CoreAbility.getAbility(Acrobatics.class).isEnabled()) {
|
if (!event.isCancelled() && bPlayer.hasElement(Element.CHI) && event.getCause() == DamageCause.FALL && bPlayer.canBendPassive(Element.CHI) && CoreAbility.getAbility(Acrobatics.class).isEnabled() && PassiveManager.hasPassive(player, CoreAbility.getAbility(Acrobatics.class))) {
|
||||||
double initdamage = event.getDamage();
|
double initdamage = event.getDamage();
|
||||||
double newdamage = event.getDamage() * ChiPassive.getFallReductionFactor();
|
double newdamage = event.getDamage() * ChiPassive.getFallReductionFactor();
|
||||||
double finaldamage = initdamage - newdamage;
|
double finaldamage = initdamage - newdamage;
|
||||||
|
@ -1181,6 +1184,7 @@ public class PKListener implements Listener {
|
||||||
JUMPS.remove(player);
|
JUMPS.remove(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void onPlayerSneak(PlayerToggleSneakEvent event) {
|
public void onPlayerSneak(PlayerToggleSneakEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
@ -1221,6 +1225,28 @@ public class PKListener implements Listener {
|
||||||
BlockSource.update(player, ClickType.SHIFT_DOWN);
|
BlockSource.update(player, ClickType.SHIFT_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CoreAbility.getAbility(FerroControl.class).isEnabled() && PassiveManager.hasPassive(player, CoreAbility.getAbility(FerroControl.class)) && !bPlayer.isOnCooldown("Hodor")) {
|
||||||
|
if (event.isSneaking()) {
|
||||||
|
Block block = player.getTargetBlock((HashSet<Material>) null, 5);
|
||||||
|
if (block != null) {
|
||||||
|
if (block.getType() == Material.IRON_DOOR_BLOCK && !GeneralMethods.isRegionProtectedFromBuild(player, block.getLocation())) {
|
||||||
|
if (block.getData() >= 8) {
|
||||||
|
block = block.getRelative(BlockFace.DOWN);
|
||||||
|
}
|
||||||
|
if (block.getData() < 4) {
|
||||||
|
block.setData((byte) (block.getData() + 4));
|
||||||
|
block.getWorld().playSound(block.getLocation(), Sound.BLOCK_IRON_DOOR_CLOSE, 10, 1);
|
||||||
|
} else {
|
||||||
|
block.setData((byte) (block.getData() - 4));
|
||||||
|
block.getWorld().playSound(block.getLocation(), Sound.BLOCK_IRON_DOOR_OPEN, 10, 1);
|
||||||
|
}
|
||||||
|
bPlayer.addCooldown("Hodor", 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AirScooter.check(player);
|
AirScooter.check(player);
|
||||||
|
|
||||||
CoreAbility coreAbil = bPlayer.getBoundAbility();
|
CoreAbility coreAbil = bPlayer.getBoundAbility();
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.BendingPlayer;
|
import com.projectkorra.projectkorra.BendingPlayer;
|
||||||
import com.projectkorra.projectkorra.Element;
|
import com.projectkorra.projectkorra.Element;
|
||||||
|
import com.projectkorra.projectkorra.Element.SubElement;
|
||||||
import com.projectkorra.projectkorra.ability.CoreAbility;
|
import com.projectkorra.projectkorra.ability.CoreAbility;
|
||||||
import com.projectkorra.projectkorra.ability.PassiveAbility;
|
import com.projectkorra.projectkorra.ability.PassiveAbility;
|
||||||
|
|
||||||
|
@ -26,9 +27,7 @@ public class PassiveManager {
|
||||||
}
|
}
|
||||||
for (CoreAbility ability : CoreAbility.getAbilities()) {
|
for (CoreAbility ability : CoreAbility.getAbilities()) {
|
||||||
if (ability instanceof PassiveAbility) {
|
if (ability instanceof PassiveAbility) {
|
||||||
if (!ability.isEnabled()) {
|
if (!hasPassive(player, ability)) {
|
||||||
continue;
|
|
||||||
} else if (!bPlayer.canBendPassive(ability.getElement())) {
|
|
||||||
continue;
|
continue;
|
||||||
} else if (CoreAbility.hasAbility(player, ability.getClass())) {
|
} else if (CoreAbility.hasAbility(player, ability.getClass())) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -67,6 +66,28 @@ public class PassiveManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean hasPassive(Player player, CoreAbility passive) {
|
||||||
|
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
||||||
|
Element element = passive.getElement();
|
||||||
|
if (passive.getElement() instanceof SubElement) {
|
||||||
|
element = ((SubElement) passive.getElement()).getParentElement();
|
||||||
|
}
|
||||||
|
if (bPlayer == null) {
|
||||||
|
return false;
|
||||||
|
} else if (!(passive instanceof PassiveAbility)) {
|
||||||
|
return false;
|
||||||
|
} else if (!passive.isEnabled()) {
|
||||||
|
return false;
|
||||||
|
} else if (!bPlayer.canBendPassive(passive.getElement())) {
|
||||||
|
return false;
|
||||||
|
} else if (!bPlayer.isToggled()) {
|
||||||
|
return false;
|
||||||
|
} else if (!bPlayer.isElementToggled(element)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public static Set<String> getPassivesForElement(Element element) {
|
public static Set<String> getPassivesForElement(Element element) {
|
||||||
if (PASSIVES_BY_ELEMENT.get(element) == null) {
|
if (PASSIVES_BY_ELEMENT.get(element) == null) {
|
||||||
return new HashSet<>();
|
return new HashSet<>();
|
||||||
|
|
|
@ -6,10 +6,12 @@ import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.ability.AirAbility;
|
import com.projectkorra.projectkorra.ability.AirAbility;
|
||||||
|
import com.projectkorra.projectkorra.ability.CoreAbility;
|
||||||
import com.projectkorra.projectkorra.ability.PassiveAbility;
|
import com.projectkorra.projectkorra.ability.PassiveAbility;
|
||||||
|
import com.projectkorra.projectkorra.chiblocking.passive.ChiAgility;
|
||||||
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
||||||
|
|
||||||
public class AirAgilityPassive extends AirAbility implements PassiveAbility {
|
public class AirAgility extends AirAbility implements PassiveAbility {
|
||||||
|
|
||||||
// Configurable variables
|
// Configurable variables
|
||||||
private int jumpPower;
|
private int jumpPower;
|
||||||
|
@ -19,7 +21,7 @@ public class AirAgilityPassive extends AirAbility implements PassiveAbility {
|
||||||
private boolean jumpActivate;
|
private boolean jumpActivate;
|
||||||
private boolean speedActivate;
|
private boolean speedActivate;
|
||||||
|
|
||||||
public AirAgilityPassive(Player player) {
|
public AirAgility(Player player) {
|
||||||
super(player);
|
super(player);
|
||||||
setFields();
|
setFields();
|
||||||
}
|
}
|
||||||
|
@ -35,6 +37,16 @@ public class AirAgilityPassive extends AirAbility implements PassiveAbility {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CoreAbility.hasAbility(player, ChiAgility.class)) {
|
||||||
|
ChiAgility chiAgility = CoreAbility.getAbility(player, ChiAgility.class);
|
||||||
|
if (chiAgility.getJumpPower() > jumpPower) {
|
||||||
|
jumpPower = chiAgility.getJumpPower();
|
||||||
|
}
|
||||||
|
if (chiAgility.getSpeedPower() > speedPower) {
|
||||||
|
speedPower = chiAgility.getSpeedPower();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Jump Buff
|
// Jump Buff
|
||||||
jumpActivate = true;
|
jumpActivate = true;
|
||||||
if (player.hasPotionEffect(PotionEffectType.JUMP)) {
|
if (player.hasPotionEffect(PotionEffectType.JUMP)) {
|
||||||
|
@ -96,4 +108,12 @@ public class AirAgilityPassive extends AirAbility implements PassiveAbility {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getJumpPower() {
|
||||||
|
return jumpPower;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSpeedPower() {
|
||||||
|
return speedPower;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.BendingPlayer;
|
import com.projectkorra.projectkorra.BendingPlayer;
|
||||||
import com.projectkorra.projectkorra.ability.ChiAbility;
|
import com.projectkorra.projectkorra.ability.ChiAbility;
|
||||||
|
import com.projectkorra.projectkorra.ability.util.PassiveManager;
|
||||||
import com.projectkorra.projectkorra.airbending.Suffocate;
|
import com.projectkorra.projectkorra.airbending.Suffocate;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
|
|
||||||
|
@ -72,6 +73,9 @@ public class Paralyze extends ChiAbility {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
ENTITIES.remove(entity);
|
ENTITIES.remove(entity);
|
||||||
|
if (entity instanceof Player) {
|
||||||
|
PassiveManager.registerPassives((Player) entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,13 @@ import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.ability.ChiAbility;
|
import com.projectkorra.projectkorra.ability.ChiAbility;
|
||||||
|
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.chiblocking.AcrobatStance;
|
import com.projectkorra.projectkorra.chiblocking.AcrobatStance;
|
||||||
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
||||||
|
|
||||||
public class ChiAgilityPassive extends ChiAbility implements PassiveAbility {
|
public class ChiAgility extends ChiAbility implements PassiveAbility {
|
||||||
|
|
||||||
// Configurable variables
|
// Configurable variables
|
||||||
private int jumpPower;
|
private int jumpPower;
|
||||||
|
@ -20,7 +22,7 @@ public class ChiAgilityPassive extends ChiAbility implements PassiveAbility {
|
||||||
private boolean jumpActivate;
|
private boolean jumpActivate;
|
||||||
private boolean speedActivate;
|
private boolean speedActivate;
|
||||||
|
|
||||||
public ChiAgilityPassive(Player player) {
|
public ChiAgility(Player player) {
|
||||||
super(player);
|
super(player);
|
||||||
setFields();
|
setFields();
|
||||||
}
|
}
|
||||||
|
@ -36,6 +38,16 @@ public class ChiAgilityPassive extends ChiAbility implements PassiveAbility {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CoreAbility.hasAbility(player, AirAgility.class)) {
|
||||||
|
AirAgility airAgility = CoreAbility.getAbility(player, AirAgility.class);
|
||||||
|
if (airAgility.getJumpPower() > jumpPower) {
|
||||||
|
jumpPower = airAgility.getJumpPower();
|
||||||
|
}
|
||||||
|
if (airAgility.getSpeedPower() > speedPower) {
|
||||||
|
speedPower = airAgility.getSpeedPower();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Jump Buff
|
// Jump Buff
|
||||||
int jMax = jumpPower;
|
int jMax = jumpPower;
|
||||||
if (hasAbility(player, AcrobatStance.class)) {
|
if (hasAbility(player, AcrobatStance.class)) {
|
||||||
|
@ -107,4 +119,12 @@ public class ChiAgilityPassive extends ChiAbility implements PassiveAbility {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getJumpPower() {
|
||||||
|
return jumpPower;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSpeedPower() {
|
||||||
|
return speedPower;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -341,6 +341,7 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Earth.Tremorsense.Description", "This is a pure utility ability for earthbenders. If you are in an area of low-light and are standing on top of an earthbendable block, this ability will automatically turn that block into glowstone, visible *only by you*. If you lose contact with a bendable block, the light will go out as you have lost contact with the earth and cannot 'see' until you can touch earth again. Additionally, if you click with this ability selected, smoke will appear above nearby earth with pockets of air beneath them.");
|
config.addDefault("Abilities.Earth.Tremorsense.Description", "This is a pure utility ability for earthbenders. If you are in an area of low-light and are standing on top of an earthbendable block, this ability will automatically turn that block into glowstone, visible *only by you*. If you lose contact with a bendable block, the light will go out as you have lost contact with the earth and cannot 'see' until you can touch earth again. Additionally, if you click with this ability selected, smoke will appear above nearby earth with pockets of air beneath them.");
|
||||||
config.addDefault("Abilities.Earth.Tremorsense.Instructions", "Simply left click while on an earthbendable block.");
|
config.addDefault("Abilities.Earth.Tremorsense.Instructions", "Simply left click while on an earthbendable block.");
|
||||||
config.addDefault("Abilities.Earth.Passive.DensityShift.Description", "DensityShift is a passive ability which allows earthbenders to make a firm landing negating all fall damage on any earthbendable surface.");
|
config.addDefault("Abilities.Earth.Passive.DensityShift.Description", "DensityShift is a passive ability which allows earthbenders to make a firm landing negating all fall damage on any earthbendable surface.");
|
||||||
|
config.addDefault("Abilities.Earth.Passive.FerroControl.Description", "FerroControl is a passive ability which allows metalbenders to simply open and close iron doors by sneaking.");
|
||||||
|
|
||||||
config.addDefault("Commands.Help.Elements.Fire", "Fire is the element of power. Firebenders focus on destruction and incineration. Their abilities are pretty straight forward: set things on fire. They do have a bit of utility however, being able to make themselves un-ignitable, extinguish large areas, cook food in their hands, extinguish large areas, small bursts of flight, and then comes the abilities to shoot fire from your hands.\nFirebenders can chain their abilities into combos, type /b help FireCombos for more information.");
|
config.addDefault("Commands.Help.Elements.Fire", "Fire is the element of power. Firebenders focus on destruction and incineration. Their abilities are pretty straight forward: set things on fire. They do have a bit of utility however, being able to make themselves un-ignitable, extinguish large areas, cook food in their hands, extinguish large areas, small bursts of flight, and then comes the abilities to shoot fire from your hands.\nFirebenders can chain their abilities into combos, type /b help FireCombos for more information.");
|
||||||
config.addDefault("Abilities.Fire.Blaze.Description", "Blaze is a basic firebending technique that can be extremely deadly if used right. It's useful to stop people from chasing you or to create space between you and other players..");
|
config.addDefault("Abilities.Fire.Blaze.Description", "Blaze is a basic firebending technique that can be extremely deadly if used right. It's useful to stop people from chasing you or to create space between you and other players..");
|
||||||
|
@ -946,6 +947,7 @@ public class ConfigManager {
|
||||||
|
|
||||||
config.addDefault("Abilities.Earth.Passive.Duration", 2500);
|
config.addDefault("Abilities.Earth.Passive.Duration", 2500);
|
||||||
config.addDefault("Abilities.Earth.Passive.DensityShift.Enabled", true);
|
config.addDefault("Abilities.Earth.Passive.DensityShift.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.Length", 6);
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.projectkorra.projectkorra.earthbending.passive;
|
package com.projectkorra.projectkorra.earthbending.passive;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.BendingPlayer;
|
import com.projectkorra.projectkorra.BendingPlayer;
|
||||||
import com.projectkorra.projectkorra.Element;
|
|
||||||
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;
|
||||||
|
@ -11,15 +10,12 @@ import com.projectkorra.projectkorra.earthbending.lava.LavaSurgeWall;
|
||||||
import com.projectkorra.projectkorra.earthbending.lava.LavaSurgeWave;
|
import com.projectkorra.projectkorra.earthbending.lava.LavaSurgeWave;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.material.MaterialData;
|
import org.bukkit.material.MaterialData;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
@ -100,7 +96,7 @@ public class EarthPassive {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
/*@SuppressWarnings("deprecation")
|
||||||
public static void handleMetalPassives() {
|
public static void handleMetalPassives() {
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
||||||
|
@ -130,7 +126,7 @@ public class EarthPassive {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public static void revertSands() {
|
public static void revertSands() {
|
||||||
for (Block block : SAND_BLOCKS.keySet()) {
|
for (Block block : SAND_BLOCKS.keySet()) {
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.projectkorra.projectkorra.earthbending.passive;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.ability.MetalAbility;
|
||||||
|
import com.projectkorra.projectkorra.ability.PassiveAbility;
|
||||||
|
|
||||||
|
public class FerroControl extends MetalAbility implements PassiveAbility {
|
||||||
|
|
||||||
|
public FerroControl(Player player) {
|
||||||
|
super(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void progress() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSneakAbility() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isHarmlessAbility() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getCooldown() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "FerroControl";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Location getLocation() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isInstantiable() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -19,7 +19,7 @@ public class EarthbendingManager implements Runnable {
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
EarthPassive.revertSands();
|
EarthPassive.revertSands();
|
||||||
EarthPassive.handleMetalPassives();
|
//EarthPassive.handleMetalPassives();
|
||||||
RevertChecker.revertEarthBlocks();
|
RevertChecker.revertEarthBlocks();
|
||||||
Shockwave.progressAll();
|
Shockwave.progressAll();
|
||||||
Tremorsense.manage(Bukkit.getServer());
|
Tremorsense.manage(Bukkit.getServer());
|
||||||
|
|
|
@ -6,9 +6,12 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.BendingPlayer;
|
import com.projectkorra.projectkorra.BendingPlayer;
|
||||||
import com.projectkorra.projectkorra.Element;
|
import com.projectkorra.projectkorra.ability.CoreAbility;
|
||||||
|
import com.projectkorra.projectkorra.ability.util.PassiveManager;
|
||||||
import com.projectkorra.projectkorra.airbending.passive.AirPassive;
|
import com.projectkorra.projectkorra.airbending.passive.AirPassive;
|
||||||
|
import com.projectkorra.projectkorra.airbending.passive.AirSaturation;
|
||||||
import com.projectkorra.projectkorra.chiblocking.passive.ChiPassive;
|
import com.projectkorra.projectkorra.chiblocking.passive.ChiPassive;
|
||||||
|
import com.projectkorra.projectkorra.chiblocking.passive.ChiSaturation;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
||||||
|
|
||||||
|
@ -33,6 +36,9 @@ public class PassiveHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkExhaustionPassives(Player player) {
|
public static void checkExhaustionPassives(Player player) {
|
||||||
|
if (!CoreAbility.getAbility(AirSaturation.class).isEnabled() && !CoreAbility.getAbility(ChiSaturation.class).isEnabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
double air = AirPassive.getExhaustionFactor();
|
double air = AirPassive.getExhaustionFactor();
|
||||||
double chi = ChiPassive.getExhaustionFactor();
|
double chi = ChiPassive.getExhaustionFactor();
|
||||||
|
|
||||||
|
@ -49,9 +55,9 @@ public class PassiveHandler {
|
||||||
if (bPlayer == null)
|
if (bPlayer == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!bPlayer.hasElement(Element.AIR))
|
if (!PassiveManager.hasPassive(player, CoreAbility.getAbility(AirSaturation.class)))
|
||||||
air = 0;
|
air = 0;
|
||||||
if (!bPlayer.hasElement(Element.CHI))
|
if (!PassiveManager.hasPassive(player, CoreAbility.getAbility(ChiSaturation.class)))
|
||||||
chi = 0;
|
chi = 0;
|
||||||
|
|
||||||
double max = Math.max(air, chi);
|
double max = Math.max(air, chi);
|
||||||
|
|
Loading…
Reference in a new issue