Exemplo n.º 1
0
 public void GameStart()
 {
     Gambling.SetClipboard("[Blackjack] Game Started");
     playerHand  = new List <Card>();
     dealerHand  = new List <Card>();
     playerStood = false;
 }
Exemplo n.º 2
0
    public void GameStart()
    {
        heldCards = new List <int>();
        hand      = new List <Card>();
        cardsHeld = false;

        Gambling.SetClipboard("[Video Poker] Game Start");
    }
Exemplo n.º 3
0
    public void GameStart()
    {
        dealerDice = new List<int>();
        playerDice = new List<int>();
        displayRemaining = false;

        Gambling.SetClipboard("[Six Shooter] Game Started");
    }
Exemplo n.º 4
0
 public void Stand()
 {
     if (!playerStood)
     {
         playerStood = true;
         Gambling.SetClipboard("[Blackjack] Player stood at " + GetTotal(playerHand));
     }
 }
Exemplo n.º 5
0
    public void GameStart()
    {
        Gambling.SetClipboard("[Baccarat] Game Started");

        playerHand  = new List <Card>();
        bankerHand  = new List <Card>();
        playerStood = false;
        bankerStood = false;
    }
Exemplo n.º 6
0
    int Generate()
    {
        string result = "[Scratch Card #" + currentID + "] | ";

        currentID++;

        int[] payout = new int[3];

        Random rand = new Random();

        for (int i = 0; i < payout.Length; i++)
        {
            int highest = 0;
            int lowest  = jackpot;
            foreach (KeyValuePair <int, int> prize in possibilities)
            {
                int value  = prize.Key;
                int chance = prize.Value;
                int random = rand.Next(0, chance);

                if (lowest > value)
                {
                    lowest = value;
                }

                if (random == 0 && value > highest)
                {
                    highest = value;
                }
            }

            // If no prize was won, automatically switch to lowest
            if (highest == 0)
            {
                highest = lowest;
            }

            payout[i] = highest;

            result += Gambling.FormatMoney((int)(payout[i] / 1000.0f) * 1000) + " | ";
        }

        Gambling.SetClipboard(result);

        if (payout[0] == payout[1] && payout[1] == payout[2])
        {
            return(payout[0]);
        }
        else
        {
            return(0);
        }
    }
Exemplo n.º 7
0
    int Generate()
    {
        Random rand   = new Random();
        int    random = rand.Next(1, rarity);

        current++;

        if (random == 1)
        {
            Gambling.SetClipboard("[Mystery Box #" + current + " You won the Jackpot: " + Gambling.FormatMoney(jackpot));
            return(jackpot);
        }
        else
        {
            int value = 0;
            random = rand.Next(1, rarity);

            if (random <= 2)
            {
                value = (int)((double)jackpot * 0.35);
                Gambling.SetClipboard("[Mystery Box #" + current + "] You win: " + Gambling.FormatMoney(value));
                return(value);
            }
            else if (random < (rarity / 75))
            {
                value = (int)((double)jackpot * 0.075);
                Gambling.SetClipboard("[Mystery Box #" + current + "] You win: " + Gambling.FormatMoney(value));
                return(value);
            }
            else if (random < (rarity / 40))
            {
                value = (int)((double)jackpot * 0.05);
                Gambling.SetClipboard("[Mystery Box #" + current + "] You win: " + Gambling.FormatMoney(value));
                return(value);
            }
            else if (random < (rarity / 15))
            {
                value = (int)((double)jackpot * 0.01);
                Gambling.SetClipboard("[Mystery Box #" + current + "] You win: " + Gambling.FormatMoney(value));
                return(value);
            }
            else if (random < (rarity / 10))
            {
                value = (int)((double)jackpot * 0.0075);
                Gambling.SetClipboard("[Mystery Box #" + current + "] You win: " + Gambling.FormatMoney(value));
                return(value);
            }

            value = (int)((float)jackpot * 0.005);
            Gambling.SetClipboard("[Mystery Box #" + current + "] You win: " + Gambling.FormatMoney(value));
            return(value);
        }
    }
Exemplo n.º 8
0
    public void InitializeActions()
    {
        Actions[Key.I] = () =>
        {
            Random rand  = new Random();
            int    total = 0;
            for (int i = 0; i < diceToRoll; i++)
            {
                total += rand.Next(1, 7);
            }

            Gambling.SetClipboard("[Dice] You have rolled " + diceToRoll + " dice: " + total);
        };
    }
