gen1 & gen2 types aren't laid out contiguously (yay bird type and extra
types)
fix gen2 type accessors looking at the wrong byte
type sprites now load correctly, and 3rd ability no longer throws an
error (forced to None).
fix by hex editing the manually altered field in the personal table so
that it matches HGSS
thanks @sora10pls !
fix unused writeback location for saving tmhm data
don't bother converting to pkm then generating the sprite off that; use
the overload with int/bool
removes sav/pkm dependency for generating gift descriptions, and
standardizes the names a little. maybe a PKMBase interface would be
useful...
one large list at static.rodata:005E6860, formatted to look like AO
table with deletions & insertions at the bottom.
bitflags are used in one large set (not 4 chunks of 4 like prior).
Copied binaries from sm, references set up for saving time later
I assume not much will change in terms of structures, so it should just
be a file replacement & filling in static encounter table => 'working'
legality checks
personalinfo setup wasn't populating info for form indexes
remove erroneous pid-type mismatch message on gen3/4 non-matching if
there are no deferred encounters
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)
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 😄