Merge pull request #134 in MIN/mineplex from rankdescriptions to develop

* commit '0177cf91bbd179ce9a1f320d59790094612f24fe': (43 commits)
  Clean up
  Final edits
  Waiting for a testing session.
  Descriptions changed
  Use Garbo's description changes
  Stats added for all other games
  Halloween, added kit to stats
  Halloween, added stats
  Gravity, added stats
  Gladiators, added stats
  Evolution, added stats
  Draw my thing, added stats
  Dragons, added stats
  Dragon Riders, added default registery
  Dragon Escape Teams, added stats
  Dragon Escape, added stats + implemented kit display for stats
  Death Tag, added stats
  Christmas Chaos, added stats
  Champ TDM, added stats
  Champ Dominate,added stats
  ...
This commit is contained in:
Shaun Bennett 2016-01-28 21:23:13 -06:00
commit 3fa9f79427
74 changed files with 1326 additions and 356 deletions

View File

@ -4,64 +4,73 @@ import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
public enum Rank
{
//Staff
LT("Leader", ChatColor.GOLD, "Leaders are in charge of special teams\nsuch as the whole staff team or the support!"),
OWNER("Owner", ChatColor.GOLD, "Owners are the Founders of Mineplex\nand they all manage different parts of it!"),
DEVELOPER("Dev", ChatColor.GOLD, "Developers make new games,\nand new features for you to enjoy"),
ADMIN("Admin", ChatColor.GOLD, "Administrators have their own\nSenior Moderator team that they lead!"),
JNR_DEV("Jr.Dev", ChatColor.GOLD, "Junior Developers make new games,\nand new features for you to enjoy"),
SUPPORT("Support", ChatColor.BLUE, "Support Agents take care of all the tickets\nthat get sent to mineplex.com/support"),
CMOD("C.Mod", ChatColor.GOLD, "Clan Moderators are Senior Moderators in\nthe Clans Management team.\nThey mainly moderate only the Clans servers.\nThey are around to help you with any problems on Clans servers."),
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD, "Senior Moderators are in a special\nSenior Moderator team where they have to fulfill team tasks.\nThey are similar to Moderators who you can always ask for help!\nIf you have any questions, just message them using /a"),
MODERATOR("Mod", ChatColor.GOLD, "Moderators are here to moderate\nand help players with any concerns they have.\nIf you have any questions, just message them using /a"),
HELPER("Trainee", ChatColor.DARK_AQUA, "Trainees are staff in training,\nand are here to help players and moderate!\nIf you have any questions, just message them using /a"),
MAPLEAD("MapLead", ChatColor.BLUE, "Leader of the Official Build team"),
MAPDEV("Builder", ChatColor.BLUE, "Official Mineplex Map Builders"),
MEDIA("Media", ChatColor.BLUE, "Official Mineplex Artist and/or Designer"),
LT("Leader", ChatColor.GOLD, "Leaders manage the operation of their respective team \nor projects. They usually operate on affairs within \nthe staff, development, or management team."),
OWNER("Owner", ChatColor.GOLD, "Owners are the founders of Mineplex. \nEach owner manages a different aspect of the \nserver and ensures its efficient operation."),
DEVELOPER("Dev", ChatColor.GOLD, "Developers work behind the scenes to \ncreate new games and features, and fix bugs to \ngive the best experience."),
ADMIN("Admin", ChatColor.GOLD, "An Administrators role is to manage \ntheir respective Senior Moderator team \nand all moderators within it."),
JNR_DEV("Jr.Dev", ChatColor.GOLD, "Junior Developers work behind the scenes to \ncreate new games and features, and fix bugs to \ngive the best experience."),
SUPPORT("Support", ChatColor.BLUE, "Support agents handle tickets and \nprovide customer service."),
CMOD("C.Mod", ChatColor.GOLD, "Clans Moderators are members of the Clans Management Senior Mod team. \nTheir duties include moderation and support within the Clans servers. \n\nFor assistance, contact them using " + F.elem("/a <message>") + "."),
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD, "Senior Moderators are members of a special \nSenior Moderator team where they have to fulfill specific tasks. \nJust like Moderators, you can always ask them for help. \n\nFor assistance, contact them using " + F.elem("/a <message>") + "."),
MODERATOR("Mod", ChatColor.GOLD, "Moderators enforce rules and provide help to \nanyone with questions or concerns. \n\nFor assistance, contact them using " + F.elem("/a <message>") + "."),
HELPER("Trainee", ChatColor.DARK_AQUA, "Trainees are moderators-in-training. \nTheir duties include enforcing the rules and \nproviding help to anyone with questions or concerns. \n\nFor assistance, contact them using " + F.elem("/a <message>") + "."),
MAPLEAD("MapLead", ChatColor.BLUE, "Map Leaders are leaders of the Mineplex Build Team. \nThey oversee the creation of new maps and manage Builders."),
MAPDEV("Builder", ChatColor.BLUE, "Builders are members of the Mineplex Build Team. \nThey create many of the maps used across Mineplex."),
MEDIA("Media", ChatColor.BLUE, "The Media rank is given to talented artists who are\n endorsed to create content for Mineplex."),
EVENT("Event", ChatColor.WHITE, "???"),
EVENT("Event", ChatColor.WHITE, "A member of the official Mineplex Events team!"),
//Media
YOUTUBE("YouTube", ChatColor.RED, "Official Mineplex Youtuber"),
YOUTUBE_SMALL("YT", ChatColor.DARK_PURPLE, "Youtube Content Creators"),
TWITCH("Twitch", ChatColor.DARK_PURPLE, "Official Twitch Live Streamer"),
YOUTUBE("YouTube", ChatColor.RED, "A YouTuber who creates content for \nor related to Mineplex."),
YOUTUBE_SMALL("YT", ChatColor.DARK_PURPLE, "A YouTuber who creates content for \nor related to Mineplex. \n\nThey have fewer subscribers than full YouTubers."),
TWITCH("Twitch", ChatColor.DARK_PURPLE, "A Twitch streamer who often features \nMineplex in their streams."),
//Player
TITAN("Titan", ChatColor.RED, true, "Mineplex's fourth premium rank\nBuy Titan at mineplex.com/shop"),
LEGEND("Legend", ChatColor.GREEN, true, "Mineplex's third premium rank\nBuy Legend at mineplex.com/shop"),
HERO("Hero", ChatColor.LIGHT_PURPLE, true, "Mineplex's second premium rank\nBuy Hero at mineplex.com/shop"),
ULTRA("Ultra", ChatColor.AQUA, true, "Mineplex's first premium rank\nBuy Ultra at mineplex.com/shop"),
TITAN("Titan", ChatColor.RED, true, "Ancient myths spoke of a gigantic being \nwith immense power... \n\nPurchase Titan at www.mineplex.com/shop"),
LEGEND("Legend", ChatColor.GREEN, true, "Mineplex's third premium rank. \n\nPurchase Legend at www.mineplex.com/shop"),
HERO("Hero", ChatColor.LIGHT_PURPLE, true, "There are many stories of a \nvaliant Hero who was brave enough to \ntame the most fearsome dragon in the land. \n\nPurchase Hero at www.mineplex.com/shop"),
ULTRA("Ultra", ChatColor.AQUA, true, "Mineplex's first premium rank. \n\nPurchase Ultra at www.mineplex.com/shop"),
ALL("", ChatColor.WHITE, null);
private ChatColor _color;
private boolean _donor;
private String _info;
private String _description;
public String Name;
Rank(String name, ChatColor color, String info)
Rank(String name, ChatColor color, String description)
{
_color = color;
Name = name;
_donor = false;
_info = info;
_description = description;
}
Rank(String name, ChatColor color, boolean donor, String info)
Rank(String name, ChatColor color, boolean donor, String description)
{
_color = color;
Name = name;
_donor = donor;
_info = info;
_description = description;
}
public String getInfo()
public String getDescription()
{
return _info;
return _description;
}
public String getRawTag()
{
if (Name.equalsIgnoreCase("ALL"))
return "";
return Name;
}
public boolean has(Rank rank)
@ -125,12 +134,4 @@ public enum Rank
{
return _donor;
}
public String getRawTag()
{
if (Name.equalsIgnoreCase("ALL"))
return "";
return Name;
}
}

View File

