public void AllIn(PokerPlayer player, bool call, bool isblind)
		{
			player.Status = Status.AllIn;
			if (isblind)
				if (m_HighestBet == 0)
					m_HighestBet = BlindSmall;
				else
					m_HighestBet += BlindSmall;

			if (call)
				saymsg(String.Format("I call all-in!"), player.Mobile, false);
			else
				saymsg(String.Format("All-in for {0:0,0}!", (double)player.Bankroll), player.Mobile, false);
			Bet(player, player.Bankroll);
		}
		public bool Raise(PokerPlayer player, int amount)
		{
			return Raise(player, amount, false);
		}
		public bool Raise(PokerPlayer player, int amount, bool isblind)
		{
			int realamount = m_HighestBet - player.RoundBet + amount;
			if (player.Bankroll <= realamount)
				AllIn(player, false, isblind);
			else
			{
				m_MovesSinceDeal++;
				if (isblind)
					saymsg(String.Format("I post a blind of {0:0,0}.", (double)realamount), player.Mobile, false);
				else
					if (HighestBet == 0)
						saymsg(String.Format("I bet {0:0,0}.", (double)amount), player.Mobile, false);
					else
						saymsg(String.Format("I raise by {0:0,0}.", (double)amount), player.Mobile, false);
				Bet(player, realamount);
			}
			return true;
		}
예제 #4
0
        public BettingGump(PokerDealer dealer, PokerPlayer player, bool gump) : base(400, 385)
        {
            m_Dealer = dealer;
            m_Player = player;

            Closable = false;
            Disposable = false;
            Dragable = true;
            Resizable = false;

            if (m_Dealer == null || m_Player == null)
                return;

            AddPage(0);
            AddBackground(120, 95, 200, 118, 9270);
            AddBackground(228, 175, 75, 20, 9300);
            AddAlphaRegion(125, 100, 190, 108);
            AddButton(225, 145, 247, 248, 4, GumpButtonType.Reply, 0);

            AddRadio(135, 110, 9720, 9723, false, 1);
            if (m_Dealer.HighestBet == player.RoundBet)
                AddLabel(170, 115, 1071, "Check");
            else if (player.Bankroll > m_Dealer.HighestBet - player.RoundBet)
            {
                AddLabel(170, 115, 1071, "Call");
                AddLabel(230, 115, 50, String.Format("{0:0,0}", (double)(m_Dealer.HighestBet - player.RoundBet)));
            }
            else
                AddLabel(170, 115, 50, "All-in");

            AddRadio(135, 140, 9720, 9723, false, 2);
            AddLabel(170, 145, 1071, "Fold");

            if (gump)
            {
                AddRadio(135, 170, 9720, 9723, true, 3);
                AddTextEntry(230, 175, 102, 20, 50, 5, String.Format("{0}", (double)(m_Dealer.BlindSmall * 2)));
            }
            else
                AddButton(135, 170, 9720, 9723, 5, GumpButtonType.Reply, 0);

            if (m_Dealer.HighestBet == 0)
                AddLabel(170, 175, 1071, "Bet");
            else
                AddLabel(170, 175, 1071, "Raise");

        }
		public void KickPlayer(PokerPlayer player)
		{
			for (int i = 0; i < Players.Length; i++)
				if (player == (PokerPlayer)Players[i])
				{
					if (player.Status >= Status.Playing && m_GameProgress > PokerProgress.None && m_GameProgress < PokerProgress.End)
						ActionTaken(player, PokerAction.Fold);

					if (player.Status == Status.GettingGold)
						player.EndGetGold();

					if (player.Bankroll == 0)
						player.Mobile.SendMessage("Thou'rt leaving the poker table broke.");
					else if (PTActive || m_DealerSetup == DealerSetup.FinalTable)
					{
						player.Mobile.SendMessage("No winnings have been deposited as you left during a tournament.");
						player.Bankroll = 0;
					}
					else
					{
						switch (m_DealerAccept)
						{
							case DealerAccept.GoldOnly:
								Payout(player, player.Bankroll);
								player.Bankroll = 0;
								player.Mobile.PlaySound(0x32);
								player.Mobile.SendMessage("Your winnings have been deposited in your bank box.");
								break;
							case DealerAccept.LowRollerTicketsOnly:
								player.Mobile.SendMessage("Your low-roller poker ticket has been placed in your backpack.");
								player.Mobile.Backpack.DropItem(new PokerLowRollerTicket());
								break;
							case DealerAccept.HighRollerTicketsOnly:
								player.Mobile.SendMessage("Your high-roller poker ticket has been placed in your backpack.");
								player.Mobile.Backpack.DropItem(new PokerHighRollerTicket());
								break;
						}
					}
					player.Mobile.MoveToWorld(m_ExitPoint, Map);
					CloseAllGumps(player.Mobile);
					Players[i] = null;
					return;
				}
		}
		private void AddWinnerAmount(ArrayList list, PokerPlayer player, int amount)
		{
			foreach (WinnerEntry entry in list)
				if (entry.m_Player == player)
				{
					entry.m_Amount += amount;
					return;
				}
			list.Add(new WinnerEntry(player, amount));
		}
		public void VerifyJoin(Mobile from, int buyin, bool check, bool ticket)
		{
			if (check)
				if (!CanJoin(from))
					return;

			int index = GetSitLoc();
			if (index == -1)
				from.SendMessage(33, "There are no open seats. Try to join the poker table later.");
			else
			{
				if (Players[index] == null)
					Players[index] = new PokerPlayer(from);
				else
					return;
				if (m_DealerAccept == DealerAccept.GoldOnly && !ticket)
				{
					Banker.Withdraw(from, buyin);
					m_TotalGoldDrained += (buyin * DrainFromBuyIn) / 100;
				}
				Players[index].Bankroll = buyin - ((buyin * DrainFromBuyIn) / 100);
				from.SendMessage("Thou'rt taking a place at the poker table with {0:0,0}gp.", (double)buyin);
				IMount mount = from.Mount;
				if (mount != null)
					mount.Rider = null;
				if (from.Spell != null)
					from.Spell = null;
				from.RevealingAction();
				from.MoveToWorld(m_Seat[index], Map);
				from.CantWalk = true;
				Players[index].Status = Status.WaitingForRound;
				m_PlayerAmount++;
				RefreshGump();
				if (m_DealerSetup == DealerSetup.Regular && ReadyPlayers.Length >= 2 && m_GameProgress == PokerProgress.None)
					PrepareForRound();
				else if (m_DealerSetup > DealerSetup.Regular && ReadyPlayers.Length == MaxPlayers && m_GameProgress == PokerProgress.None)
				{
					PTActive = true;
					m_memblind = BlindSmall;
					m_RoundRaise = 0;

					AwardList.Clear();
					m_TotalMoneyAtStart = 0;
					for (int i = 0; i < Players.Length; ++i)
						if (Players[i] != null)
							m_TotalMoneyAtStart += Players[i].Bankroll;

					Say("Let's play poker!");
					if (m_DealerSetup == DealerSetup.FinalTable)
						Say("The total amount of chips at the final table is {0:0,0}gp", (double)m_TotalMoneyAtStart);
					PlaySound(491);
					PrepareForRound();
				}
			}
		}
		public void ActionTaken(PokerPlayer player, PokerAction action, bool forced)
		{
			ActionTaken(player, action, 0, forced);
		}
		public void ActionTaken(PokerPlayer player, PokerAction action, int val)
		{
			ActionTaken(player, action, val, false);
		}
