Commit graph

906 commits

Author SHA1 Message Date
Kurt
0303eada32 this is not that
clearer than before, yay
2020-12-21 17:12:39 -08:00
Kurt
5729718d68 Simplify ternary byte casts
No longer needed to explicitly cast, thanks c#9 !
2020-12-21 16:53:28 -08:00
Kurt
62018cce1a Unify concepts with different names
AltForm & Form & Forme => Form
GenNumber & Generation => Generation

Extract out SpeciesForm interface, and re-add IGeneration

For those using PKHeX as a dependency, this should be a pretty straightforward manual replacement... GenNumber and AltForm should be quick find-replace`s.
2020-12-10 20:42:30 -08:00
Kurt
a13c2c852c Add some comments, clean a little 2020-12-07 20:14:12 -08:00
Kurt
98ef0299b6 Add xmldoc for save meta/state tracking
Move some logic around to the more appropriate spot
2020-12-07 19:49:04 -08:00
Kurt
6f7602f2ad Change signatures to use readonly if possible
Extract get/set team methods for battle video
2020-12-05 06:09:33 -08:00
Kurt
e72c80613e Extract metadata/state tracking from SaveFile obj 2020-12-05 05:36:23 -08:00
Kurt
e54e94a734 Don't waste alloc on clearing titlescreen slot
Revisiting #3098 #3086
2020-12-01 07:19:21 -08:00
CanoeHope
228042b111
Properly set empty slots to Trainer Card (#3098)
#3086 
Was only partially addressed -- it was only done for Title Screen and not League Card too.
2020-11-30 21:38:15 -08:00
Kurt
fefc38bacb Minor debug optimizations
Trees:
- Only retain the objects needed after calculation
- Reduce size of TreeCoordinates and remove allocation penalty (now a struct)

No more warnings for Release compilation :D
2020-11-28 14:55:09 -08:00
Kurt
9b178fefe2 Xmldoc, minor tweaks
Move form-info logic from FormConverter to AltFormInfo; now FormConverter is entirely form=>string[]
Add a bunch of xmldoc
Make pogo no-end-date cmp agaisnt UTCnow rather than local now.
2020-11-27 11:51:02 -08:00
Kurt
d6294d42f7 Update SAV1.cs 2020-11-24 10:51:31 -08:00
Kurt
4a8ad8b149 Expose raw evolution chain methods 2020-11-17 14:23:15 -08:00
Kurt
b1ae53ec63 Set empty slots if party not full
Closes #3086
2020-11-15 14:31:33 -08:00
Kurt
df5ebd1f54 Minor clean
Resolve some messages
2020-11-11 21:01:41 -08:00
CanoeHope
a569d91c5e
Add CurrentDex Block (#3081)
Block-Key was present since IoA (1.2.0) update.
2020-11-05 14:08:04 -08:00
Kurt
ae85097c2d Allow go shiny xor!0
Thanks @Lusamine for bruteforce testing to confirm
2020-11-04 20:55:47 -08:00
Kurt
23e765e550 Add opening for rental team dumps
Dunno why anyone would want these, lol
Closes #3074
2020-11-03 20:12:42 -08:00
Kurt
62073f5fd9 Update GP1.cs 2020-11-03 19:28:41 -08:00
Kurt
a2fb9c48eb Add fused calyrex block 2020-11-01 17:55:52 -08:00
Kurt
ef7d1e2af5 Add lair start seed
ty zak
2020-11-01 14:40:16 -08:00
Kurt
28767df0fb Split gamesync details to interface 2020-10-31 11:43:57 -07:00
Kurt
c9587c16c7 Adapt dropped/opened PKM to currently loaded savefile
Closes #3067
2020-10-30 22:44:08 -07:00
Matt
cd42abd915
Add Split-Decision Ruins save block key (#3065) 2020-10-30 13:17:25 -07:00
Matt
1b6a8d3ff6
Document Galarian Star Tournament save blocks (#3060) 2020-10-28 12:46:34 -07:00
CanoeHope
37053fb599
Add CrownDex complete to Trainer Card (#3058)
With this, all Dex markers can be displayed on your League Card as long as your save is from update 1.3.0. Expansion Pass DLC is not required.
2020-10-27 18:06:49 -07:00
Kurt
5b313210ed Handle SWSH gender strings same as LGPE
See 6a0a6aa82a for more context
2020-10-27 09:24:06 -07:00
CanoeHope
e22be71a26
Added one more Max Lair Block (#3055)
So I said that 0xF26B9151 was the first Max Lair Pokemon entry saved in my previous commit which turned out to be wrong and was in fact the Pokemon that is to be hinted by Peonia. Apologies for that mess up.
2020-10-26 21:24:04 -07:00
Lusamine
cce6402608
Fix incorrect offset for first Max Lair saved note (#3053) 2020-10-26 07:42:40 -07:00
CanoeHope
36a9ef05db
Added more Tundra Blocks (#3051)
Max Lair related.
2020-10-25 20:54:15 -07:00
CanoeHope
5722905e5d
Added Crown Tundra Block Data (#3047)
The Tundra League Card block literally only stores the Normal and Rare Peony League Cards, and nothing more.
2020-10-25 18:09:23 -07:00
Kurt
61fc0c7504 Update SaveBlockAccessor8SWSH.cs 2020-10-25 18:08:52 -07:00
Kurt
7e8a1a58d1 Set gender on pokdex registration
Closes #3045 , ty @xXAquaNightXx !
2020-10-24 15:42:17 -07:00
Kurt
919f3f2893 Update RaidSpawnList8.cs
Co-Authored-By: Leanny <1884062+Leanny@users.noreply.github.com>
2020-10-24 12:38:33 -07:00
Kurt
5fa4ddd4a2 Update internal data sources for Crown Tundra
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
Co-Authored-By: ReignOfComputer <2667537+ReignOfComputer@users.noreply.github.com>
2020-10-24 11:11:05 -07:00
Kurt
8a2a25fde1 Update data structures for Crown Tundra
Adds a wild area Raid den detail editor like mainland/armor raids.
2020-10-24 11:09:29 -07:00
Kurt
d35766649b Fix initial blank sav language load
(uint)-1 <= max now returns false, causing it to fall back to english.
2020-10-18 19:59:22 -07:00
Kurt
14a678b57d Revise save detect logic flow
Double-Clicking SAV tab no longer hides any error message; now shows it like the auto-detect would.

Move high-level detection method to Core
2020-10-18 19:49:46 -07:00
Kurt
cce4707604
Enable nullable for winforms csproj (#3037)
Handle all warnings
obviously the usage of null! could potentially be avoided if the object init wasn't such garbage, but here we are with years of old junk and lack of abstraction in the GUI project
2020-10-18 11:02:39 -07:00
Kurt
7a01b1249c Minor clean
Handle more messages, add more xmldoc
2020-10-18 09:43:41 -07:00
Kurt
38b03a42b6 Fix hide flag get/set
Closes #3030
2020-10-16 16:12:42 -07:00
Kurt
7b6f30b779 Handle overflow case
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2020-10-12 14:37:08 -07:00
Kurt
a71940bf75 Update CaptureRecords.cs
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2020-10-12 14:34:44 -07:00
Kurt
0a6534a208 Extend individual transfer count to 999mil
Closes #3028
Thanks @CarlosofKalos !

Setting 9999 for both on Rattata; capturing the 10,000th didn't increment, but transferring the 10,000th did.

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2020-10-12 14:16:55 -07:00
Kurt
3b4fd49af9 Catch any exception, show message in result 2020-10-12 10:42:26 -07:00
Kurt
d66c406751 Update SAV1StadiumJ.cs 2020-10-10 15:28:34 -07:00
Kurt
f821d698fe Update SAV1StadiumJ.cs 2020-10-10 15:11:02 -07:00
Kurt
2e82636f1e Fix slot writes 2020-10-10 14:59:51 -07:00
Kurt
7132750c9b Placeholder crown tundra logic
To be updated:
- Tables8: magic numbers for maximums
- IGigantamax: any new gigantamax forms?
- FormConverter: any new forms? (calyrex)
2020-10-10 13:14:32 -07:00
Kurt
b97bee4412 Use correct filesize reference 2020-10-10 12:50:57 -07:00
Kurt
79f60d2236
Update SAV1Stadium.cs 2020-10-09 22:11:32 -07:00
Kurt
bb65f2d2c2 Show trainer name&id for registered Stadium teams in dropdown 2020-10-09 20:31:13 -07:00
Kurt
9d21e5acdd Add GUI for Capture Records
Accessible from Pokedex window
ur welcome matt
2020-10-08 18:06:29 -07:00
Kurt
804b85ea33 Add CaptureRecord block interaction
No GUI

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2020-10-08 15:28:25 -07:00
Kurt
aa43904869 Add stad2 boxnames, registered flag handling 2020-10-05 08:29:17 -07:00
Kurt
d4452ce3af SK2 coerce to load to a hint language
This format won't be supported cleanly, so let's just try to allow language detection to work as best as it can without storing metadata in the SK2 bytes.
2020-10-04 14:42:48 -07:00
Kurt
09c6359e3a Add flexibility for SK2 imports
Check language character table for English vs Japanese when loading for a destination
2020-10-04 10:25:34 -07:00
Kurt
3fd6817a42 Refactoring: Finalize Stadium savefile logic
Extract common abstract class for shared logic
Clean up property/field/method ordering to be consistent and logical (roughly: attributes, constructors, state management, retrievable values, static methods)
Apply default language OT name
2020-10-04 09:23:16 -07:00
Kurt
d13b893351 Use PKHeX as blanksav language
Closes #3009

Make QRPK7 implement IEncounterable and remove hardcoded PKHeX strings
Let force hatching for WC3 eggs try to hatch from the savefile's language, then revert to english if failed to set an OT.
2020-10-04 08:59:33 -07:00
Kurt
8a7ed99689 Fix s1 team export
oops
Add a tostring override to help visually debug
2020-10-04 08:06:44 -07:00
Kurt
fbc4c5038a Set box metadata on write
Fix group export for 1U to exclude the right set of teams
0J now shows the correct amount of boxes & teams (halved)
2020-10-04 07:51:55 -07:00
Kurt
5853888020 Minor Stadium behavior enhancements
Use underscores for enum for ToString replacing with spaces
Don't flag empty-OT as SK2; Stadium0/1 use the "TRAINER" as rental, but leave it blank for SK2.
Don't set any terminators for an OT string if the string is empty; just wipe the buffer.
2020-10-03 21:56:57 -07:00
Kurt
262561d5d1 Fix stad1 missing team types
off by 1 (8=>9, and EN has unused interstitial teams).
Fix last-viewed-slot indication color tracking
2020-10-03 19:48:56 -07:00
Kurt
7efaa5ab71 Minor clean
collapse some expressions
handle some compiler messages
2020-10-03 18:59:36 -07:00
Kurt
816f24e3db Add Misc pkm array viewer for Stadium saves
Readonly slots

Things could be expanded on to use interfaces and wrappers for a "SlotReference" and properties for readonly.

But that's kinda unnecessary
2020-10-03 18:22:29 -07:00
Kurt
bca8a80b39 Minor clean 2020-10-03 17:09:22 -07:00
Kurt
b242aed429 Add ability to load blank japanese/korean save files
Detects the language of the currently loaded save file, and passes that info to the blank sav creator

Use a trainer name of "1337" instead of PKHeX for any Japanese save file, because Gen1/2(/3?) character tables don't have regular ascii chars.
2020-10-03 11:22:06 -07:00
Kurt
97f5f8d362 Add blank sav fetch for stad0/1/2 2020-10-03 10:53:52 -07:00
Kurt
8cb6e15f3e Add team fetch api for stad1/2 2020-10-03 10:53:35 -07:00
Kurt
52a67f2425 Add Stadium2 Support
Introducing a new PKM format: SK2
Split ICaughtData2 off of PK2 so it can be shared with SK2 when type-checks occur
Add conversion for PK2<->SK2
Split the split-buffer handling for GBPKM to GBPKML (what a name), so that I can reuse shared accessor logic for SK2.
2020-10-02 18:08:40 -07:00
Kurt
2c8e0bc8f7 Add automatic byteswap 2020-09-30 22:46:07 -07:00
Kurt
ee207a3fda Revise Stadium savefile logic to read from boxes
Add a helper to spit out teams
Alias hard-coded numbers to something to easy names.
Make them exportable, update checksums for box data
2020-09-30 18:00:25 -07:00
Kurt
af357587f9 Add Pocket Monsters Stadium support
https://projectpokemon.org/home/forums/topic/38108-gen-1-pokemon-stadium-save-file-structure/

untested, need to find a save file somewhere??
2020-09-30 12:45:41 -07:00
Kurt
769d5d8689 Allow SaveFile constructor to specify exportable state
Useful for partially-supported savefiles that can't be exported yet (Stadium)
2020-09-30 12:44:50 -07:00
Kurt
22f37910f0 Remove unnecessary single-member interfaces 2020-09-27 18:19:28 -07:00
Kurt
fb4734472b Add notation for language-specific save types 2020-09-26 13:30:17 -07:00
Kurt
a34434f7cb Make pkm.Data a readonly field rather than property 2020-09-26 12:09:02 -07:00
Kurt
82afefa335 Make GP1 expose IEncounterable for metadata
Make the main loader handle IEncounterable objects
2020-09-26 11:33:21 -07:00
Kurt
6243135f28 Minor clean
Move Home8 location to Locations.cs for documentation
Move FestaFacility to correct folder
Remove unnecessary public modifier on interface method
Pass the program's Version to any loaded plugins, if they wanted to check compatibility...?
2020-09-25 23:55:31 -07:00
Kurt
efc17a1271 Add interface for revised savefile types (patches)
SWSH is the first common savefile type that has different revisions after official patches. We want to indicate in the Program Title which revision we're currently editing, because people still are not editing latest-format saves and complaining y no urshifu.

Use short descriptions to indicate revision (Base, IoA, CT), rather than magic numbers (v0/v1) or 1.X or 1.X.Y+, because GameFreak can't follow semver rules.

go away ranch platinum update, i might handle you another time
2020-09-25 23:41:20 -07:00
Kurt
2b7e06e217 Refactoring
Extract some logic, suppress some compiler messages
2020-09-18 22:11:13 -07:00
Egzon
4b1a9a89da
Add support for reading and editing Underground Items (#2987)
Adds a sub-editor with localized support for editing Underground Items.
2020-09-13 14:55:50 -07:00
Kurt
507c913451
Invert early return bool for sav1stadium recognition
oops
2020-09-10 11:24:16 -07:00
Kurt
741fbd5296 Add stadium sav readonly support of registered teams
no checksum logic performed, just a WIP preview
2020-09-09 22:44:46 -07:00
Kurt
01fb233e48 Minor tweaks
Extract some interfaces
Suppress some warning messages with commented reasons if appropriate
2020-09-09 12:47:24 -07:00
Kurt
5d3bc289b6 seal hunting
Mark things as sealed as they shouldn't be inherited from or overriden in a derived class.
2020-09-07 13:51:13 -07:00
Kurt
9191f023a3 Minor clean
Nullability annotations and some logic simplification
2020-09-06 11:24:54 -07:00
Kurt
1114b97c4b Fix bool value naming for gen8 block editor
Was previously showing RaidArmor for pre-Armor saves, as the reference of a zero-length array was the same as the bools. Just sanity check since all block chunks have length.
2020-09-06 11:21:23 -07:00
Kurt
cf9e5ec37f Minor refactoring
Change Ability array to IReadOnlyList, add method to check ability index in personal data
Suppress some message warnings
Change EvolutionChain short-circuit for VC to jump from gen6 directly down to gen2. There aren't any notradeback 1 situations, so a notradeback1 will always start with g=1, so no need for the other if-continue.

Simplify pk5 conversion
2020-09-06 10:53:13 -07:00
Kurt
c2ec4d55e4 Minor clean
Add some xmldoc, remove some empty lines, move some small logic pieces to a better spot
2020-09-03 14:28:51 -07:00
Kurt
b03a5f2818 Fix pika beach score reading
fix reads as little endian instead of big endian
fix truncation if editor value from byte => ushort
Closes #2976
2020-09-01 16:05:52 -07:00
Kurt
b5677758be Change default TID/SID for gen7+ 2020-08-30 17:54:58 -07:00
Kurt
6e409f288e Use version on clone so that we don't have to detect again
Matches gen1/gen3 clone
2020-08-29 23:39:14 -07:00
Kurt
890f3375c9 Misc clean 2020-08-18 15:39:45 -07:00
Kurt
f35d8b2d4b Remove unnecessary logic
return/frustration not present in these games; no need to check this
2020-08-18 14:45:36 -07:00
Kurt
e012b42c9c Update SAV7b.cs 2020-08-18 10:35:59 -07:00
Kurt
c7eda4f901 Update SAV7b.cs 2020-08-18 09:15:29 -07:00
CanoeHope
1e6858c349
Add misc Restricted Sparring related Block Data (#2971)
The game also stores the Gender ID, Form ID, Encryption Constant, and Alcremie Sweet ID per block for each PKM's slot.

As for Sweet ID it is stored for all Types. However, since you obviously can't use Alcremie in non-Fairy Sparring they go unused. (They are the Int32 blocks you'll notice with a -1 value.)
2020-08-15 12:10:52 -07:00
Kurt
541c9761df Minor clean
Make flag indexes immutable
Rename some properties for clarity
2020-08-14 20:23:54 -07:00
Kurt
1df2bd444a Remove unused using 2020-08-09 20:02:06 -07:00