コード例 #1
0
 public JoinPokerGump(Mobile mobile, PokerDealer dealer, int balance) : base(10, 10)
 {
     m_Dealer = dealer;
     Closable = true;
     Disposable = true;
     Dragable = true;
     Resizable = false;
     AddPage(0);
     AddBackground(40, 50, 400, 330, 9270);
     AddBackground(166, 336, 100, 20, 9300);
     AddAlphaRegion(50, 60, 380, 310);
     AddButton(280, 336, 247, 248, 1, GumpButtonType.Reply, 0);
     AddButton(350, 336, 243, 241, 2, GumpButtonType.Reply, 0);
     AddLabel(200, 72, 1071, "Join Poker Table");
     AddLabel(58, 90, 1071, "============================================================");
     AddLabel(62, 112, 70, "You are asking to join a poker table. If you are unfamiliar");
     AddLabel(62, 128, 70, "with the rules of Texas Hold'em, or are uneasy about");
     AddLabel(62, 144, 70, "losing gold, then you are advised against proceeding. Only");
     AddLabel(62, 160, 70, "specify a buy-in amount that you would be comfortable");
     AddLabel(62, 176, 70, "losing. All bets are real gold and there are no refunds.");
     AddLabel(58, 197, 1071, "============================================================");
     AddLabel(65, 216, 1071, "Small blind:");
     AddLabel(65, 240, 1071, "Big blind:");
     AddLabel(65, 264, 1071, "Min buy-in:");
     AddLabel(65, 288, 1071, "Max buy-in:");
     AddLabel(65, 312, 1071, "Bank balance:");
     AddLabel(65, 336, 1071, "Buy-in amount:");
     AddLabel(168, 216, 50, String.Format("{0:0,0}", (double)m_Dealer.BlindSmall));
     AddLabel(168, 240, 50, String.Format("{0:0,0}", (double)m_Dealer.BlindSmall * 2));
     AddLabel(168, 264, 50, String.Format("{0:0,0}", (double)m_Dealer.BuyinMinimum));
     AddLabel(168, 288, 50, String.Format("{0:0,0}", (double)m_Dealer.BuyinMaximum));
     if(balance == 0)
         AddLabel(168, 312, 33, "0");
     else
         AddLabel(168, 312, balance < m_Dealer.BuyinMinimum ? 33 : 1071, String.Format("{0:0,0}", (double)balance));
     AddTextEntry(168, 336, 120, 20, 50, 1, "");
     if (m_Dealer.DealerMode > DealerSetup.Regular)
     {
         AddBackground(270, 220, 160, 80, 9300);
         AddImage(275, 220, 9008);
         AddLabel(280, 230, 33, "You are about to join");
         AddLabel(280, 245, 33, "a poker tournament.");
         AddLabel(280, 260, 33, "The dealer starts when");
         AddLabel(280, 275, 33, "all seats are taken.");
     }
 }
コード例 #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    {
                        m_Dealer = reader.ReadMobile() as PokerDealer;
                        m_Number = reader.ReadInt();
                        break;
                    }
            }
        }
コード例 #3
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();
 }
コード例 #4
0
 void ExpiredGetGold(PokerDealer dealer)
 {
     dealer.VerifyQuit(Mobile);
 }
コード例 #5
0
 public void BeginGetGold(PokerDealer dealer)
 {
     EndGetGold();
     m_GetGoldTimer = new GetGoldTimer(dealer, this);
 }
コード例 #6
0
 void ExpiredAction(PokerDealer dealer)
 {
     if (m_IdleRounds < 1)
     {
         dealer.ActionTaken(this, PokerAction.Fold, true);
         this.Mobile.CloseGump(typeof(BettingGump));
         m_IdleRounds++;
     }
     else
         dealer.VerifyQuit(Mobile);
 }
コード例 #7
0
 public void BeginAction(PokerDealer dealer)
 {
     if (m_ActionTimer != null)
     {
         m_ActionTimer.Stop();
         m_ActionTimer = null;
     }
     m_ActionTimer = new ActionTimer(dealer, this);
 }
