Commit graph

3056 commits

Author SHA1 Message Date
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
80eafc5b40 Check fixed nature when fixed for static encounters
Closes #3996
2023-09-16 09:39:50 -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
c09a4646a1 Fix incorrect move reference (Aipom evolve) 2023-09-15 20:35:02 -07:00
Kurt
9f340b592b Evolve-With-Move: Refactor to be memory-like
Evolving with a move requires once knowing the move, should be a much better approximation solution here. Ideally we check in specific contexts as Pokemon may learn their requisite moves after evolution, but this should catch most for now.
2023-09-12 18:14:22 -07:00
Kurt
21725aa1c0 Misc enc template ctor fixes
Static8: Use flawless IVs
Slot8b: set safari ball when required
GBRestrictions: use struct to bypass boxing allocation
2023-09-12 18:12:44 -07:00
Kurt
3a28eee2e9 Remove old GeneratePKMs api methods
Use the GenerateEncounters methods instead, just a single line extra for each consumer.

PokemonGenerationReturnsLegalPokemon now works for all Gen1-7 encounters->PKM (except for Korean WC6 Arceus form mismatch), still disabled from auto-test due to it taking about a minute to generate everything. Future updates can add special methods for SW/SH, PLA, BD/SP, and S/V if the species/form exists in the game.
2023-09-11 18:20:22 -07:00
Kurt
fe7012c3eb Allow hatched Gift2 eggs to have met info
Closes #3985
2023-09-11 01:00:24 -07:00
Kurt
e3f8091971 Misc fixes
Ignore slot match for Swarm3
Honey Tree only yield possible slots via TID/SID
Pick min level for EncounterTrade1
Set nickname for CXD Elekid trade
Set held item for Pt Giratina
Set egg location for Ranch gift hatched egg
Set hidden ability flag for N's Darmanitan
Set XY Vivillon form based on generated geolocation
Force evolve Trade species if encounter requires it
Correctly recognize pikachu-colored-pichu Gen4 gift PID type
Set hatched manaphy egg's met location & date
2023-09-11 00:54:40 -07:00
Kurt
b536388d0d Misc tweaks
Add xmldoc
Simplify some casts
Demote priority of Gen2 event yielding
Remove old EncounterMatchUtil code
Repoint DateTime.Now to console specific date provider stubs
2023-09-10 21:17:47 -07:00
Kai
c7aa497e73
Add Cetitan Eligible Date Range (#3981)
Update wc9.pkl
Closes #3982
Closes #3984
2023-09-09 21:02:58 -07:00
Kurt
19acce85c8 Update LegalityAnalysis.cs 2023-09-07 12:39:13 -07:00
Kurt
ec4eee6047 Update Encounters8.cs 2023-09-06 21:29:27 -07:00
Kurt
7fcde8a447 More Gen1/2 considerations for tree pruning
Need to prune tree for template according to the correct generation (disallow baby pre-evolutions for Gen1)
Also disallow Evolution moves for Gen2 if the evo is the enc species.
2023-09-04 20:34:46 -07:00
Kurt
45216dfa1b Set template version as byte
Be consistent with other templates

Also sets OT details for Static8a
Closes #3979
2023-09-04 18:50:35 -07:00
Kurt
4e0f23cdc0 Handle get moveset for Gen1 Red Trade Jynx
Need to not devolve into Smoochum as the rules are restrictive: no relearn, but we want to allow Jynx to "permit" moves it learns from levels 0-29.
2023-09-04 18:23:10 -07:00
Kurt
91d4ba5f03 More template tweaks
VC1/2: templates with non-hidden return correct ability permissions
PLA set met date (oops)
2023-09-04 14:57:39 -07:00
Kurt
e0e6c51498 Set template moves if provided 2023-09-04 10:15:20 -07:00
Kurt
2b55232998 Add Vespiquen as combee-genderbranch
Remove allocation in SetRandomChainShinyPID

Add Salazzle for completeness
2023-09-04 08:53:06 -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
Kurt
63c027879f Account for Snorunt->Froslass Pokewalker PIDIV 2023-09-02 16:46:23 -07:00
Kurt
e1c8f52a07 Misc tweaks
Set met dates for gen9 static encounters (oops)
Check interface implementations for HasProperty
2023-09-02 15:53:51 -07:00
Kurt
0f7e623842 Use Gen8 toxel gift IVs in ctor
ty anubis
2023-09-02 09:30:43 -07:00
Kurt
93ddee4be4 Skip dmax level check for rank 2023-09-01 22:07:25 -07:00
sora10pls
3346e2f895 Mewtwo the Unrivaled 2023-08-31 20:05:01 -04:00
Kurt
1b22453870 IsIVsCompatible -> IsIVsCompatibleSpeedLast
Fix implementation as all uses are checking IVs Speed Last, but the method wasn't thinking like that.

Improve base ROM raids for SWSH to ensure the Rank roll matches the output.
2023-08-30 19:08:00 -07: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
santacrab2
9e230b19f8
Assign fixed nature/Genders to EncounterTrade9 instead of random (#3971) 2023-08-30 07:49:10 -07:00
Kurt
78e7536459 Handle setting egg flag in cxd saves
No longer throws an exception due to EncounterInvalid having an invalid version ID (fails to fetch personal/learnset).
2023-08-29 22:47:07 -07:00
Kurt
978bcfa56f Misc enc template tweaks
Skip string fetch for Trade1
Set gender for Trade8
Add record to wrap Gen8 raid generate params, return & use bool for filtering results, fallback to unrestricted if none succeed
Fix gender comparison for Entree5 slot
Simplify gen2 ResetKey fetch (byte sum of Money/ID/OT(used)
Closes #3970 by filtering gender inside the method like Encounter9RNG with an early return
Adds IV filtering inside the method with an early return like Encounter9RNG
2023-08-29 22:22:23 -07:00
Kurt
5222fdc6ad Add more tagging for IFixedGender, IFixedNature 2023-08-28 21:09:52 -07: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
00bb8ec7de Fix misc matching regressions
Gen4/8b Muchlax tree (&& -> ||)
Colo Umbreon w/ Bite (IMoveset)
WC3 unhatched -> use MysteryGift validator

Remove wurmple defer check for Static3 (no wurmple encounters)
Remove unnecessary spaces for colo enc definitions
2023-08-23 22:03:36 -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
50608c1b15 Misc encounter tweaks (extract/pass personal)
Removes doublefetch for personal, maybe faster ctor.
2023-08-21 20:07:53 -07:00
Kurt
86459812c1 Misc tweaks
Ensure GO IVs are respecting the min floor
Add some comments, reuse PersonalInfo reference instead of refetch
Fix Hoopa Unbound SlotWrite changing to 3
2023-08-20 00:31:54 -07:00
Kurt
2777a3e039 Tag some encounter descriptions with more info 2023-08-19 16:43:05 -07:00
santacrab2
aef2cc7066
Add missing fateful setters (#3967) 2023-08-19 15:57:07 -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
sora10pls
910415ea8d Clean up Encounters9 encounter definitions
Pad species IDs to 4 digits, maintain a consistent order of fields
Also re-order trades to match the order seen in the ROM (more to be added in DLC)
2023-08-19 11:10:21 -04:00
Kurt
15faf8197a Update EncounterStatic4.cs 2023-08-18 11:48:49 -07:00
Kurt
0b2d167465 Update EncounterStatic8a.cs 2023-08-18 08:38:00 -07:00
Kurt
213234b4d2 Fix USUM max move ID usage for HOME learn
Closes #3966
Closes #3954 (original)
2023-08-17 17:36:39 -07:00
Kurt
c4b8cab9cd Set form when appropriate 2023-08-17 11:23:22 -07:00
Kurt
392dfbbb4e Gen4 trade gift nickname 2023-08-17 10:23:29 -07:00
Kurt
ff3081408a Change Gen4 roamer default met tile
the groundtile bit permission was causing the Route 201 to set Water which isn't possible to encounter them on, so use the lowest bit instead of highest bit
2023-08-17 10:15:21 -07:00
Kurt
bfc24dd5c2 Update EncounterTrade4RanchGift.cs 2023-08-17 08:26:50 -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
santacrab2
57e23cc860
- misc template -> pk tweaks (#3964)
* - misc template -> pk tweaks
2023-08-16 18:57:44 -07:00
Kurt
0a9300874b Check current level on GB Era event gift eggs
Closes #3963
2023-08-15 16:09:08 -07:00
Buggz Evol
e1499398f6
Add Eduardo Gastrodon eligible date (#3959) 2023-08-14 20:13:46 -07:00
Kurt
c6a961bda6
Add Xoroshiro128Plus Solver, SW/SH Raid verification (#3961)
Due to how the game generates the Pokémon data, the first two (or three) RNG calls are used to set the 32-bit `EncryptionConstant` and `PID`. With 2x 32-bit and 1x 64-bit values, we can algorithmically reverse the movement & manipulation of bits to recover the initial seed. Notably, certain bits of the initial state are not captured by our first two (or three) outputs, so we must brute-force guess at the initial state, and verify the RNG's output yields the expected values.

**With the ability for real-time Xoroshiro128+ seed reversal, we can now validate RNG correlations for SW/SH raid encounters natively within the program.** For now, the legality fail error message is extremely vague and any validated seed won't be "remembered" for the Legality Parse like other RNG methods. These seeds are 64bit, while every other "remembered" `PID/IV` seed-info is 32-bit.

Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
2023-08-14 20:01:38 -07:00
Kurt
534dc02154 Misc enc template -> pkm fixes 2023-08-13 17:23:16 -07:00
Kurt
3afcfcdfa3 Add setters for Dynamax/Gmax static8 2023-08-12 16:45:43 -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
3e13b1bc29 Add Tatsugiri/Mew eligible date ranges 2023-08-08 17:58:12 -04:00
sora10pls
96fa89188a Add latest distribution raid data 🦍 2023-07-27 20:03:28 -04:00
Manu
4ca9f2a905
Add Nontaro's Shiny Grimmsnarl Server Date (#3946)
* Add Nontaro's Shiny Grimmsnarl Server Date

* Corrected end date typo
2023-07-27 07:37:46 -04:00
Kurt
22aaea63df Update LearnGroupHOME.cs 2023-07-21 19:54:19 -07:00
Lusamine
92d65dc6a4 Add legal date range for Dark Tera Charizard 2023-07-21 21:05:58 -05:00
Lusamine
cf4de45c03 BDSP Valley Windworks Drifloon is 3 IV guaranteed 2023-07-21 21:05:06 -05:00
Kurt
c596804578 Minor clean
Inline logic for Meowstic form branch evo
Pass levelup byte value directly instead of recompute
With EvolutionSet all shared, reorder the constructor so the primary ctor doesn't need manually ordered properties (8 byte total struct size)
2023-07-21 15:19:12 -07:00
Kurt
171ee0d222 Misc tweaks 2023-07-21 13:41:19 -07:00
Kurt
c5d35fbce5 Handle Volt Tackle for HOME sharing GetAllMoves 2023-07-21 12:24:31 -07:00
Kurt
e3b62cf80d Update EncounterMovesetGenerator.cs 2023-07-21 11:48:29 -07:00
Kurt
6c6d02fad2 Fix oopsie
partially reverted change forgot to undo adding these
2023-07-16 20:42:51 -07:00
Kurt
8c5773969a Add HOME hoopa move share, add form specific check
Hoopa cannot know both moves due to form reversion
Kyurem cannot know both moves due to form reversion
Kyurem cannot know Scary Face when fused in past games

Add dexnav for AtAnyTime/HOME lookback when original moveset deleted (no longer in local relearn moves)
BDSP Underground encounters w/ egg moves can be shared by other means
2023-07-15 13:58:41 -07: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
Lusamine
2aef48172e Allow SV Mini & Jumbo Pikachu to be valid until Aug 1 2023-07-14 15:25:02 -05:00
Kurt
ee9ae63c22 Misc tweaks
Move enum -> ushort instead of int
Redo handling of HOME Volt Tackle (disallow on SWSH Cap Pikachu)
Pass spans instead of strings to use span methods
Reset encounter filters on early abort
2023-07-13 22:18:34 -07:00
Kurt
3a88190613 Unify EvolutionSet deserialization
Reformat all pickles to the same serialization format (latest)
(format ignores all empty evo entries, to skip allocation of dead entries)
346KB -> 60.3KB, -200 lines of code
2023-07-12 19:09:23 -07:00
Kurt
292ea5ba44 More encountertrade workarounds
probably not entirely correct, but better than flagging incorrectly
2023-07-11 16:25:05 -07:00
Kurt
a49508b354 Check scale copy in non-SV formats
Rather than ignoring it
2023-07-11 11:05:55 -07:00
Kurt
6a5dc5caa5 Revise baby species-form check for SWSH/SV
Evolutions fail to reverse Alolan Raichu in these local contexts, so revise the sanity check to use Personal instead since seedpoke data is available.
2023-07-11 08:52:46 -07:00
Kurt
2e0a2ed7eb Adjust head evo max level for 345 vc7 transfers
https://projectpokemon.org/home/forums/topic/63635-pkhex-230709-bugs/
2023-07-09 21:06:47 -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
b5f0296fe6 Skip yielding GO8+ encounters if PB7
No backwards transfer to LGP/E, and this behavior is only encountered if you turn off specific filtering settings as the generator filters them out afterwards.
2023-07-08 18:28:09 -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
1b2efef864 Add GO masterball check
go ahead and waste them
2023-07-07 21:29:51 -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
164d517ef1 Allow move crossover from GO initial movesets
GO imports that are created with their PK7 and PB7 movesets can bleed from their initial moves.

Example: Muk-Alola level 20 with Minimize can bleed into SV at level 20 (below the normal learn at level 21).
2023-07-07 19:32:38 -07:00
Kurt
41693b0142 Misc fixes 2023-07-06 19:41:27 -07:00
Kurt
0b9ec529d5 Update LearnSource2GS.cs 2023-07-05 22:08:03 -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
Lusamine
e02b33ef2c Add Wedgehurst as valid general location to gen 8 sign memory 2023-07-05 19:40:17 -05:00
sora10pls
cc7b500566 Add legal date range for Paul Chua's Arcanine
Closes #3931
2023-06-30 19:39:00 -04:00
James Park
0ba64a8da2
Pokemon location tooltip fix for PLA + miscellaneous comment fixes (#3920)
* Fix Pokemon tooltip for LA incorrectly referring to SwSh location table

* Fixes to comments referring to incorrect generation/version/game

---------

Co-authored-by: James Park <5295838+pencilethics@users.noreply.github.com>
2023-06-20 10:36:28 -07:00
sora10pls
be210ceab2 Add 정원석's Gastrodon Server Date
Closes #3919

Co-Authored-By: Sakura <106369723+xiaolong11123@users.noreply.github.com>
2023-06-17 08:22:49 -04:00
Kurt
8cc1220056 Minor clean 2023-06-11 10:38:51 -07:00
Manu
147eda0c74
Add そらみつ's Bronzong Server Date (#3911) 2023-06-11 13:16:15 -04:00
sora10pls
acba041ef8 Reorganize WC8 HOME gifts, fix Jewel of Life date ranges
tfw time zones
2023-06-11 12:24:07 -04:00
Manu
ee2c8945d3
Handle Rev 2 Home WC8 cards (#3910) 2023-06-11 09:03:39 -07:00
Kurt
11a4846b9e lower evolution stage and higher level
why did I do <= instead of <
the world may never know
2023-06-10 21:40:30 -07:00
Kurt
36a696e446 Misc tweaks
Prep for WC8 HOME Gifts having random PID/EC
2023-06-09 01:59:04 -07:00