Exemplo n.º 9
0
    public void InitializeActions()
    {
        Actions[Key.I] = () =>
        {
            Random rand   = new Random();
            int    result = rand.Next(0, 37);
            string colour = "green";

            if (result > 0)
            {
                colour = result % 2 == 0 ? "red" : "black";
            }

            Gambling.SetClipboard("[Roulette] Result: " + result + " (" + colour + ")");
        };
    }
Exemplo n.º 10
0
    public void AdvanceGame()
    {
        if (gameOver)
        {
            return;
        }

        Random rand = new Random();
        int    dice = rand.Next(1, 7) + rand.Next(1, 7);

        if (point == -1)
        {
            if (dice == 7 || dice == 11)
            {
                Gambling.SetClipboard("[Craps] (PLAYER WIN) You roll a: " + dice);
                gameOver = true;
            }
            else if (dice == 2 || dice == 3 || dice == 12)
            {
                Gambling.SetClipboard("[Craps] (PLAYER LOSE) You roll a: " + dice);
                gameOver = true;
            }
            else
            {
                point = dice;
                Gambling.SetClipboard("[Craps] (POINT SET) You roll a: " + dice + ", roll another " + dice + " to win!");
            }
        }
        else
        {
            if (dice == 7)
            {
                Gambling.SetClipboard("[Craps] (PLAYER LOSE) You roll a: " + dice);
                gameOver = true;
            }
            else if (dice == point)
            {
                Gambling.SetClipboard("[Craps] (PLAYER WIN) You roll a: " + dice);
                gameOver = true;
            }
            else
            {
                Gambling.SetClipboard("[Craps] You roll a: " + dice + ", keep rolling, you need a " + point + " to win!");
            }
        }
    }
Exemplo n.º 11
0
    public void Double()
    {
        if (!isBust)
        {
            Random rand = new Random();

            if (rand.Next(1, chanceForBust[1] + 1) <= chanceForBust[0])
            {
                isBust = true;
                Gambling.SetClipboard("[Double or Nothing] (BUST): " + Gambling.FormatMoney(total) + "!");
            }
            else
            {
                total *= 2;
                Gambling.SetClipboard("[Double or Nothing] (DOUBLE): " + Gambling.FormatMoney(total) + "!");
            }
        }
    }
Exemplo n.º 12
0
    public void Hit()
    {
        if (playerStood)
        {
            Card newCard = deck.TakeNext();

            dealerHand.Add(newCard);

            if (GetTotal(dealerHand) > 21)
            {
                if (playerHand.Count == 2 && GetTotal(playerHand) == 21)
                {
                    Gambling.SetClipboard("[Blackjack] (PLAYER BLACKJACK) Dealer Hit: " + newCard.GetName + " (Total: " + GetTotal(dealerHand) + ") | Player Total: " + GetTotal(playerHand));
                }
                else
                {
                    Gambling.SetClipboard("[Blackjack] (DEALER BUST) Dealer Hit: " + newCard.GetName + " (Total: " + GetTotal(dealerHand) + ") | Player Total: " + GetTotal(playerHand));
                }
            }
            else if (GetTotal(dealerHand) >= 17)
            {
                if (GetTotal(dealerHand) > GetTotal(playerHand))
                {
                    Gambling.SetClipboard("[Blackjack] (DEALER WIN) Dealer Hit: " + newCard.GetName + " (Total: " + GetTotal(dealerHand) + ") | Player Total: " + GetTotal(playerHand));
                }
                else if (GetTotal(dealerHand) == GetTotal(playerHand))
                {
                    Gambling.SetClipboard("[Blackjack] (PUSH) Dealer Hit: " + newCard.GetName + " (Total: " + GetTotal(dealerHand) + ") | Player Total: " + GetTotal(playerHand));
                }
                else
                {
                    if (playerHand.Count == 2 && GetTotal(playerHand) == 21)
                    {
                        Gambling.SetClipboard("[Blackjack] (PLAYER BLACKJACK) Dealer Hit: " + newCard.GetName + " (Total: " + GetTotal(dealerHand) + ") | Player Total: " + GetTotal(playerHand));
                    }
                    else
                    {
                        Gambling.SetClipboard("[Blackjack] (PLAYER WIN) Dealer Hit: " + newCard.GetName + " (Total: " + GetTotal(dealerHand) + ") | Player Total: " + GetTotal(playerHand));
                    }
                }
            }
            else
            {
                Gambling.SetClipboard("[Blackjack] Dealer Hit: " + newCard.GetName + " (Total: " + GetTotal(dealerHand) + ") | Player Total: " + GetTotal(playerHand));
            }
        }
        else if (playerHand.Count == 0)
        {
            Card[] newCards = new Card[3] {
                deck.TakeNext(),    // Player's first card
                   deck.TakeNext(), // Player's second card
                   deck.TakeNext()  // Dealer's face card
            };

            playerHand.Add(newCards[0]);
            playerHand.Add(newCards[1]);
            dealerHand.Add(newCards[2]);

            Gambling.SetClipboard(
                "[Blackjack] Player Cards: " + newCards[0].GetName + " and " + newCards[1].GetName + "(Total: " + GetTotal(playerHand) + ") | Dealer Card: " + newCards[2].GetName + " (Total: " + GetTotal(dealerHand) + ")"
                );
        }
        else
        {
            Card newCard = deck.TakeNext();

            playerHand.Add(newCard);

            if (GetTotal(playerHand) > 21)
            {
                Gambling.SetClipboard("[Blackjack] (PLAYER BUST) Player Hit: " + newCard.GetName + " (Total: " + GetTotal(playerHand) + ")");
            }
            else
            {
                Gambling.SetClipboard("[Blackjack] Player Hit: " + newCard.GetName + " (Total: " + GetTotal(playerHand) + ")");
            }
        }
    }
