public PokerGump(Mobile mobile, Gambler gambler) : base(10, 10) { m_From = gambler; int i, temp = 0; string cardtemp = "Player:"; Closable = false; AddPage(0); AddImageTiled(30, 100, 460, 160, 2624); AddAlphaRegion(90, 100, 460, 105); if (m_From.dwin == 2 || m_From.dwin == 1) { cardtemp = "Player: 1"; } AddLabel(35, 109, 600, cardtemp); AddButton(33, 243, 3, 4, 666, GumpButtonType.Reply, 0); if (m_From.pwin > 0) { AddLabel(45, 129, 70, "" + m_From.pwin); } //show player cards for (i = 0; i <= 4; ++i) { if (m_From.dwin == 1) { m_From.playercards[i] = m_From.pickcard(mobile); } temp = m_From.playercards[i]; if (temp > 0) { if (!NewCards) { AddBackground(65 + ((i + 1) * 40), 108, 35, 50, 2171); cardtemp = m_From.CardSuit(temp); AddLabel(80 + ((i + 1) * 40), 134, m_From.cardcolor(cardtemp), cardtemp); AddLabel(72 + ((i + 1) * 40), 113, 600, m_From.CardName(temp)); AddLabel(65 + ((i + 1) * 40), 180, 500, "redeal"); } if (m_From.dwin == 1 || m_From.dwin == 2) { if (NewCards) { AddCheck(25 + ((i + 1) * 75), 105, 4095 + temp, 4154, false, (i + 1)); } else { AddCheck(74 + ((i + 1) * 40), 162, 210, 211, false, (i + 1)); } } else { if (NewCards) { AddImage(25 + ((i + 1) * 75), 105, 4095 + temp); } else { AddImage(74 + ((i + 1) * 40), 162, 210); } } } } AddLabel(240, 205, 800, "Deal"); AddButton(220, 208, 2117, 2118, 101, GumpButtonType.Reply, 0); AddLabel(160, 205, 800, "" + m_From.playerbet); AddButton(140, 208, 2117, 2118, 105, GumpButtonType.Reply, 0); AddLabel(130, 230, 64, m_From.pokermsg); if (m_From.dwin == 1) { m_From.dwin = 2; } if (m_From.dwin == 3) { m_From.dwin = 0; m_From.roundend = true; } }
public BlackjackGump( Mobile mobile, Gambler gambler ) : base( 10, 10 ) { m_From = gambler; int i,dealervalue=0,temp=0; string cardtemp, scoredmsg, scorepmsg; Closable = false; AddPage( 0 ); AddImageTiled( 30, 100, 460, 280, 2624 ); AddAlphaRegion( 90, 100, 460, 230 ); AddLabel( 35, 109, 1500, "Dealer:" ); AddLabel( 35, 229, 600, "Player:" ); if (m_From.dwin>0) AddLabel( 45, 129, 70, ""+m_From.dwin ); if (m_From.pwin>0) AddLabel( 45, 249, 70, ""+m_From.pwin ); AddButton( 40, 333, 2117, 2118, 101, GumpButtonType.Reply, 0 ); AddLabel( 60, 330, 800, "Deal" ); AddButton( 150, 333, 2117, 2118, 102, GumpButtonType.Reply, 0 ); AddLabel( 170, 330, 800, "Hit" ); AddButton( 200, 333, 2117, 2118, 103, GumpButtonType.Reply, 0 ); AddLabel( 220, 330, 800, "Stand" ); AddButton( 280, 333, 2117, 2118, 104, GumpButtonType.Reply, 0 ); AddLabel( 300, 330, 800, "Double Down" ); AddButton( 90, 333, 2117, 2118, 105, GumpButtonType.Reply, 0 ); AddButton( 33, 363, 3, 4, 666, GumpButtonType.Reply, 0 ); //show dealer cards for ( i = 0; i <= 4; ++i ) { temp = m_From.dealercards[i]; if (temp>0) { if (!m_From.dealercardhidden || (m_From.dealercardhidden && i>0)) { if (NewCards) AddImage ( 25 + ((i+1)*75), 110, 4095+temp); else { cardtemp = m_From.CardSuit( temp ); //129 AddBackground( 65 + ((i+1)*40), 110, 35, 50, 2171 ); AddLabel( 80 + ((i+1)*40), 136, m_From.cardcolor( cardtemp ), cardtemp ); AddLabel( 72 + ((i+1)*40), 115, 1500, m_From.CardName( temp ) ); } dealervalue += m_From.CardValue( temp ); } else { if (NewCards) AddImage ( 25 + ((i+1)*75), 110, 4154); else AddBackground( 65 + ((i+1)*40), 110, 35, 50, 2171 ); } } } //show player cards for ( i = 0; i <= 4; ++i ) { temp = m_From.playercards[i]; if (temp>0) { if (NewCards) AddImage ( 25 + ((i+1)*75), 230, 4095+temp); else { cardtemp = m_From.CardSuit( temp ); AddBackground( 65 + ((i+1)*40), 230, 35, 50, 2171 ); AddLabel( 80 + ((i+1)*40), 256, m_From.cardcolor( cardtemp ), cardtemp ); AddLabel( 72 + ((i+1)*40), 235, 600, m_From.CardName( temp ) ); } } } AddLabel( 110, 330, 800, ""+m_From.playerbet ); if (!m_From.dealercardhidden) dealervalue = dealercardvalue(); if (m_From.CardValue(m_From.dealercards[0]) + m_From.CardValue(m_From.dealercards[1]) == 21 && !m_From.dealercardhidden) scoredmsg = "BJ"; else scoredmsg = dealervalue.ToString(); if (m_From.CardValue(m_From.playercards[1]) + m_From.CardValue(m_From.playercards[1]) == 21) scorepmsg = "BJ"; else scorepmsg = playercardvalue().ToString(); AddLabel( 63, 155, 1500, ""+scoredmsg ); AddLabel( 63, 274, 600, ""+scorepmsg ); AddLabel( 100, 350, 64, m_From.pokermsg ); }
public BlackjackGump(Mobile mobile, Gambler gambler) : base(10, 10) { m_From = gambler; int i, dealervalue = 0, temp = 0; string cardtemp, scoredmsg, scorepmsg; Closable = false; AddPage(0); AddImageTiled(30, 100, 460, 280, 2624); AddAlphaRegion(90, 100, 460, 230); AddLabel(35, 109, 1500, "Dealer:"); AddLabel(35, 229, 600, "Player:"); if (m_From.dwin > 0) { AddLabel(45, 129, 70, "" + m_From.dwin); } if (m_From.pwin > 0) { AddLabel(45, 249, 70, "" + m_From.pwin); } AddButton(40, 333, 2117, 2118, 101, GumpButtonType.Reply, 0); AddLabel(60, 330, 800, "Deal"); AddButton(150, 333, 2117, 2118, 102, GumpButtonType.Reply, 0); AddLabel(170, 330, 800, "Hit"); AddButton(200, 333, 2117, 2118, 103, GumpButtonType.Reply, 0); AddLabel(220, 330, 800, "Stand"); AddButton(280, 333, 2117, 2118, 104, GumpButtonType.Reply, 0); AddLabel(300, 330, 800, "Double Down"); AddButton(90, 333, 2117, 2118, 105, GumpButtonType.Reply, 0); AddButton(33, 363, 3, 4, 666, GumpButtonType.Reply, 0); //show dealer cards for (i = 0; i <= 4; ++i) { temp = m_From.dealercards[i]; if (temp > 0) { if (!m_From.dealercardhidden || (m_From.dealercardhidden && i > 0)) { if (NewCards) { AddImage(25 + ((i + 1) * 75), 110, 4095 + temp); } else { cardtemp = m_From.CardSuit(temp); //129 AddBackground(65 + ((i + 1) * 40), 110, 35, 50, 2171); AddLabel(80 + ((i + 1) * 40), 136, m_From.cardcolor(cardtemp), cardtemp); AddLabel(72 + ((i + 1) * 40), 115, 1500, m_From.CardName(temp)); } dealervalue += m_From.CardValue(temp); } else { if (NewCards) { AddImage(25 + ((i + 1) * 75), 110, 4154); } else { AddBackground(65 + ((i + 1) * 40), 110, 35, 50, 2171); } } } } //show player cards for (i = 0; i <= 4; ++i) { temp = m_From.playercards[i]; if (temp > 0) { if (NewCards) { AddImage(25 + ((i + 1) * 75), 230, 4095 + temp); } else { cardtemp = m_From.CardSuit(temp); AddBackground(65 + ((i + 1) * 40), 230, 35, 50, 2171); AddLabel(80 + ((i + 1) * 40), 256, m_From.cardcolor(cardtemp), cardtemp); AddLabel(72 + ((i + 1) * 40), 235, 600, m_From.CardName(temp)); } } } AddLabel(110, 330, 800, "" + m_From.playerbet); if (!m_From.dealercardhidden) { dealervalue = dealercardvalue(); } if (m_From.CardValue(m_From.dealercards[0]) + m_From.CardValue(m_From.dealercards[1]) == 21 && !m_From.dealercardhidden) { scoredmsg = "BJ"; } else { scoredmsg = dealervalue.ToString(); } if (m_From.CardValue(m_From.playercards[1]) + m_From.CardValue(m_From.playercards[1]) == 21) { scorepmsg = "BJ"; } else { scorepmsg = playercardvalue().ToString(); } AddLabel(63, 155, 1500, "" + scoredmsg); AddLabel(63, 274, 600, "" + scorepmsg); AddLabel(100, 350, 64, m_From.pokermsg); }
public PokerGump( Mobile mobile, Gambler gambler ) : base( 10, 10 ) { m_From = gambler; int i,temp=0; string cardtemp="Player:"; Closable = false; AddPage( 0 ); AddImageTiled( 30, 100, 460, 160, 2624 ); AddAlphaRegion( 90, 100, 460, 105 ); if (m_From.dwin==2||m_From.dwin==1) cardtemp="Player: 1"; AddLabel( 35, 109, 600, cardtemp ); AddButton( 33, 243, 3, 4, 666, GumpButtonType.Reply, 0 ); if (m_From.pwin>0) AddLabel( 45, 129, 70, ""+m_From.pwin ); //show player cards for ( i = 0; i <= 4; ++i ) { if (m_From.dwin==1) m_From.playercards[i]=m_From.pickcard(mobile); temp = m_From.playercards[i]; if (temp>0) { if (!NewCards) { AddBackground( 65 + ((i+1)*40), 108, 35, 50, 2171 ); cardtemp = m_From.CardSuit( temp ); AddLabel( 80 + ((i+1)*40), 134, m_From.cardcolor( cardtemp ), cardtemp ); AddLabel( 72 + ((i+1)*40), 113, 600, m_From.CardName( temp ) ); AddLabel( 65 + ((i+1)*40), 180, 500, "redeal" ); } if (m_From.dwin==1||m_From.dwin==2) { if (NewCards) AddCheck( 25 + ((i+1)*75), 105, 4095+temp, 4154, false, (i+1) ); else AddCheck( 74 + ((i+1)*40), 162, 210, 211, false, (i+1) ); } else { if (NewCards) AddImage ( 25 + ((i+1)*75), 105, 4095+temp); else AddImage( 74 + ((i+1)*40), 162, 210 ); } } } AddLabel( 240, 205, 800, "Deal" ); AddButton( 220, 208, 2117, 2118, 101, GumpButtonType.Reply, 0 ); AddLabel( 160, 205, 800, ""+m_From.playerbet ); AddButton( 140, 208, 2117, 2118, 105, GumpButtonType.Reply, 0 ); AddLabel( 130, 230, 64, m_From.pokermsg ); if (m_From.dwin==1) m_From.dwin=2; if (m_From.dwin==3) { m_From.dwin=0; m_From.roundend = true; } }
public void finishpokergame(Mobile from) { int i, match1 = 0, match2 = 0, match3 = 0, match4 = 0, match5 = 0, temp = 0; bool isStrt = true, isFlush = false; string Temp; for (i = 0; i <= 4; i++) { m_From.dealercards[i] = m_From.playercards[i]; } for (int j = 4; j >= 0; j--) { for (i = 0; i < 4; i++) { if (m_From.CardValue2(m_From.dealercards[i]) >= m_From.CardValue2(m_From.dealercards[i + 1])) { temp = m_From.dealercards[i]; m_From.dealercards[i] = m_From.dealercards[i + 1]; m_From.dealercards[i + 1] = temp; } } } for (i = 4; i > 0; i--) { if (m_From.CardValue2(m_From.dealercards[i]) != (m_From.CardValue2(m_From.dealercards[0]) + i)) { isStrt = false; m_From.pokermsg = "Game Over."; m_From.pwin = 0; } } if ((m_From.CardValue2(m_From.dealercards[0]) == 2) && (m_From.CardValue2(m_From.dealercards[1]) == 3) && (m_From.CardValue2(m_From.dealercards[2]) == 4) && (m_From.CardValue2(m_From.dealercards[3]) == 5) && (m_From.CardValue2(m_From.dealercards[4]) == 14)) { isStrt = true; } if (isStrt) { m_From.pokermsg = "Straight."; m_From.pwin = m_From.playerbet * 4; } Temp = m_From.CardSuit(m_From.dealercards[0]); if (Temp == m_From.CardSuit(m_From.dealercards[1]) && Temp == m_From.CardSuit(m_From.dealercards[2]) && Temp == m_From.CardSuit(m_From.dealercards[3]) && Temp == m_From.CardSuit(m_From.dealercards[4])) { isFlush = true; m_From.pokermsg = "Flush."; m_From.pwin = m_From.playerbet * 5; } if (!isStrt && !isFlush) { for (i = 0; i <= 4; i++) { temp = m_From.CardValue2(m_From.dealercards[i]); if ((m_From.CardValue2(m_From.dealercards[0]) == temp) && i != 0) { match1++; } if ((m_From.CardValue2(m_From.dealercards[1]) == temp) && i != 1) { match2++; } if ((m_From.CardValue2(m_From.dealercards[2]) == temp) && i != 2) { match3++; } if ((m_From.CardValue2(m_From.dealercards[3]) == temp) && i != 3) { match4++; } if ((m_From.CardValue2(m_From.dealercards[4]) == temp) && i != 4) { match5++; } } if ((match1 == 3) || (match2 == 3) || (match3 == 3) || (match4 == 3) || (match5 == 3)) { m_From.pokermsg = "4 of a Kind"; m_From.pwin = m_From.playerbet * 8; } if ((match1 == 2) || (match2 == 2) || (match3 == 2) || (match4 == 2) || (match5 == 2)) { m_From.pokermsg = "3 of a Kind"; m_From.pwin = m_From.playerbet * 3; } if ((match1 + match2 + match3 + match4 + match5) == 8) { m_From.pokermsg = "Full House."; m_From.pwin = m_From.playerbet * 6; } if ((match1 + match2 + match3 + match4 + match5) == 4) { m_From.pokermsg = "Two Pair."; m_From.pwin = m_From.playerbet * 2; } temp = 0; if ((match1 + match2 + match3 + match4 + match5) == 2) { if (match1 == 1) { temp = m_From.CardValue2(m_From.dealercards[0]); } if (match2 == 1) { temp = m_From.CardValue2(m_From.dealercards[1]); } if (match3 == 1) { temp = m_From.CardValue2(m_From.dealercards[2]); } if (match4 == 1) { temp = m_From.CardValue2(m_From.dealercards[3]); } if (temp >= 10) { m_From.pokermsg = "Pair 10's +"; m_From.pwin = m_From.playerbet; } } } //end if(isStrt && isFlush) if (isFlush && isStrt) { if (m_From.dealercards[0] == 10) { m_From.pokermsg = "Royal Straight Flush"; m_From.pwin = m_From.playerbet * 12; } else { m_From.pokermsg = "Straight Flush"; m_From.pwin = m_From.playerbet * 10; } } if (m_From.pwin > 0) { m_From.payplayer(from, m_From.pwin); Effects.PlaySound(from.Location, from.Map, 0x36); m_From.gamestats[4] += 1; } else if (m_From.pwin == m_From.playerbet) { m_From.gamestats[5] += 1; } else { m_From.gamestats[3] += 1; } }