Exemplo n.º 1
0
    public override bool ActOnPlayer(PlayerModelController pmc)
    {
        switch (name)
        {
        case PotionName.Health:
            if (pmc.GetHealth() == pmc.GetMaxHealth())
            {
                return(false);
            }
            pmc.Heal(Random.Range(2, 4));
            return(true);

        case PotionName.Mana:
            if (pmc.GetManaPercent() > 99f)
            {
                return(false);
            }
            pmc.HealMana(Random.Range(30, 70));
            return(true);

        case PotionName.Regen:
            pmc.AddRegenTime(Random.Range(2, 10));
            return(true);

        case PotionName.Invinc:
            pmc.AddInvincTime(Random.Range(2, 10));
            return(true);

        case PotionName.Strength:
            pmc.AddStrengthTime(Random.Range(2, 10));
            return(true);

        case PotionName.Speed:
            pmc.AddSpeedTime(Random.Range(2, 10));
            return(true);
        }
        Debug.LogError("Impossible Potion");
        return(true);
    }