Search in sources :

Example 1 with DisplayTable

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

the class DuelsStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> preview = getPreview(player);
    JsonHolder stats = player.getStats(GameType.DUELS);
    preview.add(new DisplayLine(""));
    String[] modes = new String[] { "uhc_duel", "uhc_doubles", "sw_duel", "sw_doubles", "classic_duel", "op_duel", "combo", "mw_duel", "mw_doubles", "blitz_duels", "potion_duel", "sumo_duel" };
    String[] names = new String[] { "UHC Solo", "UHC Doubles", "SW Solo", "SW Doubles", "Classic Duel", "OP duel", "Combo", "MegaWalls Solo", "MegaWalls Doubles", "Blitz Solo", "Potion Duel", "Sumo" };
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Kills", "Wins", "Deaths", "Losses", "K/D", "W/L" });
    for (int i = 0; i < tournaments.length; i++) {
        String mode = tournaments[i];
        lines.add(new String[] { tournament_names[i], WebsiteUtils.comma(stats.optInt(mode + "_kills")), WebsiteUtils.comma(stats.optInt(mode + "_wins")), WebsiteUtils.comma(stats.optInt(mode + "_deaths")), WebsiteUtils.comma(stats.optInt(mode + "_losses")), WebsiteUtils.buildRatio(stats.optInt(mode + "_kills"), stats.optInt(mode + "_deaths")), WebsiteUtils.buildRatio(stats.optInt(mode + "_wins"), stats.optInt(mode + "_losses")) });
    }
    preview.add(new DisplayTable(lines));
    preview.add(new DisplayLine(""));
    lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Kills", "Wins", "Deaths", "Losses", "K/D", "W/L", "Best Winstreak" });
    for (int i = 0; i < modes.length; i++) {
        String mode = modes[i];
        lines.add(new String[] { names[i], WebsiteUtils.comma(stats.optInt(mode + "_kills")), WebsiteUtils.comma(stats.optInt(mode + "_wins")), WebsiteUtils.comma(stats.optInt(mode + "_deaths")), WebsiteUtils.comma(stats.optInt(mode + "_losses")), WebsiteUtils.buildRatio(stats.optInt(mode + "_kills"), stats.optInt(mode + "_deaths")), WebsiteUtils.buildRatio(stats.optInt(mode + "_wins"), stats.optInt(mode + "_losses")), WebsiteUtils.comma(stats.optInt("duels_winstreak_best_" + mode)) });
    }
    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 2 with DisplayTable

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

the class QuakecraftStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder quakeCraft = player.getStats(GameType.QUAKECRAFT);
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(""));
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Kills", "Headshots", "Wins", "Shots Fired", "Blocks Traveled", "Godlikes", "Killstreaks", "K/D" });
    lines.add(new String[] { "Overall", String.valueOf(quakeCraft.optInt("kills") + quakeCraft.optInt("kills_teams")), String.valueOf(quakeCraft.optInt("headshots") + quakeCraft.optInt("headshots_teams")), String.valueOf(quakeCraft.optInt("wins") + quakeCraft.optInt("wins_teams")), String.valueOf(quakeCraft.optInt("shots_fired") + quakeCraft.optInt("shots_fired_teams")), String.valueOf(quakeCraft.optInt("distance_travelled") + quakeCraft.optInt("distance_travelled_teams")), String.valueOf(quakeCraft.optInt("godlikes") + quakeCraft.optInt("godlikes_teams")), String.valueOf(quakeCraft.optInt("killstreaks") + quakeCraft.optInt("killstreaks_teams")), WebsiteUtils.buildRatio(quakeCraft.optInt("kills") + quakeCraft.optInt("kills_teams"), quakeCraft.optInt("deaths") + quakeCraft.optInt("deaths_teams")) });
    lines.add(new String[] { "Solo", String.valueOf(quakeCraft.optInt("kills")), String.valueOf(quakeCraft.optInt("headshots")), String.valueOf(quakeCraft.optInt("wins")), String.valueOf(quakeCraft.optInt("shots_fired")), String.valueOf(quakeCraft.optInt("distance_travelled")), String.valueOf(quakeCraft.optInt("godlikes")), String.valueOf(quakeCraft.optInt("killstreaks")), WebsiteUtils.buildRatio(quakeCraft.optInt("kills"), quakeCraft.optInt("deaths")) });
    lines.add(new String[] { "Teams", String.valueOf(quakeCraft.optInt("kills_teams")), String.valueOf(quakeCraft.optInt("headshots_teams")), String.valueOf(quakeCraft.optInt("wins_teams")), String.valueOf(quakeCraft.optInt("shots_fired_teams")), String.valueOf(quakeCraft.optInt("distance_travelled_teams")), String.valueOf(quakeCraft.optInt("godlikes_teams")), String.valueOf(quakeCraft.optInt("killstreaks_teams")), WebsiteUtils.buildRatio(quakeCraft.optInt("kills_teams"), quakeCraft.optInt("deaths_teams")) });
    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 3 with DisplayTable

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