@ -18,6 +18,7 @@ import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.bonuses.BonusManager;
import mineplex.core.botspam.BotSpamManager;
import mineplex.core.common.Rank;
import mineplex.core.common.jsonchat.JsonMessage;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilInv;
@ -89,8 +90,18 @@ import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent;
import mineplex.minecraft.game.core.combat.DeathMessageType;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.minecraft.game.core.condition.ConditionManager;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.HoverEvent.Action;
import net.md_5.bungee.api.chat.TextComponent;
import org.jooq.tools.json.JSONObject;
import net.minecraft.server.v1_8_R3.ChatMessage;
import net.minecraft.server.v1_8_R3.EntityInsentient;
import net.minecraft.server.v1_8_R3.EntityPlayer;
import net.minecraft.server.v1_8_R3.IChatBaseComponent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -627,6 +638,21 @@ public class HubManager extends MiniClientPlugin<HubClient>
}
else
{
// TextComponent rankComponent = new TextComponent(rankStr);
// TextComponent playerNameText = new TextComponent(ChatColor.YELLOW + playerName);
// TextComponent component = new TextComponent();
//
// rankComponent.setHoverEvent(new HoverEvent(Action.SHOW_TEXT, new ComponentBuilder(rank.getColor() + rank.getTag(true, true) + ChatColor.WHITE + ":\n" + rank.getDescription()).create()));
//
// component.setText(levelStr);
// component.addExtra(rankComponent);
// component.addExtra(playerNameText);
// component.addExtra(" " + ChatColor.WHITE + event.getMessage());
JsonMessage jsonMessage = new JsonMessage(levelStr)
.extra(JSONObject.escape(rankStr)).hover("show_text", rank.getColor() + rank.getTag(true, true) + ChatColor.WHITE + "\n" + rank.getDescription())
.add(JSONObject.escape(C.cYellow + playerName + " " + ChatColor.WHITE + event.getMessage()));
for (Player other : UtilServer.getPlayers())
{
if (_tutorialManager.InTutorial(other))
@ -635,9 +661,13 @@ public class HubManager extends MiniClientPlugin<HubClient>
continue;
}
event.setMessage(event.getMessage());
event.setFormat(levelStr + rankStr + C.cYellow + playerName + " " + C.cWhite + "%2$s");
// event.setMessage(event.getMessage());
// event.setFormat(levelStr + rankStr + C.cYellow + playerName + " " + C.cWhite + "%2$s");
if(!event.isCancelled())
jsonMessage.sendToPlayer(other);
}
event.setCancelled(true);
}
}

View File

@ -85,7 +85,7 @@ import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.event.EventModule;
import nautilus.game.arcade.game.games.uhc.UHC;
import nautilus.game.arcade.managers.GameAchievementManager;
import nautilus.game.arcade.managers.GameChatManager;
import nautilus.game.arcade.managers.chat.GameChatManager;
import nautilus.game.arcade.managers.GameCreationManager;
import nautilus.game.arcade.managers.GameFlagManager;
import nautilus.game.arcade.managers.GameGemManager;
@ -174,6 +174,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private GameTournamentManager _gameTournamentManager;
private GameWorldManager _gameWorldManager;
private GameHostManager _gameHostManager;
private GameChatManager _gameChatManager;
private ServerStatusManager _serverStatusManager;
private InventoryManager _inventoryManager;
private CosmeticManager _cosmeticManager;
@ -278,7 +279,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_arcadeShop = new ArcadeShop(this, clientManager, donationManager);
// Managers
new GameChatManager(this);
_gameChatManager = new GameChatManager(this);
_gameCreationManager = new GameCreationManager(this);
_gameGemManager = new GameGemManager(this);
_gameManager = new GameManager(this);
@ -353,6 +354,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
addCommand(new RequiredRankCommand(this));
}
public GameChatManager getGameChatManager()
{
return _gameChatManager;
}
public GameServerConfig GetServerConfig()
{
return _serverConfig;

View File

@ -74,6 +74,7 @@ import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.managers.GameLobbyManager;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.scoreboard.GameScoreboard;
import nautilus.game.arcade.stats.AssistsStatTracker;
import nautilus.game.arcade.stats.DamageDealtStatTracker;
@ -271,6 +272,21 @@ public abstract class Game implements Listener
public long PrepareTime = 9000;
public boolean PlaySoundGameStart = true;
// Chat Stats
public final ChatStatData Kills = new ChatStatData("Kills", "Kills", true);
public final ChatStatData Assists = new ChatStatData("Assists", "Assists", true);
public final ChatStatData DamageDealt = new ChatStatData("Damage Dealt", "Damage Dealt", true);
public final ChatStatData DamageTaken = new ChatStatData("Damage Taken", "Damage Taken", true);
public final ChatStatData DamageTakenPVP = new ChatStatData("Damage Taken PvP", "Damage Taken", true);
public final ChatStatData Deaths = new ChatStatData("Deaths", "Deaths", true);
public final ChatStatData ExpEarned = new ChatStatData("ExpEarned", "Exp Earned", true);
public final ChatStatData GamesPlayed = new ChatStatData("GamesPlayed", "Games Played", true);
public final ChatStatData GemsEarned = new ChatStatData("GemsEarned", "Gems Earned", true);
public final ChatStatData Losses = new ChatStatData("Losses", "Losses", true);
public final ChatStatData Wins = new ChatStatData("Wins", "Wins", true);
public final ChatStatData KDRatio = new ChatStatData("KDRatio", "KD-Ratio", true);
public final ChatStatData BlankLine = new ChatStatData().blankLine();
// Gems
public double GemMultiplier = 1;
public boolean GemHunterEnabled = true;
@ -1422,6 +1438,11 @@ public abstract class Game implements Listener
}
}
public void registerChatStats(ChatStatData... stats)
{
Manager.getGameChatManager().setGameChatStats(stats);
}
public Collection<StatTracker<? extends Game>> getStatTrackers()
{
return _statTrackers;

View File

@ -38,6 +38,16 @@ public class BaconBrawl extends SoloGame
DamageTeamSelf = true;
HungerSet = 20;
PrepareFreeze = false;
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageDealt,
DamageTaken
);
}
@EventHandler

View File

@ -15,6 +15,8 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.barbarians.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.BlockBreakStatTracker;
public class Barbarians extends SoloGame
{
@ -58,6 +60,22 @@ public class Barbarians extends SoloGame
this.BlockBreakAllow.add(134);
this.BlockBreakAllow.add(135);
this.BlockBreakAllow.add(136);
registerStatTrackers(
new BlockBreakStatTracker(this, true)
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageDealt,
DamageTaken,
BlankLine,
new ChatStatData("BlockBreak", "Blocks Broken", true)
);
}
@EventHandler

View File

@ -58,6 +58,9 @@ public class BossBattles extends TeamGame
HungerSet = 20;
CreatureAllowOverride = true;
PrepareFreeze = false;
// registerChatStats(Kills);
// Game giving constant errors when loading.
}
@EventHandler

View File

@ -15,6 +15,7 @@ import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.bouncyballs.kits.*;
import nautilus.game.arcade.game.games.bouncyballs.Ball;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
public class BouncyBalls extends SoloGame
{
@ -35,6 +36,8 @@ public class BouncyBalls extends SoloGame
});
this.HungerSet = 20;
// registerChatStats();
}
@EventHandler

View File

@ -233,6 +233,16 @@ public class Bridge extends TeamGame implements OreObsfucation
new KillFastStatTracker(this, 4, 10, "Rampage"),
new DeathBomberStatTracker(this, 5)
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageTaken,
DamageDealt
);
}
@EventHandler

View File

