Search mystery gift relearn moves for needed moves

Add to encountertrades searcher, for futureproofing

solves gen8 mg searching volt tackle pikachu
This commit is contained in:
Kurt
2021-09-06 11:43:42 -07:00
parent 9751a75f59
commit 41b1aaeb19

View File

@@ -291,7 +291,7 @@ private static IEnumerable<MysteryGift> GetGifts(PKM pk, IReadOnlyCollection<int
yield return gift;
continue;
}
var em = gift.Moves;
var em = gift.Moves.Concat(gift.Relearn);
if (!needs.Except(em).Any())
yield return gift;
}
@@ -373,6 +373,8 @@ private static IEnumerable<EncounterTrade> GetTrades(PKM pk, IReadOnlyCollection
IEnumerable<int> em = trade.Moves;
if (trade.Generation <= 2)
em = em.Concat(MoveLevelUp.GetEncounterMoves(trade.Species, 0, trade.Level, trade.Version));
else if (trade is IRelearn { Relearn: { Count: not 0 } } r)
em = em.Concat(r.Relearn);
if (!needs.Except(em).Any())
yield return trade;
}