From 727e137cc4cd888ccf993645bf4182dbfb8e38af Mon Sep 17 00:00:00 2001 From: Chiss Date: Fri, 17 Oct 2014 12:12:22 +1100 Subject: [PATCH] Final HH Update --- .../game/games/halloween/Halloween.java | 58 +++++++- .../halloween/creatures/PumpkinKing.java | 137 ++++++++++-------- .../game/arcade/kit/perks/PerkFlameSlam.java | 4 +- 3 files changed, 137 insertions(+), 62 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java index f72f02b09..5a67a956f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java @@ -64,6 +64,24 @@ public class Halloween extends SoloGame public long damage = 0; public long target = 0; + public long updateBossA = 0; + public long updateBossB = 0; + public long updateBossC = 0; + public long updateBossD = 0; + public long updateBossE = 0; + public long updateBossF = 0; + public long updateBossG = 0; + public long updateBossH = 0; + public long updateBossI = 0; + public long updateBossJ = 0; + public long updateBossK = 0; + public long updateBossL = 0; + public long updateBossM = 0; + public long updateBossN = 0; + public long updateBossO = 0; + + public boolean bossDebug = false; + public Halloween(ArcadeManager manager) { super(manager, GameType.Halloween, @@ -116,7 +134,7 @@ public class Halloween extends SoloGame _waves.add(new WaveVictory(this)); //Make zombies break doors - WorldData.World.setDifficulty(Difficulty.HARD); + WorldData.World.setDifficulty(Difficulty.HARD); } @EventHandler(priority = EventPriority.MONITOR) @@ -171,6 +189,26 @@ public class Halloween extends SoloGame System.out.println("Update Time: " + UtilTime.convertString(update, 4, TimeUnit.MILLISECONDS)); System.out.println("Damage Time: " + UtilTime.convertString(damage, 4, TimeUnit.MILLISECONDS)); System.out.println("Target Time: " + UtilTime.convertString(target, 4, TimeUnit.MILLISECONDS)); + + if (bossDebug) + { + System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); + System.out.println("Update Boss State: " + UtilTime.convertString(updateBossA, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss Blocks: " + UtilTime.convertString(updateBossB, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss Health: " + UtilTime.convertString(updateBossC, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss Minion Orbit: " + UtilTime.convertString(updateBossD, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss Minion Move: " + UtilTime.convertString(updateBossE, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss Minion Attack: " + UtilTime.convertString(updateBossF, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss Minion Arrow: " + UtilTime.convertString(updateBossG, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss Minion Spawn: " + UtilTime.convertString(updateBossH, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss King Control: " + UtilTime.convertString(updateBossI, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss King Leap: " + UtilTime.convertString(updateBossJ, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss King Bomb: " + UtilTime.convertString(updateBossK, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss King Target: " + UtilTime.convertString(updateBossL, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss King Trail: " + UtilTime.convertString(updateBossM, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss Shield Orbit: " + UtilTime.convertString(updateBossN, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Boss Shield Spawn: " + UtilTime.convertString(updateBossO, 4, TimeUnit.MILLISECONDS)); + } System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); total = 0; @@ -181,6 +219,22 @@ public class Halloween extends SoloGame update = 0; damage = 0; target = 0; + + updateBossA = 0; + updateBossB = 0; + updateBossC = 0; + updateBossD = 0; + updateBossE = 0; + updateBossF = 0; + updateBossG = 0; + updateBossH = 0; + updateBossI = 0; + updateBossJ = 0; + updateBossK = 0; + updateBossL = 0; + updateBossM = 0; + updateBossN = 0; + updateBossO = 0; } @EventHandler @@ -499,7 +553,7 @@ public class Halloween extends SoloGame { PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(audio.getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ(), - 3f, 1F); + 20f, 1F); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java index df8133dbd..f28f74b62 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java @@ -72,12 +72,14 @@ public class PumpkinKing extends CreatureBase private HashSet _arrows = new HashSet(); private boolean _announcedHalfHealth = false; - + public PumpkinKing(Halloween game, Location loc) { super(game, null, Skeleton.class, loc); _kingLocation = loc; + + game.bossDebug = true; } @Override @@ -168,54 +170,74 @@ public class PumpkinKing extends CreatureBase @Override public void Update(UpdateEvent event) { + long start = System.currentTimeMillis(); + //Main if (event.getType() == UpdateType.FASTER) StateUpdate(); - + Host.updateBossA += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.FAST) KingDestroyBlocks(); - + Host.updateBossB += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.TICK) KingUpdateHealth(); + Host.updateBossC += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); //Minions if (event.getType() == UpdateType.TICK) MinionOrbit(); - + Host.updateBossD += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.FASTER) - MinionAttack(); - + MinionMove(); + Host.updateBossE += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.TICK) MinionAttackDamage(); - + Host.updateBossF += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.FASTEST) MinionArrow(); - + Host.updateBossG += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.FAST) MinionSpawn(); + Host.updateBossH += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); //Final if (event.getType() == UpdateType.FAST) KingControl(); - + Host.updateBossI += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.SEC) KingLeap(); - + Host.updateBossJ += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.SEC) KingBomb(); - + Host.updateBossK += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.SEC) KingTarget(); - + Host.updateBossL += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.TICK) KingTrail(); - + Host.updateBossM += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); //Shield if (event.getType() == UpdateType.TICK) ShieldOrbit(false); - + Host.updateBossN += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); if (event.getType() == UpdateType.FAST) ShieldSpawn(); + Host.updateBossO += System.currentTimeMillis() - start; + start = System.currentTimeMillis(); } @@ -296,26 +318,31 @@ public class PumpkinKing extends CreatureBase private void KingUpdateHealth() { + String text = ""; + double percent = 0; + + if (_shields.size() > 0) + { + percent = (double)_shields.size() / (double)_shieldsMax; + text = C.cGreen + C.Bold + "Kill the Flame Shield"; + } + else + { + if (_minions.size() > 0) + { + percent = (double)_minions.size() / (double)_minionsMax; + text = C.cYellow + C.Bold + "Kill the Pumpkin Soldiers"; + } + else + { + percent = GetEntity().getHealth()/GetEntity().getMaxHealth(); + text = C.cGold + C.Bold + "Kill the Pumpkin King"; + } + } + for (Player player : UtilServer.getPlayers()) { - if (_shields.size() > 0) - { - double percent = (double)_shields.size() / (double)_shieldsMax; - UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, C.cGreen + C.Bold + "Kill the Flame Shield"); - } - else - { - if (_minions.size() > 0) - { - double percent = (double)_minions.size() / (double)_minionsMax; - UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, C.cYellow + C.Bold + "Kill the Pumpkin Soldiers"); - } - else - { - double percent = GetEntity().getHealth()/GetEntity().getMaxHealth(); - UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, C.cGold + C.Bold + "Kill the Pumpkin King"); - } - } + UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, text); } } @@ -344,7 +371,7 @@ public class PumpkinKing extends CreatureBase Host.CreatureAllowOverride = true; Skeleton skel = GetEntity().getWorld().spawn(GetEntity().getLocation(), Skeleton.class); Host.CreatureAllowOverride = false; - + Host.Manager.GetCondition().Factory().Invisible("Cloak", skel, skel, 999999, 0, false, false, false); skel.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); @@ -357,7 +384,7 @@ public class PumpkinKing extends CreatureBase UtilEnt.Vegetate(skel); } - + _minionSpawn = false; } @@ -371,7 +398,7 @@ public class PumpkinKing extends CreatureBase Skeleton minion = _minions.get(i); UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, minion.getEyeLocation(), 0.1f, 0.1f, 0.1f, 0, 1); - + minion.setTarget(null); double lead = i * ((2d * Math.PI)/_minions.size()); @@ -395,19 +422,20 @@ public class PumpkinKing extends CreatureBase loc.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(GetEntity(), minion))); //Move - EntityCreature ec = ((CraftCreature)minion).getHandle(); - ec.getControllerMove().a(loc.getX(), loc.getY(), loc.getZ(), 1.4); + UtilEnt.CreatureMoveFast(minion, loc, 1.4f); + // EntityCreature ec = ((CraftCreature)minion).getHandle(); + // ec.getControllerMove().a(loc.getX(), loc.getY(), loc.getZ(), 1.4); } } - public void MinionAttack() + public void MinionMove() { if (GetState() != 3) return; - + if (_minions.isEmpty()) return; - + Skeleton minion = _minions.remove(0); LivingEntity target = _minionTargets.get(minion); @@ -416,14 +444,7 @@ public class PumpkinKing extends CreatureBase minion.setTarget(target); - Location loc = target.getLocation().add(UtilAlg.getTrajectory(target, minion).multiply(1)); - if (UtilMath.offset(loc, minion.getLocation()) > 12) - loc = minion.getLocation().add(UtilAlg.getTrajectory(minion.getLocation(), loc).multiply(12)); - - //Move - EntityCreature ec = ((CraftCreature)minion).getHandle(); - Navigation nav = ec.getNavigation(); - nav.a(loc.getX(), loc.getY(), loc.getZ(), 1f); + UtilEnt.CreatureMove(minion, target.getLocation(), 1f); _minions.add(minion); } @@ -436,7 +457,7 @@ public class PumpkinKing extends CreatureBase for (int i=0 ; i<_minions.size() ; i++) { final Skeleton minion = _minions.get(i); - + UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, minion.getEyeLocation(), 0.1f, 0.1f, 0.1f, 0, 1); LivingEntity target = _minionTargets.get(minion); @@ -451,13 +472,13 @@ public class PumpkinKing extends CreatureBase //Damage Event Host.Manager.GetDamage().NewDamageEvent(target, minion, null, - DamageCause.ENTITY_ATTACK, 3, true, true, false, + DamageCause.ENTITY_ATTACK, 4, true, false, false, UtilEnt.getName(minion), GetName()); //Sound minion.getWorld().playSound(minion.getLocation(), Sound.ENDERMAN_SCREAM, 2f, 2f); minion.getWorld().playSound(minion.getLocation(), Sound.ENDERMAN_SCREAM, 2f, 2f); - + //Visual Start minion.getEquipment().setHelmet(new ItemStack(Material.JACK_O_LANTERN)); @@ -571,7 +592,7 @@ public class PumpkinKing extends CreatureBase { if (GetState() == 3 || GetState() == 4) return; - + Iterator shieldIterator = _shields.iterator(); while (shieldIterator.hasNext()) { @@ -667,7 +688,7 @@ public class PumpkinKing extends CreatureBase _state = state; _stateTime = System.currentTimeMillis(); - + if (state == 3) { //Update Gear @@ -690,11 +711,11 @@ public class PumpkinKing extends CreatureBase //Announce Host.Announce(C.cAqua + C.Bold + "Kill the Pumpkin Minions!"); - MinionAttack(); - + MinionMove(); + Host.playSound(HalloweenAudio.BOSS_STAGE_MINION_ATTACK); } - + if (state == 4) { Host.playSound(HalloweenAudio.BOSS_STAGE_FINAL); @@ -748,7 +769,7 @@ public class PumpkinKing extends CreatureBase } ShieldSpawn(); - + Host.playSound(HalloweenAudio.BOSS_STAGE_SHIELD_RESTORE); _minionTargets.clear(); @@ -763,7 +784,7 @@ public class PumpkinKing extends CreatureBase Host.playSound(HalloweenAudio.BOSS_STAGE_FINAL_HALF_DEAD); _announcedHalfHealth = true; } - + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java index 1b338b855..3d08eff13 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java @@ -37,9 +37,9 @@ public class PerkFlameSlam extends Perk public PerkFlameSlam() { - super("Flame Slam", new String[] + super("Flame Charge", new String[] { - C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Flame Slam" + C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Flame Charge" }); }