@ -5,6 +5,43 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map.Entry;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
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 mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.explosion.ExplosionEvent;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
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.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.build.gui.MobShop;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
import nautilus.game.arcade.game.games.build.kits.KitBuilder;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.BlockBreakStatTracker;
import nautilus.game.arcade.stats.BlockPlaceStatTracker;
import java.util.UUID;
import org.bukkit.ChatColor;
@ -69,40 +106,6 @@ import org.bukkit.event.vehicle.VehicleCreateEvent;
import org.bukkit.event.vehicle.VehicleDamageEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
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 mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.explosion.ExplosionEvent;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
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.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.build.gui.MobShop;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
import nautilus.game.arcade.game.games.build.kits.KitBuilder;
import nautilus.game.arcade.kit.Kit;
public class Build extends SoloGame
{
private NautHashMap<Player, BuildData> _data = new NautHashMap<Player, BuildData>();
@ -221,6 +224,16 @@ public class Build extends SoloGame
_mobShop = new MobShop(getArcadeManager(), getArcadeManager().GetClients(), getArcadeManager().GetDonation());
_optionsShop = new OptionsShop(this, getArcadeManager(), getArcadeManager().GetClients(), getArcadeManager().GetDonation());
_shopItem = ItemStackFactory.Instance.CreateStack(Material.DIAMOND, (byte) 0, 1, C.cGreen + "Options");
registerStatTrackers(
new BlockBreakStatTracker(this, false),
new BlockPlaceStatTracker(this, new Material[]{})
);
registerChatStats(
new ChatStatData("BlocksPlaced", "Blocks Placed", true),
new ChatStatData("BlocksBroken", "Blocks Broken", true)
);
}
@EventHandler

View File

@ -70,6 +70,8 @@ public class Cards extends SoloGame
this.PrepareFreeze = false;
_cardFactory = new CardFactory();
registerChatStats();
}
@Override

View File

@ -71,6 +71,7 @@ import nautilus.game.arcade.game.games.castlesiege.kits.KitUndeadGhoul;
import nautilus.game.arcade.game.games.castlesiege.kits.KitUndeadZombie;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.NullKit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.BloodThirstyStatTracker;
import nautilus.game.arcade.stats.KingDamageStatTracker;
import nautilus.game.arcade.stats.KingSlayerStatTracker;
@ -219,6 +220,18 @@ public class CastleSiege extends TeamGame
new TeamDeathsStatTracker(this),
new TeamKillsStatTracker(this)
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageDealt,
DamageTaken
);
registerChatStats();
}
@Override

View File

@ -18,6 +18,7 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage;
import nautilus.game.arcade.game.games.champions.kits.KitRanger;
import nautilus.game.arcade.game.games.common.CaptureTheFlag;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.CapturesStatTracker;
import nautilus.game.arcade.stats.ClutchStatTracker;
import nautilus.game.arcade.stats.ElectrocutionStatTracker;
@ -87,6 +88,18 @@ public class ChampionsCTF extends CaptureTheFlag
new SpecialWinStatTracker(this, "SpecialWin")
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageDealt,
DamageTaken,
BlankLine,
new ChatStatData("Captures", "Flag Captures", true)
);
new ChampionsFixes(this);
}

View File

@ -16,6 +16,7 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage;
import nautilus.game.arcade.game.games.champions.kits.KitRanger;
import nautilus.game.arcade.game.games.common.Domination;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.ElectrocutionStatTracker;
import nautilus.game.arcade.stats.KillReasonStatTracker;
import nautilus.game.arcade.stats.SeismicSlamStatTracker;
@ -79,6 +80,16 @@ public class ChampionsDominate extends Domination
new SeismicSlamStatTracker(this)
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageDealt,
DamageTaken
);
new ChampionsFixes(this);
}

View File

@ -16,6 +16,7 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage;
import nautilus.game.arcade.game.games.champions.kits.KitRanger;
import nautilus.game.arcade.game.games.common.TeamDeathmatch;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.ElectrocutionStatTracker;
import nautilus.game.arcade.stats.KillAllOpposingStatTracker;
import nautilus.game.arcade.stats.KillReasonStatTracker;
@ -79,6 +80,16 @@ public class ChampionsTDM extends TeamDeathmatch
new SeismicSlamStatTracker(this)
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageDealt,
DamageTaken
);
new ChampionsFixes(this);
}

View File

@ -152,6 +152,11 @@ public class Christmas extends SoloGame
HungerSet = 20;
WorldTimeSet = 2000;
PrepareFreeze = false;
registerChatStats(
DamageDealt,
DamageTaken
);
}
//parse 129 19 47 48 103 86 137 56 22 45 121 14 15 16 87 88 89 153 173 172 162

View File

@ -73,6 +73,12 @@ public class DeathTag extends SoloGame
this.PrepareFreeze = false;
registerStatTrackers(new ComeAtMeBroStatTracker(this));
registerChatStats(
Kills,
Deaths,
KDRatio
);
}
@Override

View File

@ -52,6 +52,8 @@ import nautilus.game.arcade.events.PlayerKitGiveEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.dragonescape.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.DistanceTraveledStatTracker;
import nautilus.game.arcade.stats.ParalympicsStatTracker;
import nautilus.game.arcade.stats.WinMapStatTracker;
@ -118,7 +120,14 @@ public class DragonEscape extends SoloGame
registerStatTrackers(
new ParalympicsStatTracker(this),
new WinMapStatTracker(this)
new WinMapStatTracker(this),
new DistanceTraveledStatTracker(this, "MarathonRunner")
);
registerChatStats(
new ChatStatData("MarathonRunner", "Distance ran", true),
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}

View File

@ -45,6 +45,7 @@ import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.dragonescape.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
public class DragonEscapeTeams extends TeamGame
{
@ -84,6 +85,13 @@ public class DragonEscapeTeams extends TeamGame
this.HungerSet = 20;
this.TeamArmorHotbar = true;
registerChatStats(
Deaths,
DamageTaken,
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@Override

View File

@ -24,5 +24,8 @@ public class DragonRiders extends SoloGame
this.Damage = false;
this.HungerSet = 20;
//Chat stats
registerChatStats();
}
}

View File

