mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-01 02:16:50 -05:00
Fix alolan evolutionary lines
This commit is contained in:
@@ -206,12 +206,12 @@ public bool Valid(PKM pkm, int lvl)
|
||||
case 4:
|
||||
if (pkm.Format > pkm.GenNumber) // Pal Park / PokeTransfer updates Met Level
|
||||
return true;
|
||||
return pkm.Met_Level < Level;
|
||||
return pkm.Met_Level < lvl;
|
||||
|
||||
case 5: // Bank keeps current level
|
||||
case 6:
|
||||
case 7:
|
||||
return lvl >= Level && (!pkm.IsNative || pkm.Met_Level < Level);
|
||||
return lvl >= Level && (!pkm.IsNative || pkm.Met_Level < lvl);
|
||||
|
||||
}
|
||||
return false;
|
||||
@@ -228,6 +228,17 @@ public DexLevel GetDexLevel(int lvl)
|
||||
Flag = Method,
|
||||
};
|
||||
}
|
||||
public DexLevel GetDexLevel(int species, int lvl)
|
||||
{
|
||||
|
||||
return new DexLevel
|
||||
{
|
||||
Species = species,
|
||||
Level = lvl,
|
||||
Form = Form,
|
||||
Flag = Method,
|
||||
};
|
||||
}
|
||||
|
||||
public EvolutionMethod Copy(int species)
|
||||
{
|
||||
@@ -274,7 +285,11 @@ public IEnumerable<DexLevel> getExplicitLineage(PKM pkm, int lvl)
|
||||
if (!evo.Valid(pkm, lvl))
|
||||
continue;
|
||||
|
||||
dl.Add(evo.GetDexLevel(lvl));
|
||||
if (evo.Species > 802) // Gen7 Personal Formes -- unmap the forme personal entry to the actual species ID since species are consecutive
|
||||
dl.Add(evo.GetDexLevel(pkm.Species - Chain.Count + i, lvl));
|
||||
else
|
||||
dl.Add(evo.GetDexLevel(lvl));
|
||||
|
||||
if (evo.RequiresLevelUp)
|
||||
lvl--;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user