Fix alolan evolutionary lines

This commit is contained in:
Kurt
2016-11-10 20:45:58 -08:00
parent cd29b5f8f0
commit 0af8cdd655

View File

@@ -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;