@ -18,11 +18,7 @@ import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
@ -31,11 +27,11 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.PlayerStateChangeEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.game.games.dragons.DragonData;
import nautilus.game.arcade.game.games.dragons.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkSparkler;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.SparklezStatTracker;
public class Dragons extends SoloGame
@ -70,6 +66,13 @@ public class Dragons extends SoloGame
registerStatTrackers(
new SparklezStatTracker(this)
);
registerChatStats(
DamageDealt,
DamageTaken,
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@Override

View File

@ -35,6 +35,7 @@ import nautilus.game.arcade.game.games.dragons.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkSparkler;
import nautilus.game.arcade.managers.chat.ChatStatData;
public class DragonsTeams extends TeamGame
{
@ -72,6 +73,13 @@ public class DragonsTeams extends TeamGame
this.TeamArmor = true;
this.TeamArmorHotbar = true;
registerChatStats(
Deaths,
DamageTaken,
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@Override

View File

@ -51,6 +51,8 @@ import nautilus.game.arcade.game.games.GameScore;
import nautilus.game.arcade.game.games.draw.kits.*;
import nautilus.game.arcade.game.games.draw.tools.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.DrawGuessStatTracker;
import nautilus.game.arcade.stats.KeenEyeStatTracker;
import nautilus.game.arcade.stats.MrSquiggleStatTracker;
import nautilus.game.arcade.stats.PureLuckStatTracker;
@ -133,7 +135,13 @@ public class Draw extends SoloGame
registerStatTrackers(
new MrSquiggleStatTracker(this),
new KeenEyeStatTracker(this),
new PureLuckStatTracker(this)
new PureLuckStatTracker(this),
new DrawGuessStatTracker(this)
);
registerChatStats(
new ChatStatData("TotalGuess", "Total Guess'", true),
new ChatStatData("PureLuck", "Lucky Guess'", true)
);
Manager.GetChat().setThreeSecondDelay(false);

View File

@ -162,6 +162,16 @@ public class Evolution extends SoloGame
new NoMeleeTracker(this),
new KillsWhileEvolvingTracker(this)
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageDealt,
DamageTaken
);
}
public EvolveManager getEvolve()

View File

@ -67,6 +67,7 @@ import nautilus.game.arcade.game.games.gladiators.trackers.UntouchableTracker;
import nautilus.game.arcade.game.games.gladiators.tutorial.TutorialGladiators;
import nautilus.game.arcade.gametutorial.events.GameTutorialStartEvent;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
/**
* Created by William (WilliamTiger).
@ -123,6 +124,16 @@ public class Gladiators extends SoloGame
new SwiftKillTracker(this)
);
registerChatStats(
Kills,
Assists,
BlankLine,
new ChatStatData("Untouchable", "Untouchable", true),
BlankLine,
DamageDealt,
DamageTaken
);
_playerArenas = new HashMap<>();
_roundState = RoundState.WAITING;

View File

@ -115,6 +115,11 @@ public class Gravity extends SoloGame
this.CompassEnabled = true;
this.WorldBoundaryKill = false;
registerChatStats(
Kills,
Assists
);
}
@Override

View File

@ -38,6 +38,8 @@ import nautilus.game.arcade.game.games.halloween.waves.WaveBase;
import nautilus.game.arcade.game.games.halloween.waves.WaveBoss;
import nautilus.game.arcade.game.games.halloween.waves.WaveVictory;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedSoundEffect;
import org.bukkit.ChatColor;
@ -135,6 +137,13 @@ public class Halloween extends SoloGame
this.WorldBoundaryKill = false;
this.DontAllowOverfill = true;
registerChatStats(
DamageDealt,
DamageTaken,
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@Override

View File

@ -341,8 +341,16 @@ public class HideSeek extends TeamGame
Manager.GetExplosion().SetTNTSpread(false);
Manager.getCosmeticManager().setHideParticles(true);
registerStatTrackers(new HunterKillerStatTracker(this), new MeowStatTracker(this), new HunterKillerStatTracker(this),
new HunterOfTheYearStatTracker(this), new BadHiderStatTracker(this));
registerStatTrackers(
new HunterKillerStatTracker(this),
new MeowStatTracker(this),
new HunterKillerStatTracker(this),
new HunterOfTheYearStatTracker(this),
new BadHiderStatTracker(this)
);
//Need ideas for this one
registerChatStats();
}
@EventHandler

View File

@ -57,6 +57,8 @@ public class HoleInTheWall extends SoloGame
DamageFall = false;
HungerSet = 20;
WorldTimeSet = 8000;
registerChatStats();
}
private ArrayList<Entry<Integer, Integer>> getWall()

View File

@ -35,6 +35,8 @@ public class Horse extends TeamGame
"",
"Teams swap after game is over"
});
registerChatStats();
}
@Override

View File

@ -42,6 +42,7 @@ import nautilus.game.arcade.game.games.lobbers.trackers.TrackerDirectHit;
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerNoDamage;
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerTNTThrown;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -74,19 +75,23 @@ public class BombLobbers extends TeamGame implements IThrown
@SuppressWarnings("unchecked")
public BombLobbers(ArcadeManager manager)
{
super(manager, GameType.Lobbers, new Kit[]
super(manager, GameType.Lobbers,
new Kit[]
{
new KitJumper(manager),
new KitArmorer(manager),
new KitPitcher(manager),
new KitWaller(manager)
}, new String[]
},
new String[]
{
"Fight against your enemies using",
"the power of explosives!",
"Left click TNT to throw at your enemy.",
"Last team alive wins!"
});
DamageFall = true;
DamageEvP = true;
@ -110,7 +115,21 @@ public class BombLobbers extends TeamGame implements IThrown
WorldTimeSet = 6000;
registerStatTrackers(new Tracker6Kill(this), new TrackerBlastProof(this), new TrackerNoDamage(this), new TrackerTNTThrown(this), new TrackerDirectHit(this));
registerStatTrackers(
new Tracker6Kill(this),
new TrackerBlastProof(this),
new TrackerNoDamage(this),
new TrackerTNTThrown(this),
new TrackerDirectHit(this)
);
registerChatStats(
Kills,
Assists,
DamageTaken,
BlankLine,
new ChatStatData("Thrown", "Bombs Lobbed", true)
);
}
@EventHandler

View File

@ -22,6 +22,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.micro.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.KillsWithinGameStatTracker;
public class Micro extends TeamGame
@ -58,7 +59,17 @@ public class Micro extends TeamGame
this.BlockBreak = true;
this.BlockPlace = true;
registerStatTrackers(new KillsWithinGameStatTracker(this, 8, "Annihilation"));
registerStatTrackers(
new KillsWithinGameStatTracker(this, 8, "Annihilation")
);
registerChatStats(
Kills,
Assists,
BlankLine,
DamageTaken,
DamageDealt
);
}
@Override

View File

@ -97,6 +97,10 @@ public class MilkCow extends SoloGame
_scoreObj = Scoreboard.GetScoreboard().registerNewObjective("Milk", "dummy");
_scoreObj.setDisplaySlot(DisplaySlot.BELOW_NAME);
registerChatStats(
Kills
);
}
@Override

View File

@ -104,6 +104,7 @@ import nautilus.game.arcade.game.games.minestrike.items.guns.GunStats;
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
import nautilus.game.arcade.game.games.minestrike.kits.KitPlayer;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.KaboomStatTracker;
import nautilus.game.arcade.stats.KillAllOpposingMineStrikeRoundStatTracker;
import nautilus.game.arcade.stats.KillFastStatTracker;
@ -308,6 +309,15 @@ public class MineStrike extends TeamGame
new TeamDeathsStatTracker(this),
new TeamKillsStatTracker(this)
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
new ChatStatData("BoomHeadshot", "Headshots", true),
Assists
);
}
@Override

View File

@ -84,6 +84,8 @@ public class MineWare extends SoloGame
Manager.GetCreature().SetDisableCustomDrops(true);
PopulateOrders();
registerChatStats();
}
@Override

View File

@ -31,6 +31,8 @@ public class Moba extends TeamGame
this.DeathSpectateSecs = 8;
this.HungerSet = 20;
registerChatStats();
}
@Override

View File

@ -63,6 +63,8 @@ public class MonsterLeague extends TeamGame
this.TeamArmor = true;
this.TeamArmorHotbar = true;
registerChatStats();
}
//Supports anywhere from 2-4 teams on a map

View File

@ -33,6 +33,7 @@ import nautilus.game.arcade.game.games.monstermaze.trackers.PilotTracker;
import nautilus.game.arcade.game.games.monstermaze.trackers.SnowmanHitTracker;
import nautilus.game.arcade.game.games.monstermaze.trackers.SurvivePast10thSafepadTracker;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
@ -101,6 +102,13 @@ public class MonsterMaze extends SoloGame
new SurvivePast10thSafepadTracker(this)
);
//_maze = new SnowmanMaze(this, WorldData.GetDataLocs("GRAY")/*, WorldData.GetCustomLocs("103")*/);
registerChatStats(//first to beacon
new ChatStatData("Ninja", "Times Hit", true),
new ChatStatData("Speed", "First to safe pad", true),
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
public Maze getMaze()

View File

@ -88,6 +88,8 @@ public class OldMineWare extends SoloGame
InventoryClick = true;
PopulateOrders();
registerChatStats();
}
@Override

View File

@ -114,6 +114,16 @@ public class Paintball extends TeamGame
new WinFastStatTracker(this, 30, "Speedrunner"),
new LastStandStatTracker(this)
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageTaken,
DamageDealt
);
}
@EventHandler

View File

@ -92,6 +92,16 @@ public class Quiver extends SoloGame
new SharpShooterStatTracker(this),
new WinWithoutBowStatTracker(this, "WhatsABow")
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageTaken,
DamageDealt
);
}
@EventHandler(priority = EventPriority.HIGH)

View File

@ -65,6 +65,16 @@ public class QuiverTeams extends TeamGame
this.TeamArmor = true;
this.TeamArmorHotbar = true;
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageTaken,
DamageDealt
);
}
@EventHandler(priority = EventPriority.HIGH)

View File

@ -32,6 +32,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.runner.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.DistanceTraveledStatTracker;
import net.minecraft.server.v1_8_R3.EntityArrow;
@ -66,6 +67,12 @@ public class Runner extends SoloGame implements IThrown
this.PrepareFreeze = false;
registerStatTrackers(new DistanceTraveledStatTracker(this, "MarathonRunner"));
registerChatStats(
new ChatStatData("MarathonRunner", "Distance ran", true),
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@EventHandler

View File

@ -72,6 +72,11 @@ public class SearchAndDestroy extends TeamGame
DamageSelf = false;
Manager.GetDamage().GetCombatManager().setUseWeaponName(AttackReason.DefaultWeaponName);
registerChatStats(
Kills,
Assists
);
}
public ArrayList<TeamBomb> getBombs()

View File

