Commit graph

1203 commits

Author SHA1 Message Date
Kurt
1f64a41670 Fix gci recognition 2022-06-27 22:28:46 -07:00
Kurt
12954a6369 Minor perf improvement (spans)
Remove PKM.EVs, do operations without heap allocation
Reduce usage of PKM.IVs/PKM.Moves, reuse spans if possible.
2022-06-25 23:08:28 -07:00
Kurt
d8c8a13885 Add bizhawk footer handler
Optimize some of the other handlers.
2022-06-25 11:14:00 -07:00
Kurt
210bd90fc1 Add entree MissionsComplete for BW
Closes #3532

BW/B2W2 could be the same, meaning that the pass power offsets in the B2W2 class can be merged back in to the base class.
2022-06-19 08:39:43 -07:00
Kurt
d2115eb8b9 Add remaining gen4 roamer slots
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2022-06-18 19:46:53 -07:00
ShadyRelapse-PP
bd25312181
Added Second Roaming Pokemon for Platinum and Third Roaming Pokemon for HGSS (#3531)
* Update SAV4HGSS.cs

* Update SAV4HGSS.cs

* Update SAV4Pt.cs

* Update SAV4HGSS.cs

* Update SAV4HGSS.cs
2022-06-18 19:14:29 -07:00
Kurt
d1c2f6ef6e Add gen5 roamer get 2022-06-18 19:12:41 -07:00
Kurt
0eca5cbe05 Add gen4 roamer to block editor
Closes #3528
2022-06-18 14:11:22 -07:00
Kurt
fc754b346b
File scoped namespaces (#3529)
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces)

Updates all the files, one less level of indentation.

Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
2022-06-18 11:04:24 -07:00
Kurt
8319bfe003 Fix Entree Forest saving
Closes #3524
2022-06-14 22:30:57 -07:00
Kurt
0093927e15 Use ReadOnlySpan instead of Span if appropriate 2022-06-13 00:04:20 -07:00
Kurt
436588eb10 Replace é->e for code symbols
Closes #3519
Usages weren't consistent; since `é` isn't accessible on usual english keyboards, just use regular `e` instead of alt-223 entry.

Not sure why VS preferred to save the text files without an encoding prefix; oh well.
2022-06-11 15:32:12 -07:00
Kurt
184440f266 Add more GBMobileCableColor values
see 7225b2b87b
2fe0cbbb19/gfx/mobile/mobile_adapters.pal
2022-06-11 10:40:10 -07:00
Kurt
15a84d9d7e Minor clean 2022-06-11 09:51:43 -07:00
Kurt
8c528855f4 Differentiate dragged PK8/PB8 better w/preferences
Better determine preference with file extension string
2022-06-07 03:33:45 -07:00
Kurt
54cb4dc8c8 Minor comment fixes 2022-06-07 03:21:04 -07:00
Kurt
ab723af640 Expose Context for SaveFile/ITrainerInfo 2022-06-03 19:08:46 -07:00
Kurt
978be73b9a Trycatch path->sav factory method
Closes #3512 -- had a bad gen3 save backup causing trouble.
2022-06-02 19:21:47 -07:00
Kurt
5bcccc6d92
HOME 2.0.0: Handle conversion behavior & restrictions (#3506)
* Revises legality checks to account for traveling between the three game islands (PLA/BDSP/SWSH)
* Adds conversion mechanisms between the three formats, as well as flexible conversion options to backfill missing data (thanks GameFreak/ILCA for opting for lossy conversion instead of updating the games).
* Adds API abstractions for HOME data storage format (EKH/PKH format 1, aka EH1/PH1).
* Revises some APIs for better usage:
  - `PKM` now exposes a `Context` to indicate the isolation context for legality purposes.
  - Some method signatures have changed to accept `Context` or `GameVersion` instead of a vague `int` for Generation.
  - Evolution History is now tracked in the Legality parse for specific contexts, rather than only per generation.
2022-05-30 21:43:52 -07:00
Lusamine
0b50d6d4ac Label SWSH Poke Job Storage Block 2022-05-18 00:03:59 -05:00
Kurt
50ce6a92db Revise stadium detection if no teams set
Closes #3494
Thanks @keiyakins !
2022-05-15 14:05:10 -07:00
Kurt
a5b46d80f5 Minor tweaks
ShowdownSet: Lessen allocation
MoveTutor: Remove boxing by calling the generic method instead of object method
Xoro8b: Add more xmldoc, use positive constant instead of inverse negative for parity
StadiumUtil: Use built-in endianness reversal methods
2022-05-14 08:28:13 -07:00
Lusamine
4e703b7c9e Correct ordering of SWSH rental team blocks 2022-05-13 20:02:41 -05:00
Kurt
bc054c09ed PK5: Clear party stats on import
Add property get/set for the undocumented fields
2022-05-08 18:36:18 -07:00
Kurt
69794e7328 PK4: Add Seals & Ball Capsule index
0xD4 + 0x18 = 0xEC = 236 bytes -- end of data!
2022-05-08 13:16:41 -07:00
Kurt
3e8527f11a Minor tweaks
Reduce allocation in a few places, delete unused stuff, more concise expressions.
2022-05-07 21:25:26 -07:00
Kurt
a57f40ae7d Break up PKX into separate classes
Many years ago, PKX used to be a >4,000 line bloated file, which spun off multiple classes like CommonEdits and most of the early non-GUI PKM related logic. Now, it's just a stub to source the latest generation & personal table.

Separate files = more concise info, and more room to grow to do more advanced things.
Makes the IsPresent methods public (no longer internal).
2022-05-06 20:38:55 -07:00
Kurt
be9c947dd6 Use tuples and ComboItem, not anonymous class
Little more explicit
2022-05-06 15:43:51 -07:00
Kurt
75874b6b81 Show lock capsule slot in mystery gift editor
Closes #3487

editor getting hacky, but it works
2022-05-05 21:21:03 -07:00
Kurt
d58aed109d Add Current Box Changed flag for sav1/2
Flag not set causes the game to clear all boxes (except current box) to clear garbage sram if saves never cleared. Yay deferred execution?
2022-05-02 23:47:41 -07:00
Kurt
fa76da56c9 Inline some Rand32 calls
No functional change
2022-04-26 20:21:26 -07:00
Kurt
1f49574be1 Fix g6 hof len 2022-04-23 22:05:51 -07:00
Kurt
f5358e0e37 Update HoF6 entity editing
Reusable entity struct, no more overlapping fields
Adds OT Gender, fixes some flags.

Thanks L1nk2futr3 !
https://projectpokemon.org/home/forums/topic/60977-hall-of-fame-tid-resetting-gen-6/?do=findComment&comment=275575
2022-04-23 10:42:56 -07:00
Kurt
ff2e890e69 Revise Overworld8a application of PIDIV
Instantiating from template now follows group seed -> spawn 1 correlation, including alpha move.
Differentiates static encounters that don't follow the ow8a correlation, scrambles EC to disassociate.
Adds rand64 to get initial seeds
Set correct level range to match slotSeed; not respecting the slot roll being valid, but whatever.
2022-04-22 21:11:11 -07:00
Kurt
e90f19c962 Add setters for spawner objects
UnknownSeed->CountSeed
Seed_01 -> AlphaSeed
yay, no more unknown seed functionality, all documented.
2022-04-18 22:25:34 -07:00
Kurt
515a503ee4 Update spawner models, import from permutemmo 2022-04-17 14:54:54 -07:00
Kurt
a61d8d1efc Extract IMultiplayerSprite from SaveFile
only used by gen6 saves
2022-04-15 14:58:40 -07:00
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
hp3721
f740e1dd72
Fixed rebattling BDSP trainers (#3481) 2022-04-14 18:36:01 -07:00
Kurt
5f4bbcf8de Permit 0x1FF00 saves as stadium saves
Closes #3479
emulators are stupid
2022-04-13 10:42:35 -07:00
Kurt
f753afaae8 Minor clean 2022-04-11 11:56:56 -07:00
Kurt
a5ee845c3b Decouple event flag/work from SaveFile 2022-04-09 18:12:57 -07:00
Kurt
0389624508 Extract unnecessary stringbuilding from pkmconvert 2022-04-09 11:58:52 -07:00
Kurt
e6cf5d0baf Split PKMConverter into multiple classes
EntityFormat -> detects byte[] -> ctor() PKM
EntityConverter -> converts between pkm formats
RecentTrainerCache -> used by other classes (not within EntityConverter!)
EntityBlank -> creates blank PKM objects indirectly
2022-04-09 01:39:34 -07:00
Kurt
cc1c3e8d42 Refactor stat loading to allow spans
Can load stats without allocating
2022-04-08 21:08:06 -07:00
Kurt
274b613487 Change signature to set stackalloc ivs 2022-04-08 20:43:31 -07:00
Kurt
d40bfa63c7 Refactor gen2 mail data structure
Now reads/writes correctly in the GUI.
Closes #3470

Not going to handle slot swaps not matching the data, as this becomes problematic when cloning slots. Previous commit added the ability to manually move mail slots.
2022-04-02 23:36:56 -07:00
Kurt
55083ee02c Fill(0) -> Clear() 2022-03-26 13:33:58 -07:00
Kurt
977e977dbf Rewrite GeniusCrypto (XD/Batrev)
More clear usage of span
slightly less allocation+copying
more comments for future readers
2022-03-26 13:28:29 -07:00