Search in sources :

Example 6 with DisplayTable

use of cc.hyperium.handlers.handlers.stats.display.DisplayTable in project Hyperium by HyperiumClient.

the class MurderMysteryStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> preview = getPreview(player);
    JsonHolder stats = player.getStats(GameType.MURDER_MYSTERY);
    preview.add(new DisplayLine(""));
    preview.add(new DisplayLine("Classic Stats"));
    preview.add(new DisplayLine(bold("Kills: ", stats.optInt("kills_MURDER_CLASSIC"))));
    preview.add(new DisplayLine(bold("Wins: ", stats.optInt("wins_MURDER_CLASSIC"))));
    preview.add(new DisplayLine(bold("Deaths: ", stats.optInt("deaths_MURDER_CLASSIC"))));
    preview.add(new DisplayLine(bold("Bow Kills: ", stats.optInt("bow_kills"))));
    preview.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(stats.optInt("kills_MURDER_CLASSIC"), stats.optInt("deaths_MURDER_CLASSIC")))));
    preview.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(stats.optInt("wins_MURDER_CLASSIC"), stats.optInt("deaths_MURDER_CLASSIC")))));
    preview.add(new DisplayLine(""));
    preview.add(new DisplayLine("Hardcore Stats"));
    preview.add(new DisplayLine(bold("Kills: ", stats.optInt("kills_MURDER_HARDCORE"))));
    preview.add(new DisplayLine(bold("Wins: ", stats.optInt("wins_MURDER_HARDCORE"))));
    preview.add(new DisplayLine(bold("Deaths: ", stats.optInt("deaths_MURDER_HARDCORE"))));
    preview.add(new DisplayLine(bold("Bow Kills: ", stats.optInt("bow_kills"))));
    preview.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(stats.optInt("kills_MURDER_HARDCORE"), stats.optInt("deaths_MURDER_HARDCORE")))));
    preview.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(stats.optInt("wins_MURDER_HARDCORE"), stats.optInt("deaths_MURDER_HARDCORE")))));
    preview.add(new DisplayLine(""));
    preview.add(new DisplayLine("Assassins Stats"));
    preview.add(new DisplayLine(bold("Kills: ", stats.optInt("kills_MURDER_ASSASSINS"))));
    preview.add(new DisplayLine(bold("Wins: ", stats.optInt("wins_MURDER_ASSASSINS"))));
    preview.add(new DisplayLine(bold("Deaths: ", stats.optInt("deaths_MURDER_ASSASSINS"))));
    preview.add(new DisplayLine(bold("Bow Kills: ", stats.optInt("bow_kills"))));
    preview.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(stats.optInt("kills_MURDER_ASSASSINS"), stats.optInt("deaths_MURDER_ASSASSINS")))));
    preview.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(stats.optInt("wins_MURDER_ASSASSINS"), stats.optInt("deaths_MURDER_ASSASSINS")))));
    String[] murderMysteryModes = { "All", "Classic", "Assassins", "Hardcore" };
    String[] murderMysteryNames = { "", "_MURDER_CLASSIC", "_MURDER_ASSASIANS", "_MURDER_HARDCORE" };
    List<String[]> lines = new ArrayList<>();
    preview.add(new DisplayLine(""));
    lines.add(new String[] { "Mode", "Kills", "Wins", "Deaths", "Hero", "Bow Kills" });
    for (int i = 0; i < murderMysteryModes.length; i++) {
        String name = murderMysteryModes[i];
        String seed = murderMysteryNames[i];
        lines.add(new String[] { name, String.valueOf(stats.optInt("kills" + seed)), String.valueOf(stats.optInt("wins" + seed)), String.valueOf(stats.optInt("deaths" + seed)), String.valueOf(stats.optInt("was_hero" + seed)), String.valueOf(stats.optInt("bow_kills" + seed)) });
    }
    preview.add(new DisplayTable(lines));
    return preview;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) DisplayTable(cc.hyperium.handlers.handlers.stats.display.DisplayTable) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 7 with DisplayTable

use of cc.hyperium.handlers.handlers.stats.display.DisplayTable in project Hyperium by HyperiumClient.

the class ArenaStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> items = getPreview(player);
    items.add(new DisplayLine(""));
    List<String[]> tableItems = new ArrayList<>();
    JsonHolder arena = player.getStats(GameType.ARENA);
    tableItems.add(new String[] { "Mode", "Kills", "Deaths", "Wins", "Losses", "Healed", "K/D", "W/L" });
    String[] names = new String[] { "1v1", "2v2", "4v4" };
    for (String name : names) {
        tableItems.add(new String[] { name, WebsiteUtils.comma(arena.optInt("kills_" + name)), WebsiteUtils.comma(arena.optInt("deaths_" + name)), WebsiteUtils.comma(arena.optInt("wins_" + name)), WebsiteUtils.comma(arena.optInt("losses_" + name)), WebsiteUtils.comma(arena.optInt("healed_" + name)), WebsiteUtils.buildRatio(arena.optInt("kills_" + name), arena.optInt("deaths_" + name)), WebsiteUtils.buildRatio(arena.optInt("wins_" + name), arena.optInt("losses_" + name)) });
    }
    items.add(new DisplayTable(tableItems));
    return items;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) DisplayTable(cc.hyperium.handlers.handlers.stats.display.DisplayTable) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 8 with DisplayTable