@ -53,6 +53,7 @@ import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.sheep.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.SheepDropStatTracker;
import nautilus.game.arcade.stats.SheepThiefStatTracker;
import nautilus.game.arcade.stats.WinWithSheepStatTracker;
@ -155,6 +156,15 @@ public class SheepGame extends TeamGame
new SheepDropStatTracker(this),
new WinWithSheepStatTracker(this)
);
registerChatStats(
new ChatStatData("AnimalRescue", "Captures", true),
new ChatStatData("Thief", "Stolen", true),
BlankLine,
Kills,
Deaths,
KDRatio
);
}
@Override

View File

@ -46,6 +46,7 @@ import nautilus.game.arcade.game.games.skywars.kits.KitDestructor;
import nautilus.game.arcade.game.games.skywars.kits.KitMiner;
import nautilus.game.arcade.game.games.skywars.kits.KitMadScientist;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.ore.OreHider;
import nautilus.game.arcade.stats.DeathBomberStatTracker;
import nautilus.game.arcade.stats.SkywarsKillZombieStatTracker;
@ -204,6 +205,16 @@ public abstract class Skywars extends Game
new WinWithoutOpeningChestStatTracker(this),
new WinWithoutWearingArmorStatTracker(this));
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageTaken,
DamageDealt
);
}
public void ParseData()

View File

@ -16,6 +16,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.managers.chat.ChatStatData;
public class SoloSuperSmash extends SuperSmash
{
@ -32,6 +33,18 @@ public class SoloSuperSmash extends SuperSmash
});
this.DamageTeamSelf = true;
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageTaken,
DamageDealt,
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@EventHandler

View File

@ -24,6 +24,7 @@ import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.common.Domination;
import nautilus.game.arcade.game.games.smash.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
public class SuperSmashDominate extends Domination
{
@ -55,6 +56,18 @@ public class SuperSmashDominate extends Domination
new KitMagmaCube(manager),
});
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageTaken,
DamageDealt,
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@EventHandler(priority = EventPriority.LOWEST)

View File

@ -15,6 +15,7 @@ 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.managers.chat.ChatStatData;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -53,6 +54,18 @@ public class TeamSuperSmash extends SuperSmash
this.TeamArmorHotbar = true;
this.DontAllowOverfill = true;
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
Assists,
DamageTaken,
DamageDealt,
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@Override

View File

@ -56,6 +56,7 @@ import nautilus.game.arcade.game.games.snake.kits.KitInvulnerable;
import nautilus.game.arcade.game.games.snake.kits.KitReverser;
import nautilus.game.arcade.game.games.snake.kits.KitSpeed;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.ChooChooStatTracker;
import nautilus.game.arcade.stats.KillsWithinGameStatTracker;
import nautilus.game.arcade.stats.SlimySheepStatTracker;
@ -157,6 +158,15 @@ public class Snake extends SoloGame
new ChooChooStatTracker(this),
new SlimySheepStatTracker(this)
);
registerChatStats(//slimes eaten, kills, length
new ChatStatData("Cannibal", "Kills", true),
BlankLine,
new ChatStatData("ChooChoo", "Tail Length", true),
new ChatStatData("SlimySheep", "Slimes Eaten", true),
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@EventHandler

View File

@ -92,6 +92,14 @@ public class SneakyAssassins extends SoloGame
new RevealStatTracker(this, "ISeeYou"),
_killEntityStatTracker
);
registerChatStats(//assists
Kills,
Assists,
BlankLine,
DamageTaken,
DamageDealt
);
}
@Override

View File

@ -105,6 +105,14 @@ public class SnowFight extends TeamGame
this.TeamArmor = true;
this.TeamArmorHotbar = true;
registerChatStats(//damage, collected
Kills,
Assists,
BlankLine,
DamageTaken,
DamageDealt
);
// this.WorldWeatherEnabled = true;
// this.WorldTimeSet = 4000;
}

View File

@ -32,6 +32,7 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.SpleefBlockDestroyStatTracker;
import net.minecraft.server.v1_8_R3.EntityArrow;
@ -62,6 +63,15 @@ public class Spleef extends SoloGame
this.PrepareFreeze = false;
registerStatTrackers(new SpleefBlockDestroyStatTracker(this));
registerChatStats(
DamageTaken,
DamageDealt,
BlankLine,
new ChatStatData("SpleefBlocks", "Blocks Broken", true),
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@EventHandler

View File

@ -30,6 +30,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.spleef.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import net.minecraft.server.v1_8_R3.EntityArrow;
@ -59,6 +60,15 @@ public class SpleefTeams extends TeamGame
this.TeamArmor = true;
this.TeamArmorHotbar = true;
registerChatStats(
Kills,
Assists,
BlankLine,
new ChatStatData("BlocksBroken", "Blocks Broken", true),
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@EventHandler

View File

@ -50,6 +50,8 @@ public class SquidShooter extends SoloGame
this.PrepareFreeze = false;
this.CompassEnabled = true;
this.KitRegisterState = GameState.Prepare;
registerChatStats();
}
@EventHandler
public void Death(CombatDeathEvent event)

View File

@ -54,6 +54,8 @@ public class Stacker extends SoloGame implements IThrown
"Players lose 5 stacked animals if they get hit.",
"First to stack 16 high wins!"
});
registerChatStats();
}
@EventHandler

View File

@ -14,6 +14,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.managers.chat.ChatStatData;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;

View File

@ -87,6 +87,7 @@ import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.survivalgames.kit.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.FirstSupplyDropOpenStatTracker;
import nautilus.game.arcade.stats.KillsWithinTimeLimitStatTracker;
import nautilus.game.arcade.stats.SimultaneousSkeletonStatTracker;
@ -260,6 +261,16 @@ public abstract class SurvivalGames extends Game
new KillsWithinTimeLimitStatTracker(this, 3, 60, "Bloodlust"),
new FirstSupplyDropOpenStatTracker(this),
new SimultaneousSkeletonStatTracker(this, 5));
registerChatStats(
Kills,
Assists,
BlankLine,
DamageTaken,
DamageDealt,
BlankLine,
new ChatStatData("SupplyDropsOpened", "Event chests opened", true)
);
}
@EventHandler

View File

@ -50,6 +50,7 @@ import nautilus.game.arcade.game.games.survivalgames.kit.KitHorseman;
import nautilus.game.arcade.game.games.survivalgames.kit.KitKnight;
import nautilus.game.arcade.game.games.survivalgames.kit.KitLooter;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;

View File

@ -17,6 +17,7 @@ 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.managers.chat.ChatStatData;
import org.bukkit.ChatColor;
import org.bukkit.Location;

View File

@ -75,6 +75,8 @@ public class Tug extends TeamGame
this.DeathOut = false;
this.DeathSpectateSecs = 20;
registerChatStats();
}
@Override

View File

@ -59,7 +59,10 @@ import nautilus.game.arcade.game.games.turfforts.kits.KitInfiltrator;
import nautilus.game.arcade.game.games.turfforts.kits.KitMarksman;
import nautilus.game.arcade.game.games.turfforts.kits.KitShredder;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.BehindEnemyLinesStatTracker;
import nautilus.game.arcade.stats.BlockBreakStatTracker;
import nautilus.game.arcade.stats.BlockPlaceStatTracker;
import nautilus.game.arcade.stats.BlockShreadStatTracker;
import nautilus.game.arcade.stats.TheComebackStatTracker;
import net.minecraft.server.v1_8_R3.EntityArrow;
@ -113,6 +116,8 @@ public class TurfForts extends TeamGame
private boolean _fight = false;
private int _lines = 0;
private BlockBreakStatTracker _breakStatTracker;
private HashMap<Player, Long> _enemyTurf = new HashMap<Player, Long>();
private Set<UUID> playersThatNeedBlocks = new HashSet<UUID>();
@ -146,10 +151,23 @@ public class TurfForts extends TeamGame
this.DamageSelf = false;
this.DeathSpectateSecs = 4;
_breakStatTracker = new BlockBreakStatTracker(this, false);
registerStatTrackers(
new BlockShreadStatTracker(this),
new BehindEnemyLinesStatTracker(this),
new TheComebackStatTracker(this)
new TheComebackStatTracker(this),
new BlockPlaceStatTracker(this, new Material[]{}),
_breakStatTracker
);
registerChatStats(
Kills,
Deaths,
KDRatio,
BlankLine,
new ChatStatData("BlocksPlaced", "Blocks Placed", true),
new ChatStatData("BlocksBroken", "Blocks Broken", true)
);
}
@ -426,10 +444,12 @@ public class TurfForts extends TeamGame
if (block.getData() == 14 /* && team.GetColor() != ChatColor.RED */)
{
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.REDSTONE_BLOCK.getId());
_breakStatTracker.addStat(shooter);
}
else if (block.getData() == 3 /* && team.GetColor() != ChatColor.AQUA */)
{
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.LAPIS_BLOCK.getId());
_breakStatTracker.addStat(shooter);
}
Bukkit.getPluginManager().callEvent(new ShredBlockEvent(block, arrow));

