use of com.projectkorra.projectkorra.BendingPlayer in project Spirits by xNuminousx.
the class Infest method infestEntities.
public void infestEntities(Entity entity) {
if (new Random().nextInt(effectInt) == 0) {
if (entity instanceof Player) {
Player ePlayer = (Player) entity;
BendingPlayer bEntity = BendingPlayer.getBendingPlayer(ePlayer);
if (bEntity.hasElement(Element.getElement("DarkSpirit")) && healDarkSpirits) {
LivingEntity le = (LivingEntity) entity;
le.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 120, 1));
ParticleEffect.HEART.display(entity.getLocation().add(0, 2, 0), 0, 0, 0, 0, 1);
}
} else if (entity instanceof Monster) {
LivingEntity le = (LivingEntity) entity;
le.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 120, 1));
ParticleEffect.ANGRY_VILLAGER.display(entity.getLocation().add(0, 1, 0), 0, 0, 0, 0, 1);
} else if (entity instanceof LivingEntity && damageEntities) {
DamageHandler.damageEntity(entity, damage, this);
ParticleEffect.PORTAL.display(entity.getLocation().add(0, 1, 0), 0, 0, 0, 1.5F, 5);
}
}
}
use of com.projectkorra.projectkorra.BendingPlayer in project Spirits by xNuminousx.
the class Fuse method defuse.
public void defuse() {
if (player.getGameMode() == GameMode.SPECTATOR) {
player.setSpectatorTarget(null);
player.setGameMode(originGM);
}
if (target instanceof Player) {
BendingPlayer bTarget = BendingPlayer.getBendingPlayer((Player) target);
if (bTarget.isAvatarState()) {
AvatarState avatarState = getAbility((Player) target, AvatarState.class);
avatarState.remove();
}
}
}
use of com.projectkorra.projectkorra.BendingPlayer in project Spirits by xNuminousx.
the class AbilityListener method onSwing.
@EventHandler
public void onSwing(PlayerAnimationEvent event) {
Player player = event.getPlayer();
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
if (event.isCancelled() || bPlayer == null) {
return;
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase(null)) {
return;
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase("Agility")) {
new Dash(player);
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase("Shackle")) {
new Shackle(player);
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase("Shelter")) {
new Shelter(player, ShelterType.CLICK);
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase("Strike")) {
new Strike(player);
}
}
use of com.projectkorra.projectkorra.BendingPlayer in project Spirits by xNuminousx.
the class AbilityListener method onSneak.
@EventHandler
public void onSneak(PlayerToggleSneakEvent event) {
Player player = event.getPlayer();
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
if (event.isCancelled() || bPlayer == null) {
return;
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase(null)) {
return;
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase("Possess")) {
new Possess(player);
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase("Alleviate")) {
new Alleviate(player);
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase("Intoxicate")) {
new Intoxicate(player);
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase("Agility")) {
new Soar(player);
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase("Shelter")) {
new Shelter(player, ShelterType.SHIFT);
} else if (bPlayer.getBoundAbilityName().equalsIgnoreCase("Vanish")) {
if (event.isSneaking()) {
new Vanish(player);
} else {
return;
}
}
}
use of com.projectkorra.projectkorra.BendingPlayer in project Spirits by xNuminousx.
the class Rejuvenate method healEntities.
public void healEntities(Entity entity) {
if (new Random().nextInt(effectInt) == 0) {
if (entity instanceof Player && damageDarkSpirits) {
Player ePlayer = (Player) entity;
BendingPlayer bEntity = BendingPlayer.getBendingPlayer(ePlayer);
if (bEntity.hasElement(Element.getElement("DarkSpirit"))) {
DamageHandler.damageEntity(ePlayer, damage, this);
}
} else if (entity instanceof Monster && damageMonsters) {
DamageHandler.damageEntity(entity, damage, this);
} else {
LivingEntity le = (LivingEntity) entity;
le.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 120, 1));
ParticleEffect.HEART.display(entity.getLocation().add(0, 2, 0), 0, 0, 0, 0, 1);
}
}
}
Aggregations