fetch is exclusively done with version already known; there are cases
where version can change for eggs so it's safer this way.
version change reference (gen6+):
212a489335
move must be removed 2->1 so cannot be permitted as egg move.
remove unreachable code (ParseMovesRelearn only is called for Generation
>= 6, and thus Format != 2).
Korean g/s cannot access gen1 movesets, so pruning gen1 was necessary.
Rather than rebuilding the array (slow), just futureproof the entire
method to not rely on '7' (in case this code is ever used on Gen8).
Restriction happens because Korean can not trade with non-Korean GB era games
- There is no Korean release for gen 1 pokemon, included VC
- With no gen1 pokemon means any Korean gen2 is Gen2_NotTradeback, that means no gen1 origin nor moves are Legal
- Crystal was never released in Korean
- Pokemon Stadium 2 was never released in Korean, that means no move reminder for gen 2 korean pokemon
- Generation 4 can not trade between Korean and not Korean games, but Korean games can use the palpark with any language
Chinese language restrictions
There is no Chinese release for gen 1 and 2 pokemon games, VC Chinese games are in Japanese
farfetch'd apostrophe mapping disabled for gen5 and prior
Closes#1474
flag gen2 new moves as not obtainable if transferred from RBY (VC1) as
they must be removed before transferring 2->1.
Initialize move array for WC3 if none are present
Closes#1472
More gracefully handle invalid version pkms in a given format (gen5
origin version pkm on gen4 format no longer throws an exception).
GetGenMovesCheckOrder doesn't respect generation restrictions, while
EncounterMoves does; filter afterwards.
Add compiler flags in the Analysis file to toggle try/catch off for
easier debugging. Just uncomment the #define SUPPRESS line.
Closes#1345
* Added location to encounter slot to make verification againts the location of the encounter when the pokemon has lost met location, like generation 2 heabutt tree, jhoto surfing in route 45 and in the future generation 4 munchlax tree
Added version to generation 1 and 2 encounter locations to filter by catch rate based of the version of the encounter and check initial moves of the encounter only for the game that match the encounter
Filter generation 2 pokemon for crystal who have met location based of the time of day when it was captured
Completed version to static and traded encounters for gen 1 pokemon, to avoid check a red encounter with yellow initial moves, if an encounter is possible in both games with diferent moves it is duplicated (like eevee), if it is possible in both games with the same moves is left as RBY, the encounter will only use red/blue moveset
Verify some invalid gen 2 encounters. Crystall heabutt encounters based on the TID, using the tree selection algorithm of the game to determine if the encounter is possible for the TID (implemented base on https://bulbapedia.bulbagarden.net/wiki/Headbutt_tree#Mechanics). Coordinates of Crystal trees obtained with the programa G2Map
Added checks for fishing encounters for unreacheable water tiles in gen 2, route 14, national park and the beta safari zone.
* Fix gen 1 static encounters and trade encounters filter by version
* Missing strings
Valid species/movepools are already determined via the dexlevel and
prior methods, no need to check again with current species.
edge case: sing froslass from CXD won't check gen3 moves (ie, sing)
* Fix issue #1200
Minimum level for evolution moves in generation 7 is 2 thanks to the move reminder, also the evolution could be trigger at the minimum level and not the next level, except when the minimum level is the met level
* Gen 2 VC Speculation, it wont have Move Reminder because the only gen 2 move reminder was in Pokemon Stadium 2
* Missing variable
* Fix update generation 2 level moves
* 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
encounterinvalid isegg no longer throws exceptions when parsing moves
dropping invalid file paths to main window are now ignored (downloads
from chrome can be manually deleted but still dragged from the downloads
bar)
add pidiv case for manaphy gift
exercise in deferred execution/state machine, only calculate possible
matches until a sufficiently valid match is obtained. Previous setup
would try to calculate the 'best match' and had band-aid workarounds in
cases where a subsequent check may determine it to be a false match.
There's still more ways to improve speed:
- precalculate relationships for Encounter Slots rather than iterating
over every area
- yielding individual slots instead of an entire area
- group non-egg wondercards by ID in a dict/hashtable for faster
retrieval
reworked some internals:
- EncounterMatch is always an IEncounterable instead of an object, for
easy pattern matching.
- Splitbreed checking is done per encounter and is stored in the
EncounterEgg result
- Encounter validation uses Encounter/Move/RelearnMove/Evolution to
whittle to the final encounter.
As a part of the encounter matching, a lazy peek is used to check if an
invalid encounter should be retained instead of discarded; if another
encounter has not been checked, it'll stop the invalid checks and move
on. If it is the last encounter, no other valid encounters exist so it
will keep the parse for the invalid encounter.
If no encounters are yielded, then there is no encountermatch. An
EncounterInvalid is created to store basic details, and the parse is
carried out.
Breaks some legality checking features for flagging invalid moves in
more detail, but those can be re-added in a separate check (if
splitbreed & any move invalid -> check for other split moves).
Should now be easier to follow the flow & maintain 😄