Exemplo n.º 1
0
    /*MUTATED FRUIT: player uses a mutated fruit to various effects*/
    void UseMutatedFruit()
    {
        if (numFruits != 0)
        {
            numFruits--;

            int effect = Random.Range(0, 3);
            switch (effect)
            {
            case 0:             //Player will get hurt twice as much
                TopDownCharacterController.SetInDamageRatio(newDamageRatio);
                Debug.Log("HURT TWICE AS MUCH");
                break;

            case 1:             //Player regains health
                TopDownCharacterController.IncreaseLife(lifeIncrease);
                Debug.Log("LIFE INCREASE +1");
                break;

            case 2:             //Player gets more fruit
                numFruits += plusFruits;
                Debug.Log("TWO MORE FRUITS");
                break;
            }
        }
    }
Exemplo n.º 2
0
 /*EPIPEN: the player can move faster and takes less damage*/
 void Epipen()
 {
     if (canUseEpipen)
     {
         canUseEpipen = false;
         //Adjust speed of player and amount of damage done
         TopDownCharacterController.SetSpeedBonus(35f);
         TopDownCharacterController.SetInDamageRatio(0.5f);
     }
 }