Commit graph

77 commits

Author SHA1 Message Date
Kurt
4deb5080d1 Misc tweaks
rearrange getmove with respect to tutors; verifycurrentmoves was getting
tutor moves in levelup
extract not-found hint fetch
Expose gen5 block objects (so I can play with saves in linqpad)
2018-10-06 18:45:15 -07:00
Kurt
dc839333b7 Add more parse settings
allows consumers to tweak debatable settings
2018-10-06 13:43:05 -07:00
Kurt
66faa43e03 Add gen6+ fixed ability hot path
Closes #2135
2018-10-06 11:24:46 -07:00
Kurt
f507ab7081 Misc parse settings reorg
makes it more centralized for defining parsing settings, maybe can have
flags to change severity of certain preferential checks
2018-10-05 19:58:30 -07:00
Kurt
ce9d3abbe4 Misc reorganization
Move logical checks using encounter data out of Core.cs

might be possible to excise legality checking objects from
Legal/PKHeX.Core so that a 'slimmer' core can be made
2018-10-04 18:52:00 -07:00
Kurt
db30fea38c Remove gsc dodrio trade OT trailing space
Closes #2126
Rewrite trade OT validation by using the trade's OTs property
2018-09-19 19:09:29 -07:00
Kurt
65272d460a stricter mysterygift references
results in:
- precomputed GetTable() reference
- no casting when iterating for matches
- no db null checks, as they are initally Array.Empty<T>();

reduces noise a little & slightly faster
2018-09-15 16:22:07 -07:00
Kurt
b280ffcfef style updates
should be pretty much it
2018-09-14 22:37:47 -07:00
Kurt
91c37ab573 Update legality check message string style
V### names weren't enjoyable to work with; use similar verbose style as
the program message strings.

updating the translation files with the remapped variable names shortly

remap list: https://pastebin.com/jybkVDAK
2018-09-01 14:11:12 -07:00
Kurt
1486b7f14a Misc style & minor tweaks
Remove move combobox flicker hack (no longer necessary)
Add more Array.Empty usages
cache mysterygift sizes
seal some classes

no functionality changes
2018-08-02 20:11:42 -07:00
Kurt
c46924d220 Use wcxfull version/language restriction data
some cards may permit being recieved on incorrect games

some wcxfulls permit games they shouldn't (tapu koko flags permit USUM
but games released after the distribution window)
lots of wcx lacking restrictions completely

tested flagging USUM rockruff & zeraora

might be worth discarding MysteryGiftVerifier and instead just using
unused fields for prior formats to supply the data.
2018-07-27 22:26:27 -07:00
Kurt
c8563a3737 Respacening
Style guidelines, handle a bunch of files
no functional change
2018-07-26 19:34:27 -07:00
Kurt
75801e22e0 Update egg location -> encounter generating checks
WasEgg only checks for EncounterEgg valid locations; check for any value
instead.
2018-07-26 14:55:49 -07:00
Kurt
1ff8ebf777 Misc overload add/use
Some values are already computed; pass them in to overloads for quicker
execution
2018-07-19 19:38:44 -07:00
Kurt
ff4ca47ebe Remove GBEncounterData boxing
Interfaces implement enough detail, so can simplify
extract local methods (likely will be inlined)

less obj allocations = faster!
2018-07-18 16:37:21 -07:00
Kurt
a100488142 add gen12 generator kadabra catch rate case
https://projectpokemon.org/home/forums/topic/46259-yellow-kadabra/

Thanks Cloud AC !

update misc verifier for catchrate to better indicate for
any->nontradeback scenarios
2018-07-17 16:54:23 -07:00
Kurt
fe7fea877b Replace boolean OrderBy with DeferBy
orderby consumes the entire input enumerable in 'sorting' the list;
since we don't care about the order besides a yes/no, just manage the
yield order ourselves.

don't bother using this method more than the spot it's in; was a fun
exercise but other spots are set up for easier debugging
(overall flow is where->deferby->yield), could make things easier to
read but meh
2018-07-17 16:28:42 -07:00
Kurt
7ec1cab9a7 Update gen1/2 trade generator to emit gen1 if match
Closes #2060
2018-07-16 15:22:40 -07:00
Kurt
83e61923f7 Add bw/2 jellicent deferral case
https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?tab=comments#comment-233860

Thanks paf!
2018-07-13 13:48:27 -07:00
Kurt
f8c43d4a06 Rework gen1 trade OT handling
convert all dictionaries to char-byte instead of string (saves 50KB on
compressed dll, lul)
update OT string comparison for pre/post transfer specimens

Showing "TRAINER" for all languages isn't correct, just show a mapped
character

Closes #2049 , thanks @egzonqj & @WEERSOQUEER !
2018-07-10 16:45:24 -07:00
Kurt
326522c76f Misc simplifications
cache splitbreed species as another class
reduce linq usage in evolution validity check
reuse egg hatch method
2018-07-04 09:15:20 -07:00
Kurt
eb35d71fcc Flag East Gastrodon from Friend Safari... correctly
Closes #2023
2018-06-21 20:26:21 -07:00
Kurt
8387da64fb Disallow East Gastrodon friendsafari
Closes #2023
2018-06-21 20:22:14 -07:00
Kurt
f10cc183a7 Refactoring
Relocate Evolution Chain logic
minor reorg of check arguments for nesting / grouping
2018-06-19 17:14:22 -07:00
Kurt
f3ef122214 Refactoring
continued simplification

