Commit graph

2904 commits

Author SHA1 Message Date
Kurt
1174e354b1
Initial support for Pokémon HOME 3.0.0 (#3899)
* Heavily rewrites the `PKH` abstractions.
* Uses HOME's core-side classes as the transfer middlemen instead of direct A->B transfers.
* Revises logic to account for most of HOME's quirks (scale/height copying, safe refuge PLA)

Future revisions hinge on better handling of evotree (need better metadata about existing as specific evolutions in each game).

---------

Co-authored-by: sora10pls <17801814+sora10pls@users.noreply.github.com>
Co-authored-by: Lusamine <30205550+Lusamine@users.noreply.github.com>
2023-06-03 18:19:16 -07:00
sora10pls
61fbdfe5f6 GO: Separate Mythical encounters depending on HUD visibility
Also add in details for Shadow Raids now that they're known
2023-05-23 17:18:29 -04:00
sora10pls
302f0593e6 RAID: Shadow Legends
Need to differentiate these from regular raid encounters so that they can be excluded from LGPE GO encounter data (purified can only be sent to HOME).
2023-05-20 11:56:19 -04:00
Kurt
b08843fcc5 Allow BDSP Slate/Shard to be given via "Give All"
https://projectpokemon.org/home/forums/topic/63429-bdsp-slate/

The "Give All" cheat will skip adding unobtainable items.
Since the BDSP-exclusive Treasure (slate/shard) are unable to held, they were also skipped. Revise the logic to allow them to be added via "Give All", but still disallowed as held items (separate arrays needed).

Also condense the logic for BCAT-Dmax crystal IDs since they're all sequential. Just iterate a range instead of a span.
2023-05-18 19:30:39 -07:00
sora10pls
2bdee8c87d Permit Unknown Dungeon/Secret Base hatch locations 2023-05-14 15:16:31 -04:00
sora10pls
54b663ae6f Add latest distribution raid data 🪨 2023-05-11 20:04:24 -04:00
sora10pls
1e985d6b26 Expose Gimmighoul form argument in editing tabs 2023-05-10 21:05:43 -07:00
Kurt
4aeea9e956 Allow TSV=0 for home accounts 2023-05-08 00:03:45 -07:00
Kurt
e32410279e Flag invalid gimmighoul formarg values 2023-05-07 15:39:37 -07:00
Kurt
5c70e41b76 Devirtualize GetMatchingSlots 2023-05-07 13:34:47 -07:00
Kurt
e75da5d3b7 Misc tweaks
More readonlyspan for the rest of the defined ushort[] arrays, less dictionary/hashset
Simplify some slot-empty checks, makes it easier to see an api for slot interaction (future?)
2023-05-07 13:32:29 -07:00
sora10pls
94f98d66f5 Add latest distribution raid data 🦎 2023-04-27 20:03:51 -04:00
sora10pls
d4d353c087 Pokémon GO 0.269 Premier Ball Considerations
Perhaps one of the silliest things PKHeX could account for when it comes to legality 🥒🚫

Data has been added to PGET, but the issue has not been fixed yet, and Beast Ball is still up in the air. More to come?
2023-04-23 22:40:52 -04:00
Kurt
de17753733 Extract iterator flag mask check logic, reuse 2023-04-23 16:43:47 -07:00
Kurt
907ed0b32f struct CheckResult
tiny object, eliminate allocation for them since they're 10-16 bytes at most.
2023-04-23 16:04:04 -07:00
Kurt
b417964193 Condense some expressions for move fetch 2023-04-23 15:51:48 -07:00
Jonathan Herbert
599387e7aa
Fix ORAS Held Items Using XY Held Items By Mistake (#3866)
- Add HeldItems_XY
- Fix that HeldItem_AO pointed to what should have been HeldItems_XY
- Fix HeldItem_AO being inconsistent with the rest of the HeldItems
- Correct HeldItems_AO only having XY  held items and not ones added in ORAS
2023-04-23 01:35:26 -07:00
Kurt
998b8f1ce0 Minor tweaks
Add unit test for VC kata/hiragana edge case
De-duplicate some slot change notifications
Span in more spots
2023-04-22 17:51:32 -07:00
Lusamine
62173f4deb Add dates for Pokémon Center Mini/Jumbo Pikachu events 2023-04-22 10:00:29 -05:00
Kurt
5bdc6b9ef8
Privatize some static fields, more robust legal helper classes. (#3865)
* Uses LearnSource more throughout the codebase when appropriate, rather than loosely coupled pivot methods.
* Hides Learnset/EggMove data inside the LearnSource classes.
* Extracts functionality from the large Legal class & partial Table*.cs files into better performing helper classes.
* Cleans up some code from prior LearnSource commits.
2023-04-20 21:23:15 -07:00
Kurt
fa9a809751
Encapsulate item pouch arrays/etc for finer control (#3860)
* Extract/encapsulate inventory legal arrays to interface+class

Hiding them behind methods allows these to be left as ReadOnlySpan<ushort> and thus never allocate on the heap.
Also refactors out some logic for checking if an item is legal.

End result feels more maintainable and is less bloaty (no more passing in a nullable func)

Batch editing
* Add HasType filter

```
=HasType=11
.HeldItem=Meadow Plate
```

slaps a meadow plate on any pkm with grass type
Use `=PersonalType1=11` for only primary grass types; only-secondary-type grass will not match it.
2023-04-16 12:58:07 -07:00
Kurt
c73264d4f3 Minor minor perf
Small changes to reduce some allocations
2023-04-15 01:58:37 -07:00
sora10pls
e2fd292ffa Add Gavin's Palafin eligible date range 2023-04-14 08:16:52 -04:00
sora10pls
47f5799fef Add latest distribution raids
Scale: 0
tiny boi
2023-04-13 20:04:00 -04:00
sora10pls
f0a34f68ad Disallow form argument on Gimmighoul
Gimmighoul can't increment its form argument counter, it can only ever be 999 on Gholdengo after evolving.

Also reorder switch cases according to National Dex indexes.
2023-04-13 11:28:05 -04:00
Kurt
ecef31f167 Minor clean 2023-04-13 00:05:10 -07:00
Kurt
4caf749064 Misc tweaks
do things a little more directly

blank ctor: we already have the ctor, just invoke it ourselves instead of having to rediscover it
2023-04-10 01:26:54 -07:00
Kurt
6d0c2d9520 Add more overload methods
Learnset: slightly quicker check.
SCBlock: assists when you have Key separate from the encoded data.
2023-04-10 00:49:39 -07:00
Kurt
6182f889a6 Add learnset moves similar to games
Instead of looping, if the moveset is full and a new move is added, the game shifts all arr[1..] down one slot then adds the move at the end.
Since we don't need to keep track of PP/PP Ups, we can just defer the shifting and do n % 4 rotations at the end instead of n rotations (one on each move added).
2023-04-08 12:20:18 -07:00
Kurt
0dfb012e5c Add Ditto distribution raids 👛
Adds a helper method for SCBlock to measure a size from header.
2023-04-06 19:28:10 -07:00
Kurt
d6ec64fb00 Update MoveListSuggest.cs 2023-04-02 16:19:56 -07:00
Lusamine
d6e1019233 Add met dates for TCG Lechonk and end date for Fly Pikachu 2023-04-01 09:34:15 -05:00
sora10pls
2f5b66f49a Allow Master Rank Ribbon on Treasures of Ruin 2023-03-31 20:04:52 -04:00
Kurt
4384cadefc Add more xmldoc 2023-03-31 13:00:34 -07:00
sora10pls
3bfd302633 Add latest distribution raid data 🦦 2023-03-30 20:07:19 -04:00
sora10pls
dd157813c4 Misc changes
Re-order tables according to National Dex ID instead of Dev ID
Label unknown fields for SV player appearance/fashion
2023-03-28 16:00:44 -04:00
Kurt
aa13c93e65 Add misc generic constraints
Resolves some allocation analyzer issues
2023-03-25 23:28:28 -07:00
Kurt
0087ccb44f Use span for savefile slot API
No more offset fetch
2023-03-25 23:14:50 -07:00
Kurt
5ce3e734b8
Skip initial cctor alloc on non-byte primitives (#3850)
Runtime/jit repoints these to the dll rather than heap if we're Little Endian (always, otherwise will allocate like before).

Eliminates quite a few static constructors, so even faster startup. Items later.
2023-03-25 17:55:55 -07:00
Kurt
34c1473966 Misc tweaks 2023-03-25 17:48:49 -07:00
Kurt
081a48bbf6 Update LevelVerifier.cs 2023-03-24 23:48:35 -07:00
Kurt
4615e3577a Span-ify MoveSetApplicator 2023-03-21 21:02:13 -07:00
Kurt
46de8c4b06 Minor optimizations
Only fetch egg moves when using them
Localize KOR gen2 string directly instead of switch expression
Remap FRE gen4 chars directly, hot path instead of dictionary lookup
Uppercase chars in place
2023-03-21 17:20:13 -07:00
Kurt
ecbf6c06de Permit pokewalker courses for all languages
Wrong: #3594
Pokewalkers can interact with games they're not paired to (and receive gifts!).

Closes #3837
2023-03-19 12:21:43 -07:00
Kurt
7e3af18b2e Fix inverted bdsp footprint ribbon check
Net7 must have rewritten the logic and I partially reverted
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=282543
2023-03-16 21:05:42 -07:00
sora10pls
5110c62d25 Add latest distribution raid data 🦉 2023-03-16 20:05:39 -04:00
Lusamine
c0796780fa Tweak BulkAnalysis output 2023-03-15 21:24:03 -05:00
Kurt
7b07334a5a Update Vivillon3DS.cs 2023-03-05 12:27:17 -08:00
Kurt
827b7455c0 Update Vivillon 3DS pattern handling
Follow up to #3235, this time closing the book for good.

From a bulk analysis perspective, having multiple patterns[0, 17] of Vivillon for the same Gen6/7 OT is illegal. Maybe not for traded eggs?
2023-03-05 01:39:13 -08:00
Kurt
29b3b695bd Pre-allocate some dictionary sizes
Skips the bucket array resizing steps
a 256 key dict will garbage 5KB; StringConverter2KOR wastes 100KB of garbage.

Zukan7b: save 144 bytes and eliminate cctor
2023-03-04 20:00:27 -08:00