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; }
public void Attack2() { turn = 1 - turn; opponentTakeDamage(pkmPlayerData.power2); changeStateButtonAttack(false); if (pkmPlayerAnim.moveName2().Equals("")) { gameTeller.text = pkmPlayerName.text + " attacks miss!"; } else { gameTeller.text = pkmPlayerName.text + " use " + pkmPlayerAnim.moveName2(); } pkmPlayerAnim.Attack2(); }