예제 #1
0
    public void DoUpdate()
    {
        if (isDoneAnimating)
        {
            return;
        }
        if (Time.time >= lastCheck + (countdownState == 3?1.0f:1.5f))
        {
            lastCheck = Time.time;
            if (++countdownState < 2)
            {
                display.GetComponent <SpriteRenderer>().sprite = textSprites[3];
                PD.sounds.SetVoiceAndPlay(SoundPaths.NarratorPath + "020", 0);
                goDisplayed = true;
                if (PD.gameType == PersistData.GT.Versus || PD.gameType == PersistData.GT.QuickPlay)
                {
                    switch (Random.Range(0, 3))
                    {
                    case 0: PD.sounds.SetMusicAndPlay(SoundPaths.M_Title_DerivPath + PD.GetPlayerSpritePath(PD.p1Char, false, true)); break;

                    case 1: PD.sounds.SetMusicAndPlay(SoundPaths.M_Title_DerivPath + PD.GetPlayerSpritePath(PD.p2Char, false, true)); break;

                    default: PD.sounds.SetMusicAndPlay(SoundPaths.M_InGame); break;
                    }
                }
                else if (PD.gameType == PersistData.GT.Arcade && PD.level == 4)
                {
                    PD.sounds.SetMusicAndPlay(SoundPaths.M_Title_DerivPath + PD.GetPlayerSpritePath(PD.p2Char));
                }
                else if (PD.gameType == PersistData.GT.Arcade && PD.level > 5 && PD.difficulty > 8)
                {
                    PD.sounds.SetMusicAndPlay(SoundPaths.M_Title_DerivPath + "White");
                }
                else if (PD.gameType == PersistData.GT.Challenge)
                {
                    PD.sounds.SetMusicAndPlay(SoundPaths.M_InGame);
                }
                else if (PD.gameType == PersistData.GT.Campaign)
                {
                    if (PD.p2Char == PersistData.C.Everyone)
                    {
                        PD.sounds.SetMusicAndPlay(SoundPaths.M_LoseMusic);
                    }
                    else
                    {
                        PD.sounds.SetMusicAndPlay(SoundPaths.M_Title_DerivPath + PD.GetPlayerSpritePath(PD.p1Char, false, true));
                    }
                }
                else if ((PD.gameType == PersistData.GT.Arcade && PD.level > 5) || PD.difficulty > 6)
                {
                    PD.sounds.SetMusicAndPlay(SoundPaths.M_InGame_Intense);
                }
                else
                {
                    PD.sounds.SetMusicAndPlay(SoundPaths.M_InGame);
                }
            }
            else
            {
                isDoneAnimating = true;
                Destroy(display);
            }
        }
    }
예제 #2
0
    public void SayThingFromReaction(SpeechType type)
    {
        if (hidden)
        {
            return;
        }
        if (_player == 1 && _PD.gameType == PersistData.GT.Training)
        {
            return;
        }
        int    startidx, endidx;
        string storedPath = _path;

        if (_path == "Everyone")
        {
            System.Array values = System.Enum.GetValues(typeof(PersistData.C));
            storedPath = _PD.GetPlayerSpritePath((PersistData.C)values.GetValue(Random.Range(0, values.Length)));
        }
        if (storedPath == "MasterAlchemist")
        {
            startidx = 0; endidx = 17;
        }
        else if (storedPath == "White" || _path == "September")
        {
            switch (type)
            {
            case SpeechType.doDamage: startidx = 1; endidx = 9; break;

            case SpeechType.nonDamagePositive: startidx = 3; endidx = 9; break;

            case SpeechType.takeDamage: startidx = 9; endidx = 17; break;

            case SpeechType.nonDamageNegative: startidx = 12; endidx = 17; break;

            case SpeechType.win: startidx = 30; endidx = 31; break;

            case SpeechType.lose: startidx = 31; endidx = 32; break;

            default: startidx = 1; endidx = 2; break;
            }
        }
        else
        {
            switch (type)
            {
            case SpeechType.doDamage: startidx = 4; endidx = 20; break;

            case SpeechType.nonDamagePositive: startidx = 9; endidx = 20; break;

            case SpeechType.takeDamage: startidx = 20; endidx = 36; break;

            case SpeechType.nonDamageNegative: startidx = 25; endidx = 36; break;

            case SpeechType.win: startidx = 70; endidx = 76; break;

            case SpeechType.lose: startidx = 76; endidx = 82; break;

            default: startidx = 4; endidx = 5; break;
            }
        }
        int idx = Random.Range(startidx, endidx);

        SayThingFromXML(idx.ToString("D3"), false, storedPath);
    }