public bool PickupEgg(EvolutionTree tree) { if (activePets.Count >= maxActive) { return(false); } ActivePet pet = PetFactory.CreateEgg(tree); if (pet != null) { StartCoroutine(CreateEgg(pet)); } return(true); }
private static IEnumerable<int> Get(PersonalTable table, int gen, int species, int form) { if (species > table.MaxSpeciesID) yield break; if (form >= table[species].FormCount) yield break; var hisui = new[] { 155, 156, 501, 502, 548, 627, 704, 712, 722, 723 }; // pre-evos with branched evo paths only possible in LA EvolutionTree t; var pt = PersonalTable.LA; if (((PersonalInfoLA)pt.GetFormEntry(species, form)).IsPresentInGame && !hisui.Contains(species)) t = EvolutionTree.GetEvolutionTree(new PA8 { Version = (int)GameVersion.PLA }, 8); else t = EvolutionTree.GetEvolutionTree(gen); var tableEvos = t.GetEvolutions(species, form); foreach (var evo in tableEvos) yield return evo; }
/// <summary> /// Gets possible encounters that allow all moves requested to be learned. /// </summary> /// <param name="pk">Rough Pokémon data which contains the requested species, gender, and form.</param> /// <param name="moves">Moves that the resulting <see cref="IEncounterable"/> must be able to learn.</param> /// <param name="version">Specific version to iterate for.</param> /// <returns>A consumable <see cref="IEncounterable"/> list of possible encounters.</returns> public static IEnumerable <IEncounterable> GenerateVersionEncounters(PKM pk, IEnumerable <int> moves, GameVersion version) { if (pk.Species == 0) // can enter this method after failing to set a species ID that cannot exist in the format { return(Array.Empty <IEncounterable>()); } pk.Version = (int)version; var context = pk.Context; if (context is EntityContext.Gen2 && version is GameVersion.RD or GameVersion.GN or GameVersion.BU or GameVersion.YW) { context = EntityContext.Gen1; // try excluding baby pokemon from our evolution chain, for move learning purposes. } var et = EvolutionTree.GetEvolutionTree(context); var chain = et.GetValidPreEvolutions(pk, maxLevel: 100, skipChecks: true); int[] needs = GetNeededMoves(pk, moves, chain); return(PriorityList.SelectMany(type => GetPossibleOfType(pk, needs, version, type, chain))); }
public void ScrapChoice() { currentChoice = null; UpdateText(); }
public void ChooseEgg(string treeName) { currentChoice = GameManager.instance.evolutionGarden.GetTree(treeName); UpdateText(); }