Exemplo n.º 1
0
    public void NormalBoxOpen()
    {
        for (int i = 0; i < 5; i++)
        {
            _Pup1_Stars[i].texture = Resources.Load("images/star_e") as Texture;
        }
        int verseCode;

        if (_selectedChtCode != -1)
        {
            verseCode = Random.Range(bm.GetFirstVerseCodePerChapterCode(_selectedChtCode), bm.GetLastVerseCodePerChapterCode(_selectedChtCode));
        }
        else if (_selectedTmtCode != -1)
        {
            verseCode = Random.Range(bm.GetFirstVerseCodePerTestamentCode(_selectedTmtCode), bm.GetLastVerseCodePerTestamentCode(_selectedTmtCode));
        }
        else if (_selectedAbiCode != -1)
        {
            verseCode = Random.Range(bm.GetFirstVerseCodePerAbilityCode(_selectedAbiCode), bm.GetLastVerseCodePerAbilityCode(_selectedAbiCode));
        }
        else
        {
            verseCode = Random.Range(0, BibleManager._verseTotCount);
        }

        BibleData d = DataManager.bd[verseCode];

        _Pup1_VerseTitle.text = d.title;
        _Pup1_VerseText.text  = d.text;

        int txtCntForBE   = d.text.Replace(" ", "").Length;
        int rareRate      = fm.SetNormalRareStyle();
        int testamentCode = bm.GetTestamentCode(verseCode);
        int abiCode       = bm.GetAbilityCode(testamentCode);

        _Pup1_CardImage.texture   = Resources.Load("images/card" + rareRate) as Texture;
        _Pup1_AbilityIcon.texture = bm._abilityImages[2 * (abiCode - 1)];
        for (int i = 0; i < rareRate; i++)

        {
            _Pup1_Stars[i].texture = Resources.Load("images/star") as Texture;
        }

        long BE = (txtCntForBE + Random.Range(0, 21)) * (30 / long.Parse(Mathf.Pow(2, (5 - rareRate)) + ""));

        _Pup1_BibleEnergy.text = BE + "";
        if (rareRate < 2)
        {
            am.FindCardSoundPlay(0);
        }
        else
        {
            am.FindCardSoundPlay(1);
        }

        BibleCard c = new BibleCard(verseCode, bm.GetChapterCode(verseCode), testamentCode, abiCode, BE, rareRate);

        bm.SetVerseToCht(c);
        ChangeMenuUI();
    }