View File

@ -66,6 +66,8 @@ import nautilus.game.arcade.game.games.typewars.tutorial.TutorialTypeWars;
import nautilus.game.arcade.gametutorial.events.GameTutorialEndEvent;
import nautilus.game.arcade.gametutorial.events.GameTutorialStartEvent;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.TimeInGameStatTracker;
import nautilus.game.arcade.world.WorldData;
public class TypeWars extends TeamGame
@ -168,6 +170,10 @@ public class TypeWars extends TeamGame
new TimeInGameTracker(this)
);
registerChatStats(
new ChatStatData("MinionKills", "Kills", true)
);
manager.GetCreature().SetDisableCustomDrops(true);
manager.GetChat().setThreeSecondDelay(false);
}

View File

@ -207,6 +207,14 @@ public class UHC extends TeamGame
_createTime = System.currentTimeMillis();
_serverTime = Utility.currentTimeMillis();
registerChatStats(
Kills,
Assists,
BlankLine,
DamageTaken,
DamageDealt
);
}
@Override

View File

@ -66,6 +66,7 @@ import nautilus.game.arcade.game.games.wither.kit.KitWitherMinion;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.NullKit;
import nautilus.game.arcade.kit.perks.data.IBlockRestorer;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.TeamDeathsStatTracker;
import nautilus.game.arcade.stats.TeamKillsStatTracker;
@ -148,6 +149,14 @@ public class WitherGame extends TeamGame implements IBlockRestorer
new TeamDeathsStatTracker(this),
new TeamKillsStatTracker(this)
);
registerChatStats(
Deaths,
DamageTaken,
DamageDealt,
BlankLine,
new ChatStatData("kit", "Kit", true)
);
}
@Override

View File

@ -54,6 +54,7 @@ import net.minecraft.server.v1_8_R3.EntityFireball;
import net.minecraft.server.v1_8_R3.PacketPlayOutSetSlot;
import net.minecraft.server.v1_8_R3.PacketPlayOutWindowItems;
import nautilus.game.arcade.managers.chat.ChatStatData;
import org.apache.commons.lang.IllegalClassException;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -166,6 +167,16 @@ public class Wizards extends SoloGame
SoupEnabled = false;
DamageTeamSelf = true;
registerChatStats(
Kills,
Assists,
BlankLine,
DamageTaken,
DamageDealt,
BlankLine,
new ChatStatData("kit", "Kit", true)
);
Manager.getCosmeticManager().setHideParticles(true);
// Manager.GetDamage().GetCombatManager().setUseWeaponName(AttackReason.DefaultWeaponName);

View File

@ -71,6 +71,11 @@ public class ZombieSurvival extends SoloGame
this.HungerSet = 20;
this.CompassEnabled = true;
registerChatStats(
Kills,
Assists
);
}
@Override

View File

@ -1,177 +0,0 @@
package nautilus.game.arcade.managers;
import java.util.Iterator;
import mineplex.core.account.CoreClient;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.party.Party;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.GameTeam;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
public class GameChatManager implements Listener
{
ArcadeManager Manager;
public GameChatManager(ArcadeManager manager)
{
Manager = manager;
Manager.getPluginManager().registerEvents(this, Manager.getPlugin());
}
@EventHandler
public void MeCancel(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().startsWith("/me "))
{
event.getPlayer().sendMessage(F.main("Mirror", "You can't see /me messages, are you a vampire?"));
event.setCancelled(true);
}
}
@EventHandler
public void HandleChat(AsyncPlayerChatEvent event)
{
if (event.isCancelled())
return;
Player sender = event.getPlayer();
String senderName = sender.getName();
//Dead Prefix
String dead = "";
if (Manager.GetGame() != null)
if (Manager.GetGame().GetTeam(sender) != null)
if (!Manager.GetGame().IsAlive(sender))
dead = C.cGray + "Dead ";
Rank rank = Manager.GetClients().Get(sender).GetRank();
String disguiseTag = "";
if(Manager.GetClients().Get(sender).isDisguised())
{
CoreClient cc = Manager.GetClients().Get(sender);
rank = cc.getDisguisedRank();
if(!cc.GetRank().has(Rank.JNR_DEV))
{
disguiseTag = ChatColor.BLACK + " ";
}
}
boolean ownsUltra = false;
if (Manager.GetGame() != null)
ownsUltra= Manager.GetDonation().Get(sender.getName()).OwnsUnknownPackage(Manager.GetServerConfig().ServerType + " ULTRA");
//Level
String levelStr = "";
if (!Manager.GetGameHostManager().isPrivateServer())
levelStr = Manager.GetAchievement().getMineplexLevel(sender, rank);
String rankStr = "";
//Rank Prefix & MPS Host Prefix
if (Manager.GetGameHostManager().isHost(event.getPlayer()))
{
if (Manager.GetGameHostManager().isEventServer())
rankStr = C.cDGreen + C.Bold + "Event Host ";
else
rankStr = C.cDGreen + C.Bold + "MPS Host ";
}
else if (Manager.GetGameHostManager().isAdmin(event.getPlayer(), false))
{
if (Manager.GetGameHostManager().isEventServer())
rankStr = C.cDGreen + C.Bold + "Event Co-Host ";
else
rankStr = C.cDGreen + C.Bold + "MPS Co-Host ";
}
else
{
if (rank != Rank.ALL)
rankStr = rank.getTag(true, true) + " ";
if (ownsUltra && !rank.has(Rank.ULTRA))
rankStr = Rank.ULTRA.getTag(true, true) + " ";
}
if (event.getMessage().charAt(0) == '@')
{
//Party Chat
Party party = Manager.getPartyManager().GetParty(sender);
if (party != null)
{
event.getRecipients().clear();
event.setMessage(event.getMessage().substring(1, event.getMessage().length()));
event.setFormat(levelStr + C.cDPurple + C.Bold + "Party " + C.cWhite + C.Bold + senderName + " " + C.cPurple + "%2$s");
event.getRecipients().addAll(party.GetPlayersOnline());
return;
}
}
//Base Format
event.setFormat(disguiseTag + dead + levelStr + rankStr + Manager.GetColor(sender) + senderName + " " + ChatColor.WHITE + "%2$s");
//Public/Private (Not If Player Dead)
if (Manager.GetGame() != null && Manager.GetGame().GetState() == GameState.Live)
{
boolean globalMessage = false;
//Team
GameTeam team = Manager.GetGame().GetTeam(sender);
if (team != null)
{
//Team Chat
if (event.getMessage().charAt(0) == '@')
{
event.setMessage(event.getMessage().substring(1, event.getMessage().length()));
event.setFormat(disguiseTag + C.cWhite + C.Bold + "Team" + " " + dead + levelStr + rankStr + team.GetColor() + senderName + " " + C.cWhite + "%2$s");
}
//All Chat
else
{
globalMessage = true;
event.setFormat(disguiseTag + dead + levelStr + rankStr + team.GetColor() + senderName + " " + C.cWhite + "%2$s");
}
}
if (globalMessage)
return;
//Team Message Remove Recipient
Iterator<Player> recipientIterator = event.getRecipients().iterator();
while (recipientIterator.hasNext())
{
Player receiver = recipientIterator.next();
if (!Manager.GetServerConfig().Tournament && Manager.GetClients().Get(receiver).GetRank().has(Rank.MODERATOR))
continue;
GameTeam recTeam = Manager.GetGame().GetTeam(receiver);
GameTeam sendTeam = Manager.GetGame().GetTeam(sender);
if (recTeam == null || sendTeam == null)
{
continue;
}
if (!recTeam.equals(sendTeam))
recipientIterator.remove();
}
}
}
}

