コード例 #1
0
ファイル: CEOBlackJack.cs プロジェクト: greeduomacro/annox
			public DealerTimer(CEOBlackJack CEObj,Mobile from, TimeSpan delay)
				: base(delay)
			{
				Priority = TimerPriority.TwoFiftyMS;
				m = from;
				m_CEObj = CEObj;
			}
コード例 #2
0
ファイル: CEOBlackJack.cs プロジェクト: greeduomacro/annox
		public BlackJackCardGump(Mobile player, CEOBlackJack CEOBlackJack, string message)
			: base(20, 20)
		{
			if (CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.DealerTurn)
				Closable = false;
			else
				Closable = true;
			Disposable = true;
			Dragable = true;
			Resizable = false;
			m_CEOBlackJack = CEOBlackJack;
			m_ySize = (m_CEOBlackJack.m_BJInfo.totalhands == 0) ? 360 : 115 + (m_CEOBlackJack.m_BJInfo.totalhands * 80);
			int m_yButtonStart = m_ySize - 85;
			if (m_CEOBlackJack.m_BJInfo.largesthand < 6)
				m_xSize = m_CEOBlackJack.m_BJInfo.totalhands == 0 ? 525 : 470;
			else
				m_xSize = 125 + (m_CEOBlackJack.m_BJInfo.largesthand * 55);
			m_Base = Utility.Random(500);
			m_HelpGump = m_CEOBlackJack.HelpGump;
			m_Base = Utility.Random(2000);

			AddBackground(0, 0, m_xSize, m_ySize, 9260);

			if (m_HelpGump)
				AddBackground(m_xSize, 0, 280, 420, 9260);
			if (m_CEOBlackJack.TestMode)
				AddLabel(3, 2, 37, "Free Play");

			AddLabel(m_xSize / 2 - 60, 15, m_CEOBlackJack.Hue, "CE");
			AddLabel(m_xSize / 2 - 45, 16, 136, "\u25C6");
			AddLabel(m_xSize / 2 - 20, 15, m_CEOBlackJack.Hue, "Video BlackJack" + "\u00A9");
			if (m_CEOBlackJack.m_BJInfo.totalhands == 0)
				DisplayRuleInfo();
			else
				DisplayCards();
			if (m_CEOBlackJack.m_BJInfo.askInsurance)
			{
				AddLabel(buttonx + 170, m_yButtonStart - 70, 97, @"Insurance?");
				AddButton(buttonx + 160, m_yButtonStart - 45, 4023, 4025, m_Base + 250, GumpButtonType.Reply, 0); //OK
				AddButton(buttonx + 210, m_yButtonStart - 45, 4017, 4019, m_Base + 251, GumpButtonType.Reply, 0); //Cancel

			}
			else if (m_CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.PlayerTurn)
			{
				AddButton(buttonx, m_yButtonStart, 4002, 4004, m_Base + 201, GumpButtonType.Reply, 0); //Stand
				AddLabel(buttonx + 30, m_yButtonStart, 1149, @"Stand");
				if (m_CEOBlackJack.m_BJInfo.hitOn)
				{
					AddButton(buttonx + 90, m_yButtonStart, 4026, 4028, m_Base + 200, GumpButtonType.Reply, 0); //Hit
					AddLabel(buttonx + 120, m_yButtonStart, 1149, @"Hit");
				}
				if (m_CEOBlackJack.m_BJInfo.doubleOn)
				{
					AddButton(buttonx + 180, m_yButtonStart, 4008, 4010, m_Base + 202, GumpButtonType.Reply, 0); //Double
					AddLabel(buttonx + 210, m_yButtonStart, 1149, @"Double");
				}
				if (m_CEOBlackJack.m_BJInfo.splitOn)
				{
					AddButton(buttonx + 270, m_yButtonStart, 4020, 4022, m_Base + 203, GumpButtonType.Reply, 0); //Split
					AddLabel(buttonx + 300, m_yButtonStart, 1149, @"Split");
				}
			}
			else if (m_CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.Waiting)
			{
				AddButton(135, 19, 0x983, 0x984, m_Base + 101, GumpButtonType.Reply, 0);
				AddButton(135, 31, 0x985, 0x986, m_Base + 102, GumpButtonType.Reply, 0);
				AddButton(buttonx - 30, m_yButtonStart, 4020, 4021, m_Base + 300, GumpButtonType.Reply, 0); //PLAY
				AddLabel(buttonx, m_yButtonStart, 1149, @"Play");
				AddButton(buttonx + 60, m_yButtonStart, 4029, 4030, m_Base + 301, GumpButtonType.Reply, 0); //CASHOUT
				if (m_CEOBlackJack.TestMode)
					AddLabel(buttonx + 90, m_yButtonStart, 1149, @"Quit");
				else
				{
					if (m_CEOBlackJack.OnCredit() == 0)
						AddLabel(buttonx + 90, m_yButtonStart, 1149, @"Quit");
					else
						AddLabel(buttonx + 90, m_yButtonStart, 1149, @"Cash Out");
					AddButton(buttonx + 150, m_yButtonStart - 10, 4037, 4036, m_Base + 302, GumpButtonType.Reply, 0); //ATM
					AddLabel(buttonx + 180, m_yButtonStart, 1149, @"ATM");
				}
			}
			string score = null;
			int labelcolor;
			for (int h = 0; h < m_CEOBlackJack.m_BJInfo.totalhands; h++)
			{
				if (m_CEOBlackJack.m_BJInfo.activehand != h || m_CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.Waiting)
					labelcolor = 912;
				else
					labelcolor = 57;
				AddLabel(15, 40 + h * 80, labelcolor, h == 0 ? "Dealer" : (m_CEOBlackJack.m_BJInfo.totalhands > 2 ? "Hand " + h.ToString() : "You"));
				if (h == 0)
				{
					if (m_CEOBlackJack.m_BJInfo.HandInfo[h].status == CEOBlackJack.HandStatus.BlackJack)
					{
						AddLabel(15, 55 + h * 80, labelcolor, "21");
						AddLabel(15, 75 + h * 80, 2213, "Blackjack!");
					}
					else if (m_CEOBlackJack.DealerCardsFaceUp)
					{
						score = String.Format("{0} {1}", m_CEOBlackJack.m_BJInfo.HandInfo[h].bestscore, (m_CEOBlackJack.m_BJInfo.HandInfo[h].altscore == 0 || (m_CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.Waiting) || (m_CEOBlackJack.m_BJInfo.HandInfo[h].status == CEOBlackJack.HandStatus.Waiting)) ? null : "or " + m_CEOBlackJack.m_BJInfo.HandInfo[h].altscore.ToString());
						AddLabel(15, 55 + h * 80, labelcolor, score);
					}
					else if (m_CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.PlayerTurn)
					{
						short c = (short)(m_CEOBlackJack.m_BJInfo.HandInfo[0].card[1] % 13);
						if (c == 0)
							c = 11;
						else
							c = (short)(c > 8 ? 10 : c + 1);
						AddLabel(15, 55 + h * 80, labelcolor, c.ToString());
					}
					else
					{
						score = String.Format("{0} {1}", m_CEOBlackJack.m_BJInfo.HandInfo[h].bestscore, (m_CEOBlackJack.m_BJInfo.HandInfo[h].altscore == 0 || (m_CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.Waiting) || (m_CEOBlackJack.m_BJInfo.HandInfo[h].status == CEOBlackJack.HandStatus.Waiting)) ? null : "or " + m_CEOBlackJack.m_BJInfo.HandInfo[h].altscore.ToString());
						AddLabel(15, 55 + h * 80, labelcolor, score);
					}

				}
				else
				{
					if (m_CEOBlackJack.m_BJInfo.HandInfo[h].status == CEOBlackJack.HandStatus.BlackJack)
					{
						AddLabel(15, 55 + h * 80, labelcolor, "21");
						AddLabel(15, 75 + h * 80, 2213, "Blackjack!");
					}
					else if (m_CEOBlackJack.PlayerCardsFaceUp)
					{
						score = String.Format("{0} {1}", m_CEOBlackJack.m_BJInfo.HandInfo[h].bestscore, (m_CEOBlackJack.m_BJInfo.HandInfo[h].altscore == 0 || (m_CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.Waiting) || (m_CEOBlackJack.m_BJInfo.HandInfo[h].status == CEOBlackJack.HandStatus.Waiting)) ? null : "or " + m_CEOBlackJack.m_BJInfo.HandInfo[h].altscore.ToString());
						AddLabel(15, 55 + h * 80, labelcolor, score);
						if (m_CEOBlackJack.m_BJInfo.HandInfo[h].status == CEOBlackJack.HandStatus.Bust)
							AddLabel(15, 75 + h * 80, 37, "Bust");
					}
					else if (m_CEOBlackJack.m_BJInfo.HandInfo[h].status == CEOBlackJack.HandStatus.SplitAces)
					{
						AddLabel(15, 55 + h * 80, labelcolor, "11 or 1");
						AddLabel(15, 75 + h * 80, 87, "Good luck!");
					}
					else if (h > 0 && m_CEOBlackJack.m_BJInfo.HandInfo[h].status == CEOBlackJack.HandStatus.Double)
					{
						AddLabel(15, 75 + h * 80, 17, "Good luck!");
						score = String.Format("{0} {1}", m_CEOBlackJack.m_BJInfo.HandInfo[h].bestscore, (m_CEOBlackJack.m_BJInfo.HandInfo[h].altscore == 0 || (m_CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.Waiting) || (m_CEOBlackJack.m_BJInfo.HandInfo[h].status == CEOBlackJack.HandStatus.Waiting)) ? null : "or " + m_CEOBlackJack.m_BJInfo.HandInfo[h].altscore.ToString());
						AddLabel(15, 55 + h * 80, labelcolor, score);
					}
					else
					{
						score = String.Format("{0} {1}", m_CEOBlackJack.m_BJInfo.HandInfo[h].bestscore, (m_CEOBlackJack.m_BJInfo.HandInfo[h].altscore == 0 || (m_CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.Waiting) || (m_CEOBlackJack.m_BJInfo.HandInfo[h].status == CEOBlackJack.HandStatus.Waiting)) ? null : "or " + m_CEOBlackJack.m_BJInfo.HandInfo[h].altscore.ToString());
						AddLabel(15, 55 + h * 80, labelcolor, score);
					}
					AddLabel(70, 27 + h * 80, labelcolor, String.Format("Bet: {0}", m_CEOBlackJack.m_BJInfo.HandInfo[h].bet));
				}
				if (m_CEOBlackJack.m_BJInfo.status == CEOBlackJack.GameStatus.Waiting)
				{
					switch (m_CEOBlackJack.m_BJInfo.HandInfo[h].status)
					{
						case CEOBlackJack.HandStatus.BlackJack:
							{
							}
							break;
						case CEOBlackJack.HandStatus.Lose:
							{
								AddLabel(15, 75 + h * 80, 37, "Lose");
							}
							break;
						case CEOBlackJack.HandStatus.Bust:
							{
								AddLabel(15, 75 + h * 80, 37, "Bust");
							}
							break;
						case CEOBlackJack.HandStatus.Push:
							{
								AddLabel(15, 75 + h * 80, 48, "Push");
							}
							break;
						case CEOBlackJack.HandStatus.Win:
							{
								AddLabel(15, 75 + h * 80, 162, "Win!");
							}
							break;
						default:
							{
							}
							break;
					}
				}
			}
			AddLabel(15, 20, 0, "Current bet:");
			AddLabel(92, 20, 2213, m_CEOBlackJack.CurrentBet.ToString());
			AddLabel(15, m_yButtonStart + 30, 0, "Credits:");
			AddLabel(70, m_yButtonStart + 30, 2213, m_CEOBlackJack.OnCredit().ToString());
			AddLabel(120, m_yButtonStart + 30, 0, "Last Won:");
			AddLabel(195, m_yButtonStart + 30, 2213, CEOBlackJack.Won.ToString());
			if (player.AccessLevel >= AccessLevel.GameMaster)
			{
				int paybackhue = (m_CEOBlackJack.WinningPercentage > 99.0) ? 37 : 66;
				AddLabel(m_xSize - 175, 1, 1152, "Payout Percentage:");
				string text = String.Format("{0:##0.00%}", m_CEOBlackJack.WinningPercentage / 100);
				AddLabel(m_xSize - 62, 1, paybackhue, text);
			}
			if (message != null)
				AddLabel(15, m_ySize - 35, 1150, message);
			if (Utility.RandomDouble() < .0008)
				CEOCookie(m_CEOBlackJack.Hue, player);
			if (m_CEOBlackJack.m_BJInfo.status != CEOBlackJack.GameStatus.DealerTurn)
				AddButton(m_xSize - 45, 20, m_HelpGump ? 4014 : 4005, m_HelpGump ? 4016 : 4007, m_Base + 401, GumpButtonType.Reply, 0); //Help
			if (m_HelpGump)
				DisplayHelpGump();
		}
コード例 #3
0
ファイル: CEOBlackJack.cs プロジェクト: greeduomacro/annox
		private static void DoBlackJackSound(Mobile from, CEOBlackJack ceobj)
		{
			ceobj.PublicOverheadMessage(0, (ceobj.Hue == 907 ? 0 : ceobj.Hue), false, "Blackjack!");
			if (Utility.RandomDouble() < .005)
				DoFireworks(from);
				switch (Utility.Random(7))
				{
					case 0:
						from.PlaySound(from.Female ? 794 : 1066);
						break;
					case 1:
						from.PlaySound(from.Female ? 797 : 1069);
						break;
					case 2:
						from.PlaySound(from.Female ? 783 : 1054);
						break;
					case 3:
						from.PlaySound(from.Female ? 823 : 1097);
						break;
					default:
						break;
				}
		}