Example #1
0
    public void Onclick(string type)
    {
        if (!gameOver && Player_turn)
        {
            if (type == "magic")
            {
                if (Player.getMp() >= 60)
                {
                    Player.Usemp(60);

                    Enemy2.takeDamage(60);
                    Debug.Log("magic");
                    currentState = BattleStates.ENEMYCHOICE;
                }
                else
                {
                    currentState = BattleStates.PLAYERCHOICE;
                    Debug.Log("playerchoice no mana");
                }
            }
            else if (type == "melee")
            {
                Enemy.takeDamage(0);
                Enemy2.takeDamage(60);
                Debug.Log("melee");

                currentState = BattleStates.ENEMYCHOICE;
            }
            else if (type == "recover")
            {
                Player.TakeDamage(Player.getHp() - Player.getMaxHp());
                Player.Usemp(Player.getMp() - Player.getMaxMp());
            }
            else if (type == "objeto")
            {
                Player.TakeDamage(Player.getHp() - Player.getMaxHp());
                Player.Usemp(Player.getMp() - Player.getMaxMp());
            }
            //currentState = (BattleStates)(((int)currentState + 1)%5);
            Player_turn = false;
        }
    }
Example #2
0
 void setbar()
 {
     bar.maxValue  = player.getMaxHp();
     mana.maxValue = player.getMaxMp();
 }