예제 #10
0
		public void SendBettingGump(PokerPlayer player, bool gump)
		{
			if (GameProgress > PokerProgress.None && GameProgress < PokerProgress.End)
				if (player.AutoFold)
					ActionTaken(player, PokerAction.Fold);
				else
					player.Mobile.SendGump(new BettingGump(this, player, gump));
		}
예제 #11
0
		public void ActionTaken(PokerPlayer player, PokerAction action)
		{
			ActionTaken(player, action, 0);
		}
예제 #12
0
		public void StartGettingGold(PokerPlayer player)
		{
		}
예제 #13
0
		public void ConfirmedPayment(PokerPlayer player, int gold)
		{
			if (player != null)
			{
				player.EndGetGold();
				player.Bankroll = gold;
				player.Status = Status.WaitingForRound;
			}
			RefreshGump();
			if (ReadyPlayers.Length >= 2 && m_GameProgress == PokerProgress.None)
				PrepareForRound();
		}
예제 #14
0
		public void Payout(PokerPlayer player, int bankroll)
		{
			if (player.Mobile == null)
				return;

			while (bankroll > 1000000)
			{
				player.Mobile.BankBox.DropItem(new BankCheck(1000000));
				bankroll -= 1000000;
			}
			if (bankroll > 5000)
				player.Mobile.BankBox.DropItem(new BankCheck(bankroll));
			else if (bankroll > 0)
				player.Mobile.BankBox.DropItem(new Gold(bankroll));
		}
예제 #15
0
		public void Bet(PokerPlayer player, int amount)
		{
			player.RoundBet += amount;
			player.TotalBet += amount;
			player.Bankroll -= amount;
			if (player.RoundBet > m_HighestBet)
				m_HighestBet = player.RoundBet;
			m_PotWorth += amount;
		}
