示例#1
0
  public void dispose(boolean unload) {

    this.playerTeams.clear();

    for (TeamMap team : this.teams) {
      team.resetKills();
    }

    if (unload) {
      this.unload();
    }
  }
示例#2
0
  public TeamMap getTeamByName(String name) {

    for (TeamMap team : teams) {
      if (team.getColor()
          .name()
          .toLowerCase()
          .replace("_", " ")
          .replace("dark ", "")
          .startsWith(name)) {
        return team;
      }
    }

    return null;
  }
示例#3
0
  public String matchInfoToString(CommandSender player) {

    StringBuilder builder = new StringBuilder();

    player.sendMessage(
        ChatColor.RED
            + "------------------ "
            + ChatColor.AQUA
            + "Match Info"
            + ChatColor.RED
            + " ------------------");

    if (HyperPVP.getMap().getType() == GameType.TDM
        || HyperPVP.getMap().getType() == GameType.DTM
        || HyperPVP.getMap().getType() == GameType.DTC
        || HyperPVP.getMap().getType() == GameType.RTC) {

      player.sendMessage(
          ChatColor.DARK_AQUA + "Time: " + ChatColor.AQUA + HyperPVP.getTimeString());

      TeamMap one = this.teams.get(0);
      TeamMap two = this.teams.get(1);

      player.sendMessage(
          one.getColor()
              + HyperPVP.capitalize(
                  one.getColor().name().toLowerCase().replace("_", " ").replace("dark ", ""))
              + ChatColor.GRAY
              + " kills: "
              + ChatColor.WHITE
              + one.getKills()
              + " | "
              + two.getColor()
              + HyperPVP.capitalize(
                  two.getColor().name().toLowerCase().replace("_", " ").replace("dark ", ""))
              + ChatColor.GRAY
              + " kills: "
              + ChatColor.WHITE
              + two.getKills()
              + " | "
              + ChatColor.AQUA
              + "Observers"
              + ChatColor.GRAY
              + ": "
              + ChatColor.WHITE
              + HyperPVP.getSpectators().size());

      player.sendMessage("");

      String goal = "";

      if (HyperPVP.getMap().getType() == GameType.TDM) {
        goal = ChatColor.AQUA + "(Team Death Match) Get your team the most kills.";
      }

      if (HyperPVP.getMap().getType() == GameType.DTM) {
        goal = ChatColor.AQUA + "(Destroy The Monument) Destory all of other teams obsidian.";
      }

      if (HyperPVP.getMap().getType() == GameType.DTC) {
        goal = ChatColor.AQUA + "(Destroy The Core) Leak their obisdian core.";
      }

      if (HyperPVP.getMap().getType() == GameType.RTC) {
        goal =
            ChatColor.AQUA + "(Race To Core) Be the first team to destroy the core in the middle.";
      }

      player.sendMessage(
          ChatColor.DARK_AQUA + "" + ChatColor.BOLD + "Goal: " + ChatColor.RESET + goal);
    }

    if (HyperPVP.getMap().getType() == GameType.FFA) {

      player.sendMessage(
          ChatColor.DARK_AQUA + "Time: " + ChatColor.AQUA + HyperPVP.getTimeString());
      player.sendMessage("");
      player.sendMessage(
          ChatColor.DARK_AQUA
              + ""
              + ChatColor.BOLD
              + "Goal: "
              + ChatColor.RESET
              + ChatColor.AQUA
              + "Kill everyone, get the highest kill score.");
      player.sendMessage("");

      List<Session> topPlayers = HyperPVP.getMap().getTop();

      if (topPlayers.size() != 0) {

        int i = 1;

        for (Session set : topPlayers) {

          if (i > 10 && set.getKills() != 0) {
            continue;
          }

          player.sendMessage(
              i
                  + ". "
                  + ChatColor.GOLD
                  + set.getPlayer().getName()
                  + ChatColor.WHITE
                  + " with "
                  + set.getKills()
                  + "!");

          i++;
        }
      }
    }

    return builder.toString();
  }