Commit graph

42 commits

Author SHA1 Message Date
Kurt
802105d22d Allow pay day mewtwo, disallow dizzy punch
#1772
transfer pk1->pk2->pk7 for mewtwo knowing dizzy punch, just so we can
keep Pay Day
2018-01-25 19:17:42 -08:00
Kurt
fb6738f18b Add unown 2->7+ shiny check
closes #1755

also:
fix vc transfer checks not being called (EncounterOriginalGB is no
longer GBEncounterData).
remove usages of GBEncounterData -- class is (as of a ~~month ago) now
never leaked out of the EncounterGenerator -- always returns the actual
encounter data as the wrapper is not needed.
simplify logic flow / references
2018-01-10 16:16:35 -08:00
Kurt
0f21fc2217 add location interface for verbose analysis output
indicates met location for transferred mons
most gen1/2 encounters won't show values due to the location not being
stored respective to the string tables (anyone wanna do a location remap
after initial load?)
2018-01-02 12:00:41 -08:00
Kurt
816ebf6b0e Refactoring
no functional change
2017-12-11 16:01:24 -08:00
Kurt
5bc2e6da88 Refactoring
de-linq some areas where direct accessing is possible (list/array)
2017-12-04 20:16:54 -08:00
Kurt
2af7b152a7 re-enable error suppression
oops
2017-11-08 22:59:18 -08:00
Kurt
665e94b0aa misc cleanup
add german forme names
truncate some forme names
fix nidoran gender symbols

adds null check for invalid (caught error) pkm

disables accessory giving (needs more research)
2017-11-08 22:56:42 -08:00
Kurt
24121553b4 Add savegame sensitive pkm legality checking
uses the forme count of the savefile (rather than a futureproofed
same-gen forme count)
Closes #1559
2017-11-06 19:31:24 -08:00
Kurt
38989b4747 Export correct species name for verbose output
#1564
2017-11-06 18:06:23 -08: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
39279a7ad4 Add VC transfer checks
checks were previously only performed when finding the encounter, once
found, the GB encounter was validated. the transfer encounter is derived
after all encounter checks, thus remaining unchecked (really, only for
Locations).

Move generating logic to the generator, and double check the locations
are valid.

#1535
Thanks @DJPanda065 !
2017-10-20 21:07:15 -07:00
Kurt
0e24b5237e cleanup
remove redundant/repetitive match update (updateTypeInfo with Format>=7
already updates the encountermatch just prior to this method call)
2017-10-20 20:10:13 -07:00
Kurt
9699cdefae Gen2 egg gift bypass fix
Gen4+ static encounter eggs could slide through the VC case
prevent empty moves from appearing before suggested moves (relearnbase
being empty)
2017-09-26 20:09:18 -07:00
Kurt
9ef2016d35 Encounter Learnset move duplication fix
a level 15/16 magmar has leer/smog twice in its learnset (at level 1 and
at actual levels); returning just the 4 previous learned moves at level
15/16 yields duplicates for Smog. [Smog, Leer, Fire Punch, Smog | Leer,
Ember]. By ignoring moves already added, the true movepool is acquired

