Commit graph

2885 commits

Author SHA1 Message Date
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
Kurt
284dd6d995 Update EncounterEgg.cs 2023-03-04 15:10:34 -08:00
Kurt
81bcd95dc1 Revise Vivillon form sanity check
Previously, slots were hard-matched to 18; now since they're "random", we need to flag out of bounds values.
2023-03-04 14:53:01 -08:00
Kurt
94d5ca491f FormRandom SV Vivillon 2023-03-04 14:48:40 -08:00
Ammako
0a1b4196b1
Fix Wishmaker Jirachi (#3824)
Needs ID32 because Wishmaker Jirachi is a fixed 00000 SID, unlike Channel Jirachi.
2023-03-04 13:21:57 -08:00
Kurt
0f1fba86f7
S/V 1.2.0 Support (#3819) 2023-02-27 19:12:27 -08:00
Manu
5ef3837d3f
Fix Jiseok Garganacl start date (#3815) 2023-02-27 16:18:39 -08:00
Kurt
52f1bf081c Add SizeType9 for fixed range Scale values 2023-02-26 16:14:11 -08:00
Kurt
77cac48d34 Add sanity check for min level eggs
Closes #3797
2023-02-18 23:19:50 -08:00
Lusamine
3e5c31a7b5 Add server dates for Jiseok's Garganacl event 2023-02-17 02:22:39 -06:00
Manu
1d2c8d27ba
Fix MetDate for WC9 templates (#3790)
* fix flabébé wc9 details

* add JumpFesta Gyarados EncounterServerDate

* Fix MetDate when generating from WC9 template
2023-02-16 23:57:03 -08:00
Kurt
39a7007541 Extract Bulk Analysis components 2023-02-08 17:24:47 -08:00
Kurt
f77e605cae Update AreaWeather9.cs 2023-02-08 08:19:38 -08:00
Kurt
ad31ebbbe2 Update TransferVerifier.cs 2023-02-07 22:30:33 -08:00
Kurt
aa430b48ca Disallow LGPE event gift OT handling 2023-02-07 21:56:25 -08:00
Kurt
ad0f604841 Add pokeflute to key XY
Temporary key item
https://gaming.stackexchange.com/questions/179667/how-to-get-the-pokeflute-in-pokemon-x-and-y
2023-02-07 21:52:06 -08:00
Kurt
fe2cbeac31 Add date restrictions for WC9, pika diff 2023-02-03 20:30:41 -08:00
Kurt
60a53b6afa Skip closing other-thread popups on sav load
Plugins may have popups that were created on another thread as diagnostic messages; by trying to close these on our main GUI thread, the program crashes.

Just leave these other-thread forms open when we change save files instead of crashing or closing them on their proper thread.
2023-02-03 12:52:52 -08:00
Kurt
8279615040 Fix bit wrap met location matching
Use ulong bitmask not u32
2023-02-02 15:12:18 -08:00
Kurt
3d29cc5a19 Misc tweaks
- Allow paradox species to receive master rank ribbon
 - Resize & center IV/AV rand button (localizations
were too wide for AVs)
 - Highlight blue the most recently toggled Ribbon
2023-02-01 16:55:38 -08:00