Commit Graph

1229 Commits

Author SHA1 Message Date
sora10pls
d5cc675d15 More ZA form considerations for Pumpkaboo/Gourgeist
Initial handling only really considered the form name changes for English, but in some localizations, more than just Average and Super got changed. Now include all four updated form strings for all localizations

FRA: Mini -> Petite, Maxi -> Grande
ITA: Mini -> Piccola
DEU: S -> Kleine, L -> Große
ES-ES: Pequeño -> Pequeña
2025-11-03 12:23:49 -05:00
Kurt
b407d8f0a0 Show less-detailed scale eval in Z-A 2025-11-01 16:59:54 -05:00
Kurt
d5314a00f5 Allow game bug for trade evo's & plus moves 2025-10-29 17:40:13 -05:00
Kurt
4c2cc2f45f Add replace trainer name (Z)
profanity OT/nick => replace with this
not that it is currently being used, as none of the official events have bad OT names, and HOME can't transfer in stuff-yet-to-reset.
2025-10-29 16:33:49 -05:00
Kurt
5cd6f456f0 Minor tweaks
Fix ability index calc for generate & match
Fix message for mystery gift fateful encounter flag should be false
Add PA9 to GetBlank for anyone using the method via NuGet dll
2025-10-26 23:58:28 -05:00
Kurt
fd1c538cc5
Changes for Legends: Z-A support (#4596)
Refer to pull request notes and the eventual changelog for a high-level summary.

Co-authored-by: Matt <17801814+sora10pls@users.noreply.github.com>
Co-authored-by: Lusamine <30205550+Lusamine@users.noreply.github.com>
Co-authored-by: SciresM <8676005+SciresM@users.noreply.github.com>
2025-10-26 19:01:44 -05:00
Kurt
74870abc55 Fix item convert for gen2 showdown import
Add handling for wrong-EV format imports
2025-09-24 23:10:40 -05:00
abcboy101
dc52331cf1
Fix PK2.ConvertToPK1 (#4561) 2025-09-14 21:40:04 -05:00
Kurt
7d77c3568d Localize status type browser on hover
Toxic isn't translated, so just use "Toxic".
2025-09-13 13:35:39 -05:00
abcboy101
a75ff7b2b0
Correct Gen 5+ status conditions (#4558) 2025-09-13 12:52:17 -05:00
Kurt
ac777ba3ec Swap gen1 trade nidoran jp/int species
Also flag * char for international encounters that aren't in-game-trades.

https://projectpokemon.org/home/forums/topic/67161-invalid-ot-from-generation-12-uses-unavailable-characters/#findComment-297053
2025-09-07 17:30:19 -05:00
Kurt
5f5ec65c4a Add training bag effect party stat
ty Anubis
rearrange some of the comments for clarity

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2025-08-31 00:01:14 -05:00
Kurt
c3b3b611aa Super Training: another look
revise criteria for ribbon
add legality check for training bag values
add localizations for distribution training regimens (never distributed)

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2025-08-28 20:19:05 -05:00
Kurt
dd5d6a4e39 Minor tweaks
no functional change
2025-08-22 16:33:04 -05:00
Kurt
ea85d5e6b0 Minor clean 2025-08-16 09:21:16 -05:00
Kurt
e25b2037e2 game->version 2025-08-16 09:21:16 -05:00
Kurt
c3873165af Add farfetch'd apostrophe 1/2->7
the other ver 1.2 bug that was fixed in 1.3
every other diff noted in https://github.com/kwsch/PKHeX/pull/4545#issuecomment-3192383636 is an inaccessible text entry. Farfetch'd is set by the game on capture, just not enterable via text entry.

Restore 0-9 for both int/jpn as Porygon2 exists. 01[]345... are un-enterable, but whatever. Should be a text entry check rather than a transporter check.
2025-08-15 14:25:45 -05:00
drabu96
3e8c355ef7
Fix pk1/pk2 char conversion to >=pk7 (#4545)
* Fix pk1/pk2 char conversion to >=pk7

Fixed conversion of a gen1/2 "․" to ASCII "." when converting to pk7 or newer.
Added a test that verifies the fix.

Addresses the issue: https://github.com/kwsch/PKHeX/issues/4543

* Update StringTests.cs
2025-08-15 13:30:07 -05:00
Kurt
47efdf8a90 PK5: add pokestar fame edit, update translations
Remove pk4 walking mood from extrabyte list
2025-08-10 23:09:27 -05:00
abcboy101
8f9fec0b13
PBR: Add Battle Pass, Gear, Trainer Info editors (#4540)
* Fix PBR checksums

* Fix PBR desyncs between Data/Container

- CurrentSlot.set reloads Data from Container, so copy other.Data to Data after
- When editing the OT name, use Data if the requested slot is the current slot

* Correct PBR party offset/size

* Add GameVersion.BATREV

* Add Gear Editor

* Add Battle Pass/Trainer Info Editor for PBR

* Minor tweaks

* Fix ResetGear/UpdatePresetIndexes
2025-08-10 22:43:03 -05:00
Kurt
3a4fe49182 PB7: Add Spirit/Mood names, editing, checks
Official Names from guidebook: https://discord.com/channels/497890797115670539/950895799401848852/1285451683945779303
Removing from party (except starter): reset to 100 -- not ALWAYS like the previous logic once did.
Flag any non-party/starter if not 100-100.
Add separate GUI controls (not to confuse with Gen4's Walking Mood)
2025-08-10 02:16:37 -05:00
Kurt
d4bbb6dd02 Misc tweaks
Ball: all ball IDs are in a sequence +1'd. No need to have an array when we can just increment within the range. Ez removal of static constructor and allocation, and better iteration (and skips index 0!)
Disallow E/FR/LG item deposits of anything besides general pouch (R/S is like G/S/C, any pouch). Confirmed via testing in-game and matches Bulbapedia's testing.
Disallow Gen2 held item being an HM; no longer considered valid as a tradeback catch rate value. Oops that HMs were "allowed" for so long!
Encode Gen2 held items to bitflag array to not need to compute the merged array. Relocate duplicated logic to a single location in ItemConverter.
Fix gender-changing marill edge case comparing the wrong ratio
2025-08-08 23:43:22 -05:00
Kurt
af416dc71a Add gen4 mood to pkm editor (cosmetic) 2025-08-08 00:42:15 -05:00
Kurt
fd3af56ec4 Legality: add date sanity check, shinyleaf/mood
date: If location specified, ensure valid date; if no location, ensure zeroed.
shinyleaf: check bad bits, check crown has all leafs.
mood: rename from pokeathlon, now sbyte. All values possible, only flag outside of party in HG/SS.

Revise HGSS slot setter to wipe mood to match game behavior (and thus not retain mood to be flagged by the legality check).
There's currently no editor for it, but maybe I can add it in a future commit.
2025-08-08 00:19:33 -05:00
Kurt
1d57facd22 Minor tweaks
extract max/min level to const
fix max species ID in filtered sources
2025-08-02 21:02:11 -05:00
Kurt
90cfa59102 Misc tweaks
Pass Analysis to external localizer
Cache index for bulk analysis flagged slots
2025-07-29 20:12:41 -05:00
Kurt
47092a2df0 Misc tweaks 2025-07-28 18:45:30 -05:00
Kurt
f370c0cc39
Memory<byte> Refactoring (#4527)
`SaveFile` and `PKM` classes now use `Memory<byte>` instead of `byte[]` to store their primary backing array data.
2025-07-27 20:57:10 -05:00
Kurt
a02712e375 Add gen5 spin trade as valid link trade loc
ty Cappy for reporting, and @PP-theSLAYER & @Lusamine for testing.
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/page/32/#findComment-296214

gen4 spin trades in pt/hgss do not set the wrong value -- gen5 only bug.
2025-07-23 22:37:39 -05:00
Kurt
42835e9aac Misc tweaks
Adds a debug hex file loader from clipboard
sav1 current box if empty -> set if box is desync'd
wb7: add comment note of "real" value
2025-07-16 23:02:57 -05:00
Kurt
0e9a3129b4 Misc stuff
Adds GameSync ID for Gen5
Add GiftRibbons to gen3 mainline saves
Add defined chars from Transporter update 7 (latest)
2025-07-13 01:00:43 -05:00
Kurt
cdb5770f5f Minor tweaks
Fixes cosmetic issue on gen4 seed example times
no functional change otherwise
2025-07-08 23:00:27 -05:00
Kurt
0b77aa5729 Add swsh string check
Replace debug assert in SWSH encounter finder
Add dir arg for pogo pickle reload for debug builds
re-add latest outbreaks
2025-07-06 18:48:49 -05:00
Kurt
16f30ebe2d Handle gen6 wc's with bad OTs
https://projectpokemon.org/home/forums/topic/41065-gen-7-compilation-of-events-that-change-ot-when-traded/
2025-07-06 17:16:11 -05:00
Kurt
aee9171249 Remove length check
Nope, doesn't check length
2025-07-06 09:56:02 -05:00
Kurt
31c52b6cd2 Add HOME trade OT replacement functions 2025-07-06 09:21:13 -05:00
Kurt
89ada33e24 Add ReplaceTrainerName api 2025-07-06 02:15:10 -05:00
Kurt
607901dda1 Misc tweaks 2025-07-04 16:06:26 -05:00
Kurt
bda5baab88 PB7: Permit GO in BelongsTo check
Closes #4518
2025-07-03 18:12:08 -05:00
Kurt
416e519073 Misc tweaks
No functional change, just xmldoc and small inlining
2025-06-14 21:39:49 -05:00
Kurt
ccfa58e5f1 Split PathUtil from Util, add more xmldoc 2025-06-08 16:33:31 -05:00
Kurt
ba2245d7d8 Add more xmldoc
Updated PIDIV tests to use IV32 rather than IV sequence checks. Now marked as Obsolete to prevent myself from reusing PKM.IVs getter :)
2025-06-07 09:41:02 -05:00
Kurt
602b1b6371 Add more xmldoc 2025-06-01 11:08:07 -05:00
Kurt
93d9292d83 Minor clean 2025-05-30 17:41:54 -05:00
Kurt
c9b8a5b893 Misc tweaks
No functional change
2025-05-29 10:03:17 -05:00
Kurt
1d9fc99413 Misc tweaks
Add Count to IPersonalTable
Revise EncounterOrigin for evo chain search to use Context instead of Version
Use ITrainerID*ReadOnly as pivot for Trainer ID verification skip
Add more xmldoc
Reconfigure pla dex task fetch to be nullable, match fbs field ordering for clarity
2025-05-24 22:59:13 -05:00
Kurt
be67b007d5 Misc tweaks 2025-05-24 00:10:02 -05:00
Kurt
1c03fc3e5b Minor clean 2025-05-23 20:07:03 -05:00
Kurt
fb803c6e4d Revise region handling and game version mapping
Updated region handling logic in XK3.cs to treat PAL and NTSC_U as equivalent and adjusted remapping logic accordingly.
Added a check in PKMEditor.cs to map GameVersion.COLO and GameVersion.XD to GameVersion.CXD for consistency in filtered data sources.
2025-05-19 23:37:41 -05:00
Kurt
064e4293a0 Save Language first for gen3pkm
So that Nickname encoding can work as expected. Also fixes mainline int<->jpn changed edits

ty rainbowsunsetwaves on discord

Extend the fix to user-created eggs in Gen3 so that the OT name is converted.
2025-05-19 22:51:47 -05:00
Kurt
0d5f7c758a Fix pla purchased flag regression
ty cerquami for checking
2025-05-18 22:53:17 -05:00
Kurt
47bc45d854 GetLevelLearnMove->TryGetLevelLearnMove
As alluded to in 7442e86d65
2025-05-18 01:36:05 -05:00
Kurt
5a3ebec12b Fix characteristic of all-0 IV mons when EC%6!=0
They'll always be HP.
ty Anubis for testing and SirToastyToes for reporting

Changing characteristic is a 1 in (5/6)*(32^6) chance, when no IVs are forced; aka ~1:900million
or just get a colo e-reader mon with 5/6 chance :)

Gen4/HOME(mobile): correct, unaffected
Gen5-Gen9/HOME(switch): bugged
2025-05-17 15:03:42 -05:00
Kurt
7442e86d65 level int -> byte
Might refactor the learnset level get to byte later as a TryGet so -1 is never returned.
2025-05-17 14:45:49 -05:00
santacrab2
d6c484295a
gen 4 nature (#4487) 2025-05-04 21:52:12 -05:00
Kurt
a85f919630 ShowdownSet: handling for context-locked forms
Retconned forms like Totems and Cosplay Pikachu that only exist in a specific context now get recognized again
Current-Context has shifted from Gen6->Gen7->Gen8+, so a "get form list for species" won't return these forms.

Not a perfect implementation, but better for now.
2025-05-04 13:19:40 -05:00
Kurt
0e0d812d83 Add more xmldoc 2025-05-03 23:55:06 -05:00
Kurt
ae3bb75fe6 ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual 2025-05-03 23:54:11 -05:00
Kurt
f730f7d19a
Feature: Localization of Battle Templates (Showdown Set) (#4482)
* Localization capability for each language, import & export
* Lines with stat names (IVs/EVs) can be configured to many representations (X/X/X/X/X/X, HABCDS, etc).
* Add nonstandard localizations
* Add token types for Showdown's new set format
* Add new program settings for hover & export styles. Allows users to select which presentation format they want for the hover previews, as well as the set export format.
* Revises preview hover GUI to use new settings
* Revises export events to use new settings
* Moves no longer indicate end of set
* Enhance robustness of stat parsing
* Expand all settings in settings editor on form load
* Extract clipboard -> sets operation to api for maintainability & reusability
2025-05-01 23:16:36 -05:00
Kurt
87d2f10c7f Misc tweaks
Add date validation for lgpe go park encounters (deferred, now finally remembered to implement?)
2025-04-21 00:57:23 -05:00
Kurt
972c432205 Minor tweaks
no functional change, just updating some style for readability
2025-04-20 11:08:10 -05:00
Kurt
383037db43 More xmldoc updates 2025-04-20 11:06:08 -05:00
Kurt
ef2152cf3b Misc tweaks for cxd encounters/viewing
convert, adapt to save file on view (fixes viewing gen3 ot/nick'd encounters in cxd)
display original string in cxd format (useful for jpn->eng->ENG colo, for string matching? might need to revert)
hard-match version for colo gift (MATTLE) to not confuse 10ANIV
2025-04-15 02:50:25 -05:00
Kurt
8a19968321 Minor clean 2025-04-13 11:55:20 -05:00
Kurt
1914c482c6 Add readonly interface for 3DS georegion 2025-04-13 11:52:51 -05:00
Kurt
be874dcc50 Extract TM lists to PersonalInfo
Fix gen3 allocating eggmoves 3x (instance) instead of just once (static)
2025-04-13 11:49:45 -05:00
Kurt
fbfa28a0cf Sunset PKX -> Latest
Relocate gender ratio info to EntityGender
farewell PKX; once a behemoth catch-all of >4000 lines, now no more. 😢
2025-04-13 11:44:28 -05:00
Kurt
ca03311d21 PA8: Allow un-updated mid-scale alpha floats
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/page/31/#findComment-294285

While we're here, fix PB7->PKH to retain the ReceivedTime values. Not that it matters, because those PKH values go nowhere.
2025-03-23 13:25:54 -05:00
Kurt
9b82cdfc80 Misc tweaks
CXD: indicate shadow index on hover, pokespot area
CXD: flag eggs
CXD: enc->pk try to match shininess when requesting all IVs
make some signatures dealing with level use as byte
2025-03-15 23:15:55 -05:00
Kurt
7f33741abb PP verifier: relax check based on typeof(PKM) 2025-03-13 21:53:27 -05:00
Kurt
87fb241a98 Update 25.02.23
fix bvid5 checksum check
Gen7b: add ReceivedDate/Time editor to OT/Misc tab, enable Ribbon button
2025-02-23 23:16:43 -06:00
Kurt
65df18ae66 Extract entity/template game presence filter 2025-02-23 11:25:47 -06:00
Kurt
7279af79b2 Extract pk5->pk6 PID mutation logic 2025-02-23 11:19:33 -06:00
Manu
e93425e137
Handle HOME Keldeo & Meltan; Revise WB7 (#4446)
* WC8: Handle HOME Keldeo
* WB7: Handle HOME Meltan fixed ability, scalars, AND HeightAbsolute and WeightAbsolute
* WB7: Fix PID get/set offset
* PB7: add ribbon get/set (Meltan has Souvenir ribbon and is retained on transfer to LGP/E)
* Legality: Verify Size Absolute for WB7 Home gifts, only check absolute scale when PB7
2025-02-21 20:00:28 -06:00
Kurt
93179c0281 Add LGPE received datetime r/w/lc 2025-02-13 04:53:37 +00:00
Kurt
e04ad2c6b2 Misc tweaks
Fixes shiny rayquaza
some lowering int->byte
Fix event3 random restricted seed fetch for gender
Fix gen8a encdb filters excluding static encounters, now will be properly excluded
2025-02-01 10:42:26 -06:00
Kurt
46bb7e3d3b Add trainer ID checks for cxd/rs
Templates: Add more interfaces for trainer ID properties
Closes #4431
2025-01-29 22:34:45 -06:00
Kurt
7d59e3416a Minor tweaks
== null
to
is null
2025-01-27 16:37:37 -06:00
abcboy101
6c3eec3314
Support Gen5/3DS/Switch word filters (#4423)
* Support Gen5/3DS/Switch word filters

- Separate 3DS/Switch word filters
- Add/implement Gen5 word filter
- Adjust behavior of DisableWordFilterPastGen

* Implement halfwidth/fullwidth conversion

Only applies to alphanumeric and kana
2025-01-26 10:38:21 -06:00
Kurt
b79551411b Fix batchmod compare for $rand 2025-01-11 23:20:14 -06:00
Kurt
ab215d0721
Enhance EncounterCriteria and template->pkm adherance (#4411)
Change the EncounterCriteria object to a readonly record struct, and introduce extra properties to indicate how flexible we are with random results.
2025-01-04 22:45:30 -06:00
Kurt
b94ab9acb4 Minor clean
No functional change
2025-01-04 01:24:29 -06:00
Kurt
abc1e785d8 Remove fullness/enjoyment from PKM, use interface
No need to carry this baggage further since SV ditched it. PLA and BDSP only have it because there's a gap in the structure that *we assume* is unused (rather than reserved), and is worth checking for legality (unused bytes shouldn't be used).
2025-01-02 20:19:29 -06:00
Kurt
a6beb0293c Don't bother passing evos for hypertrain check
if it exists in PLA, then it can exist in SWSH/BDSP/SV (as of latest DLC!). Only need to check if it has visited (tracker present).
2025-01-02 20:04:04 -06:00
Kurt
8ec1c8cc81 Extract some magic numbers
If Legends: ZA adds more megas (likely), would have to refactor this monster. Rename the mega check, as SV doesn't have megas, but if ZA is Gen9(a?) we need to segregate somehow.
2025-01-02 19:57:38 -06:00
Kurt
a41f32c66b Hide PKX.Personal behind methods
No need to have the entire master personal table visible within the assembly when it is only used for gender fetching. Add 2 methods that return the info that the previous consumers were wanting from the previous logic.
2025-01-02 19:53:29 -06:00
Kurt
f77899ab73 Extract entity extension list fetch
No need to have a static member in PKM for something that is only used outside of PKM.cs (save files, GUI, aka file naming)
2025-01-02 19:48:56 -06:00
Kurt
243c4102dc Reduce some allocations in SpeciesName
implement the net9 shortcut for species name lookup from span
don't fetch japanese/spanish names twice or build dictionaries for them
2024-12-31 13:15:02 -06:00
Kurt
e2086d2a0d Misc tweaks
Allow pkm batch editor to take readonlyspan property names
concrete types over `default` for clarity
encounterverifier: use const values for egg levels for clarity
batchediting: fetch all properties only once
etrade4: reduce object size/init by having Contest as a property
2024-12-31 12:53:51 -06:00
NimbusFox
f2dfeb20af
Fixing StatusCondition to report sleep correctly (#4397) 2024-11-27 16:45:56 -05:00
Kurt
231b3ffe57 IEncounterable: Add down-level interface 2024-11-18 21:58:09 -06:00
Kurt
5c338f5f74 Misc tweaks
Extract better signatures for BallApplicator.ApplyBallLegalRandom
Slot1: swap interface order (consistency with other classes, no impact)
IEncounterTemplate vs IEncounterable interface usage
2024-11-18 14:12:57 -06:00
Kurt
ceb669c112
Update to .NET 9, c# 13 (#4390) 2024-11-17 13:13:58 -06:00
Kurt
89e705c6ae Extract ball verification result 2024-11-15 23:39:33 -06:00
Kurt
3c574a45f1 Revise enc1/2 -> pk1/2 nickname set
Skip the IsNicknamed evaluation, saving at least 1 string allocation on ctor. Remember the IsNicknamed state when we set false.
GUI: provide the selected language rather than recalculate
2024-11-10 09:32:33 -06:00
Kurt
51464fb4af Update PK9.cs 2024-11-09 22:34:33 -06:00
Kurt
ec24b8b8d5 Enhance Gen5 download content I/O
Initially just C-Gear, can do better!
Adds i/o for Pokedex skins, Musicals, Battle Videos, Movies & PWT (B2W2), and a research-only tab for Battle Test (never distributed by GameFreak, so doesn't work).
2024-10-06 01:10:32 -05:00
Kurt
1dc94152c3 Fix array reference
GC strings are 22 bytes long, but GBA strings are 10 & 7 bytes long. If a 7-char OT name is generated in C/XD and transferred, it would try iterating to the 8th char which is OOB for dest.
Iterate over the smaller array, which is always dest (in this method).
2024-10-03 14:44:22 -05:00
abcboy101
7632230edf
Support G2 mail in all languages (#4359)
* Support G2 mail in all languages

- Handle Japanese/Korean mail
- Handle both NPC and user-entered mail (#3470)
- Display European mail based on mail language (#4027)

* Fix shift

* Add support for Stad2 mail
2024-10-01 00:02:37 -05:00
Kurt
ee00a21f90 Minor clean 2024-09-30 23:54:03 -05:00