Exemplo n.º 13
0
    void AdvanceGame()
    {
        if (hand.Count == 0)
        {
            heldCards = new List <int>();

            string result = "[Video Poker] Player Cards: | ";
            for (int i = 0; i < 5; i++)
            {
                Card newCard = deck.TakeNext();
                hand.Add(newCard);

                result += newCard.GetName + " | ";
            }

            result += "Please choose which cards to hold";

            Gambling.SetClipboard(result);
        }
        else if (!cardsHeld)
        {
            cardsHeld = true;
            string result = "[Video Poker] Player Cards: | ";

            for (int i = 0; i < 5; i++)
            {
                if (!heldCards.Contains(i))
                {
                    hand[i] = deck.TakeNext();
                }
                result += hand[i].GetName + " | ";
            }

            Gambling.SetClipboard(result);
        }
        else
        {
            if (IsFlush())
            {
                if (IsRoyal())
                {
                    Gambling.SetClipboard("[Video Poker] (PLAYER WIN): Royal Flush 250x");
                    return;
                }
                else if (IsStraight())
                {
                    Gambling.SetClipboard("[Video Poker] (PLAYER WIN): Straight Flush 50x");
                    return;
                }
            }

            Dictionary <string, int> totalRanks = TotalRanks();

            if (totalRanks.ContainsValue(4))
            {
                Gambling.SetClipboard("[Video Poker] (PLAYER WIN): Four of a Kind 25x");
                return;
            }
            else if (totalRanks.ContainsValue(3) && totalRanks.ContainsValue(2))
            {
                Gambling.SetClipboard("[Video Poker] (PLAYER WIN): Full House 9x");
                return;
            }

            if (IsFlush())
            {
                Gambling.SetClipboard("[Video Poker] (PLAYER WIN): Flush 6x");
                return;
            }

            if (IsStraight())
            {
                Gambling.SetClipboard("[Video Poker] (PLAYER WIN): Straight 4x");
                return;
            }

            if (totalRanks.ContainsValue(3))
            {
                Gambling.SetClipboard("[Video Poker] (PLAYER WIN): Three of a Kind 3x");
                return;
            }

            int  totalPairs    = 0;
            bool jacksOrHigher = false;
            foreach (KeyValuePair <string, int> total in totalRanks)
            {
                if (total.Value == 2)
                {
                    if (IsJackOrHigher(total.Key))
                    {
                        jacksOrHigher = true;
                    }
                    totalPairs++;
                }
            }

            if (totalPairs == 2)
            {
                Gambling.SetClipboard("[Video Poker] (PLAYER WIN): Two Pair 2x");
                return;
            }

            if (jacksOrHigher)
            {
                Gambling.SetClipboard("[Video Poker] (PLAYER WIN): Jacks or Higher 1x");
                return;
            }

            Gambling.SetClipboard("[Video Poker] (PLAYER LOSE): No Match");
        }
    }
Exemplo n.º 14
0
 public void Reset()
 {
     isBust = false;
     total  = betAmount;
     Gambling.SetClipboard("[Double or Nothing] Game Started: " + Gambling.FormatMoney(total));
 }
Exemplo n.º 15
0
 public void GameStart()
 {
     point    = -1;
     gameOver = false;
     Gambling.SetClipboard("[Craps] Game Started");
 }