core.cs is pretty much the following:
misc one-off junk
moveset fetch
encounter table fetch
evo chain fetch

might eventually move things around a bit further for cleanliness so
that misc meta junk is the only thing that remains in core.
2018-06-18 21:56:30 -07:00
Kurt
0c06506a8d Refactoring
remove some unneeded logic
moves in gen1/2 can be reordered, sequence match should be intersect
(full) contains match.
2018-06-18 19:57:32 -07:00
Kurt
2e1081086d Refactoring
Split evolution data specific DexLevel properties from DexLevel

use IReadOnlyList instead of IList for covariant collection
2018-06-18 19:10:21 -07:00
Kurt
49c36e2173 Misc legality gen tweaks
bypass savefile language checks if no language set
fix gen2 static gift egg that is really a wild encounter -- egg flag was
set & not cleared -> no wild pkm, bad! Adds test case for this.
(probably isn't a better place to clear, enforces only once per
generation rather than on every yield/end of every static yield)
2018-06-15 18:47:17 -07:00
Kurt
cb5e1239ae Refactoring
Extract game value limits
Rearrange GameVersion util logic extensions
add better gameversion fetch for generator (equivalent to pkmeditor)
2018-06-15 16:00:28 -07:00
Kurt
b9652a835d Weaken gen2 egg species checks for pre-evos in gen1
VC can inhabit both gens

Add Tradeback setting setter for legality tests
Add GBCartEra setting setter for legality tests

Thanks @iiippppk !
2018-06-12 18:46:31 -07:00
Kurt
e105f2b589 Refactoring
fix b2w2 egg base levelup reference (not bw, b2w2!), doesn't really
matter much except for better indication (possibly?)
remove some unnecessary linq ToArray() calls
continue relocating code out of Core
2018-06-10 17:55:03 -07:00
Kurt
3f1195a2d4 Refactoring
Remove duplication of levelup fetch
relocate some stuff to a more appropriate area
2018-06-10 10:44:05 -07:00
Kurt
1202474cd5 Defer & flag VC korean unobtainable encounters
Closes #1985
2018-06-06 21:49:30 -07:00
Kurt
323db29374 Handle volt tackle special egg move
edge case turns the [] into an ienumerable, better than calling another
to-list.
2018-06-05 21:38:38 -07:00
Kurt
ae3b6a7fa1 Simplify IContestStats usage
remove new[] creating for checking if any contest stats exist
(HasContestStats)
2018-06-02 21:19:03 -07:00
Kurt
15b5de11c0 Handle hatched wc3 metlevel oddballs
Closes #1978

Met Level at 5, when hatched ingame is reset to 0.
2018-06-02 07:50:48 -07:00
Kurt
ae27c10dc2 Misc cxd fixes
#1970
2018-05-27 12:18:27 -07:00
Kurt
f7a61cf72c Flag version exclusive trades with incorrect ver
Closes #1969
2018-05-27 06:59:27 -07:00
Kurt
e6765d3691 Flag langid=0 when appropriate
only jpn bw ingame trades can lack a languageID.

skip language checks for pk1/pk2 as they have no language stored.
2018-05-26 14:40:02 -07:00
Kurt
cd3b24c122 Handle smeargle generating
Needed moves is essentially none (unless you have invalid sketch moves).
2018-05-20 08:19:03 -07:00
Kurt
1f8c72af5a Handle EncounterTrade without moves specified
Similar to EncounterStatic handling
Thanks @architdate for pointing this out
2018-05-19 21:49:26 -07:00
Kurt
0e6db90de2 more minor tweaks
add 2 overloads for encounter generator
more simplifications
2018-05-12 18:11:47 -07:00
Kurt
99005d8fc0 Refactoring
more discards & simplifications
2018-05-12 12:28:48 -07:00
Kurt
e2f11edc43 Refactoring
discards, Array.Find over FirstOrDefault
2018-05-12 08:41:29 -07:00
Kurt
5a3c8f4147 Remove trailing whitespace 2018-05-12 08:41:29 -07:00
Kurt
9fb7056837 Add test living dex generator
doesn't generate everything due to the evo chain not being 'full'
(instead is unevolved singular pkm), nor does it evolve pkm
2018-05-09 21:02:35 -07:00
Kurt
79b2576c31 add overloads for GetPossible
Remove edge case handling for level 2 blissey; updates over the past 2
(yay 2 years of legality checking) can now handle that case without
special handling.
2018-05-09 20:37:11 -07:00
Kurt
16ed4353b2 More generator updates
Store 4g giratina held item for enc->pkm legality
revise usages of GetSaneGender
Rearrange some logic
Better handle impossible version encounters (gen4)

gen 1-5 done, stuck on 659 - bunnelby egg...?
2018-05-09 17:50:56 -07:00
Kurt
4913ef9647 More generator updates
* B2 has an error in the encounter table for Route 3 Corphish Special
water encounter; GF edited from Basculin-1 to Corphish-1 and forgot to
update the form to 0.
* Ranch Trade egg locations
* Trade gender-PID set correctly
* static roamer glitch does not apply for emerald
* Mirage Island wild Wynaut case now allowed (collision with Gift Wynaut
egg hatched on Mirage Island?)

gen1-3 done; now at 413 (Wormadam) which currently yields an
EncounterEgg AS wormadam, which isn't right...
2018-05-08 21:17:31 -07:00
Kurt
c21f8bf45f More generator updates
Blazing past 251, now stopped at 280 (trade ralts, gender mismatch??)
2018-05-08 20:13:55 -07:00