Ejemplo n.º 1
0
    public void Defend()
    {
        if (myTurn)
        {
            AniManager.MeShield();
            int adder;
            int shield = 0;
            if (myMonster.level > yourMonster.level)
            {
                adder = (myMonster.level - yourMonster.level) * 3;
            }
            else
            {
                adder = -(myMonster.level - yourMonster.level) * 3;
            }
            switch (charged)
            {
            case 0:
                shield = 3;
                break;

            case 1:
                shield = 10 + adder;
                break;

            case 2:
                shield = 10 + adder * 3;
                break;

            case 3:
                shield = 10 + adder * 5;
                break;
            }
            myMonster.shield = shield;
            charged          = 0;
        }
        else
        {
            AniManager.YouShield();
            yourMonster.shield = 10 + Mathf.Abs((yourMonster.level - myMonster.level)) * 3;
        }
        ChangeTurn();
    }