Commit graph

717 commits

Author SHA1 Message Date
Kurt
b6a42d414b RNG: Move files & extract some logic
Rearrange some folder organization to extract some common/reusable logic for dealing with RNG operations for specific gens/games.
2023-10-11 19:28:51 -07:00
Kurt
c23bae5180 Add Distribution Outbreak type & recognition 2023-10-04 22:49:56 -07:00
Kurt
965039e258 Misc tweaks, fix slot8b ball
Fix Slot8b fallback ball not being Poké (was 0).

Swap eevee & none move sentinels; branch-if-zero easier for compiler.

Lift EV-any-above100 to be checked first; fetching personal and getting EXP is slower than checking 6 indexes in stack. Both branches would check. Most pokemon won't have EVs >100 as users flip through boxes in gen3/4.
2023-10-02 20:54:17 -07:00
sora10pls
8b2b858e69 Update RibbonRules.cs
Closes #4023
2023-10-02 08:07:14 -04:00
sora10pls
57292b23c8 Update Master Rank Ribbon check for Regulation E
Sinnoh starters permitted, Kitakami dex permitted, Legendary/Mythical still disallowed.

Also check for Battle Version on GO8 encounters in SWSH, which while are Gen 8 encounters, require Battle Version since they didn't originate from SWSH.
2023-10-01 09:17:51 -04:00
Kurt
96e74a05d0 Add HoneyTree API 2023-09-28 17:35:29 -07:00
Kurt
12ee201431 Extract EV limit logic 2023-09-27 22:15:59 -07:00
Kurt
9ce715f70c Copy phione disallowed bred ball rule from BDSP
only pokeball
2023-09-17 19:49:53 -07:00
Kurt
05f9073f31 Add API for home tracker state checking
Correct poltchageist masterpiece comments
swap order of Ogerpon (more likely to be Level 70)
Add methods to filter gameversions by context
add 3 more sizes
2023-09-16 16:53:06 -07:00
Kurt
7703576088 Update 23.09.16 - Teal Mask
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2023-09-15 23:36:21 -07:00
Kurt
fe7012c3eb Allow hatched Gift2 eggs to have met info
Closes #3985
2023-09-11 01:00:24 -07:00
Kurt
3fdfd29e4b Misc tweaks
Gift1: use IVs if required
Gift2: Enforce 0 TimeOfDay
Egg9: Require Egg Location to match encounter
PGT: keep requested gender in the event of antishiny
PGT: never yield Korean Ranger Manaphy for Format4

Simplify ushort range checks
Rename `EReader` bool to `IsEReader`
Extract Gender/Nature fetch for unfixed encounters
Remove Unown PIDIV branch when template has no Unown
Remove unnecessary loop for Pokewalker PID creation
2023-09-04 00:50:26 -07:00
sora10pls
3346e2f895 Mewtwo the Unrivaled 2023-08-31 20:05:01 -04:00
sora10pls
2f0dd1e94f Pokémon GO: Adventures Abound
Permit Great Ball / Ultra Ball for Sprigatito, Fuecoco, and Quaxly
2023-08-30 17:29:50 -04:00
Kurt
fd02b97ce1 Misc tweaks
Allow nickname->species with span
add ConstantExpected annotations
Correct Gen8b ability set calling CommonEdits instead of direct setter
Slightly better perf on gen5/gen8+ location fetch
Misc pkm ctor fixes for b2w2 trade & wc3 eggs
wurmple evo now has an enum to be more explicit
no recursion for gen5 generator
fix showdown line length check allowing 86 instead of 80
2023-08-27 23:05:50 -07:00
Kurt
108708dcda Add gsc union cave B2F shore fishing slots
6180be355e/data/maps/maps.asm (L115-L117)

https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=285012

