mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-28 06:50:23 +00:00
0b1fcbbe6d
* Add move source to the check result for current moves, it will be used for analysis of evolution with move to determine how many egg moves had the pokemon and determine if the evolution move could be a egg move that was forgotten * Verify evolution for species that evolved leveling up with an specific move learned, the evolution must be at least one level after the pokemon could legally learn the move or one level after transfer to the first generation where it can evolve * Check to detect traded unevolved Kadabra based in catch rate and moves exclusive from yellow or red/blue If pokemon have data exclusive from one version but is in another version that means it should be evolved * Check no tradeback moves for preevolutions, like Pichu exclusive non tradeback moves for a Pikachu, that Pikachu could not have at the same time Pichu gen 2 moves and gen 1 moves because move reminder do not allow to relearn Pichu moves and gen 2 moves must be forgotten to trade into generation 1 games * Legallity strings for non tradeback checks * https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_breeding#Passing_moves_down Eggs only inherit a level up move if both parents know the move, that means genderless and male only moves could not have any level up move as an egg except the base egg moves because Ditto is one parent Nidoran male and Volbeat excluded because they can breed with Nidoran female and Illusime * Small check to not search for egg moves in genderless pokemon, generation 2 data include egg moves for Starmie * Fix female only species * Stomp is not a possible egg moves of Stanee * Fix Steenee evolution move, it cant be inherited as an egg
30 lines
1.3 KiB
C#
30 lines
1.3 KiB
C#
using static PKHeX.Core.LegalityCheckStrings;
|
|
using System.Linq;
|
|
namespace PKHeX.Core
|
|
{
|
|
public static class VerifyEvolution
|
|
{
|
|
// Evolutions
|
|
public static CheckResult verifyEvolution(PKM pkm, LegalInfo info)
|
|
{
|
|
return isValidEvolution(pkm, info)
|
|
? new CheckResult(CheckIdentifier.Evolution)
|
|
: new CheckResult(Severity.Invalid, V86, CheckIdentifier.Evolution);
|
|
}
|
|
private static bool isValidEvolution(PKM pkm, LegalInfo info)
|
|
{
|
|
int species = pkm.Species;
|
|
if (info.EncounterMatch.Species == species)
|
|
return true;
|
|
if (info.EncounterMatch.EggEncounter && species == 350)
|
|
return true;
|
|
if(!Legal.getEvolutionValid(pkm, info.EncounterMatch.Species))
|
|
return false;
|
|
// If current species evolved with a move evolution and encounter species is not current species check if the evolution by move is valid
|
|
// Only the evolution by move is checked, if there is another evolution before the evolution by move is covered in getEvolutionValid
|
|
if (Legal.SpeciesEvolutionWithMove.Contains(pkm.Species))
|
|
return Legal.getEvolutionWithMoveValid(pkm, info);
|
|
return true;
|
|
}
|
|
}
|
|
}
|