mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-03 17:29:13 +00:00
Add placeholder duplicate relearn move check
This commit is contained in:
parent
26d6143325
commit
110d25d50e
1 changed files with 19 additions and 0 deletions
|
@ -126,6 +126,9 @@ namespace PKHeX.Core
|
|||
if (splitInvalid && e is EncounterEggSplit x)
|
||||
FlagSplitbreedMoves(result, reqBase, x);
|
||||
|
||||
var dupe = IsAnyRelearnMoveDuplicate(pkm);
|
||||
if (dupe > 0)
|
||||
result[dupe] = new CheckResult(Severity.Invalid, LMoveSourceDuplicate, CheckIdentifier.RelearnMove);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -197,5 +200,21 @@ namespace PKHeX.Core
|
|||
reqBase = Math.Min(4, unique);
|
||||
return reqBase;
|
||||
}
|
||||
|
||||
private static int IsAnyRelearnMoveDuplicate(PKM pk)
|
||||
{
|
||||
int m1 = pk.RelearnMove1;
|
||||
int m2 = pk.RelearnMove2;
|
||||
|
||||
if (m1 != 0 && m1 == m2)
|
||||
return 1;
|
||||
int m3 = pk.RelearnMove3;
|
||||
if (m3 != 0 && (m1 == m3 || m2 == m3))
|
||||
return 2;
|
||||
int m4 = pk.RelearnMove4;
|
||||
if (m4 != 0 && (m1 == m4 || m2 == m4 || m3 == m4))
|
||||
return 3;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue