fixed skywars icon

changed LOSSES to GAMESPLAYED for consistency
This commit is contained in:
Cheese 2015-07-09 12:47:40 +10:00
parent 480a29b874
commit 7d073fdc0d
2 changed files with 42 additions and 6 deletions

View File

@ -28,7 +28,7 @@ public enum AchievementCategory
SKYWARS("Skywars",null, SKYWARS("Skywars",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.DOUBLE_PLANT, 5, GameCategory.SURVIVAL, "Destructor Kit"), Material.FEATHER, 5, GameCategory.SURVIVAL, "Destructor Kit"),
UHC("Ultra Hardcore", null, UHC("Ultra Hardcore", 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 },
@ -39,7 +39,7 @@ public enum AchievementCategory
Material.BLAZE_ROD, 0, GameCategory.SURVIVAL, "Extra Class Skills"), Material.BLAZE_ROD, 0, GameCategory.SURVIVAL, "Extra Class Skills"),
CASTLE_SIEGE("Castle Siege", null, CASTLE_SIEGE("Castle Siege", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.LOSSES, new StatDisplay("Kills as Defenders"), new StatDisplay("Deaths as Defenders"), new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, new StatDisplay("Kills as Defenders"), new StatDisplay("Deaths as Defenders"),
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),
@ -52,7 +52,7 @@ public enum AchievementCategory
Material.SKULL_ITEM, 4, GameCategory.CLASSICS, "Sheep Kit"), Material.SKULL_ITEM, 4, GameCategory.CLASSICS, "Sheep Kit"),
MINE_STRIKE("MineStrike", null, MINE_STRIKE("MineStrike", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.LOSSES, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
Material.TNT, 0, GameCategory.CLASSICS, null), Material.TNT, 0, GameCategory.CLASSICS, null),
DRAW_MY_THING("Draw My Thing", null, DRAW_MY_THING("Draw My Thing", null,
@ -60,7 +60,7 @@ public enum AchievementCategory
Material.BOOK_AND_QUILL, 0, GameCategory.CLASSICS, null), Material.BOOK_AND_QUILL, 0, GameCategory.CLASSICS, null),
CHAMPIONS("Champions", new String[] {"Champions Domination", "Champions TDM"}, CHAMPIONS("Champions", new String[] {"Champions Domination", "Champions TDM"},
new StatDisplay[] { StatDisplay.WINS, StatDisplay.LOSSES, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
Material.BEACON, 0, GameCategory.CHAMPIONS, "Extra Class Skills"), Material.BEACON, 0, GameCategory.CHAMPIONS, "Extra Class Skills"),
MASTER_BUILDERS("Master Builders", null, MASTER_BUILDERS("Master Builders", null,
@ -89,11 +89,11 @@ public enum AchievementCategory
Material.BOW, 0, GameCategory.ARCADE, null), Material.BOW, 0, GameCategory.ARCADE, null),
SUPER_PAINTBALL("Super Paintball", null, SUPER_PAINTBALL("Super Paintball", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.LOSSES, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
Material.ENDER_PEARL, 0, GameCategory.ARCADE, null), Material.ENDER_PEARL, 0, GameCategory.ARCADE, null),
TURF_WARS("Turf Wars", null, TURF_WARS("Turf Wars", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.LOSSES, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
Material.HARD_CLAY, 14, GameCategory.ARCADE, null), Material.HARD_CLAY, 14, GameCategory.ARCADE, null),
RUNNER("Runner", null, RUNNER("Runner", null,

View File

@ -3,9 +3,13 @@ package nautilus.game.arcade.managers;
import java.util.HashMap; import java.util.HashMap;
import java.util.UUID; import java.util.UUID;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.leaderboard.LeaderboardManager; import mineplex.core.leaderboard.LeaderboardManager;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
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;
@ -15,6 +19,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
@ -109,4 +114,35 @@ public class GameStatManager implements Listener
Manager.GetStatsManager().incrementStat(event.getPlayer(), "Global.TimeInGame", timeInGame); Manager.GetStatsManager().incrementStat(event.getPlayer(), "Global.TimeInGame", timeInGame);
} }
} }
@EventHandler
public void statBoostCommand(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().startsWith("/statboost ") && Manager.GetClients().Get(event.getPlayer()).GetRank().Has(Rank.OWNER))
{
event.setCancelled(true);
String[] tokens = event.getMessage().split(" ");
if (tokens.length < 2)
return;
Player player = UtilPlayer.searchOnline(event.getPlayer(), tokens[1], true);
if (player == null)
return;
for (GameType type : GameType.values())
{
int wins = UtilMath.r(50);
int loss = UtilMath.r(50);
int play = wins+loss;
Manager.GetStatsManager().incrementStat(player, type.GetName() + ".Wins", wins);
Manager.GetStatsManager().incrementStat(player, type.GetName() + ".Losses", loss);
Manager.GetStatsManager().incrementStat(player, type.GetName() + ".GamesPlayed", play);
}
event.getPlayer().sendMessage("Gave Stats: " + player.getName());
}
}
} }