public PlayerStructure( PokerGame game )
		{
			m_Players = new List<PokerPlayer>();
			m_Round = new List<PokerPlayer>();
			m_Turn = new List<PokerPlayer>();
			m_Game = game;
		}
		public PlayerStructure(PokerGame game)
		{
			Game = game;

			Players = new List<PokerPlayer>();
			Round = new List<PokerPlayer>();
			Turn = new List<PokerPlayer>();
		}
Beispiel #3
0
		public void ClearGame()
		{
			m_Bet = 0;
			m_RoundGold = 0;
			m_RoundBet = 0;
			m_HoleCards.Clear();
			m_Game = null;
			CloseAllGumps();
			m_Action = PlayerAction.None;
			m_IsAllIn = false;
			m_Forced = false;
			m_LonePlayer = false;
		}
Beispiel #4
0
 public void ClearGame()
 {
     m_Bet       = 0;
     m_RoundGold = 0;
     m_RoundBet  = 0;
     m_HoleCards.Clear();
     m_Game = null;
     CloseAllGumps();
     m_Action     = PlayerAction.None;
     m_IsAllIn    = false;
     m_Forced     = false;
     m_LonePlayer = false;
 }
		public PokerBetGump(PokerGame game, PokerPlayer player, bool canCall)
			: base(460, 425)
		{
			m_CanCall = canCall;
			m_Game = game;
			m_Player = player;

			Closable = false;
			Disposable = false;
			Dragable = true;
			Resizable = false;
			AddPage(0);

			//this.AddImageTiled( 0, 0, 170, 165, 2624 );
			//this.AddImageTiled( 2, 2, 166, 161, 3604 );
			//this.AddImageTiled( 4, 4, 162, 157, 3504 );
			//this.AddImageTiled( 6, 6, 158, 153, 3604 );
			//this.AddAlphaRegion( 6, 6, 158, 153 );
			AddBackground(0, 0, 200, 130, 9270);

            AddRadio(14, 20, 9727, 9730, true, canCall && (m_Game.CurrentBet - m_Player.RoundBet) > 0 ? (int)Buttons.Call : (int)Buttons.Check);
			AddRadio(14, 50, 9727, 9730, false, (int)Buttons.Fold);
			AddRadio(14, 80, 9727, 9730, false, canCall ? (int)Buttons.Raise : (int)Buttons.Bet);

			AddHtml(50, 24, 60, 45, Color(canCall && (m_Game.CurrentBet - m_Player.RoundBet) > 0 ? "Call" : "Check", COLOR_WHITE), false, false);

            if (canCall && (m_Game.CurrentBet - m_Player.RoundBet) > 0)
            {
                AddHtml(
                    105,
                    24,
                    60,
                    22,
                    Color(
                            m_Game.CurrentBet - player.RoundBet >= player.Currency
                                ? "all-in"
                                : String.Format("{0:#,0}", m_Game.CurrentBet - m_Player.RoundBet),
                        COLOR_GREEN),
                    false,
                    false);
            }

            AddHtml(50, 54, 60, 45, Color("Fold", COLOR_WHITE), false, false);
            AddHtml(50, 84, 60, 45, Color(canCall ? "Raise" : "Bet", COLOR_WHITE), false, false);
            AddTextEntry(105, 84, 60, 22, 455, (int)Buttons.txtBet, game.NextRaise < game.Dealer.BigBlind ? game.Dealer.BigBlind.ToString(CultureInfo.InvariantCulture) : game.NextRaise.ToString());

			AddButton(104, 53, 247, 248, (int)Buttons.Okay, GumpButtonType.Reply, 0);
		}
