Esempio 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();
    }
Esempio n. 2
0
    public void TouchBible()
    {
        long totHaert = 0;

        while (true)
        {
            if (_findBibleRawText.Length == _findBibleText.text.Length)
            {
                SkipBible();
                break;
            }
            if (_findBibleRawText[_findBibleText.text.Length].Equals(' '))
            {
                _findBibleText.text += " ";
            }
            else
            {
                _findBibleText.text += _findBibleRawText[_findBibleText.text.Length];
                _touchCount         += 1;
                _findTouchNeed.text  = (int.Parse(_findTouchNeed.text) - 1).ToString();
                if (int.Parse(_findTouchNeed.text) == 0)
                {
                    int n = SetNormalRareStyle();
                    _cardImage.texture = Resources.Load("Images/card" + n) as Texture;

                    for (int j = 0; j < n; j++)
                    {
                        _starImage[j].texture = Resources.Load("Images/star") as Texture;
                    }

                    //FX Select AND Play
                    if (n == 1)
                    {
                        am.FindCardSoundPlay(0);
                    }
                    else
                    {
                        am.FindCardSoundPlay(1);
                    }

                    //Show Card's Title, BE, Ability
                    _findBibleTitle.text = _findBibleRawTitle;
                    _findBibleEnergy.gameObject.SetActive(true);
                    _bibleImage.GetComponent <RawImage>().texture = bm._abilityImages[2 * (_findAbilityCode - 1)];

                    //Card's BE Creating
                    long cardBE = (_touchCount + Random.Range(0, 21)) * (30 / long.Parse(Mathf.Pow(2, (5 - n)) + ""));
                    _findBibleEnergy.text = "+" + cardBE;

                    //Making VerseCard
                    BibleCard findCard = new BibleCard(_findVerseCode, bm.GetChapterCode(_findVerseCode), _findTestamentCode, _findAbilityCode, cardBE, n);
                    //Add VerseCard and PerfationInfo
                    bm.SetVerseToCht(findCard);
                    //Add UI VerseCard
                    //GameObject addCard = Instantiate(verseminiCard[n - 1], verseUI.transform);
                    //addCard.transform.Find("Text").GetComponent<Text>().text = findBibleRawTitle;

                    //Add Heart == Card's Text's Count
                    totHaert += _touchCount;
                    //for Touching Process End
                    break;
                }
                //for Show Texts Counts per TouchLv
                if (_touchCount % lm.GetTouchLvValue() == 0)
                {
                    break;
                }
            }
        }
        totHaert += lm.GetHeartGetValue();
        //for Touch Heart
        gm.AddHeart(totHaert);
    }