Exemplo n.º 16
0
    void AdvanceGame()
    {
        Random rand = new Random();

        if (dealerDice.Count == 0)
        {
            if (playerDice.Count > 0)
            {
                switch (playerDice.Count/3)
                {
                    case 1:
                        Gambling.SetClipboard("[Six Shooter] (PLAYER WIN) 12x bet");
                        break;
                    case 2:
                        Gambling.SetClipboard("[Six Shooter] (PLAYER WIN) 2.6x bet");
                        break;
                    case 3:
                        Gambling.SetClipboard("[Six Shooter] (PLAYER WIN) 2x bet");
                        break;
                    default:
                        break;
                }
            }
            else
            {
                string result = "[Six Shooter] Dealer Dice: ";
                for (int i = 0; i < 6; i++)
                {
                    dealerDice.Add(rand.Next(1, 7));

                    result += "" + dealerDice[i];

                    if (i != 5)
                    {
                        result += "-";
                    }
                }
                Gambling.SetClipboard(result);
            }
        }
        else if (displayRemaining)
        {
            displayRemaining = false;

            string result = "";
            for (int i = 0; i < dealerDice.Count; i++)
            {
                result += "" + dealerDice[i];

                if (i != dealerDice.Count - 1)
                {
                    result += "-";
                }
            }
            Gambling.SetClipboard("[Six Shooter] Dealer Dice: " + result);
        }
        else
        {
            if(playerDice.Count == 9)
            {
                string result = "";
                for(int i = 0;i<dealerDice.Count;i++)
                {
                    result += "" + dealerDice[i];

                    if(i != dealerDice.Count - 1)
                    {
                        result += "-";
                    }
                }

                Gambling.SetClipboard("[Six Shooter] (DEALER WIN) Dice remaining: " + result);
            }
            else
            {
                string result = "";
                for (int i = 0; i < 3; i++)
                {
                    int dice = rand.Next(1, 7);

                    result += "" + dice;

                    playerDice.Add(dice);

                    if (dealerDice.Contains(dice))
                    {
                        for (int j = dealerDice.Count - 1; j >= 0; j--)
                        {
                            if (dealerDice[j] == dice)
                            {
                                dealerDice.RemoveAt(j);
                            }
                        }
                    }

                    if(i != 2)
                    {
                        result += "-";
                    }
                }

                displayRemaining = true;

                Gambling.SetClipboard("[Six Shooter] Player rolls: " + result + " (" + (3-(playerDice.Count/3)) + " remaining)");
            }
        }
    }