Beispiel #6
0
        public PokerRebuy(Mobile from, PokerGame game)
            : base(50, 50)
        {
            m_Game = game;
            PokerPlayer pokerplayer = m_Game.GetPlayer(from);

            AddBackground(0, 0, 400, 300, 9270);
            AddAlphaRegion(92, 10, 215, 24);
            AddHtml(14, 14, 371, 24, String.Format("<CENTER><BIG><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></BIG></CENTER>", "Rebuy in to the Poker Game?"), false, false);
            AddImageTiled(20, 34, 347, 2, 9277);
            AddImageTiled(34, 36, 347, 2, 9277);

            AddHtml(20, 41, 365, 130, String.Format("<LEFT><BASEFONT COLOR=#F7D358>{0}</BASEFONT><</LEFT>", "Are you sure you want to rebuy in to the poke game? Your new buy-in + your current chips must be greater than or equal to the minimum buy-in and cannot exceed the maximum buy-in.  Please note that this is an easy way for irresponsible people to lose money.  No gold will be refunded."), false, false);
            AddImageTiled(20, 150, 347, 2, 9277);
            AddImageTiled(34, 152, 347, 2, 9277);

            AddHtml(53, 160, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Min Buy-In:"), false, false);
            AddLabel(125, 160, 1258, m_Game.Dealer.MinBuyIn.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(50, 180, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Max Buy-In:"), false, false);
            AddLabel(125, 180, 1258, m_Game.Dealer.MaxBuyIn.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(40, 200, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Bank Balance:"), false, false);

            int balance = Banker.GetBalance(from, m_Game.TypeOfCurrency);

            AddLabel(125, 200, balance + pokerplayer.Currency >= m_Game.Dealer.MinBuyIn ? 63 : 137, balance.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));

            AddHtml(34, 220, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Current Chips:"), false, false);
            AddLabel(125, 220, 1258, pokerplayer.Currency.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));

            AddHtml(32, 240, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Pending Credit:"), false, false);
            AddLabel(125, 240, 1258, pokerplayer.PendingCredit.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));

            AddHtml(31, 260, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Buy-In Amount:"), false, false);

            AddImageTiled(125, 260, 80, 19, 0xBBC);
            AddAlphaRegion(125, 260, 80, 19);
            if (pokerplayer.Currency + pokerplayer.PendingCredit > m_Game.Dealer.MaxBuyIn)
            {
                AddTextEntry(128, 260, 77, 19, 99, (int)Handlers.txtBuyInAmount, 0.ToString());
            }
            else
            {
                AddTextEntry(128, 260, 77, 19, 99, (int)Handlers.txtBuyInAmount, (m_Game.Dealer.MaxBuyIn - pokerplayer.Currency - pokerplayer.PendingCredit).ToString());
            }

            AddButton(250, 260, 247, 248, (int)Handlers.btnOkay, GumpButtonType.Reply, 0);
            AddButton(320, 260, 242, 241, (int)Handlers.btnCancel, GumpButtonType.Reply, 0);
        }
Beispiel #7
0
        public PokerBetGump(PokerGame game, PokerPlayer player, bool canCall)
            : base(460, 425)
        {
            m_CanCall = canCall;
            m_Game    = game;
            m_Player  = player;

            Closable   = false;
            Disposable = false;
            Dragable   = true;
            Resizable  = false;
            AddPage(0);

            //this.AddImageTiled( 0, 0, 170, 165, 2624 );
            //this.AddImageTiled( 2, 2, 166, 161, 3604 );
            //this.AddImageTiled( 4, 4, 162, 157, 3504 );
            //this.AddImageTiled( 6, 6, 158, 153, 3604 );
            //this.AddAlphaRegion( 6, 6, 158, 153 );
            AddBackground(0, 0, 200, 130, 9270);

            AddRadio(14, 20, 9727, 9730, true, canCall && (m_Game.CurrentBet - m_Player.RoundBet) > 0 ? (int)Buttons.Call : (int)Buttons.Check);
            AddRadio(14, 50, 9727, 9730, false, (int)Buttons.Fold);
            AddRadio(14, 80, 9727, 9730, false, canCall ? (int)Buttons.Raise : (int)Buttons.Bet);

            AddHtml(50, 24, 60, 45, Color(canCall && (m_Game.CurrentBet - m_Player.RoundBet) > 0 ? "Call" : "Check", COLOR_WHITE), false, false);

            if (canCall && (m_Game.CurrentBet - m_Player.RoundBet) > 0)
            {
                AddHtml(
                    105,
                    24,
                    60,
                    22,
                    Color(
                        m_Game.CurrentBet - player.RoundBet >= player.Currency
                                ? "all-in"
                                : String.Format("{0:#,0}", m_Game.CurrentBet - m_Player.RoundBet),
                        COLOR_GREEN),
                    false,
                    false);
            }

            AddHtml(50, 54, 60, 45, Color("Fold", COLOR_WHITE), false, false);
            AddHtml(50, 84, 60, 45, Color(canCall ? "Raise" : "Bet", COLOR_WHITE), false, false);
            AddTextEntry(105, 84, 60, 22, 455, (int)Buttons.txtBet, game.NextRaise < game.Dealer.BigBlind ? game.Dealer.BigBlind.ToString(CultureInfo.InvariantCulture) : game.NextRaise.ToString());

            AddButton(104, 53, 247, 248, (int)Buttons.Okay, GumpButtonType.Reply, 0);
        }
Beispiel #8
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			switch (version)
			{
                case 2:
			    {
			        TotalRake = reader.ReadInt();
			    }
                    goto case 1;
                case 1:
			    {
			        TableName = reader.ReadString();
			        IsDonation = reader.ReadBool();
			    }
			        goto case 0;
				case 0:
					{
						_MActive = reader.ReadBool();
						SmallBlind = reader.ReadInt();
						BigBlind = reader.ReadInt();
						MinBuyIn = reader.ReadInt();
						MaxBuyIn = reader.ReadInt();
						ExitLocation = reader.ReadPoint3D();
						ExitMap = reader.ReadMap();
						_MRake = reader.ReadDouble();
						RakeMax = reader.ReadInt();
						_MMaxPlayers = reader.ReadInt();

						int count = reader.ReadInt();
						Seats = new List<Point3D>();

						for (int i = 0; i < count; ++i)
						{
							Seats.Add(reader.ReadPoint3D());
						}
					}
					break;
			}

			Game = new PokerGame(this);
		}
Beispiel #9
0
        public PokerRebuy(Mobile from, PokerGame game)
			: base(50, 50)
		{
			m_Game = game;
            PokerPlayer pokerplayer = m_Game.GetPlayer(from);
            AddBackground(0, 0, 400, 300, 9270);
            AddAlphaRegion(92, 10, 215, 24);
            AddHtml(14, 14, 371, 24, String.Format("<CENTER><BIG><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></BIG></CENTER>", "Rebuy in to the Poker Game?"), false, false);
            AddImageTiled(20, 34, 347, 2, 9277);
            AddImageTiled(34, 36, 347, 2, 9277);

            AddHtml(20, 41, 365, 130, String.Format("<LEFT><BASEFONT COLOR=#F7D358>{0}</BASEFONT><</LEFT>", "Are you sure you want to rebuy in to the poke game? Your new buy-in + your current chips must be greater than or equal to the minimum buy-in and cannot exceed the maximum buy-in.  Please note that this is an easy way for irresponsible people to lose money.  No gold will be refunded."), false, false);
            AddImageTiled(20, 150, 347, 2, 9277);
            AddImageTiled(34, 152, 347, 2, 9277);

            AddHtml(53, 160, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Min Buy-In:"), false, false);
            AddLabel(125, 160, 1258, m_Game.Dealer.MinBuyIn.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(50, 180, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Max Buy-In:"), false, false);
            AddLabel(125, 180, 1258, m_Game.Dealer.MaxBuyIn.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(40, 200, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Bank Balance:"), false, false);

            int balance = Banker.GetBalance(from, m_Game.TypeOfCurrency);

            AddLabel(125, 200, balance + pokerplayer.Currency >= m_Game.Dealer.MinBuyIn ? 63 : 137, balance.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));

            AddHtml(34, 220, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Current Chips:"), false, false);
            AddLabel(125, 220, 1258, pokerplayer.Currency.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));

            AddHtml(32, 240, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Pending Credit:"), false, false);
            AddLabel(125, 240, 1258, pokerplayer.PendingCredit.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));

            AddHtml(31, 260, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Buy-In Amount:"), false, false);

            AddImageTiled(125, 260, 80, 19, 0xBBC);
            AddAlphaRegion(125, 260, 80, 19);
            if (pokerplayer.Currency + pokerplayer.PendingCredit > m_Game.Dealer.MaxBuyIn)
                AddTextEntry(128, 260, 77, 19, 99, (int)Handlers.txtBuyInAmount, 0.ToString());
            else
            {
                AddTextEntry(128, 260, 77, 19, 99, (int)Handlers.txtBuyInAmount, (m_Game.Dealer.MaxBuyIn - pokerplayer.Currency - pokerplayer.PendingCredit).ToString());                
            }

            AddButton(250, 260, 247, 248, (int)Handlers.btnOkay, GumpButtonType.Reply, 0);
            AddButton(320, 260, 242, 241, (int)Handlers.btnCancel, GumpButtonType.Reply, 0);
		}
		public PokerLeaveGump(PokerGame game)
			: base(50, 50)
		{
			_MGame = game;

            AddBackground(0, 0, 400, 165, 9270);
            AddAlphaRegion(115, 10, 165, 24);
            AddHtml(14, 14, 371, 24, String.Format("<CENTER><BIG><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></BIG></CENTER>", "Stand Up and Leave?"), false, false);
            AddImageTiled(20, 34, 347, 2, 9277);
            AddImageTiled(34, 36, 347, 2, 9277);

            AddHtml(20, 41, 365, 130, String.Format("<LEFT><BASEFONT COLOR=#F7D358>{0}</BASEFONT><</LEFT>", "Are you sure you want to cash-in and leave the poker table? You will play the current hand to completion and then any winnings will be deposited in your bank box. You will be unable to join another poker table for 60 seconds."), false, false);
            AddImageTiled(20, 115, 347, 2, 9277);
            AddImageTiled(34, 117, 347, 2, 9277);

            AddButton(250, 125, 247, 248, (int)Handlers.BtnOkay, GumpButtonType.Reply, 0);
            AddButton(320, 125, 242, 241, (int)Handlers.None, GumpButtonType.Reply, 0);
		}
Beispiel #11
0
        public PokerLeaveGump(PokerGame game)
            : base(50, 50)
        {
            _MGame = game;

            AddBackground(0, 0, 400, 165, 9270);
            AddAlphaRegion(115, 10, 165, 24);
            AddHtml(14, 14, 371, 24, String.Format("<CENTER><BIG><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></BIG></CENTER>", "Stand Up and Leave?"), false, false);
            AddImageTiled(20, 34, 347, 2, 9277);
            AddImageTiled(34, 36, 347, 2, 9277);

            AddHtml(20, 41, 365, 130, String.Format("<LEFT><BASEFONT COLOR=#F7D358>{0}</BASEFONT><</LEFT>", "Are you sure you want to cash-in and leave the poker table? You will play the current hand to completion and then any winnings will be deposited in your bank box. You will be unable to join another poker table for 60 seconds."), false, false);
            AddImageTiled(20, 115, 347, 2, 9277);
            AddImageTiled(34, 117, 347, 2, 9277);

            AddButton(250, 125, 247, 248, (int)Handlers.BtnOkay, GumpButtonType.Reply, 0);
            AddButton(320, 125, 242, 241, (int)Handlers.None, GumpButtonType.Reply, 0);
        }
		public PokerTableGump(PokerGame game, PokerPlayer player)
			: base(0, 0)
		{
			m_Game = game;
			m_Player = player;

			Closable = false;
			Disposable = true;
			Dragable = true;
			Resizable = false;
			AddPage(0);

			if (m_Game.State > PokerGameState.PreFlop)
			{
				DrawCards();
			}

			DrawPlayers();
		}
Beispiel #13
0
        public PokerTableGump(PokerGame game, PokerPlayer player)
            : base(0, 0)
        {
            m_Game   = game;
            m_Player = player;

            Closable   = false;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;
            AddPage(0);

            if (m_Game.State > PokerGameState.PreFlop)
            {
                DrawCards();
            }

            DrawPlayers();
        }
		public PokerJoinGump(Mobile from, PokerGame game)
			: base(50, 50)
		{
			m_Game = game;

            AddBackground(0, 0, 400, 285, 9270);
            AddAlphaRegion(135, 10, 125, 24);
            AddHtml(14, 14, 371, 24, String.Format("<CENTER><BIG><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></BIG></CENTER>", "Join Poker Table"), false, false);
            AddImageTiled(20, 34, 347, 2, 9277);
            AddImageTiled(34, 36, 347, 2, 9277);

            AddHtml(20, 41, 365, 130, String.Format("<LEFT><BASEFONT COLOR=#F7D358>{0}</BASEFONT><</LEFT>", "You are asking to join a poker table. If you are unfamiliar with the rules of Texas Hold'em, or are uneasy about " +
                                                                           "losing " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold") + ", then you are advised against proceeding. Only specify a buy-in amount that you would be comfortable losing--all bets are made with real gold and there are no refunds."), false, false);
		    if (!m_Game.Dealer.IsDonation)
		    {
		        AddImageTiled(20, 135, 347, 2, 9277);
		        AddImageTiled(34, 137, 347, 2, 9277);
		    }

		    AddHtml(52, 150, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Small Blind:"), false, false);
            AddLabel(125, 150, 1258, m_Game.Dealer.SmallBlind.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(64, 170, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Big Blind:"), false, false);
            AddLabel(125, 170, 1258, m_Game.Dealer.BigBlind.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(53, 190, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Min Buy-In:"), false, false);
            AddLabel(125, 190, 1258, m_Game.Dealer.MinBuyIn.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(50, 210, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Max Buy-In:"), false, false);
            AddLabel(125, 210, 1258, m_Game.Dealer.MaxBuyIn.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(40, 230, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Bank Balance:"), false, false);

            int balance = Banker.GetBalance(from, m_Game.TypeOfCurrency);

            AddLabel(125, 230, balance >= m_Game.Dealer.MinBuyIn ? 63 : 137, balance.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));

            AddHtml(31, 250, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Buy-In Amount:"), false, false);

            AddImageTiled(125, 250, 80, 19, 0xBBC);
            AddAlphaRegion(125, 250, 80, 19);
            AddTextEntry(128, 250, 77, 19, 99, (int)Handlers.txtBuyInAmount,m_Game.Dealer.MinBuyIn.ToString());

            AddButton(250, 250, 247, 248, (int)Handlers.btnOkay, GumpButtonType.Reply, 0);
            AddButton(320, 250, 242, 241, (int)Handlers.btnCancel, GumpButtonType.Reply, 0);
		}
Beispiel #15
0
        public PokerJoinGump(Mobile from, PokerGame game)
            : base(50, 50)
        {
            m_Game = game;

            AddBackground(0, 0, 400, 285, 9270);
            AddAlphaRegion(135, 10, 125, 24);
            AddHtml(14, 14, 371, 24, String.Format("<CENTER><BIG><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></BIG></CENTER>", "Join Poker Table"), false, false);
            AddImageTiled(20, 34, 347, 2, 9277);
            AddImageTiled(34, 36, 347, 2, 9277);

            AddHtml(20, 41, 365, 130, String.Format("<LEFT><BASEFONT COLOR=#F7D358>{0}</BASEFONT><</LEFT>", "You are asking to join a poker table. If you are unfamiliar with the rules of Texas Hold'em, or are uneasy about " +
                                                    "losing " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold") + ", then you are advised against proceeding. Only specify a buy-in amount that you would be comfortable losing--all bets are made with real gold and there are no refunds."), false, false);
            if (!m_Game.Dealer.IsDonation)
            {
                AddImageTiled(20, 135, 347, 2, 9277);
                AddImageTiled(34, 137, 347, 2, 9277);
            }

            AddHtml(52, 150, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Small Blind:"), false, false);
            AddLabel(125, 150, 1258, m_Game.Dealer.SmallBlind.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(64, 170, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Big Blind:"), false, false);
            AddLabel(125, 170, 1258, m_Game.Dealer.BigBlind.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(53, 190, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Min Buy-In:"), false, false);
            AddLabel(125, 190, 1258, m_Game.Dealer.MinBuyIn.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(50, 210, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Max Buy-In:"), false, false);
            AddLabel(125, 210, 1258, m_Game.Dealer.MaxBuyIn.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));
            AddHtml(40, 230, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Bank Balance:"), false, false);

            int balance = Banker.GetBalance(from, m_Game.TypeOfCurrency);

            AddLabel(125, 230, balance >= m_Game.Dealer.MinBuyIn ? 63 : 137, balance.ToString("#,0") + " " + (m_Game.Dealer.IsDonation ? "donation coins" : "gold"));

            AddHtml(31, 250, 100, 25, String.Format("<LEFT><BASEFONT COLOR=#FFFFFF>{0}</BASEFONT></LEFT>", "Buy-In Amount:"), false, false);

            AddImageTiled(125, 250, 80, 19, 0xBBC);
            AddAlphaRegion(125, 250, 80, 19);
            AddTextEntry(128, 250, 77, 19, 99, (int)Handlers.txtBuyInAmount, m_Game.Dealer.MinBuyIn.ToString());

            AddButton(250, 250, 247, 248, (int)Handlers.btnOkay, GumpButtonType.Reply, 0);
            AddButton(320, 250, 242, 241, (int)Handlers.btnCancel, GumpButtonType.Reply, 0);
        }
		public PokerTableGump( PokerGame game, PokerPlayer player )
			: base( 0, 0 )
		{
			m_Game = game;
			m_Player = player;

			this.Closable = true;
			this.Disposable = true;
			this.Dragable = true;
			this.Resizable = false;
			this.AddPage( 0 );

			if ( m_Game.State > PokerGameState.PreFlop )
				DrawCards();

			DrawPlayers();

			if ( m_Game.State > PokerGameState.Inactive )
				this.AddLabel( 350, 340, 148, "Pot: " + m_Game.CommunityGold.ToString( "#,###" ) );
		}
		public PokerTableGump( PokerGame game, PokerPlayer player )
			: base( 0, 0 )
		{
			m_Game = game;
			m_Player = player;

			this.Closable = true;
			this.Disposable = true;
			this.Dragable = true;
			this.Resizable = false;
			this.AddPage( 0 );

			if ( m_Game.State > PokerGameState.PreFlop )
				DrawCards();

			DrawPlayers();

			if ( m_Game.State > PokerGameState.Inactive )
				this.AddLabel( 350, 340, 148, "Pot: " + m_Game.CommunityGold.ToString( "#,###" ) );
		}
Beispiel #18
0
        public PokerBetGump(PokerGame game, PokerPlayer player, bool canCall)
            : base(460, 400)
        {
            m_CanCall = canCall;
            m_Game    = game;
            m_Player  = player;

            this.Closable   = false;
            this.Disposable = false;
            this.Dragable   = true;
            this.Resizable  = false;
            this.AddPage(0);

            //this.AddImageTiled( 0, 0, 170, 165, 2624 );
            //this.AddImageTiled( 2, 2, 166, 161, 3604 );
            //this.AddImageTiled( 4, 4, 162, 157, 3504 );
            //this.AddImageTiled( 6, 6, 158, 153, 3604 );
            //this.AddAlphaRegion( 6, 6, 158, 153 );
            this.AddBackground(0, 0, 160, 155, 9270);

            this.AddRadio(14, 10, 9727, 9730, true, (canCall ? (int)Buttons.Call : (int)Buttons.Check));
            this.AddRadio(14, 40, 9727, 9730, false, (int)Buttons.Fold);
            this.AddRadio(14, 70, 9727, 9730, false, (int)Buttons.AllIn);
            this.AddRadio(14, 100, 9727, 9730, false, (canCall ? (int)Buttons.Raise : (int)Buttons.Bet));

            this.AddHtml(45, 14, 60, 45, Color(canCall ? "Call" : "Check", COLOR_WHITE), false, false);

            if (canCall)
            {
                this.AddHtml(75, 14, 60, 22, Color(Center((m_Game.CurrentBet - player.RoundBet >= player.Gold ? "all-in" : String.Format("{0}", (m_Game.CurrentBet - m_Player.RoundBet).ToString("#,###")))), COLOR_GREEN), false, false);
            }

            this.AddHtml(45, 44, 60, 45, Color("Fold", COLOR_WHITE), false, false);
            this.AddHtml(45, 74, 60, 45, Color("All In", COLOR_WHITE), false, false);
            this.AddHtml(45, 104, 60, 45, Color(canCall ? "Raise" : "Bet", COLOR_WHITE), false, false);
            this.AddTextEntry(85, 104, 60, 22, 455, (int)Buttons.txtBet, game.Dealer.BigBlind.ToString());

            this.AddButton(95, 132, 247, 248, (int)Buttons.Okay, GumpButtonType.Reply, 0);
        }
Beispiel #19
0
        public PokerLeaveGump(Mobile from, PokerGame game)
            : base(50, 50)
        {
            m_Game = game;

            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;
            this.AddPage(0);
            this.AddImageTiled(18, 15, 350, 180, 9274);
            //this.AddAlphaRegion( 23, 20, 340, 170 );
            this.AddBackground(0, 0, 390, 200, 9270);
            this.AddLabel(133, 25, 28, @"Leave Poker Table");
            this.AddImageTiled(42, 47, 301, 3, 96);
            this.AddLabel(60, 62, 68, @"You are about to leave a game of Poker.");
            this.AddImage(33, 38, 95, 68);
            this.AddImage(342, 38, 97, 68);
            this.AddLabel(43, 80, 68, @"Are you sure you want to cash-out and leave the");
            this.AddLabel(48, 98, 68, @"table? You will auto fold, and any current bets");
            this.AddLabel(40, 116, 68, @"will be lost. Winnings will be deposited in your bank.");
            this.AddButton(163, 155, 247, 248, (int)Handlers.btnOkay, GumpButtonType.Reply, 0);
        }
Beispiel #20
0
		public PokerLeaveGump( Mobile from, PokerGame game )
			: base( 50, 50 )
		{
			m_Game = game;

			this.Closable = true;
			this.Disposable = true;
			this.Dragable = true;
			this.Resizable = false;
			this.AddPage( 0 );
			this.AddImageTiled( 18, 15, 350, 180, 9274 );
			//this.AddAlphaRegion( 23, 20, 340, 170 );
            this.AddBackground(0, 0, 390, 200, 9270);
			this.AddLabel( 133, 25, 28, @"Leave Poker Table" );
			this.AddImageTiled( 42, 47, 301, 3, 96 );
			this.AddLabel( 60, 62, 68, @"You are about to leave a game of Poker." );
			this.AddImage( 33, 38, 95, 68 );
			this.AddImage( 342, 38, 97, 68 );
			this.AddLabel( 43, 80, 68, @"Are you sure you want to cash-out and leave the" );
			this.AddLabel( 48, 98, 68, @"table? You will auto fold, and any current bets" );
			this.AddLabel( 40, 116, 68, @"will be lost. Winnings will be deposited in your bank." );
			this.AddButton( 163, 155, 247, 248, (int)Handlers.btnOkay, GumpButtonType.Reply, 0 );
		}
Beispiel #21
0
        public static void PokerKick_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            if (from == null)
            {
                return;
            }

            IPooledEnumerable eable = from.GetMobilesInRange(0);

            foreach (Mobile m in eable)
            {
                if (m is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m;

                    PokerGame game = pm.PokerGame;

                    if (game != null)
                    {
                        PokerPlayer player = game.GetPlayer(m);

                        if (player != null)
                        {
                            game.RemovePlayer(player);
                            from.SendMessage("They have been removed from the poker table");
                            return;
                        }
                    }
                }
            }

            eable.Free();

            from.SendMessage("No one found to kick from a poker table. Make sure you are standing on top of them.");
        }
Beispiel #22
0
		public PokerBetGump( PokerGame game, PokerPlayer player, bool canCall )
			: base( 460, 400 )
		{
			m_CanCall = canCall;
			m_Game = game;
			m_Player = player;

			this.Closable = false;
			this.Disposable = false;
			this.Dragable = true;
			this.Resizable = false;
			this.AddPage( 0 );

			//this.AddImageTiled( 0, 0, 170, 165, 2624 );
			//this.AddImageTiled( 2, 2, 166, 161, 3604 );
			//this.AddImageTiled( 4, 4, 162, 157, 3504 );
			//this.AddImageTiled( 6, 6, 158, 153, 3604 );
			//this.AddAlphaRegion( 6, 6, 158, 153 );
            this.AddBackground(0, 0, 160, 155, 9270);

			this.AddRadio( 14, 10, 9727, 9730, true, ( canCall ? (int)Buttons.Call : (int)Buttons.Check ) );
			this.AddRadio( 14, 40, 9727, 9730, false, (int)Buttons.Fold );
			this.AddRadio( 14, 70, 9727, 9730, false, (int)Buttons.AllIn );
			this.AddRadio( 14, 100, 9727, 9730, false, ( canCall ? (int)Buttons.Raise : (int)Buttons.Bet ) );

			this.AddHtml( 45, 14, 60, 45, Color( canCall ? "Call" : "Check", COLOR_WHITE ), false, false );

			if ( canCall )
				this.AddHtml( 75, 14, 60, 22, Color( Center( ( m_Game.CurrentBet - player.RoundBet >= player.Gold ? "all-in" : String.Format( "{0}", ( m_Game.CurrentBet - m_Player.RoundBet ).ToString( "#,###" ) ) ) ), COLOR_GREEN ), false, false );

			this.AddHtml( 45, 44, 60, 45, Color( "Fold", COLOR_WHITE ), false, false );
			this.AddHtml( 45, 74, 60, 45, Color( "All In", COLOR_WHITE ), false, false );
			this.AddHtml( 45, 104, 60, 45, Color( canCall ? "Raise" : "Bet", COLOR_WHITE ), false, false );
			this.AddTextEntry( 85, 104, 60, 22, 455, (int)Buttons.txtBet, game.Dealer.BigBlind.ToString() );

			this.AddButton( 95, 132, 247, 248, (int)Buttons.Okay, GumpButtonType.Reply, 0 );
		}
Beispiel #23
0
		private static void EventSink_Disconnected(DisconnectedEventArgs e)
		{
			Mobile from = e.Mobile;

			if (from == null)
			{
				return;
			}

			if (!(from is PlayerMobile))
			{
				return;
			}

			var pm = (PlayerMobile)from;

			PokerGame game = pm.PokerGame;

			if (game == null)
			{
				return;
			}

			PokerPlayer player = game.GetPlayer(from);

			if (player != null)
			{
			    Timer.DelayCall(TimeSpan.FromMinutes(1), () =>
			    {
			        if (!player.IsOnline())
			        {
			            player.RequestLeave = true;
			        }
			    });
			}
		}
Beispiel #24
0
        public PokerJoinGump(Mobile from, PokerGame game)
            : base(50, 50)
        {
            m_Game = game;

            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;
            this.AddPage(0);
            this.AddBackground(0, 0, 385, 393, 9270);
            this.AddImageTiled(18, 15, 350, 320, 9274);
            //this.AddAlphaRegion( 23, 19, 340, 310 );
            this.AddLabel(125, 10, 28, @"The Shard's Texas Hold-em");
            this.AddLabel(133, 25, 28, @" Join Poker Table");
            this.AddImageTiled(42, 47, 301, 3, 96);
            this.AddLabel(65, 62, 68, @"You are about to join a game of Poker.");
            this.AddImage(33, 38, 95, 68);
            this.AddImage(342, 38, 97, 68);
            this.AddLabel(52, 80, 68, @"All bets involve real gold and no refunds will be");
            this.AddLabel(54, 98, 68, @"given. If you feel uncomfortable losing gold or");
            this.AddLabel(40, 116, 68, @"are unfamiliar with the rules of Texas Hold'em, you");
            this.AddLabel(100, 134, 68, @"are advised against proceeding.");

            this.AddLabel(122, 161, 1149, @"Small Blind:");
            this.AddLabel(129, 181, 1149, @"Big Blind:");
            this.AddLabel(123, 201, 1149, @"Min Buy-In:");
            this.AddLabel(120, 221, 1149, @"Max Buy-In:");
            this.AddLabel(110, 241, 1149, @"Bank Balance:");
            this.AddLabel(101, 261, 1149, @"Buy-In Amount:");

            this.AddLabel(200, 161, 148, m_Game.Dealer.SmallBlind.ToString("#,###") + "gp");
            this.AddLabel(200, 181, 148, m_Game.Dealer.BigBlind.ToString("#,###") + "gp");
            this.AddLabel(200, 201, 148, m_Game.Dealer.MinBuyIn.ToString("#,###") + "gp");
            this.AddLabel(200, 221, 148, m_Game.Dealer.MaxBuyIn.ToString("#,###") + "gp");

            int balance    = Banker.GetBalance(from);
            int balancehue = 28;
            int layout     = 0;

            if (balance >= m_Game.Dealer.MinBuyIn)
            {
                balancehue = 266;
                layout     = 1;
            }

            this.AddLabel(200, 241, balancehue, balance.ToString("#,###") + "gp");

            if (layout == 0)
            {
                this.AddLabel(200, 261, 1149, "(not enough gold)");
                this.AddButton(163, 292, 242, 241, (int)Handlers.btnCancel, GumpButtonType.Reply, 0);
            }
            else if (layout == 1)
            {
                this.AddImageTiled(200, 261, 80, 19, 0xBBC);
                this.AddAlphaRegion(200, 261, 80, 19);
                this.AddTextEntry(203, 261, 77, 19, 68, (int)Handlers.txtBuyInAmount, m_Game.Dealer.MinBuyIn.ToString());
                this.AddButton(123, 292, 247, 248, (int)Handlers.btnOkay, GumpButtonType.Reply, 0);
                this.AddButton(200, 292, 242, 241, (int)Handlers.btnCancel, GumpButtonType.Reply, 0);
            }
        }
Beispiel #25
0
        public PokerDealer(int maxPlayers)
        {
            Blessed = true;
            Frozen = true;
            InitStats(100, 100, 100);

            Title = "the poker dealer";
            Hue = Utility.RandomSkinHue();
            NameHue = 0x35;

            if (this.Female = Utility.RandomBool())
            {
                this.Body = 0x191;
                this.Name = NameList.RandomName("female");
            }
            else
            {
                this.Body = 0x190;
                this.Name = NameList.RandomName("male");
            }

            Dress();

            MaxPlayers = maxPlayers;
            m_Seats = new List<Point3D>();
            m_Rake = 0.10;		//10% rake default
            m_RakeMax = 5000;	//5k maximum rake default
            m_Game = new PokerGame(this);
        }
Beispiel #26
0
		public PokerGameTimer( PokerGame game )
			: base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) )
		{
			m_Game = game;
			m_LastState = PokerGameState.Inactive;
			m_LastPlayer = null;
		}
Beispiel #27
0
		public PokerJoinGump( Mobile from, PokerGame game )
			: base( 50, 50 )
		{
			m_Game = game;

			this.Closable = true;
			this.Disposable = true;
			this.Dragable = true;
			this.Resizable = false;
			this.AddPage( 0 );
            this.AddBackground(0, 0, 385, 393, 9270);
			this.AddImageTiled( 18, 15, 350, 320, 9274 );
			//this.AddAlphaRegion( 23, 19, 340, 310 );
            this.AddLabel(125, 10, 28, @"The Shard's Texas Hold-em");
			this.AddLabel( 133, 25, 28, @" Join Poker Table" );
			this.AddImageTiled( 42, 47, 301, 3, 96 );
			this.AddLabel( 65, 62, 68, @"You are about to join a game of Poker." );
			this.AddImage( 33, 38, 95, 68 );
			this.AddImage( 342, 38, 97, 68 );
			this.AddLabel( 52, 80, 68, @"All bets involve real gold and no refunds will be" );
			this.AddLabel( 54, 98, 68, @"given. If you feel uncomfortable losing gold or" );
			this.AddLabel( 40, 116, 68, @"are unfamiliar with the rules of Texas Hold'em, you" );
			this.AddLabel( 100, 134, 68, @"are advised against proceeding." );

			this.AddLabel( 122, 161, 1149, @"Small Blind:" );
			this.AddLabel( 129, 181, 1149, @"Big Blind:" );
			this.AddLabel( 123, 201, 1149, @"Min Buy-In:" );
			this.AddLabel( 120, 221, 1149, @"Max Buy-In:" );
			this.AddLabel( 110, 241, 1149, @"Bank Balance:" );
			this.AddLabel( 101, 261, 1149, @"Buy-In Amount:" );

			this.AddLabel( 200, 161, 148, m_Game.Dealer.SmallBlind.ToString( "#,###" ) + "gp" );
			this.AddLabel( 200, 181, 148, m_Game.Dealer.BigBlind.ToString( "#,###" ) + "gp" );
			this.AddLabel( 200, 201, 148, m_Game.Dealer.MinBuyIn.ToString( "#,###" ) + "gp" );
			this.AddLabel( 200, 221, 148, m_Game.Dealer.MaxBuyIn.ToString( "#,###" ) + "gp" );

			int balance = Banker.GetBalance( from );
			int balancehue = 28;
			int layout = 0;

			if ( balance >= m_Game.Dealer.MinBuyIn )
			{
				balancehue = 266;
				layout = 1;
			}

			this.AddLabel( 200, 241, balancehue, balance.ToString( "#,###" ) + "gp" );

			if ( layout == 0 )
			{
				this.AddLabel( 200, 261, 1149, "(not enough gold)" );
				this.AddButton( 163, 292, 242, 241, (int)Handlers.btnCancel, GumpButtonType.Reply, 0 );
			}
			else if ( layout == 1 )
			{
				this.AddImageTiled( 200, 261, 80, 19, 0xBBC );
				this.AddAlphaRegion( 200, 261, 80, 19 );
				this.AddTextEntry( 203, 261, 77, 19, 68, (int)Handlers.txtBuyInAmount, m_Game.Dealer.MinBuyIn.ToString() );
				this.AddButton( 123, 292, 247, 248, (int)Handlers.btnOkay, GumpButtonType.Reply, 0 );
				this.AddButton( 200, 292, 242, 241, (int)Handlers.btnCancel, GumpButtonType.Reply, 0 );
			}
		}
Beispiel #28
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    m_Active = reader.ReadBool();
                    m_SmallBlind = reader.ReadInt();
                    m_BigBlind = reader.ReadInt();
                    m_MinBuyIn = reader.ReadInt();
                    m_MaxBuyIn = reader.ReadInt();
                    m_ExitLocation = reader.ReadPoint3D();
                    m_ExitMap = reader.ReadMap();
                    m_Rake = reader.ReadDouble();
                    m_RakeMax = reader.ReadInt();
                    m_MaxPlayers = reader.ReadInt();

                    int count = reader.ReadInt();
                    m_Seats = new List<Point3D>();

                    for (int i = 0; i < count; ++i)
                        m_Seats.Add(reader.ReadPoint3D());

                    break;
            }

            m_Game = new PokerGame(this);
        }