예제 #16
0
		public void ActionTaken(PokerPlayer player, PokerAction action, int val, bool forced)
		{
			if (!forced)
				player.EndAction();

			if (GameProgress == PokerProgress.None || GameProgress == PokerProgress.End || Players[m_PlayerTurn] != player && !forced)
				return;

			bool done = false;
			switch (action)
			{
				case PokerAction.Check:
					{
						done = Check(player);
						break;
					}
				case PokerAction.Fold:
					{
						done = Fold(player);
						break;
					}
				case PokerAction.Raise:
					{
						done = Raise(player, val);
						break;
					}
				case PokerAction.Call:
					{
						done = Call(player);
						break;
					}
				default:
					{
						player.Mobile.SendMessage(33, "Invalid action.");
						SendBettingGump(Players[m_PlayerTurn], false);
						return;
					}
			}
			if (done)
				CalculateAction();
		}
예제 #17
0
			public WinnerEntry(PokerPlayer player, int amount)
			{
				m_Player = player;
				m_Amount = amount;
			}
예제 #18
0
		public bool Check(PokerPlayer player)
		{
			m_MovesSinceDeal++;
			saymsg(String.Format("Check."), player.Mobile, false);
			return true;
		}
예제 #19
0
		public PokerPlayer[] PlayersWithStatus(Status status)
		{
			ArrayList list = new ArrayList();
			for (int i = 0; i < Players.Length; i++)
			{
				if (Players[i] != null && Players[i].Status == status)
					list.Add(Players[i]);
			}
			PokerPlayer[] players = new PokerPlayer[list.Count];
			for (int i = 0; i < list.Count; i++)
				players[i] = (PokerPlayer)list[i];
			return players;
		}
예제 #20
0
		public bool Call(PokerPlayer player)
		{
			int amount = m_HighestBet - player.RoundBet;
			if (player.Bankroll <= amount)
				AllIn(player, true, false);
			else
			{
				m_MovesSinceDeal++;
				saymsg(String.Format("I call."), player.Mobile, false);
				Bet(player, amount);
			}
			return true;
		}
예제 #21
0
        public GetGoldGump(PokerDealer dealer, PokerPlayer player) : base(150, 150)
        {
            m_Dealer = dealer;
            m_Player = player;

            if (m_Dealer == null || m_Player == null)
                return;

            Closable = true;
            Disposable = false;
            Dragable = true;
            Resizable = false;

            AddPage(0);
            AddBackground(0, 0, 300, 160, 9270);
            AddBackground(113, 122, 100, 20, 9300);
            AddAlphaRegion(10, 10, 280, 140);
            AddLabel(116, 20, 1071, "Need more chips?");
            AddLabel(18, 36, 1071, "===========================================");
            AddLabel(22, 50, 1071, "Your chips:");
            AddLabel(22, 74, 1071, "Max buy-in:");
            AddLabel(22, 98, 1071, "Bank balance:");
            AddLabel(22, 122, 1071, "Buy-in amount:");
            if (m_Player.Bankroll == 0)
                AddLabel(115, 50, 50, "0");
            else
                AddLabel(115, 50, 50, String.Format("{0:0,0}", (double)m_Player.Bankroll));
            AddLabel(115, 74, 50, String.Format("{0:0,0}", (double)m_Dealer.BuyinMaximum));
            int balance = Server.Mobiles.Banker.GetBalance(m_Player.Mobile);
            AddLabel(115, 98, balance < m_Dealer.BuyinMinimum - m_Player.Bankroll ? 33 : balance < m_Dealer.BuyinMinimum * 2 ? 50 : 1071, String.Format("{0:0,0}", (double)balance));
            AddTextEntry(115, 122, 120, 20, 50, 0, String.Format("{0}", m_Dealer.BuyinMinimum - m_Player.Bankroll));
            AddButton(220, 90, 247, 248, 1, GumpButtonType.Reply, 0);
            AddButton(220, 120, 243, 241, 2, GumpButtonType.Reply, 0);
        }
예제 #22
0
		public bool Fold(PokerPlayer player)
		{
			saymsg(String.Format("I fold."), player.Mobile, false);
			player.Status = Status.WaitingForRound;
			player.RoundBet = 0;
			return true;
		}
예제 #23
0
 public GetGoldTimer(PokerDealer dealer, PokerPlayer player) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
 {
     m_Dealer = dealer;
     m_Player = player;
     m_TimeLeft = m_Dealer.Timer_GetGold;
     Start();
 }
예제 #24
0
		public int GetIndex(PokerPlayer player)
		{
			for (int i = 0; i < Players.Length; i++)
				if (player == (PokerPlayer)Players[i])
					return i;
			return -1;
		}