Commit graph

80 commits

Author SHA1 Message Date
Kurt
e91cb806e5 Extract extension->prefer format method
fails for 'pkx' (returned 8 instead of 6); establish standard behavior
2018-04-21 14:38:18 -07:00
Kurt
8250bc58cd Fix levelup->evo fetching of next levelup move
Correctly fixes #1163 (test cases added), eg wooper->quagsire would
learn yawn at 31 before evolving; the getmoves wouldn't provide yawn
(stopped at 30) with the old code; the lvl decrement was removed in the
incorrect commit, providing a legal verdict which was obtained
incorrectly (dexlevels were inaccurate)
2018-04-17 19:49:33 -07:00
Kurt
78f533605c Handle untranslated Italian LeafGreen Jynx trade
lul nice translating team u got there, would be a shame if they forget
to translate something ;) /s

Thanks cicciochiave!
2018-04-12 21:22:04 -07:00
Kurt
b3b9713aa2 Switch assert comparison
AreEqual checking by Reference? strip out newlines and compare with
string equals instead

add testing method for generating full dex of pkm (still WIP hence
commented out attributes)
2018-04-03 19:34:24 -07:00
Kurt
867c705597 Fix broken gen2 tests
add oddish to the mix
2018-04-01 15:51:55 -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
d03ff147d4 Add template -> pkm method
fix signature if no versions are provided (empty params is [0], not
null)
2018-03-29 21:04:05 -07:00
Kurt
e74e7878cd Lower dragonair encounter level req for trade
https://projectpokemon.org/home/forums/topic/44555-gen2-legality-issue-with-in-game-trade/
Thanks Bumidek !
2018-03-29 08:50:23 -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
78616e1ad5 Add showdownset -> pkm encounter fetch test case
Test parsing glaceon, input must equal output
Test generating encounters for a specific version (exists only on Moon)
Test generating encounters for the same version (add handling trainer
data to permit Tutors)

fixes error in VC generations-present fetch which allowed movesets from
generations 3-6 lul
exclude negative/invalid gameversions
2018-03-27 19:45:22 -07:00
Kurt
d1cfdd782e Rework ball / frame check passing
Two checks are performed for Gen 3 & 4:
A: Encounterability (wurmple, ball, ability)
B: RNG Compatibility (frame)

Original code only checked 'A'
Recent code ordered by 'A', but returned anything that matched 'B'. If
'B was not satisfied, an 'A' match would get deferred, allowing for an
eventual B & !A to be returned before a A & !B being returned.

yay bool logic

we want to prefer a RNGFrameMatch as well as a SlotCompatible match
original code (no RNG checks) retrieves with SlotCompatible just fine
recent adding in framematch resulted in deferring compatible if not RNG
frame, yielding !A matches before A & !B

maintain 3 queues (A & B get yielded immediately) to track A!B, !AB, and
!A!B
not necessary to check unown case anymore as it'll fall into the A!B
group. better performant to skip that check in favor of only adding for
fail.

thanks theSlayer!
2018-03-21 20:19:54 -07:00
Kurt
636736c3fa Add g3 safari ball wild deferrals
Pineco is valid but also can be sourced to altering cave
similar for sandslash
Thanks theSlayer!
2018-03-21 17:30:19 -07:00
Kurt
2c4e3358e4 Fix ninjask evo move comparison
https://projectpokemon.org/home/forums/topic/44413-bug-information-about-bug-found-on-the-new-version-180319/
2018-03-18 15:30:19 -07:00
Kurt
9da1913f1b Only check static IVs if original IVs still exist
https://projectpokemon.org/home/forums/topic/44319-bug-vc-mew/
Thanks Davil!
2018-03-09 20:00:13 -08:00
Kurt
76385a6b4a Fix gsc pre-evo species chain filtering
simplify gsc check to do only once

https://projectpokemon.org/home/forums/topic/43278-gen-2-hitmonlee-and-hitmonchan-flagged-as-illegal-if-location-is-mt-mortar-at-level-10/
2018-01-01 13:53:28 -08:00
Kurt
dccad6c2f4 Simplify/fix UnSanitizeString
Species and Nicknamed params were never used; foreign always resulted in
true for cases when it actually mattered.

