From 1d4f902298ce921487f1090d49cff7e7812f51eb Mon Sep 17 00:00:00 2001 From: Chiss Date: Mon, 28 Oct 2013 13:54:10 +1100 Subject: [PATCH] HH CPU fixes --- .../game/games/halloween/Halloween.java | 119 ++++--- .../halloween/creatures/CreatureBase.java | 23 ++ .../halloween/creatures/InterfaceMove.java | 6 + .../games/halloween/creatures/MobCreeper.java | 39 +-- .../games/halloween/creatures/MobGhast.java | 5 - .../halloween/creatures/MobPigZombie.java | 30 +- .../creatures/MobSkeletonArcher.java | 39 +-- .../creatures/MobSkeletonWarrior.java | 40 +-- .../halloween/creatures/MobSpiderLeaper.java | 28 +- ...piderWebber.java => MobSpiderSmasher.java} | 31 +- .../games/halloween/creatures/MobWitch.java | 106 ------ .../games/halloween/creatures/MobZombie.java | 27 +- .../halloween/creatures/PumpkinKing.java | 303 +++++++++++------- .../game/games/halloween/waves/Wave3.java | 4 +- .../games/halloween/waves/WaveVictory.java | 10 +- 15 files changed, 345 insertions(+), 465 deletions(-) create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/InterfaceMove.java rename Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/{MobSpiderWebber.java => MobSpiderSmasher.java} (69%) delete mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobWitch.java 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 a2edde131..06b738ab8 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 @@ -23,6 +23,7 @@ import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; +import mineplex.core.common.util.UtilTime.TimeUnit; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -40,14 +41,13 @@ public class Halloween extends SoloGame { //Wave Data private ArrayList> _spawns; - + private ArrayList _waves; private int _wave = 0; - + private int _maxMobs = 80; - private HashSet _mobs = new HashSet(); - private PumpkinKing _king; - + private ArrayList _mobs = new ArrayList(); + public Halloween(ArcadeManager manager) { super(manager, GameType.Halloween, @@ -68,14 +68,14 @@ public class Halloween extends SoloGame }); this.DamagePvP = false; - + this.WorldTimeSet = 16000; this.ItemDrop = false; this.ItemPickup = false; - + this.PrepareFreeze = false; - + this.HungerSet = 20; } @@ -87,13 +87,13 @@ public class Halloween extends SoloGame _spawns.add(WorldData.GetDataLocs("YELLOW")); _spawns.add(WorldData.GetDataLocs("GREEN")); _spawns.add(WorldData.GetDataLocs("BLUE")); - + _waves = new ArrayList(); - _waves.add(new Wave1(this)); - _waves.add(new Wave2(this)); - _waves.add(new Wave3(this)); - _waves.add(new Wave4(this)); - _waves.add(new Wave5(this)); + //_waves.add(new Wave1(this)); + //_waves.add(new Wave2(this)); + //_waves.add(new Wave3(this)); + //_waves.add(new Wave4(this)); + //_waves.add(new Wave5(this)); _waves.add(new WaveBoss(this)); _waves.add(new WaveVictory(this)); } @@ -106,19 +106,19 @@ public class Halloween extends SoloGame GetTeamList().add(new GameTeam("Pumpkin King", ChatColor.RED, WorldData.GetDataLocs("RED"))); } - + @EventHandler public void SoundUpdate(UpdateEvent event) { if (event.getType() != UpdateType.SLOW) return; - + if (!IsLive()) return; - + if (Math.random() > 0.85) return; - + for (Player player : UtilServer.getPlayers()) player.playSound(player.getLocation(), Sound.AMBIENCE_CAVE, 3f, 1f); } @@ -135,32 +135,53 @@ public class Halloween extends SoloGame if (_waves.get(_wave).Update(_wave+1)) { _wave++; - + EndCheck(); } } - + public ArrayList GetSpawnSet(int i) { return _spawns.get(i); } - + public Location GetRandomSpawn() { ArrayList locSet = GetSpawnSet(UtilMath.r(_spawns.size())); return locSet.get(UtilMath.r(locSet.size())); } - + public void AddCreature(CreatureBase mob) { _mobs.add(mob); } - - public HashSet GetCreatures() + + public ArrayList GetCreatures() { return _mobs; } + @EventHandler + public void CreatureMoveUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + if (_mobs.isEmpty()) + return; + + CreatureBase base = _mobs.remove(0); + + if (base instanceof InterfaceMove) + { + InterfaceMove move = (InterfaceMove)base; + + move.Move(); + } + + _mobs.add(base); + } + @EventHandler public void CreatureUpdate(UpdateEvent event) { @@ -177,21 +198,21 @@ public class Halloween extends SoloGame mobIterator.remove(); } } - + @EventHandler public void CreatureDamage(CustomDamageEvent event) { for (CreatureBase base : _mobs) base.Damage(event); } - + @EventHandler public void CreatureTarget(EntityTargetEvent event) { for (CreatureBase base : _mobs) base.Target(event); } - + @EventHandler(priority = EventPriority.HIGHEST) public void EntityDeath(EntityDeathEvent event) { @@ -212,7 +233,7 @@ public class Halloween extends SoloGame Manager.GetGame().AddGems(player, 30, "Killing the Pumpkin King", false); Manager.GetGame().AddGems(player, 10, "Participation", false); } - + SetState(GameState.End); SetCustomWinLine("You earned Pumpkin Kings Head!"); AnnounceEnd(this.GetTeamList().get(0)); @@ -224,66 +245,66 @@ public class Halloween extends SoloGame { Manager.GetGame().AddGems(player, 10, "Participation", false); } - + SetState(GameState.End); SetCustomWinLine("You lost..."); AnnounceEnd(this.GetTeamList().get(1)); } } - + @EventHandler(priority = EventPriority.LOWEST) public void Explosion(EntityExplodeEvent event) { if (event.getEntity() instanceof Fireball) { event.blockList().clear(); - + Collection blocks = UtilBlock.getInRadius(event.getLocation(), 3.5d).keySet(); - + Iterator blockIterator = blocks.iterator(); while (blockIterator.hasNext()) { Block block = blockIterator.next(); - + if (block.getY() < 4) blockIterator.remove(); } - + Manager.GetExplosion().BlockExplosion(blocks, event.getLocation(), false); } } - + @EventHandler public void ItemSpawn(ItemSpawnEvent event) { Material type = event.getEntity().getItemStack().getType(); - + if (type == Material.DIAMOND_AXE || type == Material.FIRE || type == Material.SNOW_BALL) return; - + event.setCancelled(true); } - - + + @EventHandler(priority = EventPriority.MONITOR) public void GemAward(CustomDamageEvent event) { if (event.IsCancelled()) return; - + Player player = event.GetDamagerPlayer(true); if (player == null) return; - + for (int i=0 ; i public abstract void Damage(CustomDamageEvent event); public abstract void Target(EntityTargetEvent event); + + public void DefaultMove() + { + EntityCreature ec = ((CraftCreature)GetEntity()).getHandle(); + Navigation nav = ec.getNavigation(); + + if (UtilMath.offset(GetEntity().getLocation(), GetTarget()) > 16) + { + Location target = GetEntity().getLocation(); + + target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(16)); + + nav.a(target.getX(), target.getY(), target.getZ(), 1f); + } + else + { + nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1f); + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/InterfaceMove.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/InterfaceMove.java new file mode 100644 index 000000000..200db3c20 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/InterfaceMove.java @@ -0,0 +1,6 @@ +package nautilus.game.arcade.game.games.halloween.creatures; + +public interface InterfaceMove +{ + public void Move(); +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobCreeper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobCreeper.java index 563e044c5..3212a4996 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobCreeper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobCreeper.java @@ -1,21 +1,16 @@ package nautilus.game.arcade.game.games.halloween.creatures; -import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; -import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_6_R3.EntityCreature; -import net.minecraft.server.v1_6_R3.Navigation; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature; import org.bukkit.entity.Creeper; import org.bukkit.event.entity.EntityTargetEvent; -public class MobCreeper extends CreatureBase +public class MobCreeper extends CreatureBase implements InterfaceMove { public MobCreeper(Game game, Location loc) { @@ -26,6 +21,8 @@ public class MobCreeper extends CreatureBase public void SpawnCustom(Creeper ent) { ent.setCustomName("Creeper"); + + Move(); } @Override @@ -43,14 +40,16 @@ public class MobCreeper extends CreatureBase @Override public void Update(UpdateEvent event) { - if (event.getType() != UpdateType.SLOW) - return; - + + } + + public void Move() + { //New Target via Distance if (GetTarget() == null || - UtilMath.offset(GetEntity().getLocation(), GetTarget()) < 10 || - UtilMath.offset2d(GetEntity().getLocation(), GetTarget()) < 6 || - UtilTime.elapsed(GetTargetTime(), 10000)) + UtilMath.offset(GetEntity().getLocation(), GetTarget()) < 10 || + UtilMath.offset2d(GetEntity().getLocation(), GetTarget()) < 6 || + UtilTime.elapsed(GetTargetTime(), 10000)) { SetTarget(GetRoamTarget()); return; @@ -67,21 +66,7 @@ public class MobCreeper extends CreatureBase //Move else { - EntityCreature ec = ((CraftCreature)GetEntity()).getHandle(); - Navigation nav = ec.getNavigation(); - - if (UtilMath.offset(GetEntity().getLocation(), GetTarget()) > 12) - { - Location target = GetEntity().getLocation(); - - target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(12)); - - nav.a(target.getX(), target.getY(), target.getZ(), 1f); - } - else - { - nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1f); - } + DefaultMove(); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java index 74baf517f..0b4a940ca 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java @@ -13,8 +13,6 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause; public class MobGhast extends CreatureBase { - private Location _loc; - public MobGhast(Game game, Location loc) { super(game, null, Ghast.class, loc); @@ -23,9 +21,6 @@ public class MobGhast extends CreatureBase @Override public void SpawnCustom(Ghast ent) { - //UtilEnt.Vegetate(ent); - _loc = ent.getLocation(); - ent.setMaxHealth(80); ent.setHealth(80); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobPigZombie.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobPigZombie.java index 1e84d118e..ec7ac7b31 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobPigZombie.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobPigZombie.java @@ -1,22 +1,17 @@ package nautilus.game.arcade.game.games.halloween.creatures; -import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.disguises.DisguisePigZombie; -import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_6_R3.EntityCreature; -import net.minecraft.server.v1_6_R3.Navigation; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature; import org.bukkit.entity.Zombie; import org.bukkit.event.entity.EntityTargetEvent; -public class MobPigZombie extends CreatureBase +public class MobPigZombie extends CreatureBase implements InterfaceMove { public MobPigZombie(Game game, Location loc) { @@ -32,6 +27,8 @@ public class MobPigZombie extends CreatureBase Host.Manager.GetCondition().Factory().Speed("Speed", ent, ent, 99999, 1, false, false, false); ent.setCustomName("Nether Zombie"); + + Move(); } @Override @@ -49,11 +46,10 @@ public class MobPigZombie extends CreatureBase @Override public void Update(UpdateEvent event) { - if (event.getType() == UpdateType.SLOW) - Move(); + } - private void Move() + public void Move() { //New Target via Distance if (GetTarget() == null || @@ -76,21 +72,7 @@ public class MobPigZombie extends CreatureBase //Move else { - EntityCreature ec = ((CraftCreature)GetEntity()).getHandle(); - Navigation nav = ec.getNavigation(); - - if (UtilMath.offset(GetEntity().getLocation(), GetTarget()) > 12) - { - Location target = GetEntity().getLocation(); - - target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(12)); - - nav.a(target.getX(), target.getY(), target.getZ(), 1f); - } - else - { - nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1f); - } + DefaultMove(); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSkeletonArcher.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSkeletonArcher.java index 638f3581d..e7b419773 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSkeletonArcher.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSkeletonArcher.java @@ -1,23 +1,18 @@ package nautilus.game.arcade.game.games.halloween.creatures; -import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; -import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_6_R3.EntityCreature; -import net.minecraft.server.v1_6_R3.Navigation; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature; import org.bukkit.entity.Skeleton; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.inventory.ItemStack; -public class MobSkeletonArcher extends CreatureBase +public class MobSkeletonArcher extends CreatureBase implements InterfaceMove { public MobSkeletonArcher(Game game, Location loc) { @@ -31,6 +26,8 @@ public class MobSkeletonArcher extends CreatureBase ent.setCustomName("Skeleton Archer"); Host.Manager.GetCondition().Factory().Speed("Speed", ent, ent, 99999, 0, false, false, false); + + Move(); } @Override @@ -48,14 +45,16 @@ public class MobSkeletonArcher extends CreatureBase @Override public void Update(UpdateEvent event) { - if (event.getType() != UpdateType.SLOW) - return; - + + } + + public void Move() + { //New Target via Distance if (GetTarget() == null || - UtilMath.offset(GetEntity().getLocation(), GetTarget()) < 10 || - UtilMath.offset2d(GetEntity().getLocation(), GetTarget()) < 6 || - UtilTime.elapsed(GetTargetTime(), 10000)) + UtilMath.offset(GetEntity().getLocation(), GetTarget()) < 10 || + UtilMath.offset2d(GetEntity().getLocation(), GetTarget()) < 6 || + UtilTime.elapsed(GetTargetTime(), 10000)) { SetTarget(GetRoamTarget()); return; @@ -72,21 +71,7 @@ public class MobSkeletonArcher extends CreatureBase //Move else { - EntityCreature ec = ((CraftCreature)GetEntity()).getHandle(); - Navigation nav = ec.getNavigation(); - - if (UtilMath.offset(GetEntity().getLocation(), GetTarget()) > 12) - { - Location target = GetEntity().getLocation(); - - target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(12)); - - nav.a(target.getX(), target.getY(), target.getZ(), 1f); - } - else - { - nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1f); - } + DefaultMove(); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSkeletonWarrior.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSkeletonWarrior.java index 355c63873..b324e6cc7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSkeletonWarrior.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSkeletonWarrior.java @@ -1,25 +1,19 @@ package nautilus.game.arcade.game.games.halloween.creatures; -import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.disguises.DisguiseSkeleton; -import mineplex.core.disguise.disguises.DisguiseSpider; -import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_6_R3.EntityCreature; -import net.minecraft.server.v1_6_R3.Navigation; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature; import org.bukkit.entity.Zombie; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.inventory.ItemStack; -public class MobSkeletonWarrior extends CreatureBase +public class MobSkeletonWarrior extends CreatureBase implements InterfaceMove { public MobSkeletonWarrior(Game game, Location loc) { @@ -35,6 +29,8 @@ public class MobSkeletonWarrior extends CreatureBase ent.getEquipment().setItemInHand(new ItemStack(Material.WOOD_HOE)); Host.Manager.GetCondition().Factory().Speed("Speed", ent, ent, 99999, 0, false, false, false); + + Move(); } @Override @@ -52,14 +48,16 @@ public class MobSkeletonWarrior extends CreatureBase @Override public void Update(UpdateEvent event) { - if (event.getType() != UpdateType.SLOW) - return; - + + } + + public void Move() + { //New Target via Distance if (GetTarget() == null || - UtilMath.offset(GetEntity().getLocation(), GetTarget()) < 10 || - UtilMath.offset2d(GetEntity().getLocation(), GetTarget()) < 6 || - UtilTime.elapsed(GetTargetTime(), 10000)) + UtilMath.offset(GetEntity().getLocation(), GetTarget()) < 10 || + UtilMath.offset2d(GetEntity().getLocation(), GetTarget()) < 6 || + UtilTime.elapsed(GetTargetTime(), 10000)) { SetTarget(GetRoamTarget()); return; @@ -76,21 +74,7 @@ public class MobSkeletonWarrior extends CreatureBase //Move else { - EntityCreature ec = ((CraftCreature)GetEntity()).getHandle(); - Navigation nav = ec.getNavigation(); - - if (UtilMath.offset(GetEntity().getLocation(), GetTarget()) > 12) - { - Location target = GetEntity().getLocation(); - - target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(12)); - - nav.a(target.getX(), target.getY(), target.getZ(), 1f); - } - else - { - nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1f); - } + DefaultMove(); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderLeaper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderLeaper.java index 35f621dd3..03690fefb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderLeaper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderLeaper.java @@ -9,15 +9,12 @@ import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_6_R3.EntityCreature; -import net.minecraft.server.v1_6_R3.Navigation; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature; import org.bukkit.entity.CaveSpider; import org.bukkit.event.entity.EntityTargetEvent; -public class MobSpiderLeaper extends CreatureBase +public class MobSpiderLeaper extends CreatureBase implements InterfaceMove { public MobSpiderLeaper(Game game, Location loc) { @@ -30,6 +27,8 @@ public class MobSpiderLeaper extends CreatureBase ent.setCustomName("Leaping Spider"); Host.Manager.GetCondition().Factory().Speed("Speed", GetEntity(), GetEntity(), 99999, 1, false, false, false); + + Move(); } @Override @@ -47,9 +46,6 @@ public class MobSpiderLeaper extends CreatureBase @Override public void Update(UpdateEvent event) { - if (event.getType() == UpdateType.SLOW) - Move(); - if (event.getType() == UpdateType.SEC) Leap(); } @@ -71,7 +67,7 @@ public class MobSpiderLeaper extends CreatureBase UtilAction.velocity(GetEntity(), UtilAlg.getTrajectory2d(GetEntity().getLocation(), GetTarget()), 1, true, 0.6, 0, 10, true); } - private void Move() + public void Move() { //New Target via Distance if (GetTarget() == null || @@ -94,21 +90,7 @@ public class MobSpiderLeaper extends CreatureBase //Move else { - EntityCreature ec = ((CraftCreature)GetEntity()).getHandle(); - Navigation nav = ec.getNavigation(); - - if (UtilMath.offset(GetEntity().getLocation(), GetTarget()) > 12) - { - Location target = GetEntity().getLocation(); - - target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(12)); - - nav.a(target.getX(), target.getY(), target.getZ(), 1.6f); - } - else - { - nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1.2f); - } + DefaultMove(); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderWebber.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderSmasher.java similarity index 69% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderWebber.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderSmasher.java index 04620e526..2e9e99207 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderWebber.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderSmasher.java @@ -1,6 +1,5 @@ package nautilus.game.arcade.game.games.halloween.creatures; -import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.disguises.DisguiseSpider; @@ -8,17 +7,14 @@ import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_6_R3.EntityCreature; -import net.minecraft.server.v1_6_R3.Navigation; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature; import org.bukkit.entity.Zombie; import org.bukkit.event.entity.EntityTargetEvent; -public class MobSpiderWebber extends CreatureBase +public class MobSpiderSmasher extends CreatureBase implements InterfaceMove { - public MobSpiderWebber(Game game, Location loc) + public MobSpiderSmasher(Game game, Location loc) { super(game, null, Zombie.class, loc); } @@ -29,6 +25,8 @@ public class MobSpiderWebber extends CreatureBase DisguiseSpider spider = new DisguiseSpider(ent); Host.Manager.GetDisguise().disguise(spider); ent.setCustomName("Smashing Spider"); + + Move(); } @Override @@ -46,14 +44,11 @@ public class MobSpiderWebber extends CreatureBase @Override public void Update(UpdateEvent event) { - if (event.getType() == UpdateType.SLOW) - Move(); - if (event.getType() == UpdateType.SLOW) Speed(); } - private void Move() + public void Move() { //New Target via Distance if (GetTarget() == null || @@ -76,21 +71,7 @@ public class MobSpiderWebber extends CreatureBase //Move else { - EntityCreature ec = ((CraftCreature)GetEntity()).getHandle(); - Navigation nav = ec.getNavigation(); - - if (UtilMath.offset(GetEntity().getLocation(), GetTarget()) > 12) - { - Location target = GetEntity().getLocation(); - - target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(12)); - - nav.a(target.getX(), target.getY(), target.getZ(), 1.6f); - } - else - { - nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1.2f); - } + DefaultMove(); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobWitch.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobWitch.java deleted file mode 100644 index c1c1c8175..000000000 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobWitch.java +++ /dev/null @@ -1,106 +0,0 @@ -package nautilus.game.arcade.game.games.halloween.creatures; - -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilTime; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_6_R3.EntityCreature; -import net.minecraft.server.v1_6_R3.Navigation; - -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature; -import org.bukkit.entity.ThrownPotion; -import org.bukkit.entity.Witch; -import org.bukkit.event.entity.EntityTargetEvent; - -public class MobWitch extends CreatureBase -{ - public MobWitch(Game game, Location loc) - { - super(game, null, Witch.class, loc); - } - - @Override - public void SpawnCustom(Witch ent) - { - Move(); - } - - @Override - public void Damage(CustomDamageEvent event) - { - - } - - @Override - public void Update(UpdateEvent event) - { - if (event.getType() == UpdateType.SEC) - Move(); - - if (event.getType() == UpdateType.SLOW) - Potion(); - } - - private void Potion() - { - if (GetEntity().getTarget() == null) - return; - - ThrownPotion pot = GetEntity().launchProjectile(ThrownPotion.class); - - Host.Announce("THROWN"); - UtilAction.velocity(pot, UtilAlg.getTrajectory(GetEntity(), GetEntity().getTarget()), 1.2, false, 0, 0.3, 10, false); - } - - private void Move() - { - //New Target via Distance - if (GetTarget() == null || - UtilMath.offset(GetEntity().getLocation(), GetTarget()) < 10 || - UtilMath.offset2d(GetEntity().getLocation(), GetTarget()) < 6 || - UtilTime.elapsed(GetTargetTime(), 10000)) - { - SetTarget(GetRoamTarget()); - return; - } - - //Untarget - if (GetEntity().getTarget() != null) - { - if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10) - { - GetEntity().setTarget(null); - } - } - //Move - else - { - EntityCreature ec = ((CraftCreature)GetEntity()).getHandle(); - Navigation nav = ec.getNavigation(); - - if (UtilMath.offset(GetEntity().getLocation(), GetTarget()) > 12) - { - Location target = GetEntity().getLocation(); - - target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(12)); - - nav.a(target.getX(), target.getY(), target.getZ(), 1.6f); - } - else - { - nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1.2f); - } - } - } - - @Override - public void Target(EntityTargetEvent event) - { - - } -} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobZombie.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobZombie.java index 4d47c1d84..9444e6031 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobZombie.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobZombie.java @@ -1,21 +1,17 @@ package nautilus.game.arcade.game.games.halloween.creatures; -import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_6_R3.EntityCreature; -import net.minecraft.server.v1_6_R3.Navigation; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature; import org.bukkit.entity.Zombie; import org.bukkit.event.entity.EntityTargetEvent; -public class MobZombie extends CreatureBase +public class MobZombie extends CreatureBase implements InterfaceMove { public MobZombie(Game game, Location loc) { @@ -38,14 +34,11 @@ public class MobZombie extends CreatureBase @Override public void Update(UpdateEvent event) { - if (event.getType() == UpdateType.SLOW) - Move(); - if (event.getType() == UpdateType.SLOW) Speed(); } - private void Move() + public void Move() { //New Target via Distance if (GetTarget() == null || @@ -68,21 +61,7 @@ public class MobZombie extends CreatureBase //Move else { - EntityCreature ec = ((CraftCreature)GetEntity()).getHandle(); - Navigation nav = ec.getNavigation(); - - if (UtilMath.offset(GetEntity().getLocation(), GetTarget()) > 12) - { - Location target = GetEntity().getLocation(); - - target.add(UtilAlg.getTrajectory(GetEntity().getLocation(), GetTarget()).multiply(12)); - - nav.a(target.getX(), target.getY(), target.getZ(), 1f); - } - else - { - nav.a(GetTarget().getX(), GetTarget().getY(), GetTarget().getZ(), 1f); - } + DefaultMove(); } } 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 cf889eb44..c88b4a33b 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 @@ -56,22 +56,23 @@ public class PumpkinKing extends CreatureBase private ArrayList _minions = new ArrayList(); private int _minionsMax = 12; //12 - private HashMap _minionTargets = new HashMap(); private boolean _minionSpawn = true; + private HashMap _minionTargets = new HashMap(); + private HashMap _minionAttack = new HashMap(); private ArrayList _shields = new ArrayList(); private int _shieldsMax = 6; //6 private long _shieldSpawn = 0; - + private Location _kingLocation; private Player _kingTarget = null; - + private HashSet _arrows = new HashSet(); public PumpkinKing(Game game, Location loc) { super(game, null, Skeleton.class, loc); - + _kingLocation = loc; } @@ -83,7 +84,7 @@ public class PumpkinKing extends CreatureBase ent.setMaxHealth(400); ent.setHealth(ent.getMaxHealth()); - + ent.getWorld().strikeLightningEffect(ent.getLocation()); ent.getWorld().strikeLightningEffect(ent.getLocation()); ent.getWorld().strikeLightningEffect(ent.getLocation()); @@ -97,7 +98,7 @@ public class PumpkinKing extends CreatureBase { if (event.GetProjectile() != null) event.GetProjectile().remove(); - + if (_shields.size() > 0) { event.SetCancelled("Shielded"); @@ -108,10 +109,10 @@ public class PumpkinKing extends CreatureBase event.SetCancelled("Shielded"); UtilPlayer.message(event.GetDamagerPlayer(true), F.main("Boss", "You must destroy " + F.elem("Pumpkin Minions") + " first!")); } - + if (event.GetDamagerPlayer(true) == null) event.SetCancelled("Non-Player"); - + event.SetKnockback(false); } //Attacked Minion @@ -119,7 +120,7 @@ public class PumpkinKing extends CreatureBase { if (event.GetProjectile() != null) event.GetProjectile().remove(); - + if (_shields.size() > 0) { event.SetCancelled("Shielded"); @@ -138,9 +139,9 @@ public class PumpkinKing extends CreatureBase if (event.GetCause() != DamageCause.PROJECTILE && event.GetCause() != DamageCause.LIGHTNING) return; - + event.GetProjectile().remove(); - + if (event.GetDamagerPlayer(true) == null) return; @@ -175,27 +176,33 @@ public class PumpkinKing extends CreatureBase //Minions if (event.getType() == UpdateType.TICK) - MinionControl(); + MinionOrbit(); + + if (event.getType() == UpdateType.TICK) + MinionAttack(); + + if (event.getType() == UpdateType.TICK) + MinionAttackDamage(); if (event.getType() == UpdateType.FASTEST) MinionArrow(); if (event.getType() == UpdateType.FAST) MinionSpawn(); - + //Final if (event.getType() == UpdateType.FAST) KingControl(); - + if (event.getType() == UpdateType.SEC) KingLeap(); - + if (event.getType() == UpdateType.SEC) KingBomb(); - + if (event.getType() == UpdateType.SLOW) KingTarget(); - + if (event.getType() == UpdateType.TICK) KingTrail(); @@ -207,6 +214,8 @@ public class PumpkinKing extends CreatureBase ShieldSpawn(); } + + private void KingTrail() { if (GetState() >= 4) @@ -228,7 +237,7 @@ public class PumpkinKing extends CreatureBase { if (_kingTarget == null) _kingTarget = GetRandomPlayer(); - + GetEntity().setTarget(_kingTarget); Location loc = _kingTarget.getLocation(); @@ -250,31 +259,31 @@ public class PumpkinKing extends CreatureBase { if (GetState() < 4) return; - + if (_kingTarget == null) return; - + if (Math.random() > 0.4) return; - + UtilAction.velocity(GetEntity(), UtilAlg.getTrajectory2d(GetEntity(), _kingTarget), 1.2, false, 0, 0.4, 10, true); } - + private void KingBomb() { if (GetState() < 4) return; - + if (_kingTarget == null) return; - + if (Math.random() > 0.4) return; - + TNTPrimed tnt = GetEntity().getWorld().spawn(GetEntity().getEyeLocation().add(GetEntity().getLocation().getDirection()), TNTPrimed.class); - + Player target = GetRandomPlayer(); - + UtilAction.velocity(tnt, UtilAlg.getTrajectory(tnt, target), 1.2, false, 0, 0.4, 10, false); } @@ -323,79 +332,138 @@ public class PumpkinKing extends CreatureBase if (!_minionSpawn) return; - if (_minions.size() >= _minionsMax) + for (int i=0 ; i<_minionsMax ; i++) { - _minionSpawn = false; - return; - } + 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); - Host.CreatureAllowOverride = true; - Skeleton skel = GetEntity().getWorld().spawn(GetEntity().getLocation(), Skeleton.class); - Host.Manager.GetCondition().Factory().Invisible("Cloak", skel, skel, 999999, 0, false, false, false); + skel.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); + skel.getEquipment().setItemInHand(new ItemStack(Material.BOW)); + + skel.setMaxHealth(50); + skel.setHealth(skel.getMaxHealth()); + + _minions.add(skel); + + UtilEnt.Vegetate(skel); + } - skel.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); - skel.getEquipment().setItemInHand(new ItemStack(Material.BOW)); - - skel.setMaxHealth(50); - skel.setHealth(skel.getMaxHealth()); - - _minions.add(skel); - - Host.CreatureAllowOverride = false; + _minionSpawn = false; } - public void MinionControl() + public void MinionOrbit() { + if (GetState() != 0 && GetState() != 1 && GetState() != 2) + return; + for (int i=0 ; i<_minions.size() ; i++) { 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()); + + double sizeMod = 2 + (_minions.size() / 12); + //Orbit - if (GetState() == 0 || GetState() == 1 || GetState() == 2) + double speed = 20d; + double oX = Math.sin(GetEntity().getTicksLived()/speed + lead) * 2 * sizeMod; + double oY = 1; + double oZ = Math.cos(GetEntity().getTicksLived()/speed + lead) * 2 * sizeMod; + Location loc = GetEntity().getLocation().add(oX, oY, oZ); + + if (UtilMath.offset(loc, minion.getLocation()) > 16) { - minion.setTarget(null); + Host.Manager.GetBlood().Effects(minion.getEyeLocation(), 10, 0.2, Sound.SKELETON_HURT, 1f, 1f, Material.BONE, (byte)0, 20, false); + minion.teleport(loc); + continue; + } - double lead = i * ((2d * Math.PI)/_minions.size()); + loc.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(GetEntity(), minion))); - double sizeMod = 2 + (_minions.size() / 12); + //Move + EntityCreature ec = ((CraftCreature)minion).getHandle(); + ec.getControllerMove().a(loc.getX(), loc.getY(), loc.getZ(), 1.4); + } + } - //Orbit - double speed = 20d; - double oX = Math.sin(GetEntity().getTicksLived()/speed + lead) * 2 * sizeMod; - double oY = 1; - double oZ = Math.cos(GetEntity().getTicksLived()/speed + lead) * 2 * sizeMod; + public void MinionAttack() + { + if (GetState() != 3) + return; - Location loc = GetEntity().getLocation().add(oX, oY, oZ); - if (UtilMath.offset(loc, minion.getLocation()) > 16) + if (_minions.isEmpty()) + return; + + Skeleton minion = _minions.remove(0); + + LivingEntity target = _minionTargets.get(minion); + if (target == null) + return; + + 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); + + _minions.add(minion); + } + + private void MinionAttackDamage() + { + if (GetState() != 3) + return; + + 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); + if (target == null) + continue; + + if (UtilMath.offset(minion, target) > 2) + continue; + + if (_minionAttack.containsKey(minion) && !UtilTime.elapsed(_minionAttack.get(minion), 500)) + continue; + + //Damage Event + Host.Manager.GetDamage().NewDamageEvent(target, minion, null, + DamageCause.ENTITY_ATTACK, 3, true, true, 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)); + + //Visual End + UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Host.Manager.GetPlugin(), new Runnable() + { + public void run() { - Host.Manager.GetBlood().Effects(minion.getLocation(), 10, 0.2, Sound.SKELETON_HURT, 1f, 1f, Material.BONE, (byte)0, 20, false); - minion.teleport(loc); - continue; + minion.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); } + }, 4); - //Move - EntityCreature ec = ((CraftCreature)minion).getHandle(); - Navigation nav = ec.getNavigation(); - nav.a(loc.getX(), loc.getY(), loc.getZ(), 1.2f); - } - //Attack - else - { - LivingEntity target = _minionTargets.get(minion); - if (target == null) - continue; - - minion.setTarget(target); - - Location loc = target.getLocation(); - 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); - } + _minionAttack.put(minion, System.currentTimeMillis()); } } @@ -406,7 +474,7 @@ public class PumpkinKing extends CreatureBase while (arrowIterator.hasNext()) { Arrow arrow = arrowIterator.next(); - + if (arrow.getLocation().getY() > 30 && arrow.getVelocity().getY() > 0) { Player target = Host.GetPlayers(true).get(UtilMath.r(Host.GetPlayers(true).size())); @@ -414,7 +482,7 @@ public class PumpkinKing extends CreatureBase arrow.setVelocity(arrow.getVelocity().setY(-0.1)); continue; } - + if (arrow.getTicksLived() > 200 || arrow.isOnGround()) { if (arrow.isValid() && Math.random() > 0.50) @@ -436,7 +504,7 @@ public class PumpkinKing extends CreatureBase int z = fieldZ.getInt(entityArrow); Block block = arrow.getWorld().getBlockAt(x, y, z); - + if (block.getY() > GetEntity().getLocation().getY()) block.breakNaturally(); } @@ -445,12 +513,12 @@ public class PumpkinKing extends CreatureBase e.printStackTrace(); } } - + arrow.remove(); arrowIterator.remove(); } } - + //Circle if (GetState() == 1) { @@ -466,11 +534,11 @@ public class PumpkinKing extends CreatureBase Arrow arrow = GetEntity().getWorld().spawnArrow(minion.getEyeLocation().add(traj), traj, 2f, 16f); arrow.setShooter(minion); - + _arrows.add(arrow); } } - + //Up else if (GetState() == 2) { @@ -485,7 +553,7 @@ public class PumpkinKing extends CreatureBase Arrow arrow = GetEntity().getWorld().spawnArrow(minion.getEyeLocation().add(traj), traj, 2f, 16f); arrow.setShooter(minion); - + _arrows.add(arrow); } } @@ -508,10 +576,10 @@ public class PumpkinKing extends CreatureBase if (!UtilTime.elapsed(_shieldSpawn, 10000)) return; - + if (_shields.size() >= _shieldsMax) return; - + //Delay _shieldSpawn = System.currentTimeMillis(); @@ -519,10 +587,10 @@ public class PumpkinKing extends CreatureBase if (_shields.size() == 0) { toSpawn = _shieldsMax; - + //Sound GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_HURT, 10f, 1.5f); - + if (GetEntity().getTicksLived() > 100) Host.Announce(C.cAqua + C.Bold + "Flame Shield has regenerated!"); } @@ -531,7 +599,7 @@ public class PumpkinKing extends CreatureBase //Sound GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_HURT, 1f, 2f); } - + for (int i=0 ; i 0.4, false, 0, 0.1, 1, true); } } - + if (_shields.size() > 0) GetEntity().getWorld().playEffect(GetEntity().getLocation().add(0, 6, 0), Effect.ENDER_SIGNAL, 0); } @@ -591,29 +659,30 @@ public class PumpkinKing extends CreatureBase { _state = state; _stateTime = System.currentTimeMillis(); - + if (state == 3) { //Update Gear for (int i=0 ; i<_minions.size() ; i++) { Skeleton minion = _minions.get(i); - - minion.getEquipment().setHelmet(new ItemStack(Material.JACK_O_LANTERN)); - minion.getEquipment().setItemInHand(new ItemStack(Material.WOOD_AXE)); - + + minion.getEquipment().setItemInHand(null); + //Speed Host.Manager.GetCondition().Factory().Speed("Minion Speed", minion, minion, 15, 0, false, false, false); - + //Sound GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_SPAWN, 10f, 1.5f); - + //Target _minionTargets.put(minion, GetRandomPlayer()); } - + //Announce Host.Announce(C.cAqua + C.Bold + "Kill the Pumpkin Minions!"); + + MinionAttack(); } } @@ -653,7 +722,7 @@ public class PumpkinKing extends CreatureBase if (UtilTime.elapsed(_stateTime, 20000)) { SetState(0); - + //Update Minions for (int i=0 ; i<_minions.size() ; i++) { @@ -662,13 +731,13 @@ public class PumpkinKing extends CreatureBase minion.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); minion.getEquipment().setItemInHand(new ItemStack(Material.BOW)); } - + ShieldSpawn(); - + _minionTargets.clear(); } } - + //Skeleton Scatter if (GetState() != 3 && UtilTime.elapsed(_stateTime, 2000)) { @@ -677,23 +746,23 @@ public class PumpkinKing extends CreatureBase SetState(3); } } - + //Final Stage if (GetState() != 4 && UtilTime.elapsed(_stateTime, 2000)) { if (_shields.size() == 0 && _minions.size() == 0) { SetState(4); - + //Announce Host.Announce(C.cAqua + C.Bold + "Kill the Pumpkin King!!!"); - + //Sound GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_SPAWN, 10f, 1.5f); - + //Speed Host.Manager.GetCondition().Factory().Speed("King Speed", GetEntity(), GetEntity(), 9999, 1, false, false, false); - + //Equip GetEntity().getEquipment().setItemInHand(new ItemStack(Material.IRON_SWORD)); } @@ -709,7 +778,7 @@ public class PumpkinKing extends CreatureBase event.setCancelled(true); } } - + if (_minions.contains(event.getEntity())) { if (GetState() != 3) @@ -725,22 +794,22 @@ public class PumpkinKing extends CreatureBase else { Player player = _minionTargets.get(event.getEntity()); - + if (!player.equals(event.getTarget())) event.setCancelled(true); - + if (!Host.IsAlive(player)) _minionTargets.put(event.getEntity(), GetRandomPlayer()); } } } } - + public Player GetRandomPlayer() { if (Host.GetPlayers(true).isEmpty()) return null; - + return Host.GetPlayers(true).get(UtilMath.r(Host.GetPlayers(true).size())); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/Wave3.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/Wave3.java index 4076902c3..17d475296 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/Wave3.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/Wave3.java @@ -3,7 +3,7 @@ package nautilus.game.arcade.game.games.halloween.waves; import mineplex.core.common.util.UtilTime; import nautilus.game.arcade.game.games.halloween.Halloween; import nautilus.game.arcade.game.games.halloween.creatures.MobSpiderLeaper; -import nautilus.game.arcade.game.games.halloween.creatures.MobSpiderWebber; +import nautilus.game.arcade.game.games.halloween.creatures.MobSpiderSmasher; public class Wave3 extends WaveBase { @@ -19,7 +19,7 @@ public class Wave3 extends WaveBase return; if (tick > 200 && tick % 10 == 0 && !UtilTime.elapsed(_start, 35000)) - Host.AddCreature(new MobSpiderWebber(Host, GetSpawn())); + Host.AddCreature(new MobSpiderSmasher(Host, GetSpawn())); if (tick % 8 == 0 && !UtilTime.elapsed(_start, 25000)) Host.AddCreature(new MobSpiderLeaper(Host, GetSpawn())); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/WaveVictory.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/WaveVictory.java index 273ce65d5..b42a974e6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/WaveVictory.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/WaveVictory.java @@ -12,7 +12,7 @@ public class WaveVictory extends WaveBase { public WaveVictory(Halloween host) { - super(host, "Celebration!", 0, host.GetSpawnSet(3)); + super(host, "Celebration!", 15000, host.GetSpawnSet(3)); } @Override @@ -28,7 +28,7 @@ public class WaveVictory extends WaveBase //Mobs for (CreatureBase mob : Host.GetCreatures()) - mob.GetEntity().damage(1); + mob.GetEntity().damage(5); //Time if (Host.WorldTimeSet != 6000) @@ -37,10 +37,4 @@ public class WaveVictory extends WaveBase Host.WorldData.World.setTime(Host.WorldTimeSet); } } - - @Override - public boolean CanEnd() - { - return Host.WorldTimeSet == 6000; - } }