use of cc.hyperium.handlers.handlers.stats.display.DisplayTable in project Hyperium by HyperiumClient.

the class BlitzStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> preview = getPreview(player);
    preview.add(new DisplayLine(""));
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Kit", "Level" });
    JsonHolder blitz = player.getStats(GameType.SURVIVAL_GAMES);
    for (String st : WebsiteUtils.blitz_kits) {
        String tmp1 = null;
        if (!st.contains("Hype")) {
            tmp1 = st.replace(" ", "").toLowerCase();
        } else {
            tmp1 = st.toLowerCase();
        }
        if (blitz.has(tmp1))
            lines.add(new String[] { st, WebsiteUtils.numeral(blitz.optInt(tmp1) + 1) });
    }
    preview.add(new DisplayTable(lines));
    return preview;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) DisplayTable(cc.hyperium.handlers.handlers.stats.display.DisplayTable) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 9 with DisplayTable

use of cc.hyperium.handlers.handlers.stats.display.DisplayTable in project Hyperium by HyperiumClient.

the class SpeedUHCStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder speedUhc = player.getStats(GameType.SPEED_UHC);
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(speedUhc.optInt("kills"), speedUhc.optInt("deaths")))));
    stats.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(speedUhc.optInt("wins"), speedUhc.optInt("losses")))));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Salt: ", speedUhc.optInt("salt"))));
    final String[] SpeedUHC_modes = { "Solo Normal", "Solo Insane", "Team Normal", "Team Insane" };
    stats.add(new DisplayLine(""));
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Kills", "Deaths", "Wins", "Losses", "K/D", "W/L" });
    for (String name : SpeedUHC_modes) {
        String api = name.toLowerCase().replace(" ", "_");
        lines.add(new String[] { name, String.valueOf(speedUhc.optInt("kills_" + api)), String.valueOf(speedUhc.optInt("deaths_" + api)), String.valueOf(speedUhc.optInt("wins_" + api)), String.valueOf(speedUhc.optInt("losses_" + api)), WebsiteUtils.buildRatio(speedUhc.optInt("kills_" + api), speedUhc.optInt("deaths_" + api)), WebsiteUtils.buildRatio(speedUhc.optInt("wins_" + api), speedUhc.optInt("losses_" + api)) });
    }
    stats.add(new DisplayTable(lines));
    return stats;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) DisplayTable(cc.hyperium.handlers.handlers.stats.display.DisplayTable) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 10 with DisplayTable

use of cc.hyperium.handlers.handlers.stats.display.DisplayTable in project Hyperium by HyperiumClient.

the class SkyClashStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder skyClash = player.getStats(GameType.SKYCLASH);
    stats.add(new DisplayLine(bold("Assists: ", skyClash.optInt("assists"))));
    stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(skyClash.optInt("kills"), skyClash.optInt("deaths")))));
    stats.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(skyClash.optInt("wins"), skyClash.optInt("losses")))));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Mobs Spawned: ", skyClash.optInt("mobs_spawned"))));
    stats.add(new DisplayLine(""));
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Fastest Win", "Kills", "Wins", "Losses", "Deaths" });
    String[] SKYCLASH_MODES = { "Solo", "Doubles", "Team War" };
    for (String front : SKYCLASH_MODES) {
        String b = front.toLowerCase().replace(" ", "_");
        lines.add(new String[] { front, String.valueOf(skyClash.optInt("fastest_win_" + b)), String.valueOf(skyClash.optInt("kills_" + b)), String.valueOf(skyClash.optInt("wins_" + b)), String.valueOf(skyClash.optInt("losses_" + b)), String.valueOf(skyClash.optInt("deaths_" + b)) });
    }
    stats.add(new DisplayTable(lines));
    return stats;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) DisplayTable(cc.hyperium.handlers.handlers.stats.display.DisplayTable) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Aggregations

DisplayLine (cc.hyperium.handlers.handlers.stats.display.DisplayLine)10 DisplayTable (cc.hyperium.handlers.handlers.stats.display.DisplayTable)10 StatsDisplayItem (cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem)10 JsonHolder (cc.hyperium.utils.JsonHolder)10 ArrayList (java.util.ArrayList)10 Pet (club.sk1er.website.Pet)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1