Exemple #1
0
    private int CheckLines()
    {
        int win = 0;

        foreach (var typeCell in typeCells)
        {
            foreach (var line in lines)
            {
                int counter = 0;
                foreach (var point in line.Points)
                {
                    if ((cells[(int)point.x][(int)point.y].TypeCell.Id == typeCell.Id) ||
                        (cells[(int)point.x][(int)point.y].TypeCell.typeOfCell == TypeCell.TypeOfCell.Wild))
                    {
                        counter++;
                    }
                }
                if (typeCell.GetScore(counter) > 0)
                {
                    Achivements.SetLinesCounter();
                    if (typeCell.typeOfCell == TypeCell.TypeOfCell.Wild)
                    {
                        AudioManager.Instance.ScatterWildSound();
                        Achivements.SetWildCounter();
                    }
                    if (typeCell.typeOfCell == TypeCell.TypeOfCell.Diamond)
                    {
                        diamonds++;
                        Purse.AddMoney(0, 1);
                        AudioManager.Instance.MoneySound();
                        SpecialEventsStore.SetCollectedDiamonds(levelId, 1);
                    }
                    if (typeCell.typeOfCell == TypeCell.TypeOfCell.Scatter)
                    {
                        Achivements.SetScatterCounter();
                        AudioManager.Instance.ScatterWildSound();
                        switch (typeCell.GetScore(counter))
                        {
                        case 1:
                            StartCoroutine(FreeSpinAdd(spin1));
                            break;

                        case 3:
                            StartCoroutine(FreeSpinAdd(spin3));
                            break;
                        }
                        LevelsState.AddFreeSpin(levelId, typeCell.GetScore(counter));
                        freeSpin = freeSpin;
                    }
                    else
                    {
                        win += (int)((float)(typeCell.GetScore(counter)) * (float)bet * .01f);
                    }
                    AudioManager.Instance.LineSound();
                    line.Show();
                }
            }
        }
        return(win);
    }
Exemple #2
0
 private void NewGame()
 {
     Purse.RemoveAllMoney();
     for (int i = 0; i < LevelPages.Length; i++)
     {
         LevelsState.AddFreeSpin(i, 10);
         LevelsState.LockLevel(i);
     }
     LevelsState.UnlockLevel(0);
     Close();
     StartScreenPage.Open();
 }