also fix TradebackType getting overwritten at the end of the method (in
case of nontradeback like korean/egg)
2017-09-24 10:36:16 -07:00
javierhimura
ea86032480 Comments and a fix for AllowGen2Crystal function 2017-09-23 21:00:57 +02:00
javierhimura
f3743e490b Korean language restrictions
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
2017-09-23 20:46:10 +02:00
javierhimura
efc60c3bf8 Change VC1 pokemon tradeback initial status to allow VC2 origin, there is no way to know if the pokemon was traded to gen7 after or before VC2 release
Do not allow gen1 evolutions for VC2 pokemon without gen1 evolutions or preevolutions
2017-09-23 12:58:46 +02:00
Kurt
4b83fdbe2c Add preliminary VC2 legality checking
Surprisingly easy to toggle on
If VC, provide possible version the encounter was matched to (to
indicate GS vs RBY).
2017-09-07 23:53:12 -07:00
Kurt
e517b45e51 Add GSC version IDs (supposed)
This is speculation and for preparation purposes only
2017-09-07 23:38:57 -07:00
Kurt
c98b0ab0b3 Refactoring
Split some large methods into smaller pieces
2017-09-04 18:55:15 -07:00
Kurt
7fb9ce4131 Misc updates
Add global link mission stats (thanks Holla!)
remove some ToArray() linq in favor of direct copies
Relocate encounter suggestion logic to separate class
Closes #1396, addresses other edge cases like entree-non HA & happiny
egg.
2017-08-15 21:16:47 -07:00
Kurt
d3a30ebf35 Refactoring +docs
Add some documentation for the high-level encounter finding
Fix encounterstatics not being filtered for the associated game version
(closes #1372)
was a side effect of refactoring this week
2017-07-30 12:31:17 -07:00
Kurt
cb8777f767 Refactoring
now that the logic has become more stable, polish away some complexity
2017-07-29 11:54:52 -07:00
Kurt
3b8643bc77 Fix gen1 VC legality checking error
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
2017-07-18 16:21:31 -07:00
Kurt
23c4e81dea Add invalid match alternatives to verbose output
Indicates why another type of encounter to match to was rejected, mostly
useful for diagnosing past gen specimens to figure out what changes need
to be made for that encounter to persist.
2017-07-12 09:02:03 -07:00
Kurt
cb76d51e38 Simplify vc transfer checks
supply met level so the static encounter has a level to work with
instead of 0
Closes #1316

in other areas:
level 48 charizard VC1 transfer changed to mewtwo causes minlvl >
maxlevel, handle instead of throwing exception.
2017-07-09 08:47:17 -07:00
Kurt
29914c431e Misc capitalizations 2017-07-07 17:40:27 -07:00
Kurt
4e9b6be8e5 Convert console output to debug output
output messages are now no longer in release builds, as they are only
visible when debugging in an IDE.
2017-07-01 19:43:51 -07:00
Kurt
19bf8de17c Add gen1/2 EV checks 2017-06-26 20:12:49 -07:00
Kurt
1a9da12404 Misc updates
fields->properties, capitalize
fix pkm fields toggle referencing old pkm file, simplify that process
instead of constantly referencing Format
2017-06-20 17:57:23 -07:00
Kurt
5b4cedf14b Refactoring
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)
2017-06-18 13:02:02 -07:00
Kurt
3f38b123a3 Refactoring
mostly renaming things, includes a little bit of added sugar and
splitting methods to simplify the codebase.

all methods are now PascalCase
2017-06-17 18:37:19 -07:00
Kurt
aae6b56422 Show encounter species in EncounterName
Shows up in verbose report
#1234
2017-06-16 18:23:46 -07:00
Kurt
45ff41ca48 Add more gen2 hypothetical handling
won't be active until VC2 release
2017-06-10 15:48:18 -07:00
Kurt
1e9f5261b7 Misc pika line fixes
Closes #1213
add default cosplay form at end, add range checks
prevent cosplay/spiky eared pichu from transferring up generations
set pkm to legal info on error (checking legality no longer continues
exceptions).
2017-06-09 21:43:46 -07:00
Kurt
63b18ff51f Fix misc problems
flag undistributed gen3 events
fix gen3 string writing (resized then expanded yields 00, missing
terminator), closes #1204
fix stackoverflow, fix pkmeditor template loading save prompt, closes
#1207
2017-06-08 20:57:30 -07:00
Kurt
eaf2fd9198 Cleanup
little bit of simplification
2017-06-06 20:52:21 -07:00
javierhimura
0b1fcbbe6d New legallity checks (#1196)
* 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
2017-06-06 20:10:05 -07:00
Kurt
4201e10a0e Misc cleanup
Add PCD fixed PID check
improve PID matching for CXD pkm
hide no-pidiv match seed (00000000)
fix matching fateful for wild pokespot pkm
don't generate eggs for c/xd
2017-06-03 15:16:27 -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
Kurt
fc676ec648 Flag unparsed pkms
With every format now supported, can flag GameVersion=0 pkm
2017-05-17 21:50:52 -07:00
Evan Dixon
52c4fbbe97 Converted PKHeX.Core to .Net Standard
Refactored and rearranged things as needed to allow the change
2017-05-11 23:34:18 -05:00
Renamed from PKHeX/Legality/Analysis.cs (Browse further)