From ad487e48bd77c93db6250b854549983a342bd8e7 Mon Sep 17 00:00:00 2001 From: Chiss Date: Tue, 29 Oct 2013 10:41:53 +1100 Subject: [PATCH 1/2] THIS IS HALLOWEEN THIS IS HALLOWEEN --- .../src/mineplex/hub/HubManager.java | 60 ++++++++++--------- .../game/games/halloween/Halloween.java | 43 +++++++++++++ .../games/halloween/creatures/MobCreeper.java | 4 +- .../halloween/creatures/MobPigZombie.java | 4 +- .../creatures/MobSkeletonArcher.java | 4 +- .../creatures/MobSkeletonWarrior.java | 4 +- .../halloween/creatures/MobSpiderLeaper.java | 4 +- .../halloween/creatures/MobSpiderSmasher.java | 4 +- .../games/halloween/creatures/MobZombie.java | 4 +- 9 files changed, 95 insertions(+), 36 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 1865f3877..209f15c89 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -551,35 +551,6 @@ public class HubManager extends MiniClientPlugin { return _visibilityManager; } - - - @EventHandler - public void HeartDisplay(UpdateEvent event) - { - if (event.getType() != UpdateType.FASTER) - return; - - for (Player player : UtilServer.getPlayers()) - { - if (!player.isOp()) - continue; - - for (Player other : UtilServer.getPlayers()) - { - if (player.getName().equalsIgnoreCase("Chiss")) - UtilParticle.PlayParticle(other, ParticleType.HEART, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 1); - - else if (player.getName().equalsIgnoreCase("defek7")) - UtilParticle.PlayParticle(other, ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2); - - else if (player.getName().equalsIgnoreCase("Spu_")) - UtilParticle.PlayParticle(other, ParticleType.FLAME, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2); - - else if (player.getName().equalsIgnoreCase("sterling_")) - UtilParticle.PlayParticle(other, ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2); - } - } - } public void SetPortalDelay(Entity ent) { @@ -599,4 +570,35 @@ public class HubManager extends MiniClientPlugin return UtilTime.elapsed(_portalTime.get(player.getName()), 5000); } + + @EventHandler + public void HeartDisplay(UpdateEvent event) + { + if (event.getType() != UpdateType.FASTER) + return; + + for (Player player : UtilServer.getPlayers()) + { + if (!player.isOp() && !player.getName().equals("MonsieurApple")) + continue; + + for (Player other : UtilServer.getPlayers()) + { + if (player.getName().equalsIgnoreCase("Chiss")) + UtilParticle.PlayParticle(other, ParticleType.HEART, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 1); + + else if (player.getName().equalsIgnoreCase("defek7")) + UtilParticle.PlayParticle(other, ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2); + + else if (player.getName().equalsIgnoreCase("Spu_")) + UtilParticle.PlayParticle(other, ParticleType.FLAME, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2); + + else if (player.getName().equalsIgnoreCase("sterling_")) + UtilParticle.PlayParticle(other, ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2); + + else if (player.getName().equalsIgnoreCase("MonsieurApple")) + UtilParticle.PlayParticle(other, ParticleType.SPLASH, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 10); + } + } + } } 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 6f6d1f0d5..66fd4fa2e 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 @@ -51,6 +51,9 @@ public class Halloween extends SoloGame private int _maxMobs = 80; private ArrayList _mobs = new ArrayList(); + + public long total = 0; + public long move = 0; public Halloween(ArcadeManager manager) { @@ -111,9 +114,26 @@ public class Halloween extends SoloGame GetTeamList().add(new GameTeam("Pumpkin King", ChatColor.RED, WorldData.GetDataLocs("RED"))); } + @EventHandler(priority = EventPriority.MONITOR) + public void TimeReport(UpdateEvent event) + { + if (event.getType() != UpdateType.SEC) + return; + + System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); + System.out.println("Total Time: " + UtilTime.convertString(total, 4, TimeUnit.MILLISECONDS)); + System.out.println("Move Time: " + UtilTime.convertString(move, 4, TimeUnit.MILLISECONDS)); + System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); + + total = 0; + move = 0; + } + @EventHandler public void SoundUpdate(UpdateEvent event) { + long start = System.currentTimeMillis(); + if (event.getType() != UpdateType.SLOW) return; @@ -125,11 +145,15 @@ public class Halloween extends SoloGame for (Player player : UtilServer.getPlayers()) player.playSound(player.getLocation(), Sound.AMBIENCE_CAVE, 3f, 1f); + + total += System.currentTimeMillis() - start; } @EventHandler public void WaveUpdate(UpdateEvent event) { + long start = System.currentTimeMillis(); + if (event.getType() != UpdateType.TICK) return; @@ -142,6 +166,8 @@ public class Halloween extends SoloGame EndCheck(); } + + total += System.currentTimeMillis() - start; } public ArrayList GetSpawnSet(int i) @@ -168,6 +194,8 @@ public class Halloween extends SoloGame @EventHandler public void CreatureMoveUpdate(UpdateEvent event) { + long start = System.currentTimeMillis(); + if (event.getType() != UpdateType.TICK) return; @@ -184,11 +212,16 @@ public class Halloween extends SoloGame } _mobs.add(base); + + total += System.currentTimeMillis() - start; + move += System.currentTimeMillis() - start; } @EventHandler public void CreatureUpdate(UpdateEvent event) { + long start = System.currentTimeMillis(); + if (!IsLive()) return; @@ -201,20 +234,30 @@ public class Halloween extends SoloGame if (base.Updater(event)) mobIterator.remove(); } + + total += System.currentTimeMillis() - start; } @EventHandler public void CreatureDamage(CustomDamageEvent event) { + long start = System.currentTimeMillis(); + for (CreatureBase base : _mobs) base.Damage(event); + + total += System.currentTimeMillis() - start; } @EventHandler public void CreatureTarget(EntityTargetEvent event) { + long start = System.currentTimeMillis(); + for (CreatureBase base : _mobs) base.Target(event); + + total += System.currentTimeMillis() - start; } @EventHandler(priority = EventPriority.HIGHEST) 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 3212a4996..235bde0f6 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 @@ -8,6 +8,7 @@ import nautilus.game.arcade.game.Game; import org.bukkit.Location; import org.bukkit.entity.Creeper; +import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityTargetEvent; public class MobCreeper extends CreatureBase implements InterfaceMove @@ -58,7 +59,8 @@ public class MobCreeper extends CreatureBase implements InterfaceMove //Untarget if (GetEntity().getTarget() != null) { - if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10) + if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 || + (GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget()))) { GetEntity().setTarget(null); } 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 ec7ac7b31..88e8c4558 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 @@ -8,6 +8,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; import org.bukkit.Location; +import org.bukkit.entity.Player; import org.bukkit.entity.Zombie; import org.bukkit.event.entity.EntityTargetEvent; @@ -64,7 +65,8 @@ public class MobPigZombie extends CreatureBase implements InterfaceMove //Untarget if (GetEntity().getTarget() != null) { - if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10) + if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 || + (GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget()))) { GetEntity().setTarget(null); } 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 e7b419773..b61303171 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 @@ -8,6 +8,7 @@ import nautilus.game.arcade.game.Game; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.inventory.ItemStack; @@ -63,7 +64,8 @@ public class MobSkeletonArcher extends CreatureBase implements Interfa //Untarget if (GetEntity().getTarget() != null) { - if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10) + if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 || + (GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget()))) { GetEntity().setTarget(null); } 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 b324e6cc7..c18af6375 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 @@ -9,6 +9,7 @@ import nautilus.game.arcade.game.Game; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.entity.Player; import org.bukkit.entity.Zombie; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.inventory.ItemStack; @@ -66,7 +67,8 @@ public class MobSkeletonWarrior extends CreatureBase implements Interfac //Untarget if (GetEntity().getTarget() != null) { - if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10) + if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 || + (GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget()))) { GetEntity().setTarget(null); } 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 03690fefb..4d875c062 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 @@ -12,6 +12,7 @@ import nautilus.game.arcade.game.Game; import org.bukkit.Location; import org.bukkit.entity.CaveSpider; +import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityTargetEvent; public class MobSpiderLeaper extends CreatureBase implements InterfaceMove @@ -82,7 +83,8 @@ public class MobSpiderLeaper extends CreatureBase implements Interfa //Untarget if (GetEntity().getTarget() != null) { - if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10) + if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 || + (GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget()))) { GetEntity().setTarget(null); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderSmasher.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderSmasher.java index 2e9e99207..df7a58f99 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderSmasher.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobSpiderSmasher.java @@ -9,6 +9,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; import org.bukkit.Location; +import org.bukkit.entity.Player; import org.bukkit.entity.Zombie; import org.bukkit.event.entity.EntityTargetEvent; @@ -63,7 +64,8 @@ public class MobSpiderSmasher extends CreatureBase implements InterfaceM //Untarget if (GetEntity().getTarget() != null) { - if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10) + if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 || + (GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget()))) { GetEntity().setTarget(null); } 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 e64c60f07..9695fa056 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 @@ -8,6 +8,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; import org.bukkit.Location; +import org.bukkit.entity.Player; import org.bukkit.entity.Zombie; import org.bukkit.event.entity.EntityTargetEvent; @@ -53,7 +54,8 @@ public class MobZombie extends CreatureBase implements InterfaceMove //Untarget if (GetEntity().getTarget() != null) { - if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10) + if (UtilMath.offset2d(GetEntity(), GetEntity().getTarget()) > 10 || + (GetEntity().getTarget() instanceof Player && Host.IsAlive((Player)GetEntity().getTarget()))) { GetEntity().setTarget(null); } From 33c7d594a0fb290523b53f6235f674d450fc0deb Mon Sep 17 00:00:00 2001 From: Chiss Date: Tue, 29 Oct 2013 10:43:04 +1100 Subject: [PATCH 2/2] robin hood regen nerf --- .../games/halloween/kits/KitRobinHood.java | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/kits/KitRobinHood.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/kits/KitRobinHood.java index 2353c002d..6001c194a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/kits/KitRobinHood.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/kits/KitRobinHood.java @@ -9,6 +9,7 @@ import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -91,23 +92,43 @@ public class KitRobinHood extends SmashKit @EventHandler public void Aura(UpdateEvent event) { - if (event.getType() != UpdateType.SLOW) - return; - - for (Player player : Manager.GetGame().GetPlayers(true)) + if (event.getType() == UpdateType.FAST) { - if (!HasKit(player)) - continue; - - for (Player other : Manager.GetGame().GetPlayers(true)) + for (Player player : Manager.GetGame().GetPlayers(true)) { - if (other.equals(player)) + if (!HasKit(player)) continue; - if (UtilMath.offset(player, other) > 8) + for (Player other : Manager.GetGame().GetPlayers(true)) + { + if (other.equals(player)) + continue; + + if (UtilMath.offset(player, other) > 8) + continue; + + Manager.GetCondition().Factory().Regen("Aura", other, player, 1.9, 0, false, false, false); + } + } + } + + if (event.getType() == UpdateType.SLOW) + { + for (Player player : Manager.GetGame().GetPlayers(true)) + { + if (!HasKit(player)) continue; - Manager.GetCondition().Factory().Regen("Aura", other, player, 4.9, 0, false, false, false); + for (Player other : Manager.GetGame().GetPlayers(true)) + { + if (other.equals(player)) + continue; + + if (UtilMath.offset(player, other) > 8) + continue; + + UtilPlayer.health(other, 1); + } } } }