Also handle the SID==0 fishy for VC (which is fine)
2023-08-21 20:09:35 -07:00
Kurt
f7d66db7e2 Misc tweaks
Check HT move memories in Gen9 appropriately for deferral cases
Add missing ID32 set for GO8->PKM
Slight pre-work for Mightiest Mark Mew method signatures
2023-08-19 11:13:20 -07:00
Kurt
9855382b0a Misc encounter tweaks, annotations
EncounterEgg now indicates FixedBall(Poke) for Gen2-5
EncounterSlot2 now indicates Form Random for Gen2 Unown, database
EncounterStatic3 now generates FRLG Gen2 Roamers with correct location
EncounterCriteria now used more heavily for requested IVs
EncounterPossible3 now correctly skips Eggs if eggs are not requested
EncounterGift3Colo now generates Japanese Bonus disk gifts only in Japanese, doesn't validate non-Japanese
2023-08-17 00:07:54 -07:00
Kurt
f632aedd15
Encounter Templates: Searching and Creating (#3955)
We implement simple state machine iterators to iterate through every split type encounter array, and more finely control the path we iterate through. And, by using generics, we can have the compiler generate optimized code to avoid virtual calls.

In addition to this, we shift away from the big-5 encounter types and not inherit from an abstract class. This allows for creating a PK* of a specific type and directly writing properties (no virtual calls). Plus we can now fine-tune each encounter type to call specific code, and not have to worry about future game encounter types bothering the generation routines.
2023-08-12 16:01:16 -07:00
sora10pls
96fa89188a Add latest distribution raid data 🦍 2023-07-27 20:03:28 -04:00
Kurt
18fd790657 Minor perf tweaks
Relocate checksum adders to Checksums class, improve performance by eliminating slice calls
Improve HOME sharing for GO8 and IMoveset encounters: actually sanity check GO8, and skip other non-PK7/PB7 cases.
2023-07-15 11:22:48 -07:00
Kurt
478413e8cd Discard Fairy type Arceus when reversing
https://projectpokemon.org/home/forums/topic/63635-pkhex-230709-bugs/
2023-07-09 20:22:01 -07:00
Kurt
7fb5dc2fde Update go pickles, add fr bdsp chatot goof
Nintendo + ILCA = no nicknames allowed ;)
While we're here, streamline Gen4/5 evo pickles too -- trim out unused bytes, no longer need to scan for array length (perf). Adjust method IDs for gen4 so we can use the same code for gen4 & gen5.
2023-07-09 19:59:37 -07:00
Kurt
26cabd022b Update 23.07.09 2023-07-09 14:10:40 -07:00
Kurt
2ea6ee4e10 Misc fixes
Add sound for adding all XY fashion items (was silent)

Fix Gen7 Resort PKM loading (4 bytes extra per slot)
Fix Gen6 HallOfFame TID/SID validation dropping leading zeroes
Fix Gen6 Best Friends ribbon validation
Treat GO8 as server date restricted, give detailed message outside window
HasTracker => must have HT name
2023-07-08 20:00:41 -07:00
Kurt
a0fb01db23 More evo path restrictions
Early abort for bdsp spinda nincada
Skip caching visitation for nonvisit instead of post-work zeroing
Fix slowpoke-galar evo banning
2023-07-08 14:51:45 -07:00
Kurt
6d4cd60461 More fixes/improvements
Improve cctor times for Breeding; direct calls for splitbreed checks; inlined binary searches via generated IL instead of hashset
Fix permitting alpha ribbon on non-alphas in Gen8/8a/8b, disallow Gen8a/8b ribbons for Gen7 Alolan Raichu
Improve some IL generation of EvoChain logic
Add xmldoc for new evotree additions
2023-07-08 12:46:46 -07:00
Kurt
79729de90c Misc fixes
ty matt
2023-07-08 08:40:57 -07:00
Kurt
014cd8c738 Ban voltorb-1 ball inheritance 2023-07-07 21:20:15 -07:00
Kurt
c52b49de08 Update BallVerifier.cs 2023-07-07 20:57:01 -07:00
Kurt
41693b0142 Misc fixes 2023-07-06 19:41:27 -07:00
Kurt
dcc0e79435
Evotree: Evolution Traversal Enhancements (#3936)
Like move validation, evolutions are the earliest thing we wish to traverse when determining what encounters may have originated the current Pokémon. To determine the permitted species-form-levels a Pokémon could originate with, we must devolve a Pokémon by traveling down-generation to origin. Once we have an encounter, we can then evolve it to the current species, traversing upwards from origin to the current format.
2023-07-05 21:14:09 -07:00
Kurt
8cc1220056 Minor clean 2023-06-11 10:38:51 -07:00
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
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
e32410279e Flag invalid gimmighoul formarg values 2023-05-07 15:39:37 -07:00
sora10pls
94f98d66f5 Add latest distribution raid data 🦎 2023-04-27 20:03:51 -04: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
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
c73264d4f3 Minor minor perf
Small changes to reduce some allocations
2023-04-15 01:58:37 -07: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
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
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
Kurt
aa13c93e65 Add misc generic constraints
Resolves some allocation analyzer issues
2023-03-25 23:28:28 -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