mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
Add handling for mid-chain lowlvl encounter evos
haunter caught at level 20, transferred at 24, leveled once as gengar did not allow gengar in the chain as it is assumed (incorrectly) that gengar is evolved after transfer. determine if the lower levels of the next step's evolution rung are valid, using the same logic as pikachu case but to handle the other side Closes #1564 (should probably refactor the encounter chain generator to use the base encounter data if known, but oh well works fine and isn't a cpu hog)
This commit is contained in:
parent
38989b4747
commit
9cac3738dc
1 changed files with 14 additions and 7 deletions
|
@ -1563,16 +1563,23 @@ namespace PKHeX.Core
|
|||
var last = vs.Last();
|
||||
if (last.MinLevel > 1) // Last entry from vs is removed, turn next entry into the wild/hatched pokemon
|
||||
{
|
||||
last.MinLevel = 1;
|
||||
last.MinLevel = Encounter.LevelMin;
|
||||
last.RequiresLvlUp = false;
|
||||
var first = vs.First();
|
||||
if (first.MinLevel == 2 && !first.RequiresLvlUp)
|
||||
if (!first.RequiresLvlUp)
|
||||
{
|
||||
// Example Raichu in gen 2 or later,
|
||||
// because Pichu requires level up Minimum level of Raichu would be 2
|
||||
// but after removing Pichu because the origin species is Pikachu, Raichu min level should be 1
|
||||
first.MinLevel = 1;
|
||||
first.RequiresLvlUp = false;
|
||||
if (first.MinLevel == 2)
|
||||
{
|
||||
// Example Raichu in gen 2 or later,
|
||||
// because Pichu requires level up Minimum level of Raichu would be 2
|
||||
// but after removing Pichu because the origin species is Pikachu, Raichu min level should be 1
|
||||
first.MinLevel = 1;
|
||||
first.RequiresLvlUp = false;
|
||||
}
|
||||
else // ingame trade / stone can evolve immediately
|
||||
{
|
||||
first.MinLevel = last.MinLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Maxspec is used to remove future gen evolutions, to gather evolution chain of a pokemon in previous generations
|
||||
|
|
Loading…
Reference in a new issue