Commit graph

1137 commits

Author SHA1 Message Date
Kurt
da9d09ea76 Misc tweaks
No functional change
2022-01-11 22:53:20 -08:00
Kurt
1992f36c5b Fix gen3 item quantity reads
Oops :)

Closes #3369
ty @MichiS97 !
2022-01-09 20:34:55 -08:00
Kurt
9cde291595
Enumerate ability permissions in encounter templates, misc updates (#3368) 2022-01-08 22:34:04 -08:00
Kurt
7743b30b2f Fix species being replaced with incorrect mapping
XD shadow monitor stores the Gen3-mainline-SpeciesID instead of nationaldex ID.
Remap the values on the fly.

Pass the data via span to save a 8KB allocation for sav ctor

Closes #3365
2022-01-07 17:48:12 -08:00
Kurt
47071b41f3
Refactoring: Span-based value writes and method signatures (#3361)
Existing `get`/`set` logic is flawed in that it doesn't work on Big Endian operating systems, and it allocates heap objects when it doesn't need to.

`System.Buffers.Binary.BinaryPrimitives` in the `System.Memory` NuGet package provides both Little Endian and Big Endian methods to read and write data; all the `get`/`set` operations have been reworked to use this new API. This removes the need for PKHeX's manual `BigEndian` class, as all functions are already covered by the BinaryPrimitives API.

The `StringConverter` has now been rewritten to accept a Span to read from & write to, no longer requiring a temporary StringBuilder.

Other Fixes included:
- The Super Training UI for Gen6 has been reworked according to the latest block structure additions.
- Cloning a Stadium2 Save File now works correctly (opening from the Folder browser list).
- Checksum & Sanity properties removed from parent PKM class, and is now implemented via interface.
2022-01-02 21:35:59 -08:00
Kurt
ac1136615e Fix rival string read/write to General 2021-12-31 13:52:50 -08:00
Kurt
cc8ac7a4f1 Remove unnecessary warning suppression
fixed dat .editorconfig in vs22
Catching general exceptions is okay because this program handles user modified data that can potentially be corrupt.
2021-12-27 12:09:15 -08:00
Kurt
11039f1119 Extract some event unlocking logic for core 2021-12-26 18:21:34 -08:00
Kurt
13e0f35e00 Add munchlax slot checking for DPPt/BDSP honey trees
Closes #3352
2021-12-25 13:48:28 -08:00
Kurt
4e7e23cb88 Add battle tower record editing 2021-12-20 23:48:05 -08:00
Kurt
36a97a6eda Add misc edit to defeat all trainers & rebattle all 2021-12-20 19:26:07 -08:00
Kurt
98713f4d7b Move inventory item clearing to class
Fixes ClearItem offset being wrong
2021-12-13 18:31:00 -08:00
Kurt
cacd6e9965 More records/sealing 2021-12-05 23:54:59 -08:00
Kurt
7e4877e7de Add 3 more useless blocks
Spinda registers correctly now, lol
2021-12-04 23:52:33 -08:00
Kurt
40ed5898af Merge extended property patterns 2021-12-04 18:37:47 -08:00
Kurt
88ddc5822e c#10: readonly record structs
Reduces some boilerplate constructors/equality compares
2021-12-04 18:32:35 -08:00
Kurt
f55c5bea66 Minor clean
no functional change
2021-12-04 17:56:56 -08:00
Kurt
9a1b2719ec Add simple legal item filtering for giveall
Closes #3318

Gen8: if held item, only give if can be legally held; if dmax crystal, only give if available.
Gen8b: if held item, only give if can be legally held
Others: unimplemented; pull requests accepted.
2021-12-04 12:24:32 -08:00
Kurt
e50bb8f288 Abstract-ify pouch items; acknowledge sort order
Closes #3320
Should better handle bdsp inventory format; shows sort order with the now-zero slots
2021-12-02 23:31:48 -08:00
Kurt
b74283560d Add more useless bdsp saveblock objects 2021-11-30 22:05:20 -08:00
Kurt
8c9fb3a872 Add FieldObjectSave browser 2021-11-30 17:31:46 -08:00
Kurt
1c82b707f3 Add xmldoc, add egglevel get central location 2021-11-30 17:09:46 -08:00
Kurt
1bb3255ab1 Add randomgroup block
Still does the same silly ARNG as gen4:
        seed = 0x6C078965 * seed + 1;
to advance on each day

Do note that it sets event flag 1711 to true, and sets the absolute value of the "Random" to Work[436]. FLAG_DAILY_RANDOM, WK_DAILY_RANDOM, assumedly for easy use with scripts.
2021-11-28 23:31:01 -08:00
Kurt
4276ee1b9d No exp gain for nursery
I'm not up to date on game mechanics, thanks matt.
2021-11-28 16:30:56 -08:00
Kurt
0189e84263 Clear all flags on seen none 2021-11-28 11:55:31 -08:00
Kurt
cc34d40120 Update 21.11.27 2021-11-27 10:50:42 -08:00
Kurt
be3af9fba9 Add bdsp poffin editor
The RAM is pretty dirty for unallocated poffins; slots that have never been filled will have junk with whatever the unallocated pointer was looking at.

An empty poffin slot is just marked as FF, ignores the stats for that slot. Not sure on the naming, but Matt had a single Level 60 poffin -> must be Mild? Thus, all the names are -1 from the textfile array...
2021-11-27 02:06:35 -08:00
Kurt
fd4dd6e2fb Indicate teamlocks in boxes 2021-11-26 19:54:07 -08:00
sora10pls
8bce248d95 Crop BDSP Box Wallpapers, re-tile Grass, and fix off-by-one 2021-11-26 22:11:54 -05:00
Kurt
2560d0eb28 Change safari seed to uint
matches community handling of seeds
2021-11-26 11:31:00 -08:00
Kurt
5d4a8e5328 Add Mystery Gift records for BDSP 2021-11-26 11:08:51 -08:00
Kurt
6fb1634a2f Show internal affixed seal enum name for tostring 2021-11-26 09:35:25 -08:00
Kurt
b50791530c Add ENC_SV_DATA, PLAYER_SAVE_DATA, capsules, UgCountRecord 2021-11-26 01:21:38 -08:00
Kurt
b7c9993bac Add Misc editor form for bdsp
Three clickables so people can stop getting confused about event-bound encounters like Darkrai/Shaymin/Spiritomb
2021-11-25 22:48:09 -08:00
Kurt
02dc4dc8a7 Automatically update v1.1 expanded records on TID/SID change
Closes #3305
I think it was actually crashing due to the bad GameClear date record, not this extra record data, but we'll still update the head record

Fix note of ENC_SV_DATA start offset now that we know the real size of Record8b
Add actual maximums for all record entries
2021-11-25 20:05:39 -08:00
Kurt
1a9f9fcfe5 Add more savedata notes 2021-11-25 18:09:05 -08:00
Kurt
95bdde69a7 Add more savedata abstractions
Array sizes for the top level structures are now noted, should make it easier to determine the shape of them & offsets.
2021-11-25 16:38:58 -08:00
Kurt
0fe80edb37 Add bdsp v1.1 to valid save size hashset
Now shows the save file backups from v1.1 in the Folder Browser
2021-11-25 12:57:43 -08:00
Kurt
d79864b049 Add seal list editor
Inject all the stickers you want.
2021-11-24 17:51:12 -08:00
Kurt
a7ab45746c Set both gender flags for genderless species
Nice deviation from mainline logic :)
2021-11-24 17:02:29 -08:00
Kurt
dc0f56e790 Add underground save structure documentation 2021-11-24 00:45:11 -08:00
Kurt
086c6492f2 Add trainer rebattle status block logic 2021-11-22 20:54:12 -08:00
Kurt
97960d4439 Add placeholder berrytree+poffin blocks 2021-11-22 20:20:57 -08:00
Kurt
1ab895a6c4 Restrict constructor to BDSP save type 2021-11-22 19:31:19 -08:00
Kurt
d81f832a61 Fix Record8b capping first record (uncapped) 2021-11-22 19:30:51 -08:00
Kurt
4b40414b8b Add BattleTower work reader, move BP get/set into it 2021-11-22 19:30:28 -08:00
Synthlight
b32ad02c10
Add/Enable BDSP Battle Tower Points (BP). (#3309) 2021-11-22 18:56:31 -08:00
Kurt
a9bc86bb13 Clear deleted item slots
Closes #3304 ty @MewtwoFanz
2021-11-21 17:49:34 -08:00
Kurt
9b8f1c8305 Allow multiple diggerdrill 2021-11-21 12:52:16 -08:00
Kurt
32edb660ce BDSP: Add underground item-inventory editor 2021-11-21 11:33:04 -08:00
Kurt
ee567a7d15 Add systemtime, (underground item, poketch, both no GUI)
systemtime to be integrated to trainer info editor later
2021-11-20 23:54:27 -08:00
Kurt
9d5cff5221 Add daycare reader, show playtime in backup filename 2021-11-20 19:10:42 -08:00
Kurt
6980026ca2 Add BDSP trainer stat records
Continue crawling down the serialized savedata structure :)
2021-11-20 15:40:18 -08:00
Kurt
921b151aef Add zoneID property 2021-11-20 09:37:40 -08:00
Kurt
723514e89c
Update 21.11.19 - Brilliant Diamond & Shining Pearl (#3289)
Big thanks to @SciresM @sora10pls @Lusamine @architdate @ReignOfComputer for testing and contributing code / test cases. Can't add co-authors from the PR menu :(

Builds will fail because azure pipelines not yet updated with net6.
2021-11-19 18:23:49 -08:00
Kurt
692898fe46 Set metadata for sav on certain paths
Closes #3282
2021-11-07 10:17:03 -08:00
Kurt
533526465e Omit exclusions if empty 2021-10-25 20:03:16 -07:00
Lusamine
bf94c1de1f Document both SWSH bike boost save blocks 2021-10-24 20:39:10 -05:00
CanoeHope
aeb1043d4e
Added 2 SWSH blocks (#3276) 2021-10-23 22:15:48 -07:00
sora10pls
aa214524fd Label SWSH event flag save blocks
Static encounters (stationary and Max Lair), gift encounters, and some general purpose flags. Can filter most of these out in PKHeX settings by ignoring `KCaptured` and `KReceived`.
2021-10-23 16:41:07 -04:00
FeralFalcon
3afd51e587
Adding a plethora of event flag data (#3273)
* Add metadata flagging for values

Allows users to set a minimum importance for the list displayed.

Could probably make this checkboxes within the flags UI.

* Add setting to filter out gen8 block names

Allows users to filter out unwanted low-value property names.

Co-authored-by: Kurt <kaphotics@gmail.com>
2021-10-23 11:25:14 -07:00
Kurt
009e37662f
Startup Enhancements, Gen1/2 Save Indication, Export SAV cleaned up (#3275)
* Providing pkm/sav files via command line (dragging files onto exe / associated file launched) will more intelligently source a partner sav/pkm object if not provided.
* Gen1/2 mainline save files now indicate if they are VC era or GB era (legality implications) in the program title bar.
* Fixes loading VC era save backups not being recognized as VC era (`.bak` extension hides `.dat`)
* Export BAK moved to the SAV tab, which allows Export main to be deleted and Export SAV to be used as the single-click for exporting saves. `CTRL-E` is still the hotkey.
2021-10-21 22:13:21 -07:00
Kurt
4b263bf9bb Fix pattern matching comparison
Wish I had an analyzer to catch this (missing parens) similar to boolean logic

#3271 - resolves the traded egg recognition issue
2021-10-13 20:05:19 -07:00
Kurt
6304ef2006 Fix gets for u16 char widths
oops

Only gen1/2 have trash exposed for OT, so I guess I can just leave these.
2021-10-10 17:23:14 -07:00
Kurt
3bf8d2fe07 Add rival string editing for all remaining games
Block Editor for direct edits, no GUI

Co-Authored-By: FeralFalcon <33670476+FeralFalcon@users.noreply.github.com>
2021-10-10 16:11:46 -07:00
Kurt
40031fd94d Fix give all goods for ORAS secret base
was overwriting pokepuffs, oops
2021-10-08 12:43:24 -07:00
Kurt
08b7d7ebfe
Update Misc5.cs
#3259
2021-09-18 17:52:58 -07:00
Kurt
0c83da7c1b Add Poké Transfer minigame score editing (Gen 5)
Closes #3259

Co-Authored-By: FeralFalcon <33670476+FeralFalcon@users.noreply.github.com>
2021-09-18 16:31:22 -07:00
Kurt
4fb0f96dc4 Add daycare slot view for lgpe
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-09-16 14:21:44 -07:00
Kurt
02af45cb30 Add LGPE to block editor
thanks for nobody noticing this yet :)
2021-09-16 14:06:52 -07:00
Kurt
26422bc17c Add Crystal blue card points get/set
Co-Authored-By: FeralFalcon <33670476+FeralFalcon@users.noreply.github.com>

#3258
2021-09-16 13:16:12 -07:00
Kurt
50084eaaee Fix sav3 [uninit, oneSave] primary secondary detection
Closes #3257
2021-09-14 18:38:46 -07:00
Kurt
d8c5c027ac Emerald: Add walda wallpaper
use block editor
f7a699c686/include/global.h (L1045)
2021-09-06 20:46:41 -07:00
Kurt
819b884b19 Update EventWork7b.cs 2021-09-05 13:07:33 -07:00
Kurt
a7ed5b400f Add Trainer Class / Title property for LGPE 2021-09-04 22:04:49 -07:00
Kurt
f9d9bcfb80 XD: Purification is stored differently for jp games
A more condensed data structure, 72->60 bytes for each entry instead.
Closes #3255

Related? #2956
2021-09-03 18:16:09 -07:00
Kurt
6e9f230dee Add cxd/rsbox event data for mainline sav3
Closes #3248
2021-08-22 18:52:29 -07:00
Kurt
8f0fb902d1 ArgumentException -> ArgumentOutOfRangeException 2021-08-21 16:51:50 -07:00
Kurt
5da9b4a70a Force alignment
FieldOffset isn't implied, fun.
2021-08-20 22:07:09 -07:00
Kurt
05364212ba Update Encount5.cs 2021-08-20 20:53:23 -07:00
Kurt
9ef93552c9 Add ability to set swarms for gen3 2021-08-20 20:50:16 -07:00
Kurt
48024f1245 Add Swarm data get/set for gen3-5
#3245
2021-08-20 19:52:31 -07:00
Kurt
bedc52943e Trailing commas
No functional change
2021-08-20 13:49:20 -07:00
Kurt
c6342a163f Minor clean
variable swaps, simplifications
2021-08-20 13:42:25 -07:00
Kurt
c0d748a975 Add Dream World upload slot indicator
Tested & works on bw & b2w2
Thanks Brokemia for the request!
2021-08-16 11:54:03 -07:00
Kurt
9793e9f1a0 Minor clean
Slap on interface for EntreeSlot
De-magic some 💯 numbers to indicate what they're doing
Improve perf of move-match-relearn check
Add an "else" as valid is never both values (history verifier)
2021-08-13 15:36:30 -07:00
Kurt
5ec2b12ae5 Handle some warnings for release build
Unused usings; just make PIDType stuff visible.
2021-08-06 09:41:39 -07:00
Kurt
0f3e5095c5 Replace more linq usage 2021-08-05 22:39:38 -07:00
Kurt
5c472a400d Expand shorthand parameters
int i => int index, or whatever the value is representing.
2021-08-05 20:33:25 -07:00
Kurt
a1f5c76790 Fix pgl jpeg save 2021-08-05 19:38:47 -07:00
Kurt
59d480c834 Minor tweaks
Discard empty pkm files (species 0) when loading boxes or templates
Add more xmldoc
Simplify some method parameter names for readability
2021-08-05 17:05:39 -07:00
Kurt
cc0397f087 Misc tweaks
Improved readability
2021-08-05 15:18:43 -07:00
sora10pls
bfcf081e5b Fix XY multiplayer sprite display
Reorder enums; Serena before Calem
2021-08-05 16:22:06 -04:00
Kurt
1efebe51d3 Simplify Country/Region/ConsoleRegion to byte from int
Only exists in gen6/7 games.
2021-08-02 19:43:57 -07:00
sora10pls
3fdf1396aa Update TrainerFashion6 structure
Rename EyeShadow => Eyeliner, fixes labeling for fields and getters for lip color and freckles data
2021-07-31 16:00:10 -04:00
Kurt
0c6254835d Add battle agency slots to main window misc viewables 2021-07-26 23:57:05 -07:00
Kurt
4ed0e30ace Minor tweaks
Muh infinitesimally small perf gainz found while waiting for next dota match
2021-07-26 23:33:56 -07:00
Kurt
c9640f8561 Comments: forme->form 2021-07-26 14:14:39 -07:00
Kurt
9c8bee19ca Gen5: Add give all musical props, b/w entree level changing
Abstract some things into their parent save block structure.
2021-07-25 23:44:03 -07:00
Kurt
a6176dc3d0 Add fused & gts slot indications for gen5 2021-07-24 17:23:58 -07:00