mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-14 00:07:15 +00:00
Update EncounterGenerator6.cs
Closes #3153 wc6 is the only one with deferred cards that matter
This commit is contained in:
parent
f63654d5ae
commit
f5b47f9116
1 changed files with 24 additions and 5 deletions
|
@ -16,11 +16,33 @@ namespace PKHeX.Core
|
|||
int ctr = 0;
|
||||
|
||||
var chain = EncounterOrigin.GetOriginChain(pkm);
|
||||
|
||||
IEncounterable? deferred = null;
|
||||
IEncounterable? partial = null;
|
||||
|
||||
if (pkm.WasEvent || pkm.WasEventEgg || pkm.WasLink)
|
||||
{
|
||||
foreach (var z in GetValidGifts(pkm, chain))
|
||||
{ yield return z; ++ctr; }
|
||||
if (ctr != 0) yield break;
|
||||
{
|
||||
var match = z.GetMatchRating(pkm);
|
||||
switch (match)
|
||||
{
|
||||
case Match: yield return z; ++ctr; break;
|
||||
case Deferred: deferred ??= z; break;
|
||||
case PartialMatch: partial ??= z; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctr != 0)
|
||||
{
|
||||
if (deferred != null)
|
||||
yield return deferred;
|
||||
|
||||
if (partial != null)
|
||||
yield return partial;
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (pkm.WasBredEgg)
|
||||
|
@ -30,9 +52,6 @@ namespace PKHeX.Core
|
|||
if (ctr == 0) yield break;
|
||||
}
|
||||
|
||||
IEncounterable? deferred = null;
|
||||
IEncounterable? partial = null;
|
||||
|
||||
foreach (var z in GetValidStaticEncounter(pkm, chain))
|
||||
{
|
||||
var match = z.GetMatchRating(pkm);
|
||||
|
|
Loading…
Reference in a new issue