remove legality check's use of reflection which checked individual
properties; add interfaces to interact with the ribbons of each PKM
type. With this, every ribbon attribute is accessible via its
corresponding interface (cast)
will have to add checks for individual interfaces as per #1250
I didn't feel like adding much documentation, is pretty straightforward.
Cast a pkm object to the desired ribbon set; if not null, can access
ribbons regardless of pkm format.
Rewrote showdown set exporting to be much clearer, added auto-fixing of
relearn moves when importing showdown set (applies suggested relearn
moves)
Simplified main form loading routine (from ~160 to ~25 by extracting
methods)
Evo table was not mutated correctly
clear florges evo table except for base form (for some reason it was
returning spewpa as base species)
gen<6 exeggcute evolves via item:8 (not via levelup:4)
Closes#1234
Previous approach was 'most likely to find valid', this approach is a
little greedier to try to find a more fitting match. Will result in a
small increase in computation time, but trying out EncounterTrades and
static encounters first is preferred.
Fix Rhydon ingame trade gender. Bulbapedia is wrong, that's a Male
Rhydon with those IVs.
getFormeIndex returns the base species (670 or 671), which duplicates
entries on the chain
the evolution checks use the forme ID but also return 670/671, thus
making this unnecessary
closes#1202
* 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
Track gen1/2 origin game as well as generation
fix pk2 gender setting (incorrect bitmask & wasn't set from tabs)
extend female gender check for gen2 to apply to GS encounters -- if met
location is missing, was traded to gen1 which clears gender.
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 😄
check requireslevelup during evolution validity check, not during tree
generation as movepool fetch treats the 'level' as the max possible
level it was at (not the level it was encountered).
fix dropping pkm from external source causing exception (final return
false caused it to proceed with regular dragdrop operation from source
slot).
#1163
Evolution info was not checked for non-eggs; for mystery gifts check
that the level of the evolution is not less than the level of the
matched encounter
fix spacing (cosmetic)
add temp flagging for magnetpull/static slots (will eventually refactor
into something functional that considers a set of slots including
swarm/etc)