//setup all the information of the start of battle public IEnumerator SetupBattle() { state = BattleState.START; battleCam.enabled = true; playerPokemon = PokemonFactory.Create(5, "Charizard"); //enemyPokemon = PokemonFactory.CreateRandom(); enemyPokemon = PokemonFactory.CreateRandom(); //Added more moves to the player for testing Move move2 = new Move("Fire Stuff"); Move move3 = new Move("Fire Blast"); Move move4 = new Move("Fly"); List <Move> MovesToadd = new List <Move> { move2, move3, move4 }; playerPokemon.moves.AddRange(MovesToadd); dialogText.text = "A crazy " + enemyPokemon.name + " appeared"; SetHud(); AssingMoves(); yield return(new WaitForSeconds(1.5f)); state = BattleState.PLAYERTURN; PlayerTurn(); }
private void pokemonComboBox_SelectedIndexChanged(object sender, EventArgs e) { string id = pokemonComboBox.Items[pokemonComboBox.SelectedIndex].ToString(); pokemon = PokemonFactory.Create(int.Parse(id)); Render(); }
public GymBox() { InitializeComponent(); pokemon = PokemonFactory.Create(4); this.pokemonBox.Render(pokemon); }
public static Pokemon Create(int level, string name) { // Let's parse the Pokedex.csv file to find the requested pokemon! // Note that now you can easily add custom pokemons or modify existing ones! :) using (var reader = new StreamReader(@"Assets\Pokedex.csv")) { // Let's call readline to skip the first line (the one with the headers) reader.ReadLine(); // We countinue reading one line at a time until we get to the end of the file while (!reader.EndOfStream) { // Each line is stored in the 'line' variable, and then split using the comma (CSV = Comma Separated Values) String line = reader.ReadLine(); String[] values = line.Split(','); // Now we can check if the name required is a match for the current line if (values[2].ToLower() == name.ToLower()) { // We have found the pokemon requested! return(PokemonFactory.Create(level, name)); } } } //if we get here, it means we couldn't find the specified pokemon, so let's raise an exception throw new ArgumentException("Not a valid pokemon!"); }
private static void Main(string[] args) { Pokemon pokemon1 = PokemonFactory.Create(1); Pokemon pokemon2 = PokemonFactory.Create(2); Console.WriteLine(pokemon1); Console.WriteLine(pokemon2); }
private void Form1_Load(object sender, EventArgs e) { Random random = new Random(); pokemon1 = PokemonFactory.Create(random.Next(1, 5)); pokemon2 = PokemonFactory.Create(random.Next(1, 5)); Render(); }
public void Render(Pokemon pokemon) { this.pokemon1 = pokemon; this.pictureBox1.Image = (Image)Properties.Resources.ResourceManager.GetObject(pokemon.ImageFileName); this.pokemon2 = PokemonFactory.Create(2); this.hpLabel.Text = "HP: " + pokemon1.CurrentHP.ToString(); this.pictureBox2.Image = (Image)Properties.Resources.ResourceManager.GetObject(pokemon2.ImageFileName); }
private static void Main(string[] args) { int[] nationalNos = new int[] { 1, 2, 25 }; Random random = new Random(); int nationalNo1 = nationalNos[random.Next(0, nationalNos.Length)]; int nationalNo2 = nationalNos[random.Next(0, nationalNos.Length)]; Pokemon pokemon1 = PokemonFactory.Create(nationalNo1); Pokemon pokemon2 = PokemonFactory.Create(nationalNo2); }
private static void Main(string[] args) { Pokemon pokemon1 = PokemonFactory.Create(args[0]); Pokemon pokemon2 = PokemonFactory.Create(args[1]); pokemon1.Attack(pokemon2); pokemon1.Attack(pokemon2); Console.WriteLine(pokemon1.CurrentHp); Console.WriteLine(pokemon2.CurrentHp); }
private void createPokemonButton_Click(object sender, EventArgs e) { PokemonPanel panel = new PokemonPanel(); Pokemon pokemon = PokemonFactory.Create("Bulbasaur"); pokemons.Add(pokemon); int count = pokemons.Count; panel.Location = new Point(14 + 270 * (count - 1), 93); panel.Render(pokemon); this.Controls.Add(panel); }
public MainWindow() { InitializeComponent(); nationalNos = new int[] { 1, 2, 25 }; random = new Random(); nationalNo1 = nationalNos[random.Next(0, nationalNos.Length)]; nationalNo2 = nationalNos[random.Next(0, nationalNos.Length)]; pokemon1 = PokemonFactory.Create(nationalNo1); pokemon2 = PokemonFactory.Create(nationalNo2); pokemon1.nationalNo = nationalNo1; pokemon2.nationalNo = nationalNo2; Render(); }
private void createPokemonButton_Click(object sender, EventArgs e) { string selectedItem = pokemonSelector.Items[pokemonSelector.SelectedIndex].ToString(); // MessageBox.Show(selectedItem); PokemonPanel panel = new PokemonPanel(); Pokemon pokemon = PokemonFactory.Create(selectedItem); pokemons.Add(pokemon); int count = pokemons.Count; panel.Location = new Point(14 + 270 * (count - 1), 93); panel.SetPokemon(pokemon); this.Controls.Add(panel); }
static void Main(string[] args) { Pokemon[] pokemons = new Pokemon[3]; pokemons[0] = PokemonFactory.Create("妙蛙種子"); pokemons[1] = PokemonFactory.Create("妙蛙草"); pokemons[2] = PokemonFactory.Create("妙蛙草"); pokemons[0].Cp = 5; pokemons[1].Cp = 2; pokemons[2].Cp = 10; Array.Sort(pokemons); foreach (Pokemon p in pokemons) { Console.WriteLine(p.Cp); } }
private static void Main(string[] args) { Pokemon pokemon = null; if (args.Length > 0) { foreach (string arg in args) { pokemon = PokemonFactory.Create(int.Parse(arg)); Console.WriteLine(pokemon); } } else { Console.WriteLine("未輸入編號,產生預設值:妙蛙種子"); pokemon = PokemonFactory.Create(1); Console.WriteLine(pokemon); } }
private static void Main(string[] args) { int nationalNo1 = 1; int nationalNo2 = 1; if (args.Length == 2) { int.TryParse(args[0], out nationalNo1); int.TryParse(args[1], out nationalNo2); } else if (args.Length == 1) { int.TryParse(args[0], out nationalNo1); } else { Console.WriteLine("未輸入參數,用預設妙蛙種子對戰"); } Pokemon pokemon1 = PokemonFactory.Create(nationalNo1); Pokemon pokemon2 = PokemonFactory.Create(nationalNo2); pokemon1.Attack(pokemon2); }
// Use this for initialization void Start() { pokemon = PokemonFactory.Create(2, "pikachu"); // You can also crate random pokemons: //pokemon = PokemonFactory.CreateRandom(); }
// Use this for initialization void Start() { playerPokemon = PokemonFactory.Create(2, "charmander"); //, pokeSprite // You can also crate random pokemons: }
public Form1() { InitializeComponent(); pokemon = PokemonFactory.Create(1); Render(); }
private static void Main(string[] args) { Pokemon pokemon1 = PokemonFactory.Create(int.Parse(args[0])); Pokemon pokemon2 = PokemonFactory.Create(int.Parse(args[1])); }