the class SkyWarsStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder skyWars = player.getStats(GameType.SKYWARS);
    SimpleDateFormat hhmmss = new SimpleDateFormat("HH:mm:ss");
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(skyWars.optInt("kills"), skyWars.optInt("deaths")))));
    stats.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(skyWars.optInt("wins"), skyWars.optInt("losses")))));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Total Souls: ", skyWars.optInt("souls"))));
    stats.add(new DisplayLine(bold("Soul Well Usages: ", skyWars.optInt("soul_well"))));
    stats.add(new DisplayLine(bold("Soul Well Legendaries: ", skyWars.optInt("soul_well_legendaries"))));
    stats.add(new DisplayLine(bold("Soul Well Rares: ", skyWars.optInt("soul_well_rares"))));
    stats.add(new DisplayLine(bold("Souls Gathered: ", skyWars.optInt("souls_gathered"))));
    stats.add(new DisplayLine(bold("Souls Purchased: ", skyWars.optInt("paid_souls"))));
    int skywars_time_played = skyWars.optInt("time_played");
    int skywars_tmp_days = 0;
    // SKYWARS_TIME
    while (skywars_time_played > 24 * 60 * 60) {
        skywars_tmp_days++;
        skywars_time_played -= 24 * 60 * 60;
    }
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Time played: (DD, HH:MM:SS): ", skywars_tmp_days + ", " + hhmmss.format(new Date(1000 * skywars_time_played)))));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(""));
    final String[] skywars_modes = { "Ranked", "Solo Normal", "Solo Insane", "Team Normal", "Team Insane", "Mega" };
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Kills", "Wins", "Deaths", "Losses", "K/D", "W/L" });
    for (String front : skywars_modes) {
        String api = front.toLowerCase().replace(" ", "_");
        lines.add(new String[] { front, String.valueOf(skyWars.optInt("kills_" + api)), String.valueOf(skyWars.optInt("wins_" + api)), String.valueOf(skyWars.optInt("deaths_" + api)), String.valueOf(skyWars.optInt("losses_" + api)), WebsiteUtils.buildRatio(skyWars.optInt("kills_" + api), skyWars.optInt("deaths_" + api)), WebsiteUtils.buildRatio(skyWars.optInt("wins_" + api), skyWars.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) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Example 4 with DisplayTable

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

the class BedWarsStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> preview = getPreview(player);
    preview.add(new DisplayLine(""));
    List<String[]> lines = new ArrayList<>();
    JsonHolder bedwars = player.getStats(GameType.BEDWARS);
    String[] bedwarsnames = { "Solo", "Doubles", "3v3v3v3", "4v4v4v4" };
    String[] bedwarsBackend = { "eight_one", "eight_two", "four_three", "four_four" };
    lines.add(new String[] { "Mode", "Kills", "Deaths", "Wins", "Losses", "Final Kills", "Final Deaths", "Beds Broken", "K/D", "Final K/D", "W/L" });
    for (int i = 0; i < bedwarsnames.length; i++) {
        lines.add(new String[] { bedwarsnames[i], WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_kills_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_deaths_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_wins_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_losses_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_final_kills_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_final_deaths_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_beds_broken_bedwars")), WebsiteUtils.buildRatio(bedwars.optInt(bedwarsBackend[i] + "_kills_bedwars"), bedwars.optInt(bedwarsBackend[i] + "_deaths_bedwars")), WebsiteUtils.buildRatio(bedwars.optInt(bedwarsBackend[i] + "_final_kills_bedwars"), bedwars.optInt(bedwarsBackend[i] + "_final_deaths_bedwars")), WebsiteUtils.buildRatio(bedwars.optInt(bedwarsBackend[i] + "_wins_bedwars"), bedwars.optInt(bedwarsBackend[i] + "_losses_bedwars")) });
    }
    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 5 with DisplayTable

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

the class GeneralStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> items = getPreview(player);
    JsonHolder giftm = player.getGiftMeta();
    items.add(new DisplayLine(""));
    items.add(new DisplayLine(bold("Gift given: ", giftm.optInt("realBundlesGiven"))));
    items.add(new DisplayLine(bold("Gift received: ", giftm.optInt("realBundlesReceived"))));
    items.add(new DisplayLine(""));
    if (player.has("mostRecentGameType")) {
        items.add(new DisplayLine(bold("Most recent played: ", player.mostRecentGame().getName())));
        items.add(new DisplayLine(""));
    }
    items.add(new DisplayLine(bold("Rewards Claimed: ", player.getInt("totalRewards"))));
    items.add(new DisplayLine(bold("Daily Rewards Claimed: ", player.getInt("totalDailyRewards"))));
    items.add(new DisplayLine(bold("Best Rewards Streak: ", player.getInt("rewardHighScore"))));
    items.add(new DisplayLine(bold("Current reward streak: ", player.getInt("rewardScore"))));
    items.add(new DisplayLine(""));
    items.add(new DisplayLine(bold("Times voted: ", player.getInt("voting#total"))));
    items.add(new DisplayLine(""));
    JsonHolder petss2 = player.getRoot().optJSONObject("petStats");
    List<String[]> strings = new ArrayList<>();
    strings.add(new String[] { "Name", "Level" });
    for (String in : petss2.getKeys()) {
        JsonHolder tmp = petss2.optJSONObject(in);
        Pet pet = new Pet(tmp);
        String name;
        if (tmp.has("name"))
            name = tmp.optString("name");
        else
            name = in.replace("_", " ").toLowerCase();
        strings.add(new String[] { name, Integer.toString(pet.level) });
    }
    items.add(new DisplayLine("Pets", Color.WHITE.getRGB(), 2));
    items.add(new DisplayTable(strings));
    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) Pet(club.sk1er.website.Pet)

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