Commit graph

2130 commits

Author SHA1 Message Date
Kurt
893f22a664 Extract generation traversal list fetch to static class 2021-04-17 13:09:09 -07:00
Kurt
8e52d2fddb Xmldoc updates 2021-04-17 13:07:28 -07:00
Kurt
8b180c3122 Fix egg move source indications (were defaulting to gen2)
Switch expression had an issue with interpreting the object's type (unboxing, yay)

should probably just return a typed object from the parse, but nah, this is a quick fix.
2021-04-16 17:57:48 -07:00
Kurt
16406d7bba Allow Strongest Trainer memory on gen6-visitors banned from Maison
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=265898

End result is only gen7-origin-in-gen7 are disallowed.

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-04-16 08:53:50 -07:00
Kurt
aaae94b739 Fix Gen2 roamer location check
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=265885

Location=>pkm.Met_Location

Change the array search for a bitwise and check, for muh efficiency
2021-04-14 13:29:23 -07:00
Kurt
758b6e6770 Remove '<->’ aliasing
Farfetch’d uses the non-vertical apostrophe, still.

Showdown is consistent with their usage (in/outputting ’), but we'll keep the '->’ for that sanitization just in case other services/users enter the wrong char.

Closes #3185
2021-04-12 17:04:02 -07:00
Kurt
b289c12918 Update Locations.cs 2021-04-12 15:43:21 -07:00
Kurt
0d45075d4b
Rewrite settings handling; enhance some user experiences (#3193)
- Settings now stored as json next to exe
- Settings now exposes all legality checking setttings that can be changed
- Slot hovering now can play cries in MGDB/PKMDB/etc, not just the main boxes.
- Enhanced hover text for mystery gifts and encounters that have movesets
- Show recently loaded save files in ctrl-f browser
- Toggle auto-load savefile setting to be none/detect-latest/last-loaded
- Custom extensions & extra backup paths can now be configured directly in the json settings
- Settings editor now uses propertygrid & tabs.
2021-04-11 18:09:54 -07:00
Kurt
aaa69eac15 Rename Gen3 Champ ribbon to be more accurate
been like this since mid 2016

this ribbon can be obtained in either Hoenn or Kanto within Gen3
https://bulbapedia.bulbagarden.net/wiki/List_of_Ribbons_in_the_games#League_Ribbons
2021-04-10 12:09:43 -07:00
Kurt
cfcefca14f Add splitbreed relearn suggest recursion 2021-04-10 11:03:21 -07:00
Kurt
e9c9627ad5
Relearn suggestions + Headbutt Slot Fix (#3190)
This change revises the logic for an Egg Move's RelearnMoves.

Removes a class that is no longer used
Passes the large value-passing struct byref via in keyword
Revises handling so that early-returned results from the MoveBreed processing are marked with their move source rather than leaving them unvisited.
The moveset processor uses depth search recursion, and returns false if the move that it is processing is not possible for the hatched moveset. If the depth search never reaches the check for base moves, all moves won't be marked for their origins, resulting in the result array not being accurate to use for suggestion purposes.

Yay multi-purpose logic (validation w/early returns & fixing needing fully processed data).
2021-04-08 15:58:09 -07:00
Kurt
4579a66a38 Fix deferral for wild slots
Base method checks wurmple (not available in swsh), removed.
Hidden ability check returns Partial for any species that cannot be patched, and Deferred for any patched; we don't care, because there aren't any wild species that can't be patched in swsh.
2021-04-04 21:54:24 -07:00
Kurt
63639a1ec8 Add latest distribution raid templates 2021-04-04 20:38:26 -07:00
Kurt
0ad06c6359 Disallow Thousand Arrows/Waves for Format6 Smeargle
moves unavailable in that format, same as light of ruin

Closes #3182 ty @DaWoblefet
2021-04-04 19:39:31 -07:00
Kurt
0626b0c29b
Add Breeding move ordering logic, and use in legality analysis (#3183)
* Initial bred moveset validation logic

Unpeel the inheritance via recursion and permitted moves

* Volt tackle considerations

* Optimize out empty slot skips

* Add tests, fix off-by-one's

* Require all base moves if empty slot in moveset

* Add test to prove failure per Anubis' provided test

* Tweak enum labels for easier debugging

When two enums share the same underlying value, the ToString/name of the value may be either of the two (or the last defined one, in my debugging). Just give it a separate magic value.

* Fix recursion oopsie

Also check for scenario where no-base-moves but not enough moves to push base moves out

* Add Crystal tutor checks

* Add specialized gen2 verification method

Game loops through father's moves and pushes in one iteration, rather than checking by type.

* Add another case with returning base move

* Add push-out requirement for re-added base moves

* Minor tweaks

Condense tests, fix another off-by-one noticed when creating tests

* Disallow inherited parent levelup moves

Disallow volt tackle on Gen2/R/S

* Split MoveBreed into generation specific classes

Gen2 behaves slightly different from Gen3/4, which behaves slightly different from Gen5... and Gen6 behaves differently too.

Add some xmldoc as the api is starting to solidify

* Add method overload that returns the parse

Verify that the parse order is as expected

* Add reordering suggestion logic

Try sorting first, then go nuclear with rebuilding.

* Return base moves if complete fail

* Set base moves when generating eggs, only.

* Use breed logic to check for egg ordering legality

Don't bother helping for split-breed species
2021-04-04 18:30:01 -07:00
Kurt
ba5bf463e0 Convert static dictionary to switch
probably ends up as a jumptable via jit, so better perf?
2021-04-02 16:47:37 -07:00
Lusamine
d3059218c9
Remove gen 8 static encounters from DB if no location (#3181) 2021-04-01 15:09:26 -07:00
Kurt
9881beea1e Update EncounterStaticGenerator.cs 2021-04-01 13:51:00 -07:00
Kurt
69c737b71a Show Mystery Gift information in hover summary 2021-03-30 20:27:58 -07:00
Kurt
75fb704658 Use already allocated result array
All operations overwrite all 4 entries of the result array, so no need to forcibly reallocate the array.
2021-03-30 20:27:40 -07:00
Kurt
5c9ce494cf Minor perf improvements
Defer some value assignments
Pass already known values directly
Pass static references to reduce allocating small duplicate objects
2021-03-30 18:51:53 -07:00
Kurt
4daf225379 Add location for colo ereader shadows 2021-03-27 20:32:52 -07:00
Kurt
53d3dba74e Reorder array for ordered search 2021-03-27 20:32:25 -07:00
Kurt
4bb95e0bd3 Spring raids 2021-03-25 18:28:17 -07:00
Kurt
0c1d13bf4d Minor tweaks
Lift some temporary arrays for more reuse
reuse some temp references
less allocation overall
2021-03-23 23:10:30 -07:00
Kurt
7c926dc09e More xmldoc 2021-03-23 21:20:02 -07:00
Kurt
3822981590
Rework EncounterCriteria to be ability indexed rather than direct ability (#3179)
* Exploration: rework ability criteria to ability numbers desired

* Sync remaining changes

* Update EncounterCriteria.cs

* Add xmldoc

* Improve speed of IsDualGender check

* More xmldoc updates

Should be doing this on main but meh, this branch is gonna get merged later

* Fix typo

* Update WC7.cs

* Update PersonalInfo.cs
2021-03-23 17:05:15 -07:00
Kurt
f86291cc1c Split gen3 encounter listing to have CXD separate 2021-03-21 19:52:48 -07:00
Kurt
5ce3d64996 Disallow lang=2 for dp trades
DP English origin are Japanese language; since we 1=>2, we still needed to disallow 2.
2021-03-21 10:34:00 -07:00
Kurt
012f6678ba Check for dual ability =>evo w/single ability capsule 2021-03-20 17:49:16 -07:00
Kurt
e547a9cf63 Extract report generation from LegalityAnalysis object functions
Can replace the default functionality with your own formatter, I guess.
2021-03-20 13:21:04 -07:00
Kurt
7badb56535 Move strings file to formatting subfolder 2021-03-20 12:47:59 -07:00
Kurt
a71d7d1950 Handle gen3 mismatched ability
ty Breil --
https://projectpokemon.org/home/forums/topic/58665-makuhita-in-game-trade-bug-sapphire/
2021-03-20 11:22:56 -07:00
Kurt
8020a44961 Minor simplification
All slots are now initialized via constructor, property can now be init!
Optimize some value fetching for gen7b, as the input data has features that can be abused
2021-03-17 22:40:37 -07:00
Kurt
71d355804a Move enc7b sky encounter fudging to reformatter project
50c53d6b33
2021-03-17 21:59:00 -07:00
Kurt
1acefbcf93 Remove sigilyph from g5 breed HA banlist
https://projectpokemon.org/home/forums/topic/58657-sigilyph/?do=findComment&comment=265330
2021-03-17 20:20:54 -07:00
Kurt
b4f763f7ef Move bridge-stony copy logic to pkNX
Also trims out empty slots (species=0), less size!

49efb96db9
2021-03-17 18:11:07 -07:00
Kurt
535f464b61 Update EncounterSlot7.cs
Closes #3176
2021-03-16 23:49:04 -07:00
Kurt
6bce4eea14 Minor clean
Annotations (nullable), some switch cases for readability
2021-03-14 16:16:55 -07:00
Kurt
ac116e0d0b Add more xmldoc / enum clean 2021-03-14 11:28:46 -07:00
Kurt
649958ee68 Move EReader berry names from tables to settings class 2021-03-14 10:16:09 -07:00
Kurt
b7bb5a0672 Remove unused 0 pp entries at end
Array is length checked already
2021-03-14 10:15:45 -07:00
Kurt
7b163147ef Add case for special headbutt slots
Closes #3174

Add more xmldoc for SlotType

Import revised slot-type table, as we've removed "Special" from the regular trees.
ef4b1b2894
2021-03-11 20:52:00 -08:00
Kurt
5cc3322b83 Split RNG class into simple & enhanced
ARNG object doesn't need the reversal caches, saves 256KB of memory allocation

Move RNG algorithms & support logic into a subfolder
2021-03-10 22:30:30 -08:00
Kurt
155e0283ce Inline some string logic, extract magic values, xmldoc 2021-03-09 21:31:53 -08:00
Kurt
9e4f1d11cc Show misc encounter details on hover 2021-03-07 12:35:26 -08:00
Kurt
2e10e0757a Check gen5 egg met location rather than gen6
Override the base impl in encstatic, swap const refs
2021-03-03 18:35:26 -08:00
sora10pls
9ee27aaf8f Update EncounterArea7g/8g
Now properly grabs forms for Unown, Arceus, Vivillon, and Silvally.
2021-03-03 17:45:18 -05:00
sora10pls
08ecac8cb3 Update upcoming Dynamax Crystal encounters 2021-03-02 11:21:56 -05:00
Kurt
eba704a46b Add March raid data
Wonder if they'll fix the gmax Hattrem ;)
2021-02-28 17:19:17 -08:00