Update game achievements

This commit is contained in:
Thanos paravantis 2016-04-24 13:37:39 +03:00
parent bfabfab2d1
commit e2a6500bce
15 changed files with 193 additions and 162 deletions

View File

@ -714,52 +714,67 @@ public enum Achievement
new int[]{1}, new int[]{1},
AchievementCategory.MINE_STRIKE), AchievementCategory.MINE_STRIKE),
//MineWare //Bawk Bawk Battles
MINEWARE_VETERAN("Mineware Veteran", 1500, BAWK_BAWK_BATTLES_VETERAN("Bawk Bawk Battles Veteran", 1500,
new String[]{"MineWare.Veteran"}, new String[]{"BawkBawkBattles.Veteran"},
new String[]{"Win 50 games of Mineware"}, new String[]{"Win 50 games of Bawk Bawk Battles"},
new int[] {50}, new int[] {50},
AchievementCategory.MINEWARE), AchievementCategory.BAWK_BAWK_BATTLES),
MINEWARE_LAURA_CRAFT("Laura Craft", 800, BAWK_BAWK_BATTLES_LAURA_CRAFT("Laura Craft", 800,
new String[]{"MineWare.LauraCraft"}, new String[]{"BawkBawkBattles.LauraCraft"},
new String[]{"Complete the maze challenge in under 8 seconds 3 times"}, new String[]{
C.cGray + "Maze Runner Challenge",
"Finish 3 times in a row, in under 8 seconds"
},
new int[] {3}, new int[] {3},
AchievementCategory.MINEWARE), AchievementCategory.BAWK_BAWK_BATTLES),
MINEWARE_PINATA_MASTER("Pinata Master", 800, BAWK_BAWK_BATTLES_PINATA_MASTER("Pinata Master", 800,
new String[]{"MineWare.PinataMaster"}, new String[]{"BawkBawkBattles.PinataMaster"},
new String[]{"In chicken shooter, hit 6 chickens without missing one"}, new String[]{
C.cGray + "Chicken Shooting Challenge",
"Hit 6 chickens without missing one"
},
new int[] {1}, new int[] {1},
AchievementCategory.MINEWARE), AchievementCategory.BAWK_BAWK_BATTLES),
MINEWARE_MILK_MAN("Professional Milk Man", 700, BAWK_BAWK_BATTLES_MILK_MAN("Professional Milk Man", 700,
new String[]{"MineWare.MilkMan"}, new String[]{"BawkBawkBattles.MilkMan"},
new String[]{"In Milk the Cows, Collect 100 buckets of milk to the Farmer"}, new String[]{
C.cGray + "Milk a Cow Challenge",
"Deliver 100 buckets of milk to the farmer"
},
new int[] {100}, new int[] {100},
AchievementCategory.MINEWARE), AchievementCategory.BAWK_BAWK_BATTLES),
MINEWARE_TAG_MASTER("Tag Master", 700, BAWK_BAWK_BATTLES_TAG_MASTER("Tag Master", 700,
new String[]{"MineWare.TagMaster"}, new String[]{"BawkBawkBattles.TagMaster"},
new String[]{"In reverse tag, Win an entire round without losing the tag"}, new String[]{
C.cGray + "Reverse Tag Challenge",
"Win an entire round without being untagged"
},
new int[] {1}, new int[] {1},
AchievementCategory.MINEWARE), AchievementCategory.BAWK_BAWK_BATTLES),
MINEWARE_SURF_UP("Surf Up", 850, BAWK_BAWK_BATTLES_SURF_UP("Surf Up", 850,
new String[]{"MineWare.SurfUp"}, new String[]{"BawkBawkBattles.SurfUp"},
new String[]{"Avoid 250 waves in Wave Crush"}, new String[]{
C.cGray + "Wave Crush Challenge",
"Avoid 250 waves"
},
new int[] {250}, new int[] {250},
AchievementCategory.MINEWARE), AchievementCategory.BAWK_BAWK_BATTLES),
MINEWARE_KANGAROO_AT_HEART("Kangaroo at Heart", 900, BAWK_BAWK_BATTLES_KANGAROO_AT_HEART("Kangaroo at Heart", 900,
new String[]{"MineWare.Kangaroo"}, new String[]{"BawkBawkBattles.Kangaroo"},
new String[]{"Complete Kangaroo Jump without falling once, 15 times"}, new String[]{
C.cGray + "Kangaroo Jump Challenge",
"Complete the challenge 15 times in a row without falling"
},
new int[] {15}, new int[] {15},
AchievementCategory.MINEWARE), AchievementCategory.BAWK_BAWK_BATTLES),
//Bomb Lobbers //Bomb Lobbers
BOMB_LOBBERS_WINS("Master Bomber", 1200, BOMB_LOBBERS_WINS("Master Bomber", 1200,
new String[]{"Bomb Lobbers.Wins"}, new String[]{"Bomb Lobbers.Wins"},

View File

@ -2,19 +2,18 @@ package mineplex.core.achievement;
import java.util.List; 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.account.CoreClientManager;
import mineplex.core.common.Rank; import mineplex.core.common.Rank;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.game.GameCategory;
import mineplex.core.game.GameDisplay; import mineplex.core.game.GameDisplay;
import mineplex.core.stats.PlayerStats; import mineplex.core.stats.PlayerStats;
import mineplex.core.stats.StatsManager; import mineplex.core.stats.StatsManager;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
public enum AchievementCategory public enum AchievementCategory
{ {
GLOBAL("Global", null, GLOBAL("Global", null,
@ -63,10 +62,10 @@ public enum AchievementCategory
new StatDisplay("Kills as Undead"), new StatDisplay("Deaths as Undead"), StatDisplay.GEMS_EARNED }, new StatDisplay("Kills as Undead"), new StatDisplay("Deaths as Undead"), StatDisplay.GEMS_EARNED },
Material.DIAMOND_CHESTPLATE, 0, GameCategory.CLASSICS, null), 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 }, 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, BLOCK_HUNT("Block Hunt", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
Material.GRASS, 0, GameCategory.CLASSICS, "Infestor Kit"), Material.GRASS, 0, GameCategory.CLASSICS, "Infestor Kit"),

View File

@ -46,7 +46,7 @@ public class AchievementMainPage extends ShopPageBase<AchievementManager, Achiev
protected void buildPage() protected void buildPage()
{ {
ArrayList<Integer> pageLayout = new ItemLayout( ArrayList<Integer> pageLayout = new ItemLayout(
"XXXXOXXXO", "XXXXOXOXO",
"OXOXOXOXO", "OXOXOXOXO",
"OXOXOXOXO", "OXOXOXOXO",
"OXOXOXOXO").getItemSlots(); "OXOXOXOXO").getItemSlots();

View File

@ -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.ChallengeRedLightGreenLight;
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeReverseTag; 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.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.ChallengeSmashOff;
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeTreasureDigger; import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeTreasureDigger;
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeVolleyPig; 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.ChallengeEndEvent;
import nautilus.game.arcade.game.games.mineware.events.ChallengeStartEvent; 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.kit.KitBawksFood;
import nautilus.game.arcade.game.games.mineware.stats.MinewareKangarooAtHeart; import nautilus.game.arcade.game.games.mineware.stats.StatTrackerKangarooAtHeart;
import nautilus.game.arcade.game.games.mineware.stats.MinewareLauraCraftTracker; import nautilus.game.arcade.game.games.mineware.stats.StatTrackerLauraCraftTracker;
import nautilus.game.arcade.game.games.mineware.stats.MinewareMilkManTracker; import nautilus.game.arcade.game.games.mineware.stats.StatTrackerMilkManTracker;
import nautilus.game.arcade.game.games.mineware.stats.MinewarePinataMasterTracker; import nautilus.game.arcade.game.games.mineware.stats.StatTrackerPinataMasterTracker;
import nautilus.game.arcade.game.games.mineware.stats.MinewareSurfUpTracker; import nautilus.game.arcade.game.games.mineware.stats.StatTrackerSurfUpTracker;
import nautilus.game.arcade.game.games.mineware.stats.MinewareTagMasterTracker; import nautilus.game.arcade.game.games.mineware.stats.StatTrackerTagMasterTracker;
import nautilus.game.arcade.game.games.mineware.stats.MinewareVeteranTracker; import nautilus.game.arcade.game.games.mineware.stats.StatTrackerVeteranTracker;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
/** /**
@ -167,9 +167,8 @@ public class BawkBawkBattles extends TeamGame implements IThrown
* *
* High Priority * High Priority
* - Define team spawns on correct side * - 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) * - Fix item rendering exception (kangaroo jump http://i.imgur.com/CPYIogC.jpg)
* *
* Medium Priority * Medium Priority
* - Make spawn distance equal from a target * - Make spawn distance equal from a target
* - Fix out of bounds exception on stats menu * - Fix out of bounds exception on stats menu
@ -226,13 +225,14 @@ public class BawkBawkBattles extends TeamGame implements IThrown
populateChallenges(); populateChallenges();
registerStatTrackers( registerStatTrackers(
new MinewareVeteranTracker(this), new StatTrackerKangarooAtHeart(this),
new MinewareSurfUpTracker(this), new StatTrackerLauraCraftTracker(this),
new MinewareLauraCraftTracker(this), new StatTrackerMilkManTracker(this),
new MinewareMilkManTracker(this), new StatTrackerPinataMasterTracker(this),
new MinewarePinataMasterTracker(this), new StatTrackerSurfUpTracker(this),
new MinewareTagMasterTracker(this), new StatTrackerTagMasterTracker(this),
new MinewareKangarooAtHeart(this)); new StatTrackerVeteranTracker(this)
);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -244,6 +244,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown
ChallengeBlockLobbers.class, ChallengeBlockLobbers.class,
ChallengeBouncingBlock.class, ChallengeBouncingBlock.class,
ChallengeBuildRace.class, ChallengeBuildRace.class,
ChallengeChickenShooting.class,
ChallengeDiamondSeeker.class, ChallengeDiamondSeeker.class,
ChallengeCloudFall.class, ChallengeCloudFall.class,
ChallengeColorChange.class, ChallengeColorChange.class,
@ -268,7 +269,6 @@ public class BawkBawkBattles extends TeamGame implements IThrown
ChallengeRedLightGreenLight.class, ChallengeRedLightGreenLight.class,
ChallengeReverseTag.class, ChallengeReverseTag.class,
ChallengeRushPush.class, ChallengeRushPush.class,
ChallengeShootChickens.class,
ChallengeSmashOff.class, ChallengeSmashOff.class,
ChallengeTreasureDigger.class, ChallengeTreasureDigger.class,
ChallengeVolleyPig.class, ChallengeVolleyPig.class,

View File

@ -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.Challenge;
import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType; import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType;
public class ChallengeShootChickens extends Challenge public class ChallengeChickenShooting extends Challenge
{ {
private ArrayList<Chicken> _chickens = new ArrayList<Chicken>(); private ArrayList<Chicken> _chickens = new ArrayList<Chicken>();
private HashMap<Player, Integer> _score = new HashMap<Player, Integer>(); private HashMap<Player, Integer> _score = new HashMap<Player, Integer>();
private HashMap<Player, Integer> _arrowsShot = new HashMap<Player, Integer>(); private HashMap<Player, Integer> _arrowsShot = new HashMap<Player, Integer>();
public ChallengeShootChickens(BawkBawkBattles host) public ChallengeChickenShooting(BawkBawkBattles host)
{ {
super( super(
host, host,

View File

@ -224,7 +224,7 @@ public class ChallengeKangarooJump extends Challenge
return players; return players;
} }
public HashMap<Player, Integer> getPlayerHeight() public HashMap<Player, Integer> getPlayerHeights()
{ {
return _playerJumpHeight; return _playerJumpHeight;
} }

View File

@ -323,7 +323,7 @@ public class ChallengeMilkACow extends Challenge
holo.setFollowEntity(cow); holo.setFollowEntity(cow);
holo.start(); holo.start();
} }
private Location getRandomLocation() private Location getRandomLocation()
{ {
return getCenter().add(UtilMath.r(((getArenaSize() * 2) - 1) - (getArenaSize() - 1)), 1, UtilMath.r((getArenaSize() * 2) - 1) - (getArenaSize() - 1)); return getCenter().add(UtilMath.r(((getArenaSize() * 2) - 1) - (getArenaSize() - 1)), 1, UtilMath.r((getArenaSize() * 2) - 1) - (getArenaSize() - 1));

View File

@ -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<Game>
{
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);
}
}

View File

@ -11,9 +11,9 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
public class MinewareKangarooAtHeart extends StatTracker<Game> public class StatTrackerKangarooAtHeart extends StatTracker<Game>
{ {
public MinewareKangarooAtHeart(Game game) public StatTrackerKangarooAtHeart(Game game)
{ {
super(game); super(game);
} }
@ -29,10 +29,17 @@ public class MinewareKangarooAtHeart extends StatTracker<Game>
if (!(challenge instanceof ChallengeKangarooJump)) if (!(challenge instanceof ChallengeKangarooJump))
return; return;
ChallengeKangarooJump kJump = (ChallengeKangarooJump) challenge; ChallengeKangarooJump kangarooJump = (ChallengeKangarooJump) challenge;
for (Player player : kJump.getPlayerHeight().keySet()) for (Player player : kangarooJump.getPlayerHeights().keySet())
if (!kJump.getData().isLost(player)) {
if (!player.isOnline())
continue;
if (!kangarooJump.getData().isLost(player))
{
addStat(player, "Kangaroo", 1, false, false); addStat(player, "Kangaroo", 1, false, false);
}
}
} }
} }

View File

@ -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<Game>
{
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);
}
}
}
}

View File

@ -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.game.games.mineware.events.ChallengeEndEvent;
import nautilus.game.arcade.stats.StatTracker; import nautilus.game.arcade.stats.StatTracker;
public class MinewareMilkManTracker extends StatTracker<Game> public class StatTrackerMilkManTracker extends StatTracker<Game>
{ {
public MinewareMilkManTracker(Game game) public StatTrackerMilkManTracker(Game game)
{ {
super(game); super(game);
} }
@ -29,15 +29,15 @@ public class MinewareMilkManTracker extends StatTracker<Game>
if (!(challenge instanceof ChallengeMilkACow)) if (!(challenge instanceof ChallengeMilkACow))
return; 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()) if (!player.isOnline())
continue; continue;
int score = milkeACow.getScore().get(player);
addStat(player, "MilkMan", score, false, false); addStat(player, "MilkMan", score, false, false);
} }
} }

View File

@ -3,7 +3,7 @@ package nautilus.game.arcade.game.games.mineware.stats;
import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.mineware.challenge.Challenge; 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.game.games.mineware.events.ChallengeEndEvent;
import nautilus.game.arcade.stats.StatTracker; import nautilus.game.arcade.stats.StatTracker;
@ -11,9 +11,9 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
public class MinewarePinataMasterTracker extends StatTracker<Game> public class StatTrackerPinataMasterTracker extends StatTracker<Game>
{ {
public MinewarePinataMasterTracker(Game game) public StatTrackerPinataMasterTracker(Game game)
{ {
super(game); super(game);
} }
@ -26,13 +26,22 @@ public class MinewarePinataMasterTracker extends StatTracker<Game>
Challenge challenge = event.getEndedChallenge(); Challenge challenge = event.getEndedChallenge();
if (!(challenge instanceof ChallengeShootChickens)) if (!(challenge instanceof ChallengeChickenShooting))
return; return;
ChallengeShootChickens chickChallenge = (ChallengeShootChickens) challenge; ChallengeChickenShooting chickenShooting = (ChallengeChickenShooting) challenge;
for (Player player : chickChallenge.getArrowsShot().keySet()) for (Player player : chickenShooting.getArrowsShot().keySet())
if (chickChallenge.getArrowsShot().get(player) == 6 && challenge.getData().isCompleted(player)) {
if (!player.isOnline())
continue;
int shots = chickenShooting.getArrowsShot().get(player);
if (shots == 6 && challenge.getData().isCompleted(player))
{
addStat(player, "PinataMaster", 1, true, false); addStat(player, "PinataMaster", 1, true, false);
}
}
} }
} }

View File

@ -11,9 +11,9 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
public class MinewareSurfUpTracker extends StatTracker<Game> public class StatTrackerSurfUpTracker extends StatTracker<Game>
{ {
public MinewareSurfUpTracker(Game game) public StatTrackerSurfUpTracker(Game game)
{ {
super(game); super(game);
} }
@ -29,16 +29,19 @@ public class MinewareSurfUpTracker extends StatTracker<Game>
if (!(challenge instanceof ChallengeWaveCrush)) if (!(challenge instanceof ChallengeWaveCrush))
return; 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; continue;
addStat(player, "SurfUp", survivedWavesAmount, false, false); addStat(player, "SurfUp", amount, false, false);
} }
} }
} }

View File

@ -11,15 +11,15 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
public class MinewareTagMasterTracker extends StatTracker<Game> public class StatTrackerTagMasterTracker extends StatTracker<Game>
{ {
public MinewareTagMasterTracker(Game game) public StatTrackerTagMasterTracker(Game game)
{ {
super(game); super(game);
} }
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onGameEnd(ChallengeEndEvent event) public void onChallengeEnd(ChallengeEndEvent event)
{ {
if (getGame().GetState() != GameState.Live) if (getGame().GetState() != GameState.Live)
return; return;
@ -29,12 +29,15 @@ public class MinewareTagMasterTracker extends StatTracker<Game>
if (!(challenge instanceof ChallengeReverseTag)) if (!(challenge instanceof ChallengeReverseTag))
return; 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)) if (!player.isOnline())
return; continue;
if (reverseTag.getData().isLost(player))
continue;
addStat(player, "TagMaster", 1, true, false); addStat(player, "TagMaster", 1, true, false);
} }

View File

@ -1,26 +1,30 @@
package nautilus.game.arcade.game.games.mineware.stats; 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.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.stats.StatTracker; import nautilus.game.arcade.stats.StatTracker;
import org.bukkit.entity.Player; public class StatTrackerVeteranTracker extends StatTracker<Game>
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
public class MinewareVeteranTracker extends StatTracker<Game>
{ {
public MinewareVeteranTracker(Game game) public StatTrackerVeteranTracker(Game game)
{ {
super(game); super(game);
} }
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void tracePlayerWin(GameStateChangeEvent event) public void onGameStateChange(GameStateChangeEvent event)
{ {
if (event.GetState() == GameState.End) if (event.GetState() == GameState.End)
{
for (Player player : getGame().getWinners()) for (Player player : getGame().getWinners())
{
addStat(player, "Veteran", 1, true, false); addStat(player, "Veteran", 1, true, false);
}
}
} }
} }