Filter to the non-fullwidth characters, check the char type (latin base
vs jp/zh/ko) in order to determine if the full/half symbols should be
squished

could be faster replacing char instead of string, so change those

add two test cases for half width & full width string
sanitization/unsanitization
2017-12-28 22:50:32 -08:00
Kurt
24b5cc48ed Fix gb encounter move comparison
don't calc NoMoveReminder for non-gen2 formats, also fix comparisons
(gen1 || gen2&&noRemind)
Closes #1707
2017-12-17 21:26:31 -08:00
Kurt
e8c4cc8fa8 Fix broken crystal origin pkm test
works fine on a crystal save, the test needs this enabled for crystal
origins
2017-12-17 19:42:31 -08:00
Kurt
21c1dde3a7 Fix static encounter gift / egg edge case
extract EncounterStatic match determination; in doing so fixes "lvl" by
passing byval.

Pichu encounters (2) come before the Gift level 25 pikachu, causing lvl
to be dropped to 5. When pikachu comes around, it compares 5==25 -> bad;
pulling out the method and passing byval allows it to be 25 at the start
of every new encounterstatic checked.
2017-12-16 18:24:03 -08:00
Kurt
d3d7d7d50d Add slot level / IsEncounterable beginnings
dynamic level -> calc level
no sweet scent -> proc available (rock smash/fish)

change frame checking in encountergenerator to save which frame it was
found on (unused but possibly later can capture this for output)
2017-11-29 21:31:52 -08:00
Kurt
0bc2ee0938 Skip scatterbug static encounter forme check
closes #1668
add 2/3 pkms provided as test cases (spewpa can be ignored, close
enough. just want an evo & orig).
2017-11-28 19:29:25 -08:00
Kurt
c5b7ebf50a Add egg forme check
all other egg formes that are disallowed are checked later; check for
totems here
Closes #1667
2017-11-27 18:13:54 -08:00
Kurt
9806677d5e EncounterType init update
move MarkEncounterTypeData back above the area size reduction so that
the mark-by-locationID special handling will work
prevent slottype from becoming overwritten if already defined by special
case handling

add examples provided to automated test cases
closes #1648
2017-11-22 07:52:17 -08:00
Kurt
5859daf1d8 Add maxspecies checks for gen7
accesses arrays outside the range for the new USUM species
Closes #1631 , add test case
also adds lycanroc test cases for #1630
2017-11-18 21:50:48 -08:00
Kurt
311e110f6b Block wild dusk rockruff
closes #1627
adds test cases
2017-11-17 20:02:01 -08:00
Kurt
1ea29eb66c Add legality test case setup
hopefully the pathfinding isn't machine sensistive...
2017-11-17 16:00:26 -08:00
Evan Dixon
563d03e51a Merge remote-tracking branch 'origin/master' into f/savedata-checksum-tests 2017-11-13 20:53:58 -06:00
Kurt
9ba5ede81a Fix broken test 2017-11-08 13:30:52 -08:00
Evan Dixon
52a22fbf7d Add more checks to failing test 2017-11-07 19:21:17 -06:00
Evan Dixon
889302fea6 Merge remote-tracking branch 'origin/master' into f/savedata-checksum-tests 2017-11-07 19:07:55 -06:00
Evan Dixon
bb02488c6d Add checksum tests 2017-11-07 19:07:13 -06:00
Kurt
d08bd25b4f always clear memecrypto sig on load
allows verification & resigning to work as intended
reverts to code prior to refactor

b1641772e6 (diff-1681616e650971296aa4b549afadd0eaL116)

cleanup suggestions for tests
2017-11-07 16:57:18 -08:00
Michael Scire
b1641772e6 Refactor Memecrypto API, Add Memecrypto Tests
Refactors the Memecrypto API to improve generalized usage.

