Commit graph

104 commits

Author SHA1 Message Date
Kurt
a681783f1a Extract interface for SaveBlock, allow strict
External users shouldn't be using SaveBlock
2022-04-15 11:45:04 -07:00
Kurt
ac7947fd66 Misc tweaks - static namespace using 2022-04-15 09:54:12 -07:00
Kurt
54f1e341f9 Spanify spawner object get 2022-03-20 01:46:24 -07:00
Kurt
bb8dee1e6c Return block value
oops, refactoring forgot to add return
Closes #3458
2022-03-08 08:36:17 -08:00
Kurt
47f7efab2c Update SCBlockAccessor.cs 2022-03-06 00:46:10 -08:00
Kurt
3c567c0c97 Rearrange some scblock logic
No functional change. just increasing robustness
Decouples exportable state from get/set values
2022-03-05 17:46:03 -08:00
Kurt
1370d9ab0f Merge SAV8 into SAV8SWSH
Was originally expected that gen8 was going to be a pair+revision generation, but with BDSP and PLA being totally different games, there's no need to have inheritance complicating a single SWSH class.
2022-03-05 17:34:09 -08:00
Kurt
90b075947d Move some get/set operations into Accessor class
Adds exception-free get/set for revised saves.
2022-03-05 17:33:08 -08:00
Kurt
7cfdb8a466 Move hashing to SCBlockAccessor, fix #3455
Fixes #3455 by adding bool for insular sea, and adjusting overall progress values as listed.
Closes #3456 (supersedes)

Updates SCBlockAccessor to eliminate bounds check (integer overflow, which isn't possible with our array size), adds some overloads, and xmldoc.

Co-Authored-By: Jonathan Herbert <3344332+foohyfooh@users.noreply.github.com>
2022-03-02 18:05:13 -08:00
CanoeHope
e507d4ab91
Update SaveBlockAccessor8LA.cs (#3453) 2022-03-01 21:34:37 -08:00
CanoeHope
e792c038b8
Label a new L:A update block (#3452) 2022-02-28 22:47:30 -08:00
Kurt
b3cd4dea25 Initial support for PLA-v1.1 2022-02-27 07:56:47 -08:00
Kurt
5a71ecc8bb Minor clean 2022-02-24 23:17:16 -08:00
Kurt
a276975847 Don't throw exception in safe block search
Just duplicate the method to return fake default instead of trycatch overhead.
2022-02-24 21:02:08 -08:00
CanoeHope
61821c7986
Add L:A blocks and BDSP event constants (#3444)
* Update SaveBlockAccessor8LA.cs

* Update work_bdsp_en.txt
2022-02-20 22:46:20 -08:00
Kurt
d5be6254f3
Add logic for PLA wild RNG correlation (#3443)
Adds structures to read/write saved spawner data such as seeds, counts.
Adds generator and validator to emulate the FixInitSpec builder used by the game logic

Similar to SW/SH raids, validating these in-process is not feasible due to the number crunching required.

This does not handle the encounter slot call or the follow-up level range call. Just the inner FixInitSpec ctor & fill.

level is calc'd:
randFloat(sum) -> slot float
rand.Next() -> gen_seed (for all the details)
rand.NextInt(delta) +min -> level

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-02-20 17:59:48 -08:00
CanoeHope
08f8b6e3d4
Add Legends: Arceus blocks (#3403)
* Update SaveBlockAccessor8LA.cs
2022-02-08 18:50:52 -08:00
sora10pls
9023b302c8 Label individual clothing item unlock save blocks 2022-02-05 13:38:39 -05:00
Kurt
0b32cbf132 Update PKHeX.Core abstractions with latest logic
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>
2022-02-04 17:35:15 -08:00
Kurt
691f941bb6 Add savedata models
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>
2022-02-04 17:31:20 -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
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
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
Kurt
02af45cb30 Add LGPE to block editor
thanks for nobody noticing this yet :)
2021-09-16 14:06:52 -07:00
Kurt
48024f1245 Add Swarm data get/set for gen3-5
#3245
2021-08-20 19:52:31 -07:00
Kurt
0c6254835d Add battle agency slots to main window misc viewables 2021-07-26 23:57:05 -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
Kurt
0686922d5c Rewrite gen6ao secret base handling, i/o, GUI
Closes #3177

Format sizes are now accurate to game structure sizes. Added a few more editable fields, rid of label/textbox/etc for general base editing -- use a PropertyGrid instead.

Feels nice having a bank of saves to reference + idb to discover the struct layout.
2021-06-13 00:38:47 -07:00
Kurt
c98717bdc0 Fix namespaces 2021-06-06 23:34:15 -07:00
Kurt
066aedfc21 Separate scblock ctor's
No longer need to set byte[] twice
Add value-setter checks for bad mutations (size change, bool1<->bool2 only)
2021-06-03 12:35:39 -07:00
Kurt
b9d9766674 Fix typos, update block list notes 2021-05-14 12:16:08 -07:00
Lusamine
e5867ce512 Add NormalEncountRigel2 block and Pokedex Rec block 2021-04-23 17:41:54 -05:00
Kurt
b0700ba281 Extract Gen7 HoF class, extend event flag count
4k flags exactly, and probably 4950 for USUM (alignment +1 byte for an even 4960)

The old flag + count (4 bytes total) are just +32 event flags.
2021-04-07 00:20:02 -07:00
Kurt
2826049e32 Add boxes unlocked & secret box toggle
ty @sora10pls
use box layout editor to change values (0-32 and toggle the flag)
2021-03-02 21:28:53 -08:00
CanoeHope
121ae9b611
Rename SWSH blocks and update Chinese HGSS Event Constant (#3131)
* Update TrainerCard8.cs

* Update SaveBlockAccessor8SWSH.cs

* Update const_hgss_zh.txt
2021-01-19 12:46:54 -08:00
Kurt
6e741a0cf0 Minor tweaks
Add xmldoc
Remove linq from memecrypto code (speed lmao)
Hide some methods that shouldn't be called directly
Name variables better for accessor const's
2021-01-06 23:30:30 -08:00
Kurt
98be0f6739 Target type'd new 2020-12-21 17:17:56 -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
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
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
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