コード例 #8
0
 public RulesPokerGump(PokerDealer dealer) : base(150, 150)
 {
     m_Dealer = dealer;
     Closable = true;
     Disposable = true;
     Dragable = true;
     Resizable = false;
     AddPage(0);
     AddBackground(25, 25, 335, 140, 9270);
     AddAlphaRegion(35, 35, 315, 120);
     AddLabel(47, 45, 1071, "Do you wish to open an url to the poker guide?");
     AddLabel(45, 60, 1071, "=================================================");
     AddLabel(47, 80, 70, "The guide will cover everything you need to know");
     AddLabel(47, 100, 70, "about this poker system, from hand sequences");
     AddLabel(47, 120, 70, "to weekly jackpot payout and more.");
     AddButton(277, 125, 247, 248, 1, GumpButtonType.Reply, 0);
 }
コード例 #9
0
        public PokerStatGump(PokerDealer dealer) : base(150, 150)
        {
            m_Dealer = dealer;

            Closable = true;
            Disposable = true;
            Dragable = true;
            Resizable = false;
            AddPage(0);
            AddBackground(0, 0, 400, 230, 5120);
            AddAlphaRegion(10, 10, 380, 210);
            AddImage(300, 10, 4037);
            AddLabel(25, 25, 1071, String.Format("Statistics for poker dealer \"{0}\".", m_Dealer.Name));
            AddLabel(25, 55, 1071, "Gold to jackpot:");
            AddLabel(165, 55, 1071, "absolute total");
            AddLabel(280, 55, 50, String.Format("{0:0,0}gp", (double)m_Dealer.TotalGoldToJackpot));
            AddLabel(165, 80, 1071, "average per round");
            AddLabel(280, 80, 50, String.Format("{0:0,0.##}gp", (double)m_Dealer.TotalGoldToJackpot / m_Dealer.RoundsFinished));
            AddLabel(25, 110, 1071, "Gold drained:");
            AddLabel(165, 110, 1071, "absolute total");
            AddLabel(280, 110, 50, String.Format("{0:0,0}gp", (double)m_Dealer.TotalGoldDrained));
            AddLabel(165, 135, 1071, "average per round");
            AddLabel(280, 135, 50, String.Format("{0:0,0.##}gp", (double)m_Dealer.TotalGoldDrained / m_Dealer.RoundsFinished));
            AddLabel(25, 165, 1071, "Players joined so far:");
            AddLabel(280, 165, 1071, String.Format("{0:0,0}", (double)m_Dealer.PlayerAmount));
            AddLabel(25, 190, 1071, "Table status:");
            AddLabel(280, 190, 1071, String.Format("{0}", m_Dealer.IsHighRoller ? "high-roller" : "low-roller"));
        }
コード例 #10
0
        public GamePokerGump(PokerDealer dealer, Mobile mobile) : base(20, 20)
        {
            m_Dealer = dealer;
            PokerPlayer player = m_Dealer.GetPlayer(mobile);
            int i = m_Dealer.GetIndex(player);

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

            AddBackground(265, 306, 80, 80, 3000);
            AddBackground(295, 306, 80, 80, 3000);

            if (player.Quitting)
                AddImage(358, 305, 56);
            else
                AddButton(358, 305, 55, 55, 1, GumpButtonType.Reply, 0);

            if (m_Dealer.ReadyPlayers.Length > 0)
                DrawPlayers(i);

            if (m_Dealer.Players[i].Status >= Status.Playing && (PokerPlayer)m_Dealer.Players[i] == player && m_Dealer.GameProgress > PokerProgress.None)
                DrawCards(m_Dealer.Players[i].Hand, 265, 306, true);

            if (m_Dealer.GameProgress > PokerProgress.PreFlop && m_Dealer.GameProgress < PokerProgress.End)
            {
                int x = (int)m_Dealer.GameProgress - 2;
                DrawCommunityCards(x);
                AddItem(295, 245, 3823);
                AddLabel(273, 250, 50, String.Format("{0}({1:0,0})", GetSpace(m_Dealer.PotWorth), (double)m_Dealer.PotWorth));
            }
            else if (m_Dealer.GameProgress == PokerProgress.End && m_Dealer.EndWinners.Count > 0)
                m_Dealer.DrawList(this, 225, 95);
        }
コード例 #11
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");

        }
