/** * */ public void Attaque(Pokemon[] duelPokemons) { combatPokemon = new CombatPokemon(); combatPokemon.setCombatDescription(" #" + duelPokemons[currentTurn].NomPokemon.ToUpper() + "# attaque #" + duelPokemons[currentTurn ^ 1].NomPokemon.ToUpper() + "# "); duelPokemons[currentTurn].Attack(duelPokemons[currentTurn ^ 1]); if (duelPokemons[currentTurn].PtsVie <= 0) { duelPokemons[currentTurn].PtsVie = 0; } else if (duelPokemons[currentTurn ^ 1].PtsVie <= 0) { duelPokemons[currentTurn ^ 1].PtsVie = 0; } combatPokemon.setCombatDescription(duelPokemons[currentTurn].NomPokemon.ToUpper() + " a " + duelPokemons[currentTurn].PtsVie + " pts de vie et " + duelPokemons[currentTurn ^ 1].NomPokemon.ToUpper() + " a " + duelPokemons[currentTurn ^ 1].PtsVie + " pts de vie."); if (duelPokemons[1].PtsVie == 0) { switchPokemonAdversaire(duelPokemons); } if (duelPokemons[0].PtsVie == 0) { switchPokemon(duelPokemons); } }
private void b_combat_Click(object sender, EventArgs e) { CombatPokemon combat = new CombatPokemon(choixPokemon, pokeList[position], pokeList[choixpokeAdversaire]); this.Hide(); combat.ShowDialog(); // START COMBAT Combat.initGame(pokemons); _combat.tour(choixPokemon); }