View File

@ -0,0 +1,56 @@
package nautilus.game.arcade.managers.chat;
/**
* Created by TeddyDev on 10/01/2016.
*/
public class ChatStatData
{
private String _stat;
private String _display;
private boolean _isValue;
public ChatStatData()
{
}
public ChatStatData(String stat, String display, boolean isValue)
{
_stat = stat;
_display = display;
_isValue = isValue;
}
public ChatStatData blankLine()
{
_stat = null;
_display = " ";
_isValue = false;
return this;
}
public ChatStatData plainText(String text)
{
_stat = null;
_display = text;
_isValue = false;
return this;
}
public String getStat()
{
return _stat;
}
public String getDisplay()
{
return _display;
}
public boolean isValue()
{
return _isValue;
}
}

View File

@ -0,0 +1,383 @@
package nautilus.game.arcade.managers.chat;
import java.text.DecimalFormat;
import java.util.AbstractMap;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import mineplex.core.account.CoreClient;
import mineplex.core.common.Rank;
import mineplex.core.common.jsonchat.JsonMessage;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.party.Party;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.GameTeam;
import org.jooq.tools.json.JSONObject;
public class GameChatManager implements Listener
{
private ArcadeManager _manager;
private LinkedList<ChatStatData> _chatStats;
public GameChatManager(ArcadeManager manager)
{
_manager = manager;
_manager.getPluginManager().registerEvents(this, _manager.getPlugin());
_chatStats = new LinkedList<ChatStatData>();
}
@EventHandler
public void MeCancel(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().startsWith("/me "))
{
UtilPlayer.message(event.getPlayer(), F.main("Mirror", "You can't see /me messages, are you a vampire?"));
event.setCancelled(true);
}
}
@EventHandler
public void HandleChat(AsyncPlayerChatEvent event)
{
if (event.isCancelled())
return;
Player sender = event.getPlayer();
String senderName = sender.getName();
String format = "";
String name = "";
String message = "";
//Dead Prefix
String dead = "";
if (_manager.GetGame() != null)
if (_manager.GetGame().GetTeam(sender) != null)
if (!_manager.GetGame().IsAlive(sender))
dead = C.cGray + "Dead " + C.Reset;
Rank rank = _manager.GetClients().Get(sender).GetRank();
String disguiseTag = "";
if(_manager.GetClients().Get(sender).isDisguised())
{
CoreClient cc = _manager.GetClients().Get(sender);
rank = cc.getDisguisedRank();
if(!cc.GetRank().has(Rank.JNR_DEV))
{
disguiseTag = ChatColor.BLACK + " ";
}
}
boolean ownsUltra = false;
if (_manager.GetGame() != null)
ownsUltra = _manager.GetDonation().Get(sender.getName()).OwnsUnknownPackage(_manager.GetServerConfig().ServerType + " ULTRA");
//Level
String levelStr = "";
if (!_manager.GetGameHostManager().isPrivateServer())
levelStr = _manager.GetAchievement().getMineplexLevel(sender, rank);
String rankStr = "";
//Rank Prefix & MPS Host Prefix
if (_manager.GetGameHostManager().isHost(event.getPlayer()))
{
if (_manager.GetGameHostManager().isEventServer())
rankStr = C.cDGreen + C.Bold + "Event Host " + C.Reset;
else
rankStr = C.cDGreen + C.Bold + "MPS Host " + C.Reset;
}
else if (_manager.GetGameHostManager().isAdmin(event.getPlayer(), false))
{
if (_manager.GetGameHostManager().isEventServer())
rankStr = C.cDGreen + C.Bold + "Event Co-Host " + C.Reset;
else
rankStr = C.cDGreen + C.Bold + "MPS Co-Host " + C.Reset;
}
else
{
if (rank != Rank.ALL)
rankStr = rank.getTag(true, true) + " " + C.Reset;
if (ownsUltra && !rank.has(Rank.ULTRA))
rankStr = Rank.ULTRA.getTag(true, true) + " " + C.Reset;
}
if (event.getMessage().charAt(0) == '@')
{
//Party Chat
Party party = _manager.getPartyManager().GetParty(sender);
if (party != null)
{
event.getRecipients().clear();
rankStr = C.cDPurpleB + "Party " + C.Reset;
event.setMessage(event.getMessage().substring(1, event.getMessage().length()));
event.setFormat(levelStr + rankStr + C.cWhiteB + senderName + " " + C.cPurple + "%2$s");
format = event.getFormat().split(rankStr)[0];
name = C.cWhiteB + sender.getName() + C.Reset;
message = event.getFormat().split(sender.getName())[1].replace("%2$s", "") + _manager.GetChat().getFilteredMessage(sender, event.getMessage());
if(safeSend(sender, format, rankStr, rank, name, message, party.GetPlayersOnline()))
{
event.setCancelled(true);
}
return;
}
}
event.setFormat(levelStr + rankStr + senderName + " " + C.cWhite + "%2$s");
if(rankStr.equals(""))
format = levelStr;
else
format = event.getFormat().split(rankStr)[0];
name = _manager.GetColor(sender) + sender.getName() + C.Reset;
message = event.getFormat().split(sender.getName())[1].replace("%2$s", "") + _manager.GetChat().getFilteredMessage(sender, event.getMessage());
if (_manager.GetGame().GetState() != GameState.Live)
{
event.setFormat(levelStr + rankStr + senderName + " " + C.cWhite + "%2$s");
if(safeSend(sender, format, rankStr, rank, name, message, event.getRecipients()))
{
event.setCancelled(true);
}
return;
}
//Base Format
event.setFormat(disguiseTag + dead + levelStr + rankStr + _manager.GetColor(sender) + senderName + " " + C.cWhite + "%2$s");
//Public/Private (Not If Player Dead)
if (_manager.GetGame() != null && _manager.GetGame().GetState() == GameState.Live)
{
boolean globalMessage = false;
//Team
GameTeam team = _manager.GetGame().GetTeam(sender);
if (team != null)
{
boolean isPriv = event.getMessage().charAt(0) == '@';
if(isPriv)
event.setMessage(event.getMessage().substring(1, event.getMessage().length()));
else
globalMessage = true;
event.setFormat(isPriv ? disguiseTag + C.cWhiteB + "Team " + dead + levelStr + rankStr + senderName + " " + C.cWhite + "%2$s" : disguiseTag + dead + levelStr + rankStr + team.GetColor() + senderName + " " + C.cWhite + "%2$s");
if(rankStr.equals(""))
format = isPriv ? disguiseTag + C.cWhiteB + "Team " + dead + levelStr : disguiseTag + dead + levelStr;
else
format = event.getFormat().split(rankStr)[0];
name = isPriv ? team.GetColor() + sender.getName() : _manager.GetColor(sender) + sender.getName();
}
else
{
globalMessage = true;
event.setFormat(disguiseTag + dead + levelStr + rankStr + senderName + " " + C.cWhite + "%2$s");
if(rankStr.equals(""))
format = disguiseTag + dead + levelStr;
else
format = event.getFormat().split(rankStr)[0];
name = _manager.GetColor(sender) + sender.getName();
}
if (globalMessage)
{
if(safeSend(sender, format, rankStr, rank, name, message, event.getRecipients()))
{
event.setCancelled(true);
}
return;
}
//Team Message Remove Recipient
Iterator<Player> recipientIterator = event.getRecipients().iterator();
while (recipientIterator.hasNext())
{
Player receiver = recipientIterator.next();
if (!_manager.GetServerConfig().Tournament && _manager.GetClients().Get(receiver).GetRank().has(Rank.MODERATOR))
continue;
GameTeam recTeam = _manager.GetGame().GetTeam(receiver);
GameTeam sendTeam = _manager.GetGame().GetTeam(sender);
if (recTeam == null || sendTeam == null)
{
continue;
}
if (!recTeam.equals(sendTeam))
recipientIterator.remove();
}
if(safeSend(sender, format, rankStr, rank, name, message, event.getRecipients()))
{
event.setCancelled(true);
}
}
}
public boolean safeSend(Player sender, String prefix, String rankStr, Rank rank, String name, String message, Collection<Player> sendto)
{
final JsonMessage json = buildJSON(sender, prefix, rankStr, rank, name, _chatStats, message);
try
{
json.send(JsonMessage.MessageType.CHAT_BOX, sendto.toArray(new Player[sendto.size()]));
return true;
}
catch (Exception e)
{
System.out.println("ChatStats Failed to send JSON message..");
System.out.println(json);
return false;
}
}
public void setGameChatStats(ChatStatData... stats)
{
_chatStats = new LinkedList<ChatStatData>();
for(ChatStatData chatStat : stats)
{
_chatStats.add(chatStat);
}
}
private JsonMessage buildJSON(Player player, String prefix, String rankStr, Rank rank, String name, LinkedList<ChatStatData> hoverText, String message)
{
if(_manager.GetGame().GetState() != GameState.Prepare && _manager.GetGame().GetState() != GameState.Live && _manager.GetGame().GetState() != GameState.End)
{
if(rank == Rank.ALL)
{
return new JsonMessage("").extra(JSONObject.escape(prefix))
.add(JSONObject.escape(rankStr)).add(JSONObject.escape(name)).add(JSONObject.escape(message));
}
return new JsonMessage("").extra(JSONObject.escape(prefix))
.add(JSONObject.escape(rankStr)).hover("show_text", rank.getColor() + rank.getTag(true, true) + C.cWhite + "\n" + rank.getDescription())
.add(JSONObject.escape(name)).add(JSONObject.escape(message));
}
LinkedList<Map.Entry<String, String>> temp = new LinkedList<Map.Entry<String, String>>();
ChatColor teamColor = _manager.GetColor(player);
temp.add(new AbstractMap.SimpleEntry<String, String>(teamColor + C.Bold + ChatColor.stripColor(name) + teamColor + "'s stats", ""));
temp.add(new AbstractMap.SimpleEntry<String, String>(" ", ""));
Game game = _manager.GetGame();
String gameName = game.GetName();
for (int i = 0; i < hoverText.size(); i++)
{
if (!_manager.GetGame().GetStats().containsKey(player))
{
temp.add(new AbstractMap.SimpleEntry<String, String>(C.cGray + "Retrieving stats..", ""));
break;
}
ChatStatData chatStatData = hoverText.get(i);
String display = (chatStatData.getDisplay() == null ? chatStatData.getStat() : chatStatData.getDisplay());
if(!chatStatData.isValue())
{
temp.add(new AbstractMap.SimpleEntry<String, String>(chatStatData.getDisplay(), ""));
continue;
}
if (chatStatData.getStat().equalsIgnoreCase("kit"))
{
temp.add(new AbstractMap.SimpleEntry<String, String>(display + ": ", game.GetKit(player).GetName()));
continue;
}
if (chatStatData.getStat().equalsIgnoreCase("kdratio"))
{
int kills;
int deaths;
if (game.GetStats().get(player).containsKey(gameName + ".Kills"))
kills = game.GetStats().get(player).get(gameName + ".Kills");
else
kills = 0;
if (game.GetStats().get(player).containsKey(gameName + ".Deaths"))
deaths = game.GetStats().get(player).get(gameName + ".Deaths");
else
deaths = 0;
temp.add(new AbstractMap.SimpleEntry<String, String>(display + ": ", "" + getRatio(kills, deaths, "##.##")));
continue;
}
if (game.GetStats().get(player).containsKey(gameName + "." + chatStatData.getStat()))
{
temp.add(new AbstractMap.SimpleEntry<String, String>(display + ": ", (game.GetStats().get(player).get(gameName + "." + chatStatData.getStat()).toString())));
}
else
{
temp.add(new AbstractMap.SimpleEntry<String, String>(display + ": ", "0"));
}
}
String stats = "";
for (int i = 0; i < temp.size(); i++)
{
stats += C.cWhite + JSONObject.escape(temp.get(i).getKey()) + C.cGray + JSONObject.escape(temp.get(i).getValue()) + (i >= temp.size()-1 ? "" : "\\n");
}
if(rank == Rank.ALL)
{
return new JsonMessage("").extra(JSONObject.escape(prefix))
.add(JSONObject.escape(rankStr)).add(JSONObject.escape(name)).hover("show_text", stats).add(JSONObject.escape(message));
}
return new JsonMessage("").extra(JSONObject.escape(prefix))
.add(JSONObject.escape(rankStr)).hover("show_text", rank.getColor() + rank.getTag(true, true) + ChatColor.WHITE + "\n" + rank.getDescription())
.add(JSONObject.escape(name)).hover("show_text", stats).add(JSONObject.escape(message));
}
public double getRatio(int var1, int var2, String format)
{
double ratio = 0.0;
if(var1 <= 0) ratio = 0d;
else if(var2 <= 1) ratio = (double) var1;
else if(var1 <= 0 && var2 <= 0) ratio = 0d;
else ratio = ((double) var1 / var2);
return Double.parseDouble(new DecimalFormat(format).format(ratio));
}
}

