Exemplo n.º 1
0
  public void payPot(int divide) {
    double potToPay = getPot() / divide;
    double rake = 0;
    PokerTable pokerTable = getPokerTable();
    if (pokerTable.getSettings().rake.getValue() > 0) {
      rake = potToPay * pokerTable.getSettings().rake.getValue();

      UltimateCards.getEconomy().depositPlayer(pokerTable.getOwner(), rake);
      Log.addToLog(
          DateMethods.getDate() + " [ECONOMY] Depositing " + rake + " to " + pokerTable.getOwner());
    }

    pokerTable.sendTableMessage(
        "&6"
            + getPlayerName()
            + "&f wins &6"
            + Formatter.formatMoney(potToPay - rake)
            + (pokerTable.getSettings().rake.getValue() > 0
                ? "&f - Rake " + Formatter.formatMoney(rake)
                : ""));

    // Get the actual amount that the player wins by subtracting the rake from the pot, then give it
    // to the player's stack
    giveMoney(potToPay - rake);

    for (PokerPlayer p : pokerTable.getNonFoldedPlayers()) {
      p.setPot(p.getPot() - potToPay);
    }

    Sound.won(getPlayer());
  }
Exemplo n.º 2
0
  public void bet(double bet, String blind) {
    if (blind != null) {
      setCurrentBet(
          getCurrentBet() + bet); // If this is a blind, add to the current bet (for antes to work)
      getPokerTable()
          .sendTableMessage(
              "&6"
                  + getPlayerName()
                  + "&f posts "
                  + Formatter.formatMoney(bet)
                  + "&f "
                  + blind
                  + "&f (Total: "
                  + "&6"
                  + Formatter.formatMoney(getCurrentBet())
                  + "&f)");
    } else if (money - bet == 0) {
      getPokerTable()
          .sendTableMessage(
              "&6"
                  + getPlayerName()
                  + "&f went all in with "
                  + "&6"
                  + Formatter.formatMoney(bet)
                  + "&f (Total: "
                  + "&6"
                  + Formatter.formatMoney(bet + getTotalBet())
                  + "&f)");
    } else if (getPokerTable().noBetsThisRound()) {
      getPokerTable()
          .sendTableMessage(
              "&6"
                  + getPlayerName()
                  + "&f bets "
                  + "&6"
                  + Formatter.formatMoney(bet)
                  + "&f (Total: "
                  + "&6"
                  + Formatter.formatMoney(bet + getTotalBet())
                  + "&f)");
    } else if (bet > getPokerTable().getCurrentBet()) {
      getPokerTable()
          .sendTableMessage(
              "&6"
                  + getPlayerName()
                  + "&f raises to "
                  + "&6"
                  + Formatter.formatMoney(bet)
                  + "&f (Total: "
                  + "&6"
                  + Formatter.formatMoney(bet + getTotalBet())
                  + "&f)");
    } else if (bet == getPokerTable().getCurrentBet()) {
      getPokerTable()
          .sendTableMessage(
              "&6"
                  + getPlayerName()
                  + "&f calls "
                  + "&6"
                  + Formatter.formatMoney(bet)
                  + "&f (Total: "
                  + "&6"
                  + Formatter.formatMoney(bet + getTotalBet())
                  + "&f)");
    }

    if (blind == null) {
      setCurrentBet(bet);
    }

    for (PokerPlayer p : getPokerTable().getNonFoldedPlayers()) {
      p.resetDeltaPot();
      p.updatePot();
    }

    cancelTurnTimer();
    if (blind == null) {
      setActed(true);
      getPokerTable().nextPersonTurn(this);
    }
  }