Exemplo n.º 1
0
        public void SwitchMode(SlotMode mode = null)
        {
            if (mode == null)
            {
                mode = current;
                if (mode == bonusMode)
                {
                    if (slot.gameInfo.bonuses == 0)
                    {
                        mode = freeSpinMode;
                    }
                }
                if (mode == freeSpinMode)
                {
                    if (slot.gameInfo.bonuses > 0)
                    {
                        mode = bonusMode;
                    }
                    else if (slot.gameInfo.freeSpins == 0)
                    {
                        mode = defaultMode;
                    }
                }
                if (mode == defaultMode)
                {
                    if (slot.gameInfo.bonuses > 0)
                    {
                        mode = bonusMode;
                    }
                    else if (slot.gameInfo.freeSpins > 0)
                    {
                        mode = freeSpinMode;
                    }
                }
            }

            if (mode != current)
            {
                slot.symbolManager.ApplySymbolMap(cleanMap, mode.symbolSwaps);
                SlotModeInfo info = new SlotModeInfo(current);
                current = mode;
                slot.callbacks.onSlotModeChange.Invoke(info);
            }
        }
Exemplo n.º 2
0
        private void ParseReels()
        {
            reelMap.Clear();
            SlotMode cleanMode = new SlotMode();

            foreach (SlotMode mode in new SlotMode[] { cleanMode, defaultMode, freeSpinMode, bonusMode })
            {
                List <Symbol[]> r = new List <Symbol[]>();
                for (int j = 0; j < reelLength; j++)
                {
                    r.Add(new Symbol[symbolsPerReel]);
                }
                for (int x = 0; x < reelLength; x++)
                {
                    for (int y = 0; y < symbolsPerReel; y++)
                    {
                        Symbol symbol = slot.reels[x].symbols[y];
                        if (mode.symbolSwaps != null)
                        {
                            for (int i = 0; i < mode.symbolSwaps.Count; i++)
                            {
                                if (symbol == mode.symbolSwaps[i].from)
                                {
                                    symbol = mode.symbolSwaps[i].to;
                                }
                            }
                        }
                        r[x][y] = symbol;
                        if (mode == cleanMode)
                        {
                            r[x][y].log.count++;
                        }
                    }
                }
                reelMap.Add(mode, r);
            }
        }
Exemplo n.º 3
0
 public void Initialize()
 {
     cleanMap = slot.symbolManager.GetSymbolMap();
     current  = defaultMode;
 }
Exemplo n.º 4
0
 public SlotModeInfo(SlotMode lastMode)
 {
     this.lastMode = lastMode;
 }
Exemplo n.º 5
0
 public int NewCostPerSpin(SlotMode mode)
 {
     return((defaultMode.costPerLine - mode.costPerLine) * lines.Length);
 }
Exemplo n.º 6
0
 public int CostPerSpin(SlotMode mode)
 {
     return(mode.costPerLine * lines.Length);
 }