Commit graph

10 commits

Author SHA1 Message Date
Kurt
07b2568b1f Fix g2 caterpie generating
has no egg moves -> no moves generated!
2018-04-01 15:02:27 -07:00
Kurt
ba4c911566 Refactoring & finish eevee test case
generates a legal pk* for every possible encounter; there's likely other
scenarios and more roughness to smooth out, but seems legit for now
2018-03-31 20:37:36 -07:00
Kurt
32f9f806db Add other iencounterable->pkm generators
not tested
2018-03-31 00:43:41 -07:00
Kurt
a89c0c3312 Rename egg game->version
add more gameversions (soon)
2018-03-30 21:37:01 -07:00
Kurt
2ea1fea5f5 Refactoring
add GameVersion to generation
fix generating pk2 eggs
relocate some logic
2018-03-29 21:00:38 -07:00
Kurt
e5ccae906a misc quality of life improvements
set egg friendship
allow SetRandomIVs to use a minimum fixed IV count
2018-03-28 20:56:58 -07:00
Kurt
76b4db1477 Add egg converter & test
only tested for gen7 egg->pkm (not to eventual set)

pretty sure a good chunk of the egg generation logic can be pulled out
for reuse in other IEncounterable generators (IEncounterable
extensions?)
2018-03-28 20:40:07 -07:00
Kurt
1e13220e6e Add IEncounterable -> pkm interface method
egg,slot,static,link,trade need to be implemented later

remove IEncounterable from PL6
2018-03-28 20:38:07 -07:00
Kurt
69cf1eaa9c add more pkhex.core xml documentation
adds a bunch of documentation useful for those unfamiliar with the core
library
2017-10-23 23:12:58 -07:00
Kurt
858aa50689 Refactor encounter matching
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 😄
2017-05-27 21:17:57 -07:00