View File

@ -0,0 +1,71 @@
package nautilus.game.arcade.stats;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDamageEvent;
import nautilus.game.arcade.game.Game;
/**
* Created by TeddehDev on 15/01/2016.
*/
public class BlockBreakStatTracker extends StatTracker<Game>
{
private boolean _blockDamage;
/**
* @param blockDamage
* - true = triggers block damage event
* - false = triggers block break event
*/
public BlockBreakStatTracker(Game game, boolean blockDamage)
{
super(game);
_blockDamage = blockDamage;
}
@EventHandler
public void blockBreak(BlockBreakEvent event)
{
if(!getGame().IsLive())
return;
if(event.isCancelled())
return;
if(_blockDamage)
return;
Player player = event.getPlayer();
if(player == null)
return;
addStat(player, "BlocksBroken", 1, false, false);
}
@EventHandler
public void blockBreak(BlockDamageEvent event)
{
if(!getGame().IsLive())
return;
if(event.isCancelled())
return;
if(!_blockDamage)
return;
Player player = event.getPlayer();
if(player == null)
return;
addStat(player, "BlocksBroken", 1, false, false);
}
public void addStat(Player player)
{
addStat(player, "BlocksBroken", 1, false, false);
}
}

View File

@ -0,0 +1,48 @@
package nautilus.game.arcade.stats;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockPlaceEvent;
import nautilus.game.arcade.game.Game;
/**
* Created by TeddehDev on 15/01/2016.
*/
public class BlockPlaceStatTracker extends StatTracker<Game>
{
private Material[] _ignore;
public BlockPlaceStatTracker(Game game, Material[] ignore)
{
super(game);
_ignore = ignore;
}
@EventHandler
public void blockPlace(BlockPlaceEvent event)
{
if(!getGame().IsLive())
return;
if(event.isCancelled())
return;
Player player = event.getPlayer();
if(player == null)
return;
if(_ignore.length == 0)
addStat(event.getPlayer(), "BlocksPlaced", 1, false, false);
for(Material material : _ignore)
{
if(event.getBlock().getType() == material)
continue;
addStat(event.getPlayer(), "BlocksPlaced", 1, false, false);
}
}
}

View File

@ -0,0 +1,40 @@
package nautilus.game.arcade.stats;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import nautilus.game.arcade.game.Game;
/**
* Created by luke1 on 28/01/2016.
*/
public class DrawGuessStatTracker extends StatTracker<Game>
{
public DrawGuessStatTracker(Game game)
{
super(game);
}
@EventHandler
public void guess(AsyncPlayerChatEvent event)
{
if(getGame().GetState() != Game.GameState.Live)
return;
int i = 0;
if(event.getMessage().contains(" "))
{
for(char c : event.getMessage().toCharArray())
{
System.out.println(c);
if(c != ' ')
continue;
i++;
}
}
if(i <= 1)
addStat(event.getPlayer(), "TotalGuess", 1, false, false);
}
}

View File

@ -24,12 +24,12 @@ public class FirstSupplyDropOpenStatTracker extends StatTracker<Game>
{
if (getGame().GetState() != Game.GameState.Live)
return;
System.out.println("DEBUG 1");
if (_opened.contains(event.getChest()))
return;
_opened.add(event.getChest());
System.out.println("DEBUG 2");
addStat(event.getPlayer(), "SupplyDropsOpened", 1, false, false);
}
}