Commit graph

2168 commits

Author SHA1 Message Date
Kurt
74e0cba3b0 Minor tweaks
use assert instead of manual exceptions
span
remove some dead logic
2021-05-18 16:16:48 -07:00
Kurt
25fa52e597 Use correct SID
lol I had copied from VC->gen7
2021-05-18 13:33:36 -07:00
Kurt
2c820bfbe9 Minor tweaks 2021-05-18 13:29:55 -07:00
Kurt
fbba64c0e6 Clean up catch rate comparisons
Add dragonite to the uncapturable list, removes catchrate comparison for dragonite since it's filtered out.

Skip some linq by doing the loop directly in the method. Replace local methods with captured variables with direct if-returns.
2021-05-18 10:38:01 -07:00
Kurt
565f161226 Show shiny state of encounter in db
Force shiny state for GO encounters

For encounters, this interface property is mainly just for exposing metadata for sprites.
2021-05-18 10:36:45 -07:00
Kurt
4c8772ff14 Update EvolutionRestrictions.cs 2021-05-16 11:12:16 -07:00
Kurt
5a012e85a0 Fix gen8 move threshold evo checks
gen7 allows all moves to be reminded; gen8 reverted that.
add greedy minlevel return, and reduce array size allocation by 270 bytes
2021-05-16 00:00:29 -07:00
Kurt
0e2f070510 Clean up know-move-evolution checks
Looks like Mr. Rime case wasn't being handled, so I rewrote it. Better performance, less complexity. No need to double-reference the moves.

Cache a single Valid evolution result; every parse can reuse that object.
2021-05-15 21:41:04 -07:00
Kurt
e31980d15e Clean up nickname parsing, make Gender an int type
Breaking change for anyone using IBattleTemplate (alm)
2021-05-14 23:41:14 -07:00
Kurt
50b15cd740 Use range/index
More in line with modernizing the codebase with latest c# syntax

improve web-qr decode speed slightly (no linq skiptake)
get money/coin mask without a temporary string (lol performance)
2021-05-14 15:30:55 -07:00
Kurt
07584a8774 Add chateau score, seaside cycle score
Update some other areas too
looks like this fixes the sube pkx fetch method for extraslots, yay.
2021-05-13 23:12:53 -07:00
Kurt
96ea7f0b39 Fix toxtricity neutral StatNature generating 2021-05-08 08:29:20 -07:00
Kurt
a7f3ce5766 Leak mismatched forms thru the possible check
The EncDB doesn't specify form; the encounter methods verify Form.

This is actually a fix; pkm that can change forms aren't really encounter trades, but we shouldn't be strict matching here.
2021-05-08 08:13:27 -07:00
Kurt
31142ee297 Replace some linq usage with direct logic 2021-05-06 23:26:38 -07:00
Kurt
fa5bc0d634 Set friendship after form set
Resolves GO galarian stunfisk, ty matt
2021-05-05 08:43:32 -07:00
sora10pls
6ed6e60840 Add PogoType + Requirements for Strange Egg encounters
Rationale behind this is explained in the accompanied commit in PGET: 7c2575d8a8

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-04-30 21:13:28 -04:00
sora10pls
e330eb5cfc Add current Meowth Distribution Raids 2021-04-29 20:08:16 -04:00
Kurt
2bfcdaf148 Update LegalityAnalysis.cs 2021-04-28 18:22:39 -07:00
Kurt
91557d0180 Don't defer on hidden ability change 2021-04-25 00:11:15 -07:00
Lusamine
eceb498da3 Fix Gen 2 roamer locations 2021-04-23 15:52:54 -05:00
sora10pls
00e88b2abd Add World Penguin Day distribution Raids 2021-04-23 11:39:20 -04:00
Kurt
e36fdd3cb6 Update EncounterStatic8ND.cs 2021-04-22 22:32:17 -07:00
Kurt
efb3d9aeac Add inaccessible den-rank checks
Rotom Bike water upgrade isn't available until you have sufficient progress, so you can't get these dens with the lowest rank.

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-04-22 21:47:25 -07:00
Kurt
f66662b8db More deferral tweaks for non-HA having HA 2021-04-22 13:47:33 -07:00
Kurt
8483dc241d Update MarkVerifier.cs 2021-04-21 19:12:50 -07:00
Kurt
7256ff0a7f Check if the Shedinja's encounter can have marks
Not all gen8 encounters can have marks (nest, go), so use the regular method.
2021-04-21 18:52:24 -07:00
Kurt
2aed4c3118 Add shedinja dropped ribbons/marking considerations
Nice bug ya got there, gamefreak.

Coulda cleared the AffixedRibbon value instead of copying it on Shedinja creation, and it would have made this unnecessary.

Please ditch the Affixed Ribbon gimmick for future games, thanks!
2021-04-21 15:20:16 -07:00
Kurt
25565e6f07 More pattern matching expressions
Shapes are fancy; nested pattern checks
2021-04-20 02:17:28 -07:00
Kurt
2f078e6565 Minor tweaks
Make HP IV set use single array fetch, less memory required
add some xmldoc
2021-04-20 01:02:32 -07:00
Kurt
45f12bd924 Update FormVerifier.cs 2021-04-18 21:22:58 -07:00
Kurt
f61108ac4e Check gen1/2 female OTs a little more thoroughly
https://github.com/kwsch/PKHeX/issues/2687#issuecomment-822072999

celebi is a es2e, so just filter on specified TID

Co-Authored-By: FeralFalcon <33670476+FeralFalcon@users.noreply.github.com>
2021-04-18 19:31:22 -07:00
Kurt
0e4848ad82 minor clean 2021-04-18 18:18:09 -07:00
Lusamine
f2c2a77cfe
Check nest distribution encounters by patch epoch (#3195)
Distribution raid encounters from before each of the DLC patches can only be captured in existing Wild Area locations.
Store the BCAT index in the encounter details and use it to compare when the BCAT was available.
2021-04-18 11:01:42 -07:00
Kurt
fd8da81b4a Remove unnecessary setter 2021-04-18 11:00:40 -07:00
Kurt
0719320e33 Eggs: explicitly pass generation instead of calculating 2021-04-17 20:09:02 -07:00
Kurt
9171d7f87e move property to class that uses it 2021-04-17 20:08:20 -07:00
Kurt
f35a3ce03c Add overload for Totem check, simplify some flow 2021-04-17 13:24:57 -07:00
Kurt
5635e8f345 Unroll some loops, reduce allocations a little for hacked eggs 2021-04-17 13:13:03 -07:00
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