Breathbending Updates

Added a method to free an entity from breathbending, and allowed players
to use simple bendings (AirSwipe, WaterManipulation, FireBlast,
EarthBlast) even if they are being BreathBent.
This commit is contained in:
AlexTheCoder 2014-08-24 03:37:01 -04:00
parent 15afefe181
commit 13ee8969f3
2 changed files with 21 additions and 7 deletions

View file

@ -78,6 +78,7 @@ import com.projectkorra.ProjectKorra.airbending.AirShield;
import com.projectkorra.ProjectKorra.airbending.AirSpout; import com.projectkorra.ProjectKorra.airbending.AirSpout;
import com.projectkorra.ProjectKorra.airbending.AirSuction; import com.projectkorra.ProjectKorra.airbending.AirSuction;
import com.projectkorra.ProjectKorra.airbending.AirSwipe; import com.projectkorra.ProjectKorra.airbending.AirSwipe;
import com.projectkorra.ProjectKorra.airbending.Breathbending;
import com.projectkorra.ProjectKorra.airbending.Tornado; import com.projectkorra.ProjectKorra.airbending.Tornado;
import com.projectkorra.ProjectKorra.chiblocking.Paralyze; import com.projectkorra.ProjectKorra.chiblocking.Paralyze;
import com.projectkorra.ProjectKorra.chiblocking.RapidPunch; import com.projectkorra.ProjectKorra.chiblocking.RapidPunch;
@ -1838,4 +1839,10 @@ public class Methods {
return false; return false;
} }
public static void breakBreathbendingHold(Entity entity) {
if(Breathbending.isBreathbent(entity)) {
Breathbending.breakBreathbend(entity);
}
}
} }

View file

@ -306,7 +306,13 @@ public class PKListener implements Listener {
if (event.isCancelled()) return; if (event.isCancelled()) return;
if (Paralyze.isParalyzed(player) || Bloodbending.isBloodbended(player) || Breathbending.isBreathbent(player)) { if(Breathbending.isBreathbent(player)) {
if(!Methods.getBoundAbility(player).equalsIgnoreCase("AirSwipe") || !Methods.getBoundAbility(player).equalsIgnoreCase("FireBlast") || !Methods.getBoundAbility(player).equalsIgnoreCase("EarthBlast") || !Methods.getBoundAbility(player).equalsIgnoreCase("WaterManipulation")) {
event.setCancelled(true);
}
}
if (Paralyze.isParalyzed(player) || Bloodbending.isBloodbended(player)) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -623,7 +629,13 @@ public class PKListener implements Listener {
Player player = event.getPlayer(); Player player = event.getPlayer();
if (Bloodbending.isBloodbended(player) || Paralyze.isParalyzed(player) || Breathbending.isBreathbent(player)) { if(Breathbending.isBreathbent(player)) {
if(!Methods.getBoundAbility(player).equalsIgnoreCase("AirSwipe") || !Methods.getBoundAbility(player).equalsIgnoreCase("FireBlast") || !Methods.getBoundAbility(player).equalsIgnoreCase("EarthBlast") || !Methods.getBoundAbility(player).equalsIgnoreCase("WaterManipulation")) {
event.setCancelled(true);
}
}
if (Bloodbending.isBloodbended(player) || Paralyze.isParalyzed(player)) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -1005,11 +1017,6 @@ public class PKListener implements Listener {
return; return;
} }
if (Breathbending.isBreathbent(e.getEntity())) {
if(e.getCause() == DamageCause.CUSTOM) {
Breathbending.breakBreathbend(e.getEntity());
}
}
Entity en = e.getEntity(); Entity en = e.getEntity();
if (en instanceof Player) { if (en instanceof Player) {