Ejemplo n.º 1
0
    public void randomOpponentAttack()
    {
        int rand = rnd.Next(2);

        if (rand == 0)
        {
            playerTakeDamage((int)(rnd.Next(3) + 1) / (rnd.Next(2) + 1) * pkmOpponentData.power1);
            pkmOppontentAnim.Attack1();
            if (pkmOppontentAnim.moveName1().Equals(""))
            {
                gameTeller.text = pkmOpponentName.text + " attacks miss!";
            }
            else
            {
                gameTeller.text = pkmOpponentName.text + " use " + pkmOppontentAnim.moveName1();
            }
        }
        else
        {
            playerTakeDamage((int)(rnd.Next(3) + 1) / (rnd.Next(2) + 1) * pkmOpponentData.power2);
            pkmOppontentAnim.Attack2();
            if (pkmOppontentAnim.moveName2().Equals(""))
            {
                gameTeller.text = pkmOpponentName.text + " attacks miss!";
            }
            else
            {
                gameTeller.text = pkmOpponentName.text + " use " + pkmOppontentAnim.moveName2();
            }
        }

        turn = 1 - turn;
    }
Ejemplo n.º 2
0
 public void Attack1()
 {
     turn = 1 - turn;
     opponentTakeDamage(pkmPlayerData.power1);
     changeStateButtonAttack(false);
     if (pkmPlayerAnim.moveName1().Equals(""))
     {
         gameTeller.text = pkmPlayerName.text + " attacks miss!";
     }
     else
     {
         gameTeller.text = pkmPlayerName.text + " use " + pkmPlayerAnim.moveName1();
     }
     pkmPlayerAnim.Attack1();
 }