Exemplo n.º 17
0
    void AdvanceGame()
    {
        if (playerHand.Count == 0)
        {
            playerHand.Add(deck.TakeNext());
            playerHand.Add(deck.TakeNext());
            Gambling.SetClipboard("[Baccarat] Player Hand |" + playerHand[0].GetName + "|" + " |" + playerHand[1].GetName + "| (Total: " + GetTotal(playerHand) + ")");
        }
        else if (bankerHand.Count == 0)
        {
            bankerHand.Add(deck.TakeNext());
            bankerHand.Add(deck.TakeNext());
            Gambling.SetClipboard("[Baccarat] Banker Hand |" + bankerHand[0].GetName + "|" + " |" + bankerHand[1].GetName + "| (Total: " + GetTotal(bankerHand) + ")");
        }
        else
        {
            int playerTotal = GetTotal(playerHand);
            int bankerTotal = GetTotal(bankerHand);
            if (playerHand.Count == 2 && bankerHand.Count == 2 && !playerStood)
            {
                if (playerTotal == 8 || playerTotal == 9 || bankerTotal == 8 || bankerTotal == 9)
                {
                    if (playerTotal > bankerTotal)
                    {
                        Gambling.SetClipboard("[Baccarat] (PLAYER WIN) Player's Natural " + playerTotal + " beats Banker's " + bankerTotal);
                    }
                    else if (playerTotal < bankerTotal)
                    {
                        Gambling.SetClipboard("[Baccarat] (BANKER WIN) Banker's Natural " + bankerTotal + " beats Player's " + playerTotal);
                    }
                    else
                    {
                        Gambling.SetClipboard("[Baccarat] (TIE) Player's Natural" + playerTotal + " is matched by the Banker");
                    }
                }
                else
                {
                    if (playerTotal <= 5)
                    {
                        Card newCard = deck.TakeNext();
                        playerHand.Add(newCard);
                        Gambling.SetClipboard("[Baccarat] Player draws a |" + newCard.GetName + "| (Total: " + GetTotal(playerHand) + ")");
                    }
                    else
                    {
                        playerStood = true;
                        Gambling.SetClipboard("[Baccarat] Player stands at " + playerTotal);
                    }
                }
            }
            else
            {
                if (playerStood)
                {
                    if (bankerHand.Count == 2 && bankerStood == false)
                    {
                        if (bankerTotal <= 5)
                        {
                            bankerStood = true;
                            Card newCard = deck.TakeNext();
                            bankerHand.Add(newCard);
                            Gambling.SetClipboard("[Baccarat] Banker draws a |" + newCard.GetName + "| (Total: " + GetTotal(bankerHand) + ")");
                        }
                        else
                        {
                            bankerStood = true;
                            Gambling.SetClipboard("[Baccarat] Banker stands at " + bankerTotal);
                        }
                    }
                    else
                    {
                        if (bankerStood)
                        {
                            if (playerTotal > bankerTotal)
                            {
                                Gambling.SetClipboard("[Baccarat] (PLAYER WIN) Player's " + playerTotal + " beats Banker's " + bankerTotal);
                            }
                            else if (playerTotal < bankerTotal)
                            {
                                Gambling.SetClipboard("[Baccarat] (BANKER WIN) Banker's " + bankerTotal + " beats Player's " + playerTotal);
                            }
                            else
                            {
                                Gambling.SetClipboard("[Baccarat] (TIE) Player's " + playerTotal + " is matched by the Banker");
                            }
                        }
                    }
                }
                else
                {
                    if (playerHand.Count == 2)
                    {
                        Card newCard = deck.TakeNext();
                        playerHand.Add(newCard);
                        Gambling.SetClipboard("[Baccarat] Player draws a " + newCard.GetName + " (Total: " + GetTotal(playerHand) + ")");
                    }
                    else if (bankerStood)
                    {
                        if (playerTotal > bankerTotal)
                        {
                            Gambling.SetClipboard("[Baccarat] (PLAYER WIN) Player's " + playerTotal + " beats Banker's " + bankerTotal);
                        }
                        else if (playerTotal < bankerTotal)
                        {
                            Gambling.SetClipboard("[Baccarat] (BANKER WIN) Banker's " + bankerTotal + " beats Player's " + playerTotal);
                        }
                        else
                        {
                            Gambling.SetClipboard("[Baccarat] (TIE) Player's " + playerTotal + " is matched by the Banker");
                        }
                    }
                    else
                    {
                        int third = cardValues[playerHand[2].Rank];
                        bankerStood = true;

                        if (third == 2 || third == 3)
                        {
                            if (bankerTotal <= 4)
                            {
                                Card newCard = deck.TakeNext();
                                bankerHand.Add(newCard);
                                Gambling.SetClipboard("[Baccarat] Banker draws a |" + newCard.GetName + "| (Total: " + GetTotal(bankerHand) + ")");
                            }
                            else
                            {
                                Gambling.SetClipboard("[Baccarat] Banker stands at " + bankerTotal);
                            }
                        }
                        else if (third == 4 || third == 5)
                        {
                            if (bankerTotal <= 5)
                            {
                                Card newCard = deck.TakeNext();
                                bankerHand.Add(newCard);
                                Gambling.SetClipboard("[Baccarat] Banker draws a |" + newCard.GetName + "| (Total: " + GetTotal(bankerHand) + ")");
                            }
                            else
                            {
                                Gambling.SetClipboard("[Baccarat] Banker stands at " + bankerTotal);
                            }
                        }
                        else if (third == 6 || third == 7)
                        {
                            if (bankerTotal <= 6)
                            {
                                Card newCard = deck.TakeNext();
                                bankerHand.Add(newCard);
                                Gambling.SetClipboard("[Baccarat] Banker draws a |" + newCard.GetName + "| (Total: " + GetTotal(bankerHand) + ")");
                            }
                            else
                            {
                                Gambling.SetClipboard("[Baccarat] Banker stands at " + bankerTotal);
                            }
                        }
                        else if (third == 8)
                        {
                            if (bankerTotal <= 2)
                            {
                                Card newCard = deck.TakeNext();
                                bankerHand.Add(newCard);
                                Gambling.SetClipboard("[Baccarat] Banker draws a |" + newCard.GetName + "| (Total: " + GetTotal(bankerHand) + ")");
                            }
                            else
                            {
                                Gambling.SetClipboard("[Baccarat] Banker stands at " + bankerTotal);
                            }
                        }
                        else
                        {
                            if (bankerTotal <= 3)
                            {
                                Card newCard = deck.TakeNext();
                                bankerHand.Add(newCard);
                                Gambling.SetClipboard("[Baccarat] Banker draws a |" + newCard.GetName + "| (Total: " + GetTotal(bankerHand) + ")");
                            }
                            else
                            {
                                Gambling.SetClipboard("[Baccarat] Banker stands at " + bankerTotal);
                            }
                        }
                    }
                }
            }
        }
    }