mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-28 10:46:43 -05:00
Yield specific static encounters for rby/gsc for moveset gen
This commit is contained in:
@@ -206,7 +206,7 @@ private static IEnumerable<IEncounterable> GetPossibleOfType(PKM pk, IReadOnlyLi
|
||||
{
|
||||
EncounterOrder.Egg => GetEggs(pk, needs, chain, version),
|
||||
EncounterOrder.Mystery => GetGifts(pk, needs, chain),
|
||||
EncounterOrder.Static => GetStatic(pk, needs, chain),
|
||||
EncounterOrder.Static => GetStatic(pk, needs, chain, version),
|
||||
EncounterOrder.Trade => GetTrades(pk, needs, chain, version),
|
||||
EncounterOrder.Slot => GetSlots(pk, needs, chain, version),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
|
||||
@@ -281,10 +281,11 @@ private static IEnumerable<MysteryGift> GetGifts(PKM pk, IReadOnlyCollection<int
|
||||
/// <param name="pk">Rough Pokémon data which contains the requested species, gender, and form.</param>
|
||||
/// <param name="needs">Moves which cannot be taught by the player.</param>
|
||||
/// <param name="chain">Origin possible evolution chain</param>
|
||||
/// <param name="version">Specific version to iterate for.</param>
|
||||
/// <returns>A consumable <see cref="IEncounterable"/> list of possible encounters.</returns>
|
||||
private static IEnumerable<EncounterStatic> GetStatic(PKM pk, IReadOnlyCollection<int> needs, IReadOnlyList<EvoCriteria> chain)
|
||||
private static IEnumerable<EncounterStatic> GetStatic(PKM pk, IReadOnlyCollection<int> needs, IReadOnlyList<EvoCriteria> chain, GameVersion version)
|
||||
{
|
||||
var encounters = EncounterStaticGenerator.GetPossible(pk, chain);
|
||||
var encounters = EncounterStaticGenerator.GetPossible(pk, chain, version);
|
||||
int gen = pk.Generation;
|
||||
if ((uint)gen <= 2)
|
||||
encounters = encounters.Concat(EncounterStaticGenerator.GetPossibleGBGifts(pk, chain, gen == 2 ? GameVersion.C : GameVersion.RBY));
|
||||
|
||||
@@ -25,7 +25,13 @@ public static IEnumerable<EncounterStatic> GetPossible(PKM pkm, IReadOnlyList<De
|
||||
if (gameSource == Any)
|
||||
gameSource = (GameVersion)pkm.Version;
|
||||
|
||||
var table = GetEncounterStaticTable(pkm, gameSource);
|
||||
var table = gameSource switch
|
||||
{
|
||||
RD or GN or BU or YW => StaticRBY.Where(z => z.Version.Contains(gameSource)),
|
||||
GD or SV => StaticGS.Where(z => z.Version.Contains(gameSource)),
|
||||
C => StaticC,
|
||||
_ => GetEncounterStaticTable(pkm, gameSource),
|
||||
};
|
||||
return table.Where(e => chain.Any(d => d.Species == e.Species));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user