mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 13:58:33 +00:00
Flag evo stone evolved pkm in eggs
Evolution stone pkm at level 1 slipped through (example Ninetails) while levelup evos were already caught. Add the check to getValidPreEvolutions as well as other evolution method checks. Closes #827
This commit is contained in:
parent
77c25c41d3
commit
80d81f92de
1 changed files with 17 additions and 0 deletions
|
@ -520,6 +520,9 @@ namespace PKHeX.Core
|
|||
}
|
||||
internal static IEnumerable<int> getLineage(PKM pkm)
|
||||
{
|
||||
if (pkm.IsEgg)
|
||||
return new[] {pkm.Species};
|
||||
|
||||
var table = getEvolutionTable(pkm);
|
||||
var lineage = table.getValidPreEvolutions(pkm, pkm.CurrentLevel);
|
||||
return lineage.Select(evolution => evolution.Species);
|
||||
|
@ -545,10 +548,16 @@ namespace PKHeX.Core
|
|||
}
|
||||
internal static bool getHasEvolved(PKM pkm)
|
||||
{
|
||||
if (pkm.IsEgg)
|
||||
return false;
|
||||
|
||||
return getValidPreEvolutions(pkm).Count() > 1;
|
||||
}
|
||||
internal static bool getHasEvolvedFormChange(PKM pkm)
|
||||
{
|
||||
if (pkm.IsEgg)
|
||||
return false;
|
||||
|
||||
if (pkm.Format >= 7 && EvolveToAlolanForms.Contains(pkm.Species))
|
||||
return pkm.AltForm == 1;
|
||||
if (pkm.Species == 678 && pkm.Gender == 1)
|
||||
|
@ -557,6 +566,9 @@ namespace PKHeX.Core
|
|||
}
|
||||
internal static bool getHasTradeEvolved(PKM pkm)
|
||||
{
|
||||
if (pkm.IsEgg)
|
||||
return false;
|
||||
|
||||
var table = getEvolutionTable(pkm);
|
||||
var lineage = table.getValidPreEvolutions(pkm, 100, skipChecks:true);
|
||||
return lineage.Any(evolution => EvolutionMethod.TradeMethods.Any(method => method == evolution.Flag)); // Trade Evolutions
|
||||
|
@ -866,6 +878,11 @@ namespace PKHeX.Core
|
|||
{
|
||||
if (lvl < 0)
|
||||
lvl = pkm.CurrentLevel;
|
||||
if (lvl == 1 && pkm.IsEgg)
|
||||
return new List<DexLevel>
|
||||
{
|
||||
new DexLevel { Species = pkm.Species, Level = 1 },
|
||||
};
|
||||
if (pkm.Species == 292 && pkm.Met_Level + 1 <= lvl && lvl >= 20)
|
||||
return new List<DexLevel>
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue