private void OnSetPokemon(object sender, RoutedEventArgs e) { IPokemon pokemon = SendPokemonToWindow.ShowSelectDialog(this, true); if (pokemon != null) { for (int i = 0; i < newPokemonTeam.Count; i++) { if (i == teamIndex) { continue; } if (pokemon.Personality == newPokemonTeam[i].Personality && PokemonDatabase.GetStartingEvolutionDexID(pokemon.DexID) == PokemonDatabase.GetStartingEvolutionDexID(newPokemonTeam[i].DexID)) { TriggerMessageBox.Show(this, "Cannot use more than one Pokémon with the same personality and family.", "Duplicate Pokémon Detected"); return; } } if (teamIndex < newPokemonTeam.Count) { newPokemonTeam[teamIndex] = pokemon.CreateGBAPokemon(GameTypes.Any, false); } else { newPokemonTeam.Add(pokemon.CreateGBAPokemon(GameTypes.Any, false)); } RefreshTeam(); } }
public void AddPokemon(IPokemon pokemon) { pokePC.GameSave.IsChanged = true; IPokemon pkm = (pokemon != null ? (pokemon is GBAPokemon ? pokemon : pokemon.CreateGBAPokemon(GameType)): null); if (pkm != null) { pkm.GameType = GameType; pkm.PokeContainer = this; if (pokePC.GameSave != null) { pokePC.GameSave.SetPokemonOwned(pkm.DexID, true); } party.Add(pkm); } }
public void AddPokemon(IPokemon pokemon) { pokePC.GameSave.IsChanged = true; IPokemon pkm = (pokemon != null ? (pokemon is GBAPokemon ? pokemon : pokemon.CreateGBAPokemon(GameType)): null); int index = 0; for (index = 0; index < 3; index++) { if (originalPokemon[index] == null) { break; } } pkm.GameType = GameType; pkm.PokeContainer = this; if (pokePC.GameSave != null) { pokePC.GameSave.SetPokemonOwned(pkm.DexID, true); } finalPokemon[index] = pkm as GBAPokemon; originalPokemon[index] = pkm as GBAPokemon; SetGainedExperience(index, 0); }
public void AddPokemon(IPokemon pokemon) { pokePC.GameSave.IsChanged = true; IPokemon pkm = (pokemon != null ? (pokemon is GBAPokemon ? pokemon : pokemon.CreateGBAPokemon(GameType)): null); int index = 0; for (index = 0; index < 3; index++) { if (originalPokemon[index] == null) break; } pkm.GameType = GameType; pkm.PokeContainer = this; if (pokePC.GameSave != null) pokePC.GameSave.SetPokemonOwned(pkm.DexID, true); finalPokemon[index] = pkm as GBAPokemon; originalPokemon[index] = pkm as GBAPokemon; SetGainedExperience(index, 0); }