Adds unit tests that verify memecrypto works, so that future changes
don't potentially break the code.
2017-11-06 03:24:48 -08:00
Evan Dixon
e0673ea6fc Add basic test for pokemon name retreival 2017-11-01 21:16:14 -05:00
Kurt
c7dfc3d9b0 Cleanup
union / count usages
remove unnecessary stuff
2017-10-06 21:03:23 -07:00
Kurt
6bd0e7ce72 sync remaining
pls revoke my access
2017-10-03 18:20:31 -07:00
Kurt
6611e874c3 more usum prep
species added requires the 'latest personal table' reference to be
USUM's; the other referencs for .SM are fine as there's no possibility
to have a species ID high enough for it to matter.
2017-09-18 22:36:06 -07:00
Kurt
7efd771bf4 Misc refactoring
add docs, move some data fetching to more appropriate class
remove old XP memecrypto support handling, was previously removed due to
net standard/core split
refactor memecrypto to handle multiple save sizes (USUM won't be the
same size save file); placeholder -1 for USUM size
2017-09-16 11:38:58 -07:00
Kurt
c55b3df939 Add nyx antishiny pidiv detection
( ͡° ͜ʖ ͡°)
2017-09-12 00:27:16 -07:00
Kurt
b948f27646 Add wordfilter
#1442
2017-09-05 22:57:45 -07:00
Kurt
b078064e08 Improve xdrng seed search speed
refer to stackexchange links, makes XDRNG PID/IV search so quick (2^3
instead of 2^8 or 2^16; as fast as a gen3 shiny pokemon (2^13=8192 times
as fast as last release)

throw in some auto-inlining to eliminate some overhead in repetitive
search calls
2017-08-05 01:51:29 -07:00
Kurt
fe06309134 Add IV framegap search
Only usable for searching Method 4 IV spreads -> seeds;
1,3's search uses the same approach as the 1,2 search
I took the 1,2 search derivation to iterate for the next step, which
allows us to not know anything about the middle rand bits.

optimize a little bit more, move the pre-loop add to the initialization
stage; moving to the precomputed section pays off after 256 calls to the
method
2017-08-03 21:35:41 -07:00
Kurt
4945744599 Update Pokewalker PID checks
wildeep to the rescue 7y ago

http://www.smogon.com/forums/threads/past-gen-rng-research.61090/page-12#post-2661504

test cases need gender specified as gender is stored in a field (not
directly grabbed from PID)

addresses pokewalker pkms provided in #1377, RoC's PC has a bunch of
hacks ;)
2017-08-01 23:48:35 -07:00
Kurt
2a2f5669e4 Add wc3->pk3 conversion
fixes 10ANIV pikachu having Thunderbolt twice
un-duplicates CHANNEL event data
adds seed->PIDIV generator template for M1/2/4, CXD, Channel, and BACD

improve pkm converter to update nickname of hatched eggs. isn't perfect
(farfetch'd) but works better than before
2017-07-15 18:36:55 -07:00
Kurt
b760509fcb Misc gen3 event updates
Add special ribbon detection (for wc3),
speed up seeds from IVs calc (flip top bit of seed to get the result for
other iteration)
Add a bunch of gen3 event data
2017-07-01 16:50:45 -07:00
Kurt
1c4a1af633 Misc updates
Detect channel, only detect Channel PIDIV for RS origin (only really
care about method1/2/4 being used when it shouldn't)
Channel does this weird thing called not setting the met level.

Refactor set suggested met location to a method that can suppress
popups.
2017-06-29 19:32:29 -07:00
Kurt
ac16492daa update abilityflip g5mgshiny checks
Closes #1269
Also adds pokewalker PID check (don't think it works correctly but close
enough for now)
2017-06-24 17:24:36 -07:00
Evan Dixon
560f4eab0b Target netstanard1.3 and net46
I recently learned about targetting multiple frameworks in .Net Standard libraries. The main benefit here si taht PKHeX.WinForms and PKHeX.Tests no longer need to carry around the .Net Core DLLs. While it's now an option, I encourage PKHeX.Core to avoid framework-specific compiler directives.
2017-06-24 08:12:35 -05: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
11b2dc35d7 Refactor main form into smaller pieces
pkm editor, sav editor, menus, and a manager to glue the storage slots
together
decouples the pkm/sav editors from a static savefile reference.

improves dragdrop/click view/set/delete indication, hides unavailable
contextmenuitems, and fixes a few incorrect references. Box Subviewer
slots now have all the indication/events that the main save editor slots
have.

pls report behavior bugs 👍
2017-05-22 21:55:12 -07:00