コード例 #12
0
 public LeavePokerGump(Mobile mobile, PokerDealer dealer) : base(150, 150)
 {
     m_Dealer = dealer;
     Closable = true;
     Disposable = true;
     Dragable = true;
     Resizable = false;
     AddPage(0);
     AddBackground(25, 25, 315, 185, 9270);
     AddAlphaRegion(35, 35, 295, 165);
     AddLabel(130, 45, 1071, "Stand up and leave?");
     AddLabel(45, 60, 1071, "============================================");
     AddLabel(50, 80, 70, "Are you sure you want to cash-in and");
     AddLabel(50, 100, 70, "leave the poker table? You will play");
     AddLabel(50, 120, 70, "the current hand to completion, any");
     AddLabel(50, 140, 70, "winnings will be deposited in your bank box.");
     AddButton(185, 165, 247, 248, 1, GumpButtonType.Reply, 0);
     AddButton(255, 165, 242, 241, 2, GumpButtonType.Reply, 0);
 }
コード例 #13
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);
        }
コード例 #14
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			Blessed = true;

			switch (version)
			{
				case 0:
					{
						int listlength = reader.ReadInt();
						for (int i = 0; i < listlength; i++)
						{
							Mobile mobile = reader.ReadMobile() as PlayerMobile;
							int bankroll = reader.ReadInt();
							int ticket = reader.ReadInt();
							bool lowroller = reader.ReadBool();
							bool highroller = reader.ReadBool();
							mobile.CantWalk = false;
							CrashList.Add(new CrashEntry(mobile, bankroll, ticket, lowroller, highroller));
						}
						m_AllowSameIP = reader.ReadBool();
						m_BlindSmall = reader.ReadInt();
						m_MaxBuyIn = reader.ReadInt();
						m_MinBuyIn = reader.ReadInt();
						m_DealerAccept = (DealerAccept)reader.ReadInt();
						m_DealerSetup = (DealerSetup)reader.ReadInt();
						m_Open = reader.ReadBool();
						m_DrainFromBuyIn = reader.ReadInt();
						m_DrainFromPot = reader.ReadInt();
						m_DrainToJackpot = reader.ReadInt();
						m_IsHighRoller = reader.ReadBool();
						m_MaxPlayers = reader.ReadInt();
						m_ExitPoint = reader.ReadPoint3D();
						m_WinnerPoint = reader.ReadPoint3D();
						m_Stone = reader.ReadItem() as PokerJackpot;
						m_Active = reader.ReadBool();
						m_Award = (Award)reader.ReadInt();
						m_msg = reader.ReadBool();
						m_TournyReward = reader.ReadItem();
						m_maxforward = reader.ReadInt();
						m_PTNextDealer = reader.ReadMobile() as PokerDealer;
						m_RaiseSmall = reader.ReadInt();
						m_PokerReward = (PokerReward)reader.ReadInt();
						for (int i = 0; i < 10; ++i)
							m_Seat[i] = reader.ReadPoint3D();
						m_AutoFoldTimer = reader.ReadInt();
						m_GetGoldTimer = reader.ReadInt();
						m_URL = reader.ReadString();
						int playerlength = reader.ReadInt();
						for (int i = 0; i < playerlength; i++)
						{
							Mobile mobile = reader.ReadMobile();
							int bankroll = reader.ReadInt();
							mobile.LogoutLocation = m_ExitPoint;
							mobile.CantWalk = false;
							int ticket = bankroll;
							bool lowroller = false;
							bool highroller = false;
							switch (m_DealerAccept)
							{
								case DealerAccept.GoldOnly:
									if (m_Active)
										bankroll = 0;
									else
										ticket = 0;
									break;
								case DealerAccept.LowRollerTicketsOnly:
									if (m_Active)
										bankroll = 0;
									else
									{
										bankroll = 0;
										ticket = 0;
										lowroller = true;
									}
									break;
								case DealerAccept.HighRollerTicketsOnly:
									if (m_Active)
										bankroll = 0;
									else
									{
										bankroll = 0;
										ticket = 0;
										highroller = true;
									}
									break;
							}
							AddCrashEntry(mobile, bankroll, ticket, lowroller, highroller);
						}
						m_memblind = reader.ReadInt();
						m_TotalGoldToJackpot = reader.ReadInt();
						m_TotalGoldDrained = reader.ReadInt();
						m_RoundsFinished = reader.ReadInt();
						m_PlayerAmount = reader.ReadInt();
						break;
					}
			}
			m_Registry.Add(this);

			if (DealerMode == DealerSetup.SingleLoop)
			{
				m_Active = false;
				if (m_memblind > 0)
					BlindSmall = m_memblind;
			}

			//Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( FixCrashed ) );
		}