Example #1
0
    public void Buff(int numberOfOffering)
    {
        soundScript.PlaySound(TYPE_AUDIO.Bonus);
        int randomBuff;

        switch (numberOfOffering)
        {
        case 1:
            randomBuff = Random.Range(1, 2);
            if (randomBuff == 1)
            {
                villageScript.PlusOneVillager();
                godVoiceDisplay.color = new Color(1, 1, 1, 1);
                godVoiceDisplay.text  = "Voilà une nouvelle âme pure pour ton clan !";
                StartCoroutine(GodVoiceFade());
            }
            else
            {
                playerScript.DoubleWood();
                godVoiceDisplay.color = new Color(1, 1, 1, 1);
                godVoiceDisplay.text  = "Un peu de bois avec ton bois ?";
                StartCoroutine(GodVoiceFade());
            }

            break;

        case 2:
            randomBuff = Random.Range(1, 2);
            if (randomBuff == 1)
            {
                treeManagerScript.DoubleTreeLife();
                godVoiceDisplay.color = new Color(1, 1, 1, 1);
                godVoiceDisplay.text  = "J'ai béni la forêt de ma protection";
                StartCoroutine(GodVoiceFade());
            }
            else     //if (randomBuff == 2)
            {
                villageScript.DoublePassifGain();
                godVoiceDisplay.color = new Color(1, 1, 1, 1);
                godVoiceDisplay.text  = "Mate moi ces biscotos";
                StartCoroutine(GodVoiceFade());
            }
            //else
            //{
            //    //+1 tree in tree list
            //}

            break;

        case 3:
            randomBuff = Random.Range(1, 2);
            if (randomBuff == 1)
            {
                barricadeManagerScript.DoubleBarricadeHealth();
                godVoiceDisplay.color = new Color(1, 1, 1, 1);
                godVoiceDisplay.text  = "Vous ne passerez pas !";
                StartCoroutine(GodVoiceFade());
            }
            else
            {
                //cut wave in half
                godVoiceDisplay.color = new Color(1, 1, 1, 1);
                godVoiceDisplay.text  = "Allez, ça dégage";
                StartCoroutine(GodVoiceFade());
            }
            break;
        }
    }