mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 19:50:37 +00:00
commit
a9508f6ac2
35 changed files with 170 additions and 80 deletions
|
@ -481,13 +481,46 @@ public class GeneralMethods {
|
|||
* {@link EntityDamageByEntityEvent}.
|
||||
*
|
||||
* @param player The player dealing the damage
|
||||
* @param entity The entity that is receiving the damage
|
||||
* @param entity The entity receiving the damage
|
||||
* @param damage The amount of damage to deal
|
||||
* @param ability The ability that is used to damage the entity
|
||||
*/
|
||||
public static void damageEntity(Player player, Entity entity, double damage) {
|
||||
damageEntity(player, entity, damage, null);
|
||||
public static void damageEntity(Player player, Entity entity, double damage, String ability) {
|
||||
if (abilityExists(ability)) {
|
||||
damageEntity(player, entity, damage, getAbilityElement(ability), getAbilitySubElement(ability), ability);
|
||||
} else {
|
||||
damageEntity(player, entity, damage, null, null, ability);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Damages an Entity by amount of damage specified. Starts a
|
||||
* {@link EntityDamageByEntityEvent}.
|
||||
*
|
||||
* @param player The player dealing the damage
|
||||
* @param entity The entity receiving the damage
|
||||
* @param damage The amount of damage to deal
|
||||
* @param element The element of the ability
|
||||
* @param ability The ability that is used to damage the entity
|
||||
*/
|
||||
public static void damageEntity(Player player, Entity entity, double damage, Element element, String ability) {
|
||||
damageEntity(player, entity, damage, element, null, ability);
|
||||
}
|
||||
|
||||
/**
|
||||
* Damages an Entity by amount of damage specified. Starts a
|
||||
* {@link EntityDamageByEntityEvent}.
|
||||
*
|
||||
* @param player The player dealing the damage
|
||||
* @param entity The entity receiving the damage
|
||||
* @param damage The amount of damage to deal
|
||||
* @param sub The subelement of the ability
|
||||
* @param ability The ability that is used to damage the entity
|
||||
*/
|
||||
public static void damageEntity(Player player, Entity entity, double damage, SubElement sub, String ability) {
|
||||
damageEntity(player, entity, damage, null, sub, ability);
|
||||
}
|
||||
|
||||
/**
|
||||
* Damages an Entity by amount of damage specified. Starts a
|
||||
* {@link EntityDamageByEntityEvent}.
|
||||
|
@ -495,9 +528,11 @@ public class GeneralMethods {
|
|||
* @param player The player dealing the damage
|
||||
* @param entity The entity that is receiving the damage
|
||||
* @param damage The amount of damage to deal
|
||||
* @param element The element of the ability
|
||||
* @param sub The sub element of the ability
|
||||
* @param ability The ability that is used to damage the entity
|
||||
*/
|
||||
public static void damageEntity(Player player, Entity entity, double damage, String ability) {
|
||||
public static void damageEntity(Player player, Entity entity, double damage, Element element, SubElement sub, String ability) {
|
||||
if (entity instanceof LivingEntity) {
|
||||
if (entity instanceof Player) {
|
||||
if (Commands.invincible.contains(entity.getName()))
|
||||
|
@ -507,7 +542,7 @@ public class GeneralMethods {
|
|||
NCPExemptionManager.exemptPermanently(player, CheckType.FIGHT_REACH);
|
||||
}
|
||||
if (((LivingEntity) entity).getHealth() - damage <= 0 && entity instanceof Player && !entity.isDead()) {
|
||||
PlayerBendingDeathEvent event = new PlayerBendingDeathEvent((Player) entity, player, ability, damage);
|
||||
PlayerBendingDeathEvent event = new PlayerBendingDeathEvent((Player) entity, player, damage, element, sub, ability);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
((LivingEntity) entity).damage(damage, player);
|
||||
|
|
|
@ -576,9 +576,9 @@ public class PKListener implements Listener {
|
|||
double damage = ((e.getDistanceTraveled() - minimumDistance) < 0 ? 0 : e.getDistanceTraveled() - minimumDistance) / (e.getDifference().length());
|
||||
if (damage > 0) {
|
||||
if(damage <= maxDamage) {
|
||||
GeneralMethods.damageEntity(e.getInstigator(), e.getEntity(), damage);
|
||||
GeneralMethods.damageEntity(e.getInstigator(), e.getEntity(), damage, null);
|
||||
} else {
|
||||
GeneralMethods.damageEntity(e.getInstigator(), e.getEntity(), maxDamage);
|
||||
GeneralMethods.damageEntity(e.getInstigator(), e.getEntity(), maxDamage, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -605,15 +605,24 @@ public class PKListener implements Listener {
|
|||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPlayerBendingDeath(PlayerBendingDeathEvent event) {
|
||||
if (ConfigManager.deathMsgConfig.get().getBoolean("Properties.Enabled")) {
|
||||
bendingDeathPlayer.put(event.getVictim(), event.getAbility());
|
||||
final Player player = event.getVictim();
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
bendingDeathPlayer.remove(player);
|
||||
if (event.getAbility() != null) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (event.getSubElement() != null) {
|
||||
sb.append(event.getSubElement().getChatColor());
|
||||
} else if (event.getElement() != null) {
|
||||
sb.append(event.getElement().getChatColor());
|
||||
}
|
||||
}.runTaskLater(ProjectKorra.plugin, 20);
|
||||
sb.append(event.getAbility());
|
||||
bendingDeathPlayer.put(event.getVictim(), sb.toString());
|
||||
final Player player = event.getVictim();
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
bendingDeathPlayer.remove(player);
|
||||
}
|
||||
}.runTaskLater(ProjectKorra.plugin, 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -706,7 +715,7 @@ public class PKListener implements Listener {
|
|||
Player source = Flight.getLaunchedBy(player);
|
||||
if (source != null) {
|
||||
event.setCancelled(true);
|
||||
GeneralMethods.damageEntity(source, player, event.getDamage());
|
||||
GeneralMethods.damageEntity(source, player, event.getDamage(), null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -858,7 +867,12 @@ public class PKListener implements Listener {
|
|||
if (bendingDeathPlayer.containsKey(event.getEntity())) {
|
||||
String message = ConfigManager.deathMsgConfig.get().getString("Properties.Default");
|
||||
String ability = bendingDeathPlayer.get(event.getEntity());
|
||||
String element = null;
|
||||
String tempAbility = ChatColor.stripColor(ability);
|
||||
Element element = null;
|
||||
if (GeneralMethods.abilityExists(tempAbility)) {
|
||||
element = GeneralMethods.getAbilityElement(tempAbility);
|
||||
}
|
||||
/*
|
||||
Player killer = event.getEntity().getKiller();
|
||||
String killerAbility = GeneralMethods.getLastUsedAbility(killer, false);
|
||||
if (ability == null) {
|
||||
|
@ -876,10 +890,17 @@ public class PKListener implements Listener {
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (ConfigManager.deathMsgConfig.get().contains(element + "." + ability)) {
|
||||
message = ConfigManager.deathMsgConfig.get().getString(element + "." + ability);
|
||||
*/
|
||||
if (element != null) {
|
||||
if (ConfigManager.deathMsgConfig.get().contains(element.toString() + "." + ability)) {
|
||||
message = ConfigManager.deathMsgConfig.get().getString(element + "." + ability);
|
||||
}
|
||||
} else {
|
||||
if (ConfigManager.deathMsgConfig.get().contains("Combo." + ability)) {
|
||||
message = ConfigManager.deathMsgConfig.get().getString("Combo." + ability);
|
||||
}
|
||||
}
|
||||
message = message.replace("{victim}", event.getEntity().getName()).replace("{attacker}", event.getEntity().getKiller().getName()).replace("{ability}", GeneralMethods.getAbilityColor(killerAbility) + ability);
|
||||
message = message.replace("{victim}", event.getEntity().getName()).replace("{attacker}", event.getEntity().getKiller().getName()).replace("{ability}", ability);
|
||||
event.setDeathMessage(message);
|
||||
bendingDeathPlayer.remove(event.getEntity());
|
||||
}
|
||||
|
|
|
@ -98,16 +98,13 @@ public class ComboManager {
|
|||
instructions.put("AirStream", "AirShield (Hold Shift) > AirSuction (Left Click) > AirBlast (Left Click)");
|
||||
|
||||
/*
|
||||
* ArrayList<AbilityInformation> airSlice = new
|
||||
* ArrayList<AbilityInformation>(); airSlice.add(new
|
||||
* AbilityInformation("AirBlast",ClickType.LEFTCLICK)); airSlice.add(new
|
||||
* AbilityInformation("AirScooter",ClickType.SHIFTDOWN));
|
||||
* airSlice.add(new
|
||||
* AbilityInformation("AirScooter",ClickType.LEFTCLICK));
|
||||
* comboAbilityList.put(new
|
||||
* ComboAbility("AirSlice",airSlice,AirCombo.class));
|
||||
*/
|
||||
|
||||
ArrayList<AbilityInformation> airSlice = new ArrayList<AbilityInformation>();
|
||||
airSlice.add(new AbilityInformation("AirBlast",ClickType.LEFT_CLICK));
|
||||
airSlice.add(new AbilityInformation("AirScooter",ClickType.SHIFT_DOWN));
|
||||
airSlice.add(new AbilityInformation("AirScooter",ClickType.LEFT_CLICK));
|
||||
comboAbilityList.put("AirSlice", new ComboAbility("AirSlice",airSlice,AirCombo.class));
|
||||
*/
|
||||
|
||||
ArrayList<AbilityInformation> airSweep = new ArrayList<AbilityInformation>();
|
||||
airSweep.add(new AbilityInformation("AirSwipe", ClickType.LEFT_CLICK));
|
||||
airSweep.add(new AbilityInformation("AirSwipe", ClickType.LEFT_CLICK));
|
||||
|
|
|
@ -238,7 +238,7 @@ public class AirBlast extends CoreAbility {
|
|||
AirMethods.breakBreathbendingHold(entity);
|
||||
|
||||
if (damage > 0 && entity instanceof LivingEntity && !entity.equals(player) && !affectedentities.contains(entity)) {
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "AirBlast");
|
||||
affectedentities.add(entity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -396,7 +396,7 @@ public class AirCombo implements ConfigLoadable {
|
|||
}
|
||||
if (damage != 0)
|
||||
if (entity instanceof LivingEntity)
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "AirCombo");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ public class AirSwipe extends CoreAbility {
|
|||
}
|
||||
if (entity instanceof LivingEntity && !affectedentities.contains(entity)) {
|
||||
if (damage != 0)
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "AirSwipe");
|
||||
affectedentities.add(entity);
|
||||
}
|
||||
if (entity instanceof Player) {
|
||||
|
|
|
@ -417,7 +417,7 @@ public class Suffocate extends CoreAbility {
|
|||
BukkitRunnable br1 = new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GeneralMethods.damageEntity(fplayer, target, damage);
|
||||
GeneralMethods.damageEntity(fplayer, target, damage, "Suffocate");
|
||||
}
|
||||
};
|
||||
BukkitRunnable br2 = new BukkitRunnable() {
|
||||
|
|
|
@ -21,7 +21,7 @@ public class QuickStrike {
|
|||
if (e == null)
|
||||
return;
|
||||
|
||||
GeneralMethods.damageEntity(player, e, damage);
|
||||
GeneralMethods.damageEntity(player, e, damage, "QuickStrike");
|
||||
|
||||
if (GeneralMethods.rand.nextInt(100) < blockChance && e instanceof Player) {
|
||||
ChiPassive.blockChi((Player) e);
|
||||
|
|
|
@ -58,7 +58,7 @@ public class RapidPunch {
|
|||
instances.remove(p);
|
||||
if (target instanceof LivingEntity && target != null) {
|
||||
LivingEntity lt = (LivingEntity) target;
|
||||
GeneralMethods.damageEntity(p, target, damage);
|
||||
GeneralMethods.damageEntity(p, target, damage, "RapidPunch");
|
||||
if (target instanceof Player) {
|
||||
if (ChiPassive.willChiBlock(p, (Player) target)) {
|
||||
ChiPassive.blockChi((Player) target);
|
||||
|
|
|
@ -21,7 +21,7 @@ public class SwiftKick {
|
|||
if (e == null)
|
||||
return;
|
||||
|
||||
GeneralMethods.damageEntity(player, e, damage);
|
||||
GeneralMethods.damageEntity(player, e, damage, "SwiftKick");
|
||||
|
||||
if (GeneralMethods.rand.nextInt(100) < blockChance && e instanceof Player) {
|
||||
ChiPassive.blockChi((Player) e);
|
||||
|
|
|
@ -30,16 +30,16 @@ public class ConfigManager {
|
|||
config.addDefault("Air.AirBurst", "{victim} was thrown down by {attacker}'s {ability}");
|
||||
config.addDefault("Air.AirSwipe", "{victim} was struck by {attacker}'s {ability}");
|
||||
config.addDefault("Air.Suffocate", "{victim} was asphyxiated by {attacker}'s {ability}");
|
||||
config.addDefault("Air.AirCombo", "{victim} was overwhelmed by {attacker}'s skill {ability}");
|
||||
|
||||
config.addDefault("Water.IceBlast", "{victim} was shattered by {attacker}'s {ability}");
|
||||
config.addDefault("Water.Torrent", "{victim} was taken down by {attacker}'s {ability}");
|
||||
config.addDefault("Water.IceSpike", "{victim} was impaled by {attacker}'s {ability}");
|
||||
config.addDefault("Water.WaterManipulation", "{victim} was taken down by {attacker}'s {ability}");
|
||||
config.addDefault("Water.WaterArms", "{victim} was too slow for {attacker}'s {ability}");
|
||||
config.addDefault("Water.WaterArmsPunch", "{victim} was too slow for {attacker}'s {ability}");
|
||||
config.addDefault("Water.WaterArmsFreeze", "{victim} was frozen by {attacker}'s {ability}");
|
||||
config.addDefault("Water.WaterArmsSpear", "{victim} was speared to death by {attacker}'s {ability}");
|
||||
config.addDefault("Water.OctopusForm", "{victim} was slapped by {attacker}'s {ability}");
|
||||
config.addDefault("Water.Bloodbending", "{victim} was destroyed by {attacker}'s {ability}");
|
||||
config.addDefault("Water.WaterCombo", "{victim} was overwhelmed by {attacker}'s skill {ability}");
|
||||
|
||||
config.addDefault("Earth.Collapse", "{victim} was suffocated by {attacker}'s {ability}");
|
||||
config.addDefault("Earth.EarthBlast", "{victim} was broken apart by {attacker}'s {ability}");
|
||||
|
@ -47,7 +47,6 @@ public class ConfigManager {
|
|||
config.addDefault("Earth.LavaFlow", "{victim} was caught in by {attacker}'s {ability}");
|
||||
config.addDefault("Earth.MetalClips", "{victim} was too slow for {attacker}'s {ability}");
|
||||
config.addDefault("Earth.Shockwave", "{victim} was blown away by {attacker}'s {ability}");
|
||||
config.addDefault("Earth.EarthCombo", "{victim} was overwhelmed by {attacker}'s skill {ability}");
|
||||
|
||||
config.addDefault("Fire.FireBlast", "{victim} was burnt by {attacker}'s {ability}");
|
||||
config.addDefault("Fire.Blaze", "{victim} was burned alive by {attacker}'s {ability}");
|
||||
|
@ -56,12 +55,17 @@ public class ConfigManager {
|
|||
config.addDefault("Fire.Combustion", "{victim} was shot down by {attacker}'s {ability}");
|
||||
config.addDefault("Fire.FireBurst", "{victim} was blown apart by {attacker}'s {ability}");
|
||||
config.addDefault("Fire.FireShield", "{victim} scorched theirself on {attacker}'s {ability}");
|
||||
config.addDefault("Fire.FireCombo", "{victim} was overwhelmed by {attacker}'s skill {ability}");
|
||||
|
||||
config.addDefault("Chi.QuickStrike", "{victim} was struck down by {attacker}'s {ability}");
|
||||
config.addDefault("Chi.SwiftKick", "{victim} was kicked to the floor by {attacker}'s {ability}");
|
||||
config.addDefault("Chi.RapidPunch", "{victim} took all the hits against {attacker}'s {ability}");
|
||||
config.addDefault("Chi.ChiCombo", "{victim} was overwhelmed by {attacker}'s skill {ability}");
|
||||
|
||||
config.addDefault("Combo.AirCombo", "{victim} was overwhelmed by {attacker}'s skill {ability}");
|
||||
config.addDefault("Combo.FireKick", "{victim} was kicked to the floor with flames by {attacker}'s {ability}");
|
||||
config.addDefault("Combo.FireSpin", "{victim} was caught in {attacker}'s {ability} inferno");
|
||||
config.addDefault("Combo.JetBlaze", "{victim} was blasted away by {attacker}'s {ability}");
|
||||
config.addDefault("Combo.FireWheel", "{victim} was incinerated by {attacker}'s {ability}");
|
||||
config.addDefault("Combo.IceBullet", "{victim}'s heart was frozen by {attacker}'s {ability}");
|
||||
|
||||
deathMsgConfig.save();
|
||||
break;
|
||||
|
|
|
@ -340,7 +340,7 @@ public class EarthBlast {
|
|||
if (EarthMethods.isMetal(sourceblock) && EarthMethods.canMetalbend(player)) {
|
||||
damage = EarthMethods.getMetalAugment(this.damage);
|
||||
}
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "EarthBlast");
|
||||
progressing = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -505,7 +505,7 @@ public class EarthSmash {
|
|||
if (entity instanceof LivingEntity && entity != player && !affectedEntities.contains(entity)) {
|
||||
affectedEntities.add(entity);
|
||||
double damage = currentBlocks.size() / 13 * this.damage;
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "EarthSmash");
|
||||
Vector travelVec = GeneralMethods.getDirection(loc, entity.getLocation());
|
||||
entity.setVelocity(travelVec.setY(knockup).normalize().multiply(knockback));
|
||||
}
|
||||
|
|
|
@ -308,7 +308,7 @@ public class LavaSurge {
|
|||
{
|
||||
if(e.getEntityId() != player.getEntityId())
|
||||
{
|
||||
GeneralMethods.damageEntity(player, e, impactDamage);
|
||||
GeneralMethods.damageEntity(player, e, impactDamage, "LavaSurge");
|
||||
e.setFireTicks(100);
|
||||
GeneralMethods.setVelocity(e, direction.clone());
|
||||
}
|
||||
|
|
|
@ -394,7 +394,7 @@ public class MetalClips {
|
|||
|
||||
if (System.currentTimeMillis() > time + crushInterval) {
|
||||
time = System.currentTimeMillis();
|
||||
GeneralMethods.damageEntity(player, targetent, (crushDamage + (crushDamage * 1.2)));
|
||||
GeneralMethods.damageEntity(player, targetent, (crushDamage + (crushDamage * 1.2)), "MetalClips");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ public class MetalClips {
|
|||
}
|
||||
|
||||
else {
|
||||
GeneralMethods.damageEntity(player, e, 5);
|
||||
GeneralMethods.damageEntity(player, e, 5, "MetalClips");
|
||||
ii.getWorld().dropItem(ii.getLocation(), ii.getItemStack());
|
||||
remove();
|
||||
}
|
||||
|
|
|
@ -254,7 +254,7 @@ public class Ripple {
|
|||
private void affect(Entity entity) {
|
||||
|
||||
if (entity instanceof LivingEntity) {
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "Shockwave");
|
||||
}
|
||||
|
||||
Vector vector = direction.clone();
|
||||
|
|
|
@ -154,7 +154,7 @@ public class SandSpout {
|
|||
for (Player sPlayer : players) {
|
||||
if (!sPlayer.equals(player)) {
|
||||
sPlayer.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, bTime * 20, 1));
|
||||
GeneralMethods.damageEntity(player, sPlayer, spoutDamage);
|
||||
GeneralMethods.damageEntity(player, sPlayer, spoutDamage, "SandSpout");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.projectkorra.projectkorra.event;
|
||||
|
||||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.SubElement;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
|
@ -19,19 +21,25 @@ public class PlayerBendingDeathEvent extends Event {
|
|||
private Player attacker;
|
||||
private String ability;
|
||||
private double damage;
|
||||
private Element element;
|
||||
private SubElement sub;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param victim the player who died
|
||||
* @param attacker the player who killed the victim
|
||||
* @param ability the ability used to kill the victim
|
||||
* @param damage the amount of damage done in the attack that killed the victim
|
||||
* @param element the element of the ability
|
||||
* @param sub the subelement of the ability
|
||||
* @param ability the ability used to kill the victim
|
||||
*/
|
||||
public PlayerBendingDeathEvent(Player victim, Player attacker, String ability, double damage) {
|
||||
public PlayerBendingDeathEvent(Player victim, Player attacker, double damage, Element element, SubElement sub, String ability) {
|
||||
this.victim = victim;
|
||||
this.attacker = attacker;
|
||||
this.ability = ability;
|
||||
this.damage = damage;
|
||||
this.element = element;
|
||||
this.sub = sub;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,6 +74,22 @@ public class PlayerBendingDeathEvent extends Event {
|
|||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the element of the ability used
|
||||
*/
|
||||
public Element getElement() {
|
||||
return element;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the subelement of the ability used
|
||||
*/
|
||||
public SubElement getSubElement() {
|
||||
return sub;
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ public class Combustion extends CoreAbility {
|
|||
for (Entity entity : block.getWorld().getEntities()) {
|
||||
if (entity instanceof LivingEntity) {
|
||||
if (entity.getLocation().distance(block) < radius) { // They are close enough to the explosion.
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "Combustion");
|
||||
AirMethods.breakBreathbendingHold(entity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ public class FireBlast extends CoreAbility {
|
|||
}
|
||||
if (entity instanceof LivingEntity) {
|
||||
entity.setFireTicks((int) (fireticks * 20));
|
||||
GeneralMethods.damageEntity(player, entity, (int) FireMethods.getFirebendingDayAugment((double) damage, entity.getWorld()));
|
||||
GeneralMethods.damageEntity(player, entity, (int) FireMethods.getFirebendingDayAugment((double) damage, entity.getWorld()), "FireBlast");
|
||||
AirMethods.breakBreathbendingHold(entity);
|
||||
new Enflamed(entity, player);
|
||||
remove();
|
||||
|
|
|
@ -221,7 +221,7 @@ public class FireCombo implements ConfigLoadable {
|
|||
entity.getLocation().getWorld().playSound(entity.getLocation(), Sound.VILLAGER_HIT, 0.3f, 0.3f);
|
||||
|
||||
if (ability.equalsIgnoreCase("FireKick")) {
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "FireKick");
|
||||
fstream.remove();
|
||||
} else if (ability.equalsIgnoreCase("FireSpin")) {
|
||||
if (entity instanceof Player) {
|
||||
|
@ -229,19 +229,19 @@ public class FireCombo implements ConfigLoadable {
|
|||
return;
|
||||
}
|
||||
double knockback = AvatarState.isAvatarState(player) ? FIRE_SPIN_KNOCKBACK + 0.5 : FIRE_SPIN_KNOCKBACK;
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "FireSpin");
|
||||
entity.setVelocity(direction.normalize().multiply(knockback));
|
||||
fstream.remove();
|
||||
} else if (ability.equalsIgnoreCase("JetBlaze")) {
|
||||
if (!affectedEntities.contains(entity)) {
|
||||
affectedEntities.add(entity);
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "JetBlaze");
|
||||
entity.setFireTicks((int) (fireticksJetBlaze * 20));
|
||||
}
|
||||
} else if (ability.equalsIgnoreCase("FireWheel")) {
|
||||
if (!affectedEntities.contains(entity)) {
|
||||
affectedEntities.add(entity);
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "FireWheel");
|
||||
entity.setFireTicks((int) (fireticksFireWheel * 20));
|
||||
this.remove();
|
||||
}
|
||||
|
|
|
@ -133,13 +133,13 @@ public class Fireball extends AddonAbility {
|
|||
if (distance > damageradius)
|
||||
return;
|
||||
if (distance < innerradius) {
|
||||
GeneralMethods.damageEntity(player, entity, maxdamage);
|
||||
GeneralMethods.damageEntity(player, entity, maxdamage, "FireBlast");
|
||||
return;
|
||||
}
|
||||
double slope = -(maxdamage * .5) / (damageradius - innerradius);
|
||||
double damage = slope * (distance - innerradius) + maxdamage;
|
||||
// Methods.verbose(damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "FireBlast");
|
||||
AirMethods.breakBreathbendingHold(entity);
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ public class Fireball extends AddonAbility {
|
|||
{
|
||||
double slope = -(maxdamage * .5) / (damageradius - innerradius);
|
||||
double damage = slope * (e.getLocation().distance(location) - innerradius) + maxdamage;
|
||||
GeneralMethods.damageEntity(getPlayer(), e, damage);
|
||||
GeneralMethods.damageEntity(getPlayer(), e, damage, "FireBlast");
|
||||
}
|
||||
}
|
||||
location.getWorld().playSound(location, Sound.EXPLODE, 5, 1);
|
||||
|
|
|
@ -163,7 +163,7 @@ public class Lightning extends CoreAbility {
|
|||
public void electrocute(LivingEntity lent) {
|
||||
lent.getWorld().playSound(lent.getLocation(), Sound.CREEPER_HISS, 1, 0);
|
||||
player.getWorld().playSound(player.getLocation(), Sound.CREEPER_HISS, 1, 0);
|
||||
GeneralMethods.damageEntity(player, lent, damage);
|
||||
GeneralMethods.damageEntity(player, lent, damage, "Lightning");
|
||||
if (Math.random() < stunChance) {
|
||||
final Location lentLoc = lent.getLocation();
|
||||
final LivingEntity flent = lent;
|
||||
|
|
|
@ -99,7 +99,7 @@ public class WallOfFire extends CoreAbility {
|
|||
entity.setFireTicks((int) (FIRETICKS * 20));
|
||||
GeneralMethods.setVelocity(entity, new Vector(0, 0, 0));
|
||||
if (entity instanceof LivingEntity) {
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "WallOfFire");
|
||||
new Enflamed(entity, player);
|
||||
AirMethods.breakBreathbendingHold(entity);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public class Bloodbending {
|
|||
if (GeneralMethods.isRegionProtectedFromBuild(player, "Bloodbending", entity.getLocation()) || (AvatarState.isAvatarState((Player) entity) || entity.getEntityId() == player.getEntityId() || GeneralMethods.canBend(((Player) entity).getName(), "Bloodbending")))
|
||||
continue;
|
||||
}
|
||||
GeneralMethods.damageEntity(player, entity, 0);
|
||||
GeneralMethods.damageEntity(player, entity, 0, "Bloodbending");
|
||||
AirMethods.breakBreathbendingHold(entity);
|
||||
targetentities.put(entity, entity.getLocation().clone());
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ public class Bloodbending {
|
|||
if (!canBeUsedOnUndead && isUndead(target)) {
|
||||
return;
|
||||
}
|
||||
GeneralMethods.damageEntity(player, target, 0);
|
||||
GeneralMethods.damageEntity(player, target, 0, "Bloodbending");
|
||||
HorizontalVelocityTracker.remove(target);
|
||||
AirMethods.breakBreathbendingHold(target);
|
||||
targetentities.put(target, target.getLocation().clone());
|
||||
|
@ -177,7 +177,7 @@ public class Bloodbending {
|
|||
}
|
||||
entities.add(entity);
|
||||
if (!targetentities.containsKey(entity) && entity instanceof LivingEntity) {
|
||||
GeneralMethods.damageEntity(player, entity, 0);
|
||||
GeneralMethods.damageEntity(player, entity, 0, "Bloodbending");
|
||||
targetentities.put(entity, entity.getLocation().clone());
|
||||
}
|
||||
if (entity instanceof LivingEntity) {
|
||||
|
|
|
@ -182,12 +182,14 @@ public class IceBlast {
|
|||
PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, 70, 2);
|
||||
new TempPotionEffect(entity, effect);
|
||||
bPlayer.slow(10);
|
||||
entity.damage(damage, player);
|
||||
//entity.damage(damage, player);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "IceBlast");
|
||||
}
|
||||
} else {
|
||||
PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, 70, 2);
|
||||
new TempPotionEffect(entity, effect);
|
||||
entity.damage(damage, player);
|
||||
//entity.damage(damage, player);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "IceBlast");
|
||||
}
|
||||
AirMethods.breakBreathbendingHold(entity);
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ public class OctopusForm {
|
|||
double knock = AvatarState.isAvatarState(player) ? AvatarState.getValue(knockback) : knockback;
|
||||
entity.setVelocity(GeneralMethods.getDirection(player.getLocation(), location).normalize().multiply(knock));
|
||||
if (entity instanceof LivingEntity)
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, "OctoposForm");
|
||||
AirMethods.breakBreathbendingHold(entity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -519,7 +519,7 @@ public class Torrent {
|
|||
if (WaterMethods.isNight(world)) {
|
||||
damagedealt = (int) (WaterMethods.getWaterbendingNightAugment(world) * (double) deflectdamage);
|
||||
}
|
||||
GeneralMethods.damageEntity(player, entity, damagedealt);
|
||||
GeneralMethods.damageEntity(player, entity, damagedealt, "Torrent");
|
||||
AirMethods.breakBreathbendingHold(entity);
|
||||
}
|
||||
}
|
||||
|
@ -539,7 +539,7 @@ public class Torrent {
|
|||
damagedealt = (int) (WaterMethods.getWaterbendingNightAugment(world) * (double) damage);
|
||||
}
|
||||
// if (((LivingEntity) entity).getNoDamageTicks() == 0) {
|
||||
GeneralMethods.damageEntity(player, entity, damagedealt);
|
||||
GeneralMethods.damageEntity(player, entity, damagedealt, "Torrent");
|
||||
AirMethods.breakBreathbendingHold(entity);
|
||||
// Methods.verbose("Hit! Health at "
|
||||
// + ((LivingEntity) entity).getHealth());
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.projectkorra.projectkorra.waterbending;
|
||||
|
||||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.ability.multiability.MultiAbilityManager;
|
||||
|
@ -349,9 +350,9 @@ public class WaterArms {
|
|||
for (Location l1 : getOffsetLocations(4, arm.getLocation(), 1.25))
|
||||
FireMethods.playLightningbendingParticle(l1);
|
||||
if (lightningKill)
|
||||
GeneralMethods.damageEntity(l.getPlayer(), player, 60D);
|
||||
GeneralMethods.damageEntity(l.getPlayer(), player, 60D, Element.Water, "Electrocution");
|
||||
else
|
||||
GeneralMethods.damageEntity(l.getPlayer(), player, lightningDamage);
|
||||
GeneralMethods.damageEntity(l.getPlayer(), player, lightningDamage, Element.Water, "Electrocution");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.projectkorra.projectkorra.waterbending;
|
|||
import com.projectkorra.projectkorra.BendingPlayer;
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.SubElement;
|
||||
import com.projectkorra.projectkorra.earthbending.EarthMethods;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
@ -136,7 +137,7 @@ public class WaterArmsFreeze {
|
|||
|
||||
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, 2.5)) {
|
||||
if (entity instanceof LivingEntity && entity.getEntityId() != player.getEntityId() && !(entity instanceof ArmorStand)) {
|
||||
GeneralMethods.damageEntity(player, entity, iceDamage);
|
||||
GeneralMethods.damageEntity(player, entity, iceDamage, SubElement.Icebending, "WaterArms Freeze");
|
||||
PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, 40, 2);
|
||||
new TempPotionEffect((LivingEntity) entity, effect);
|
||||
remove();
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.projectkorra.projectkorra.waterbending;
|
|||
|
||||
import com.projectkorra.projectkorra.BendingManager;
|
||||
import com.projectkorra.projectkorra.BendingPlayer;
|
||||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.earthbending.EarthMethods;
|
||||
|
@ -180,7 +181,7 @@ public class WaterArmsSpear {
|
|||
location = entity.getLocation();
|
||||
|
||||
if (spearDamageEnabled) {
|
||||
GeneralMethods.damageEntity(player, entity, spearDamage);
|
||||
GeneralMethods.damageEntity(player, entity, spearDamage, Element.Water, "WaterArms Spear");
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.projectkorra.projectkorra.waterbending;
|
|||
|
||||
import com.projectkorra.projectkorra.BendingManager;
|
||||
import com.projectkorra.projectkorra.BendingPlayer;
|
||||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.ability.multiability.MultiAbilityManager;
|
||||
|
@ -299,7 +300,7 @@ public class WaterArmsWhip {
|
|||
if (entity instanceof LivingEntity) {
|
||||
if (entity.getEntityId() != player.getEntityId()) {
|
||||
hasDamaged = true;
|
||||
GeneralMethods.damageEntity(player, entity, punchDamage, WaterMethods.getWaterColor() + "WaterArms Punch");
|
||||
GeneralMethods.damageEntity(player, entity, punchDamage, Element.Water, "WaterArms Punch");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.BendingPlayer;
|
|||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.SubElement;
|
||||
import com.projectkorra.projectkorra.ability.AvatarState;
|
||||
import com.projectkorra.projectkorra.command.Commands;
|
||||
import com.projectkorra.projectkorra.earthbending.EarthMethods;
|
||||
|
@ -369,7 +370,7 @@ public class WaterCombo {
|
|||
}
|
||||
if (damage != 0)
|
||||
if (entity instanceof LivingEntity)
|
||||
GeneralMethods.damageEntity(player, entity, damage);
|
||||
GeneralMethods.damageEntity(player, entity, damage, SubElement.Icebending, "IceBullets");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.projectkorra.projectkorra.waterbending;
|
||||
|
||||
import com.projectkorra.projectkorra.BendingPlayer;
|
||||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.ability.AvatarState;
|
||||
|
@ -387,7 +388,7 @@ public class WaterManipulation {
|
|||
// .add(direction));
|
||||
if (AvatarState.isAvatarState(player))
|
||||
damage = AvatarState.getValue(damage);
|
||||
GeneralMethods.damageEntity(player, entity, (int) WaterMethods.waterbendingNightAugment(damage, player.getWorld()));
|
||||
GeneralMethods.damageEntity(player, entity, (int) WaterMethods.waterbendingNightAugment(damage, player.getWorld()), "WaterManipulation");
|
||||
AirMethods.breakBreathbendingHold(entity);
|
||||
progressing = false;
|
||||
// }
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.projectkorra.projectkorra.waterbending;
|
||||
|
||||
import com.projectkorra.projectkorra.BendingPlayer;
|
||||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.ability.AvatarState;
|
||||
|
@ -241,7 +242,7 @@ public class WaterWave {
|
|||
if (entity != this.player && entity instanceof LivingEntity && !affectedEntities.contains(entity)) {
|
||||
affectedEntities.add(entity);
|
||||
final double aug = WaterMethods.getWaterbendingNightAugment(player.getWorld());
|
||||
GeneralMethods.damageEntity(player, entity, aug * damage);
|
||||
GeneralMethods.damageEntity(player, entity, aug * damage, Element.Water, "WaterWave");
|
||||
final Player fplayer = this.player;
|
||||
final Entity fent = entity;
|
||||
new BukkitRunnable() {
|
||||
|
|
Loading…
Reference in a new issue