Commit graph

5597 commits

Author SHA1 Message Date
Samuel Magnan
fda815c3e5
Gen2: Add MysteryGiftIsUnlocked flag in Simple Editor (#4007)
The flag indicates whether the option "Mystery Gift" has been unlocked and it is displayed in the start menu.
Note: It is unlocked after talking with the little girl on the fifth floor of the Goldenrod Department Store.
2023-10-27 21:09:15 -07:00
Jonathan Herbert
0015beb8d8
Add Accessors for Black 2 And White 2 Medals (#4043)
Thanks @suloku as the logic this uses comes from their BW_tool.
2023-10-27 21:02:04 -07:00
Jonathan Herbert
fd1f00e1a6
Handle Sun and Moon Legendary At Altar Flags Correctly (#4044)
According to the research by IgnisSpace shown on https://projectpokemon.org/home/forums/topic/64103-sm-battle-flags-and-others-misc-flags/ , Solgaleo and Lunala have different flags for if they are at the Altar of the Sunne/Moone.
2023-10-27 21:01:27 -07:00
Kurt
5c7ce2c0a6 Misc tweaks
Fix g12 str set (jp/en was swapped, oops)
add more xmldoc
minor readability/short circuiting
2023-10-27 21:01:11 -07:00
sora10pls
7fd1c9da1e Add Halloween raid/outbreak data 2023-10-26 21:12:14 -04:00
Kurt
16aba45371 EncDB: Fix colo starter yield
Improve enc->ck3 creation, inline the shiny/gender reroll logic instead of trying again outside the loop.
Rewrite the pidiv logic to be more obvious

colo starters now show up in encdb list
2023-10-26 01:07:20 -07:00
Kurt
325f75e3d3 Gen12 strings: span instead of runtime dictionary
More performant byte->str performance (no longer needing to hash byte and fetch bucket), unmeasured str->byte performance, but it is the same implementation as Gen3 which is not a bottleneck.
Reduces the dll size by 80KB, and RAM usage by an unmeasured (likely similar amount). Better startup speeds since multiple dictionaries do not need to be allocated and created.

Moves Gen1 trainer names (0x5D) to Transporter class, and remove Korean entry (not legally obtainable since there's only Gen2 Korean games and Gen2 Korean VC cannot trade with international).

Hard verify Gen1 trainer name for language, since 0x5D is the ROM transfer language. Nickname can still be from any of the connected games.

This refactor makes it easier to use a different charmap for byte<->str for Boxes (see #4027) and the language differences. We have a master table that "works" for all text name entry, but localizations differ for some glyphs accessible in the box naming UI.
2023-10-25 16:34:11 -07:00
Zazsona
1816aefc25
Ranch level indexing fixes and general API usability improvements (#4041) 2023-10-20 18:28:43 -07:00
Kurt
da27814504 Minor tweaks
I quite like the DeSmuME footer check simplification.
2023-10-14 19:28:46 -07:00
Kurt
0da8c33c52 Use byte span for BinLinker check
Need to change ConstantExpected to Length when NET8 comes out next month
2023-10-14 19:25:39 -07:00
Kurt
b3bbc044ca Misc jp Gen1/2 vc fixes
Fix iterator jump
Allow bu dragonair encounter -- should probably rip out all the old catchrate compare stuff anyway.
2023-10-13 18:39:25 -07:00
Kai
6978db5e9a
Add Trixie Mimikyu Eligible Date Range (#4035) 2023-10-13 19:28:11 -04:00
Kurt
4877c63750 Update 23.10.11
Add sizes for 2.0.2
Add crossover Unown-C location for PLA - Closes #4031
2023-10-11 20:12:51 -07:00
Kurt
0491ab2372 SAV3E: Max Item ID +2
Closes #4033
2023-10-11 19:30:26 -07:00
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
BlackShark
bf8a5451ed
Updated badwords.txt (#4032)
* Updated badwords.txt

* More clean up
2023-10-10 15:18:45 -07:00
Kurt
abcaaa44cd Extract pokewalker logic from template ctor
Actually searching (instead of brute-forcing) for a spread will forever be haunting.

Add to Legality Check matching with vague partial match
2023-10-07 23:14:34 -07:00
Hendi48
1c097598e7
HGSS: Add support for editing Pokeathlon Points (#4030) 2023-10-07 08:57:38 -07:00
Kurt
707898d4e2 Add Pokewalker IV validation methods
Not yet hooked into the legality analysis (MethodFinder doesn't know about encounter template info).
2023-10-07 00:00:36 -07:00
Kurt
fac682bcad Update WordFilter.cs
Reduces startup alloc by 24KB if we don't allocate an array to store all regex strings
kinda small but ez free
2023-10-06 23:58:13 -07:00
sora10pls
bb5cc7cff1 Add latest distribution raid data 🦉🥋 2023-10-05 20:03:16 -04:00
Lusamine
e64205e504 Fix unsafe camera config block find
Closes #4026
2023-10-05 10:11:34 -05: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
e58a1565ad Add ConfigCamera9 2023-10-02 15:55:19 -04: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
17e0f1feee Prefer cave when finding Fixed origin AreaInfo
see pkNX commit
2023-09-29 22:33:43 -07:00
sora10pls
07191e6aad Label a whole bunch of delivery outbreak blocks
Paldea, Kitakami, Blueberry, BCAT Paldea, BCAT Kitakami, BCAT Blueberry
2023-09-28 21:26:27 -04:00
Kurt
96e74a05d0 Add HoneyTree API 2023-09-28 17:35:29 -07:00
Kurt
963eaaaa40 Merge branch 'master' of https://github.com/kwsch/PKHeX 2023-09-28 16:40:17 -07:00
sora10pls
3debc89e3c Fix sudachi outbreak subjugation block keys
Co-Authored-By: santacrab2 <79347566+santacrab2@users.noreply.github.com>
Co-Authored-By: notzyro <62817135+zyro670@users.noreply.github.com>
Co-Authored-By: Manu <52102823+Manu098vm@users.noreply.github.com>
2023-09-28 10:34:48 -04:00
Kurt
12ee201431 Extract EV limit logic 2023-09-27 22:15:59 -07:00
Kurt
0cda774b97 Misc tweaks
Closes #4016
Closes #4018

Adds interface to fetch 64bit correlation seeds from template
Improves re-entry performance for 64bit seed search
2023-09-26 09:32:49 -07:00
Kurt
c00657f845 Update 23.09.25 2023-09-24 21:19:53 -07:00
Kurt
88a5a1c9e5 Update WC9 ID32 handling for 2.0.1
Seems like
2023-09-24 20:56:35 -07:00
Kurt
f6ee2b1ffa Kitakami Placeholder area weather table 2023-09-24 17:11:52 -07:00
Kurt
bc18cd0ab4 Kitakami: Fixed spawn subzone & crossover 2023-09-24 17:02:42 -07:00
Kurt
b4b72a8fda Clarify Tera Raid crystal middle number 2023-09-23 20:41:50 -07:00
Kurt
7a28a23d5e Add subzone encounters
Yay untagged locations with exclusive encounters
2023-09-23 20:41:00 -07:00
Kurt
dd541e0bf2 Add TryGetBlock fetch method
Improves performance; only a single binary search for the block (instead of one or two).

Remove allcoation for SV flyhashes
2023-09-23 15:50:11 -07:00
sora10pls
0b60161379 Label more sudachi1 save blocks 2023-09-23 15:28:35 -04:00
sora10pls
9510272149 SV TM/Fly cheats: do not modify non-existent blocks
New fly location and TM Machine flags do not exist on older save revisions, which would've thrown an exception
2023-09-23 11:08:25 -04:00
Leidenfrosty
703e2ed5ad
Other Additional G9 DLC Save Sizes (#4008) 2023-09-21 19:47:20 -07:00
sora10pls
26894eb6fa Add latest distribution raid data 🔥🐛 2023-09-21 20:07:11 -04:00
Kurt
a45a7cc2d3 Misc fixes
Pokewalker: defer match if shiny
Jacq egg: recognize unhatched egg, traded
sv-pokedex-old: don't add rows for >1010 species (out of range)
static9: correctly flag scale mismatch

SAV4HGSS: expose pokegear #'s as span instead of alloc
2023-09-21 13:14:34 -07:00
sora10pls
99d4a5ccdc Add sudachi1/2 encount outbreak save blocks
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2023-09-20 22:28:20 -04:00
sora10pls
10147334e6 Add Terastal Cap, add remaining missing fashion items
Co-Authored-By: Pasquale Nardiello <pasqualeomeglio@gmail.com>
2023-09-19 20:35:50 -04:00
Kurt
5fcf82c827 Split meta filter from property filters
Closes #4009
was never implemented to work with SAV_Database... until now!
2023-09-18 20:13:23 -07:00
Manu
ce9a3d0104
RibbonExtensions public accessors (#4006) 2023-09-18 15:56:53 -07:00
Lusamine
11145c2432 Label SV BC outbreak blocks 2023-09-18 09:37:07 -05:00
sora10pls
af8194f241 Add unreleased Tracksuit fashion items 2023-09-18 08:44:43 -04:00
Kurt
685e4cfd95 Add new Raid display requirements (3/4) 2023-09-17 20:23:00 -07:00
Kurt
9ce715f70c Copy phione disallowed bred ball rule from BDSP
only pokeball
2023-09-17 19:49:53 -07:00
Kurt
96c0e199e1 Add Kitakami Raid edits, new dex block edits
Closes #3992

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2023-09-17 19:49:26 -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
sora10pls
ed6674791a Fix Ogerpon-5 and Ogerpon-6 ability text 2023-09-16 15:40:09 -04:00
sora10pls
5c1d165f2d Enhance SV fashion unlocker for DLC 1
No point in having a billion categorizations for fashion, makes things too bloated as more items get introduced.
Add in DLC items, fix giving opposite-gender starting uniforms.
Closes #3994
2023-09-16 15:34:21 -04:00
ReignOfComputer
8084102eb9
Additional G9 DLC Save Sizes (#3995)
* Additional G9 DLC Save Sizes

* Additional Size and Adjusted Diff

* Another Additional Size
2023-09-16 09:40:09 -07:00
Kurt
80eafc5b40 Check fixed nature when fixed for static encounters
Closes #3996
2023-09-16 09:39:50 -07:00
Kurt
71c4b1a97b Update SaveUtil.cs 2023-09-16 00:47:47 -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
Jonathan Herbert
988a0b5718
Fix MsgMysteryGiftSlotAlternate Error In MessageStrings_en.txt (#3987)
Close #3986
2023-09-12 18:37:11 -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
0aa4a15851 Fix cgear skin import loop
byte 255->0 overflow infinite loop if too many tiles are unique
https://projectpokemon.org/home/forums/topic/63828-c-gear-skin-editor-crash/?do=findComment&comment=285181
2023-08-30 04:44:40 -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
Alexander3a
afc29fb203
Fixed span for PokeDexEntry9SV being too large (#3969)
* Fixed span for PokeDexEntry9SV being too large

Prevents .Clear() from wiping data it shouldnt
2023-08-25 10:08:43 -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
a7f4d572e7 Set Japanese console region for pk1/pk2->pk7
Also simplifies some logic to reuse methods / use more straightforward. No longer fetches PersonalInfo twice
2023-08-23 20:47:38 -07:00
Kurt
4e13a0261d Update 23.08.23 2023-08-22 21:27:29 -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
8dd9e0803d Update dex minmax read offsets
Closes #3943

Also exposes the boolean flag in between the height/weight tuple.
Pretty sure this struct has an unused second half, and is just {byte, bool, byte}[2].
2023-08-20 13:48:01 -07:00