Ejemplo n.º 1
0
        } // End method Spin

        private int GetLinePayout(Symbol[] line, bool useFixedBonus = false)
        {
            int    count    = 1; // count of consecutive matching symbols, left to right
            Symbol sym      = line[0];
            int    bonusWin = 0;

            switch (sym)
            {
            case Symbol.LO:     // Bonus
                for (int i = 1; i < 3; i++)
                {
                    if (line[i] == Symbol.LO)
                    {
                        count++;
                    }
                    else
                    {
                        break;
                    }
                }

                if (count == 3)
                {
                    if (useFixedBonus)
                    {
                        bonusWin = 331;     // Average bonus win
                    }
                    else
                    {
                        // Use random bonus win
                        bonusWin = Bonus.GetPrizes(_rand);
                        Stats.BonusWinCount++;
                        Stats.BonusWinCredits += bonusWin;
                        Stats.GameBonusWin    += bonusWin;
                    }
                }
                else
                {
                    bonusWin = 0;
                }

                break;      // case Symbol.LO

            case Symbol.LT: // Scatter
                count = 1;  // Scatter handled at gameboard level, no win here
                break;      // case "LT"

            case Symbol.WS: // Wild
                Symbol altSym = Symbol.WS;

                for (int i = 1; i < NUM_REELS; i++)
                {
                    if ((line[i] == sym) || (line[i] == altSym))
                    {
                        count++;
                    }
                    else
                    {
                        if (!line[i].Equals(Symbol.LO) && !line[i].Equals(Symbol.LT) && altSym.Equals(Symbol.WS))
                        {
                            altSym = line[i];
                            count++;
                        }
                        else
                        {
                            break;
                        }
                    }
                }

                sym = altSym;     // count and sym are now set correctly

                // ANOMOLY FIX
                // 3 wilds pay more than 4 of anything but lobstermania
                // 4 wilds pay more than 5 of anything but lobstermania
                // Take greatest win possible

                // Leading 4 wilds
                if (line[1].Equals(Symbol.WS) && line[2].Equals(Symbol.WS) && line[3].Equals(Symbol.WS) && !line[4].Equals(Symbol.LM) && !line[4].Equals(Symbol.WS))
                {
                    sym   = Symbol.WS;
                    count = 4;
                }

                // Leading 3 wilds
                if (line[1].Equals(Symbol.WS) && line[2].Equals(Symbol.WS) && !line[3].Equals(Symbol.LM) && !line[3].Equals(Symbol.WS) && !line[4].Equals(line[3]) && !line[4].Equals(Symbol.WS))
                {
                    sym   = Symbol.WS;
                    count = 3;
                }

                break;   // case "WS"

            default:     // Handle all other 1st symbols not handled in cases above
                sym = line[0];
                for (int i = 1; i < NUM_REELS; i++)
                {
                    if (line[i].Equals(sym) || line[i].Equals(Symbol.WS))
                    {
                        count++;
                    }
                    else
                    {
                        break;
                    }
                }
                break;     // case default
            } // end switch

            if (sym.Equals(Symbol.WS) && count == 5)
            {
                Stats.NumJackpots++;
            }

            // count variable now set for number of consecutive line[0] symbols (1 based)
            count--; // adjust for zero based indexing

            if (bonusWin > 0)
            {
                return(bonusWin);
            }

            int lineWin = _payouts[count, GetSymIndex(sym)];

            return(lineWin);
        } // End method GetLinePayout
Ejemplo n.º 2
0
        } // End method Spin

        private int GetLinePayout(string[] line)
        {
            int    count    = 1; // count of consecutive matching symbols, left to right
            string sym      = line[0];
            int    bonusWin = 0;

            switch (sym)
            {
            case "LO":     // Bonus
                for (int i = 1; i < 3; i++)
                {
                    if (line[i] == "LO")
                    {
                        count++;
                    }
                    else
                    {
                        break;
                    }
                }

                if (count == 3)
                {
                    bonusWin = Bonus.GetPrizes();
                    stats.bonusWinCount++;
                    stats.bonusWinCredits += bonusWin;
                    stats.igBonusWin      += bonusWin;
                }
                else
                {
                    bonusWin = 0;
                }

                break;     // case "LO"

            case "LT":     // Scatter
                count = 1; // Scatter handled at gameboard level
                break;     // case "LT"

            case "WS":     // Wild
                string altSym = "WS";

                for (int i = 1; i < NUM_REELS; i++)
                {
                    if ((line[i] == sym) || (line[i] == altSym))
                    {
                        count++;
                    }
                    else
                    {
                        if (line[i] != "LO" && line[i] != "LT" && altSym == "WS")
                        {
                            altSym = line[i];
                            count++;
                        }
                        else
                        {
                            break;
                        }
                    }
                }

                sym = altSym;     // count and sym are now set correctly

                // ANOMOLY FIX
                // 3 wilds pay more than 4 of anything but lobstermania
                // 4 wilds pay more than 5 of anything but lobstermania
                // Take greatest win possible

                // Leading 4 wilds
                if ((line[1] == "WS") && (line[2] == "WS") && (line[3] == "WS"))
                {
                    if (line[4] == "LM")
                    {
                        sym   = "LM";
                        count = 5;
                    }
                    else
                    if (line[4] != "WS")
                    {
                        sym   = "WS";
                        count = 4;
                    }
                }

                // Leading 3 wilds
                if ((line[1] == "WS") && (line[2] == "WS") && (line[3] == "LM") && (line[4] == "WS") && (line[4] != "LM"))
                {
                    sym   = "LM";
                    count = 4;
                    goto Done;
                }
                if ((line[1] == "WS") && (line[2] == "WS") && (line[3] != "LM") && (line[3] != "WS") && (line[4] != line[3]))
                {
                    sym   = "WS";
                    count = 3;
                }

Done:
                break;   // case "WS"

            default:     // Handle all other 1st symbols not handled in cases above
                sym = line[0];
                for (int i = 1; i < NUM_REELS; i++)
                {
                    if ((line[i] == sym) || (line[i] == "WS"))
                    {
                        count++;
                    }
                    else
                    {
                        break;
                    }
                }
                break;     // case default
            } // end switch

            if ((sym == "WS") && (count == 5))
            {
                stats.numJackpots++;
            }

            // count variable now set for number of consecutive line[0] symbols (1 based)
            count--; // adjust for zero based indexing

            if (bonusWin > 0)
            {
                return(bonusWin);
            }

            int lineWin = PAYOUTS[count, GetSymIndex(sym)];

            return(lineWin);
        } // End method GetLinePayout