public IEnumerator ValidateWord(string word, int potionCount)
    {
        if (!History[History.Count - 1].IsWordFound(word))   // first check if word has already been created
        {
            bool valid = DictionaryManager.Instance.ValidWord(word);

            if (valid)
            {
                Debug.Log("valid");
                //TODO: animate word moving up into sky
                /* Play the validWord sound effect */
                AudioManager.Instance.PlayEffect(AudioManager.SoundEffects.ValidWord);
                /* Add the found word to the history */
                History[History.Count - 1].AddFoundWord(word);
                StartCoroutine(AddWordToBook(word));
                // add extra time for creating long words and using blends
                if (word.Length >= 4)
                {
                    AddTime(word.Length + word.Length - potionCount);
                }
                cauldron.InstantUpdateSprite();
                yield return(new WaitForSeconds(0.75f));

                cauldron.Clear();
            }
            else
            {
                Debug.Log("not valid");
                //TODO: animate cauldron exploding
                /* Play the invalidWord sound effect */
                AudioManager.Instance.PlayEffect(AudioManager.SoundEffects.InvalidWord);
                yield return(null);

                cauldron.Clear();
            }
        }
        else
        {
            Debug.Log("already made");
            //TODO: animate cauldron exploding
            /* Play the reusedWord sound effect */
            AudioManager.Instance.PlayEffect(AudioManager.SoundEffects.ReusedWord);
            yield return(null);

            cauldron.Clear();
        }
    }
Exemplo n.º 2
0
    public void ParsePotion()
    {
        Dictionary <Reagent.ReagentType, int> reagents = Cauldron.Reagents;

        /*String debug = "";
         * foreach (KeyValuePair<Reagent.ReagentType, int> rea in reagents)
         * {
         *  debug += rea.Value + " : ";
         * }
         * Debug.Log("Regent input = " + debug);*/

        /*
         * T͉o̖͔̬̲͙̲ ̬̱͇̘͔̗in̲̦͇̫͚̼v̡͍̜o̧̲̥͈͕k͝e̹̞͎ ̩̩̦͇̹͠ͅt̠̣̟̘̟̣͉h̛̹̹̻͓̺̞̖e͓̭̣͍͙̰̻͠ ̺̯̲ͅͅḥ̬͖̩̫̣i͕͈v̷͓̬̝̬e̙̲͝-m̷͍̹̠̣̯͕̣i̷̳͎̼̰͓ͅn̘̱̟̪͡d̯̬͚ ̻͖̫̥r̡e̶̩̮̦̥̰̙ͅp̱r̦͍̪̪͢ẹ̟̟͎̻̭̲s̱̕e̷̺̝̘͉̭͈ͅn̼͈͎t̶̝i̺̲̰͕͍̫n̸̮͈g͇̙̱̝̠͇͘ ̟̬̹̻͉c̬͉̰̖͖̩̩h̠̺̲a̼̬o̺͕̳ș.͕̺̩͔͠
         * ̛̥̪̜I̥͟n̷̼̻̼v̭̀o̷̱̩̟̯̼k̷͈i̭͢n̟̩̟͙g̞̖̭͕̘ ͞ͅt͈͈́ͅh̟̩e̸̟͎̝ͅ f̷̞͖̲̺e͇͇e̶̤l̟̭̪̕i̘̜̫̘̞̣̯ņg̟̝ ̺͕o̻͇̪͚͇̬f͎̮̟̝̗ ͏͈̜͉͍̮c̥̮̜̥̙̘̞ha͍̣͔̥̺ͅo̖̮̭̣̥ṣ̳͙̲͈̘͜.̥͚̟͜
         * W̴̠̞̯i͈͈̫t̵̺͙͚̙̝h̘̩͍̣ ̫̺͙̣̪ͅo̺u͚̭̘̰̟t̢͇͓͈͖̹ ̨ǫ͈̻͇r̦d͔̜̝̲̺̩e̸͓̝̠̼͖̬r̥͙̯.̘̠͓̣̗̥ͅ
         * ̟̺̣T̴̰͖͍̙͚ͅh̼̟̙e̪̥̼̤͎̯͝ ̢̺͖̘̭̲̻N̰̪̰e̢̯̬͚̣̩͍ẕ̰̬̲p̶͍̙̤̰̠͉ͅe̫̮̰̲r͏̫d̜i̵͇͇a̶̜͓̤͍̬͇͔ṇ̶̮͚̹̗̳ ̶̟h̝͈̳͈̣ͅi̢͕v̦͇͈̫̮̺ͅe͢-̳͇̝̭m͙̩͚̰̘i̪̺̜̭n̯̣ḍ̩̱̦̘ ̴̗o̭̭͔̹̳̹̳f̝̘̪̼̬͔̱ ̱c̲͈h͡a̘o̮̲̖̗̬̜s̥̖͕̜.̨̬̫̪̼̭̰͍ ̳Ẓ̪̥a͓̗l͙̯̩̻̮g͕͓͓͘ò̬̳͍̦ͅ.̪͇
         * ̜̺͉̳́H̬͠e̟ ͔͔̹̩̲̣͖w̸̬h̙̖̣o͔̠ ̤W̱̟̘̲͢ạḭ͝t̥̬̠̼̞̺̳ṣ̱͖̩̱̼ ͇̖͔̲͢B̡̤ͅe̺h̪̖̜͍͇̞͔͢i͓̝̞͉͉̙̤n̸̲̫̝̣̦͉̱d͟ ̠̗̮̘T̰͔͎̦̳̤͙́h̯͈̯̯̩̘ḛ̠̞̝ ̷͎͖̬W̼̤̫a͖̠͢l̰̠͘l͚̹̻͓.̰͕͉̞͈̪
         * ̹͙̠̭͇Z̞͙A̗͈͈̠̦L̷G̤͔O!̻́
         */
        if (reagents[Reagent.ReagentType.Urn] > 10)
        {
            ZALGO();
            Cauldron.Clear();
            return;
        }

        int[] effectSchema = CalcEffectSchema(reagents);

        String mes = CalcMessage(effectSchema);

        Message(mes);

        Cauldron.Clear();

        if (_objective != null)
        {
            _objective.CheckObjective(effectSchema);
        }
    }