//ボタン系
 public void PushSignalReplayModeButton()
 {
     if (activeCountReplayMode > 0)
     {
         activeCountReplayMode = 0;
         StopReplayMode();
         mainManager.AddJackpotScore(5000);
     }
     else if (signalTestMode)
     {
         StartReplayMode(int.MaxValue);
     }
 }
Exemple #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Racket")
        {
            switch (itemCode)
            {
            case POINT_100:
                mainManager.AddGameScore(100);
                prefabSounds.GetPoint();
                break;

            case POINT_200:
                mainManager.AddGameScore(200);
                prefabSounds.GetPoint();
                break;

            case POINT_500:
                mainManager.AddGameScore(500);
                prefabSounds.GetPoint();
                break;

            case POINT_1000:
                mainManager.AddGameScore(1000);
                prefabSounds.GetPoint();
                break;

            case EXPAND_RACKET:
                racket.Expand();
                break;

            case SHRINK_RACKET:
                if (signalManager.IsActiveTrapGuard())
                {
                    prefabSounds.GetNothing();
                }
                else
                {
                    racket.Shrink();
                }
                break;

            case EXTRA_BALL:
                mainManager.AddRestOfBall();
                prefabSounds.GetExtraBall();
                break;

            case POWER_UP:
                signalManager.StartPoweredBall(1000);
                break;

            case PROTECTOR:
                signalManager.StartProtector(750);
                break;

            case LEVEL_UP:
                mainManager.AddJackpotScore(100);
                mainManager.LevelUp();
                break;

            case TRAP_GUARD:
                signalManager.StartTrapGuard(1500);
                break;

            case GAME_OVER:
                if (signalManager.IsActiveTrapGuard())
                {
                    prefabSounds.GetNothing();
                }
                else
                {
                    mainManager.StartGameOver();
                }
                break;

            case PRECIPITATE:
                signalManager.StartPrecipitate(1500);
                break;

            case SHOOTING:
                signalManager.StartShooting(750);
                break;

            case HOSTAGE_300:
                mainManager.AddGameScore(300);
                prefabSounds.GetPoint();
                break;

            case NEGATIVE_POINT_200:
                if (signalManager.IsActiveTrapGuard())
                {
                    prefabSounds.GetNothing();
                }
                else
                {
                    mainManager.AddGameScore(-200);
                }
                break;

            case FLASH:
                if (signalManager.IsActiveTrapGuard())
                {
                    prefabSounds.GetNothing();
                }
                else
                {
                    mainManager.StartFlash();
                }
                break;

            case COUNTERFEIT:
                if (signalManager.IsActiveTrapGuard())
                {
                    prefabSounds.GetNothing();
                }
                else
                {
                    mainManager.AddGameScore(-1000);
                    signalManager.StopAllSignals();
                    racket.SetStepOfLength(1);
                    prefabSounds.GetCounterfeit();
                }
                break;

            case MAGNET:
                signalManager.StartMagnet(1000);
                break;

            case STICKY:
                signalManager.StartSticky(1500);
                break;

            case DECELERATE:
                ball.Decelerate();
                break;

            case ACCELERATE:
                if (signalManager.IsActiveTrapGuard())
                {
                    prefabSounds.GetNothing();
                }
                else
                {
                    ball.Accelerate();
                }
                break;

            case MAX_SPEED:
                if (signalManager.IsActiveTrapGuard())
                {
                    prefabSounds.GetNothing();
                }
                else
                {
                    ball.MaxSpeed();
                }
                break;
            }
            Destroy(this.gameObject);
        }
        if (collision.gameObject.tag == "FailZone")
        {
            switch (itemCode)
            {
            case EXTRA_BALL:
                //複雑なシステムに使う
                break;

            case HOSTAGE_300:
                mainManager.MissingHostage300();
                break;
            }
            Destroy(this.gameObject);
        }
    }
    public void OnSwtichOn(int switchCode)
    {
        if (isIdle)
        {
            if (switchCode == 3)
            {
                audioSources[0].time = 0.0f;
                audioSources[0].Play();
                mainManager.AddGameScore(5);
                isIdle = false;
                slotSwitches[switchCode].SetTrigger("Off");
                slotBoard.SetTrigger("Rotating");
                for (int i = 0; i < 3; i++)
                {
                    vsDrumRotating[i] = true;
                    slotDrums[i].StartDrum();
                    slotSwitches[i].SetTrigger("Skyblue");
                }

                int randomNumber = Random.Range(0, 60);
                if (randomNumber == 0)
                {
                    decidedNumbers[0] = 0;
                    decidedNumbers[1] = 1;
                    decidedNumbers[2] = 1;
                }
                else if (randomNumber <= 10)
                {
                    isRiggedReach = false;
                    int randomNumber2 = feverNumbers[Random.Range(0, feverNumbers.Length)];
                    for (int i = 0; i < 3; i++)
                    {
                        decidedNumbers[i] = randomNumber2;
                    }
                }
                else if (randomNumber <= 30)
                {
                    isRiggedReach     = true;
                    riggedReachNumber = feverNumbers[Random.Range(0, feverNumbers.Length)];
                }
                else
                {
                    isRiggedReach = false;
                    for (int i = 0; i < 3; i++)
                    {
                        decidedNumbers[i] = Random.Range(0, 9);
                    }
                }
            }
        }
        else
        {
            if (switchCode == 0 || switchCode == 1 || switchCode == 2)
            {
                if (vsDrumRotating[switchCode])
                {
                    audioSources[1].time = 0.0f;
                    audioSources[1].Play();
                    mainManager.AddGameScore(1);
                    vsDrumRotating[switchCode] = false;
                    slotSwitches[switchCode].SetTrigger("Off");
                    if (isRiggedReach)
                    {
                        if (GetDramStatus() != 0)
                        {
                            decidedNumbers[switchCode] = riggedReachNumber;
                        }
                        else
                        {
                            decidedNumbers[switchCode] = Random.Range(0, 9);
                        }
                    }
                    slotDrums[switchCode].StopDrum(decidedNumbers[switchCode]);
                    switch (GetDramStatus())
                    {
                    case 0:
                        if (decidedNumbers[0] == decidedNumbers[1] && decidedNumbers[1] == decidedNumbers[2])
                        {
                            int      index      = decidedNumbers[0];
                            int[]    soundIndex = { 5, 6, 5, 5, 5, 5, 5, 6, 5 };
                            int[]    scores     = { 100, 0, 100, 100, 100, 100, 100, 0, 100 };
                            string[] triggers   = { "Fever", "Ouch", "Excellent", "Fever", "Fever", "Fever", "Excellent", "Ouch", "Fever" };
                            GenerateItem();
                            slotBoard.SetTrigger(triggers[index]);
                            mainManager.AddGameScore(scores[index]);
                            audioSources[soundIndex[index]].time = 0.0f;
                            audioSources[soundIndex[index]].Play();
                        }
                        else if (decidedNumbers[0] == 0 && decidedNumbers[1] == 1 && decidedNumbers[2] == 1)
                        {
                            slotBoard.SetTrigger("AtelierFever");

                            audioSources[7].time = 0.0f;
                            audioSources[7].Play();
                            mainManager.AddJackpotScore(14400);
                            mainManager.SetHasSlot144(true);
                        }
                        else
                        {
                            slotBoard.SetTrigger("Idle");
                        }
                        isIdle = true;
                        slotSwitches[3].SetTrigger("Rainbow");
                        break;

                    case 1:
                        if (decidedNumbers[1] == decidedNumbers[2])
                        {
                            int      index      = decidedNumbers[1];
                            int[]    soundIndex = { 2, 4, 2, 2, 2, 2, 2, 3, 2 };
                            string[] triggers   = { "Reach", "AtelierPinch", "Reach", "Reach", "Reach", "Reach", "Reach", "Pinch", "Reach" };
                            audioSources[soundIndex[index]].time = 0.0f;
                            audioSources[soundIndex[index]].Play();
                            slotBoard.SetTrigger(triggers[index]);
                        }
                        break;

                    case 2:
                        if (decidedNumbers[0] == decidedNumbers[2])
                        {
                            int      index      = decidedNumbers[0];
                            int[]    soundIndex = { 2, 3, 2, 2, 2, 2, 2, 3, 2 };
                            string[] triggers   = { "Reach", "Pinch", "Reach", "Reach", "Reach", "Reach", "Reach", "Pinch", "Reach" };
                            audioSources[soundIndex[index]].time = 0.0f;
                            audioSources[soundIndex[index]].Play();
                            slotBoard.SetTrigger(triggers[index]);
                        }
                        else if (decidedNumbers[0] == 0 && decidedNumbers[2] == 1)
                        {
                            audioSources[4].time = 0.0f;
                            audioSources[4].Play();
                            slotBoard.SetTrigger("AtelierReach");
                        }
                        break;

                    case 4:
                        if (decidedNumbers[0] == decidedNumbers[1])
                        {
                            int      index      = decidedNumbers[0];
                            int[]    soundIndex = { 2, 3, 2, 2, 2, 2, 2, 3, 2 };
                            string[] triggers   = { "Reach", "Pinch", "Reach", "Reach", "Reach", "Reach", "Reach", "Pinch", "Reach" };
                            audioSources[soundIndex[index]].time = 0.0f;
                            audioSources[soundIndex[index]].Play();
                            slotBoard.SetTrigger(triggers[index]);
                        }
                        else if (decidedNumbers[0] == 0 && decidedNumbers[1] == 1)
                        {
                            audioSources[4].time = 0.0f;
                            audioSources[4].Play();
                            slotBoard.SetTrigger("AtelierReach");
                        }
                        break;
                    }
                }
            }
        }
    }