From 6c39c08abf07765fe0b93f071c396a7ada3a1e48 Mon Sep 17 00:00:00 2001 From: fooify Date: Thu, 30 Jul 2015 11:59:04 -0700 Subject: [PATCH 001/219] some progress on snow sprint --- .../src/mineplex/core/game/GameDisplay.java | 1 + .../src/mineplex/mapparser/GameType.java | 1 + .../src/nautilus/game/arcade/GameType.java | 6 +- .../game/games/snowsprint/SnowSprint.java | 73 ++++++ .../game/games/snowsprint/SnowmanMaze.java | 216 ++++++++++++++++++ .../games/snowsprint/SnowmanWaypoint.java | 17 ++ .../game/games/snowsprint/kits/KitJumper.java | 40 ++++ 7 files changed, 352 insertions(+), 2 deletions(-) create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanWaypoint.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index 91c3ae291..8ef66ff5e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -63,6 +63,7 @@ public enum GameDisplay Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51), Skywars("Skywars", "Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52), SkywarsTeams("Skywars Teams", "Skywars",Material.FEATHER, (byte)5, GameCategory.TEAM_VARIANT, 53), + SnowSprint("Snow Sprint", Material.SNOW_BALL, (byte)0, GameCategory.ARCADE, 54), Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999); diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java index 7e627f491..1ad54f8ea 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java @@ -43,6 +43,7 @@ public enum GameType SearchAndDestroy("Search and Destroy"), Sheep("Sheep Quest"), Skywars("Skywars"), + SnowSprint("Snow Sprint"), Smash("Super Smash Mobs"), SmashTeams("Super Smash Mobs Teams", "Super Smash Mobs"), SmashDomination("Super Smash Mobs Domination", "Super Smash Mobs"), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java index 355d0a853..2f3980321 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -1,5 +1,7 @@ package nautilus.game.arcade; +import org.bukkit.Material; + import mineplex.core.game.GameCategory; import mineplex.core.game.GameDisplay; import nautilus.game.arcade.game.Game; @@ -46,6 +48,7 @@ import nautilus.game.arcade.game.games.smash.TeamSuperSmash; import nautilus.game.arcade.game.games.snake.Snake; import nautilus.game.arcade.game.games.sneakyassassins.SneakyAssassins; import nautilus.game.arcade.game.games.snowfight.SnowFight; +import nautilus.game.arcade.game.games.snowsprint.SnowSprint; import nautilus.game.arcade.game.games.spleef.Spleef; import nautilus.game.arcade.game.games.spleef.SpleefTeams; import nautilus.game.arcade.game.games.squidshooter.SquidShooter; @@ -59,8 +62,6 @@ import nautilus.game.arcade.game.games.wither.WitherGame; import nautilus.game.arcade.game.games.wizards.Wizards; import nautilus.game.arcade.game.games.zombiesurvival.ZombieSurvival; -import org.bukkit.Material; - public enum GameType { //Mini @@ -121,6 +122,7 @@ public enum GameType Cards(Cards.class, GameDisplay.Cards), Skywars(SoloSkywars.class, GameDisplay.Skywars), SkywarsTeams(TeamSkywars.class, GameDisplay.SkywarsTeams, new GameType[]{GameType.Skywars}, false), + SnowSprint(SnowSprint.class, GameDisplay.SnowSprint), Event(EventGame.class, GameDisplay.Event, new GameType[]{ GameType.BaconBrawl, GameType.Barbarians, GameType.Bridge, GameType.Build, GameType.Build, diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java new file mode 100644 index 000000000..7dd5a6da7 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java @@ -0,0 +1,73 @@ +package nautilus.game.arcade.game.games.snowsprint; + +import java.util.HashMap; +import java.util.UUID; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; + +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.GameType; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.SoloGame; +import nautilus.game.arcade.game.games.snowsprint.kits.KitJumper; +import nautilus.game.arcade.kit.Kit; + +public class SnowSprint extends SoloGame +{ + private SnowmanMaze _maze; + + private HashMap _jumpers = new HashMap(); + + public SnowSprint(ArcadeManager manager) + { + super(manager, GameType.SnowSprint, + + new Kit[] + { + new KitJumper(manager), + }, + + new String[] + { + "stuff happens and you have to do stuff so yeah", + "", + "have fun i guess", + }); + + this.DamagePvP = false; + + this.PrepareFreeze = false; + + //_maze = new SnowmanMaze(this, WorldData.GetDataLocs("GRAY")/*, WorldData.GetCustomLocs("103")*/); + } + + @EventHandler + public void Update(UpdateEvent event) + { + if(event.getType() != UpdateType.TICK) return; + if(_maze == null) return; + _maze.Update(); + } + + @EventHandler + public void GameStateChange(GameStateChangeEvent event) + { + if(event.GetState() == GameState.Prepare) + { + _maze = new SnowmanMaze(this, WorldData.GetDataLocs("GRAY")); + + for(Player pl : GetPlayers(true)) + { + if (GetKit(pl) instanceof KitJumper) _jumpers.put(pl.getUniqueId(), 3); + } + } + } + + public HashMap GetJumperScores() + { + return _jumpers; + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java new file mode 100644 index 000000000..379e305bd --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java @@ -0,0 +1,216 @@ +package nautilus.game.arcade.game.games.snowsprint; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map.Entry; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Player; +import org.bukkit.entity.Snowman; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; + +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.recharge.Recharge; +import nautilus.game.arcade.game.games.snowsprint.kits.KitJumper; + +public class SnowmanMaze +{ + private SnowSprint Host; + private ArrayList _spawns; + private HashSet _waypoints; + private ArrayList _borders; + + private HashMap _ents = new HashMap(); + + public SnowmanMaze(SnowSprint host, ArrayList spawns/*, ArrayList borders*/) + { + Host = host; + + _spawns = spawns; + //_borders = borders; + + _waypoints = new HashSet(); + + for (Location loc : _spawns) + { + _waypoints.add(loc.getBlock()); + + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.QUARTZ_BLOCK); + } + } + + public void Update() + { + spawn(); + + if (Host.IsLive()) + { + move(); + bump(); + } + } + + private void bump() + { + //Hit Players + for (Player player : Host.GetPlayers(true)) + { + if (!Recharge.Instance.usable(player, "Snowman Hit")) + continue; + + //Hit Snowman + for (Snowman snowman : _ents.keySet()) + { + if (UtilMath.offset2d(player, snowman) < 1) + { + Recharge.Instance.useForce(player, "Snowman Hit", 1000); + + //Velocity + //UtilAction.velocity(player, new Vector(1,0,0), 4, false, 0, 1.2, 1.2, true); + + //Damage Event + Host.Manager.GetDamage().NewDamageEvent(player, snowman, null, + DamageCause.ENTITY_ATTACK, 10, false, false, false, + null, "Snowman Attack"); + } + } + + //Out of Bounds + if (player.getLocation().getY() != _spawns.get(0).getBlockY()) { + //if (UtilAlg.inBoundingBox(player.getLocation(), _borders.get(0), _borders.get(1))) + //{ + Recharge.Instance.useForce(player, "Snowman Hit", 1000); + + //Velocity + //UtilAction.velocity(player, new Vector(0,1,0), 4, false, 0, 1.2, 1.2, true); + + if (Host.GetKit(player) instanceof KitJumper) + { + int jumpsLeft = Host.GetJumperScores().get(player.getUniqueId()); + if(Host.GetJumperScores().get(player.getUniqueId()) > 0) + { + Host.GetJumperScores().put(player.getUniqueId(), jumpsLeft-1); + UtilPlayer.message(player, F.main("Skill", "You used " + F.skill("Jump") + ".")); + if(jumpsLeft == 0) UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill("Jump") + " anymore.")); + continue; + } + } + + //Damage Event + Host.Manager.GetDamage().NewDamageEvent(player, null, null, + DamageCause.CUSTOM, 10, false, false, false, + null, "Jumping"); + + UtilPlayer.message(player, F.main("Game", "You cannot jump!")); + //} + } + } + } + + private void move() + { + Iterator> entIterator = _ents.entrySet().iterator(); + + //Move & Die + while (entIterator.hasNext()) + { + Entry data = entIterator.next(); + + //New or Fallen + if (data.getValue().Target == null || data.getKey().getLocation().getY() < data.getValue().Target.getBlockY()) + { + Location loc = UtilAlg.findClosest(data.getKey().getLocation(), _spawns); + + data.getKey().teleport(loc); + data.getValue().Target = loc; + } + + //New Waypoint + if (UtilMath.offset2d(data.getKey().getLocation(), data.getValue().Target) < 0.4) + { + ArrayList nextBlock = new ArrayList(); + + Block north = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.NORTH); + Block south = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.SOUTH); + Block east = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.EAST); + Block west = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.WEST); + + if (north != null) nextBlock.add(north); + if (south != null) nextBlock.add(south); + if (east != null) nextBlock.add(east); + if (west != null) nextBlock.add(west); + + //Random Direction + if (!nextBlock.isEmpty()) + { + data.getValue().Target = UtilAlg.Random(nextBlock).getLocation().add(0.5, 0, 0.5); + UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); + } + } + + //Timeout Move + if (UtilMath.offset(data.getKey().getLocation(), data.getValue().Last) > 0.1) + data.getValue().Time = System.currentTimeMillis(); + + if (UtilTime.elapsed(data.getValue().Time, 2000)) + UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); + } + } + + private Block getTarget(Block start, Block cur, BlockFace face) + { + if (cur == null) + cur = start; + + while (_waypoints.contains(cur.getRelative(face))) + { + cur = cur.getRelative(face); + + //Stop at intersection + int count = 0; + + if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; + if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; + if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; + if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; + + if (count > 1) + break; + } + + if (cur.equals(start)) + return null; + + return cur; + } + + private void spawn() + { + //Spawn + //if (Host.IsLive()) + { + while (_ents.size() < 40) + { + Location loc = UtilAlg.Random(_spawns); + + Host.CreatureAllowOverride = true; + Snowman ent = loc.getWorld().spawn(loc, Snowman.class); + Host.CreatureAllowOverride = false; + + UtilEnt.Vegetate(ent); + UtilEnt.ghost(ent, true, false); + _ents.put(ent, new SnowmanWaypoint(ent.getLocation())); + } + } + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanWaypoint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanWaypoint.java new file mode 100644 index 000000000..7873fa98e --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanWaypoint.java @@ -0,0 +1,17 @@ +package nautilus.game.arcade.game.games.snowsprint; + +import org.bukkit.Location; + +public class SnowmanWaypoint +{ + public Location Last; + public Location Target; + public long Time; + + public SnowmanWaypoint(Location last) + { + Last = last; + Target = null; + Time = System.currentTimeMillis(); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java new file mode 100644 index 000000000..149b4b81c --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java @@ -0,0 +1,40 @@ +package nautilus.game.arcade.game.games.snowsprint.kits; + +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.itemstack.ItemStackFactory; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.KitAvailability; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.*; + +public class KitJumper extends Kit +{ + public KitJumper(ArcadeManager manager) + { + super(manager, "Jumper", KitAvailability.Free, + + new String[] + { + "You get three jumps before you", + "have to walk like everyone else." + }, + + new Perk[] + { + }, + EntityType.SKELETON, + new ItemStack(Material.AIR)); + + } + + @Override + public void GiveItems(Player player) + { + //player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE)); + } +} From 014cac31f0d695eafb63baf5c475e57f8cfd43e8 Mon Sep 17 00:00:00 2001 From: fooify Date: Thu, 30 Jul 2015 14:04:39 -0700 Subject: [PATCH 002/219] more changes to snow sprint --- .../game/games/snowsprint/SnowSprint.java | 26 +++++++----- .../game/games/snowsprint/SnowmanMaze.java | 42 ++++--------------- .../game/games/snowsprint/kits/KitJumper.java | 6 +-- 3 files changed, 26 insertions(+), 48 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java index 7dd5a6da7..b0c4ba14a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java @@ -1,10 +1,10 @@ package nautilus.game.arcade.game.games.snowsprint; -import java.util.HashMap; -import java.util.UUID; - import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -19,8 +19,6 @@ public class SnowSprint extends SoloGame { private SnowmanMaze _maze; - private HashMap _jumpers = new HashMap(); - public SnowSprint(ArcadeManager manager) { super(manager, GameType.SnowSprint, @@ -60,14 +58,22 @@ public class SnowSprint extends SoloGame _maze = new SnowmanMaze(this, WorldData.GetDataLocs("GRAY")); for(Player pl : GetPlayers(true)) - { - if (GetKit(pl) instanceof KitJumper) _jumpers.put(pl.getUniqueId(), 3); - } + pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000000, 250)); } } - public HashMap GetJumperScores() + @EventHandler + public void Antijump(UpdateEvent event) { - return _jumpers; + if(event.getType() != UpdateType.SEC) return; // because why not + if(GetState() != GameState.Prepare && GetState() != GameState.Live) + for(Player pl : GetPlayers(true)) + pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000000, 250)); + } + + @EventHandler + public void Damage(EntityDamageEvent event) + { + if(_maze.getSnowmen().contains(event.getEntity())) event.setCancelled(true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java index 379e305bd..8d17ae53e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map.Entry; +import java.util.Set; import org.bukkit.Location; import org.bukkit.Material; @@ -14,16 +15,13 @@ import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; import mineplex.core.recharge.Recharge; -import nautilus.game.arcade.game.games.snowsprint.kits.KitJumper; -public class SnowmanMaze +public class SnowmanMaze { private SnowSprint Host; private ArrayList _spawns; @@ -81,39 +79,9 @@ public class SnowmanMaze //Damage Event Host.Manager.GetDamage().NewDamageEvent(player, snowman, null, DamageCause.ENTITY_ATTACK, 10, false, false, false, - null, "Snowman Attack"); + "Snowman", "Snowman Attack"); } } - - //Out of Bounds - if (player.getLocation().getY() != _spawns.get(0).getBlockY()) { - //if (UtilAlg.inBoundingBox(player.getLocation(), _borders.get(0), _borders.get(1))) - //{ - Recharge.Instance.useForce(player, "Snowman Hit", 1000); - - //Velocity - //UtilAction.velocity(player, new Vector(0,1,0), 4, false, 0, 1.2, 1.2, true); - - if (Host.GetKit(player) instanceof KitJumper) - { - int jumpsLeft = Host.GetJumperScores().get(player.getUniqueId()); - if(Host.GetJumperScores().get(player.getUniqueId()) > 0) - { - Host.GetJumperScores().put(player.getUniqueId(), jumpsLeft-1); - UtilPlayer.message(player, F.main("Skill", "You used " + F.skill("Jump") + ".")); - if(jumpsLeft == 0) UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill("Jump") + " anymore.")); - continue; - } - } - - //Damage Event - Host.Manager.GetDamage().NewDamageEvent(player, null, null, - DamageCause.CUSTOM, 10, false, false, false, - null, "Jumping"); - - UtilPlayer.message(player, F.main("Game", "You cannot jump!")); - //} - } } } @@ -213,4 +181,8 @@ public class SnowmanMaze } } } + + public Set getSnowmen() { + return _ents.keySet(); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java index 149b4b81c..f6b5970c7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java @@ -20,12 +20,12 @@ public class KitJumper extends Kit new String[] { - "You get three jumps before you", - "have to walk like everyone else." + "WHOOSH!" }, new Perk[] { + new PerkLeap("Leap", 1, 1, 4000, 2) }, EntityType.SKELETON, new ItemStack(Material.AIR)); @@ -35,6 +35,6 @@ public class KitJumper extends Kit @Override public void GiveItems(Player player) { - //player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE)); } } From e59f2751f34f531e6f2205b0cc4c6fc9ce938ca3 Mon Sep 17 00:00:00 2001 From: fooify Date: Thu, 30 Jul 2015 17:31:26 -0700 Subject: [PATCH 003/219] more stuff changed to snow sprint --- .../game/games/snowsprint/SnowSprint.java | 12 ++--- .../kits/{KitJumper.java => KitHyper.java} | 16 ++++--- .../game/arcade/kit/perks/PerkHyper.java | 47 +++++++++++++++++++ 3 files changed, 61 insertions(+), 14 deletions(-) rename Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/{KitJumper.java => KitHyper.java} (63%) create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHyper.java diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java index b0c4ba14a..b8382e1b1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java @@ -1,5 +1,6 @@ package nautilus.game.arcade.game.games.snowsprint; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageEvent; @@ -12,7 +13,7 @@ import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.SoloGame; -import nautilus.game.arcade.game.games.snowsprint.kits.KitJumper; +import nautilus.game.arcade.game.games.snowsprint.kits.KitHyper; import nautilus.game.arcade.kit.Kit; public class SnowSprint extends SoloGame @@ -25,7 +26,7 @@ public class SnowSprint extends SoloGame new Kit[] { - new KitJumper(manager), + new KitHyper(manager), }, new String[] @@ -56,9 +57,6 @@ public class SnowSprint extends SoloGame if(event.GetState() == GameState.Prepare) { _maze = new SnowmanMaze(this, WorldData.GetDataLocs("GRAY")); - - for(Player pl : GetPlayers(true)) - pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000000, 250)); } } @@ -66,7 +64,7 @@ public class SnowSprint extends SoloGame public void Antijump(UpdateEvent event) { if(event.getType() != UpdateType.SEC) return; // because why not - if(GetState() != GameState.Prepare && GetState() != GameState.Live) + if(!InProgress()) return; for(Player pl : GetPlayers(true)) pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000000, 250)); } @@ -74,6 +72,6 @@ public class SnowSprint extends SoloGame @EventHandler public void Damage(EntityDamageEvent event) { - if(_maze.getSnowmen().contains(event.getEntity())) event.setCancelled(true); + if(event.getEntityType() == EntityType.SNOWMAN) event.setCancelled(true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitHyper.java similarity index 63% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitHyper.java index f6b5970c7..7a1bf6b7d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitJumper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitHyper.java @@ -5,6 +5,7 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import mineplex.core.common.util.C; import mineplex.core.itemstack.ItemStackFactory; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.Kit; @@ -12,29 +13,30 @@ import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.perks.*; -public class KitJumper extends Kit +public class KitHyper extends Kit { - public KitJumper(ArcadeManager manager) + public KitHyper(ArcadeManager manager) { - super(manager, "Jumper", KitAvailability.Free, + super(manager, "Hyper", KitAvailability.Free, new String[] { - "WHOOSH!" + "Zoom zippity zip zip quick." }, new Perk[] { - new PerkLeap("Leap", 1, 1, 4000, 2) + new PerkHyper() }, EntityType.SKELETON, - new ItemStack(Material.AIR)); + new ItemStack(Material.SUGAR)); } @Override public void GiveItems(Player player) { - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SUGAR, (byte)0, 3, + C.cYellow + C.Bold + "Right-click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Speed Boost")); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHyper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHyper.java new file mode 100644 index 000000000..6d2e07a7f --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHyper.java @@ -0,0 +1,47 @@ +package nautilus.game.arcade.kit.perks; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerInteractEvent; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilInv; +import nautilus.game.arcade.kit.Perk; + +public class PerkHyper extends Perk +{ + public PerkHyper() + { + super("Hyper", new String[] + { + C.cYellow + "Right-click" + C.cGray + " with Sugar to " + C.cGreen + "GO HYPER" + }); + } + + @EventHandler + public void Interact(PlayerInteractEvent event) + { + if(!UtilEvent.isAction(event, ActionType.R)) return; + + if (event.getPlayer().getItemInHand() == null) + return; + + if (event.getPlayer().getItemInHand().getType() != Material.SUGAR) + return; + + Player player = event.getPlayer(); + + if (!Kit.HasKit(player)) + return; + + event.setCancelled(true); + + UtilInv.remove(player, Material.SUGAR, (byte)0, 1); + UtilInv.Update(player); + + Manager.GetCondition().Factory().Speed(GetName(), player, player, 4, 0, false, false, true); + } +} From 519449e015ac835fdaea532f6e6529c5d14eb0ac Mon Sep 17 00:00:00 2001 From: fooify Date: Sat, 1 Aug 2015 11:42:32 -0700 Subject: [PATCH 004/219] lots of stuff (: --- .../core/common/util/UtilFirework.java | 2 +- .../src/mineplex/core/game/GameDisplay.java | 2 +- .../src/mineplex/mapparser/GameType.java | 2 +- .../src/nautilus/game/arcade/GameType.java | 4 +- .../arcade/game/games/monstermaze/Maze.java | 297 ++++++++++++++++++ .../MazeMobWaypoint.java} | 6 +- .../MonsterMaze.java} | 53 +++- .../game/games/snowsprint/SnowmanMaze.java | 188 ----------- .../game/arcade/kit/perks/PerkHyper.java | 6 + 9 files changed, 357 insertions(+), 203 deletions(-) create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java rename Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/{snowsprint/SnowmanWaypoint.java => monstermaze/MazeMobWaypoint.java} (59%) rename Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/{snowsprint/SnowSprint.java => monstermaze/MonsterMaze.java} (52%) delete mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java index 7b9a8479f..32f2af478 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java @@ -53,7 +53,7 @@ public class UtilFirework return null; } - public void detonateFirework(Firework firework) + public static void detonateFirework(Firework firework) { ((CraftWorld)firework.getWorld()).getHandle().broadcastEntityEffect(((CraftEntity)firework).getHandle(), (byte)17); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index 8ef66ff5e..b74b5db21 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -63,7 +63,7 @@ public enum GameDisplay Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51), Skywars("Skywars", "Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52), SkywarsTeams("Skywars Teams", "Skywars",Material.FEATHER, (byte)5, GameCategory.TEAM_VARIANT, 53), - SnowSprint("Snow Sprint", Material.SNOW_BALL, (byte)0, GameCategory.ARCADE, 54), + MonsterMaze("Monster Maze", Material.ROTTEN_FLESH, (byte)0, GameCategory.ARCADE, 54), Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999); diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java index 1ad54f8ea..3a559a4f1 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java @@ -36,6 +36,7 @@ public enum GameType MineStrike("MineStrike"), MineWare("MineWare"), MilkCow("Milk the Cow"), + MonsterMaze("Monster Maze"), Paintball("Super Paintball"), Quiver("One in the Quiver"), QuiverTeams("One in the Quiver Teams"), @@ -43,7 +44,6 @@ public enum GameType SearchAndDestroy("Search and Destroy"), Sheep("Sheep Quest"), Skywars("Skywars"), - SnowSprint("Snow Sprint"), Smash("Super Smash Mobs"), SmashTeams("Super Smash Mobs Teams", "Super Smash Mobs"), SmashDomination("Super Smash Mobs Domination", "Super Smash Mobs"), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java index baa0e5932..59ed6bd9f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -33,6 +33,7 @@ import nautilus.game.arcade.game.games.micro.Micro; import nautilus.game.arcade.game.games.milkcow.MilkCow; import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.mineware.MineWare; +import nautilus.game.arcade.game.games.monstermaze.MonsterMaze; import nautilus.game.arcade.game.games.oldmineware.OldMineWare; import nautilus.game.arcade.game.games.paintball.Paintball; import nautilus.game.arcade.game.games.quiver.Quiver; @@ -48,7 +49,6 @@ import nautilus.game.arcade.game.games.smash.TeamSuperSmash; import nautilus.game.arcade.game.games.snake.Snake; import nautilus.game.arcade.game.games.sneakyassassins.SneakyAssassins; import nautilus.game.arcade.game.games.snowfight.SnowFight; -import nautilus.game.arcade.game.games.snowsprint.SnowSprint; import nautilus.game.arcade.game.games.spleef.Spleef; import nautilus.game.arcade.game.games.spleef.SpleefTeams; import nautilus.game.arcade.game.games.squidshooter.SquidShooter; @@ -122,7 +122,7 @@ public enum GameType Cards(Cards.class, GameDisplay.Cards), Skywars(SoloSkywars.class, GameDisplay.Skywars), SkywarsTeams(TeamSkywars.class, GameDisplay.SkywarsTeams, new GameType[]{GameType.Skywars}, false), - SnowSprint(SnowSprint.class, GameDisplay.SnowSprint), + MonsterMaze(MonsterMaze.class, GameDisplay.MonsterMaze), Event(EventGame.class, GameDisplay.Event, new GameType[]{ GameType.BaconBrawl, GameType.Barbarians, GameType.Bridge, GameType.Build, GameType.Build, diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java new file mode 100644 index 000000000..ccd57099a --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -0,0 +1,297 @@ +package nautilus.game.arcade.game.games.monstermaze; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map.Entry; +import java.util.Set; + +import org.bukkit.Color; +import org.bukkit.FireworkEffect; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.entity.Snowman; +import org.bukkit.entity.Zombie; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.hologram.Hologram; +import mineplex.core.hologram.Hologram.HologramTarget; +import mineplex.core.recharge.Recharge; + +public class Maze +{ + private MonsterMaze Host; + private ArrayList _spawns; + private ArrayList _map; + private ArrayList _goals; + private HashSet _waypoints; + private ArrayList _borders; + + private Hologram _holo; + + private Location _goal = null; + private ArrayList _goalPlayers = new ArrayList(); // players who got the goal + + private int _phaseTimer = 30; // counts down + /* + * 16-30 - walking around + * 1-15 - get to the goal + * 0 - kill whoever didn't get it + */ + + private HashMap _ents = new HashMap(); + + public Maze(MonsterMaze host, ArrayList map, ArrayList spawns, ArrayList goals) + { + Host = host; + + _map = map; + _spawns = spawns; + _goals = goals; + //_borders = borders; + + _waypoints = new HashSet(); + + for (Location loc : _map) + { + _waypoints.add(loc.getBlock()); + + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.QUARTZ_BLOCK); + } + for (Location loc : _goals) + { + _waypoints.add(loc.getBlock()); + + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.QUARTZ_BLOCK); + } + + for (Location loc : _spawns) + { + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GOLD_BLOCK); + } + } + + public void Update() + { + if (Host.IsLive()) + { + checkGoal(); + move(); + bump(); + } + } + + private void bump() + { + if(_ents.size() <= 0) return; + //Hit Players + for (Player player : Host.GetPlayers(true)) + { + if (!Recharge.Instance.usable(player, "Monster Hit")) + continue; + + //Hit Snowman + for (Entity ent : _ents.keySet()) + { + if (UtilMath.offset2d(player, ent) < 1) + { + Recharge.Instance.useForce(player, "Monster Hit", 1000); + + //Velocity + //UtilAction.velocity(player, new Vector(1,0,0), 4, false, 0, 1.2, 1.2, true); + UtilAction.velocity(player, UtilAlg.getTrajectory(ent, player), 1, false, 0, 0.5, 1.2, true); + + //Damage Event + Host.Manager.GetDamage().NewDamageEvent(player, (LivingEntity)ent, null, + DamageCause.ENTITY_ATTACK, 6, false, false, false, + "Monster", "Monster Attack"); + } + } + } + } + + private void move() + { + Iterator> entIterator = _ents.entrySet().iterator(); + + //Move & Die + while (entIterator.hasNext()) + { + Entry data = entIterator.next(); + + //New or Fallen + if (data.getValue().Target == null || data.getKey().getLocation().getY() < data.getValue().Target.getBlockY()) + { + Location loc = UtilAlg.findClosest(data.getKey().getLocation(), _spawns); + + data.getKey().teleport(loc); + data.getValue().Target = loc; + } + + //New Waypoint + if (UtilMath.offset2d(data.getKey().getLocation(), data.getValue().Target) < 0.4) + { + ArrayList nextBlock = new ArrayList(); + + Block north = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.NORTH); + Block south = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.SOUTH); + Block east = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.EAST); + Block west = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.WEST); + + if (north != null) nextBlock.add(north); + if (south != null) nextBlock.add(south); + if (east != null) nextBlock.add(east); + if (west != null) nextBlock.add(west); + + //Random Direction + if (!nextBlock.isEmpty()) + { + data.getValue().Target = UtilAlg.Random(nextBlock).getLocation().add(0.5, 0, 0.5); + UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); + } + } + + //Timeout Move + if (UtilMath.offset(data.getKey().getLocation(), data.getValue().Last) > 0.1) + data.getValue().Time = System.currentTimeMillis(); + + if (UtilTime.elapsed(data.getValue().Time, 2000)) + UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); + } + } + + private Block getTarget(Block start, Block cur, BlockFace face) + { + if (cur == null) + cur = start; + + while (_waypoints.contains(cur.getRelative(face))) + { + cur = cur.getRelative(face); + + //Stop at intersection + int count = 0; + + if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; + if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; + if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; + if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; + + if (count > 1) + break; + } + + if (cur.equals(start)) + return null; + + return cur; + } + + public void spawn() + { + //Spawn + //if (Host.IsLive()) + + if(_ents.size() >= 35) return; + + Location loc = UtilAlg.Random(_spawns); + + Host.CreatureAllowOverride = true; + Entity ent; + //Snowman ent = loc.getWorld().spawn(loc, Snowman.class); + if(Host.getMonsterType() == EntityType.ZOMBIE) + { + ent = loc.getWorld().spawn(loc, Zombie.class); + } + else if(Host.getMonsterType() == EntityType.SNOWMAN) + { + ent = loc.getWorld().spawn(loc, Snowman.class); + } + else + { + ent = loc.getWorld().spawn(loc, Zombie.class); + } + + Host.CreatureAllowOverride = false; + + UtilEnt.Vegetate(ent); + UtilEnt.ghost(ent, true, false); + _ents.put(ent, new MazeMobWaypoint(ent.getLocation())); + } + + public void decrementPhaseTime() + { + _phaseTimer--; + + if(_phaseTimer == 15) + { + _goal = UtilAlg.Random(_map); + _goal = _goal.getBlock().getRelative(BlockFace.DOWN).getLocation(); + _goal.getBlock().setType(Material.DIAMOND_BLOCK); + Host.Announce(C.cAqua + C.Bold + "Quick! Go step on the diamond block or you'll die!"); + Location holoLoc = _goal.clone(); + holoLoc.add(0.5, 1.5, 0.5); + _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "STEP HERE", C.cGreen + "v"); + _holo.setHologramTarget(HologramTarget.BLACKLIST); + _holo.start(); + } + if(_phaseTimer == 0) + { + _goal.getBlock().setType(Material.QUARTZ_BLOCK); // maybe use maputil.quickBlockChange + _goal = null; + for(Player p : Host.GetPlayers(true)) + { + if(_goalPlayers.contains(p)) + { + UtilPlayer.message(p, C.cGreen + C.Bold + "You got the goal, so you didn't die."); + } + else + { + Host.Manager.GetDamage().NewDamageEvent(p, null, null, + DamageCause.ENTITY_ATTACK, 500, false, false, false, + "Game", "Missed the goal"); + UtilPlayer.message(p, C.cRed + C.Bold + "Oh no! You didn't get to the goal in time. R.I.P."); + } + } + _goalPlayers.clear(); + _holo.stop(); + _holo = null; + } + } + + public void checkGoal() + { + if(_goal == null) return; + for(Player pl : Host.GetPlayers(true)) + { + if(_goalPlayers.contains(pl)) continue; + if(pl.getLocation().getBlock().getRelative(BlockFace.DOWN).getLocation().equals(_goal)) + { + UtilPlayer.message(pl, C.cGold + C.Bold + "Okay, you stepped on the diamond block."); + // TODO add sounds + UtilFirework.detonateFirework(UtilFirework.launchFirework(pl.getLocation(), FireworkEffect.builder().withColor(Color.BLUE).build(), new Vector(0,0,0), 0)); + _goalPlayers.add(pl); + } + } + } + + public Set getMonsters() { + return _ents.keySet(); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanWaypoint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java similarity index 59% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanWaypoint.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java index 7873fa98e..7db60f73f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanWaypoint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java @@ -1,14 +1,14 @@ -package nautilus.game.arcade.game.games.snowsprint; +package nautilus.game.arcade.game.games.monstermaze; import org.bukkit.Location; -public class SnowmanWaypoint +public class MazeMobWaypoint { public Location Last; public Location Target; public long Time; - public SnowmanWaypoint(Location last) + public MazeMobWaypoint(Location last) { Last = last; Target = null; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java similarity index 52% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index b8382e1b1..4169bb1fd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowSprint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -1,12 +1,19 @@ -package nautilus.game.arcade.game.games.snowsprint; +package nautilus.game.arcade.game.games.monstermaze; +import org.bukkit.Color; +import org.bukkit.FireworkEffect; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; +import org.bukkit.entity.Skeleton; +import org.bukkit.entity.Zombie; import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import mineplex.core.common.util.UtilFirework; +import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; @@ -16,13 +23,14 @@ import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.snowsprint.kits.KitHyper; import nautilus.game.arcade.kit.Kit; -public class SnowSprint extends SoloGame +public class MonsterMaze extends SoloGame { - private SnowmanMaze _maze; + private Maze _maze; + private EntityType _monsterType; - public SnowSprint(ArcadeManager manager) + public MonsterMaze(ArcadeManager manager) { - super(manager, GameType.SnowSprint, + super(manager, GameType.MonsterMaze, new Kit[] { @@ -37,6 +45,7 @@ public class SnowSprint extends SoloGame }); this.DamagePvP = false; + this.DamageFall = false; this.PrepareFreeze = false; @@ -56,7 +65,8 @@ public class SnowSprint extends SoloGame { if(event.GetState() == GameState.Prepare) { - _maze = new SnowmanMaze(this, WorldData.GetDataLocs("GRAY")); + if(WorldData.MapName.contains("Frost")) _monsterType = EntityType.ZOMBIE; + _maze = new Maze(this, WorldData.GetDataLocs("GRAY"), WorldData.GetDataLocs("YELLOW"), WorldData.GetDataLocs("RED")); } } @@ -69,9 +79,38 @@ public class SnowSprint extends SoloGame pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000000, 250)); } + @EventHandler + public void DecrementPhaseTimer(UpdateEvent event) + { + if(event.getType() != UpdateType.SEC) return; + if(!IsLive()) return; + _maze.decrementPhaseTime(); + } + + @EventHandler + public void SpawnMob(UpdateEvent event) + { + if(event.getType() != UpdateType.SEC) return; + if(GetState() != GameState.Live) return; + _maze.spawn(); + } + @EventHandler public void Damage(EntityDamageEvent event) { - if(event.getEntityType() == EntityType.SNOWMAN) event.setCancelled(true); + if(event.getEntityType() == _monsterType) event.setCancelled(true); // TODO check to see if it's one of the entities + } + + @EventHandler + public void onEntityCombust(EntityCombustEvent event) + { + if(event.getEntity() instanceof Zombie || event.getEntity() instanceof Skeleton) + { + event.setCancelled(true); + } + } + + public EntityType getMonsterType() { + return _monsterType; } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java deleted file mode 100644 index 8d17ae53e..000000000 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/SnowmanMaze.java +++ /dev/null @@ -1,188 +0,0 @@ -package nautilus.game.arcade.game.games.snowsprint; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map.Entry; -import java.util.Set; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.Player; -import org.bukkit.entity.Snowman; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; - -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilTime; -import mineplex.core.recharge.Recharge; - -public class SnowmanMaze -{ - private SnowSprint Host; - private ArrayList _spawns; - private HashSet _waypoints; - private ArrayList _borders; - - private HashMap _ents = new HashMap(); - - public SnowmanMaze(SnowSprint host, ArrayList spawns/*, ArrayList borders*/) - { - Host = host; - - _spawns = spawns; - //_borders = borders; - - _waypoints = new HashSet(); - - for (Location loc : _spawns) - { - _waypoints.add(loc.getBlock()); - - loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.QUARTZ_BLOCK); - } - } - - public void Update() - { - spawn(); - - if (Host.IsLive()) - { - move(); - bump(); - } - } - - private void bump() - { - //Hit Players - for (Player player : Host.GetPlayers(true)) - { - if (!Recharge.Instance.usable(player, "Snowman Hit")) - continue; - - //Hit Snowman - for (Snowman snowman : _ents.keySet()) - { - if (UtilMath.offset2d(player, snowman) < 1) - { - Recharge.Instance.useForce(player, "Snowman Hit", 1000); - - //Velocity - //UtilAction.velocity(player, new Vector(1,0,0), 4, false, 0, 1.2, 1.2, true); - - //Damage Event - Host.Manager.GetDamage().NewDamageEvent(player, snowman, null, - DamageCause.ENTITY_ATTACK, 10, false, false, false, - "Snowman", "Snowman Attack"); - } - } - } - } - - private void move() - { - Iterator> entIterator = _ents.entrySet().iterator(); - - //Move & Die - while (entIterator.hasNext()) - { - Entry data = entIterator.next(); - - //New or Fallen - if (data.getValue().Target == null || data.getKey().getLocation().getY() < data.getValue().Target.getBlockY()) - { - Location loc = UtilAlg.findClosest(data.getKey().getLocation(), _spawns); - - data.getKey().teleport(loc); - data.getValue().Target = loc; - } - - //New Waypoint - if (UtilMath.offset2d(data.getKey().getLocation(), data.getValue().Target) < 0.4) - { - ArrayList nextBlock = new ArrayList(); - - Block north = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.NORTH); - Block south = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.SOUTH); - Block east = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.EAST); - Block west = getTarget(data.getKey().getLocation().getBlock(), null, BlockFace.WEST); - - if (north != null) nextBlock.add(north); - if (south != null) nextBlock.add(south); - if (east != null) nextBlock.add(east); - if (west != null) nextBlock.add(west); - - //Random Direction - if (!nextBlock.isEmpty()) - { - data.getValue().Target = UtilAlg.Random(nextBlock).getLocation().add(0.5, 0, 0.5); - UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); - } - } - - //Timeout Move - if (UtilMath.offset(data.getKey().getLocation(), data.getValue().Last) > 0.1) - data.getValue().Time = System.currentTimeMillis(); - - if (UtilTime.elapsed(data.getValue().Time, 2000)) - UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); - } - } - - private Block getTarget(Block start, Block cur, BlockFace face) - { - if (cur == null) - cur = start; - - while (_waypoints.contains(cur.getRelative(face))) - { - cur = cur.getRelative(face); - - //Stop at intersection - int count = 0; - - if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; - if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; - if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; - if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; - - if (count > 1) - break; - } - - if (cur.equals(start)) - return null; - - return cur; - } - - private void spawn() - { - //Spawn - //if (Host.IsLive()) - { - while (_ents.size() < 40) - { - Location loc = UtilAlg.Random(_spawns); - - Host.CreatureAllowOverride = true; - Snowman ent = loc.getWorld().spawn(loc, Snowman.class); - Host.CreatureAllowOverride = false; - - UtilEnt.Vegetate(ent); - UtilEnt.ghost(ent, true, false); - _ents.put(ent, new SnowmanWaypoint(ent.getLocation())); - } - } - } - - public Set getSnowmen() { - return _ents.keySet(); - } -} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHyper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHyper.java index 6d2e07a7f..879d5612d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHyper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHyper.java @@ -8,6 +8,7 @@ import org.bukkit.event.player.PlayerInteractEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.recharge.Recharge; import mineplex.core.common.util.UtilInv; import nautilus.game.arcade.kit.Perk; @@ -37,6 +38,11 @@ public class PerkHyper extends Perk if (!Kit.HasKit(player)) return; + if (!Recharge.Instance.usable(player, "Hyper")) + return; + + Recharge.Instance.useForce(player, "Hyper", 3000); + event.setCancelled(true); UtilInv.remove(player, Material.SUGAR, (byte)0, 1); From 551451c5334c1ace73ec94c94bb0db549e2c5605 Mon Sep 17 00:00:00 2001 From: fooify Date: Wed, 5 Aug 2015 10:30:27 -0700 Subject: [PATCH 005/219] moar changes --- .../core/common/util/UtilFirework.java | 2 +- .../arcade/game/games/monstermaze/Maze.java | 145 +++++++++++--- .../game/games/monstermaze/MonsterMaze.java | 14 +- .../game/games/monstermaze/SafePad.java | 177 ++++++++++++++++++ 4 files changed, 301 insertions(+), 37 deletions(-) create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java index 32f2af478..7b9a8479f 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java @@ -53,7 +53,7 @@ public class UtilFirework return null; } - public static void detonateFirework(Firework firework) + public void detonateFirework(Firework firework) { ((CraftWorld)firework.getWorld()).getHandle().broadcastEntityEffect(((CraftEntity)firework).getHandle(), (byte)17); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index ccd57099a..71007f88e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -19,12 +19,16 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.entity.Zombie; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; @@ -33,8 +37,10 @@ import mineplex.core.common.util.UtilTime; import mineplex.core.hologram.Hologram; import mineplex.core.hologram.Hologram.HologramTarget; import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; -public class Maze +public class Maze implements Listener { private MonsterMaze Host; private ArrayList _spawns; @@ -43,16 +49,16 @@ public class Maze private HashSet _waypoints; private ArrayList _borders; + private SafePad _safePad = null; + private SafePad _oldSafePad = null; + private Hologram _holo; - private Location _goal = null; - private ArrayList _goalPlayers = new ArrayList(); // players who got the goal + //private ArrayList _goalPlayers = new ArrayList(); // players who got the goal - private int _phaseTimer = 30; // counts down + private int _phaseTimer = -1; // counts down /* - * 16-30 - walking around - * 1-15 - get to the goal - * 0 - kill whoever didn't get it + * 10-0 - get to the goal... */ private HashMap _ents = new HashMap(); @@ -91,7 +97,7 @@ public class Maze { if (Host.IsLive()) { - checkGoal(); + //checkGoal(); move(); bump(); } @@ -237,61 +243,140 @@ public class Maze public void decrementPhaseTime() { + if(_phaseTimer == -1) + { + _safePad = new SafePad(Host, this, UtilAlg.Random(_goals).clone().subtract(0,1,0)); + _safePad.build(); + UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); + _phaseTimer = 11; + return; + } + _phaseTimer--; - if(_phaseTimer == 15) + if(_phaseTimer == 10) { - _goal = UtilAlg.Random(_map); - _goal = _goal.getBlock().getRelative(BlockFace.DOWN).getLocation(); - _goal.getBlock().setType(Material.DIAMOND_BLOCK); - Host.Announce(C.cAqua + C.Bold + "Quick! Go step on the diamond block or you'll die!"); - Location holoLoc = _goal.clone(); - holoLoc.add(0.5, 1.5, 0.5); - _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "STEP HERE", C.cGreen + "v"); + if(_oldSafePad != null) + { + _oldSafePad.setGlassData((byte)4); + _oldSafePad.turnOffBeacon(); + } + Host.Announce(C.cAqua + C.Bold + "Quick! Go step on the safe pad or you'll die!"); + Location holoLoc = _safePad.getLocation().clone(); + holoLoc.add(0, 1.5, 0); + _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD", C.cGreen + "v"); _holo.setHologramTarget(HologramTarget.BLACKLIST); _holo.start(); } + if(_phaseTimer == 9) + { + if(_oldSafePad != null) _oldSafePad.setGlassData((byte)1); + } + if(_phaseTimer == 8) + { + if(_oldSafePad != null) _oldSafePad.setGlassData((byte)14); + } + if(_phaseTimer == 7) + { + if(_oldSafePad != null) _oldSafePad.destroy(); + _oldSafePad = null; + } if(_phaseTimer == 0) { - _goal.getBlock().setType(Material.QUARTZ_BLOCK); // maybe use maputil.quickBlockChange - _goal = null; for(Player p : Host.GetPlayers(true)) { - if(_goalPlayers.contains(p)) + if(_safePad.isOn(p)) { - UtilPlayer.message(p, C.cGreen + C.Bold + "You got the goal, so you didn't die."); + UtilPlayer.message(p, C.cGreen + C.Bold + "You got onto the safe pad, so you didn't die."); } else { Host.Manager.GetDamage().NewDamageEvent(p, null, null, - DamageCause.ENTITY_ATTACK, 500, false, false, false, + DamageCause.CUSTOM, 500, false, false, false, "Game", "Missed the goal"); - UtilPlayer.message(p, C.cRed + C.Bold + "Oh no! You didn't get to the goal in time. R.I.P."); + UtilPlayer.message(p, C.cRed + C.Bold + "Oh no! You didn't get to the safe pad in time."); } } - _goalPlayers.clear(); + //_goalPlayers.clear(); _holo.stop(); _holo = null; + + _oldSafePad = _safePad; + _oldSafePad.turnOffBeacon(); + ArrayList goals = new ArrayList(_goals); + goals.remove(_oldSafePad.getLocation()); + + _safePad = new SafePad(Host, this, UtilAlg.Random(_goals).clone().subtract(0,1,0)); + _safePad.build(); + UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); +// for(Block b : _waypoints) +// { +// if(b.getRelative(BlockFace.DOWN).getType().equals(Material.QUARTZ_BLOCK)) +// { +// MapUtil.QuickChangeBlockAt(b.getLocation(), Material.CARPET.getId(), (byte)14); +// } +// } + _phaseTimer = 0; } +// if(_phaseTimer == 0) +// { +//// for(Block b : _waypoints) +//// { +//// if(b.getType().equals(Material.CARPET) && b.getData() == (byte)14) +//// { +//// MapUtil.QuickChangeBlockAt(b.getLocation(), Material.AIR); +//// } +//// } +// _phaseTimer = 11; +// } } - public void checkGoal() + /*public void checkGoal() { - if(_goal == null) return; + if(_safePad == null) return; for(Player pl : Host.GetPlayers(true)) { if(_goalPlayers.contains(pl)) continue; - if(pl.getLocation().getBlock().getRelative(BlockFace.DOWN).getLocation().equals(_goal)) + if(_safePad.isStandingOn(pl)) { - UtilPlayer.message(pl, C.cGold + C.Bold + "Okay, you stepped on the diamond block."); // TODO add sounds - UtilFirework.detonateFirework(UtilFirework.launchFirework(pl.getLocation(), FireworkEffect.builder().withColor(Color.BLUE).build(), new Vector(0,0,0), 0)); _goalPlayers.add(pl); } } - } + }*/ + +// @EventHandler +// public void carpetDamage(UpdateEvent event) +// { +// if(event.getType() != UpdateType.SEC) return; +// if(!Host.IsLive()) return; +// for(Player p : Host.GetPlayers(true)) +// { +// Block pb = p.getLocation().getBlock(); +// boolean isTouchingCarpet = false; +// for(Block b : UtilBlock.getInRadius(pb, 0.66).keySet()) +// { +// if(b.getType().equals(Material.CARPET) && b.getData() == (byte)14) +// { +// isTouchingCarpet = true; +// } +// } +// if(isTouchingCarpet) +// { +// UtilPlayer.message(p, F.main("Game", "Get back onto the safe pad!")); +// Host.Manager.GetDamage().NewDamageEvent(p, null, null, +// DamageCause.CUSTOM, 5, false, false, false, +// "Red Carpet", "Exposure to Red Carpet"); +// } +// } +// } public Set getMonsters() { return _ents.keySet(); } + + public int getPhaseTimer() + { + return _phaseTimer; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index 4169bb1fd..deac0f7b7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -1,19 +1,19 @@ package nautilus.game.arcade.game.games.monstermaze; -import org.bukkit.Color; -import org.bukkit.FireworkEffect; +import org.bukkit.entity.Egg; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; import org.bukkit.entity.Zombie; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityCombustEvent; +import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import mineplex.core.common.util.UtilFirework; -import mineplex.core.recharge.Recharge; +import mineplex.core.common.util.UtilServer; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; @@ -65,8 +65,9 @@ public class MonsterMaze extends SoloGame { if(event.GetState() == GameState.Prepare) { - if(WorldData.MapName.contains("Frost")) _monsterType = EntityType.ZOMBIE; + if(WorldData.MapName.contains("Monster")) _monsterType = EntityType.ZOMBIE; _maze = new Maze(this, WorldData.GetDataLocs("GRAY"), WorldData.GetDataLocs("YELLOW"), WorldData.GetDataLocs("RED")); + UtilServer.getServer().getPluginManager().registerEvents(_maze, getArcadeManager().getPlugin()); } } @@ -110,7 +111,8 @@ public class MonsterMaze extends SoloGame } } - public EntityType getMonsterType() { + public EntityType getMonsterType() + { return _monsterType; } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java new file mode 100644 index 000000000..76d3753f6 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java @@ -0,0 +1,177 @@ +package nautilus.game.arcade.game.games.monstermaze; + +import java.util.ArrayList; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Entity; +import org.bukkit.event.Listener; + +import mineplex.core.common.util.MapUtil; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilPlayer; + +public class SafePad +{ + private MonsterMaze Host; + private Maze _maze; + + private Location _loc; + + private ArrayList _blocks = new ArrayList(); + + public SafePad(MonsterMaze host, Maze maze, Location loc) + { + Host = host; + _maze = maze; + + _loc = loc; + + // beacon + _blocks.add(new SafePadBlock(loc.clone().add(0, 0, 0), Material.BEACON, (byte)0)); + + // beacon base + _blocks.add(new SafePadBlock(loc.clone().add(-1, -1, -1), Material.GOLD_BLOCK, (byte)0)); + _blocks.add(new SafePadBlock(loc.clone().add(0, -1, -1), Material.GOLD_BLOCK, (byte)0)); + _blocks.add(new SafePadBlock(loc.clone().add(1, -1, -1), Material.GOLD_BLOCK, (byte)0)); + + _blocks.add(new SafePadBlock(loc.clone().add(-1, -1, 0), Material.GOLD_BLOCK, (byte)0)); + _blocks.add(new SafePadBlock(loc.clone().add(0, -1, 0), Material.GOLD_BLOCK, (byte)0)); + _blocks.add(new SafePadBlock(loc.clone().add(1, -1, 0), Material.GOLD_BLOCK, (byte)0)); + + _blocks.add(new SafePadBlock(loc.clone().add(-1, -1, 1), Material.GOLD_BLOCK, (byte)0)); + _blocks.add(new SafePadBlock(loc.clone().add(0, -1, 1), Material.GOLD_BLOCK, (byte)0)); + _blocks.add(new SafePadBlock(loc.clone().add(1, -1, 1), Material.GOLD_BLOCK, (byte)0)); + + // glass + _blocks.add(new SafePadBlock(loc.clone().add(-2, 0, -2), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(-1, 0, -2), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(0, 0, -2), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(1, 0, -2), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(2, 0, -2), Material.STAINED_GLASS, (byte)5)); + + _blocks.add(new SafePadBlock(loc.clone().add(-2, 0, -1), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(-1, 0, -1), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(0, 0, -1), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(1, 0, -1), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(2, 0, -1), Material.STAINED_GLASS, (byte)5)); + + _blocks.add(new SafePadBlock(loc.clone().add(-2, 0, 0), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(-1, 0, 0), Material.STAINED_GLASS, (byte)5)); + // (this is where the beacon is, so no glass) + _blocks.add(new SafePadBlock(loc.clone().add(1, 0, 0), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(2, 0, 0), Material.STAINED_GLASS, (byte)5)); + + _blocks.add(new SafePadBlock(loc.clone().add(-2, 0, 1), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(-1, 0, 1), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(0, 0, 1), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(1, 0, 1), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(2, 0, 1), Material.STAINED_GLASS, (byte)5)); + + _blocks.add(new SafePadBlock(loc.clone().add(-2, 0, 2), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(-1, 0, 2), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(0, 0, 2), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(1, 0, 2), Material.STAINED_GLASS, (byte)5)); + _blocks.add(new SafePadBlock(loc.clone().add(2, 0, 2), Material.STAINED_GLASS, (byte)5)); + } + + public class SafePadBlock + { + Material _origM; + byte _origD; + + Material _tempMat; + byte _tempData; + + Location _loc; + + public SafePadBlock(Location loc, Material newMat, byte newData) + { + _origM = loc.getBlock().getType(); + _origD = loc.getBlock().getData(); + + _tempMat = newMat; + _tempData = newData; + + _loc = loc; + } + + public void setMaterial(Material m) + { + _tempMat = m; + MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData); + } + + public void setData(byte b) // for glass changing + { + _tempData = b; + MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData); + } + + public Location getLocation() + { + return _loc; + } + + public void build() + { + MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData); + } + + public void restore() + { + MapUtil.QuickChangeBlockAt(_loc, _origM.getId(), _origD); + } + } + + public void build() + { + for(SafePadBlock spb : _blocks) + { + spb.build(); + } + } + + public void setGlassData(byte newData) + { + for(SafePadBlock spb : _blocks) + { + if(!spb.getLocation().getBlock().getType().equals(Material.STAINED_GLASS)) continue; + spb.setData(newData); + } + } + + public void turnOffBeacon() + { + for(SafePadBlock bl : _blocks) + { + if(bl.getLocation().getBlock().getType().equals(Material.GOLD_BLOCK)) bl.restore(); + if(bl.getLocation().getBlock().getType().equals(Material.BEACON)) + { + bl.setMaterial(Material.STAINED_GLASS); + bl.setData((byte)5); + } + } + } + + public void destroy() + { + for(SafePadBlock bl : _blocks) + { + bl.restore(); + } + } + + public Location getLocation() + { + return _loc; + } + + public boolean isOn(Entity e) + { + return UtilAlg.inBoundingBox(e.getLocation(), getLocation().clone().add(2, 0, 2), getLocation().clone().add(-2, 5, -2)); + } +} From b5d1202674f489c958204004dfc2caaf3799d70c Mon Sep 17 00:00:00 2001 From: fooify Date: Wed, 5 Aug 2015 13:09:26 -0700 Subject: [PATCH 006/219] YET MORE WORK ON MM --- .../arcade/game/games/monstermaze/Maze.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index 71007f88e..afac944d1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -24,11 +24,8 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; @@ -37,8 +34,7 @@ import mineplex.core.common.util.UtilTime; import mineplex.core.hologram.Hologram; import mineplex.core.hologram.Hologram.HologramTarget; import mineplex.core.recharge.Recharge; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; public class Maze implements Listener { @@ -173,6 +169,11 @@ public class Maze implements Listener } } + if(_safePad != null && _safePad.isOn(data.getKey())) + { + UtilAction.velocity(data.getKey(), UtilAlg.getTrajectory(data.getKey().getLocation(), _safePad.getLocation()), 1, false, 0, 0.5, 1.2, true); + } + //Timeout Move if (UtilMath.offset(data.getKey().getLocation(), data.getValue().Last) > 0.1) data.getValue().Time = System.currentTimeMillis(); @@ -262,11 +263,6 @@ public class Maze implements Listener _oldSafePad.turnOffBeacon(); } Host.Announce(C.cAqua + C.Bold + "Quick! Go step on the safe pad or you'll die!"); - Location holoLoc = _safePad.getLocation().clone(); - holoLoc.add(0, 1.5, 0); - _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD", C.cGreen + "v"); - _holo.setHologramTarget(HologramTarget.BLACKLIST); - _holo.start(); } if(_phaseTimer == 9) { @@ -298,8 +294,11 @@ public class Maze implements Listener } } //_goalPlayers.clear(); - _holo.stop(); - _holo = null; + if(_holo != null) + { + _holo.stop(); + _holo = null; + } _oldSafePad = _safePad; _oldSafePad.turnOffBeacon(); @@ -309,6 +308,11 @@ public class Maze implements Listener _safePad = new SafePad(Host, this, UtilAlg.Random(_goals).clone().subtract(0,1,0)); _safePad.build(); UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); + Location holoLoc = _safePad.getLocation().clone(); + holoLoc.add(0, 1.5, 0); + _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD"); + _holo.setHologramTarget(HologramTarget.BLACKLIST); + _holo.start(); // for(Block b : _waypoints) // { // if(b.getRelative(BlockFace.DOWN).getType().equals(Material.QUARTZ_BLOCK)) @@ -316,7 +320,7 @@ public class Maze implements Listener // MapUtil.QuickChangeBlockAt(b.getLocation(), Material.CARPET.getId(), (byte)14); // } // } - _phaseTimer = 0; + _phaseTimer = 11; } // if(_phaseTimer == 0) // { From 9e92a3a68d23e45290347125cbc1e3990f812829 Mon Sep 17 00:00:00 2001 From: fooify Date: Thu, 6 Aug 2015 09:44:00 -0700 Subject: [PATCH 007/219] more changes (not really ready for testing yet though...) --- .../arcade/game/games/monstermaze/Maze.java | 86 ++++++++++++++++--- .../games/monstermaze/MazeMobWaypoint.java | 6 ++ 2 files changed, 78 insertions(+), 14 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index afac944d1..fe9cfee17 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -19,7 +19,6 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.entity.Zombie; -import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; @@ -34,7 +33,7 @@ import mineplex.core.common.util.UtilTime; import mineplex.core.hologram.Hologram; import mineplex.core.hologram.Hologram.HologramTarget; import mineplex.core.recharge.Recharge; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.game.games.monstermaze.MazeMobWaypoint.CardinalDirection; public class Maze implements Listener { @@ -43,6 +42,7 @@ public class Maze implements Listener private ArrayList _map; private ArrayList _goals; private HashSet _waypoints; + private HashSet _disabledWaypoints; // TODO x) private ArrayList _borders; private SafePad _safePad = null; @@ -101,7 +101,6 @@ public class Maze implements Listener private void bump() { - if(_ents.size() <= 0) return; //Hit Players for (Player player : Host.GetPlayers(true)) { @@ -160,19 +159,54 @@ public class Maze implements Listener if (south != null) nextBlock.add(south); if (east != null) nextBlock.add(east); if (west != null) nextBlock.add(west); - - //Random Direction - if (!nextBlock.isEmpty()) + + if(!nextBlock.isEmpty() && data.getValue().Direction != null) // they can do a uturn if they're stuck { - data.getValue().Target = UtilAlg.Random(nextBlock).getLocation().add(0.5, 0, 0.5); - UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); + if(data.getValue().Direction == CardinalDirection.NORTH) + { + nextBlock.remove(north); + } + else if(data.getValue().Direction == CardinalDirection.SOUTH) + { + nextBlock.remove(south); + } + else if(data.getValue().Direction == CardinalDirection.WEST) + { + nextBlock.remove(west); + } + else if(data.getValue().Direction == CardinalDirection.EAST) + { + nextBlock.remove(east); + } } + + //Random Direction + Location nextLoc = UtilAlg.Random(nextBlock).getLocation(); + data.getValue().Target = nextLoc.clone().add(0.5, 0, 0.5); + if(north != null && nextLoc.equals(north)) + { + data.getValue().Direction = CardinalDirection.NORTH; + } + else if(north != null && nextLoc.equals(south.getLocation())) + { + data.getValue().Direction = CardinalDirection.SOUTH; + } + else if(north != null && nextLoc.equals(east.getLocation())) + { + data.getValue().Direction = CardinalDirection.EAST; + } + else if(north != null && nextLoc.equals(west.getLocation())) + { + data.getValue().Direction = CardinalDirection.WEST; + } + UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); + } - if(_safePad != null && _safePad.isOn(data.getKey())) - { - UtilAction.velocity(data.getKey(), UtilAlg.getTrajectory(data.getKey().getLocation(), _safePad.getLocation()), 1, false, 0, 0.5, 1.2, true); - } +// if(_safePad != null && _safePad.isOn(data.getKey())) +// { +// UtilAction.velocity(data.getKey(), UtilAlg.getTrajectory(data.getKey().getLocation(), _safePad.getLocation()), 1, false, 0, 0.5, 1.2, true); +// } //Timeout Move if (UtilMath.offset(data.getKey().getLocation(), data.getValue().Last) > 0.1) @@ -210,6 +244,25 @@ public class Maze implements Listener return cur; } + /* + * [11:28:29 ERROR]: Could not pass event UpdateEvent to Arcade v0.1 +org.bukkit.event.EventException + at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] + at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] + at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] + at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] + at mineplex.core.updater.Updater.run(Updater.java:24) [Arcade.jar:?] + at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftTask.run(CraftTask.java:71) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] + at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] + at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:641) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] + at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:275) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] + at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] + at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] + at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] +Caused by: java.lang.NullPointerException + + */ + public void spawn() { //Spawn @@ -249,6 +302,11 @@ public class Maze implements Listener _safePad = new SafePad(Host, this, UtilAlg.Random(_goals).clone().subtract(0,1,0)); _safePad.build(); UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); + Location holoLoc = _safePad.getLocation().clone(); + holoLoc.add(0, 2, 0); + _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD!"); + _holo.setHologramTarget(HologramTarget.BLACKLIST); + _holo.start(); _phaseTimer = 11; return; } @@ -309,8 +367,8 @@ public class Maze implements Listener _safePad.build(); UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); Location holoLoc = _safePad.getLocation().clone(); - holoLoc.add(0, 1.5, 0); - _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD"); + holoLoc.add(0, 2, 0); + _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD!"); _holo.setHologramTarget(HologramTarget.BLACKLIST); _holo.start(); // for(Block b : _waypoints) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java index 7db60f73f..4688e9b6b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java @@ -7,6 +7,7 @@ public class MazeMobWaypoint public Location Last; public Location Target; public long Time; + public CardinalDirection Direction; public MazeMobWaypoint(Location last) { @@ -14,4 +15,9 @@ public class MazeMobWaypoint Target = null; Time = System.currentTimeMillis(); } + + public enum CardinalDirection + { + NORTH, SOUTH, EAST, WEST // such order much not care + } } From 42868b2a0a9a012f615614e8e4e47d5a0c16377c Mon Sep 17 00:00:00 2001 From: fooify Date: Thu, 6 Aug 2015 10:09:13 -0700 Subject: [PATCH 008/219] trying to merge... --- .../src/mineplex/core/game/GameDisplay.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index b74b5db21..e88c38cb9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -51,7 +51,7 @@ public enum GameDisplay SquidShooter("Squid Shooter", Material.FIREWORK_CHARGE, (byte)0, GameCategory.ARCADE, 43), Stacker("Super Stacker", Material.BOWL, (byte)0, GameCategory.ARCADE, 42), SurvivalGames("Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.SURVIVAL, 22), - SurvivalGamesTeams("Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.TEAM_VARIANT, 23), + SurvivalGamesTeams("Survival Games Teams", "Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.TEAM_VARIANT, 23), Tug("Tug of Wool", Material.WHEAT, (byte)0, GameCategory.ARCADE, 44), TurfWars("Turf Wars", Material.STAINED_CLAY, (byte)14, GameCategory.ARCADE, 45), UHC("Ultra Hardcore", Material.GOLDEN_APPLE, (byte)0, GameCategory.SURVIVAL, 46), @@ -61,8 +61,8 @@ public enum GameDisplay Build("Master Builders", Material.WOOD, (byte)0, GameCategory.CLASSICS, 50), Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51), - Skywars("Skywars", "Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52), - SkywarsTeams("Skywars Teams", "Skywars",Material.FEATHER, (byte)5, GameCategory.TEAM_VARIANT, 53), + Skywars("Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52), + SkywarsTeams("Skywars Teams", "Skywars", Material.FEATHER, (byte)0, GameCategory.TEAM_VARIANT, 53), MonsterMaze("Monster Maze", Material.ROTTEN_FLESH, (byte)0, GameCategory.ARCADE, 54), Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999); @@ -127,4 +127,10 @@ public enum GameDisplay return null; } + //May need to actually add this to each game individually, but for now, LobbyName works fine + public String getKitGameName() + { + return _lobbyName; + } + } \ No newline at end of file From f27ca9ba719e4743114955ca33b59c2bb6bba0eb Mon Sep 17 00:00:00 2001 From: fooify Date: Thu, 6 Aug 2015 10:13:34 -0700 Subject: [PATCH 009/219] still working on merge --- Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index e88c38cb9..d8fb8b9f9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -63,7 +63,6 @@ public enum GameDisplay Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51), Skywars("Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52), SkywarsTeams("Skywars Teams", "Skywars", Material.FEATHER, (byte)0, GameCategory.TEAM_VARIANT, 53), - MonsterMaze("Monster Maze", Material.ROTTEN_FLESH, (byte)0, GameCategory.ARCADE, 54), Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999); From 67bbd3a6056e923fed5ff1a3f758792d8cbb5c2c Mon Sep 17 00:00:00 2001 From: fooify Date: Thu, 6 Aug 2015 10:16:37 -0700 Subject: [PATCH 010/219] kk did merge --- Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index d8fb8b9f9..e88c38cb9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -63,6 +63,7 @@ public enum GameDisplay Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51), Skywars("Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52), SkywarsTeams("Skywars Teams", "Skywars", Material.FEATHER, (byte)0, GameCategory.TEAM_VARIANT, 53), + MonsterMaze("Monster Maze", Material.ROTTEN_FLESH, (byte)0, GameCategory.ARCADE, 54), Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999); From f70b1231ab8cd246265093cc3b43eb6727f90224 Mon Sep 17 00:00:00 2001 From: fooify Date: Fri, 7 Aug 2015 10:32:31 -0700 Subject: [PATCH 011/219] AI fixes and such for Monster Maze --- .../arcade/game/games/monstermaze/Maze.java | 40 +++++++++++-------- .../game/games/monstermaze/MonsterMaze.java | 3 +- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index fe9cfee17..c0470f1d2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -13,6 +13,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import org.bukkit.entity.Creeper; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -23,6 +24,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; @@ -160,42 +162,42 @@ public class Maze implements Listener if (east != null) nextBlock.add(east); if (west != null) nextBlock.add(west); - if(!nextBlock.isEmpty() && data.getValue().Direction != null) // they can do a uturn if they're stuck + if(nextBlock.size() > 1 && data.getValue().Direction != null) // they can do a uturn if they're stuck { if(data.getValue().Direction == CardinalDirection.NORTH) { - nextBlock.remove(north); + nextBlock.remove(south); } else if(data.getValue().Direction == CardinalDirection.SOUTH) { - nextBlock.remove(south); + nextBlock.remove(north); } else if(data.getValue().Direction == CardinalDirection.WEST) { - nextBlock.remove(west); + nextBlock.remove(east); } else if(data.getValue().Direction == CardinalDirection.EAST) { - nextBlock.remove(east); + nextBlock.remove(west); } } //Random Direction Location nextLoc = UtilAlg.Random(nextBlock).getLocation(); data.getValue().Target = nextLoc.clone().add(0.5, 0, 0.5); - if(north != null && nextLoc.equals(north)) + if(north != null && nextLoc.equals(north.getLocation())) { data.getValue().Direction = CardinalDirection.NORTH; } - else if(north != null && nextLoc.equals(south.getLocation())) + else if(south != null && nextLoc.equals(south.getLocation())) { data.getValue().Direction = CardinalDirection.SOUTH; } - else if(north != null && nextLoc.equals(east.getLocation())) + else if(east != null && nextLoc.equals(east.getLocation())) { data.getValue().Direction = CardinalDirection.EAST; } - else if(north != null && nextLoc.equals(west.getLocation())) + else if(west != null && nextLoc.equals(west.getLocation())) { data.getValue().Direction = CardinalDirection.WEST; } @@ -268,7 +270,7 @@ Caused by: java.lang.NullPointerException //Spawn //if (Host.IsLive()) - if(_ents.size() >= 35) return; + if(_ents.size() >= 100) return; Location loc = UtilAlg.Random(_spawns); @@ -283,6 +285,10 @@ Caused by: java.lang.NullPointerException { ent = loc.getWorld().spawn(loc, Snowman.class); } + else if(Host.getMonsterType() == EntityType.CREEPER) + { + ent = loc.getWorld().spawn(loc, Creeper.class); + } else { ent = loc.getWorld().spawn(loc, Zombie.class); @@ -304,7 +310,7 @@ Caused by: java.lang.NullPointerException UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); Location holoLoc = _safePad.getLocation().clone(); holoLoc.add(0, 2, 0); - _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD!"); + _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD!"); _holo.setHologramTarget(HologramTarget.BLACKLIST); _holo.start(); _phaseTimer = 11; @@ -320,7 +326,7 @@ Caused by: java.lang.NullPointerException _oldSafePad.setGlassData((byte)4); _oldSafePad.turnOffBeacon(); } - Host.Announce(C.cAqua + C.Bold + "Quick! Go step on the safe pad or you'll die!"); + Host.Announce(C.cAqua + C.Bold + "Quick! Go step on the safe pad or you'll take damage!"); } if(_phaseTimer == 9) { @@ -341,14 +347,16 @@ Caused by: java.lang.NullPointerException { if(_safePad.isOn(p)) { - UtilPlayer.message(p, C.cGreen + C.Bold + "You got onto the safe pad, so you didn't die."); + //UtilPlayer.message(p, C.cGreen + C.Bold + "You got onto the safe pad, so you didn't take damage."); + UtilPlayer.message(p, F.main("Game", "You got on the safe pad, so no additional damage was dealt to your body.")); } else { Host.Manager.GetDamage().NewDamageEvent(p, null, null, - DamageCause.CUSTOM, 500, false, false, false, - "Game", "Missed the goal"); - UtilPlayer.message(p, C.cRed + C.Bold + "Oh no! You didn't get to the safe pad in time."); + DamageCause.CUSTOM, 10, false, false, false, + "Game", "Map damage"); + //UtilPlayer.message(p, C.cRed + C.Bold + "Oh no! You didn't get to the safe pad in time."); + UtilPlayer.message(p, F.main("Game", "You took damage because you weren't on the safe pad.")); } } //_goalPlayers.clear(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index deac0f7b7..7cfb118ee 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -65,7 +65,8 @@ public class MonsterMaze extends SoloGame { if(event.GetState() == GameState.Prepare) { - if(WorldData.MapName.contains("Monster")) _monsterType = EntityType.ZOMBIE; + if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER; + _monsterType = EntityType.SNOWMAN; _maze = new Maze(this, WorldData.GetDataLocs("GRAY"), WorldData.GetDataLocs("YELLOW"), WorldData.GetDataLocs("RED")); UtilServer.getServer().getPluginManager().registerEvents(_maze, getArcadeManager().getPlugin()); } From db521668a97bb09a1e9a4c1f3256e3a8bf089a81 Mon Sep 17 00:00:00 2001 From: fooify Date: Fri, 7 Aug 2015 14:20:15 -0700 Subject: [PATCH 012/219] more changes! it's getting pretty cool now x) --- .../arcade/game/games/monstermaze/Maze.java | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index c0470f1d2..e3e7c559e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -31,6 +31,7 @@ import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; import mineplex.core.hologram.Hologram; import mineplex.core.hologram.Hologram.HologramTarget; @@ -96,6 +97,7 @@ public class Maze implements Listener if (Host.IsLive()) { //checkGoal(); + UtilTextTop.display(C.cAqua + C.Bold + "Get to the safe pad or you'll take damage!", Host.GetPlayers(false).toArray(new Player[Host.GetPlayers(false).size()])); move(); bump(); } @@ -308,11 +310,11 @@ Caused by: java.lang.NullPointerException _safePad = new SafePad(Host, this, UtilAlg.Random(_goals).clone().subtract(0,1,0)); _safePad.build(); UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); - Location holoLoc = _safePad.getLocation().clone(); - holoLoc.add(0, 2, 0); - _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD!"); - _holo.setHologramTarget(HologramTarget.BLACKLIST); - _holo.start(); +// Location holoLoc = _safePad.getLocation().clone(); +// holoLoc.add(0, 2, 0); +// _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD!"); +// _holo.setHologramTarget(HologramTarget.BLACKLIST); +// _holo.start(); _phaseTimer = 11; return; } @@ -326,7 +328,6 @@ Caused by: java.lang.NullPointerException _oldSafePad.setGlassData((byte)4); _oldSafePad.turnOffBeacon(); } - Host.Announce(C.cAqua + C.Bold + "Quick! Go step on the safe pad or you'll take damage!"); } if(_phaseTimer == 9) { @@ -347,8 +348,6 @@ Caused by: java.lang.NullPointerException { if(_safePad.isOn(p)) { - //UtilPlayer.message(p, C.cGreen + C.Bold + "You got onto the safe pad, so you didn't take damage."); - UtilPlayer.message(p, F.main("Game", "You got on the safe pad, so no additional damage was dealt to your body.")); } else { @@ -356,15 +355,15 @@ Caused by: java.lang.NullPointerException DamageCause.CUSTOM, 10, false, false, false, "Game", "Map damage"); //UtilPlayer.message(p, C.cRed + C.Bold + "Oh no! You didn't get to the safe pad in time."); - UtilPlayer.message(p, F.main("Game", "You took damage because you weren't on the safe pad.")); + UtilPlayer.message(p, F.main("Game", C.cRed + "You took damage because you weren't on the safe pad!")); } } //_goalPlayers.clear(); - if(_holo != null) - { - _holo.stop(); - _holo = null; - } +// if(_holo != null) +// { +// _holo.stop(); +// _holo = null; +// } _oldSafePad = _safePad; _oldSafePad.turnOffBeacon(); @@ -374,11 +373,11 @@ Caused by: java.lang.NullPointerException _safePad = new SafePad(Host, this, UtilAlg.Random(_goals).clone().subtract(0,1,0)); _safePad.build(); UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); - Location holoLoc = _safePad.getLocation().clone(); - holoLoc.add(0, 2, 0); - _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD!"); - _holo.setHologramTarget(HologramTarget.BLACKLIST); - _holo.start(); +// Location holoLoc = _safePad.getLocation().clone(); +// holoLoc.add(0, 2, 0); +// _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD!"); +// _holo.setHologramTarget(HologramTarget.BLACKLIST); +// _holo.start(); // for(Block b : _waypoints) // { // if(b.getRelative(BlockFace.DOWN).getType().equals(Material.QUARTZ_BLOCK)) From c6ec60700c76e3c34bae8bf4c3b1000895806f35 Mon Sep 17 00:00:00 2001 From: fooify Date: Tue, 11 Aug 2015 09:04:45 -0700 Subject: [PATCH 013/219] monster maze is really working now! :D --- .../arcade/game/games/monstermaze/Maze.java | 406 ++++++++++-------- .../games/monstermaze/MazeMobWaypoint.java | 4 +- .../game/games/monstermaze/MonsterMaze.java | 20 +- 3 files changed, 241 insertions(+), 189 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index e3e7c559e..5733437e7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -11,6 +11,7 @@ import org.bukkit.Color; import org.bukkit.FireworkEffect; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Creeper; @@ -27,14 +28,14 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; -import mineplex.core.hologram.Hologram; -import mineplex.core.hologram.Hologram.HologramTarget; import mineplex.core.recharge.Recharge; import nautilus.game.arcade.game.games.monstermaze.MazeMobWaypoint.CardinalDirection; @@ -45,20 +46,16 @@ public class Maze implements Listener private ArrayList _map; private ArrayList _goals; private HashSet _waypoints; - private HashSet _disabledWaypoints; // TODO x) + private HashSet _disabledWaypoints; private ArrayList _borders; private SafePad _safePad = null; private SafePad _oldSafePad = null; - private Hologram _holo; + private ArrayList _playersOnPad = new ArrayList(); - //private ArrayList _goalPlayers = new ArrayList(); // players who got the goal - - private int _phaseTimer = -1; // counts down - /* - * 10-0 - get to the goal... - */ + private int _phaseTimer = -1; + private int _padDecayTimer = -1; private HashMap _ents = new HashMap(); @@ -69,9 +66,9 @@ public class Maze implements Listener _map = map; _spawns = spawns; _goals = goals; - //_borders = borders; _waypoints = new HashSet(); + _disabledWaypoints = new HashSet(); for (Location loc : _map) { @@ -92,14 +89,31 @@ public class Maze implements Listener } } - public void Update() + public void update() { if (Host.IsLive()) { //checkGoal(); - UtilTextTop.display(C.cAqua + C.Bold + "Get to the safe pad or you'll take damage!", Host.GetPlayers(false).toArray(new Player[Host.GetPlayers(false).size()])); + checkPlayersOnSafePad(); move(); bump(); + if(_phaseTimer <= -1) + { + UtilTextTop.display(C.cAqua + C.Bold + "Be the first player to get to the safe pad!", Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(false).size()])); + } + else + { + for(Player p : Host.GetPlayers(true)) + { + if(_safePad.isOn(p)) + { + UtilTextTop.display(C.cGreen + C.Bold + "Stay on the safe pad for " + _phaseTimer + " more seconds!", p); + } + else { + UtilTextTop.display(C.cRed + C.Bold + "You have " + _phaseTimer + " seconds to get to the safe pad!", p); + } + } + } } } @@ -143,7 +157,7 @@ public class Maze implements Listener //New or Fallen if (data.getValue().Target == null || data.getKey().getLocation().getY() < data.getValue().Target.getBlockY()) { - Location loc = UtilAlg.findClosest(data.getKey().getLocation(), _spawns); + Location loc = UtilAlg.findClosest(data.getKey().getLocation(), _map); data.getKey().teleport(loc); data.getValue().Target = loc; @@ -164,7 +178,14 @@ public class Maze implements Listener if (east != null) nextBlock.add(east); if (west != null) nextBlock.add(west); - if(nextBlock.size() > 1 && data.getValue().Direction != null) // they can do a uturn if they're stuck + if(nextBlock.size() == 0) + { + System.err.println("ENTITY HAS NO DIRECTION TO GO, removing entity"); + entIterator.remove(); + + } + + if(nextBlock.size() > 1 && data.getValue().Direction != CardinalDirection.NULL) // they can do a uturn if they're stuck { if(data.getValue().Direction == CardinalDirection.NORTH) { @@ -207,11 +228,6 @@ public class Maze implements Listener } -// if(_safePad != null && _safePad.isOn(data.getKey())) -// { -// UtilAction.velocity(data.getKey(), UtilAlg.getTrajectory(data.getKey().getLocation(), _safePad.getLocation()), 1, false, 0, 0.5, 1.2, true); -// } - //Timeout Move if (UtilMath.offset(data.getKey().getLocation(), data.getValue().Last) > 0.1) data.getValue().Time = System.currentTimeMillis(); @@ -247,200 +263,238 @@ public class Maze implements Listener return cur; } - - /* - * [11:28:29 ERROR]: Could not pass event UpdateEvent to Arcade v0.1 -org.bukkit.event.EventException - at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] - at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] - at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] - at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] - at mineplex.core.updater.Updater.run(Updater.java:24) [Arcade.jar:?] - at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftTask.run(CraftTask.java:71) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] - at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] - at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:641) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] - at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:275) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] - at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] - at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] - at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-gb748d57] -Caused by: java.lang.NullPointerException - - */ - public void spawn() + public void fillSpawn(int numToSpawn) { - //Spawn - //if (Host.IsLive()) - - if(_ents.size() >= 100) return; + System.out.println("spawning " + numToSpawn + " entities on map"); - Location loc = UtilAlg.Random(_spawns); - - Host.CreatureAllowOverride = true; - Entity ent; - //Snowman ent = loc.getWorld().spawn(loc, Snowman.class); - if(Host.getMonsterType() == EntityType.ZOMBIE) - { - ent = loc.getWorld().spawn(loc, Zombie.class); - } - else if(Host.getMonsterType() == EntityType.SNOWMAN) - { - ent = loc.getWorld().spawn(loc, Snowman.class); - } - else if(Host.getMonsterType() == EntityType.CREEPER) - { - ent = loc.getWorld().spawn(loc, Creeper.class); - } - else - { - ent = loc.getWorld().spawn(loc, Zombie.class); - } + int spawned = 0; - Host.CreatureAllowOverride = false; - - UtilEnt.Vegetate(ent); - UtilEnt.ghost(ent, true, false); - _ents.put(ent, new MazeMobWaypoint(ent.getLocation())); + while(spawned <= numToSpawn) + { + Location loc = UtilAlg.Random(_map); + Host.CreatureAllowOverride = true; + Entity ent = null; + if(Host.getMonsterType() == EntityType.ZOMBIE) + { + ent = loc.getWorld().spawn(loc, Zombie.class); + } + else if(Host.getMonsterType() == EntityType.SNOWMAN) + { + ent = loc.getWorld().spawn(loc, Snowman.class); + } + else if(Host.getMonsterType() == EntityType.CREEPER) + { + ent = loc.getWorld().spawn(loc, Creeper.class); + } + else + { + ent = loc.getWorld().spawn(loc, Zombie.class); + } + + Host.CreatureAllowOverride = false; + + UtilEnt.Vegetate(ent); + UtilEnt.ghost(ent, true, false); + _ents.put(ent, new MazeMobWaypoint(ent.getLocation())); + spawned++; + } } - + + public void spawn(int numToSpawn) + { + System.out.println("spawning " + numToSpawn + " entities at spawnpoints"); + Location loc = UtilAlg.Random(_spawns); + + int spawned = 0; + + while(spawned <= numToSpawn) + { + Host.CreatureAllowOverride = true; + Entity ent = null; + if(Host.getMonsterType() == EntityType.ZOMBIE) + { + ent = loc.getWorld().spawn(loc, Zombie.class); + } + else if(Host.getMonsterType() == EntityType.SNOWMAN) + { + ent = loc.getWorld().spawn(loc, Snowman.class); + } + else if(Host.getMonsterType() == EntityType.CREEPER) + { + ent = loc.getWorld().spawn(loc, Creeper.class); + } + else + { + ent = loc.getWorld().spawn(loc, Zombie.class); + } + + Host.CreatureAllowOverride = false; + + UtilEnt.Vegetate(ent); + UtilEnt.ghost(ent, true, false); + _ents.put(ent, new MazeMobWaypoint(ent.getLocation())); + spawned++; + } + } + + public void spawnSafePad() + { + System.out.println("creating safe pad"); + if(_safePad != null) + { + _oldSafePad = _safePad; + _oldSafePad.turnOffBeacon(); + _padDecayTimer = 5; + } + ArrayList goals = new ArrayList(_goals); + if(_oldSafePad != null) goals.remove(_oldSafePad.getLocation()); + + if(_disabledWaypoints.size() > 0) + { + for(Block b : _disabledWaypoints) + { + System.out.println("remove"); + _waypoints.add(b); + } + _disabledWaypoints.clear(); + } + + _safePad = new SafePad(Host, this, UtilAlg.Random(goals).clone().subtract(0,1,0)); // maybe don't need to clone() + _safePad.build(); + UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); + + Iterator iter = _waypoints.iterator(); + while (iter.hasNext()) { + Block b = iter.next(); + if(UtilBlock.getInBoundingBox(_safePad.getLocation().clone().add(2, 0, 2), _safePad.getLocation().clone().add(-2, 0, -2)).contains(b.getRelative(BlockFace.DOWN))) + { + System.out.println("block"); + _disabledWaypoints.add(b); + iter.remove(); + } + } + + Iterator it = _ents.keySet().iterator(); + while (it.hasNext()) { + Entity e = it.next(); + if(_safePad.isOn(e)) + { + System.out.println("ent"); + _ents.remove(_ents.get(e)); + it.remove(); + e.remove(); + } + } + } + + public void decrementSafePadTime() + { + if(_padDecayTimer == -1) return; + + _padDecayTimer--; + + if(_oldSafePad != null) + { + if(_padDecayTimer == 4) + { + _oldSafePad.setGlassData((byte)4); + _oldSafePad.turnOffBeacon(); + } + else if(_padDecayTimer == 3) + { + _oldSafePad.setGlassData((byte)1); + } + else if(_padDecayTimer == 2) + { + _oldSafePad.setGlassData((byte)14); + } + else if(_padDecayTimer == 1) + { + _oldSafePad.destroy(); + _oldSafePad = null; + } + } + if(_padDecayTimer == 1) + { + _padDecayTimer = -1; + } + } + public void decrementPhaseTime() { - if(_phaseTimer == -1) + if(_phaseTimer == -1) return; + /*if(_phaseTimer == -1) { _safePad = new SafePad(Host, this, UtilAlg.Random(_goals).clone().subtract(0,1,0)); _safePad.build(); UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); -// Location holoLoc = _safePad.getLocation().clone(); -// holoLoc.add(0, 2, 0); -// _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD!"); -// _holo.setHologramTarget(HologramTarget.BLACKLIST); -// _holo.start(); + + Iterator iter = _waypoints.iterator(); + while (iter.hasNext()) { + Block b = iter.next(); + if(UtilBlock.getInBoundingBox(_safePad.getLocation().clone().add(2, 0, 2), _safePad.getLocation().clone().add(-2, 0, -2)).contains(b.getRelative(BlockFace.DOWN))) + { + System.out.println("block"); + _disabledWaypoints.add(b); + iter.remove(); + } + } + _phaseTimer = 11; return; - } + }*/ _phaseTimer--; - - if(_phaseTimer == 10) - { - if(_oldSafePad != null) - { - _oldSafePad.setGlassData((byte)4); - _oldSafePad.turnOffBeacon(); - } - } - if(_phaseTimer == 9) - { - if(_oldSafePad != null) _oldSafePad.setGlassData((byte)1); - } - if(_phaseTimer == 8) - { - if(_oldSafePad != null) _oldSafePad.setGlassData((byte)14); - } - if(_phaseTimer == 7) - { - if(_oldSafePad != null) _oldSafePad.destroy(); - _oldSafePad = null; - } if(_phaseTimer == 0) { for(Player p : Host.GetPlayers(true)) { if(_safePad.isOn(p)) { + // maybe send them a happy message? =) + UtilPlayer.message(p, F.main("Game", C.cGreen + "Since you were on the safe pad, you didn't die!")); } else { Host.Manager.GetDamage().NewDamageEvent(p, null, null, - DamageCause.CUSTOM, 10, false, false, false, + DamageCause.CUSTOM, 500, false, false, false, "Game", "Map damage"); - //UtilPlayer.message(p, C.cRed + C.Bold + "Oh no! You didn't get to the safe pad in time."); - UtilPlayer.message(p, F.main("Game", C.cRed + "You took damage because you weren't on the safe pad!")); + UtilPlayer.message(p, F.main("Game", C.cRed + "You died because you weren't on the safe pad!")); } } - //_goalPlayers.clear(); -// if(_holo != null) -// { -// _holo.stop(); -// _holo = null; -// } - - _oldSafePad = _safePad; - _oldSafePad.turnOffBeacon(); - ArrayList goals = new ArrayList(_goals); - goals.remove(_oldSafePad.getLocation()); - - _safePad = new SafePad(Host, this, UtilAlg.Random(_goals).clone().subtract(0,1,0)); - _safePad.build(); - UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); -// Location holoLoc = _safePad.getLocation().clone(); -// holoLoc.add(0, 2, 0); -// _holo = new Hologram(Host.getArcadeManager().getHologramManager(), holoLoc, C.cAqua + C.Bold + "SAFE PAD!"); -// _holo.setHologramTarget(HologramTarget.BLACKLIST); -// _holo.start(); -// for(Block b : _waypoints) -// { -// if(b.getRelative(BlockFace.DOWN).getType().equals(Material.QUARTZ_BLOCK)) -// { -// MapUtil.QuickChangeBlockAt(b.getLocation(), Material.CARPET.getId(), (byte)14); -// } -// } - _phaseTimer = 11; + spawn(15); + spawnSafePad(); + _playersOnPad.clear(); + _phaseTimer = -1; } -// if(_phaseTimer == 0) -// { -//// for(Block b : _waypoints) -//// { -//// if(b.getType().equals(Material.CARPET) && b.getData() == (byte)14) -//// { -//// MapUtil.QuickChangeBlockAt(b.getLocation(), Material.AIR); -//// } -//// } -// _phaseTimer = 11; -// } } - /*public void checkGoal() + public void checkPlayersOnSafePad() { if(_safePad == null) return; - for(Player pl : Host.GetPlayers(true)) + for(Player p : Host.GetPlayers(true)) { - if(_goalPlayers.contains(pl)) continue; - if(_safePad.isStandingOn(pl)) + if(_safePad.isOn(p) && !_playersOnPad.contains(p)) { - // TODO add sounds - _goalPlayers.add(pl); + _playersOnPad.add(p); + if(_playersOnPad.size() == 1) // first player + { + UtilTextMiddle.display(C.cGold + C.Bold + "AWESOME!", C.cGold + "You were the first to make it to the safe pad!", p); + p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); + _phaseTimer = 21; + Host.Announce(C.cRed + C.Bold + p.getName() + " was the first to make it to the safe pad! Everyone not on the safe pad in 20 seconds will die!"); + } else // not the first + { + p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); + UtilTextMiddle.display(C.cGreen + C.Bold + "Great!", C.cGreen + "You made it to the safe pad!"); + } } } - }*/ + } -// @EventHandler -// public void carpetDamage(UpdateEvent event) -// { -// if(event.getType() != UpdateType.SEC) return; -// if(!Host.IsLive()) return; -// for(Player p : Host.GetPlayers(true)) -// { -// Block pb = p.getLocation().getBlock(); -// boolean isTouchingCarpet = false; -// for(Block b : UtilBlock.getInRadius(pb, 0.66).keySet()) -// { -// if(b.getType().equals(Material.CARPET) && b.getData() == (byte)14) -// { -// isTouchingCarpet = true; -// } -// } -// if(isTouchingCarpet) -// { -// UtilPlayer.message(p, F.main("Game", "Get back onto the safe pad!")); -// Host.Manager.GetDamage().NewDamageEvent(p, null, null, -// DamageCause.CUSTOM, 5, false, false, false, -// "Red Carpet", "Exposure to Red Carpet"); -// } -// } -// } - - public Set getMonsters() { + public Set getMonsters() + { return _ents.keySet(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java index 4688e9b6b..4238ebba2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MazeMobWaypoint.java @@ -7,7 +7,7 @@ public class MazeMobWaypoint public Location Last; public Location Target; public long Time; - public CardinalDirection Direction; + public CardinalDirection Direction = CardinalDirection.NULL; public MazeMobWaypoint(Location last) { @@ -18,6 +18,6 @@ public class MazeMobWaypoint public enum CardinalDirection { - NORTH, SOUTH, EAST, WEST // such order much not care + NORTH, SOUTH, EAST, WEST, NULL // such order much not care } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index 7cfb118ee..4a8552223 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -57,7 +57,7 @@ public class MonsterMaze extends SoloGame { if(event.getType() != UpdateType.TICK) return; if(_maze == null) return; - _maze.Update(); + _maze.update(); } @EventHandler @@ -65,10 +65,15 @@ public class MonsterMaze extends SoloGame { if(event.GetState() == GameState.Prepare) { - if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER; - _monsterType = EntityType.SNOWMAN; + //if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER; + _monsterType = EntityType.SNOWMAN; // TODO map-specific monster type _maze = new Maze(this, WorldData.GetDataLocs("GRAY"), WorldData.GetDataLocs("YELLOW"), WorldData.GetDataLocs("RED")); UtilServer.getServer().getPluginManager().registerEvents(_maze, getArcadeManager().getPlugin()); + _maze.fillSpawn(150); + } else if(event.GetState() == GameState.Live) + { + + _maze.spawnSafePad(); } } @@ -87,14 +92,7 @@ public class MonsterMaze extends SoloGame if(event.getType() != UpdateType.SEC) return; if(!IsLive()) return; _maze.decrementPhaseTime(); - } - - @EventHandler - public void SpawnMob(UpdateEvent event) - { - if(event.getType() != UpdateType.SEC) return; - if(GetState() != GameState.Live) return; - _maze.spawn(); + _maze.decrementSafePadTime(); } @EventHandler From 356060eedc42ee5a42303c7896aeb789d2058302 Mon Sep 17 00:00:00 2001 From: fooify Date: Tue, 11 Aug 2015 09:41:26 -0700 Subject: [PATCH 014/219] more amazing changes --- .../nautilus/game/arcade/game/games/monstermaze/Maze.java | 4 ++-- .../game/arcade/game/games/monstermaze/MonsterMaze.java | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index 5733437e7..90913576c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -482,12 +482,12 @@ public class Maze implements Listener { UtilTextMiddle.display(C.cGold + C.Bold + "AWESOME!", C.cGold + "You were the first to make it to the safe pad!", p); p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); - _phaseTimer = 21; + _phaseTimer = 16; Host.Announce(C.cRed + C.Bold + p.getName() + " was the first to make it to the safe pad! Everyone not on the safe pad in 20 seconds will die!"); } else // not the first { p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); - UtilTextMiddle.display(C.cGreen + C.Bold + "Great!", C.cGreen + "You made it to the safe pad!"); + UtilTextMiddle.display(C.cGreen + C.Bold + "Great!", C.cGreen + "Stay on the safe pad!", p); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index 4a8552223..4bf648938 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -39,9 +39,8 @@ public class MonsterMaze extends SoloGame new String[] { - "stuff happens and you have to do stuff so yeah", - "", - "have fun i guess", + "Get to the safe pad, but avoid the monsters!", + "You can't jump.", }); this.DamagePvP = false; @@ -69,7 +68,7 @@ public class MonsterMaze extends SoloGame _monsterType = EntityType.SNOWMAN; // TODO map-specific monster type _maze = new Maze(this, WorldData.GetDataLocs("GRAY"), WorldData.GetDataLocs("YELLOW"), WorldData.GetDataLocs("RED")); UtilServer.getServer().getPluginManager().registerEvents(_maze, getArcadeManager().getPlugin()); - _maze.fillSpawn(150); + _maze.fillSpawn(135); } else if(event.GetState() == GameState.Live) { From 9343bc004892ae54040ae95a054d0580d9e5e238 Mon Sep 17 00:00:00 2001 From: fooify Date: Mon, 17 Aug 2015 14:53:59 -0700 Subject: [PATCH 015/219] trying to merge --- .../Mineplex.Core/src/mineplex/core/game/GameDisplay.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index e88c38cb9..37d826e6c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -27,7 +27,7 @@ public enum GameDisplay HideSeek("Block Hunt", Material.GRASS, (byte)0, GameCategory.CLASSICS, 20), HoleInTheWall("Hole in the Wall", Material.STAINED_GLASS, (byte) 2, GameCategory.ARCADE, 52), Horse("Horseback", Material.IRON_BARDING, (byte)0, GameCategory.ARCADE, 21), - Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 53), + Micro("Micro Battle", Material.LAVA_BUCKET, (byte)0, GameCategory.ARCADE, 24), MilkCow("Milk the Cow", Material.MILK_BUCKET, (byte)0, GameCategory.ARCADE, 27), MineStrike("MineStrike", Material.TNT, (byte)0, GameCategory.CHAMPIONS, 25),// Temp set to CHAMPIONS to fix UI bug @@ -63,7 +63,8 @@ public enum GameDisplay Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51), Skywars("Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52), SkywarsTeams("Skywars Teams", "Skywars", Material.FEATHER, (byte)0, GameCategory.TEAM_VARIANT, 53), - MonsterMaze("Monster Maze", Material.ROTTEN_FLESH, (byte)0, GameCategory.ARCADE, 54), + + Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 54), Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999); From d489b3173873a37c25d4e7ae3ca62b3058703535 Mon Sep 17 00:00:00 2001 From: fooify Date: Mon, 17 Aug 2015 16:27:28 -0700 Subject: [PATCH 016/219] merge --- Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index 37d826e6c..652b7cfdb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -63,6 +63,7 @@ public enum GameDisplay Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51), Skywars("Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52), SkywarsTeams("Skywars Teams", "Skywars", Material.FEATHER, (byte)0, GameCategory.TEAM_VARIANT, 53), + MonsterMaze("Monster Maze", Material.ROTTEN_FLESH, (byte)0, GameCategory.ARCADE, 55), Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 54), From 15eba5b491d806d6a5c67b4dd9ecbd0ce9f2fc0c Mon Sep 17 00:00:00 2001 From: fooify Date: Tue, 18 Aug 2015 12:22:34 -0700 Subject: [PATCH 017/219] added more y velocity --- .../src/nautilus/game/arcade/game/games/monstermaze/Maze.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index 90913576c..838d5af70 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -134,7 +134,7 @@ public class Maze implements Listener //Velocity //UtilAction.velocity(player, new Vector(1,0,0), 4, false, 0, 1.2, 1.2, true); - UtilAction.velocity(player, UtilAlg.getTrajectory(ent, player), 1, false, 0, 0.5, 1.2, true); + UtilAction.velocity(player, UtilAlg.getTrajectory(ent, player), 1, false, 0, 0.75, 1.2, true); //Damage Event Host.Manager.GetDamage().NewDamageEvent(player, (LivingEntity)ent, null, From 859a7e07d5ca13aa14a214a25058eede83b4988f Mon Sep 17 00:00:00 2001 From: fooify Date: Tue, 18 Aug 2015 16:43:14 -0700 Subject: [PATCH 018/219] added the optional functionality to include air blocks in the util method getInBoundingBox() --- .../src/mineplex/core/common/util/UtilBlock.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java index 43cbfb1d2..d780bb944 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java @@ -516,6 +516,11 @@ public class UtilBlock return false; } public static ArrayList getInBoundingBox(Location a, Location b) + { + return getInBoundingBox(a, b, true); + } + + public static ArrayList getInBoundingBox(Location a, Location b, boolean ignoreAir) { ArrayList blocks = new ArrayList(); @@ -525,8 +530,12 @@ public class UtilBlock { Block block = a.getWorld().getBlockAt(x,y,z); - if (block.getType() != Material.AIR) - blocks.add(block); + if(ignoreAir) + { + if (block.getType() != Material.AIR) + blocks.add(block); + } + else blocks.add(block); } return blocks; From 633cbdabe279a9ec1a57d96d6585f58a6d3754df Mon Sep 17 00:00:00 2001 From: xGamingDudex Date: Thu, 20 Aug 2015 15:42:39 +0200 Subject: [PATCH 019/219] player.isOnGround() is controlled by packets from the player, meaning players can easily fake being on the ground resulting in infinite double jumps. player.getFallDisance() is also reset when isOnGround() returns true, meaning we'll need to manually check if the player is on the ground. Outlines two opposite corners of the entities bounding box, scann all blocks inside, check if any of them are solid and return respectively. --- .../mineplex/core/common/util/UtilEnt.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java index 8b489c952..1cc2d5416 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import net.minecraft.server.v1_7_R4.AxisAlignedBB; import net.minecraft.server.v1_7_R4.EntityBat; import net.minecraft.server.v1_7_R4.EntityCreature; import net.minecraft.server.v1_7_R4.EntityEnderDragon; @@ -26,7 +27,9 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.World; -import org.bukkit.block.BlockFace; +import org.bukkit.block.Block; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; import org.bukkit.entity.Creature; @@ -36,8 +39,6 @@ import org.bukkit.entity.Giant; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.util.Vector; -import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; -import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; public class UtilEnt { @@ -495,10 +496,14 @@ public class UtilEnt public static boolean isGrounded(Entity ent) { - if (ent instanceof CraftEntity) - return ((CraftEntity)ent).getHandle().onGround; - - return UtilBlock.solid(ent.getLocation().getBlock().getRelative(BlockFace.DOWN)); + AxisAlignedBB box = ((CraftEntity)ent).getHandle().boundingBox; + Location bottom_corner_1 = new Location(ent.getWorld(), box.a, ent.getLocation().getY()-0.1, box.c); + Location bottom_corner_2 = new Location(ent.getWorld(), box.d, ent.getLocation().getY()-0.1, box.f); + + for(Block b : UtilBlock.getInBoundingBox(bottom_corner_1, bottom_corner_2)){ + if(UtilBlock.solid(b)) return true; + } + return false; } public static void PlayDamageSound(LivingEntity damagee) From 549435224fe414772e31ef252ddfe94fa9b3a507 Mon Sep 17 00:00:00 2001 From: fooify Date: Mon, 24 Aug 2015 09:58:07 -0700 Subject: [PATCH 020/219] changes to monster maze! --- .../arcade/game/games/monstermaze/Maze.java | 114 +++++++++++++++++- .../game/games/monstermaze/MonsterMaze.java | 22 ++-- 2 files changed, 121 insertions(+), 15 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index 838d5af70..6cedcf3b4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -49,9 +49,16 @@ public class Maze implements Listener private HashSet _disabledWaypoints; private ArrayList _borders; + private Location _safeZoneCenter; + private ArrayList _safeZoneGlass = new ArrayList<>(); // game start safe zone stuff + + private ArrayList _playerContainmentUnitLocations = new ArrayList<>(); // probably could use a longer variable name... + private SafePad _safePad = null; private SafePad _oldSafePad = null; + private int _zoneDecayTimer = 6; + private ArrayList _playersOnPad = new ArrayList(); private int _phaseTimer = -1; @@ -59,7 +66,7 @@ public class Maze implements Listener private HashMap _ents = new HashMap(); - public Maze(MonsterMaze host, ArrayList map, ArrayList spawns, ArrayList goals) + public Maze(MonsterMaze host, ArrayList map, ArrayList spawns, ArrayList goals, Location safeZone, ArrayList _glassBounds) { Host = host; @@ -87,6 +94,15 @@ public class Maze implements Listener { loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GOLD_BLOCK); } + + + for (Location loc : _glassBounds) + { + _playerContainmentUnitLocations.add(loc.clone().add(0, -1, 0)); + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); + loc.getBlock().getRelative(BlockFace.DOWN).setData((byte)3); + } + _safeZoneCenter = safeZone; } public void update() @@ -99,7 +115,7 @@ public class Maze implements Listener bump(); if(_phaseTimer <= -1) { - UtilTextTop.display(C.cAqua + C.Bold + "Be the first player to get to the safe pad!", Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(false).size()])); + UtilTextTop.display(C.cAqua + C.Bold + "Be the first player to get to the safe pad!", Host.GetPlayers(false).toArray(new Player[Host.GetPlayers(false).size()])); } else { @@ -137,9 +153,9 @@ public class Maze implements Listener UtilAction.velocity(player, UtilAlg.getTrajectory(ent, player), 1, false, 0, 0.75, 1.2, true); //Damage Event - Host.Manager.GetDamage().NewDamageEvent(player, (LivingEntity)ent, null, + /*Host.Manager.GetDamage().NewDamageEvent(player, (LivingEntity)ent, null, DamageCause.ENTITY_ATTACK, 6, false, false, false, - "Monster", "Monster Attack"); + "Monster", "Monster Attack");*/ } } } @@ -272,7 +288,17 @@ public class Maze implements Listener while(spawned <= numToSpawn) { - Location loc = UtilAlg.Random(_map); + ArrayList validSpawns = new ArrayList<>(_map); + + Iterator iter = validSpawns.iterator(); + while (iter.hasNext()) { + Location b = iter.next(); + if(UtilMath.offset(b, _safeZoneCenter) < 7.5) + { + iter.remove(); + } + } + Location loc = UtilAlg.Random(validSpawns); Host.CreatureAllowOverride = true; Entity ent = null; if(Host.getMonsterType() == EntityType.ZOMBIE) @@ -393,7 +419,7 @@ public class Maze implements Listener if(_padDecayTimer == -1) return; _padDecayTimer--; - + // 5 if(_oldSafePad != null) { if(_padDecayTimer == 4) @@ -421,6 +447,37 @@ public class Maze implements Listener } } + public void decrementZoneTime() + { + if(_zoneDecayTimer == -1) return; + + _zoneDecayTimer--; + + if(_safeZoneGlass.size() > 0) + { + if(_zoneDecayTimer == 4) + { + setSafeZoneColor((byte)4); + } + else if(_zoneDecayTimer == 3) + { + setSafeZoneColor((byte)1); + } + else if(_zoneDecayTimer == 2) + { + setSafeZoneColor((byte)14); + } + else if(_zoneDecayTimer == 1) + { + destroySafeZone(); + } + } + if(_padDecayTimer == 1) + { + _padDecayTimer = -1; + } + } + public void decrementPhaseTime() { if(_phaseTimer == -1) return; @@ -493,6 +550,51 @@ public class Maze implements Listener } } + private void setSafeZoneColor(byte data) + { + if(_safeZoneGlass.size() <= 0) return; + for(Block bl : _safeZoneGlass) + { + bl.setData(data); + } + } + + private void destroySafeZone() + { + if(_safeZoneGlass.size() <= 0) return; + for(Block bl : _safeZoneGlass) + { + bl.setType(Material.AIR); + } + _safeZoneGlass.clear(); + } + + public void removePlayerContainmentUnit() + { + for(Location loc : _playerContainmentUnitLocations) + { + loc.getBlock().setType(Material.AIR); + } + } + + public void createSafeZone() + { + System.out.println("creating safe zone"); + _safeZoneGlass = UtilBlock.getInBoundingBox(_safeZoneCenter.clone().add(5, 0, 5), _safeZoneCenter.clone().add(-5, 0, -5), false); + Iterator iter = _safeZoneGlass.iterator(); + while (iter.hasNext()) { + Block b = iter.next(); + if(b.getType() == Material.AIR) + { + b.setType(Material.STAINED_GLASS); + b.setData((byte)5); + } + else iter.remove(); + } + + // TODO bounds + } + public Set getMonsters() { return _ents.keySet(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index 4bf648938..48b51382b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -1,15 +1,12 @@ package nautilus.game.arcade.game.games.monstermaze; -import org.bukkit.entity.Egg; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; import org.bukkit.entity.Zombie; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityCombustEvent; -import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; @@ -65,14 +62,20 @@ public class MonsterMaze extends SoloGame if(event.GetState() == GameState.Prepare) { //if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER; - _monsterType = EntityType.SNOWMAN; // TODO map-specific monster type - _maze = new Maze(this, WorldData.GetDataLocs("GRAY"), WorldData.GetDataLocs("YELLOW"), WorldData.GetDataLocs("RED")); - UtilServer.getServer().getPluginManager().registerEvents(_maze, getArcadeManager().getPlugin()); - _maze.fillSpawn(135); - } else if(event.GetState() == GameState.Live) + } + else if(event.GetState() == GameState.Live) { - _maze.spawnSafePad(); + _maze.removePlayerContainmentUnit(); + } + else if(event.GetState() == GameState.Recruit) + { + _monsterType = EntityType.SNOWMAN; // TODO map-specific monster type + _maze = new Maze(this, WorldData.GetDataLocs("GRAY"), WorldData.GetDataLocs("YELLOW"), WorldData.GetDataLocs("RED"), WorldData.GetDataLocs("ORANGE").get(0), WorldData.GetDataLocs("PINK")); + + UtilServer.getServer().getPluginManager().registerEvents(_maze, getArcadeManager().getPlugin()); + _maze.createSafeZone(); + _maze.fillSpawn(200); } } @@ -92,6 +95,7 @@ public class MonsterMaze extends SoloGame if(!IsLive()) return; _maze.decrementPhaseTime(); _maze.decrementSafePadTime(); + _maze.decrementZoneTime(); } @EventHandler From 33d78a5efd7d8a1a0a4f998f4a9545322e3a5a3a Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 30 Aug 2015 18:39:07 -0400 Subject: [PATCH 021/219] Fixed eating spider eye. Yay! --- .../src/nautilus/game/arcade/managers/GameFlagManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index 97ebf6af2..b535e12a6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -849,11 +849,17 @@ public class GameFlagManager implements Listener if (game.HungerSet != -1) for (Player player : game.GetPlayers(true)) + { player.setFoodLevel(game.HungerSet); + player.setSaturation(1F); + } if (game.HealthSet != -1) for (Player player : game.GetPlayers(true)) + { player.setHealth(game.HealthSet); + player.setSaturation(1F); + } } @EventHandler(priority = EventPriority.LOWEST) From becfbe1f1333ddf10a5e82fe3c25cdbadbd17f0a Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 30 Aug 2015 20:09:47 -0400 Subject: [PATCH 022/219] Fixed possible game breaking bug :S --- .../src/nautilus/game/arcade/managers/GameFlagManager.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index b535e12a6..da2381dd8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -858,7 +858,6 @@ public class GameFlagManager implements Listener for (Player player : game.GetPlayers(true)) { player.setHealth(game.HealthSet); - player.setSaturation(1F); } } From 58ae09ebd4c9af901974d286468a38f792bb75ee Mon Sep 17 00:00:00 2001 From: Sarah Date: Mon, 31 Aug 2015 11:32:18 +0200 Subject: [PATCH 023/219] saving Project for pulling. --- .../arcade/game/games/event/EventGame.java | 131 +++++++++++++++++- .../arcade/game/games/event/EventModule.java | 60 ++++---- 2 files changed, 159 insertions(+), 32 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index 05d1c8508..681dd16c4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -1,9 +1,12 @@ package nautilus.game.arcade.game.games.event; +import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import mineplex.core.common.util.F; import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; @@ -11,7 +14,9 @@ import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.disguises.DisguiseBase; import mineplex.core.disguise.disguises.DisguiseBat; import mineplex.core.disguise.disguises.DisguiseChicken; @@ -26,21 +31,28 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.core.visibility.VisibilityManager; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; +import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.Game; -import nautilus.game.arcade.game.SoloGame; -import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.games.event.kits.KitPlayer; +import nautilus.game.arcade.game.games.skywars.TeamSkywars.TeamColors; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.managers.GameHostManager; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.Effect; import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.BlockFace; +import org.bukkit.block.Sign; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.block.BlockRedstoneEvent; +import org.bukkit.event.block.SignChangeEvent; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.EntityDeathEvent; @@ -65,6 +77,8 @@ public class EventGame extends Game private boolean _allowAllGadgets = false; private HashSet _gadgetWhitelist = new HashSet(); + + private HashMap _functionSigns; public EventGame(ArcadeManager manager) { @@ -110,9 +124,45 @@ public class EventGame extends Game this.GameTimeout = -1; _mps = manager.GetGameHostManager(); + _functionSigns = new HashMap<>(); this.CreatureAllow = true; } + + @EventHandler + public void registerSigns(GameStateChangeEvent event) + { + if(event.GetState() != GameState.Live) + return; + + for(Location loc : WorldData.GetDataLocs("RED")) + { + for(int i = -5; i < 5; i++) + { + Location temp = loc.clone().add(0, i, 0); + if(temp.getBlock().getType() == Material.SIGN_POST || temp.getBlock().getType() == Material.WALL_SIGN) + { + if(!_functionSigns.containsKey((Sign) temp.getBlock().getState())) + { + _functionSigns.put((Sign) temp.getBlock().getState(), System.currentTimeMillis()); + } + } + } + } + } + + @EventHandler + public void signPlace(SignChangeEvent event) + { + if(!IsLive()) + return; + + if(!Manager.GetGameHostManager().isAdmin(event.getPlayer(), true)) + return; + + if(event.getLine(0).startsWith("[") && event.getLine(0).endsWith("]")) + _functionSigns.put((Sign) event.getBlock().getState(), System.currentTimeMillis()); + } //Before GamePlayerManager puts onto Spec! @EventHandler(priority = EventPriority.LOW) @@ -464,4 +514,81 @@ public class EventGame extends Game return losers; } + @EventHandler + public void signCheck(BlockRedstoneEvent event) + { + if(event.getBlock().getType() != Material.SIGN_POST && event.getBlock().getType() != Material.WALL_SIGN) + return; + + useSign(((Sign) event.getBlock().getState()).getLines()); + } + + @EventHandler + public void signClock(UpdateEvent event) + { + if(event.getType() != UpdateType.SEC) + return; + + for(Sign sign : _functionSigns.keySet()) + { + if(sign.getBlock().getRelative(BlockFace.DOWN).getType() != Material.IRON_BLOCK) + continue; + + Sign cooldown = null; + + for(BlockFace face : BlockFace.values()) + { + if(face == BlockFace.UP) + continue; + + if(sign.getBlock().getRelative(BlockFace.DOWN).getRelative(face).getType() == Material.WALL_SIGN) + { + cooldown = (Sign) sign.getBlock().getRelative(BlockFace.DOWN).getRelative(face).getState(); + break; + } + } + + if(cooldown == null) + continue; + + if(!UtilTime.elapsed(_functionSigns.get(sign), Long.parseLong(cooldown.getLine(0)) * 1000)) + continue; + + _functionSigns.put(sign, System.currentTimeMillis()); + useSign(sign.getLines()); + } + } + + public void useSign(String[] args) + { + String command = args[0]; + String playerName = args[1]; + + command.replace("[", "").replaceAll("]", ""); + if(command.contentEquals("BC")) + { + String message = args[1]; + for(int i = 2; i <= 3; i++) + message += " " + args[i]; + + String colored = ChatColor.translateAlternateColorCodes('&', message); + this.Announce(F.main("Event", colored), true); + } + + + Player player = Bukkit.getPlayer(playerName); + if(player == null) + return; + + String[] vars = new String[args.length - 1]; + vars[0] = args[0]; + vars[1] = args[2]; + vars[2] = args[3]; + + if(command.contentEquals("MOB")) + { + Manager.GetEventModule().commandMob(player, vars); + } + } + } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java index 537e6589c..90d0c4f29 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java @@ -54,7 +54,7 @@ import org.bukkit.potion.PotionEffectType; public class EventModule extends MiniPlugin { - public ArcadeManager Manager; + private ArcadeManager Manager; private NautHashMap _potionEffectsDuration = new NautHashMap<>(); private NautHashMap _potionEffectsMult = new NautHashMap<>(); @@ -110,7 +110,7 @@ public class EventModule extends MiniPlugin event.setCancelled(true); } - private void commandHelp(Player player) + public void commandHelp(Player player) { UtilPlayer.message(player, F.main("Event", "Displaying Commands;")); @@ -151,7 +151,7 @@ public class EventModule extends MiniPlugin UtilPlayer.message(player, F.value("/e effect clear", "")); } - private void commandHelpSettings(Player player) + public void commandHelpSettings(Player player) { UtilPlayer.message(player, F.main("Event", "Displaying Settings Commands;")); UtilPlayer.message(player, F.value("/e damage all", "Toggles All Damage")); @@ -181,7 +181,7 @@ public class EventModule extends MiniPlugin //Command Handler @EventHandler(priority = EventPriority.LOWEST) - private void commandHandler(PlayerCommandPreprocessEvent event) + public void commandHandler(PlayerCommandPreprocessEvent event) { if (!Manager.GetGame().InProgress()) return; @@ -366,7 +366,7 @@ public class EventModule extends MiniPlugin } } - private void listSettings(Player player) + public void listSettings(Player player) { UtilPlayer.message(player, F.value("Damage All", F.tf(Manager.GetGame().Damage))); UtilPlayer.message(player, F.value("Damage PvP", F.tf(Manager.GetGame().DamagePvP))); @@ -389,28 +389,28 @@ public class EventModule extends MiniPlugin UtilPlayer.message(player, F.value("Mob griefing", F.tf(_mobGriefing))); } - private void commandBlockBreakInCreative(Player player, String[] args) + public void commandBlockBreakInCreative(Player player, String[] args) { Manager.GetGame().BlockBreakCreative = !Manager.GetGame().BlockBreakCreative; UtilPlayer.message(player, F.main("Settings", "BlockBreakCreative: " + F.tf(Manager.GetGame().BlockBreakCreative))); } - private void commandBlockPlaceInCreative(Player player, String[] args) + public void commandBlockPlaceInCreative(Player player, String[] args) { Manager.GetGame().BlockPlaceCreative = !Manager.GetGame().BlockPlaceCreative; UtilPlayer.message(player, F.main("Settings", "BlockPlaceCreative: " + F.tf(Manager.GetGame().BlockPlaceCreative))); } - private void commandMobGriefing(Player player, String[] args) + public void commandMobGriefing(Player player, String[] args) { _mobGriefing = !_mobGriefing; UtilPlayer.message(player, F.main("Settings", "Mob Griefing: " + F.tf(_mobGriefing))); } - private void commandBlockPlace(Player player, String[] args, boolean whitelist, String command) + public void commandBlockPlace(Player player, String[] args, boolean whitelist, String command) { try { @@ -471,7 +471,7 @@ public class EventModule extends MiniPlugin commandHelpSettings(player); } - private void commandBlockBreak(Player player, String[] args, boolean whitelist, String command) + public void commandBlockBreak(Player player, String[] args, boolean whitelist, String command) { try { @@ -532,7 +532,7 @@ public class EventModule extends MiniPlugin commandHelpSettings(player); } - private void commandHealth(Player player, String[] args) + public void commandHealth(Player player, String[] args) { try { @@ -563,7 +563,7 @@ public class EventModule extends MiniPlugin commandHelpSettings(player); } - private void commandHunger(Player player, String[] args) + public void commandHunger(Player player, String[] args) { try { @@ -594,7 +594,7 @@ public class EventModule extends MiniPlugin commandHelpSettings(player); } - private void commandTime(Player player, String[] args) + public void commandTime(Player player, String[] args) { try { @@ -626,7 +626,7 @@ public class EventModule extends MiniPlugin } //Teleport Command (To, Here, All) - private void commandTeleport(Player player, String[] args) + public void commandTeleport(Player player, String[] args) { if (args.length >= 3 && args[1].equalsIgnoreCase("here")) { @@ -668,7 +668,7 @@ public class EventModule extends MiniPlugin } //Gadget Commands (Global & Individual) - private void commandGadget(Player player, String[] args) + public void commandGadget(Player player, String[] args) { if(!(Manager.GetGame() instanceof EventGame)) { UtilPlayer.message(player, F.main("Inventory", "You can only enable/disable gadgets in the Event game!")); @@ -780,7 +780,7 @@ public class EventModule extends MiniPlugin } //Silence - private void commandSilence(Player player, String[] args) + public void commandSilence(Player player, String[] args) { try { @@ -813,7 +813,7 @@ public class EventModule extends MiniPlugin } //Gamemode (Self and Others) - private void commandAdmin(Player player, String[] args) + public void commandAdmin(Player player, String[] args) { Player target = player; @@ -835,7 +835,7 @@ public class EventModule extends MiniPlugin } //Gamemode (Self and Others) - private void commandGamemode(Player player, String[] args) + public void commandGamemode(Player player, String[] args) { Player target = player; @@ -857,7 +857,7 @@ public class EventModule extends MiniPlugin } //Forcefield - private void commandForcefieldRadius(Player player, String[] args) + public void commandForcefieldRadius(Player player, String[] args) { if(!(Manager.GetGame() instanceof EventGame)) { @@ -889,7 +889,7 @@ public class EventModule extends MiniPlugin } //Give - private void commandGive(Player player, String[] args) + public void commandGive(Player player, String[] args) { String[] newArgs = new String[args.length-1]; @@ -900,7 +900,7 @@ public class EventModule extends MiniPlugin } //Spec - private void commandSpectators(Player player, String[] args) + public void commandSpectators(Player player, String[] args) { Manager.GetGame().JoinInProgress = !Manager.GetGame().JoinInProgress; @@ -908,7 +908,7 @@ public class EventModule extends MiniPlugin } //Deathout - private void commandDeathout(Player player, String[] args) + public void commandDeathout(Player player, String[] args) { Manager.GetGame().DeathOut = !Manager.GetGame().DeathOut; @@ -916,7 +916,7 @@ public class EventModule extends MiniPlugin } //QuitOut - private void commandQuitOut(Player player, String[] args) + public void commandQuitOut(Player player, String[] args) { Manager.GetGame().QuitOut = !Manager.GetGame().QuitOut; @@ -924,7 +924,7 @@ public class EventModule extends MiniPlugin } //Double Jump - private void commandDoubleJump(Player player, String[] args) + public void commandDoubleJump(Player player, String[] args) { if(!(Manager.GetGame() instanceof EventGame)) { @@ -942,7 +942,7 @@ public class EventModule extends MiniPlugin } //Scoreboard - private void commandScoreboard(Player player, String[] args) + public void commandScoreboard(Player player, String[] args) { if(!(Manager.GetGame() instanceof EventGame)) { @@ -1016,7 +1016,7 @@ public class EventModule extends MiniPlugin } //Whitelist - private void commandWhitelist(Player player, String[] args) + public void commandWhitelist(Player player, String[] args) { //On and Off if (args.length >= 2) @@ -1056,7 +1056,7 @@ public class EventModule extends MiniPlugin } //Mob - private void commandMob(Player caller, String[] args) + public void commandMob(Player caller, String[] args) { if (args.length == 1) { @@ -1444,7 +1444,7 @@ public class EventModule extends MiniPlugin } } - private void commandMobKill(Player caller, String[] args) + public void commandMobKill(Player caller, String[] args) { if (args.length < 3) { @@ -1490,7 +1490,7 @@ public class EventModule extends MiniPlugin UtilPlayer.message(caller, F.main("Creature", "Killed " + target + ". " + count + " Removed.")); } - private void commandKit(Player caller, String[] args) + public void commandKit(Player caller, String[] args) { if(!(Manager.GetGame() instanceof EventGame)) { @@ -1533,7 +1533,7 @@ public class EventModule extends MiniPlugin commandHelp(caller); } - private void commandEffect(Player caller, String[] args) + public void commandEffect(Player caller, String[] args) { //Clear if (args.length >= 3 && args[2].equalsIgnoreCase("clear")) From b63843930f4d5394ff5312c22931114c6c450faf Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:08:42 -0400 Subject: [PATCH 024/219] Fixed bug https://trello.com/c/ZYS3Ddxw/134-hub-emerald-twirl-particles-are-called-green-ring-in-the-gui --- .../src/mineplex/core/gadget/gadgets/ParticleGreen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java index 9a370fad1..0489005a2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java @@ -21,7 +21,7 @@ public class ParticleGreen extends ParticleGadget public ParticleGreen(GadgetManager manager) { - super(manager, "Green Ring", new String[] + super(manager, "Emerald Twirl", new String[] { C.cWhite + "With these sparkles, you", C.cWhite + "can now sparkle while you", From 32a257fa55ce97d9b9f98fceb70fc78a0dafb05f Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:11:57 -0400 Subject: [PATCH 025/219] Fix bug https://trello.com/c/Jf7bht6V/138-general-tp-before-game-starts --- .../src/nautilus/game/arcade/managers/GameFlagManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index 97ebf6af2..34c55e670 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -947,7 +947,7 @@ public class GameFlagManager implements Listener Game game = Manager.GetGame(); if (game == null) return; - if (!game.IsLive()) + if (!(game.IsLive() || game.GetState() == GameState.Prepare)) return; if (!game.TeleportsDisqualify) From 24fed013ae9920a84e6a899ea144ec9998169d9b Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:39:04 -0400 Subject: [PATCH 026/219] Fixed previous ownership not being transferred --- .../src/mineplex/core/gadget/gadgets/ParticleGreen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java index 0489005a2..9a370fad1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java @@ -21,7 +21,7 @@ public class ParticleGreen extends ParticleGadget public ParticleGreen(GadgetManager manager) { - super(manager, "Emerald Twirl", new String[] + super(manager, "Green Ring", new String[] { C.cWhite + "With these sparkles, you", C.cWhite + "can now sparkle while you", From 5322e9d018189c9ea1ac7315c27f1379086b39b2 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:48:25 -0400 Subject: [PATCH 027/219] Marked the Bunny Morph to reflect its no longer available status --- .../src/mineplex/core/gadget/gadgets/MorphBunny.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java index 7d84e2457..78e502bc5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java @@ -59,8 +59,7 @@ public class MorphBunny extends MorphGadget " ", C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" , " ", - C.cPurple + "Special Limited Time Morph", - C.cPurple + "Purchase at www.mineplex.com/shop", + C.cPurple + "No longer available", }, -1, Material.MONSTER_EGG, (byte)98); From cbb0d4521cb4d12dafca9a4cae901bb3838e5182 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:49:31 -0400 Subject: [PATCH 028/219] Made Legend cosmetics follow the same rules as all other premium rank cosmetics, as many staff were previously legend and lacked access to features they had paid for. --- .../src/mineplex/core/gadget/gadgets/MorphWither.java | 5 +---- Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java index da9d82ebd..7bd891dcb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java @@ -177,10 +177,7 @@ public class MorphWither extends MorphGadget @EventHandler public void legendOwner(PlayerJoinEvent event) { - if (Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.LEGEND || - Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.ADMIN || - Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.DEVELOPER || - Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.OWNER) + if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.LEGEND)) { Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName()); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java index a95bcb150..0e70a0a22 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java @@ -146,7 +146,7 @@ public class PetManager extends MiniClientPlugin { Player p = event.getPlayer(); Rank rank = _clientManager.Get(p).GetRank(); - if (rank == Rank.LEGEND || rank == Rank.ADMIN || rank == Rank.DEVELOPER || rank == Rank.OWNER) + if (rank.has(Rank.LEGEND)) { _donationManager.Get(p.getName()).AddUnknownSalesPackagesOwned("Widder"); } From fe4586852c7537adb4fb5cf1ca7da3c460c4f2e9 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:59:53 -0400 Subject: [PATCH 029/219] Made rank unlock lore colored based on rank required for item (QA Requested) --- .../src/mineplex/core/cosmetic/ui/page/PetPage.java | 2 +- .../src/mineplex/core/gadget/gadgets/MorphPig.java | 2 +- .../src/mineplex/core/gadget/gadgets/MorphWither.java | 2 +- .../src/mineplex/core/gadget/gadgets/ParticleLegend.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java index 47d45cfa3..c9a544b93 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java @@ -75,7 +75,7 @@ public class PetPage extends ShopPageBase if (pet.GetPetType() == EntityType.WITHER) { itemLore.add(C.cBlack); - itemLore.add(ChatColor.RESET + C.cYellow + "Unlocked with Legend Rank"); + itemLore.add(ChatColor.RESET + C.cGreen + "Unlocked with Legend Rank"); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java index f132e9e7a..44662f5a1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java @@ -38,7 +38,7 @@ public class MorphPig extends MorphGadget C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Oink", C.cYellow + "Collide" + C.cGray + " to use " + C.cGreen + "Pig Bounce", " ", - C.cPurple + "Unlocked with Ultra Rank", + C.cAqua + "Unlocked with Ultra Rank", }, -1, Material.PORK, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java index 7bd891dcb..d7e4ba8dc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java @@ -47,7 +47,7 @@ public class MorphWither extends MorphGadget " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Wither Skull", " ", - C.cPurple + "Unlocked with Legend Rank", + C.cGreen + "Unlocked with Legend Rank", }, -1, Material.SKULL_ITEM, (byte)1); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java index 094c1ff39..7be1a9609 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java @@ -22,7 +22,7 @@ public class ParticleLegend extends ParticleGadget C.cWhite + "These mystic particle attach to", C.cWhite + "only the most legendary of players!", " ", - C.cPurple + "Unlocked with Legend Rank", + C.cGreen + "Unlocked with Legend Rank", }, -2, Material.ENDER_PORTAL, (byte)0); From 8a94602aefc1e4ea3490da434f14205f99ba1d8e Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 16:03:27 -0400 Subject: [PATCH 030/219] Fixed bug https://trello.com/c/KBhgw0zK/115-hg-mismatching-achievement-text --- .../src/mineplex/core/achievement/Achievement.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index ab821003d..01925be94 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -56,7 +56,7 @@ public enum Achievement //Survival Games SURVIVAL_GAMES_WINS("Katniss Everdeen", 600, new String[]{"Survival Games.Wins"}, - new String[]{"Win 20 games of Survival Games"}, + new String[]{"Win 30 games of Survival Games"}, new int[]{30}, AchievementCategory.SURVIVAL_GAMES), From b4ce33a916246263f3c53e820c5fa4a0f1c1f4f6 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Tue, 1 Sep 2015 01:59:36 -0400 Subject: [PATCH 031/219] Fixed things. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added a cancelled check to No Ability • Removed tokens on quit. • Checked if players are alive before giving them places. --- .../game/games/evolution/Evolution.java | 35 +++++++++++-------- .../evolution/trackers/NoAbilityTracker.java | 3 ++ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java index 62978c22b..1d4506b45 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java @@ -73,6 +73,7 @@ import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerItemHeldEvent; +import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.util.Vector; public class Evolution extends SoloGame @@ -141,7 +142,7 @@ public class Evolution extends SoloGame GemAssistDeathRespawn = .5; CompassEnabled = true; - CompassGiveItem = false; + CompassGiveItem = false; AutomaticRespawn = false; DeathSpectateSecs = 4.0; @@ -149,8 +150,7 @@ public class Evolution extends SoloGame VersionRequire1_8 = true; CreatureAllow = false; - - InventoryClick = false; + InventoryClick = false; InventoryOpenBlock = false; @@ -223,6 +223,12 @@ public class Evolution extends SoloGame upgradeKit(event.GetPlayer(), false); } + @EventHandler + public void removeToken(PlayerQuitEvent event) + { + _tokens.remove(event.getPlayer().getName()); + } + // //Double Kit // @EventHandler(priority = EventPriority.MONITOR) // public void storeTokens(GameStateChangeEvent event) @@ -414,7 +420,7 @@ public class Evolution extends SoloGame } } - @EventHandler + @EventHandler(priority = EventPriority.MONITOR) public void onKill(CombatDeathEvent event) { event.SetBroadcastType(DeathMessageType.Simple); @@ -747,7 +753,11 @@ public class Evolution extends SoloGame for (int i = 0 ; i < tokens.size() ; i++) { - players.add(tokens.get(i).Player); + Player cur = tokens.get(i).Player; + if (!cur.isOnline()) + continue; + + players.add(cur); } //Award Gems @@ -804,19 +814,14 @@ public class Evolution extends SoloGame Scoreboard.WriteBlank(); - int index = 0; + Scoreboard.Write(C.cYellow + C.Bold + "First to " + _mobKits.size()); + + Scoreboard.WriteBlank(); + for (Player player : GetPlayers(true)) { - if (index > 11) - break; - - Scoreboard.WriteOrdered("Score", C.cGreen + player.getName(), getScore(player), true); - index++; + Scoreboard.WriteOrdered("Score", C.cGreen + player.getName(), getScore(player), true); } - - Scoreboard.WriteBlank(); - - Scoreboard.Write(C.cGold + C.Bold + "First to " + _mobKits.size()); Scoreboard.Draw(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/trackers/NoAbilityTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/trackers/NoAbilityTracker.java index 655eb6f79..68b0cee22 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/trackers/NoAbilityTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/trackers/NoAbilityTracker.java @@ -29,6 +29,9 @@ public class NoAbilityTracker extends StatTracker @EventHandler(priority = EventPriority.MONITOR) public void onEvolutionAbility(EvolutionAbilityUseEvent event) { + if (event.isCancelled()) + return; + if (!getGame().IsLive()) return; From 0c58de3c190040a4f22f57226b60b010fbc0d89a Mon Sep 17 00:00:00 2001 From: Mysticate Date: Tue, 1 Sep 2015 02:35:06 -0400 Subject: [PATCH 032/219] Glitches. Fixed the things. --- .../game/arcade/game/games/evolution/kits/KitHealth.java | 4 ++-- .../game/arcade/game/games/evolution/mobs/KitChicken.java | 4 ++++ .../game/games/evolution/mobs/perks/PerkBounceEVO.java | 3 +++ .../games/evolution/mobs/perks/PerkFlamingSwordEVO.java | 4 ++++ .../games/evolution/mobs/perks/PerkSiesmicSlamEVO.java | 3 +++ .../games/evolution/mobs/perks/PerkSulphurBombEVO.java | 4 ++++ .../game/games/evolution/mobs/perks/PerkWebEVO.java | 8 ++++++++ 7 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/kits/KitHealth.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/kits/KitHealth.java index b9d93c102..71ae6fc03 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/kits/KitHealth.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/kits/KitHealth.java @@ -61,7 +61,7 @@ public class KitHealth extends Kit if (!Manager.GetGame().IsLive()) return; - Player killer = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName()); + Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName()); if (killer == null || !killer.isOnline()) return; @@ -74,6 +74,6 @@ public class KitHealth extends Kit if (!HasKit(killer)) return; - killer.setHealth(killer.getMaxHealth()); + UtilPlayer.health(killer, 9999); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/KitChicken.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/KitChicken.java index 0f9b32d9a..0910b74a3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/KitChicken.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/KitChicken.java @@ -1,6 +1,7 @@ package nautilus.game.arcade.game.games.evolution.mobs; import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilGear; @@ -66,6 +67,9 @@ public class KitChicken extends EvoKit if (!UtilEvent.isAction(event, ActionType.R)) return; + if (UtilBlock.usable(event.getClickedBlock())) + return; + if (!Manager.GetGame().IsLive()) return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBounceEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBounceEVO.java index 063a22493..d200e76e9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBounceEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBounceEVO.java @@ -55,6 +55,9 @@ public class PerkBounceEVO extends Perk if (!UtilEvent.isAction(event, ActionType.R)) return; + + if (UtilBlock.usable(event.getClickedBlock())) + return; if (UtilBlock.usable(event.getClickedBlock())) return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkFlamingSwordEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkFlamingSwordEVO.java index 6e226b34e..8f38ff279 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkFlamingSwordEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkFlamingSwordEVO.java @@ -5,6 +5,7 @@ import java.util.Map.Entry; import mineplex.core.common.util.C; import mineplex.core.common.util.NautHashMap; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; @@ -49,6 +50,9 @@ public class PerkFlamingSwordEVO extends Perk if (!UtilEvent.isAction(event, ActionType.R)) return; + if (UtilBlock.usable(event.getClickedBlock())) + return; + if (!Manager.GetGame().IsLive()) return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSiesmicSlamEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSiesmicSlamEVO.java index ad9232582..9339eef8c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSiesmicSlamEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSiesmicSlamEVO.java @@ -71,6 +71,9 @@ public class PerkSiesmicSlamEVO extends Perk if (!UtilEvent.isAction(event, ActionType.R)) return; + if (UtilBlock.usable(event.getClickedBlock())) + return; + if (!UtilInv.IsItem(event.getItem(), Material.IRON_INGOT, (byte) 0)) return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java index a11c63035..b38629a80 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java @@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.evolution.mobs.perks; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; @@ -55,6 +56,9 @@ public class PerkSulphurBombEVO extends Perk implements IThrown if (!UtilEvent.isAction(event, ActionType.R)) return; + if (UtilBlock.usable(event.getClickedBlock())) + return; + if (!UtilInv.IsItem(event.getItem(), Material.SULPHUR, (byte) 0)) return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java index 7abe68567..03aeaa0d8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java @@ -1,6 +1,7 @@ package nautilus.game.arcade.game.games.evolution.mobs.perks; import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilInv; @@ -39,6 +40,9 @@ public class PerkWebEVO extends Perk implements IThrown if (!UtilEvent.isAction(event, ActionType.R)) return; + if (UtilBlock.usable(event.getClickedBlock())) + return; + if (!Manager.GetGame().IsLive()) return; @@ -109,7 +113,11 @@ public class PerkWebEVO extends Perk implements IThrown public void Web(ProjectileUser data) { Location loc = data.GetThrown().getLocation(); + data.GetThrown().remove(); + + if (loc.getBlock().getType() != Material.AIR) + return; Manager.GetBlockRestore().Add(loc.getBlock(), 30, (byte)0, 4000); } From 271b86dabdb3c069f62066606f549b2545fba492 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Fri, 4 Sep 2015 11:45:42 -0400 Subject: [PATCH 033/219] Fixed spectators slowing evolution times. --- .../nautilus/game/arcade/game/games/evolution/Evolution.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java index 1d4506b45..39ceda806 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java @@ -375,9 +375,12 @@ public class Evolution extends SoloGame } } - @EventHandler + @EventHandler(priority = EventPriority.MONITOR) public void onDamage(CustomDamageEvent event) { + if (event.IsCancelled()) + return; + if (!IsLive()) return; From 9e3f87b71eaebd4b0011bc52c7813b5662238307 Mon Sep 17 00:00:00 2001 From: fooify Date: Sat, 5 Sep 2015 06:39:31 -0700 Subject: [PATCH 034/219] more edits to MM - displaying more information - permanent safezones around the map - spawn now does not deteriorate, is permanent --- .../arcade/game/games/monstermaze/Maze.java | 137 +++++++++--------- .../game/games/monstermaze/MonsterMaze.java | 8 +- .../kits/KitHyper.java | 2 +- 3 files changed, 76 insertions(+), 71 deletions(-) rename Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/{snowsprint => monstermaze}/kits/KitHyper.java (94%) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index 6cedcf3b4..b58d2ae10 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -1,9 +1,11 @@ package nautilus.game.arcade.game.games.monstermaze; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Map.Entry; import java.util.Set; @@ -17,7 +19,6 @@ import org.bukkit.block.BlockFace; import org.bukkit.entity.Creeper; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.entity.Zombie; @@ -30,9 +31,13 @@ import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilEnum; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; +import mineplex.core.common.util.UtilTextBottom; import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; @@ -49,7 +54,8 @@ public class Maze implements Listener private HashSet _disabledWaypoints; private ArrayList _borders; - private Location _safeZoneCenter; + private Location _center; + private ArrayList _safeZoneGlass = new ArrayList<>(); // game start safe zone stuff private ArrayList _playerContainmentUnitLocations = new ArrayList<>(); // probably could use a longer variable name... @@ -66,7 +72,7 @@ public class Maze implements Listener private HashMap _ents = new HashMap(); - public Maze(MonsterMaze host, ArrayList map, ArrayList spawns, ArrayList goals, Location safeZone, ArrayList _glassBounds) + public Maze(MonsterMaze host, ArrayList map, ArrayList spawns, ArrayList goals, Location center, ArrayList _glassBounds) { Host = host; @@ -98,11 +104,11 @@ public class Maze implements Listener for (Location loc : _glassBounds) { - _playerContainmentUnitLocations.add(loc.clone().add(0, -1, 0)); - loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); - loc.getBlock().getRelative(BlockFace.DOWN).setData((byte)3); + _playerContainmentUnitLocations.add(loc); + loc.getBlock().setType(Material.STAINED_GLASS); + loc.getBlock().setData((byte)3); } - _safeZoneCenter = safeZone; + _center = center; } public void update() @@ -115,18 +121,24 @@ public class Maze implements Listener bump(); if(_phaseTimer <= -1) { - UtilTextTop.display(C.cAqua + C.Bold + "Be the first player to get to the safe pad!", Host.GetPlayers(false).toArray(new Player[Host.GetPlayers(false).size()])); + for(Player p : Host.GetPlayers(true)) + { + p.setExp(0); + } + UtilTextTop.displayProgress(C.cAqua + C.Bold + "Be the first player to get to the Safe Pad!", 100, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); } else { + double percentage = _phaseTimer/20d; for(Player p : Host.GetPlayers(true)) { + p.setExp((float)percentage); if(_safePad.isOn(p)) { - UtilTextTop.display(C.cGreen + C.Bold + "Stay on the safe pad for " + _phaseTimer + " more seconds!", p); + UtilTextTop.displayProgress(C.cGreen + C.Bold + "Stay on the Safe Pad for " + _phaseTimer + " more seconds!", percentage, p); } else { - UtilTextTop.display(C.cRed + C.Bold + "You have " + _phaseTimer + " seconds to get to the safe pad!", p); + UtilTextTop.displayProgress(C.cRed + C.Bold + "You have " + _phaseTimer + " seconds to get to the Safe Pad!", percentage, p); } } } @@ -293,7 +305,7 @@ public class Maze implements Listener Iterator iter = validSpawns.iterator(); while (iter.hasNext()) { Location b = iter.next(); - if(UtilMath.offset(b, _safeZoneCenter) < 7.5) + if(UtilMath.offset(b, _center) < 7.5) { iter.remove(); } @@ -366,7 +378,6 @@ public class Maze implements Listener public void spawnSafePad() { - System.out.println("creating safe pad"); if(_safePad != null) { _oldSafePad = _safePad; @@ -380,7 +391,6 @@ public class Maze implements Listener { for(Block b : _disabledWaypoints) { - System.out.println("remove"); _waypoints.add(b); } _disabledWaypoints.clear(); @@ -395,7 +405,6 @@ public class Maze implements Listener Block b = iter.next(); if(UtilBlock.getInBoundingBox(_safePad.getLocation().clone().add(2, 0, 2), _safePad.getLocation().clone().add(-2, 0, -2)).contains(b.getRelative(BlockFace.DOWN))) { - System.out.println("block"); _disabledWaypoints.add(b); iter.remove(); } @@ -406,7 +415,7 @@ public class Maze implements Listener Entity e = it.next(); if(_safePad.isOn(e)) { - System.out.println("ent"); + System.out.println("entity on newly spawned safepad removed"); _ents.remove(_ents.get(e)); it.remove(); e.remove(); @@ -447,7 +456,7 @@ public class Maze implements Listener } } - public void decrementZoneTime() + /*public void decrementZoneTime() { if(_zoneDecayTimer == -1) return; @@ -476,33 +485,39 @@ public class Maze implements Listener { _padDecayTimer = -1; } - } + }*/ public void decrementPhaseTime() { if(_phaseTimer == -1) return; - /*if(_phaseTimer == -1) - { - _safePad = new SafePad(Host, this, UtilAlg.Random(_goals).clone().subtract(0,1,0)); - _safePad.build(); - UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); - - Iterator iter = _waypoints.iterator(); - while (iter.hasNext()) { - Block b = iter.next(); - if(UtilBlock.getInBoundingBox(_safePad.getLocation().clone().add(2, 0, 2), _safePad.getLocation().clone().add(-2, 0, -2)).contains(b.getRelative(BlockFace.DOWN))) - { - System.out.println("block"); - _disabledWaypoints.add(b); - iter.remove(); - } - } - - _phaseTimer = 11; - return; - }*/ _phaseTimer--; + + if(_phaseTimer == 15 || _phaseTimer == 10) + { + UtilTextMiddle.display("", C.cGray + C.Bold + _phaseTimer + " seconds to get to the Safe Zone!", 0, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); + } + + if(_phaseTimer == 5 || _phaseTimer == 4) + { + UtilTextMiddle.display("", C.cGreen + C.Bold + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); + } + + if(_phaseTimer == 3) + { + UtilTextMiddle.display("", C.cYellow + C.Bold + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); + } + + if(_phaseTimer == 2) + { + UtilTextMiddle.display("", C.cGold + C.Bold + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); + } + + if(_phaseTimer == 1) + { + UtilTextMiddle.display("", C.cRed + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); + } + if(_phaseTimer == 0) { for(Player p : Host.GetPlayers(true)) @@ -510,14 +525,15 @@ public class Maze implements Listener if(_safePad.isOn(p)) { // maybe send them a happy message? =) - UtilPlayer.message(p, F.main("Game", C.cGreen + "Since you were on the safe pad, you didn't die!")); + UtilPlayer.message(p, F.main("Game", C.cGreen + "Since you were on the Safe Pad, you didn't die!")); } else { Host.Manager.GetDamage().NewDamageEvent(p, null, null, DamageCause.CUSTOM, 500, false, false, false, "Game", "Map damage"); - UtilPlayer.message(p, F.main("Game", C.cRed + "You died because you weren't on the safe pad!")); + UtilTextMiddle.display(C.cDRed + C.Bold + "Failure", C.cRed + "You didn't make it to the Safe Pad in time!", 5, 40, 5, p); + UtilPlayer.message(p, F.main("Game", C.cRed + "You died because you weren't on the Safe Pad!")); } } spawn(15); @@ -537,29 +553,38 @@ public class Maze implements Listener _playersOnPad.add(p); if(_playersOnPad.size() == 1) // first player { - UtilTextMiddle.display(C.cGold + C.Bold + "AWESOME!", C.cGold + "You were the first to make it to the safe pad!", p); + _phaseTimer = 21; // start the countdown + + UtilTextMiddle.display(C.cGold + C.Bold + "AWESOME!", C.cGold + "You were the first to make it to the Safe Pad!", 5, 40, 5, p); p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); - _phaseTimer = 16; - Host.Announce(C.cRed + C.Bold + p.getName() + " was the first to make it to the safe pad! Everyone not on the safe pad in 20 seconds will die!"); + UtilPlayer.message(p, F.main("Game", C.cGreen + "Great, you made it. Stay on the Safe Pad!")); + + ArrayList pElse = Host.GetPlayers(false); + pElse.remove(p); + for(Player i : pElse) + { + UtilPlayer.message(i, C.cRed + C.Bold + p.getName() + " was the first to make it to the Safe Pad!"); + UtilPlayer.message(i, C.cRed + "Everyone not on the Safe Pad in 20 seconds will die!"); // I don't like this message + } } else // not the first { p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); - UtilTextMiddle.display(C.cGreen + C.Bold + "Great!", C.cGreen + "Stay on the safe pad!", p); + UtilTextMiddle.display(C.cGreen + C.Bold + "Great!", C.cGreen + "Stay on the Safe Pad!", 5, 40, 5, p); } } } } - private void setSafeZoneColor(byte data) + /*private void setSafeZoneColor(byte data) { if(_safeZoneGlass.size() <= 0) return; for(Block bl : _safeZoneGlass) { bl.setData(data); } - } + }*/ - private void destroySafeZone() + /*private void destroySafeZone() { if(_safeZoneGlass.size() <= 0) return; for(Block bl : _safeZoneGlass) @@ -567,7 +592,7 @@ public class Maze implements Listener bl.setType(Material.AIR); } _safeZoneGlass.clear(); - } + }*/ public void removePlayerContainmentUnit() { @@ -577,24 +602,6 @@ public class Maze implements Listener } } - public void createSafeZone() - { - System.out.println("creating safe zone"); - _safeZoneGlass = UtilBlock.getInBoundingBox(_safeZoneCenter.clone().add(5, 0, 5), _safeZoneCenter.clone().add(-5, 0, -5), false); - Iterator iter = _safeZoneGlass.iterator(); - while (iter.hasNext()) { - Block b = iter.next(); - if(b.getType() == Material.AIR) - { - b.setType(Material.STAINED_GLASS); - b.setData((byte)5); - } - else iter.remove(); - } - - // TODO bounds - } - public Set getMonsters() { return _ents.keySet(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index 48b51382b..8d0dfee19 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -17,7 +17,7 @@ import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.SoloGame; -import nautilus.game.arcade.game.games.snowsprint.kits.KitHyper; +import nautilus.game.arcade.game.games.monstermaze.kits.KitHyper; import nautilus.game.arcade.kit.Kit; public class MonsterMaze extends SoloGame @@ -62,10 +62,10 @@ public class MonsterMaze extends SoloGame if(event.GetState() == GameState.Prepare) { //if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER; + _maze.spawnSafePad(); } else if(event.GetState() == GameState.Live) { - _maze.spawnSafePad(); _maze.removePlayerContainmentUnit(); } else if(event.GetState() == GameState.Recruit) @@ -74,8 +74,7 @@ public class MonsterMaze extends SoloGame _maze = new Maze(this, WorldData.GetDataLocs("GRAY"), WorldData.GetDataLocs("YELLOW"), WorldData.GetDataLocs("RED"), WorldData.GetDataLocs("ORANGE").get(0), WorldData.GetDataLocs("PINK")); UtilServer.getServer().getPluginManager().registerEvents(_maze, getArcadeManager().getPlugin()); - _maze.createSafeZone(); - _maze.fillSpawn(200); + _maze.fillSpawn(150); } } @@ -95,7 +94,6 @@ public class MonsterMaze extends SoloGame if(!IsLive()) return; _maze.decrementPhaseTime(); _maze.decrementSafePadTime(); - _maze.decrementZoneTime(); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitHyper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitHyper.java similarity index 94% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitHyper.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitHyper.java index 7a1bf6b7d..5e08deb76 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snowsprint/kits/KitHyper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitHyper.java @@ -1,4 +1,4 @@ -package nautilus.game.arcade.game.games.snowsprint.kits; +package nautilus.game.arcade.game.games.monstermaze.kits; import org.bukkit.Material; import org.bukkit.entity.EntityType; From c648d7c186634ed9f7d61b652d549baa61629e95 Mon Sep 17 00:00:00 2001 From: fooify Date: Sat, 5 Sep 2015 09:30:51 -0700 Subject: [PATCH 035/219] stuff, things...things, stuff (Monster Maze) --- .../arcade/game/games/monstermaze/Maze.java | 169 +++++++++++------- .../game/games/monstermaze/MonsterMaze.java | 17 +- 2 files changed, 117 insertions(+), 69 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index b58d2ae10..176b2c8eb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -1,11 +1,9 @@ package nautilus.game.arcade.game.games.monstermaze; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.List; import java.util.Map.Entry; import java.util.Set; @@ -19,6 +17,7 @@ import org.bukkit.block.BlockFace; import org.bukkit.entity.Creeper; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.entity.Zombie; @@ -31,13 +30,9 @@ import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilEnum; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilText; -import mineplex.core.common.util.UtilTextBottom; import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; @@ -56,19 +51,17 @@ public class Maze implements Listener private Location _center; - private ArrayList _safeZoneGlass = new ArrayList<>(); // game start safe zone stuff - private ArrayList _playerContainmentUnitLocations = new ArrayList<>(); // probably could use a longer variable name... private SafePad _safePad = null; private SafePad _oldSafePad = null; - private int _zoneDecayTimer = 6; - private ArrayList _playersOnPad = new ArrayList(); private int _phaseTimer = -1; private int _padDecayTimer = -1; + + private ArrayList _clientsideBlocks = new ArrayList<>(); private HashMap _ents = new HashMap(); @@ -104,6 +97,10 @@ public class Maze implements Listener for (Location loc : _glassBounds) { + _playerContainmentUnitLocations.add(loc.clone().subtract(0, 1, 0)); + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); + loc.getBlock().getRelative(BlockFace.DOWN).setData((byte)3); + _playerContainmentUnitLocations.add(loc); loc.getBlock().setType(Material.STAINED_GLASS); loc.getBlock().setData((byte)3); @@ -152,6 +149,9 @@ public class Maze implements Listener { if (!Recharge.Instance.usable(player, "Monster Hit")) continue; + + if(_playersOnPad.contains(player)) + continue; //Hit Snowman for (Entity ent : _ents.keySet()) @@ -165,9 +165,9 @@ public class Maze implements Listener UtilAction.velocity(player, UtilAlg.getTrajectory(ent, player), 1, false, 0, 0.75, 1.2, true); //Damage Event - /*Host.Manager.GetDamage().NewDamageEvent(player, (LivingEntity)ent, null, - DamageCause.ENTITY_ATTACK, 6, false, false, false, - "Monster", "Monster Attack");*/ + Host.Manager.GetDamage().NewDamageEvent(player, (LivingEntity)ent, null, + DamageCause.ENTITY_ATTACK, 4, false, false, false, + "Monster", "Monster Attack"); } } } @@ -210,7 +210,7 @@ public class Maze implements Listener { System.err.println("ENTITY HAS NO DIRECTION TO GO, removing entity"); entIterator.remove(); - + data.getKey().remove(); } if(nextBlock.size() > 1 && data.getValue().Direction != CardinalDirection.NULL) // they can do a uturn if they're stuck @@ -339,7 +339,7 @@ public class Maze implements Listener } } - public void spawn(int numToSpawn) + private void spawn(int numToSpawn) { System.out.println("spawning " + numToSpawn + " entities at spawnpoints"); Location loc = UtilAlg.Random(_spawns); @@ -387,15 +387,6 @@ public class Maze implements Listener ArrayList goals = new ArrayList(_goals); if(_oldSafePad != null) goals.remove(_oldSafePad.getLocation()); - if(_disabledWaypoints.size() > 0) - { - for(Block b : _disabledWaypoints) - { - _waypoints.add(b); - } - _disabledWaypoints.clear(); - } - _safePad = new SafePad(Host, this, UtilAlg.Random(goals).clone().subtract(0,1,0)); // maybe don't need to clone() _safePad.build(); UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); @@ -448,6 +439,15 @@ public class Maze implements Listener { _oldSafePad.destroy(); _oldSafePad = null; + + if(_disabledWaypoints.size() > 0) + { + for(Block b : _disabledWaypoints) + { + _waypoints.add(b); + } + _disabledWaypoints.clear(); + } } } if(_padDecayTimer == 1) @@ -456,37 +456,6 @@ public class Maze implements Listener } } - /*public void decrementZoneTime() - { - if(_zoneDecayTimer == -1) return; - - _zoneDecayTimer--; - - if(_safeZoneGlass.size() > 0) - { - if(_zoneDecayTimer == 4) - { - setSafeZoneColor((byte)4); - } - else if(_zoneDecayTimer == 3) - { - setSafeZoneColor((byte)1); - } - else if(_zoneDecayTimer == 2) - { - setSafeZoneColor((byte)14); - } - else if(_zoneDecayTimer == 1) - { - destroySafeZone(); - } - } - if(_padDecayTimer == 1) - { - _padDecayTimer = -1; - } - }*/ - public void decrementPhaseTime() { if(_phaseTimer == -1) return; @@ -515,7 +484,7 @@ public class Maze implements Listener if(_phaseTimer == 1) { - UtilTextMiddle.display("", C.cRed + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); + UtilTextMiddle.display("", C.cRed + C.Bold + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); } if(_phaseTimer == 0) @@ -543,7 +512,7 @@ public class Maze implements Listener } } - public void checkPlayersOnSafePad() + private void checkPlayersOnSafePad() { if(_safePad == null) return; for(Player p : Host.GetPlayers(true)) @@ -571,28 +540,92 @@ public class Maze implements Listener p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); UtilTextMiddle.display(C.cGreen + C.Bold + "Great!", C.cGreen + "Stay on the Safe Pad!", 5, 40, 5, p); } + + buildSafePadBarrier(p); } } } - /*private void setSafeZoneColor(byte data) + private void buildSafePadBarrier(Player p) { - if(_safeZoneGlass.size() <= 0) return; - for(Block bl : _safeZoneGlass) + ArrayList _cube = UtilBlock.getInBoundingBox(_safePad.getLocation().clone().add(3, 2, 3), _safePad.getLocation().clone().add(-3, 1, -3), false); + ArrayList _hollowedCube = UtilBlock.getInBoundingBox(_safePad.getLocation().clone().add(2, 2, 2), _safePad.getLocation().clone().add(-2, 1, -2), false); + _cube.removeAll(_hollowedCube); + + for(Block b : _cube) { - bl.setData(data); + _clientsideBlocks.add(new ClientsideBlock(p, b.getLocation(), Material.STAINED_GLASS, (byte)3)); } - }*/ + } - /*private void destroySafeZone() + private void removeSafePadBarrier() // for all players ;) { - if(_safeZoneGlass.size() <= 0) return; - for(Block bl : _safeZoneGlass) + for(ClientsideBlock csb : _clientsideBlocks) { - bl.setType(Material.AIR); + csb.disable(); } - _safeZoneGlass.clear(); - }*/ + _clientsideBlocks.clear(); + } + + private class ClientsideBlock + { + private Player _player; + + private Location _loc; + private Material _mat; + private byte _data; + + private Material _origMat; + private byte _origData; + + private boolean _shown = false; + + public ClientsideBlock(Player p, Location loc, Material mat, byte data) + { + _player = p; + + _loc = loc; + _mat = mat; + _data = data; + + _origMat = _loc.getBlock().getType(); + _origData = _loc.getBlock().getData(); + + enable(); + } + + public void enable() + { + if(isShown()) return; + + _player.sendBlockChange(_loc, _mat, _data); + _shown = true; + } + + public void disable() + { + if(!isShown()) return; + + _player.sendBlockChange(_loc, _origMat, _origData); + + _shown = false; + } + + public boolean isShown() // this can break if the block changes and overrides the client-side blocks, but this won't happen if it's being used properly (maybe should add a check?...) + { + return _shown; + } + + public Player getPlayer() + { + return _player; + } + + public Location getLocation() + { + return _loc; + } + } public void removePlayerContainmentUnit() { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index 8d0dfee19..2434af05e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -1,5 +1,6 @@ package nautilus.game.arcade.game.games.monstermaze; +import org.bukkit.GameMode; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; @@ -9,8 +10,11 @@ import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import org.bukkit.scoreboard.Team; +import mineplex.core.common.util.C; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; @@ -66,7 +70,15 @@ public class MonsterMaze extends SoloGame } else if(event.GetState() == GameState.Live) { + for(Player player : GetPlayers(true)) + player.setGameMode(GameMode.ADVENTURE); + _maze.removePlayerContainmentUnit(); + + UtilTextMiddle.display(C.cAqua + C.Bold + "Push F5", C.cWhite + "Monster Maze is best played in 3rd Person", 10, 70, 10); + + for (Team team : GetScoreboard().GetScoreboard().getTeams()) + team.setCanSeeFriendlyInvisibles(true); } else if(event.GetState() == GameState.Recruit) { @@ -74,7 +86,7 @@ public class MonsterMaze extends SoloGame _maze = new Maze(this, WorldData.GetDataLocs("GRAY"), WorldData.GetDataLocs("YELLOW"), WorldData.GetDataLocs("RED"), WorldData.GetDataLocs("ORANGE").get(0), WorldData.GetDataLocs("PINK")); UtilServer.getServer().getPluginManager().registerEvents(_maze, getArcadeManager().getPlugin()); - _maze.fillSpawn(150); + _maze.fillSpawn(175); } } @@ -84,7 +96,10 @@ public class MonsterMaze extends SoloGame if(event.getType() != UpdateType.SEC) return; // because why not if(!InProgress()) return; for(Player pl : GetPlayers(true)) + { pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000000, 250)); + pl.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 80, 250)); + } } @EventHandler From 5712af8ddcaeac6c5c5090b7ce7c445418c754ac Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 5 Sep 2015 20:38:51 +0200 Subject: [PATCH 036/219] Adding Redstone function signs for events. --- .../arcade/game/games/event/EventGame.java | 316 ++++++++++++++++-- .../arcade/game/games/event/EventModule.java | 40 ++- 2 files changed, 327 insertions(+), 29 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index 681dd16c4..6f74a2da3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import mineplex.core.common.util.F; @@ -23,6 +24,7 @@ import mineplex.core.disguise.disguises.DisguiseChicken; import mineplex.core.disguise.disguises.DisguiseEnderman; import mineplex.core.disguise.disguises.DisguiseWither; import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.give.Give; import mineplex.core.mount.event.MountActivateEvent; import mineplex.core.recharge.Recharge; import mineplex.core.shop.item.SalesPackageBase; @@ -34,7 +36,6 @@ import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.games.event.kits.KitPlayer; -import nautilus.game.arcade.game.games.skywars.TeamSkywars.TeamColors; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.managers.GameHostManager; @@ -51,6 +52,7 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.event.block.SignChangeEvent; import org.bukkit.event.entity.CreatureSpawnEvent; @@ -79,6 +81,7 @@ public class EventGame extends Game private HashSet _gadgetWhitelist = new HashSet(); private HashMap _functionSigns; + private ArrayList _powerdedSigns; public EventGame(ArcadeManager manager) { @@ -125,6 +128,7 @@ public class EventGame extends Game _mps = manager.GetGameHostManager(); _functionSigns = new HashMap<>(); + _powerdedSigns = new ArrayList<>(); this.CreatureAllow = true; } @@ -514,25 +518,23 @@ public class EventGame extends Game return losers; } - @EventHandler + /*@EventHandler public void signCheck(BlockRedstoneEvent event) { if(event.getBlock().getType() != Material.SIGN_POST && event.getBlock().getType() != Material.WALL_SIGN) - return; + return; useSign(((Sign) event.getBlock().getState()).getLines()); - } + }*/ @EventHandler public void signClock(UpdateEvent event) { - if(event.getType() != UpdateType.SEC) + if(event.getType() != UpdateType.TICK) return; for(Sign sign : _functionSigns.keySet()) { - if(sign.getBlock().getRelative(BlockFace.DOWN).getType() != Material.IRON_BLOCK) - continue; Sign cooldown = null; @@ -542,42 +544,243 @@ public class EventGame extends Game continue; if(sign.getBlock().getRelative(BlockFace.DOWN).getRelative(face).getType() == Material.WALL_SIGN) - { + { cooldown = (Sign) sign.getBlock().getRelative(BlockFace.DOWN).getRelative(face).getState(); break; } } if(cooldown == null) + { + if(!sign.getBlock().isBlockPowered()) + { + _powerdedSigns.remove(sign); + continue; + } + + if(_powerdedSigns.contains(sign)) + continue; + + useSign(sign, ((Sign) sign.getBlock().getState()).getLines()); + + if(sign.getBlock().isBlockPowered()) + { + if(!_powerdedSigns.contains(sign)) + { + _powerdedSigns.add(sign); + } + } + continue; + } + + if(!sign.getBlock().isBlockPowered() && !UtilTime.elapsed(_functionSigns.get(sign), Long.parseLong(cooldown.getLine(0)) * 1000)) continue; - if(!UtilTime.elapsed(_functionSigns.get(sign), Long.parseLong(cooldown.getLine(0)) * 1000)) + if(!sign.getBlock().isBlockPowered()) + { + _powerdedSigns.remove(sign); + } + + if(_powerdedSigns.contains(sign)) continue; _functionSigns.put(sign, System.currentTimeMillis()); - useSign(sign.getLines()); + useSign(sign, ((Sign) sign.getBlock().getState()).getLines()); + + if(sign.getBlock().isBlockPowered()) + { + if(!_powerdedSigns.contains(sign)) + { + _powerdedSigns.add(sign); + } + } } } - public void useSign(String[] args) + public void useSign(final Sign sign, String[] args) { String command = args[0]; String playerName = args[1]; - command.replace("[", "").replaceAll("]", ""); - if(command.contentEquals("BC")) + HashMap> varMap = new HashMap<>(); + + int i = 0; + for(String varArgs : args) + { + ArrayList players = new ArrayList<>(); + if(Bukkit.getPlayer(playerName) != null) + players.add(Bukkit.getPlayer(playerName)); + + if(playerName.contentEquals("@p")) + { + for(Player player : GetPlayers(true)) + { + boolean found = true; + for(Player otherPlayer : GetPlayers(true)) + { + if(UtilMath.offset(sign.getLocation(), player.getLocation()) >= UtilMath.offset(sign.getLocation(), otherPlayer.getLocation())) + { + found = false; + break; + } + } + if(found = true) + { + players.add(player); + break; + } + } + } + if(playerName.contains("@a")) + { + int radius = 0; + if(playerName.contains("r=")) + { + try + { + radius = Integer.parseInt(playerName.split("=")[1]); + } + catch (Exception e) {} + } + for(Player player : GetPlayers(true)) + { + if(UtilMath.offset(sign.getLocation(), player.getLocation()) <= radius || radius <= 0) + players.add(player); + } + } + + varMap.put(i, players); + i++; + } + + if(command.contentEquals("[BC]")) { String message = args[1]; - for(int i = 2; i <= 3; i++) - message += " " + args[i]; + for(int e = 2; e <= 3; e++) + message += " " + args[e]; String colored = ChatColor.translateAlternateColorCodes('&', message); this.Announce(F.main("Event", colored), true); } + if(command.contentEquals("[TELEPORT]")) + { + for(Player player : varMap.get(1)) + { + if(Bukkit.getPlayer(args[2]) != null) + { + player.teleport(Bukkit.getPlayer(args[2])); + } + else + { + String[] coords = args[2].split(" "); + int x = Integer.parseInt(coords[0]); + int y = Integer.parseInt(coords[1]); + int z = Integer.parseInt(coords[2]); + player.teleport(new Location(sign.getWorld(), x, y, z)); + } + } + } + + if(command.contentEquals("[MESSAGE]")) + { + String message = args[2]; + message += " " + args[3]; + + String colored = ChatColor.translateAlternateColorCodes('&', message); + + for(Player player : varMap.get(1)) + { + UtilPlayer.message(player, F.main("Event", colored)); + } + } + + if(command.contentEquals("[SETBLOCK]")) + { + Material mat = Material.getMaterial(args[1]); + String[] coords = args[2].split(" "); + int x = Integer.parseInt(coords[0]); + int y = Integer.parseInt(coords[1]); + int z = Integer.parseInt(coords[2]); + sign.getWorld().getBlockAt(new Location(sign.getWorld(), x, y, z)).setType(mat); + } + + if(command.contentEquals("[TESTFOR]")) + { + boolean redstone = false; + Material mat = Material.getMaterial(args[1]); + if(args[2].contains("r=")) + { + int radius = 0; + try + { + radius = Integer.parseInt(args[2].split("=")[1]); + if(radius >= 30) + radius = 30; + + for(int x = -radius + sign.getLocation().getBlockX(); x < radius + sign.getLocation().getBlockX(); x++) + { + for(int y = -radius + sign.getLocation().getBlockY(); y < radius + sign.getLocation().getBlockY(); y++) + { + for(int z = -radius + sign.getLocation().getBlockZ(); z < radius + sign.getLocation().getBlockZ(); z++) + { + if(sign.getWorld().getBlockAt(new Location(sign.getWorld(), x, y, z)).getType() == mat) + { + redstone = true; + } + } + } + } + } + catch (Exception e) {} + } + else + { + String[] coords = args[2].split(" "); + int x = Integer.parseInt(coords[0]); + int y = Integer.parseInt(coords[1]); + int z = Integer.parseInt(coords[2]); + if(sign.getWorld().getBlockAt(new Location(sign.getWorld(), x, y, z)).getType() == mat) + { + redstone = true; + } + } + if(redstone) + { + for(final BlockFace face : BlockFace.values()) + { + if(face != BlockFace.UP + && face != BlockFace.NORTH_WEST + && face != BlockFace.NORTH_EAST + && face != BlockFace.SOUTH_EAST + && face != BlockFace.SOUTH_WEST) + { + continue; + } + + if(sign.getBlock().getRelative(face).getType() != Material.AIR) + continue; + + if(sign.getBlock().getRelative(face).isBlockPowered()) + continue; + + sign.getBlock().getRelative(face).setType(Material.REDSTONE_BLOCK); + + Manager.runSyncLater(new Runnable() + { - Player player = Bukkit.getPlayer(playerName); - if(player == null) + @Override + public void run() + { + sign.getBlock().getRelative(face).setType(Material.AIR); + } + + }, 3L); + } + } + } + + if(varMap.get(1).isEmpty()) return; String[] vars = new String[args.length - 1]; @@ -585,9 +788,84 @@ public class EventGame extends Game vars[1] = args[2]; vars[2] = args[3]; - if(command.contentEquals("MOB")) + String tempArgs = ""; + for(String str : vars) { - Manager.GetEventModule().commandMob(player, vars); + for(String string : str.split(" ")) + { + tempArgs += string + " "; + } + } + String[] commandArgs = tempArgs.split(" "); + + if(command.contentEquals("[MOB]")) + { + for(Player player : varMap.get(1)) + Manager.GetEventModule().commandMob(player, commandArgs); + } + if(command.contentEquals("[SCORE]")) + { + for(Player player : varMap.get(1)) + Manager.GetEventModule().commandScoreboard(player, vars); + } + if(command.contentEquals("[GIVE]")) + { + try + { + for(Player player : varMap.get(1)) + { + String[] newArgs = new String[commandArgs.length-1]; + + for (int e=0 ; e signIter = _functionSigns.keySet().iterator(); + while(signIter.hasNext()) + { + Sign sign = signIter.next(); + if(sign.getLocation().getBlockX() == event.getBlock().getLocation().getBlockX() + && sign.getLocation().getBlockY() == event.getBlock().getLocation().getBlockY() + && sign.getLocation().getBlockZ() == event.getBlock().getLocation().getBlockZ()) + { + signIter.remove(); + } + } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java index 90d0c4f29..8880db1e7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java @@ -257,7 +257,7 @@ public class EventModule extends MiniPlugin } else if (args[0].equalsIgnoreCase("effect")) { - commandEffect(event.getPlayer(), args); + commandEffect(event.getPlayer(), args, null); } else if (args[0].equalsIgnoreCase("kit")) { @@ -987,7 +987,7 @@ public class EventModule extends MiniPlugin lineText += " "; } - ((EventGame) Manager.GetGame()).getSideText()[line] = lineText; + ((EventGame) Manager.GetGame()).getSideText()[line] = ChatColor.translateAlternateColorCodes('&', lineText); UtilPlayer.message(player, F.main("Scoreboard", "Set Line " + F.elem(line+"") + " to " + F.elem(lineText) + ".")); @@ -1533,7 +1533,7 @@ public class EventModule extends MiniPlugin commandHelp(caller); } - public void commandEffect(Player caller, String[] args) + public void commandEffect(Player caller, String[] args, ArrayList players) { //Clear if (args.length >= 3 && args[2].equalsIgnoreCase("clear")) @@ -1551,9 +1551,19 @@ public class EventModule extends MiniPlugin } else { - targets = UtilPlayer.matchOnline(caller, args[1], true); - if (targets.isEmpty()) - return; + if(players == null) + { + targets = UtilPlayer.matchOnline(caller, args[1], true); + if (targets.isEmpty()) + return; + } + else + { + targets = new LinkedList<>(); + for(Player player : players) + targets.add(player); + + } } for (Player player : targets) @@ -1647,10 +1657,20 @@ public class EventModule extends MiniPlugin _potionEffectsMult.put(type, mult); } else - { - targets = UtilPlayer.matchOnline(caller, args[1], true); - if (targets.isEmpty()) - return; + { + if(players == null) + { + targets = UtilPlayer.matchOnline(caller, args[1], true); + if (targets.isEmpty()) + return; + } + else + { + targets = new LinkedList<>(); + for(Player player : players) + targets.add(player); + + } } //Apply From 4240026024b8dbe1e4e0ca15df1f6b74403aa398 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sun, 6 Sep 2015 18:55:00 +0200 Subject: [PATCH 037/219] Adding Areas and a few more commands like /e kick and /e tempgadget to the event game. --- .../arcade/game/games/event/EventGame.java | 178 ++++++++++++++++++ .../arcade/game/games/event/EventModule.java | 120 +++++++++++- 2 files changed, 293 insertions(+), 5 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index 6f74a2da3..2a979c53a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -31,11 +31,13 @@ import mineplex.core.shop.item.SalesPackageBase; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.visibility.VisibilityManager; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.games.event.kits.KitPlayer; +import nautilus.game.arcade.game.games.sheep.kits.KitBrute; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.managers.GameHostManager; @@ -57,8 +59,10 @@ import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.event.block.SignChangeEvent; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.inventory.ItemStack; @@ -82,6 +86,8 @@ public class EventGame extends Game private HashMap _functionSigns; private ArrayList _powerdedSigns; + + private HashMap _customAreas; public EventGame(ArcadeManager manager) { @@ -131,6 +137,8 @@ public class EventGame extends Game _powerdedSigns = new ArrayList<>(); this.CreatureAllow = true; + + _customAreas = new HashMap<>(); } @EventHandler @@ -155,6 +163,35 @@ public class EventGame extends Game } } + @EventHandler + public void registerAreas(GameStateChangeEvent event) + { + if(event.GetState() != GameState.Live) + return; + + for(String name : WorldData.GetAllCustomLocs().keySet()) + { + try + { + EventArea area = new EventArea(Integer.parseInt(name.split(" ")[0])); + Location tempA = WorldData.GetAllCustomLocs().get(name).get(0); + Location tempB = WorldData.GetAllCustomLocs().get(name).get(1); + area.CornerA = new Location(tempA.getWorld(), Math.min(tempA.getX(), tempB.getX()), Math.min(tempA.getY(), tempB.getY()), Math.min(tempA.getZ(), tempB.getZ())); + area.CornerB = new Location(tempA.getWorld(), Math.max(tempA.getX(), tempB.getX()), Math.max(tempA.getY(), tempB.getY()), Math.max(tempA.getZ(), tempB.getZ())); + area.DamageAll = name.contains("ALL"); + area.DamagePvP = name.contains("PVP"); + area.DamagePvE = name.contains("PVE"); + area.DamageEvP = name.contains("EVP"); + area.Usable = true; + _customAreas.put(Integer.parseInt(name.split(" ")[0]), area); + } + catch (Exception e) + { + System.out.println("Error while parsing area locs"); + } + } + } + @EventHandler public void signPlace(SignChangeEvent event) { @@ -869,4 +906,145 @@ public class EventGame extends Game } } + @EventHandler(ignoreCancelled=true) + public void areaDamage(CustomDamageEvent event) + { + for(EventArea area : _customAreas.values()) + { + if(area.CornerA == null || area.CornerB == null) + continue; + + if(area.Usable == false) + continue; + + if(event.GetDamageeEntity().getLocation().getX() < area.CornerA.getX() || event.GetDamageeEntity().getLocation().getX() > area.CornerB.getX()) + continue; + + if(event.GetDamageeEntity().getLocation().getY() < area.CornerA.getY() || event.GetDamageeEntity().getLocation().getY() > area.CornerB.getY()) + continue; + + if(event.GetDamageeEntity().getLocation().getZ() < area.CornerA.getZ() || event.GetDamageeEntity().getLocation().getZ() > area.CornerB.getZ()) + continue; + + if(!area.DamageAll) + { + event.SetCancelled("Event Area"); + } + if(event.GetCause() == DamageCause.ENTITY_ATTACK && event.GetDamagerPlayer(true) == null) + { + if(!area.DamageEvP) + { + event.SetCancelled("Event Area"); + } + } + if(!(event.GetDamageeEntity() instanceof Player)) + { + if(!area.DamagePvE) + { + event.SetCancelled("Event Area"); + } + } + if((event.GetDamageeEntity() instanceof Player) && (event.GetDamagerEntity(true) instanceof Player)) + { + if(!area.DamagePvP) + { + event.SetCancelled("Event Area"); + } + } + } + } + + public void editArea(Player player, String[] args) + { + try + { + if(_customAreas.containsKey(Integer.parseInt(args[1]))) + { + if(args[2].equalsIgnoreCase("Del")) + { + _customAreas.remove(Integer.parseInt(args[1])); + UtilPlayer.message(player, F.main("Event", "Region deleted")); + } + if(args[2].equalsIgnoreCase("ALL")) + { + _customAreas.get(Integer.parseInt(args[1])).DamageAll = !_customAreas.get(Integer.parseInt(args[1])).DamageAll; + UtilPlayer.message(player, F.main("Event", "Damage all for Region " + args[1] + ": " + F.tf(_customAreas.get(Integer.parseInt(args[1])).DamageAll))); + } + if(args[2].equalsIgnoreCase("PVP")) + { + _customAreas.get(Integer.parseInt(args[1])).DamagePvP = !_customAreas.get(Integer.parseInt(args[1])).DamagePvP; + UtilPlayer.message(player, F.main("Event", "Damage PvP for Region " + args[1] + ": " + F.tf(_customAreas.get(Integer.parseInt(args[1])).DamagePvP))); + } + if(args[2].equalsIgnoreCase("PVE")) + { + _customAreas.get(Integer.parseInt(args[1])).DamagePvE = !_customAreas.get(Integer.parseInt(args[1])).DamagePvE; + UtilPlayer.message(player, F.main("Event", "Damage PvE for Region " + args[1] + ": " + F.tf(_customAreas.get(Integer.parseInt(args[1])).DamagePvE))); + } + if(args[2].equalsIgnoreCase("EVP")) + { + _customAreas.get(Integer.parseInt(args[1])).DamageEvP = !_customAreas.get(Integer.parseInt(args[1])).DamageEvP; + UtilPlayer.message(player, F.main("Event", "Damage EvP for Region " + args[1] + ": " + F.tf(_customAreas.get(Integer.parseInt(args[1])).DamageEvP))); + } + } + else + { + UtilPlayer.message(player, F.main("Event", "No Area Found")); + } + if(args[2].equalsIgnoreCase("Add")) + { + if(!_customAreas.containsKey(Integer.parseInt(args[1]))) + _customAreas.put(Integer.parseInt(args[1]), new EventArea(Integer.parseInt(args[1]))); + + EventArea area = _customAreas.get(Integer.parseInt(args[1])); + + if(args[3].equalsIgnoreCase("A")) + { + area.CornerA = player.getLocation(); + UtilPlayer.message(player, F.main("Event", "Corner A set!")); + } + if(args[3].equalsIgnoreCase("B")) + { + area.CornerB = player.getLocation(); + UtilPlayer.message(player, F.main("Event", "Corner B set!")); + } + if(area.CornerA != null && area.CornerB != null) + { + Location tempA = area.CornerA.clone(); + Location tempB = area.CornerB.clone(); + area.CornerA = new Location(tempA.getWorld(), Math.min(tempA.getX(), tempB.getX()), Math.min(tempA.getY(), tempB.getY()), Math.min(tempA.getZ(), tempB.getZ())); + area.CornerB = new Location(tempA.getWorld(), Math.max(tempA.getX(), tempB.getX()), Math.max(tempA.getY(), tempB.getY()), Math.max(tempA.getZ(), tempB.getZ())); + area.Usable = true; + UtilPlayer.message(player, F.main("Event", "Region is Usable")); + } + } + } + catch (Exception e) + { + UtilPlayer.message(player, F.main("Event", "Error while executing command")); + } + } + + public class EventArea + { + + public int ID; + + public Location CornerA; + public Location CornerB; + + public boolean DamageAll; + public boolean DamagePvP; + public boolean DamagePvE; + public boolean DamageEvP; + + public boolean Usable; + + public EventArea(Integer id) + { + ID = id; + Usable = false; + } + + } + } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java index 8880db1e7..e7bb773de 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java @@ -26,9 +26,12 @@ import nautilus.game.arcade.ArcadeManager; import org.bukkit.Bukkit; import org.bukkit.ChatColor; +import org.bukkit.Effect; import org.bukkit.GameMode; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.OfflinePlayer; +import org.bukkit.Sound; import org.bukkit.World; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; import org.bukkit.entity.Ageable; @@ -36,16 +39,17 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; +import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.entity.Slime; import org.bukkit.entity.Villager; +import org.bukkit.entity.Villager.Profession; import org.bukkit.entity.Wolf; import org.bukkit.entity.Zombie; -import org.bukkit.entity.Skeleton.SkeletonType; -import org.bukkit.entity.Villager.Profession; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; @@ -59,12 +63,17 @@ public class EventModule extends MiniPlugin private NautHashMap _potionEffectsDuration = new NautHashMap<>(); private NautHashMap _potionEffectsMult = new NautHashMap<>(); - private boolean _mobGriefing = true; + private boolean _mobGriefing; + + private ArrayList _stacker; + private boolean _allowStacker; public EventModule(ArcadeManager manager, JavaPlugin plugin) { super("EventModule", plugin); Manager = manager; + _mobGriefing = true; + _stacker = new ArrayList<>(); } @EventHandler @@ -356,14 +365,50 @@ public class EventModule extends MiniPlugin { commandBlockPlaceInCreative(event.getPlayer(), args); } - else if(args[0].equalsIgnoreCase("blockbreakcreative")) + else if(args[0].equalsIgnoreCase("stacker")) { - commandBlockBreakInCreative(event.getPlayer(), args); + commandStacker(event.getPlayer(), args); + } + else if(args[0].equalsIgnoreCase("area")) + { + if(!(Manager.GetGame() instanceof EventGame)) { + UtilPlayer.message(event.getPlayer(), F.main("Settings", "You can only edit areas in the Event game!")); + return; + } + + ((EventGame) Manager.GetGame()).editArea(event.getPlayer(), args); } else if(args[0].equalsIgnoreCase("mobgriefing")) { commandMobGriefing(event.getPlayer(), args); } + else if(args[0].equalsIgnoreCase("kick")) + { + if(Bukkit.getPlayer(args[1]) == null) + { + UtilPlayer.message(event.getPlayer(), "No matches for: " + C.cYellow + args[1]); + return; + } + Bukkit.getPlayer(args[1]).kickPlayer("You where kicked from the event, probably you didn't stick to the Event Rules."); + UtilPlayer.message(event.getPlayer(), F.main("Event", "You kicked " + C.cYellow + Bukkit.getPlayer(args[1]).getName())); + } + else if(args[0].equalsIgnoreCase("tempgadget")) + { + String gadget = args[1]; + for(int e = 2; e < args.length; e++) + gadget+= " " + args[e]; + + try + { + for(Player target : UtilServer.getPlayers()) + Manager.GetDonation().Get(target).AddUnknownSalesPackagesOwned(gadget); + } + catch (Exception e) + { + UtilPlayer.message(event.getPlayer(), F.main("Event", "Gadget is not vallid")); + } + UtilPlayer.message(event.getPlayer(), F.main("Event", "You gave the gadget " + F.item(gadget) + " to all Players!")); + } } public void listSettings(Player player) @@ -396,6 +441,33 @@ public class EventModule extends MiniPlugin UtilPlayer.message(player, F.main("Settings", "BlockBreakCreative: " + F.tf(Manager.GetGame().BlockBreakCreative))); } + public void commandStacker(Player player, String[] args) + { + if(args.length == 1) + { + _allowStacker = !_allowStacker; + UtilPlayer.message(player, F.main("Settings", "Stacker all: " + F.tf(_allowStacker))); + } + else + { + for(Player target : UtilPlayer.matchOnline(player, args[1], true)) + { + if(_stacker.contains(target)) + { + _stacker.remove(target); + UtilPlayer.message(target, F.main("Settings", "Stacker: " + F.tf(false))); + UtilPlayer.message(player, F.main("Settings", "Stacker " + target.getName() + ": " + F.tf(false))); + } + else + { + _stacker.add(target); + UtilPlayer.message(target, F.main("Settings", "Stacker: " + F.tf(true))); + UtilPlayer.message(player, F.main("Settings", "Stacker " + target.getName() + ": " + F.tf(true))); + } + } + } + } + public void commandBlockPlaceInCreative(Player player, String[] args) { Manager.GetGame().BlockPlaceCreative = !Manager.GetGame().BlockPlaceCreative; @@ -1706,4 +1778,42 @@ public class EventModule extends MiniPlugin } } + @EventHandler + public void StackPlayer(PlayerInteractEntityEvent event) + { + if (!Manager.GetGame().IsLive()) + return; + + if (!(event.getRightClicked() instanceof Player)) + return; + + if (event.getRightClicked().getVehicle() != null) + return; + + Player player = event.getPlayer(); + Player other = (Player)event.getRightClicked(); + + if(!_allowStacker && !_stacker.contains(player)) + return; + + if (Manager.isSpectator(event.getPlayer())) + return; + + if (!Manager.GetGame().IsAlive(event.getPlayer())) + return; + + //Effect + event.getRightClicked().getWorld().playEffect(event.getRightClicked().getLocation(), Effect.STEP_SOUND, 35); + + //Stack + player.setPassenger(other); + + //Audio + player.playSound(player.getLocation(), Sound.HORSE_ARMOR, 1f, 1f); + + //Inform + UtilPlayer.message(other, F.main("Event", F.elem(Manager.GetGame().GetTeam(player).GetColor() + player.getName()) + " picked you up.")); + UtilPlayer.message(player, F.main("Event", "You picked up " + F.elem(Manager.GetGame().GetTeam(other).GetColor() + other.getName()) + ".")); + } + } From 5824ec6df0a5f776dcdbf3477c2be327505492d5 Mon Sep 17 00:00:00 2001 From: fooify Date: Mon, 7 Sep 2015 07:08:00 -0700 Subject: [PATCH 038/219] lots of changes to monster maze, check trello for list --- .../arcade/game/games/monstermaze/Maze.java | 197 +++++++++--------- .../game/games/monstermaze/MonsterMaze.java | 19 +- .../game/games/monstermaze/SafePad.java | 71 ++++++- .../game/games/monstermaze/kits/KitHyper.java | 3 + 4 files changed, 168 insertions(+), 122 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index 176b2c8eb..80d4db89d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -47,6 +47,7 @@ public class Maze implements Listener private ArrayList _goals; private HashSet _waypoints; private HashSet _disabledWaypoints; + private HashSet _oldDisabledWaypoints; private ArrayList _borders; private Location _center; @@ -60,8 +61,6 @@ public class Maze implements Listener private int _phaseTimer = -1; private int _padDecayTimer = -1; - - private ArrayList _clientsideBlocks = new ArrayList<>(); private HashMap _ents = new HashMap(); @@ -75,6 +74,7 @@ public class Maze implements Listener _waypoints = new HashSet(); _disabledWaypoints = new HashSet(); + _oldDisabledWaypoints = new HashSet(); for (Location loc : _map) { @@ -91,6 +91,7 @@ public class Maze implements Listener for (Location loc : _spawns) { + _waypoints.add(loc.getBlock()); loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GOLD_BLOCK); } @@ -110,12 +111,18 @@ public class Maze implements Listener public void update() { + if(_safePad != null) + { + for(Player p : Host.GetPlayers(true)) + p.setCompassTarget(_safePad.getLocation()); + } if (Host.IsLive()) { //checkGoal(); checkPlayersOnSafePad(); move(); bump(); + removeMobsOnSafePad(); if(_phaseTimer <= -1) { for(Player p : Host.GetPlayers(true)) @@ -141,6 +148,34 @@ public class Maze implements Listener } } } + + private void removeMobsOnSafePad() + { + Iterator it = _ents.keySet().iterator(); + while (it.hasNext()) { + Entity e = it.next(); + if(_safePad != null) + { + if(_safePad.isOn(e)) + { + System.out.println("entity on safepad removed"); + it.remove(); + e.remove(); + continue; + } + } + + if(_oldSafePad != null) + { + if(_oldSafePad.isOn(e)) + { + System.out.println("entity on old safepad removed"); + it.remove(); + e.remove(); + } + } + } + } private void bump() { @@ -150,13 +185,15 @@ public class Maze implements Listener if (!Recharge.Instance.usable(player, "Monster Hit")) continue; - if(_playersOnPad.contains(player)) - continue; + if(_safePad != null) + { + if(_safePad.isOn(player)) continue; + } //Hit Snowman for (Entity ent : _ents.keySet()) { - if (UtilMath.offset2d(player, ent) < 1) + if (UtilMath.offset(player, ent) < 1) { Recharge.Instance.useForce(player, "Monster Hit", 1000); @@ -382,10 +419,13 @@ public class Maze implements Listener { _oldSafePad = _safePad; _oldSafePad.turnOffBeacon(); - _padDecayTimer = 5; + _padDecayTimer = 11; + + _oldDisabledWaypoints = new HashSet<>(_disabledWaypoints); } + _disabledWaypoints.clear(); ArrayList goals = new ArrayList(_goals); - if(_oldSafePad != null) goals.remove(_oldSafePad.getLocation()); + if(_oldSafePad != null) goals.remove(_oldSafePad.getLocation().clone().add(0, 1, 0)); _safePad = new SafePad(Host, this, UtilAlg.Random(goals).clone().subtract(0,1,0)); // maybe don't need to clone() _safePad.build(); @@ -419,34 +459,63 @@ public class Maze implements Listener if(_padDecayTimer == -1) return; _padDecayTimer--; - // 5 + if(_oldSafePad != null) { - if(_padDecayTimer == 4) + if(_padDecayTimer == 10) { - _oldSafePad.setGlassData((byte)4); - _oldSafePad.turnOffBeacon(); + _oldSafePad.setGlassData((byte)5); // green + _oldSafePad.turnOffBeacon(); + _oldSafePad.setCrackedProgress(1); + } + else if(_padDecayTimer == 9) + { + _oldSafePad.setCrackedProgress(2); + } + else if(_padDecayTimer == 8) + { + _oldSafePad.setGlassData((byte)4); // yellow + _oldSafePad.setCrackedProgress(3); + } + else if(_padDecayTimer == 7) + { + _oldSafePad.setCrackedProgress(4); + } + else if(_padDecayTimer == 6) + { + _oldSafePad.setGlassData((byte)1); // orange + _oldSafePad.setCrackedProgress(5); + } + else if(_padDecayTimer == 5) + { + _oldSafePad.setCrackedProgress(6); + } + else if(_padDecayTimer == 4) + { + _oldSafePad.setGlassData((byte)14); // red + _oldSafePad.setCrackedProgress(7); } else if(_padDecayTimer == 3) { - _oldSafePad.setGlassData((byte)1); + _oldSafePad.setCrackedProgress(8); } else if(_padDecayTimer == 2) { - _oldSafePad.setGlassData((byte)14); + _oldSafePad.setCrackedProgress(9); } else if(_padDecayTimer == 1) { + _oldSafePad.setCrackedProgress(-1); _oldSafePad.destroy(); _oldSafePad = null; - if(_disabledWaypoints.size() > 0) + if(_oldDisabledWaypoints.size() > 0) { - for(Block b : _disabledWaypoints) + for(Block b : _oldDisabledWaypoints) { _waypoints.add(b); } - _disabledWaypoints.clear(); + _oldDisabledWaypoints.clear(); } } } @@ -464,7 +533,7 @@ public class Maze implements Listener if(_phaseTimer == 15 || _phaseTimer == 10) { - UtilTextMiddle.display("", C.cGray + C.Bold + _phaseTimer + " seconds to get to the Safe Zone!", 0, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); + UtilTextMiddle.display("", C.cAqua + C.Bold + _phaseTimer + " seconds to get to the Safe Pad!", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); } if(_phaseTimer == 5 || _phaseTimer == 4) @@ -519,111 +588,33 @@ public class Maze implements Listener { if(_safePad.isOn(p) && !_playersOnPad.contains(p)) { + UtilPlayer.message(p, F.main("Game", C.cGreen + "Great, you made it. Stay on the Safe Pad!")); _playersOnPad.add(p); if(_playersOnPad.size() == 1) // first player { - _phaseTimer = 21; // start the countdown + _phaseTimer = 20; // start the countdown UtilTextMiddle.display(C.cGold + C.Bold + "AWESOME!", C.cGold + "You were the first to make it to the Safe Pad!", 5, 40, 5, p); p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); - UtilPlayer.message(p, F.main("Game", C.cGreen + "Great, you made it. Stay on the Safe Pad!")); ArrayList pElse = Host.GetPlayers(false); pElse.remove(p); for(Player i : pElse) { UtilPlayer.message(i, C.cRed + C.Bold + p.getName() + " was the first to make it to the Safe Pad!"); - UtilPlayer.message(i, C.cRed + "Everyone not on the Safe Pad in 20 seconds will die!"); // I don't like this message + UtilPlayer.message(i, C.cGray + "Everyone not on the Safe Pad in 20 seconds will die!"); // I don't like this message } } else // not the first { p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); UtilTextMiddle.display(C.cGreen + C.Bold + "Great!", C.cGreen + "Stay on the Safe Pad!", 5, 40, 5, p); } - - buildSafePadBarrier(p); } - } - } - - private void buildSafePadBarrier(Player p) - { - ArrayList _cube = UtilBlock.getInBoundingBox(_safePad.getLocation().clone().add(3, 2, 3), _safePad.getLocation().clone().add(-3, 1, -3), false); - ArrayList _hollowedCube = UtilBlock.getInBoundingBox(_safePad.getLocation().clone().add(2, 2, 2), _safePad.getLocation().clone().add(-2, 1, -2), false); - _cube.removeAll(_hollowedCube); - - for(Block b : _cube) - { - _clientsideBlocks.add(new ClientsideBlock(p, b.getLocation(), Material.STAINED_GLASS, (byte)3)); - } - } - - private void removeSafePadBarrier() // for all players ;) - { - for(ClientsideBlock csb : _clientsideBlocks) - { - csb.disable(); - } - _clientsideBlocks.clear(); - } - - private class ClientsideBlock - { - private Player _player; - - private Location _loc; - private Material _mat; - private byte _data; - - private Material _origMat; - private byte _origData; - - private boolean _shown = false; - - public ClientsideBlock(Player p, Location loc, Material mat, byte data) - { - _player = p; - - _loc = loc; - _mat = mat; - _data = data; - - _origMat = _loc.getBlock().getType(); - _origData = _loc.getBlock().getData(); - - enable(); - } - - public void enable() - { - if(isShown()) return; - - _player.sendBlockChange(_loc, _mat, _data); - _shown = true; - } - - public void disable() - { - if(!isShown()) return; - - _player.sendBlockChange(_loc, _origMat, _origData); - - _shown = false; - } - - public boolean isShown() // this can break if the block changes and overrides the client-side blocks, but this won't happen if it's being used properly (maybe should add a check?...) - { - return _shown; - } - - public Player getPlayer() - { - return _player; - } - - public Location getLocation() - { - return _loc; + if(!_safePad.isOn(p) && _playersOnPad.contains(p)) + { + UtilTextMiddle.display(C.cDRed + C.Bold + "Danger!", C.cRed + "Get back to the Safe Pad!", 0, 10, 0, p); + //UtilTextBottom.display(C.cRed + "Get back to the Safe Pad!", p); + } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index 2434af05e..ef3d0b73a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -40,8 +40,7 @@ public class MonsterMaze extends SoloGame new String[] { - "Get to the safe pad, but avoid the monsters!", - "You can't jump.", + "Be the first to make it to the Safe Pad, but avoid the monsters!" }); this.DamagePvP = false; @@ -69,10 +68,7 @@ public class MonsterMaze extends SoloGame _maze.spawnSafePad(); } else if(event.GetState() == GameState.Live) - { - for(Player player : GetPlayers(true)) - player.setGameMode(GameMode.ADVENTURE); - + { _maze.removePlayerContainmentUnit(); UtilTextMiddle.display(C.cAqua + C.Bold + "Push F5", C.cWhite + "Monster Maze is best played in 3rd Person", 10, 70, 10); @@ -91,14 +87,21 @@ public class MonsterMaze extends SoloGame } @EventHandler - public void Antijump(UpdateEvent event) + public void PotionEffects(UpdateEvent event) { if(event.getType() != UpdateType.SEC) return; // because why not if(!InProgress()) return; for(Player pl : GetPlayers(true)) { pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000000, 250)); - pl.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 80, 250)); + if(GetPlayers(true).size() > 4) + { + pl.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1000000000, 250)); + } + else + { + pl.removePotionEffect(PotionEffectType.INVISIBILITY); + } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java index 76d3753f6..e2d9e5a73 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java @@ -1,18 +1,21 @@ package nautilus.game.arcade.game.games.monstermaze; import java.util.ArrayList; +import java.util.Iterator; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; import org.bukkit.entity.Entity; -import org.bukkit.event.Listener; +import org.bukkit.entity.Player; import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilPlayer; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutBlockBreakAnimation; public class SafePad { @@ -80,11 +83,11 @@ public class SafePad public class SafePadBlock { - Material _origM; - byte _origD; + private Material _origM; + private byte _origD; - Material _tempMat; - byte _tempData; + private Material _tempMat; + private byte _tempData; Location _loc; @@ -111,6 +114,16 @@ public class SafePad MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData); } + public Material getBlockMaterial() + { + return _loc.getBlock().getType(); + } + + public byte getBlockData() + { + return _loc.getBlock().getData(); + } + public Location getLocation() { return _loc; @@ -139,7 +152,7 @@ public class SafePad { for(SafePadBlock spb : _blocks) { - if(!spb.getLocation().getBlock().getType().equals(Material.STAINED_GLASS)) continue; + if(!spb.getBlockMaterial().equals(Material.STAINED_GLASS)) continue; spb.setData(newData); } } @@ -148,8 +161,8 @@ public class SafePad { for(SafePadBlock bl : _blocks) { - if(bl.getLocation().getBlock().getType().equals(Material.GOLD_BLOCK)) bl.restore(); - if(bl.getLocation().getBlock().getType().equals(Material.BEACON)) + if(bl.getBlockMaterial().equals(Material.GOLD_BLOCK)) bl.restore(); + if(bl.getBlockMaterial().equals(Material.BEACON)) { bl.setMaterial(Material.STAINED_GLASS); bl.setData((byte)5); @@ -157,6 +170,42 @@ public class SafePad } } + public void setCrackedProgress(int progress) + { + int i = 0; + Iterator iter = _blocks.iterator(); + ArrayList packets = new ArrayList(); + while(iter.hasNext()) + { + SafePadBlock spb = iter.next(); + if(!spb.getLocation().getBlock().getType().equals(Material.STAINED_GLASS)) continue; + + UtilParticle.PlayParticle(ParticleType.BLOCK_DUST.getParticle(Material.STAINED_GLASS, spb.getBlockData()), spb.getLocation(), 0.5f, 0.5f, 0.5f, 0.05f, 8, ViewDist.NORMAL, Host.GetPlayers(false).toArray(new Player[Host.GetPlayers(false).size()])); + + i++; + + Packet packet = new PacketPlayOutBlockBreakAnimation(i, spb.getLocation().getBlockX(), spb.getLocation().getBlockY(), spb.getLocation().getBlockZ(), progress); + packets.add(packet); + } + for(Player p : Host.GetPlayers(false)) + { + Packet[] pcks = new Packet[packets.size()]; + packets.toArray(pcks); + UtilPlayer.sendPacket(p, pcks); + } + /*for(SafePadBlock spb : _blocks) + { + if(!spb.getLocation().getBlock().getType().equals(Material.STAINED_GLASS)) continue; + + UtilParticle.PlayParticle(ParticleType.BLOCK_DUST.getParticle(Material.STAINED_GLASS, spb.getBlockData()), spb.getLocation(), 0.5f, 0.5f, 0.5f, 0.05f, 8, ViewDist.NORMAL, Host.GetPlayers(false).toArray(new Player[Host.GetPlayers(false).size()])); + Packet packet = new PacketPlayOutBlockBreakAnimation(1, spb.getLocation().getBlockX(), spb.getLocation().getBlockY(), spb.getLocation().getBlockZ(), progress); + for(Player p : Host.GetPlayers(false)) + { + UtilPlayer.sendPacket(p, packet); + } + }*/ + } + public void destroy() { for(SafePadBlock bl : _blocks) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitHyper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitHyper.java index 5e08deb76..0408a5381 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitHyper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitHyper.java @@ -36,6 +36,9 @@ public class KitHyper extends Kit @Override public void GiveItems(Player player) { + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COMPASS, (byte)0, 1, + C.cYellow + "Safe Pad Tracking Device™")); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SUGAR, (byte)0, 3, C.cYellow + C.Bold + "Right-click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Speed Boost")); } From b56813deefbfef323b39328c8dd53c259409fdaa Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 12 Sep 2015 04:33:10 +0200 Subject: [PATCH 039/219] Improving /e commands (/e kick, /e area, etc) --- .../arcade/game/games/event/EventGame.java | 50 +++++-- .../arcade/game/games/event/EventModule.java | 132 ++++++++++++++++-- 2 files changed, 165 insertions(+), 17 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index 2a979c53a..a96234726 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -13,6 +13,7 @@ import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; @@ -62,6 +63,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerToggleFlightEvent; @@ -851,13 +853,7 @@ public class EventGame extends Game { for(Player player : varMap.get(1)) { - String[] newArgs = new String[commandArgs.length-1]; - - for (int e=0 ; e area.CornerB.getX()) continue; @@ -929,12 +936,14 @@ public class EventGame extends Game if(!area.DamageAll) { event.SetCancelled("Event Area"); + continue; } if(event.GetCause() == DamageCause.ENTITY_ATTACK && event.GetDamagerPlayer(true) == null) { if(!area.DamageEvP) { event.SetCancelled("Event Area"); + continue; } } if(!(event.GetDamageeEntity() instanceof Player)) @@ -942,6 +951,7 @@ public class EventGame extends Game if(!area.DamagePvE) { event.SetCancelled("Event Area"); + continue; } } if((event.GetDamageeEntity() instanceof Player) && (event.GetDamagerEntity(true) instanceof Player)) @@ -949,8 +959,17 @@ public class EventGame extends Game if(!area.DamagePvP) { event.SetCancelled("Event Area"); + continue; } } + if(!Manager.GetGame().DamagePvP) + { + Manager.GetGame().Damage = true; + Manager.GetGame().DamagePvP = true; + Bukkit.getPluginManager().callEvent(event); + Manager.GetGame().DamagePvP = false; + Manager.GetGame().Damage = false; + } } } @@ -1024,6 +1043,21 @@ public class EventGame extends Game } } + @EventHandler + public void preventChestDrop(PlayerDropItemEvent event) + { + if(event.getItemDrop() == null) + return; + + if(event.getItemDrop().getItemStack().getType() != Material.CHEST) + return; + + if(!event.getItemDrop().getItemStack().hasItemMeta()) + return; + + event.setCancelled(true); + } + public class EventArea { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java index e7bb773de..82315cc58 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java @@ -12,16 +12,22 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilSystem; import mineplex.core.common.util.UtilText; +import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.creature.event.CreatureKillEntitiesEvent; +import mineplex.core.event.StackerEvent; +import mineplex.core.gadget.gadgets.MorphBlock; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.give.Give; import mineplex.core.mount.Mount; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeManager; import org.bukkit.Bukkit; @@ -50,6 +56,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; @@ -65,7 +72,10 @@ public class EventModule extends MiniPlugin private boolean _mobGriefing; + private HashSet _tempStackShift = new HashSet(); + private ArrayList _stacker; + private ArrayList _damage; private boolean _allowStacker; public EventModule(ArcadeManager manager, JavaPlugin plugin) @@ -74,6 +84,7 @@ public class EventModule extends MiniPlugin Manager = manager; _mobGriefing = true; _stacker = new ArrayList<>(); + _damage = new ArrayList<>(); } @EventHandler @@ -369,6 +380,29 @@ public class EventModule extends MiniPlugin { commandStacker(event.getPlayer(), args); } + else if(args[0].equalsIgnoreCase("playerdamage")) + { + if(args[1] == null) + { + UtilPlayer.message(event.getPlayer(), F.main("Event", "Insufficient arguments!")); + return; + } + + if(Bukkit.getPlayer(args[1]) == null) + { + UtilPlayer.message(event.getPlayer(), F.main("Event", "This Player is not online!")); + return; + } + + if(_damage.contains(Bukkit.getPlayer(args[1]))) + _damage.remove(Bukkit.getPlayer(args[1])); + else + _damage.add(Bukkit.getPlayer(args[1])); + } + else if(args[0].equalsIgnoreCase("bc")) + { + commandBC(event.getPlayer(), args); + } else if(args[0].equalsIgnoreCase("area")) { if(!(Manager.GetGame() instanceof EventGame)) { @@ -389,8 +423,9 @@ public class EventModule extends MiniPlugin UtilPlayer.message(event.getPlayer(), "No matches for: " + C.cYellow + args[1]); return; } - Bukkit.getPlayer(args[1]).kickPlayer("You where kicked from the event, probably you didn't stick to the Event Rules."); - UtilPlayer.message(event.getPlayer(), F.main("Event", "You kicked " + C.cYellow + Bukkit.getPlayer(args[1]).getName())); + //Bukkit.getPlayer(args[1]).kickPlayer("You where kicked from the event, probably you didn't stick to the Event Rules."); + Manager.GetGameHostManager().getBlacklist().add(Bukkit.getPlayer(args[1]).getName()); + UtilPlayer.message(event.getPlayer(), F.main("Event", "You removed " + C.cYellow + Bukkit.getPlayer(args[1]).getName())); } else if(args[0].equalsIgnoreCase("tempgadget")) { @@ -1562,6 +1597,16 @@ public class EventModule extends MiniPlugin UtilPlayer.message(caller, F.main("Creature", "Killed " + target + ". " + count + " Removed.")); } + public void commandBC(Player caller, String[] args) + { + String message = args[1]; + for(int e = 2; e <= 3; e++) + message += " " + args[e]; + + String colored = ChatColor.translateAlternateColorCodes('&', message); + Manager.GetGame().Announce(F.main("Event", colored), true); + } + public void commandKit(Player caller, String[] args) { @@ -1773,25 +1818,25 @@ public class EventModule extends MiniPlugin { for(PotionEffectType effect : _potionEffectsDuration.keySet()) { + if(_potionEffectsDuration.get(effect) < 0) + continue; + player.addPotionEffect(new PotionEffect(effect, (int) (((_potionEffectsDuration.get(effect) - System.currentTimeMillis()) / 1000) * 20), _potionEffectsMult.get(effect))); } } } @EventHandler - public void StackPlayer(PlayerInteractEntityEvent event) + public void StackEntity(PlayerInteractEntityEvent event) { if (!Manager.GetGame().IsLive()) return; - if (!(event.getRightClicked() instanceof Player)) - return; - if (event.getRightClicked().getVehicle() != null) return; Player player = event.getPlayer(); - Player other = (Player)event.getRightClicked(); + Entity other = event.getRightClicked(); if(!_allowStacker && !_stacker.contains(player)) return; @@ -1802,6 +1847,17 @@ public class EventModule extends MiniPlugin if (!Manager.GetGame().IsAlive(event.getPlayer())) return; + if (Manager.getCosmeticManager().getGadgetManager().getActive(player, GadgetType.Morph) instanceof MorphBlock) + { + UtilPlayer.message(player, F.main("Stacker", "You cannot stack while using the Block Morph.")); + return; + } + + StackerEvent stackerEvent = new StackerEvent(player); + Bukkit.getServer().getPluginManager().callEvent(stackerEvent); + if (stackerEvent.isCancelled()) + return; + //Effect event.getRightClicked().getWorld().playEffect(event.getRightClicked().getLocation(), Effect.STEP_SOUND, 35); @@ -1812,8 +1868,66 @@ public class EventModule extends MiniPlugin player.playSound(player.getLocation(), Sound.HORSE_ARMOR, 1f, 1f); //Inform - UtilPlayer.message(other, F.main("Event", F.elem(Manager.GetGame().GetTeam(player).GetColor() + player.getName()) + " picked you up.")); - UtilPlayer.message(player, F.main("Event", "You picked up " + F.elem(Manager.GetGame().GetTeam(other).GetColor() + other.getName()) + ".")); + if ((event.getRightClicked() instanceof Player)) + { + UtilPlayer.message(other, F.main("Event", F.elem(Manager.GetGame().GetTeam(player).GetColor() + player.getName()) + " picked you up.")); + UtilPlayer.message(player, F.main("Event", "You picked up " + F.elem(Manager.GetGame().GetTeam(((Player) other)).GetColor() + ((Player) other).getName()) + ".")); + } } + + @EventHandler + public void ThrowEntity(PlayerInteractEvent event) + { + if (!UtilEvent.isAction(event, ActionType.L)) + return; + Player thrower = event.getPlayer(); + + if (thrower.getVehicle() != null) + return; + + Entity throwee = thrower.getPassenger(); + if (throwee == null) + return; + + StackerEvent stackerEvent = new StackerEvent(thrower); + Bukkit.getServer().getPluginManager().callEvent(stackerEvent); + if (stackerEvent.isCancelled()) + return; + + thrower.eject(); + + Entity throweeStack = throwee.getPassenger(); + if (throweeStack != null) + { + throwee.eject(); + throweeStack.leaveVehicle(); + + final Entity fThrower = thrower; + final Entity fThroweeStack = throweeStack; + + _tempStackShift.add(throweeStack); + + getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable() + { + public void run() + { + fThrower.setPassenger(fThroweeStack); + _tempStackShift.remove(fThroweeStack); + } + }, 2); + } + } + + @EventHandler(ignoreCancelled=true) + public void playerDamage(CustomDamageEvent event) + { + + } + + public ArrayList getDamagePlayers() + { + return _damage; + } + } From 55ac104e2cfe283f76ee6cebe3ac69e27070d94f Mon Sep 17 00:00:00 2001 From: fooify Date: Sat, 12 Sep 2015 09:50:06 -0700 Subject: [PATCH 040/219] took forever to get it working, but the maze parsing works! :) --- .../src/mineplex/mapparser/MapParser.java | 151 +++++++++- .../game/games/monstermaze/MMMazes.java | 273 ++++++++++++++++++ .../arcade/game/games/monstermaze/Maze.java | 34 +-- .../game/games/monstermaze/MonsterMaze.java | 15 +- 4 files changed, 444 insertions(+), 29 deletions(-) create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java index 622e7516c..50ff24667 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java @@ -1,7 +1,11 @@ package mineplex.mapparser; +import java.io.BufferedWriter; import java.io.File; +import java.io.FileWriter; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -50,7 +54,26 @@ import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; -import mineplex.mapparser.command.*; +import mineplex.mapparser.command.AdminCommand; +import mineplex.mapparser.command.AuthorCommand; +import mineplex.mapparser.command.BaseCommand; +import mineplex.mapparser.command.CopyCommand; +import mineplex.mapparser.command.CopySchematicsCommand; +import mineplex.mapparser.command.CreateCommand; +import mineplex.mapparser.command.DeleteCommand; +import mineplex.mapparser.command.GameTypeCommand; +import mineplex.mapparser.command.HubCommand; +import mineplex.mapparser.command.ListCommand; +import mineplex.mapparser.command.MapCommand; +import mineplex.mapparser.command.NameCommand; +import mineplex.mapparser.command.ParseCommand200; +import mineplex.mapparser.command.ParseCommand400; +import mineplex.mapparser.command.ParseCommand600; +import mineplex.mapparser.command.RenameCommand; +import mineplex.mapparser.command.SaveCommand; +import mineplex.mapparser.command.SetSpawnCommand; +import mineplex.mapparser.command.SpawnCommand; +import mineplex.mapparser.command.WorldsCommand; public class MapParser extends JavaPlugin implements Listener { @@ -694,6 +717,132 @@ public class MapParser extends JavaPlugin implements Listener } } + @EventHandler + public void mmMazeParser(PlayerInteractEvent event) + { + if (event.isCancelled()) + return; + + if (event.getAction() != Action.LEFT_CLICK_BLOCK) return; + + //Permission + if (!GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer())) + { + return; + } + + Player player = event.getPlayer(); + + if (!UtilGear.isMat(player.getItemInHand(), Material.WEB)) + return; + + event.setCancelled(true); + + // parse + + Block clicked = event.getClickedBlock(); + Location center = clicked.getLocation(); + Location lowestCorner = center.clone().subtract(50, 0, 50); + + ArrayList blocks = UtilBlock.getInBoundingBox(center.clone().add(50, 0, 50), center.clone().subtract(49, 0, 49), false); + + // 0 = air or other + // 1 = path - quartz + // 2 = mob spawn - gold + // 3 = safe spawn - stone + + int[][] maze = new int[100][100]; + + /*Iterator iter = blocks.iterator(); + while(iter.hasNext()) + { + Block b = iter.next(); + switch (b.getType()) { + case QUARTZ_BLOCK: + maze[x][y] = 1; + break; + + case GOLD_BLOCK: + maze[x][y] = 2; + break; + + case STONE: + maze[x][y] = 3; + break; + + default: + maze[x][y] = 0; + break; + } + x++; + if(x > 99) + { + y++; + x = 0; + } + if(y > 99) + { + System.out.println("y > 99"); + break; + } + }*/ + + for (int i = 0; i < 100; i++) + for (int j = 0; j < 100; j++) + maze[i][j] = getMMParseValue(lowestCorner.clone().add(j, 0, i).getBlock().getType()); + + //Save + try + { + FileWriter fstream = new FileWriter(GetData(player.getWorld().getName()).MapFolder + File.separator + "Maze.dat"); + BufferedWriter out = new BufferedWriter(fstream); + + out.write("private static final int[][] PARSED_MAZE = {" + System.lineSeparator()); + for (int j[] : maze) + { + out.write("{"); + boolean first = true; + for (int k : j) + { + if(!first) out.write(","); + out.write(k + ""); + + first = false; + } + out.write("}," + System.lineSeparator()); + } + out.write("};" + System.lineSeparator()); + + out.close(); + } + catch (Exception e) + { + player.sendMessage(C.cRed + C.Bold + "MMMazeParse: " + ChatColor.RESET + "An error has occured, see console."); + e.printStackTrace(); + } + player.sendMessage(C.cGreen + C.Bold + "MMMazeParse: " + ChatColor.RESET + "Maze parsed."); + } + + private int getMMParseValue(Material m) + { + switch (m) { + case QUARTZ_BLOCK: + return 1; + + case GOLD_BLOCK: + return 2; + + case STONE: + return 3; + + case DIRT: + return 4; + + default: + return 0; + } + } + private HashSet searchLog(HashSet blocks, Block current) { //Not Tree diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java new file mode 100644 index 000000000..f283f2d56 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java @@ -0,0 +1,273 @@ +package nautilus.game.arcade.game.games.monstermaze; + +import java.util.ArrayList; +import java.util.Iterator; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.BlockFace; + +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilWorld; + +public class MMMazes +{ + public static MazePreset getRandomMapPreset(Location loc) + { + return new MazePreset(M1, loc); // TODO randomization + } + + public static class MazePreset + { + private boolean _built = false; + + private ArrayList _maze = new ArrayList(); + private ArrayList _validSafePadSpawns; + private ArrayList _spawns = new ArrayList(); + + private ArrayList _centerSafeZone = new ArrayList(); + private ArrayList _glassBounds = new ArrayList(); + + private Location _center; + + public MazePreset(int[][] rawMaze, Location loc) + { + int[][] maze = rawMaze; + + _center = loc; + + Location cur = _center.clone().subtract(49, 0, 49); + + // x/y refers to array coordinates, not physical minecraft location + for (int y = 0; y < 100; y++) + { + for (int x = 0; x < 100; x++) + { + int i = maze[y][x]; + if(i == 1) + { + _maze.add(cur); + } + else if(i == 2) + { + _maze.add(cur); + _spawns.add(cur); + } + else if(i == 3) + { + _centerSafeZone.add(cur); + } + else if(i == 4) + { + _centerSafeZone.add(cur); + _glassBounds.add(cur.clone().add(0, 2, 0)); + } + cur = cur.clone().add(0, 0, 1); + } + cur.setZ(_center.clone().subtract(49, 0, 49).getZ()); + cur = cur.clone().add(1, 0, 0); + } + + _validSafePadSpawns = new ArrayList(_maze); + + Iterator iter = _validSafePadSpawns.iterator(); + removeLoop: while(iter.hasNext()) + { + Location l = iter.next(); + + for(Location s : _spawns) + { + if(UtilMath.offset2d(l, s) < 10) + { + iter.remove(); + continue removeLoop; + } + } + + for(Location b : _glassBounds) + { + if(UtilMath.offset2d(l, b) < 7) + { + iter.remove(); + continue removeLoop; + } + } + } + } + + public void printInfo() + { + System.out.println("_maze.size() == " + _maze.size()); + System.out.println("_spawns.size() == " + _spawns.size()); + System.out.println("_centerSafeZone.size() == " + _centerSafeZone.size()); + } + + public void build() + { + StringBuilder sb = new StringBuilder(); + for(Location loc : _maze) + { + sb.append("_maze: " + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ() + " "); + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.QUARTZ_BLOCK); + } + + for(Location loc : _spawns) + { + sb.append("_spawns: " + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ() + " "); + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GOLD_BLOCK); + } + + for(Location loc : _centerSafeZone) + { + sb.append("_centerSafeZone: " + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ() + " "); + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); + loc.getBlock().getRelative(BlockFace.DOWN).setData((byte)8); + } + System.out.println(sb.toString()); + _built = true; + } + + public ArrayList getSpawns() + { + return _spawns; + } + + public boolean isBuilt() + { + return _built; + } + + // anywhere a monster can walk + public ArrayList getMaze() + { + return _maze; + } + + public ArrayList getGlassBounds() + { + return _glassBounds; + } + + public ArrayList getCenterSafeZone() + { + return _centerSafeZone; + } + + public ArrayList getValidSafePadSpawns() + { + return _validSafePadSpawns; + } + + public Location getCenter() + { + return _center; + } + } + + // PARSED MAZES + + private static final int[][] M1 = { + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,1,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2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1,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,1,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + }; + + +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index 80d4db89d..349fc87bc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -37,6 +37,7 @@ import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; import mineplex.core.recharge.Recharge; +import nautilus.game.arcade.game.games.monstermaze.MMMazes.MazePreset; import nautilus.game.arcade.game.games.monstermaze.MazeMobWaypoint.CardinalDirection; public class Maze implements Listener @@ -48,7 +49,6 @@ public class Maze implements Listener private HashSet _waypoints; private HashSet _disabledWaypoints; private HashSet _oldDisabledWaypoints; - private ArrayList _borders; private Location _center; @@ -64,39 +64,24 @@ public class Maze implements Listener private HashMap _ents = new HashMap(); - public Maze(MonsterMaze host, ArrayList map, ArrayList spawns, ArrayList goals, Location center, ArrayList _glassBounds) + public Maze(MonsterMaze host, MazePreset maze) { Host = host; - _map = map; - _spawns = spawns; - _goals = goals; + _map = maze.getMaze(); + _spawns = maze.getSpawns(); + _goals = maze.getValidSafePadSpawns(); _waypoints = new HashSet(); _disabledWaypoints = new HashSet(); _oldDisabledWaypoints = new HashSet(); - for (Location loc : _map) + for(Location loc : _map) { _waypoints.add(loc.getBlock()); - - loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.QUARTZ_BLOCK); - } - for (Location loc : _goals) - { - _waypoints.add(loc.getBlock()); - - loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.QUARTZ_BLOCK); } - for (Location loc : _spawns) - { - _waypoints.add(loc.getBlock()); - loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GOLD_BLOCK); - } - - - for (Location loc : _glassBounds) + for (Location loc : maze.getGlassBounds()) { _playerContainmentUnitLocations.add(loc.clone().subtract(0, 1, 0)); loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); @@ -106,12 +91,12 @@ public class Maze implements Listener loc.getBlock().setType(Material.STAINED_GLASS); loc.getBlock().setData((byte)3); } - _center = center; + _center = maze.getCenter(); } public void update() { - if(_safePad != null) + if(_safePad != null) // TODO probably a good idea to check if this will screw up compasses in inventories before the game starts { for(Player p : Host.GetPlayers(true)) p.setCompassTarget(_safePad.getLocation()); @@ -429,7 +414,6 @@ public class Maze implements Listener _safePad = new SafePad(Host, this, UtilAlg.Random(goals).clone().subtract(0,1,0)); // maybe don't need to clone() _safePad.build(); - UtilFirework.playFirework(_safePad.getLocation(), FireworkEffect.builder().withColor(Color.LIME).build()); Iterator iter = _waypoints.iterator(); while (iter.hasNext()) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index ef3d0b73a..db04ef7f5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -1,6 +1,5 @@ package nautilus.game.arcade.game.games.monstermaze; -import org.bukkit.GameMode; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; @@ -21,6 +20,7 @@ import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.SoloGame; +import nautilus.game.arcade.game.games.monstermaze.MMMazes.MazePreset; import nautilus.game.arcade.game.games.monstermaze.kits.KitHyper; import nautilus.game.arcade.kit.Kit; @@ -29,6 +29,8 @@ public class MonsterMaze extends SoloGame private Maze _maze; private EntityType _monsterType; + private MazePreset _preset; + public MonsterMaze(ArcadeManager manager) { super(manager, GameType.MonsterMaze, @@ -65,7 +67,8 @@ public class MonsterMaze extends SoloGame if(event.GetState() == GameState.Prepare) { //if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER; - _maze.spawnSafePad(); + if(_maze != null) System.out.println("maze is not null! :)"); + //_maze.spawnSafePad(); } else if(event.GetState() == GameState.Live) { @@ -75,11 +78,17 @@ public class MonsterMaze extends SoloGame for (Team team : GetScoreboard().GetScoreboard().getTeams()) team.setCanSeeFriendlyInvisibles(true); + + _maze.spawnSafePad(); } else if(event.GetState() == GameState.Recruit) { _monsterType = EntityType.SNOWMAN; // TODO map-specific monster type - _maze = new Maze(this, WorldData.GetDataLocs("GRAY"), WorldData.GetDataLocs("YELLOW"), WorldData.GetDataLocs("RED"), WorldData.GetDataLocs("ORANGE").get(0), WorldData.GetDataLocs("PINK")); + System.out.println("loc: " + WorldData.GetDataLocs("ORANGE").get(0).getBlockX() + "," + WorldData.GetDataLocs("ORANGE").get(0).getBlockY() + "," + WorldData.GetDataLocs("ORANGE").get(0).getBlockZ()); + _preset = MMMazes.getRandomMapPreset(WorldData.GetDataLocs("ORANGE").get(0)); + _preset.printInfo(); + _preset.build(); + _maze = new Maze(this, _preset); UtilServer.getServer().getPluginManager().registerEvents(_maze, getArcadeManager().getPlugin()); _maze.fillSpawn(175); From fcec6253cdf635c48cbb81edf5b7c2b6efc7fcb2 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 12 Sep 2015 23:56:38 +0200 Subject: [PATCH 041/219] fixing @p on signs, adding potioneffects and gadgets to areas. --- .../arcade/game/games/event/EventGame.java | 164 ++++++++++++++++-- .../arcade/game/games/event/EventModule.java | 10 +- 2 files changed, 152 insertions(+), 22 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index a96234726..18c492865 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -25,7 +25,10 @@ import mineplex.core.disguise.disguises.DisguiseChicken; import mineplex.core.disguise.disguises.DisguiseEnderman; import mineplex.core.disguise.disguises.DisguiseWither; import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.gadget.types.GadgetType; import mineplex.core.give.Give; +import mineplex.core.mount.Mount; import mineplex.core.mount.event.MountActivateEvent; import mineplex.core.recharge.Recharge; import mineplex.core.shop.item.SalesPackageBase; @@ -68,6 +71,8 @@ import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; public class EventGame extends Game { @@ -130,6 +135,7 @@ public class EventGame extends Game this.InventoryClick = true; this.InventoryOpenBlock = true; this.InventoryOpenChest = true; + //Dont timeout this.GameTimeout = -1; @@ -647,23 +653,27 @@ public class EventGame extends Game for(String varArgs : args) { ArrayList players = new ArrayList<>(); - if(Bukkit.getPlayer(playerName) != null) - players.add(Bukkit.getPlayer(playerName)); + if(Bukkit.getPlayer(varArgs) != null) + players.add(Bukkit.getPlayer(varArgs)); - if(playerName.contentEquals("@p")) + if(varArgs.contentEquals("@p")) { for(Player player : GetPlayers(true)) { - boolean found = true; + boolean found; + found = true; for(Player otherPlayer : GetPlayers(true)) { + if(player == otherPlayer) + continue; + if(UtilMath.offset(sign.getLocation(), player.getLocation()) >= UtilMath.offset(sign.getLocation(), otherPlayer.getLocation())) { found = false; break; } } - if(found = true) + if(found) { players.add(player); break; @@ -736,7 +746,7 @@ public class EventGame extends Game if(command.contentEquals("[SETBLOCK]")) { - Material mat = Material.getMaterial(args[1]); + Material mat = Material.getMaterial(Integer.parseInt(args[1])); String[] coords = args[2].split(" "); int x = Integer.parseInt(coords[0]); int y = Integer.parseInt(coords[1]); @@ -747,7 +757,7 @@ public class EventGame extends Game if(command.contentEquals("[TESTFOR]")) { boolean redstone = false; - Material mat = Material.getMaterial(args[1]); + Material mat = Material.getMaterial(Integer.parseInt(args[1])); if(args[2].contains("r=")) { int radius = 0; @@ -853,7 +863,7 @@ public class EventGame extends Game { for(Player player : varMap.get(1)) { - player.getInventory().addItem(new ItemStack(Material.getMaterial(args[2]), Integer.parseInt(args[3]))); + player.getInventory().addItem(new ItemStack(Material.getMaterial(Integer.parseInt(args[2])), Integer.parseInt(args[3]))); } } catch (Exception e) @@ -902,6 +912,68 @@ public class EventGame extends Game } } + public boolean isInArea(EventArea area, Entity entity) + { + if(entity.getLocation().getX() < area.CornerA.getX() || entity.getLocation().getX() > area.CornerB.getX()) + return false; + + if(entity.getLocation().getY() < area.CornerA.getY() || entity.getLocation().getY() > area.CornerB.getY()) + return false; + + if(entity.getLocation().getZ() < area.CornerA.getZ() || entity.getLocation().getZ() > area.CornerB.getZ()) + return false; + + return true; + } + + @EventHandler + public void activateGadget(GadgetActivateEvent event) + { + for(EventArea area : _customAreas.values()) + { + if(area.CornerA == null || area.CornerB == null) + continue; + + if(area.Usable == false) + continue; + + if(!isInArea(area, event.getPlayer())) + continue; + + if(!area.GadgetsEnabled.contains(event.getGadget())) + { + event.setCancelled(true); + } + } + } + + @EventHandler + public void areaPotionEffect(UpdateEvent event) + { + if(event.getType() != UpdateType.SEC) + return; + + for(EventArea area : _customAreas.values()) + { + for(Player player : GetPlayers(true)) + { + if(area.CornerA == null || area.CornerB == null) + continue; + + if(area.Usable == false) + continue; + + if(!isInArea(area, player)) + continue; + + for(PotionEffectType type : area.PotionEffects.keySet()) + { + player.addPotionEffect(new PotionEffect(type, 30, area.PotionEffects.get(type)), true); + } + } + } + } + @EventHandler(ignoreCancelled=true) public void areaDamage(CustomDamageEvent event) { @@ -917,20 +989,16 @@ public class EventGame extends Game { if(!Manager.GetGame().DamagePvP) { + Manager.GetGame().Damage = true; Manager.GetGame().DamagePvP = true; Bukkit.getPluginManager().callEvent(event); Manager.GetGame().DamagePvP = false; + Manager.GetGame().Damage = false; } return; } - if(event.GetDamageeEntity().getLocation().getX() < area.CornerA.getX() || event.GetDamageeEntity().getLocation().getX() > area.CornerB.getX()) - continue; - - if(event.GetDamageeEntity().getLocation().getY() < area.CornerA.getY() || event.GetDamageeEntity().getLocation().getY() > area.CornerB.getY()) - continue; - - if(event.GetDamageeEntity().getLocation().getZ() < area.CornerA.getZ() || event.GetDamageeEntity().getLocation().getZ() > area.CornerB.getZ()) + if(!isInArea(area, event.GetDamageeEntity())) continue; if(!area.DamageAll) @@ -1004,6 +1072,67 @@ public class EventGame extends Game _customAreas.get(Integer.parseInt(args[1])).DamageEvP = !_customAreas.get(Integer.parseInt(args[1])).DamageEvP; UtilPlayer.message(player, F.main("Event", "Damage EvP for Region " + args[1] + ": " + F.tf(_customAreas.get(Integer.parseInt(args[1])).DamageEvP))); } + if(args[2].equalsIgnoreCase("Effect")) + { + PotionEffectType type = PotionEffectType.getByName(args[3]); + if (type == null) + { + UtilPlayer.message(player, F.main("Effect", "Invalid Effect Type: " + args[2])); + UtilPlayer.message(player, F.value("Valid Types", "http://minecraft.gamepedia.com/Status_effect")); + return; + } + int strenght = 0; + try + { + strenght = Integer.parseInt(args[4]); + } + catch (Exception e) {} + _customAreas.get(Integer.parseInt(args[1])).PotionEffects.put(type, strenght); + UtilPlayer.message(player, F.main("Event", "Potion Effect added for Region " + args[1])); + } + if(args[2].equalsIgnoreCase("Gadget")) + { + //Gadgets + for (GadgetType type : GadgetType.values()) + { + for (Gadget gadget : Manager.getCosmeticManager().getGadgetManager().getGadgets(type)) + { + if (gadget.GetName().replaceAll(" ", "").equalsIgnoreCase(args[3])) + { + if (_customAreas.get(Integer.parseInt(args[1])).GadgetsEnabled.remove(gadget)) + { + Manager.GetGame().Announce(F.main("Inventory", F.value(gadget.GetName() + " Gadget for area " + args[1], F.ed(false)))); + } + else + { + Manager.GetGame().Announce(F.main("Inventory", F.value(gadget.GetName() + " Gadget for area " + args[1], F.ed(true)))); + _customAreas.get(Integer.parseInt(args[1])).GadgetsEnabled.add(gadget); + } + + return; + } + } + } + + //Mounts + for (Mount mount : Manager.getCosmeticManager().getMountManager().getMounts()) + { + if (mount.GetName().replaceAll(" ", "").equalsIgnoreCase(args[3])) + { + if (_customAreas.get(Integer.parseInt(args[1])).GadgetsEnabled.remove(mount)) + { + Manager.GetGame().Announce(F.main("Inventory", F.value(mount.GetName() + " Gadget for area " + args[1], F.ed(false)))); + } + else + { + Manager.GetGame().Announce(F.main("Inventory", F.value(mount.GetName() + " Gadget for area " + args[1], F.ed(true)))); + _customAreas.get(Integer.parseInt(args[1])).GadgetsEnabled.add(mount); + } + + return; + } + } + } } else { @@ -1073,10 +1202,15 @@ public class EventGame extends Game public boolean Usable; + public HashMap PotionEffects; + public HashSet GadgetsEnabled; + public EventArea(Integer id) { ID = id; Usable = false; + PotionEffects = new HashMap<>(); + GadgetsEnabled = new HashSet(); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java index 82315cc58..9e980a32f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java @@ -29,6 +29,7 @@ import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.events.PlayerDeathOutEvent; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -57,6 +58,7 @@ import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; @@ -1600,7 +1602,7 @@ public class EventModule extends MiniPlugin public void commandBC(Player caller, String[] args) { String message = args[1]; - for(int e = 2; e <= 3; e++) + for(int e = 2; e < args.length; e++) message += " " + args[e]; String colored = ChatColor.translateAlternateColorCodes('&', message); @@ -1919,12 +1921,6 @@ public class EventModule extends MiniPlugin } } - @EventHandler(ignoreCancelled=true) - public void playerDamage(CustomDamageEvent event) - { - - } - public ArrayList getDamagePlayers() { return _damage; From 112f94a8421c61b2c73375975dab8ea971bed0ef Mon Sep 17 00:00:00 2001 From: Sarah Date: Sun, 13 Sep 2015 00:00:47 +0200 Subject: [PATCH 042/219] forgot to add command to remove potion effects. --- .../src/nautilus/game/arcade/game/games/event/EventGame.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index 18c492865..555511b96 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -1075,6 +1075,11 @@ public class EventGame extends Game if(args[2].equalsIgnoreCase("Effect")) { PotionEffectType type = PotionEffectType.getByName(args[3]); + if(_customAreas.get(Integer.parseInt(args[1])).PotionEffects.containsKey(type)) + { + _customAreas.get(Integer.parseInt(args[1])).PotionEffects.remove(type); + UtilPlayer.message(player, F.main("Event", "Removed potion effect from area")); + } if (type == null) { UtilPlayer.message(player, F.main("Effect", "Invalid Effect Type: " + args[2])); From 53d5c2fd0e9e5ae172d10e182cf33442a64cbb7e Mon Sep 17 00:00:00 2001 From: Sarah Date: Sun, 13 Sep 2015 00:30:55 +0200 Subject: [PATCH 043/219] adding area info command. --- .../arcade/game/games/event/EventGame.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index 555511b96..d48f616d4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -74,6 +74,8 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import com.sun.xml.internal.ws.resources.UtilMessages; + public class EventGame extends Game { private GameHostManager _mps; @@ -1041,8 +1043,34 @@ public class EventGame extends Game } } + public void listAreaSettings(Player player) + { + for(EventArea area : _customAreas.values()) + { + UtilPlayer.message(player, F.main("Event", "============================")); + UtilPlayer.message(player, F.main("Event", "Settings for area " + area.ID)); + UtilPlayer.message(player, F.oo("Damage All", area.DamageAll) + ", " + + F.oo("Damage PvP", area.DamagePvP) + ", " + + F.oo("Damage PvE", area.DamagePvE) + + ", " + F.oo("Damage EvP", area.DamageEvP)); + + UtilPlayer.message(player, F.main("Event", "Potion Effects for area " + area.ID)); + for(PotionEffectType type : area.PotionEffects.keySet()) + UtilPlayer.message(player, F.oo(type.getName(), true) + " level: " + area.PotionEffects.get(type)); + + for(SalesPackageBase gadget : area.GadgetsEnabled) + UtilPlayer.message(player, F.oo(gadget.GetName(), true)); + } + } + public void editArea(Player player, String[] args) { + + if(args[1].equalsIgnoreCase("Info")) + { + listAreaSettings(player); + return; + } try { if(_customAreas.containsKey(Integer.parseInt(args[1]))) From a46cb2c2749d634026e9134a7476466d4186f897 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sun, 13 Sep 2015 00:35:22 +0200 Subject: [PATCH 044/219] last fix in the listAreaInfo method. --- .../src/nautilus/game/arcade/game/games/event/EventGame.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index d48f616d4..0957549dd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -1058,6 +1058,7 @@ public class EventGame extends Game for(PotionEffectType type : area.PotionEffects.keySet()) UtilPlayer.message(player, F.oo(type.getName(), true) + " level: " + area.PotionEffects.get(type)); + UtilPlayer.message(player, F.main("Event", "Gadgets for area " + area.ID)); for(SalesPackageBase gadget : area.GadgetsEnabled) UtilPlayer.message(player, F.oo(gadget.GetName(), true)); } From 7ca6f581082eea9e1c50bb2bd6ef609cf49246b0 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sun, 13 Sep 2015 10:25:44 +0200 Subject: [PATCH 045/219] Adding Gem signs. --- .../arcade/game/games/event/EventGame.java | 48 +++++++++++++++++++ .../arcade/game/games/event/EventModule.java | 6 +++ 2 files changed, 54 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index 0957549dd..20caa6877 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -7,6 +7,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import mineplex.core.common.util.Callback; import mineplex.core.common.util.F; import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAction; @@ -58,6 +59,7 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.event.block.SignChangeEvent; @@ -68,6 +70,7 @@ import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.inventory.ItemStack; @@ -1221,6 +1224,51 @@ public class EventGame extends Game event.setCancelled(true); } + @EventHandler + public void gemSign(final PlayerInteractEvent event) + { + if(event.getAction() != Action.RIGHT_CLICK_BLOCK) + return; + + if(!(event.getClickedBlock() instanceof Sign)) + return; + + Sign sign = (Sign) event.getClickedBlock().getState(); + if(!sign.getLine(0).contentEquals("[GEM]")) + return; + + final Material mat = Material.getMaterial(Integer.parseInt(sign.getLine(1))); + Integer price = Integer.parseInt(sign.getLine(2)); + if(price > 500) + price = 500; + + if(price <= 0) + { + UtilPlayer.message(event.getPlayer(), F.main("Event", "You got an item for free.")); + event.getPlayer().getInventory().addItem(new ItemStack(mat)); + return; + } + + if(Manager.GetDonation().Get(event.getPlayer()).GetGems() < price) + { + UtilPlayer.message(event.getPlayer(), F.main("Event", "You dont have enough Gems.")); + return; + } + + final int gems = price; + Manager.GetDonation().RewardGems(new Callback() + { + public void run(Boolean completed) + { + if (completed) + { + UtilPlayer.message(event.getPlayer(), F.main("Event", "You bought an item for " + gems + " Gems.")); + event.getPlayer().getInventory().addItem(new ItemStack(mat)); + } + } + }, "Gem Sign", event.getPlayer().getName(), event.getPlayer().getUniqueId(), -price); + } + public class EventArea { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java index 9e980a32f..9dc6de524 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java @@ -159,6 +159,12 @@ public class EventModule extends MiniPlugin UtilPlayer.message(player, F.value("/e give [e:#,e:#...]", "Give Item")); UtilPlayer.message(player, F.value("/e doublejump", "Toggles Double Jump")); + UtilPlayer.message(player, F.value("/e bc", "Broadcast a message with colorcodes")); + UtilPlayer.message(player, F.value("/e tempgadget", "Activates gadget for all player")); + UtilPlayer.message(player, F.value("/e playerdamage", "Toggles damage fpr player")); + UtilPlayer.message(player, F.value("/e stacker [Player]", "toggles stacker global or for Players")); + UtilPlayer.message(player, F.value("/e kick", "Remove a player from the event")); + UtilPlayer.message(player, F.value("/e area PVP|ALL|PVE|EVP|Gadget|Effect / add", "Create and edit areas")); UtilPlayer.message(player, F.value("/e scoreboard [Text]", "Sets Scoreboard Text")); From aa8cb8943e1d2238abedadbe63f39c398f76e678 Mon Sep 17 00:00:00 2001 From: fooify Date: Sun, 13 Sep 2015 08:42:26 -0700 Subject: [PATCH 046/219] more work on monster maze --- .../game/games/monstermaze/MMMazes.java | 9 +-- .../arcade/game/games/monstermaze/Maze.java | 47 +++++++++------- .../game/games/monstermaze/MonsterMaze.java | 55 +++++++++++++++++++ 3 files changed, 84 insertions(+), 27 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java index f283f2d56..f5715529a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java @@ -36,7 +36,7 @@ public class MMMazes _center = loc; - Location cur = _center.clone().subtract(49, 0, 49); + Location cur = _center.clone().subtract(50, 0, 50); // x/y refers to array coordinates, not physical minecraft location for (int y = 0; y < 100; y++) @@ -64,7 +64,7 @@ public class MMMazes } cur = cur.clone().add(0, 0, 1); } - cur.setZ(_center.clone().subtract(49, 0, 49).getZ()); + cur.setZ(_center.clone().subtract(50, 0, 50).getZ()); cur = cur.clone().add(1, 0, 0); } @@ -104,26 +104,21 @@ public class MMMazes public void build() { - StringBuilder sb = new StringBuilder(); for(Location loc : _maze) { - sb.append("_maze: " + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ() + " "); loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.QUARTZ_BLOCK); } for(Location loc : _spawns) { - sb.append("_spawns: " + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ() + " "); loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GOLD_BLOCK); } for(Location loc : _centerSafeZone) { - sb.append("_centerSafeZone: " + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ() + " "); loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); loc.getBlock().getRelative(BlockFace.DOWN).setData((byte)8); } - System.out.println(sb.toString()); _built = true; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index 349fc87bc..e15655d32 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -1,14 +1,14 @@ package nautilus.game.arcade.game.games.monstermaze; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Map.Entry; import java.util.Set; -import org.bukkit.Color; -import org.bukkit.FireworkEffect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; @@ -30,7 +30,6 @@ import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTextMiddle; @@ -59,7 +58,7 @@ public class Maze implements Listener private ArrayList _playersOnPad = new ArrayList(); - private int _phaseTimer = -1; + private int _phaseTimer = 90; private int _padDecayTimer = -1; private HashMap _ents = new HashMap(); @@ -84,10 +83,10 @@ public class Maze implements Listener for (Location loc : maze.getGlassBounds()) { _playerContainmentUnitLocations.add(loc.clone().subtract(0, 1, 0)); - loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); - loc.getBlock().getRelative(BlockFace.DOWN).setData((byte)3); - - _playerContainmentUnitLocations.add(loc); + _playerContainmentUnitLocations.add(loc.clone().subtract(0, 2, 0)); + } + for(Location loc : _playerContainmentUnitLocations) + { loc.getBlock().setType(Material.STAINED_GLASS); loc.getBlock().setData((byte)3); } @@ -108,7 +107,7 @@ public class Maze implements Listener move(); bump(); removeMobsOnSafePad(); - if(_phaseTimer <= -1) + if(_phaseTimer > 15) { for(Player p : Host.GetPlayers(true)) { @@ -118,7 +117,7 @@ public class Maze implements Listener } else { - double percentage = _phaseTimer/20d; + double percentage = _phaseTimer/15d; for(Player p : Host.GetPlayers(true)) { p.setExp((float)percentage); @@ -514,6 +513,10 @@ public class Maze implements Listener if(_phaseTimer == -1) return; _phaseTimer--; + if(_phaseTimer == 20) // only gets to this by running out of time naturally, not by player + { + Host.Announce(C.cRed + C.Bold + "Nobody has gotten to the Safe Pad yet! Twenty seconds left."); + } if(_phaseTimer == 15 || _phaseTimer == 10) { @@ -561,7 +564,8 @@ public class Maze implements Listener spawn(15); spawnSafePad(); _playersOnPad.clear(); - _phaseTimer = -1; + //_phaseTimer = -1; + _phaseTimer = 90; } } @@ -576,18 +580,21 @@ public class Maze implements Listener _playersOnPad.add(p); if(_playersOnPad.size() == 1) // first player { - _phaseTimer = 20; // start the countdown + if(_phaseTimer > 15) + { + _phaseTimer = 15; // reduce countdown to 15 + + ArrayList pElse = Host.GetPlayers(false); + pElse.remove(p); + for(Player i : pElse) + { + UtilPlayer.message(i, C.cRed + C.Bold + p.getName() + " was the first to make it to the Safe Pad!"); + UtilPlayer.message(i, C.cGray + "Everyone not on the Safe Pad in 15 seconds will die!"); // I don't like this message + } + } UtilTextMiddle.display(C.cGold + C.Bold + "AWESOME!", C.cGold + "You were the first to make it to the Safe Pad!", 5, 40, 5, p); p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); - - ArrayList pElse = Host.GetPlayers(false); - pElse.remove(p); - for(Player i : pElse) - { - UtilPlayer.message(i, C.cRed + C.Bold + p.getName() + " was the first to make it to the Safe Pad!"); - UtilPlayer.message(i, C.cGray + "Everyone not on the Safe Pad in 20 seconds will die!"); // I don't like this message - } } else // not the first { p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index db04ef7f5..04d6f29ee 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -1,10 +1,13 @@ package nautilus.game.arcade.game.games.monstermaze; +import org.bukkit.Material; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; +import org.bukkit.entity.Snowman; import org.bukkit.entity.Zombie; import org.bukkit.event.EventHandler; +import org.bukkit.event.block.EntityBlockFormEvent; import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.potion.PotionEffect; @@ -14,11 +17,14 @@ import org.bukkit.scoreboard.Team; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTextMiddle; +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 nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.monstermaze.MMMazes.MazePreset; import nautilus.game.arcade.game.games.monstermaze.kits.KitHyper; @@ -114,6 +120,14 @@ public class MonsterMaze extends SoloGame } } + @EventHandler + public void antisnow(EntityBlockFormEvent e) + { + if(e.getEntity() instanceof Snowman) + if(e.getNewState().getType().equals(Material.SNOW)) + e.setCancelled(true); + } + @EventHandler public void DecrementPhaseTimer(UpdateEvent event) { @@ -142,4 +156,45 @@ public class MonsterMaze extends SoloGame { return _monsterType; } + + @Override + @EventHandler + public void ScoreboardUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + if (GetTeamList().isEmpty()) + return; + + Scoreboard.Reset(); + + Scoreboard.WriteBlank(); + + Scoreboard.Write(C.cDPurple + C.Bold + "Beacon Timer"); + if(IsLive()) + { + Scoreboard.Write(_maze.getPhaseTimer() + ""); + } + else + { + Scoreboard.Write("--"); + } + Scoreboard.WriteBlank(); + + Scoreboard.Write(C.cYellow + C.Bold + "Players Alive"); + if(GetPlayers(true).size() > 5) + { + Scoreboard.Write(C.cWhite + GetPlayers(true).size() + " Players"); + } + else + { + for(Player p : GetPlayers(true)) + { + Scoreboard.Write(p.getName()); + } + } + + Scoreboard.Draw(); + } } From 362d99a819f053f9907320b910133b14dd42ea20 Mon Sep 17 00:00:00 2001 From: Sarah Date: Tue, 15 Sep 2015 07:10:39 +0200 Subject: [PATCH 047/219] Fixing up Gem signs, Effects etc. --- .../game/arcade/game/games/event/EventGame.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index 20caa6877..31e1a164a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -883,13 +883,12 @@ public class EventGame extends Game } if(command.contentEquals("[EFFECT]")) { - try + //Manager.GetEventModule().commandEffect(Manager.GetGameHostManager().getHost(), commandArgs, varMap.get(1)); + for(Player player : varMap.get(1)) { - Manager.GetEventModule().commandEffect(Manager.GetGameHostManager().getHost(), commandArgs, varMap.get(1)); - } catch (Exception e) - { - + player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(args[2]), Integer.parseInt(args[3].split(" ")[0]), Integer.parseInt(args[3].split(" ")[1]))); } + } if(command.contentEquals("[KIT]")) { @@ -973,7 +972,7 @@ public class EventGame extends Game for(PotionEffectType type : area.PotionEffects.keySet()) { - player.addPotionEffect(new PotionEffect(type, 30, area.PotionEffects.get(type)), true); + player.addPotionEffect(new PotionEffect(type, 60, area.PotionEffects.get(type)), true); } } } @@ -1111,6 +1110,7 @@ public class EventGame extends Game { _customAreas.get(Integer.parseInt(args[1])).PotionEffects.remove(type); UtilPlayer.message(player, F.main("Event", "Removed potion effect from area")); + return; } if (type == null) { @@ -1230,11 +1230,11 @@ public class EventGame extends Game if(event.getAction() != Action.RIGHT_CLICK_BLOCK) return; - if(!(event.getClickedBlock() instanceof Sign)) + if(event.getClickedBlock().getType() != Material.SIGN && event.getClickedBlock().getType() != Material.WALL_SIGN && event.getClickedBlock().getType() != Material.SIGN_POST) return; Sign sign = (Sign) event.getClickedBlock().getState(); - if(!sign.getLine(0).contentEquals("[GEM]")) + if(!sign.getLine(0).contentEquals("(GEM)")) return; final Material mat = Material.getMaterial(Integer.parseInt(sign.getLine(1))); From 5e8fc771649fd3e9513f3aa10b15022860b3b679 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 17 Sep 2015 04:34:45 +1200 Subject: [PATCH 048/219] Add pages to spectator and in-progress server menu --- .../mineplex/core/shop/page/ShopPageBase.java | 2 +- .../core/shop/page/ShopPageInventory.java | 123 ++++++++++++++++ .../mineplex/hub/server/ui/ServerNpcPage.java | 114 +++++++++++---- .../arcade/addons/compass/CompassAddon.java | 2 +- .../nautilus/game/arcade/game/GameTeam.java | 11 ++ .../gui/spectatorMenu/page/SpectatorPage.java | 137 +++++++++++++----- 6 files changed, 325 insertions(+), 64 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageInventory.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java index 4f46b6f0f..67f346fd0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java @@ -138,7 +138,7 @@ public abstract class ShopPageBase= 0) { if (event.getInventory().getTitle() == inventory.getInventoryName() && (inventory.getSize() <= event.getSlot() || inventory.getItem(event.getSlot()) != null)) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageInventory.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageInventory.java new file mode 100644 index 000000000..0546c0de6 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageInventory.java @@ -0,0 +1,123 @@ +package mineplex.core.shop.page; + +import mineplex.core.MiniPlugin; +import mineplex.core.account.CoreClientManager; +import mineplex.core.donation.DonationManager; +import mineplex.core.itemstack.ItemBuilder; +import mineplex.core.shop.ShopBase; +import mineplex.core.shop.item.IButton; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.inventory.ItemStack; + +public abstract class ShopPageInventory> extends + ShopPageBase +{ + private int _page; + + public ShopPageInventory(PluginType plugin, ShopType shop, CoreClientManager clientManager, DonationManager donationManager, + String name, Player player) + { + super(plugin, shop, clientManager, donationManager, name, player, 54); + } + + public PluginType getPlugin() + { + return (PluginType) super.getPlugin(); + } + + public ShopPageInventory(PluginType plugin, ShopType shop, CoreClientManager clientManager, DonationManager donationManager, + String name, Player player, int slots) + { + super(plugin, shop, clientManager, donationManager, name, player, slots); + } + + protected abstract IButton[] getButtons(); + + protected abstract ItemStack[] getItems(); + + protected abstract void buildItems(); + + @Override + protected final void buildPage() + { + clearPage(); + buildItems(); + + IButton[] buttons = getButtons(); + ItemStack[] items = getItems(); + + int maxLen = Math.max(items.length, buttons.length); + boolean pages = maxLen > getSize(); + + _page = Math.max(0, Math.min(_page, pages ? (int) Math.ceil(maxLen / (double) (getSize() - 9)) - 1 : 0)); + + int start = pages ? _page * (getSize() - 9) : 0; + + for (int slot = 0; slot < (pages ? getSize() - 9 : getSize()); slot++) + { + IButton button = null; + ItemStack item = null; + + if (slot + start < buttons.length) + { + button = buttons[slot + start]; + } + + if (slot + start < items.length) + { + item = items[slot + start]; + } + + if (button != null) + { + super.addButton(slot, item, button); + } + else + { + setItem(slot, item); + } + } + + if (pages) + { + for (int slot = 0; slot < 9; slot++) + { + int realSlot = getSize() - (9 - slot); + + if ((slot == 0 && _page > 0) || (slot == 8 && maxLen > (_page + 1) * (getSize() - 9))) + { + final int nextPage = slot == 0 ? _page - 1 : _page + 1; + + ItemBuilder builder = new ItemBuilder(Material.SIGN); + builder.setTitle(slot == 0 ? "Previous Page" : "Next Page"); + builder.setAmount(nextPage + 1); + + super.addButton(realSlot, builder.build(), new IButton() + { + + @Override + public void onClick(Player player, ClickType clickType) + { + setPage(nextPage); + } + }); + } + else if (slot == 4) + { + ItemStack item = new ItemBuilder(Material.PAPER).setTitle("Page " + (_page + 1)).setAmount(_page + 1).build(); + + setItem(realSlot, item); + } + } + } + } + + public void setPage(int newPage) + { + _page = newPage; + buildPage(); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java index c2c1bf9e4..34b527fa9 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java @@ -1,6 +1,7 @@ package mineplex.hub.server.ui; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -8,25 +9,26 @@ import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; +import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.SkullMeta; import mineplex.core.account.CoreClientManager; -import mineplex.core.achievement.AchievementCategory; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; import mineplex.core.donation.DonationManager; import mineplex.core.game.GameDisplay; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.shop.item.IButton; import mineplex.core.shop.item.ShopItem; -import mineplex.core.shop.page.ShopPageBase; +import mineplex.core.shop.page.ShopPageInventory; import mineplex.hub.server.ServerInfo; import mineplex.hub.server.ServerManager; import mineplex.hub.server.ServerSorter; import mineplex.hub.server.ui.button.JoinServerButton; -public class ServerNpcPage extends ShopPageBase implements IServerPage +public class ServerNpcPage extends ShopPageInventory implements IServerPage { // Shop Item Messages private static final String MESSAGE_BETA_GET_ULTRA = ChatColor.RESET + C.Line + "Get Ultra to join Tournament servers!"; @@ -40,6 +42,9 @@ public class ServerNpcPage extends ShopPageBase im private String _serverGroupName; private boolean _onMainPage = true; + private IButton[] _buttons; + private ItemStack[] _items; + public ServerNpcPage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player, String serverGroupName) { super(plugin, shop, clientManager, donationManager, name, player, 54); @@ -50,12 +55,14 @@ public class ServerNpcPage extends ShopPageBase im } @Override - protected void buildPage() + protected void buildItems() { + _items = new ItemStack[0]; + _buttons = new IButton[0]; + List serverList = new ArrayList(getPlugin().getServerList(_serverGroupName)); - + int slotsNeeded = 1; - if (serverList.size() > 0) { @@ -81,6 +88,7 @@ public class ServerNpcPage extends ShopPageBase im getPlugin().selectServer(player, _serverGroupName); } }); + buildAvailableServerPage(serverList, slotsNeeded); } else @@ -109,7 +117,7 @@ public class ServerNpcPage extends ShopPageBase im ChatColor.RESET + C.cGreen + "www.mineplex.com/shop" }, seconds, false, false); - addItem(22, item); + addItemStack(22, item); } private ShopItem buildShopItem(ServerInfo serverInfo, int slotsNeeded) @@ -220,7 +228,7 @@ public class ServerNpcPage extends ShopPageBase im ChatColor.RESET + "Visit " + C.cGreen + "www.mineplex.com/shop" + C.cWhite + "!" }, 1, false, false); - addItem(22, item); + addItemStack(22, item); return; } @@ -243,9 +251,6 @@ public class ServerNpcPage extends ShopPageBase im } else { - if (slot >= 54) - continue; - addButton(slot, getPrivateItem(serverInfo), new JoinServerButton(this, serverInfo)); slot++; } @@ -273,7 +278,7 @@ public class ServerNpcPage extends ShopPageBase im greenCount++; if (serverInfo.MOTD.contains("Open in")) - setItem(slot, shopItem); + addItemStack(slot, shopItem); else { addButton(slot, shopItem, new JoinServerButton(this, serverInfo)); @@ -303,11 +308,39 @@ public class ServerNpcPage extends ShopPageBase im { for (int i = greenCount + greenStartSlot; i < greenStartSlot + serversToShow; i++) { - setItem(i, null); + addItemStack(i, null); } } } + public void addItemStack(int slot, ItemStack item) + { + if (_items.length <= slot) + { + if (item == null || item.getType() == Material.AIR) + { + return; + } + + _items = Arrays.copyOf(_items, slot + 1); + _buttons = Arrays.copyOf(_buttons, slot + 1); + } + + _items[slot] = item; + } + + protected void addButton(int slot, ItemStack item, IButton button) + { + if (_items.length <= slot) + { + _items = Arrays.copyOf(_items, slot + 1); + _buttons = Arrays.copyOf(_buttons, slot + 1); + } + + _items[slot] = item; + _buttons[slot] = button; + } + private ShopItem getPrivateItem(ServerInfo serverInfo) { String hostName = serverInfo.Name.substring(0, serverInfo.Name.indexOf('-')); @@ -371,36 +404,47 @@ public class ServerNpcPage extends ShopPageBase im private void buildInProgressServerPage(List serverList, int slotsNeeded) { int slot = 9; + + ArrayList inProgress = new ArrayList(); for (ServerInfo serverInfo : serverList) { - if (isInProgress(serverInfo) && slot < getSize()) + if (isInProgress(serverInfo)) { - ShopItem shopItem = buildShopItem(serverInfo, slotsNeeded); - - addButton(slot, shopItem, new JoinServerButton(this, serverInfo)); - - slot++; + inProgress.add(serverInfo); } } - addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() + for (ServerInfo serverInfo : inProgress) + { + if (inProgress.size() > 45 && slot > 9 && slot % 45 == 0) + { + addBackBed(slot + 4); + slot += 9; + } + + ShopItem shopItem = buildShopItem(serverInfo, slotsNeeded); + + addButton(slot, shopItem, new JoinServerButton(this, serverInfo)); + + slot++; + } + + addBackBed(4); + } + + private void addBackBed(int slot) + { + addButton(slot, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[] + {}, 1, false), new IButton() { @Override public void onClick(Player player, ClickType clickType) { - clear(); _onMainPage = true; + buildPage(); } }); - - while (slot < getSize()) - { - if (getItem(slot) != null) - setItem(slot, null); - - slot++; - } } public void Update() @@ -422,4 +466,16 @@ public class ServerNpcPage extends ShopPageBase im getPlugin().selectServer(player, serverInfo); } + + @Override + protected IButton[] getButtons() + { + return _buttons; + } + + @Override + protected ItemStack[] getItems() + { + return _items; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/compass/CompassAddon.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/compass/CompassAddon.java index 5383b0be6..488295caf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/compass/CompassAddon.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/compass/CompassAddon.java @@ -206,7 +206,7 @@ public class CompassAddon extends MiniPlugin { // Teleport to nearest player when you left click compass - if (!Recharge.Instance.use(player, "Spectate", 5000, true, false)) + if (!Recharge.Instance.use(player, "Spectate", 3000, true, false)) { return; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java index a4adccbd5..cc3956390 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java @@ -73,6 +73,7 @@ public class GameTeam //Records order players go out in protected ArrayList _places = new ArrayList(); + private long _teamCreatedTime = System.currentTimeMillis(); // Used just for SpectatorPage so that teams remain ordered public GameTeam(Game host, String name, ChatColor color, ArrayList spawns, boolean tags) { @@ -90,6 +91,11 @@ public class GameTeam this(host, name, color, spawns, false); } + public long getCreatedTime() + { + return _teamCreatedTime; + } + public String GetName() { return _name; @@ -300,6 +306,11 @@ public class GameTeam _displayName = name; } + public String getDisplayName() + { + return _displayName; + } + public byte GetColorData() { if (GetColor() == ChatColor.WHITE) return (byte)0; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/spectatorMenu/page/SpectatorPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/spectatorMenu/page/SpectatorPage.java index ebe10c41a..7f75b4533 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/spectatorMenu/page/SpectatorPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/spectatorMenu/page/SpectatorPage.java @@ -4,8 +4,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.List; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -18,8 +20,9 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.UtilColor; import mineplex.core.common.util.UtilMath; import mineplex.core.donation.DonationManager; +import mineplex.core.shop.item.IButton; import mineplex.core.shop.item.ShopItem; -import mineplex.core.shop.page.ShopPageBase; +import mineplex.core.shop.page.ShopPageInventory; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.addons.compass.CompassAddon; import nautilus.game.arcade.game.GameTeam; @@ -30,35 +33,46 @@ import nautilus.game.arcade.gui.spectatorMenu.button.SpectatorButton; * Created by shaun on 14-09-24. */ -public class SpectatorPage extends ShopPageBase +public class SpectatorPage extends + ShopPageInventory { private ArcadeManager _arcadeManager; + private IButton[] _buttons; + private ItemStack[] _items; - public SpectatorPage(CompassAddon plugin, ArcadeManager arcadeManager, SpectatorShop shop, CoreClientManager clientManager, + public SpectatorPage(CompassAddon plugin, ArcadeManager arcadeManager, + SpectatorShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player) { - super(plugin, shop, clientManager, donationManager, "Spectator Menu", player); + super(plugin, shop, clientManager, donationManager, "Spectator Menu", + player); + _arcadeManager = arcadeManager; buildPage(); } @Override - protected void buildPage() + protected void buildItems() { - int playerCount = _arcadeManager.GetGame().GetPlayers(true).size(); + _buttons = new IButton[54]; + _items = new ItemStack[54]; + List teamList = _arcadeManager.GetGame().GetTeamList(); - if (teamList.size() == 1 && playerCount < 28) - buildSingleTeam(teamList.get(0), playerCount); - else - buildMultipleTeams(teamList, playerCount); + int playerCount = _arcadeManager.GetGame().GetPlayers(true).size(); + if (teamList.size() == 1 && playerCount < 28) + { + buildSingleTeam(teamList.get(0), playerCount); + } + else + { + buildMultipleTeams(teamList, playerCount); + } } private void buildSingleTeam(GameTeam team, int playerCount) { - setItem(13, getTeamItem(team, playerCount)); - ArrayList players = team.GetPlayers(true); Collections.sort(players, new Comparator() @@ -72,6 +86,11 @@ public class SpectatorPage extends ShopPageBase }); + _buttons = new IButton[19 + players.size()]; + _items = new ItemStack[_buttons.length]; + + _items[13] = getTeamItem(team, playerCount); + int slot = 19; for (Player other : players) @@ -79,41 +98,70 @@ public class SpectatorPage extends ShopPageBase addPlayerItem(slot, team, other); if ((slot + 2) % 9 == 0) + { + _buttons = Arrays.copyOf(_buttons, _buttons.length + 3); + _items = Arrays.copyOf(_items, _items.length + 3); + slot += 3; + } else + { slot++; + } } } private void buildMultipleTeams(List teamList, int playerCount) { + _buttons = new IButton[0]; + _items = new ItemStack[0]; + int currentRow = 0; + Collections.sort(teamList, new Comparator() + { + + @Override + public int compare(GameTeam o1, GameTeam o2) + { + int returns = o1.getDisplayName().compareToIgnoreCase( + o2.getDisplayName()); + + if (returns == 0) + { + return Long.compare(o1.getCreatedTime(), + o2.getCreatedTime()); + } + + return returns; + } + + }); + for (GameTeam team : teamList) { ArrayList teamPlayers = team.GetPlayers(true); - int rowsNeeded = (int) Math.ceil(teamPlayers.size() / 8.0); Collections.sort(teamPlayers, new Comparator() { - @Override public int compare(Player o1, Player o2) { return o1.getName().compareToIgnoreCase(o2.getName()); } - }); + int rowsNeeded = (int) Math.ceil(teamPlayers.size() / 8.0); + + _buttons = Arrays.copyOf(_buttons, _buttons.length + + (rowsNeeded * 9)); + _items = Arrays.copyOf(_items, _items.length + (rowsNeeded * 9)); + for (int row = 0; row < rowsNeeded; row++) { int woolSlot = (row * 9) + (currentRow * 9); - // TODO Need to handle too many players in a better way - if (woolSlot >= getSize()) - continue; - - setItem(woolSlot, getTeamItem(team, teamPlayers.size())); + _items[woolSlot] = getTeamItem(team, teamPlayers.size()); int playerIndex = row * 8; for (int i = 0; i < 8 && playerIndex < teamPlayers.size(); i++, playerIndex++) @@ -121,36 +169,43 @@ public class SpectatorPage extends ShopPageBase Player other = teamPlayers.get(playerIndex); int slot = woolSlot + 1 + i; - // TODO Need to handle too many players in a better way - if (slot >= getSize()) - continue; - addPlayerItem(slot, team, other); } } - // Add a line in between teams if the player count is low enough and there are less than 4 teams + // Add a line in between teams if the player count is low enough and + // there are less than 4 teams if (rowsNeeded == 1 && teamList.size() < 4 && playerCount <= 26) + { currentRow += 2; + } else + { currentRow += rowsNeeded; + } } } private void addPlayerItem(int slot, GameTeam team, Player other) { ItemStack playerItem = getPlayerItem(team, other); - ShopItem shopItem = new ShopItem(playerItem, other.getName(), other.getName(), 1, false, false); - addButton(slot, shopItem, new SpectatorButton(_arcadeManager, getPlayer(), other)); + + ShopItem shopItem = new ShopItem(playerItem, other.getName(), + other.getName(), 1, false, false); + + _items[slot] = shopItem; + _buttons[slot] = new SpectatorButton(_arcadeManager, getPlayer(), other); } private ItemStack getTeamItem(GameTeam team, int playerCount) { - ItemStack item = new ItemStack(Material.WOOL, 1, (short) 0, UtilColor.chatColorToWoolData(team.GetColor())); + ItemStack item = new ItemStack(Material.WOOL, 1, (short) 0, + UtilColor.chatColorToWoolData(team.GetColor())); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(team.GetFormattedName()); - meta.setLore(Arrays.asList(" ", ChatColor.RESET + C.cYellow + "Players Alive: " + C.cWhite + playerCount)); + meta.setLore(Arrays.asList(" ", ChatColor.RESET + C.cYellow + + "Players Alive: " + C.cWhite + playerCount)); item.setItemMeta(meta); return item; @@ -161,13 +216,17 @@ public class SpectatorPage extends ShopPageBase ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (byte) 3); double distance = UtilMath.offset(getPlayer(), other); - double heightDifference = other.getLocation().getY() - getPlayer().getLocation().getY(); + double heightDifference = other.getLocation().getY() + - getPlayer().getLocation().getY(); ArrayList lore = new ArrayList(); lore.add(" "); - lore.add(ChatColor.RESET + C.cYellow + "Kit: " + C.cWhite + _arcadeManager.GetGame().GetKit(other).GetName()); - lore.add(ChatColor.RESET + C.cYellow + "Distance: " + C.cWhite + UtilMath.trim(1, distance)); - lore.add(ChatColor.RESET + C.cYellow + "Height Difference: " + C.cWhite + UtilMath.trim(1, heightDifference)); + lore.add(ChatColor.RESET + C.cYellow + "Kit: " + C.cWhite + + _arcadeManager.GetGame().GetKit(other).GetName()); + lore.add(ChatColor.RESET + C.cYellow + "Distance: " + C.cWhite + + UtilMath.trim(1, distance)); + lore.add(ChatColor.RESET + C.cYellow + "Height Difference: " + C.cWhite + + UtilMath.trim(1, heightDifference)); lore.add(" "); lore.add(ChatColor.RESET + C.Line + "Click to Spectate"); SkullMeta skullMeta = ((SkullMeta) item.getItemMeta()); @@ -179,4 +238,16 @@ public class SpectatorPage extends ShopPageBase return item; } + @Override + protected IButton[] getButtons() + { + return _buttons; + } + + @Override + protected ItemStack[] getItems() + { + return _items; + } + } \ No newline at end of file From 901dad2f8a46126ee6691cf6d45cb5d793c8c311 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 17 Sep 2015 22:31:18 -0400 Subject: [PATCH 049/219] Add vote3 to bonusmanager --- .../Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java index 85f878294..1276e2f00 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java @@ -156,6 +156,7 @@ public class BonusManager extends MiniClientPlugin implements I _voteList = new ArrayList(); _voteList.add("http://vote1.mineplex.com"); _voteList.add("http://vote2.mineplex.com"); + _voteList.add("http://vote3.mineplex.com"); _coinQueue = new LinkedList(); _gemQueue = new LinkedList(); @@ -185,6 +186,7 @@ public class BonusManager extends MiniClientPlugin implements I _voteList = new ArrayList(); _voteList.add("http://vote1.mineplex.com"); _voteList.add("http://vote2.mineplex.com"); + _voteList.add("http://vote3.mineplex.com"); _canVote = true; _coinQueue = new LinkedList(); From 0581474a1668398d9358cde4610679ebbf60de23 Mon Sep 17 00:00:00 2001 From: fooify Date: Fri, 18 Sep 2015 08:25:11 -0700 Subject: [PATCH 050/219] lots of work on Monster Maze --- .../mineplex/core/common/util/RadarData.java | 38 +++ .../mineplex/core/common/util/UtilRadar.java | 112 +++++++++ .../src/mineplex/mapparser/MapParser.java | 10 +- .../game/games/monstermaze/MMMazes.java | 217 +++++++++--------- .../arcade/game/games/monstermaze/Maze.java | 80 ++++++- .../game/games/monstermaze/MonsterMaze.java | 78 +++++-- .../games/monstermaze/kits/KitJumper.java | 43 ++++ .../kits/{KitHyper.java => KitSmasher.java} | 17 +- 8 files changed, 448 insertions(+), 147 deletions(-) create mode 100644 Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/RadarData.java create mode 100644 Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilRadar.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitJumper.java rename Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/{KitHyper.java => KitSmasher.java} (73%) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/RadarData.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/RadarData.java new file mode 100644 index 000000000..51c4bf21a --- /dev/null +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/RadarData.java @@ -0,0 +1,38 @@ +package mineplex.core.common.util; + +import org.bukkit.Location; + +public class RadarData +{ + public Location Loc; + public String Text; + + private double _bearing = 0; + + public RadarData(Location loc, String text) + { + Loc = loc; + Text = text; + } + + public void print() + { + System.out.println(Text + ": " + _bearing); + } + + public void setBearing(double d) + { + while (d < -180) + d += 360; + + while (d > 180) + d -= 360; + + _bearing = d; + } + + public double getBearing() + { + return _bearing; + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilRadar.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilRadar.java new file mode 100644 index 000000000..3c8047fd9 --- /dev/null +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilRadar.java @@ -0,0 +1,112 @@ +package mineplex.core.common.util; + +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.entity.Player; + +public class UtilRadar +{ + public static void displayRadar(Player player, List dataList) + { + displayRadar(player, dataList, true); + } + + public static void displayRadar(Player player, List dataList, boolean bossBar) + { + int radarChars = 59; + int radarSpaces = radarChars; + + //get bearings for each element + for (RadarData data : dataList) + { + double pYaw = UtilAlg.GetYaw(player.getLocation().getDirection()); + double relYaw = UtilAlg.GetYaw(UtilAlg.getTrajectory(player.getLocation(), data.Loc)); + + data.setBearing(relYaw - pYaw); + + radarSpaces -= ChatColor.stripColor(data.Text).length(); + } + + //sort + sortScores(dataList); + + //draw + String text = C.cPurple + C.Bold + "Radar [" + ChatColor.RESET; + int radarSpacesDrawn = 0; + int radarCharsDrawn = 0; + + for (RadarData data : dataList) + { + //behind to left + if (data.getBearing() < -90) + { + text += ChatColor.RESET + data.Text; + radarCharsDrawn += ChatColor.stripColor(data.Text).length(); + } + //behind to right + else if (data.getBearing() > 90) + { + //finish spaces + while (radarSpacesDrawn < radarSpaces) + { + text += " "; + radarSpacesDrawn++; + radarCharsDrawn++; + } + + text += ChatColor.RESET + data.Text; + radarCharsDrawn += ChatColor.stripColor(data.Text).length(); + } + //in front + else + { + double percent = (data.getBearing() + 90D) / 180D; + + while (percent >= (double)radarCharsDrawn/(double)radarChars && radarSpacesDrawn dataList) + { + for (int i=0 ; i0 ; j--) + { + if (dataList.get(j).getBearing() < dataList.get(j-1).getBearing()) + { + RadarData temp = dataList.get(j); + dataList.set(j, dataList.get(j-1)); + dataList.set(j-1, temp); + } + } + } + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java index 50ff24667..deff89bb1 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java @@ -742,16 +742,14 @@ public class MapParser extends JavaPlugin implements Listener Block clicked = event.getClickedBlock(); Location center = clicked.getLocation(); - Location lowestCorner = center.clone().subtract(50, 0, 50); - - ArrayList blocks = UtilBlock.getInBoundingBox(center.clone().add(50, 0, 50), center.clone().subtract(49, 0, 49), false); + Location lowestCorner = center.clone().subtract(49, 0, 49); // 0 = air or other // 1 = path - quartz // 2 = mob spawn - gold // 3 = safe spawn - stone - int[][] maze = new int[100][100]; + int[][] maze = new int[99][99]; /*Iterator iter = blocks.iterator(); while(iter.hasNext()) @@ -787,8 +785,8 @@ public class MapParser extends JavaPlugin implements Listener } }*/ - for (int i = 0; i < 100; i++) - for (int j = 0; j < 100; j++) + for (int i = 0; i < 99; i++) + for (int j = 0; j < 99; j++) maze[i][j] = getMMParseValue(lowestCorner.clone().add(j, 0, i).getBlock().getType()); //Save diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java index f5715529a..51804fc23 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MMMazes.java @@ -36,12 +36,12 @@ public class MMMazes _center = loc; - Location cur = _center.clone().subtract(50, 0, 50); + Location cur = _center.clone().subtract(49, 0, 49); // x/y refers to array coordinates, not physical minecraft location - for (int y = 0; y < 100; y++) + for (int y = 0; y < 99; y++) { - for (int x = 0; x < 100; x++) + for (int x = 0; x < 99; x++) { int i = maze[y][x]; if(i == 1) @@ -64,7 +64,7 @@ public class MMMazes } cur = cur.clone().add(0, 0, 1); } - cur.setZ(_center.clone().subtract(50, 0, 50).getZ()); + cur.setZ(_center.clone().subtract(49, 0, 49).getZ()); cur = cur.clone().add(1, 0, 0); } @@ -95,13 +95,6 @@ public class MMMazes } } - public void printInfo() - { - System.out.println("_maze.size() == " + _maze.size()); - System.out.println("_spawns.size() == " + _spawns.size()); - System.out.println("_centerSafeZone.size() == " + _centerSafeZone.size()); - } - public void build() { for(Location loc : _maze) @@ -162,107 +155,105 @@ public class MMMazes // PARSED MAZES private static final int[][] M1 = { - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + }; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index e15655d32..a26761e88 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -5,10 +5,11 @@ import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.List; import java.util.Map.Entry; import java.util.Set; +import org.bukkit.Color; +import org.bukkit.FireworkEffect.Type; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; @@ -21,23 +22,33 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.entity.Zombie; +import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.player.PlayerInteractEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.RadarData; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilRadar; import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; +import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.recharge.Recharge; import nautilus.game.arcade.game.games.monstermaze.MMMazes.MazePreset; import nautilus.game.arcade.game.games.monstermaze.MazeMobWaypoint.CardinalDirection; +import nautilus.game.arcade.game.games.monstermaze.kits.KitSmasher; public class Maze implements Listener { @@ -60,6 +71,10 @@ public class Maze implements Listener private int _phaseTimer = 90; private int _padDecayTimer = -1; + + private Location _nextSafePadLoc; + + private RadarData _safePadRadarData; private HashMap _ents = new HashMap(); @@ -91,6 +106,8 @@ public class Maze implements Listener loc.getBlock().setData((byte)3); } _center = maze.getCenter(); + + pickNextLocForSafePad(); } public void update() @@ -98,7 +115,11 @@ public class Maze implements Listener if(_safePad != null) // TODO probably a good idea to check if this will screw up compasses in inventories before the game starts { for(Player p : Host.GetPlayers(true)) - p.setCompassTarget(_safePad.getLocation()); + { + p.setCompassTarget(_nextSafePadLoc); + UtilRadar.displayRadar(p, Arrays.asList(_safePadRadarData), false); + } + } if (Host.IsLive()) { @@ -113,6 +134,7 @@ public class Maze implements Listener { p.setExp(0); } + UtilTextTop.displayProgress(C.cAqua + C.Bold + "Be the first player to get to the Safe Pad!", 100, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); } else @@ -180,6 +202,7 @@ public class Maze implements Listener if (UtilMath.offset(player, ent) < 1) { Recharge.Instance.useForce(player, "Monster Hit", 1000); + Recharge.Instance.useForce(player, "Monster Launch", 2100); //Velocity //UtilAction.velocity(player, new Vector(1,0,0), 4, false, 0, 1.2, 1.2, true); @@ -397,6 +420,15 @@ public class Maze implements Listener } } + private void pickNextLocForSafePad() // short method name + { + ArrayList goals = new ArrayList(_goals); + if(_oldSafePad != null) goals.remove(_oldSafePad.getLocation().clone().add(0, 1, 0)); + _nextSafePadLoc = UtilAlg.Random(goals); + + _safePadRadarData = new RadarData(_nextSafePadLoc, '\u25A0' + ""); + } + public void spawnSafePad() { if(_safePad != null) @@ -408,10 +440,8 @@ public class Maze implements Listener _oldDisabledWaypoints = new HashSet<>(_disabledWaypoints); } _disabledWaypoints.clear(); - ArrayList goals = new ArrayList(_goals); - if(_oldSafePad != null) goals.remove(_oldSafePad.getLocation().clone().add(0, 1, 0)); - _safePad = new SafePad(Host, this, UtilAlg.Random(goals).clone().subtract(0,1,0)); // maybe don't need to clone() + _safePad = new SafePad(Host, this, _nextSafePadLoc.clone().subtract(0,1,0)); // maybe don't need to clone() _safePad.build(); Iterator iter = _waypoints.iterator(); @@ -535,6 +565,8 @@ public class Maze implements Listener if(_phaseTimer == 2) { + pickNextLocForSafePad(); + UtilFirework.playFirework(_nextSafePadLoc, Type.BALL, Color.ORANGE, false, false); UtilTextMiddle.display("", C.cGold + C.Bold + _phaseTimer + "...", 5, 40, 5, Host.GetPlayers(true).toArray(new Player[Host.GetPlayers(true).size()])); } @@ -578,6 +610,7 @@ public class Maze implements Listener { UtilPlayer.message(p, F.main("Game", C.cGreen + "Great, you made it. Stay on the Safe Pad!")); _playersOnPad.add(p); + Host.AddGems(p, 2, "Got to Safe Pad", true, true); if(_playersOnPad.size() == 1) // first player { if(_phaseTimer > 15) @@ -594,6 +627,7 @@ public class Maze implements Listener } UtilTextMiddle.display(C.cGold + C.Bold + "AWESOME!", C.cGold + "You were the first to make it to the Safe Pad!", 5, 40, 5, p); + Host.AddGems(p, 7.5, "First to Safe Pad", true, true); p.playSound(p.getLocation(), Sound.SUCCESSFUL_HIT, 1.0f, 1.0f); } else // not the first { @@ -609,6 +643,42 @@ public class Maze implements Listener } } + public void smasher(PlayerInteractEvent event) + { + if(!UtilEvent.isAction(event, ActionType.R)) return; + + if (event.getPlayer().getItemInHand() == null) + return; + + if (event.getPlayer().getItemInHand().getType() != Material.ANVIL) + return; + + Player player = event.getPlayer(); + + if (!(Host.GetKit(player) instanceof KitSmasher)) return; + + if (!Recharge.Instance.usable(player, "MM Smash")) + return; + + Recharge.Instance.useForce(player, "MM Smash", 2000); + + event.setCancelled(true); + + UtilInv.remove(player, Material.ANVIL, (byte)0, 1); + UtilInv.Update(player); + + for(Entity ent : UtilEnt.getInRadius(player.getLocation(), 3).keySet()) + { + if(_ents.containsKey(ent)) + { + Location loc = ent.getLocation(); + + UtilFirework.playFirework(loc, Type.BURST, Color.BLACK, false, false); + ent.teleport(UtilAlg.Random(_spawns)); + } + } + } + public void removePlayerContainmentUnit() { for(Location loc : _playerContainmentUnitLocations) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index 04d6f29ee..8ab8d7e45 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -1,5 +1,9 @@ package nautilus.game.arcade.game.games.monstermaze; +import java.util.HashMap; +import java.util.UUID; + +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; @@ -10,24 +14,24 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.block.EntityBlockFormEvent; import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scoreboard.Team; import mineplex.core.common.util.C; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTextMiddle; -import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilTime.TimeUnit; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.monstermaze.MMMazes.MazePreset; -import nautilus.game.arcade.game.games.monstermaze.kits.KitHyper; +import nautilus.game.arcade.game.games.monstermaze.kits.KitJumper; +import nautilus.game.arcade.game.games.monstermaze.kits.KitSmasher; import nautilus.game.arcade.kit.Kit; public class MonsterMaze extends SoloGame @@ -37,13 +41,18 @@ public class MonsterMaze extends SoloGame private MazePreset _preset; + private Location _center; + + private HashMap _jumperData = new HashMap<>(); + public MonsterMaze(ArcadeManager manager) { super(manager, GameType.MonsterMaze, new Kit[] { - new KitHyper(manager), + new KitJumper(manager), + new KitSmasher(manager) }, new String[] @@ -73,8 +82,8 @@ public class MonsterMaze extends SoloGame if(event.GetState() == GameState.Prepare) { //if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER; - if(_maze != null) System.out.println("maze is not null! :)"); //_maze.spawnSafePad(); + setupJumpers(); } else if(event.GetState() == GameState.Live) { @@ -90,25 +99,64 @@ public class MonsterMaze extends SoloGame else if(event.GetState() == GameState.Recruit) { _monsterType = EntityType.SNOWMAN; // TODO map-specific monster type - System.out.println("loc: " + WorldData.GetDataLocs("ORANGE").get(0).getBlockX() + "," + WorldData.GetDataLocs("ORANGE").get(0).getBlockY() + "," + WorldData.GetDataLocs("ORANGE").get(0).getBlockZ()); - _preset = MMMazes.getRandomMapPreset(WorldData.GetDataLocs("ORANGE").get(0)); - _preset.printInfo(); + _center = WorldData.GetDataLocs("ORANGE").get(0); + _preset = MMMazes.getRandomMapPreset(_center); _preset.build(); _maze = new Maze(this, _preset); - UtilServer.getServer().getPluginManager().registerEvents(_maze, getArcadeManager().getPlugin()); - _maze.fillSpawn(175); + _maze.fillSpawn(200); + } + } + + private void setupJumpers() + { + for(Player p : GetPlayers(true)) + { + if(GetKit(p) instanceof KitJumper) + { + _jumperData.put(p.getUniqueId(), 5); + } + } + } + + @EventHandler + public void smasher(PlayerInteractEvent event) + { + _maze.smasher(event); + } + + @EventHandler + public void jumpEvent(UpdateEvent event) + { + if(event.getType() != UpdateType.TICK) return; + if(GetState() != GameState.Live) return; + for(Player p : GetPlayers(true)) + { + if(!_jumperData.containsKey(p.getUniqueId()) || !Recharge.Instance.usable(p, "MM Player Jump") || p.getLocation().getY()-_center.getY() <= 0 || !Recharge.Instance.usable(p, "Monster Launch")) continue; + + _jumperData.put(p.getUniqueId(), _jumperData.get(p.getUniqueId())-1); + + Recharge.Instance.useForce(p, "MM Player Jump", 750); } } @EventHandler public void PotionEffects(UpdateEvent event) { - if(event.getType() != UpdateType.SEC) return; // because why not + if(event.getType() != UpdateType.TICK) return; if(!InProgress()) return; for(Player pl : GetPlayers(true)) { - pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000000, 250)); + if(_jumperData.containsKey(pl.getUniqueId()) && _jumperData.get(pl.getUniqueId()) > 0) + { + pl.getInventory().setItem(8, ItemStackFactory.Instance.CreateStack(Material.FEATHER, (byte)0, _jumperData.get(pl.getUniqueId()), + C.cYellow + C.Bold + _jumperData.get(pl.getUniqueId()) + " Jumps Remaining")); + } + else + { + pl.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000000, 250)); + pl.getInventory().setItem(8, ItemStackFactory.Instance.CreateStack(Material.AIR, (byte)0, 1, "" )); + } if(GetPlayers(true).size() > 4) { pl.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1000000000, 250)); @@ -182,7 +230,7 @@ public class MonsterMaze extends SoloGame } Scoreboard.WriteBlank(); - Scoreboard.Write(C.cYellow + C.Bold + "Players Alive"); + Scoreboard.Write(C.cYellow + C.Bold + "Players"); if(GetPlayers(true).size() > 5) { Scoreboard.Write(C.cWhite + GetPlayers(true).size() + " Players"); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitJumper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitJumper.java new file mode 100644 index 000000000..6a60d0521 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitJumper.java @@ -0,0 +1,43 @@ +package nautilus.game.arcade.game.games.monstermaze.kits; + +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.common.util.C; +import mineplex.core.itemstack.ItemStackFactory; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.KitAvailability; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.*; + +public class KitJumper extends Kit +{ + public KitJumper(ArcadeManager manager) + { + super(manager, "Jumper", KitAvailability.Free, + + new String[] + { + "Your legs are reinforced with metal braces,", + "so you can jump an extra five times!" + }, + + new Perk[] + { + + }, + EntityType.SKELETON, + new ItemStack(Material.FEATHER)); + + } + + @Override + public void GiveItems(Player player) + { + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COMPASS, (byte)0, 1, + C.cYellow + "Safe Pad Tracking Device™")); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitHyper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitSmasher.java similarity index 73% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitHyper.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitSmasher.java index 0408a5381..60995e4d6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitHyper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitSmasher.java @@ -13,23 +13,24 @@ import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.perks.*; -public class KitHyper extends Kit +public class KitSmasher extends Kit { - public KitHyper(ArcadeManager manager) + public KitSmasher(ArcadeManager manager) { - super(manager, "Hyper", KitAvailability.Free, + super(manager, "Smasher", KitAvailability.Gem, 4000, new String[] { - "Zoom zippity zip zip quick." + "You can perform three smashing actions,", + "which helps you clear your path!" }, new Perk[] { - new PerkHyper() + }, EntityType.SKELETON, - new ItemStack(Material.SUGAR)); + new ItemStack(Material.ANVIL)); } @@ -39,7 +40,7 @@ public class KitHyper extends Kit player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COMPASS, (byte)0, 1, C.cYellow + "Safe Pad Tracking Device™")); - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SUGAR, (byte)0, 3, - C.cYellow + C.Bold + "Right-click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Speed Boost")); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.ANVIL, (byte)0, 3, + C.cYellow + C.Bold + "Right-click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Smash")); } } From 1f8490730950a14063bcdbf6c9ce7c8835a602b1 Mon Sep 17 00:00:00 2001 From: fooify Date: Sun, 20 Sep 2015 07:40:24 -0700 Subject: [PATCH 051/219] more changes to monstermaze --- .../arcade/game/games/monstermaze/MonsterMaze.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index 8ab8d7e45..fc2d6ae00 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -5,6 +5,7 @@ import java.util.UUID; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.Sound; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; @@ -82,7 +83,7 @@ public class MonsterMaze extends SoloGame if(event.GetState() == GameState.Prepare) { //if(WorldData.MapName.contains("MonsterTest")) _monsterType = EntityType.CREEPER; - //_maze.spawnSafePad(); + _maze.spawnSafePad(); setupJumpers(); } else if(event.GetState() == GameState.Live) @@ -93,8 +94,6 @@ public class MonsterMaze extends SoloGame for (Team team : GetScoreboard().GetScoreboard().getTeams()) team.setCanSeeFriendlyInvisibles(true); - - _maze.spawnSafePad(); } else if(event.GetState() == GameState.Recruit) { @@ -104,7 +103,7 @@ public class MonsterMaze extends SoloGame _preset.build(); _maze = new Maze(this, _preset); - _maze.fillSpawn(200); + _maze.fillSpawn(150); } } @@ -135,6 +134,7 @@ public class MonsterMaze extends SoloGame if(!_jumperData.containsKey(p.getUniqueId()) || !Recharge.Instance.usable(p, "MM Player Jump") || p.getLocation().getY()-_center.getY() <= 0 || !Recharge.Instance.usable(p, "Monster Launch")) continue; _jumperData.put(p.getUniqueId(), _jumperData.get(p.getUniqueId())-1); + p.playSound(p.getLocation(), Sound.CHICKEN_EGG_POP, 1.0f, 1.0f); Recharge.Instance.useForce(p, "MM Player Jump", 750); } @@ -222,7 +222,7 @@ public class MonsterMaze extends SoloGame Scoreboard.Write(C.cDPurple + C.Bold + "Beacon Timer"); if(IsLive()) { - Scoreboard.Write(_maze.getPhaseTimer() + ""); + Scoreboard.Write(_maze.getPhaseTimer() + " Seconds"); } else { @@ -230,7 +230,6 @@ public class MonsterMaze extends SoloGame } Scoreboard.WriteBlank(); - Scoreboard.Write(C.cYellow + C.Bold + "Players"); if(GetPlayers(true).size() > 5) { Scoreboard.Write(C.cWhite + GetPlayers(true).size() + " Players"); From cf618abd4ec47fd984b4212a93b025d68de35696 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 22 Sep 2015 01:38:45 -0400 Subject: [PATCH 052/219] BotSpam Module --- Plugins/.idea/artifacts/Mineplex_Hub_jar.xml | 1 + Plugins/.idea/compiler.xml | 1 + Plugins/Mineplex.Core/Mineplex.Core.iml | 1 + .../src/mineplex/core/TablistFix.java | 3 +- .../mineplex/core/botspam/BotSpamManager.java | 162 ++++++++++++++++++ .../src/mineplex/core/botspam/SpamText.java | 47 +++++ .../botspam/command/BotSpamAddCommand.java | 64 +++++++ .../core/botspam/command/BotSpamCommand.java | 31 ++++ .../command/BotSpamDisableCommand.java | 71 ++++++++ .../botspam/command/BotSpamEnableCommand.java | 71 ++++++++ .../botspam/command/BotSpamListCommand.java | 40 +++++ .../botspam/repository/BotSpamRepository.java | 85 +++++++++ .../src/mineplex/core/punish/Punish.java | 34 ++-- .../Mineplex.Hub/src/mineplex/hub/Hub.java | 2 +- .../src/mineplex/hub/HubManager.java | 5 +- 15 files changed, 602 insertions(+), 16 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/botspam/BotSpamManager.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/botspam/SpamText.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamAddCommand.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamCommand.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamDisableCommand.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamEnableCommand.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamListCommand.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/botspam/repository/BotSpamRepository.java diff --git a/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml b/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml index 150c21bc3..370ba8bd7 100644 --- a/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml +++ b/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/Plugins/.idea/compiler.xml b/Plugins/.idea/compiler.xml index bd35e0f52..37717d4dc 100644 --- a/Plugins/.idea/compiler.xml +++ b/Plugins/.idea/compiler.xml @@ -4,6 +4,7 @@