public static void PokemonUsedMove(pokemon attackPokemon, Trainer defendPokemon, string moveUsed, int damageDealt, float superEffectiveCheck) { UpdatePokemonHp(defendPokemon); Console.SetCursorPosition(0, 8); Console.Write(new string (' ', Console.BufferWidth)); Console.SetCursorPosition(0, 8); Console.WriteLine(attackPokemon.name + " used " + moveUsed + "!"); Console.Write(new string(' ', Console.BufferWidth)); if (superEffectiveCheck == 2) { Console.SetCursorPosition(0, Console.CursorTop - 1); Console.WriteLine("It's super effective!"); } if (superEffectiveCheck == 0.5) { Console.SetCursorPosition(0, Console.CursorTop - 1); Console.WriteLine("It's not very effective..."); } if (superEffectiveCheck == 0) { Console.SetCursorPosition(0, Console.CursorTop - 1); Console.WriteLine("It doesn't have any effect..."); } Thread.Sleep(timeOut); }
public static void TrainerChallenge(Trainer ChallengingTrainer, pokemon startingPlayerPokemon) { Console.WriteLine(ChallengingTrainer.trainerName + " wants to battle!"); Console.WriteLine(ChallengingTrainer.trainerName + " sends out " + ChallengingTrainer.activePokemon.name); Console.WriteLine(startingPlayerPokemon.name + ", I choose you!"); Thread.Sleep(timeOut); Console.Clear(); }
public void setAIParty(pokemon[] pokemonList) { for (int i = 0; i < 3; i++) { partyofPokemon[i] = pokemonList[rand.Next(pokemonList.Length)]; while (partyofPokemon[i].isAvailable == false) { partyofPokemon[i] = pokemonList[rand.Next(pokemonList.Length)]; } partyofPokemon[i].isAvailable = false; } activePokemon = partyofPokemon[0]; }
public static void PokemonCombatantsHP(pokemon ThePokemon) { Console.Write(" " + ThePokemon.name); Console.SetCursorPosition(13, Console.CursorTop); Console.Write(" HP: [ ]"); Console.SetCursorPosition(19, Console.CursorTop); for (int i = 0; i < (ThePokemon.hp / 5); i++) { Console.Write("|"); } Console.SetCursorPosition(40, Console.CursorTop); Console.WriteLine(""); }
public void CheckAIAlive(ref bool PartyisStillAlive) { if (!activePokemon.isAlive) { Display.FaintedPokemon(this.activePokemon); Alive--; if (Alive > 0) { do { activePokemon = partyofPokemon[rand.Next(partyofPokemon.Length)]; } while (activePokemon.hp <= 0); Console.WriteLine(trainerName + " sends out " + activePokemon.name); Thread.Sleep(timeOut); } else { Console.WriteLine("All of " + trainerName + "'s Pokemon have fainted!"); PartyisStillAlive = false; Thread.Sleep(timeOut); } } }
static void Main(string[] args) { // init var Trainer playerTrainer = new Trainer("", true); Trainer aiTrainer = new Trainer("Youngster Joey"); //init Pokemon available in pool to choose from pokemon[] pokemons = new pokemon[10]; pokemons[0] = new pokemon(100, "Bulbasaur", element.elements.grass, 4); pokemons[1] = new pokemon(100, "Charmander", element.elements.fire, 7); pokemons[2] = new pokemon(100, "Squirtle", element.elements.water, 2); pokemons[3] = new pokemon(100, "Rattata", element.elements.normal, 9); pokemons[4] = new pokemon(100, "Pidgey", element.elements.flying, 6); pokemons[5] = new pokemon(100, "Spearow", element.elements.flying, 8); pokemons[6] = new pokemon(100, "Nidoran", element.elements.poison, 1); pokemons[7] = new pokemon(100, "Caterpie", element.elements.bug, 3); pokemons[8] = new pokemon(100, "Weedle", element.elements.bug, 5); pokemons[9] = new pokemon(100, "Pikachu", element.elements.electric, 10); Display.AskTrainerName(ref playerTrainer); //Ask for, and set, Player trainer name playerTrainer.setParty(pokemons); //Display selection of Pokemon, and have Player select party from pool aiTrainer.setAIParty(pokemons); //Creates a random party from remaining in pool for an ai Trainer Battle.NewBattle(playerTrainer, aiTrainer); //Starts a new battle with a AI trainer }
public static void SwitchedInPokemon(pokemon OneWhoHasSwitchedIn) { Console.WriteLine("You have selected " + OneWhoHasSwitchedIn.name); Thread.Sleep(timeOut); }
public static void FaintedPokemon(pokemon OneWhoHasFainted) { Console.WriteLine(OneWhoHasFainted.name + " has fainted!"); Thread.Sleep(timeOut); }