diff --git a/src/sig/plugin/TwosideKeeper/Boss/EliteZombie.java b/src/sig/plugin/TwosideKeeper/Boss/EliteZombie.java index caef687..d8baaa2 100644 --- a/src/sig/plugin/TwosideKeeper/Boss/EliteZombie.java +++ b/src/sig/plugin/TwosideKeeper/Boss/EliteZombie.java @@ -303,23 +303,27 @@ public class EliteZombie extends EliteMonster{ } else { m.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(DEFAULT_MOVE_SPD); } + + if (l.getLocation().getY()>m.getLocation().getY()+1) { + //Jump up to compensate. Move towards the player too. + m.setVelocity((m.getLocation().getDirection()).add(new Vector(0,0.2*(l.getLocation().getY()-m.getLocation().getY()),0))); + } + if (lastLoc!=null && lastLoc.distance(m.getLocation())<=0.4) { + stuckTimer++; + //TwosideKeeper.log("Stuck. "+stuckTimer, 0); + } else { + stuckTimer=0; + } + lastLoc = m.getLocation().clone(); + if (stuckTimer>5) { + //Teleport randomly. + m.teleport(getNearbyFreeLocation(m.getLocation())); + stuckTimer=0; + } } - - if (l.getLocation().getY()>m.getLocation().getY()+1) { - //Jump up to compensate. Move towards the player too. - m.setVelocity((m.getLocation().getDirection()).add(new Vector(0,0.2*(l.getLocation().getY()-m.getLocation().getY()),0))); - } - if (lastLoc!=null && lastLoc.distance(m.getLocation())<=0.4) { - stuckTimer++; - //TwosideKeeper.log("Stuck. "+stuckTimer, 0); - } else { - stuckTimer=0; - } - lastLoc = m.getLocation().clone(); - if (stuckTimer>5) { - //Teleport randomly. - m.teleport(getNearbyFreeLocation(m.getLocation())); - stuckTimer=0; + if (l instanceof Player) { + Player pl = (Player)l; + pl.setFlying(false); } } else { targetlist.remove(l); @@ -591,7 +595,7 @@ public class EliteZombie extends EliteMonster{ SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1.0f, 1.0f); GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.CONFUSION,20*4,0,p); TwosideKeeper.log("Got hit for "+storingenergy_hit+" damage!", 2); - GenericFunctions.removeNoDamageTick(p, m); + //GenericFunctions.removeNoDamageTick(p, m); if (CustomDamage.ApplyDamage(storingenergy_hit, m, p, null, "Stored Energy", CustomDamage.IGNOREDODGE|CustomDamage.IGNORE_DAMAGE_TICK)) { //TwosideKeeperAPI.DealDamageToEntity(.CalculateDamageReduction(storingenergy_hit,p,m),p,m); storingenergy_hit=0; diff --git a/src/sig/plugin/TwosideKeeper/CustomDamage.java b/src/sig/plugin/TwosideKeeper/CustomDamage.java index c61c6b4..7e79b5d 100644 --- a/src/sig/plugin/TwosideKeeper/CustomDamage.java +++ b/src/sig/plugin/TwosideKeeper/CustomDamage.java @@ -48,6 +48,7 @@ import org.bukkit.potion.PotionType; import org.bukkit.util.Vector; import aPlugin.API; +import sig.plugin.TwosideKeeper.Boss.EliteZombie; import sig.plugin.TwosideKeeper.Events.EntityDamagedEvent; import sig.plugin.TwosideKeeper.Events.PlayerDodgeEvent; import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility; @@ -1164,10 +1165,14 @@ public class CustomDamage { private static int GetHeartAmount(double dmg) { int heartcount = 1; double dmgamountcopy = dmg; + TwosideKeeper.log("Starting Damage: "+dmgamountcopy, 0); while (dmgamountcopy>10) { dmgamountcopy/=2; heartcount++; + TwosideKeeper.log("Hearts: "+heartcount, 0); + TwosideKeeper.log("Remaining Damage: "+dmgamountcopy, 0); } + TwosideKeeper.log(ChatColor.RED+"Final Heart Count: "+heartcount, 0); return heartcount; } @@ -1520,6 +1525,9 @@ public class CustomDamage { if (damager instanceof Player && target instanceof Player && !damager.getWorld().getPVP()) { return true; //Cancel all PvP related events. } + if (isFlagSet(flags,IGNORE_DAMAGE_TICK)) { + GenericFunctions.removeNoDamageTick(target, damager); + } if (isFlagSet(flags,IGNORE_DAMAGE_TICK) || (GenericFunctions.enoughTicksHavePassed(target, damager) && canHitMobDueToWeakness(damager) && !GenericFunctions.isSuppressed(getDamagerEntity(damager)) && !target.isDead())) { TwosideKeeper.log("Enough ticks have passed.", 5); @@ -1538,6 +1546,23 @@ public class CustomDamage { return true; } + if (damager instanceof Monster) { + Monster m = (Monster)damager; + LivingEntityStructure les = LivingEntityStructure.getLivingEntityStructure(m); + if (les.isElite) { + for (EliteMonster em : TwosideKeeper.elitemonsters) { + if (em.m.equals(m)) { + if (em instanceof EliteZombie) { + EliteZombie ez = (EliteZombie)em; + if (ez.storingenergy) { + return true; //Cancel it, we're storing energy right now. + } + } + } + } + } + } + if (isFlagSet(flags,IGNOREDODGE) || !PassesIframeCheck(target,damager)) { TwosideKeeper.log("Not in an iframe.", 5); diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java b/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java index a837231..97a4cc3 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java @@ -464,7 +464,7 @@ public enum ItemSet { lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Damage Reduction"); lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Swift Aegis "+WorldShop.toRomanNumeral(ItemSet.GetBaseAmount(set, tier, 4))); lore.add(ChatColor.GRAY+" Builds "+ItemSet.GetBaseAmount(set, tier, 4)+" stack"+((ItemSet.GetBaseAmount(set, tier, 4))!=1?"s":"")+" of Resist"); - lore.add(ChatColor.GRAY+" (20% Damage Reduction) every 5 seconds of sprinting,"); + lore.add(ChatColor.GRAY+" ("+(ItemSet.GetBaseAmount(set, tier, 4)*10)+"% Damage Reduction) every 5 seconds of sprinting,"); lore.add(ChatColor.GRAY+" and with every Tumble. Each hit taken removes one"); lore.add(ChatColor.GRAY+" stack of Resist. Caps at Resist 10. Lasts 20 seconds."); lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Boosts All Modes of Ranger"); diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index a86e211..8f19d11 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -462,6 +462,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { public static HashMap banksessions; public static Habitation habitat_data; public static boolean last_announced_storm = false; //Whether or not the last announcement was about a storm. + public static long lastTimingReport=0; public static List weather_watch_users = new ArrayList(); @@ -5709,6 +5710,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { CustomDamage.ApplyDamage(pd.vendetta_amt, ev.getDamager(), (LivingEntity)ev.getEntity(), null, "Vendetta"); pd.vendetta_amt=0.0; GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+" dmg stored",true); + ev.setCancelled(true); } else { CustomDamage.ApplyDamage(0, ev.getDamager(), (LivingEntity)ev.getEntity(), weapon, null); if (ev.getDamager() instanceof Projectile) { diff --git a/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java b/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java index 001aef0..85d8c2c 100644 --- a/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java +++ b/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java @@ -36,6 +36,7 @@ import org.inventivetalent.glow.GlowAPI.Color; import aPlugin.DiscordMessageSender; import net.minecraft.server.v1_9_R1.EnumParticle; +import net.minecraft.server.v1_9_R1.MinecraftServer; import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility; import sig.plugin.TwosideKeeper.HelperStructures.BankSession; import sig.plugin.TwosideKeeper.HelperStructures.ItemSet; @@ -297,6 +298,8 @@ final class runServerHeartbeat implements Runnable { if (pd.vendetta_amt>0 && pd.lastvendettastack+20072000) { + aPlugin.API.takeTimings(1200); + } else { + aPlugin.API.takeTimings(3600); + } + TwosideKeeper.lastTimingReport=TwosideKeeper.getServerTickTime(); + } + } + private void CheckAndAnnounceWeather() { if (Bukkit.getWorld("world").hasStorm()) { if (!TwosideKeeper.last_announced_storm) {