diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index c74d23965..b134589dc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -714,52 +714,67 @@ public enum Achievement new int[]{1}, AchievementCategory.MINE_STRIKE), - //MineWare - MINEWARE_VETERAN("Mineware Veteran", 1500, - new String[]{"MineWare.Veteran"}, - new String[]{"Win 50 games of Mineware"}, + //Bawk Bawk Battles + BAWK_BAWK_BATTLES_VETERAN("Bawk Bawk Battles Veteran", 1500, + new String[]{"BawkBawkBattles.Veteran"}, + new String[]{"Win 50 games of Bawk Bawk Battles"}, new int[] {50}, - AchievementCategory.MINEWARE), - - MINEWARE_LAURA_CRAFT("Laura Craft", 800, - new String[]{"MineWare.LauraCraft"}, - new String[]{"Complete the maze challenge in under 8 seconds 3 times"}, + AchievementCategory.BAWK_BAWK_BATTLES), + + BAWK_BAWK_BATTLES_LAURA_CRAFT("Laura Craft", 800, + new String[]{"BawkBawkBattles.LauraCraft"}, + new String[]{ + C.cGray + "Maze Runner Challenge", + "Finish 3 times in a row, in under 8 seconds" + }, new int[] {3}, - AchievementCategory.MINEWARE), - - MINEWARE_PINATA_MASTER("Pinata Master", 800, - new String[]{"MineWare.PinataMaster"}, - new String[]{"In chicken shooter, hit 6 chickens without missing one"}, + AchievementCategory.BAWK_BAWK_BATTLES), + + BAWK_BAWK_BATTLES_PINATA_MASTER("Pinata Master", 800, + new String[]{"BawkBawkBattles.PinataMaster"}, + new String[]{ + C.cGray + "Chicken Shooting Challenge", + "Hit 6 chickens without missing one" + }, new int[] {1}, - AchievementCategory.MINEWARE), - - MINEWARE_MILK_MAN("Professional Milk Man", 700, - new String[]{"MineWare.MilkMan"}, - new String[]{"In Milk the Cows, Collect 100 buckets of milk to the Farmer"}, + AchievementCategory.BAWK_BAWK_BATTLES), + + BAWK_BAWK_BATTLES_MILK_MAN("Professional Milk Man", 700, + new String[]{"BawkBawkBattles.MilkMan"}, + new String[]{ + C.cGray + "Milk a Cow Challenge", + "Deliver 100 buckets of milk to the farmer" + }, new int[] {100}, - AchievementCategory.MINEWARE), - - MINEWARE_TAG_MASTER("Tag Master", 700, - new String[]{"MineWare.TagMaster"}, - new String[]{"In reverse tag, Win an entire round without losing the tag"}, + AchievementCategory.BAWK_BAWK_BATTLES), + + BAWK_BAWK_BATTLES_TAG_MASTER("Tag Master", 700, + new String[]{"BawkBawkBattles.TagMaster"}, + new String[]{ + C.cGray + "Reverse Tag Challenge", + "Win an entire round without being untagged" + }, new int[] {1}, - AchievementCategory.MINEWARE), + AchievementCategory.BAWK_BAWK_BATTLES), - MINEWARE_SURF_UP("Surf Up", 850, - new String[]{"MineWare.SurfUp"}, - new String[]{"Avoid 250 waves in Wave Crush"}, + BAWK_BAWK_BATTLES_SURF_UP("Surf Up", 850, + new String[]{"BawkBawkBattles.SurfUp"}, + new String[]{ + C.cGray + "Wave Crush Challenge", + "Avoid 250 waves" + }, new int[] {250}, - AchievementCategory.MINEWARE), + AchievementCategory.BAWK_BAWK_BATTLES), - MINEWARE_KANGAROO_AT_HEART("Kangaroo at Heart", 900, - new String[]{"MineWare.Kangaroo"}, - new String[]{"Complete Kangaroo Jump without falling once, 15 times"}, + BAWK_BAWK_BATTLES_KANGAROO_AT_HEART("Kangaroo at Heart", 900, + new String[]{"BawkBawkBattles.Kangaroo"}, + new String[]{ + C.cGray + "Kangaroo Jump Challenge", + "Complete the challenge 15 times in a row without falling" + }, new int[] {15}, - AchievementCategory.MINEWARE), + AchievementCategory.BAWK_BAWK_BATTLES), - - - //Bomb Lobbers BOMB_LOBBERS_WINS("Master Bomber", 1200, new String[]{"Bomb Lobbers.Wins"}, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java index c4da40e41..b4baccb72 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java @@ -2,19 +2,18 @@ package mineplex.core.achievement; import java.util.List; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.entity.Player; + import mineplex.core.account.CoreClientManager; import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilTime; -import mineplex.core.game.GameCategory; import mineplex.core.game.GameDisplay; import mineplex.core.stats.PlayerStats; import mineplex.core.stats.StatsManager; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.entity.Player; - public enum AchievementCategory { GLOBAL("Global", null, @@ -63,10 +62,10 @@ public enum AchievementCategory new StatDisplay("Kills as Undead"), new StatDisplay("Deaths as Undead"), StatDisplay.GEMS_EARNED }, Material.DIAMOND_CHESTPLATE, 0, GameCategory.CLASSICS, null), - MINEWARE("Mineware", null, + BAWK_BAWK_BATTLES("Bawk Bawk Battles", null, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.GEMS_EARNED }, - Material.SPONGE, 0, GameCategory.CLASSICS, null), - + Material.EGG, 0, GameCategory.CLASSICS, null), + BLOCK_HUNT("Block Hunt", null, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, Material.GRASS, 0, GameCategory.CLASSICS, "Infestor Kit"), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/ui/page/AchievementMainPage.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/ui/page/AchievementMainPage.java index 3817df163..280e3ba54 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/ui/page/AchievementMainPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/ui/page/AchievementMainPage.java @@ -46,7 +46,7 @@ public class AchievementMainPage extends ShopPageBase pageLayout = new ItemLayout( - "XXXXOXXXO", + "XXXXOXOXO", "OXOXOXOXO", "OXOXOXOXO", "OXOXOXOXO").getItemSlots(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java index af956fc81..32f5af24f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java @@ -105,7 +105,7 @@ import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengePunchThe import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeRedLightGreenLight; import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeReverseTag; import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeRushPush; -import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeShootChickens; +import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeChickenShooting; import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeSmashOff; import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeTreasureDigger; import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeVolleyPig; @@ -117,13 +117,13 @@ import nautilus.game.arcade.game.games.mineware.effect.DeathEffectData; import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent; import nautilus.game.arcade.game.games.mineware.events.ChallengeStartEvent; import nautilus.game.arcade.game.games.mineware.kit.KitBawksFood; -import nautilus.game.arcade.game.games.mineware.stats.MinewareKangarooAtHeart; -import nautilus.game.arcade.game.games.mineware.stats.MinewareLauraCraftTracker; -import nautilus.game.arcade.game.games.mineware.stats.MinewareMilkManTracker; -import nautilus.game.arcade.game.games.mineware.stats.MinewarePinataMasterTracker; -import nautilus.game.arcade.game.games.mineware.stats.MinewareSurfUpTracker; -import nautilus.game.arcade.game.games.mineware.stats.MinewareTagMasterTracker; -import nautilus.game.arcade.game.games.mineware.stats.MinewareVeteranTracker; +import nautilus.game.arcade.game.games.mineware.stats.StatTrackerKangarooAtHeart; +import nautilus.game.arcade.game.games.mineware.stats.StatTrackerLauraCraftTracker; +import nautilus.game.arcade.game.games.mineware.stats.StatTrackerMilkManTracker; +import nautilus.game.arcade.game.games.mineware.stats.StatTrackerPinataMasterTracker; +import nautilus.game.arcade.game.games.mineware.stats.StatTrackerSurfUpTracker; +import nautilus.game.arcade.game.games.mineware.stats.StatTrackerTagMasterTracker; +import nautilus.game.arcade.game.games.mineware.stats.StatTrackerVeteranTracker; import nautilus.game.arcade.kit.Kit; /** @@ -167,9 +167,8 @@ public class BawkBawkBattles extends TeamGame implements IThrown * * High Priority * - Define team spawns on correct side - * - Fix delay on map generation (NPE's on console) * - Fix item rendering exception (kangaroo jump http://i.imgur.com/CPYIogC.jpg) - * + * * Medium Priority * - Make spawn distance equal from a target * - Fix out of bounds exception on stats menu @@ -226,13 +225,14 @@ public class BawkBawkBattles extends TeamGame implements IThrown populateChallenges(); registerStatTrackers( - new MinewareVeteranTracker(this), - new MinewareSurfUpTracker(this), - new MinewareLauraCraftTracker(this), - new MinewareMilkManTracker(this), - new MinewarePinataMasterTracker(this), - new MinewareTagMasterTracker(this), - new MinewareKangarooAtHeart(this)); + new StatTrackerKangarooAtHeart(this), + new StatTrackerLauraCraftTracker(this), + new StatTrackerMilkManTracker(this), + new StatTrackerPinataMasterTracker(this), + new StatTrackerSurfUpTracker(this), + new StatTrackerTagMasterTracker(this), + new StatTrackerVeteranTracker(this) + ); } @SuppressWarnings("unchecked") @@ -244,6 +244,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown ChallengeBlockLobbers.class, ChallengeBouncingBlock.class, ChallengeBuildRace.class, + ChallengeChickenShooting.class, ChallengeDiamondSeeker.class, ChallengeCloudFall.class, ChallengeColorChange.class, @@ -268,7 +269,6 @@ public class BawkBawkBattles extends TeamGame implements IThrown ChallengeRedLightGreenLight.class, ChallengeReverseTag.class, ChallengeRushPush.class, - ChallengeShootChickens.class, ChallengeSmashOff.class, ChallengeTreasureDigger.class, ChallengeVolleyPig.class, diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeShootChickens.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeChickenShooting.java similarity index 98% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeShootChickens.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeChickenShooting.java index 9dea44a34..340216f8b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeShootChickens.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeChickenShooting.java @@ -32,13 +32,13 @@ import nautilus.game.arcade.game.games.mineware.BawkBawkBattles; import nautilus.game.arcade.game.games.mineware.challenge.Challenge; import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType; -public class ChallengeShootChickens extends Challenge +public class ChallengeChickenShooting extends Challenge { private ArrayList _chickens = new ArrayList(); private HashMap _score = new HashMap(); private HashMap _arrowsShot = new HashMap(); - public ChallengeShootChickens(BawkBawkBattles host) + public ChallengeChickenShooting(BawkBawkBattles host) { super( host, diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeKangarooJump.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeKangarooJump.java index dc62b14d4..a616b980b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeKangarooJump.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeKangarooJump.java @@ -224,7 +224,7 @@ public class ChallengeKangarooJump extends Challenge return players; } - public HashMap getPlayerHeight() + public HashMap getPlayerHeights() { return _playerJumpHeight; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeMilkACow.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeMilkACow.java index 3f90c799d..20ee1d7b9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeMilkACow.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeMilkACow.java @@ -323,7 +323,7 @@ public class ChallengeMilkACow extends Challenge holo.setFollowEntity(cow); holo.start(); } - + private Location getRandomLocation() { return getCenter().add(UtilMath.r(((getArenaSize() * 2) - 1) - (getArenaSize() - 1)), 1, UtilMath.r((getArenaSize() * 2) - 1) - (getArenaSize() - 1)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareLauraCraftTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareLauraCraftTracker.java deleted file mode 100644 index 9747763b2..000000000 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareLauraCraftTracker.java +++ /dev/null @@ -1,56 +0,0 @@ -package nautilus.game.arcade.game.games.mineware.stats; - -import nautilus.game.arcade.game.Game; -import nautilus.game.arcade.game.Game.GameState; -import nautilus.game.arcade.game.games.mineware.challenge.Challenge; -import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeNavigationMaze; -import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent; -import nautilus.game.arcade.game.games.mineware.events.ChallengeStartEvent; -import nautilus.game.arcade.stats.StatTracker; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; - -public class MinewareLauraCraftTracker extends StatTracker -{ - private long _challengeStartTime; - private int _timeForCompletion = 8; // Measured in seconds. - - public MinewareLauraCraftTracker(Game game) - { - super(game); - } - - @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) - public void onMazeChallengeStart(ChallengeStartEvent event) - { - if (getGame().GetState() != GameState.Live) - return; - - Challenge challenge = event.getStartedChallenge(); - - if (!(challenge instanceof ChallengeNavigationMaze)) - return; - - _challengeStartTime = System.currentTimeMillis(); - } - - @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) - public void onMazeChallengeEnd(ChallengeEndEvent event) - { - if (getGame().GetState() != GameState.Live) - return; - - Challenge challenge = event.getEndedChallenge(); - - if (!(challenge instanceof ChallengeNavigationMaze)) - return; - - ChallengeNavigationMaze challengeMaze = (ChallengeNavigationMaze) challenge; - - for (Player player : challengeMaze.getPlayerTimes().keySet()) - if (challengeMaze.getPlayerTimes().get(player) <= (_challengeStartTime + (_timeForCompletion * 1000))) - addStat(player, "LauraCraft", 1, false, false); - } -} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareKangarooAtHeart.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerKangarooAtHeart.java similarity index 71% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareKangarooAtHeart.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerKangarooAtHeart.java index df2900a07..ae353b1f8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareKangarooAtHeart.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerKangarooAtHeart.java @@ -11,9 +11,9 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -public class MinewareKangarooAtHeart extends StatTracker +public class StatTrackerKangarooAtHeart extends StatTracker { - public MinewareKangarooAtHeart(Game game) + public StatTrackerKangarooAtHeart(Game game) { super(game); } @@ -29,10 +29,17 @@ public class MinewareKangarooAtHeart extends StatTracker if (!(challenge instanceof ChallengeKangarooJump)) return; - ChallengeKangarooJump kJump = (ChallengeKangarooJump) challenge; + ChallengeKangarooJump kangarooJump = (ChallengeKangarooJump) challenge; - for (Player player : kJump.getPlayerHeight().keySet()) - if (!kJump.getData().isLost(player)) + for (Player player : kangarooJump.getPlayerHeights().keySet()) + { + if (!player.isOnline()) + continue; + + if (!kangarooJump.getData().isLost(player)) + { addStat(player, "Kangaroo", 1, false, false); + } + } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerLauraCraftTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerLauraCraftTracker.java new file mode 100644 index 000000000..5f89be189 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerLauraCraftTracker.java @@ -0,0 +1,47 @@ +package nautilus.game.arcade.game.games.mineware.stats; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; + +import nautilus.game.arcade.game.Game; +import nautilus.game.arcade.game.Game.GameState; +import nautilus.game.arcade.game.games.mineware.challenge.Challenge; +import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeNavigationMaze; +import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent; +import nautilus.game.arcade.stats.StatTracker; + +public class StatTrackerLauraCraftTracker extends StatTracker +{ + private int _timeForCompletion = 8; // Seconds + + public StatTrackerLauraCraftTracker(Game game) + { + super(game); + } + + @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) + public void onChallengeEnd(ChallengeEndEvent event) + { + if (getGame().GetState() != GameState.Live) + return; + + Challenge challenge = event.getEndedChallenge(); + + if (!(challenge instanceof ChallengeNavigationMaze)) + return; + + ChallengeNavigationMaze navigationMaze = (ChallengeNavigationMaze) challenge; + + for (Player player : navigationMaze.getPlayerTimes().keySet()) + { + if (!player.isOnline()) + continue; + + if (navigationMaze.getPlayerTimes().get(player) <= (navigationMaze.getSettings().getStartTime() + (_timeForCompletion * 1000))) + { + addStat(player, "LauraCraft", 1, false, false); + } + } + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareMilkManTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerMilkManTracker.java similarity index 77% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareMilkManTracker.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerMilkManTracker.java index 724d590eb..d3ad65df5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareMilkManTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerMilkManTracker.java @@ -11,9 +11,9 @@ import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeMilkACow import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent; import nautilus.game.arcade.stats.StatTracker; -public class MinewareMilkManTracker extends StatTracker +public class StatTrackerMilkManTracker extends StatTracker { - public MinewareMilkManTracker(Game game) + public StatTrackerMilkManTracker(Game game) { super(game); } @@ -29,15 +29,15 @@ public class MinewareMilkManTracker extends StatTracker if (!(challenge instanceof ChallengeMilkACow)) return; - ChallengeMilkACow milk = (ChallengeMilkACow) challenge; + ChallengeMilkACow milkeACow = (ChallengeMilkACow) challenge; - for (Player player : milk.getScore().keySet()) + for (Player player : milkeACow.getScore().keySet()) { - int score = milk.getScore().get(player); - if (!player.isOnline()) continue; + int score = milkeACow.getScore().get(player); + addStat(player, "MilkMan", score, false, false); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewarePinataMasterTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerPinataMasterTracker.java similarity index 61% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewarePinataMasterTracker.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerPinataMasterTracker.java index f2f1cb270..4cdb7a385 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewarePinataMasterTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerPinataMasterTracker.java @@ -3,7 +3,7 @@ package nautilus.game.arcade.game.games.mineware.stats; import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.games.mineware.challenge.Challenge; -import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeShootChickens; +import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeChickenShooting; import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent; import nautilus.game.arcade.stats.StatTracker; @@ -11,9 +11,9 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -public class MinewarePinataMasterTracker extends StatTracker +public class StatTrackerPinataMasterTracker extends StatTracker { - public MinewarePinataMasterTracker(Game game) + public StatTrackerPinataMasterTracker(Game game) { super(game); } @@ -26,13 +26,22 @@ public class MinewarePinataMasterTracker extends StatTracker Challenge challenge = event.getEndedChallenge(); - if (!(challenge instanceof ChallengeShootChickens)) + if (!(challenge instanceof ChallengeChickenShooting)) return; - ChallengeShootChickens chickChallenge = (ChallengeShootChickens) challenge; + ChallengeChickenShooting chickenShooting = (ChallengeChickenShooting) challenge; - for (Player player : chickChallenge.getArrowsShot().keySet()) - if (chickChallenge.getArrowsShot().get(player) == 6 && challenge.getData().isCompleted(player)) + for (Player player : chickenShooting.getArrowsShot().keySet()) + { + if (!player.isOnline()) + continue; + + int shots = chickenShooting.getArrowsShot().get(player); + + if (shots == 6 && challenge.getData().isCompleted(player)) + { addStat(player, "PinataMaster", 1, true, false); + } + } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareSurfUpTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerSurfUpTracker.java similarity index 68% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareSurfUpTracker.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerSurfUpTracker.java index efabf331c..935f8045f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareSurfUpTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerSurfUpTracker.java @@ -11,9 +11,9 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -public class MinewareSurfUpTracker extends StatTracker +public class StatTrackerSurfUpTracker extends StatTracker { - public MinewareSurfUpTracker(Game game) + public StatTrackerSurfUpTracker(Game game) { super(game); } @@ -29,16 +29,19 @@ public class MinewareSurfUpTracker extends StatTracker if (!(challenge instanceof ChallengeWaveCrush)) return; - ChallengeWaveCrush wave = (ChallengeWaveCrush) challenge; + ChallengeWaveCrush waveCrush = (ChallengeWaveCrush) challenge; - for (Player player : wave.getSurvivedWaves().keySet()) + for (Player player : waveCrush.getSurvivedWaves().keySet()) { - int survivedWavesAmount = wave.getSurvivedWaves().get(player); + if (!player.isOnline()) + continue; + + int amount = waveCrush.getSurvivedWaves().get(player); - if (survivedWavesAmount < 1) + if (amount < 1) continue; - addStat(player, "SurfUp", survivedWavesAmount, false, false); + addStat(player, "SurfUp", amount, false, false); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareTagMasterTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerTagMasterTracker.java similarity index 68% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareTagMasterTracker.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerTagMasterTracker.java index 7e82c15a1..f631b93fd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareTagMasterTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerTagMasterTracker.java @@ -11,15 +11,15 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -public class MinewareTagMasterTracker extends StatTracker +public class StatTrackerTagMasterTracker extends StatTracker { - public MinewareTagMasterTracker(Game game) + public StatTrackerTagMasterTracker(Game game) { super(game); } @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) - public void onGameEnd(ChallengeEndEvent event) + public void onChallengeEnd(ChallengeEndEvent event) { if (getGame().GetState() != GameState.Live) return; @@ -29,12 +29,15 @@ public class MinewareTagMasterTracker extends StatTracker if (!(challenge instanceof ChallengeReverseTag)) return; - ChallengeReverseTag tag = (ChallengeReverseTag) challenge; + ChallengeReverseTag reverseTag = (ChallengeReverseTag) challenge; - for (Player player : tag.getNonTagged().getPlayers()) + for (Player player : reverseTag.getNonTagged().getPlayers()) { - if (tag.getData().isLost(player)) - return; + if (!player.isOnline()) + continue; + + if (reverseTag.getData().isLost(player)) + continue; addStat(player, "TagMaster", 1, true, false); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareVeteranTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerVeteranTracker.java similarity index 76% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareVeteranTracker.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerVeteranTracker.java index 8d58d24c4..c4f563cf8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/MinewareVeteranTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/stats/StatTrackerVeteranTracker.java @@ -1,26 +1,30 @@ package nautilus.game.arcade.game.games.mineware.stats; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; + import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.stats.StatTracker; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; - -public class MinewareVeteranTracker extends StatTracker +public class StatTrackerVeteranTracker extends StatTracker { - public MinewareVeteranTracker(Game game) + public StatTrackerVeteranTracker(Game game) { super(game); } @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) - public void tracePlayerWin(GameStateChangeEvent event) + public void onGameStateChange(GameStateChangeEvent event) { if (event.GetState() == GameState.End) + { for (Player player : getGame().getWinners()) + { addStat(player, "Veteran", 1, true, false); + } + } } }