Commit graph

824 commits

Author SHA1 Message Date
Kurt
a4533b62d8 Reduce size of display-able met location arrays
shaves 5KB off the core DLL
2022-03-20 19:07:33 -07:00
Kurt
fadcf92dc8 Faster pokecrypto
net6 was 4x faster than 461 with the old implementation; now it is faster for both but not as disparate.

New implementation performance is always at least 30% better than the old implementation; even better for smaller chunks of data (40% less time).

Pretty much mimics bare metal value writes
2022-03-20 02:44:36 -07:00
Kurt
d91d242719 Stackalloc EV/AV checks 2022-03-13 22:33:17 -07:00
Kurt
5942a74147 Expose SpeciesID3 for CK3/XK3
Closes #3463
Not going to add unobtainable species IDs to the GUI.
2022-03-13 19:53:46 -07:00
Kurt
d95ba482f3 Reduce allocation in methodfinder IV set 2022-03-13 19:39:38 -07:00
Kurt
d5ae6764aa Stackalloc IVs for template->pkm fill 2022-03-13 19:24:08 -07:00
Kurt
69fafcab83 Performance: Slightly reduce allocations in moveset validation (#3460)
* Reuses move parse result objects for each encounter parsed in a LegalityCheck attempt, instead of creating a new object.
* Ensures the objects are never-null, and makes cleanup easier.

Slightly adjusts some other parts of the moveset validation to reduce allocations.
2022-03-12 17:39:00 -08:00
Kurt
2e6364dceb Fix pk2->pk1 nickname copy
nobody noticed until I did
2022-03-10 18:00:45 -08:00
Kurt
e1414a0bea Move some interfaces to different folder
No code changes
2022-03-06 12:06:50 -08:00
Kurt
c51d51d381 More specific primitives for Memories/others 2022-03-06 12:01:47 -08:00
Kurt
e17483fe46 some linq reduction 2022-03-05 20:03:52 -08:00
Kurt
1b266c1e4b Handle PLA MMO formarg deferral
Can capture formarg evolved stuff directly in wild
2022-03-05 18:54:50 -08:00
Kurt
3d9c7dc750 Reduce IAwakened from int->byte 2022-03-05 18:46:03 -08:00
Kurt
b20566eb59 Use actual primitive instead of int
Some interfaces aren't needed to be exposed as int
2022-03-05 18:30:35 -08:00
Kurt
6ae59c509f IGanbaru int->byte fields 2022-03-04 22:34:11 -08:00
Kurt
7443db3564 Update some xmldoc 2022-03-04 22:34:11 -08:00
Kurt
e5e2a3427f Rename Silver SV->SI
SV will likely be the lump for SCarlet and VIolet
2022-02-27 11:16:12 -08:00
Kurt
2753927942 Ignore empty slots in pre-filter
Add Palma property to PK8 per bdsp disassembly
2022-02-22 07:34:43 -08:00
Kurt
75bd26d056 Add new Illegal (clone/glitch abuse) flag + check 2022-02-21 20:13:27 -08:00
Kurt
f2637168ab Fix kor string writes
Was writing kor string, then writing en after (all terminators).
Make method signature match other SetString, with write buffer as first arg

Closes #3440
2022-02-17 23:11:13 -08:00
Kurt
51975e4bdd Only push move if doesn't already have
Closes #3439
2022-02-17 20:53:21 -08:00
Kurt
dc3d8e7cec Minor clean 2022-02-14 21:32:52 -08:00
Kurt
0eece2711a Set the calc h/w float regardless of epsilon
epsilon no longer required per #3417
closes #3434
2022-02-12 18:48:33 -08:00
Kurt
cedf13c343 PK4: Fix DP met location write
Closes #3431
2022-02-11 16:28:51 -08:00
Kurt
a5d1bf7900 Fix cxd pouch write, bk4 pid reads
Closes #3429
2022-02-10 10:57:59 -08:00
Kurt
a287efe3a1 Inline pk2/pk3 form setter, only SetGender if different
Helps out ALM generate unown
2022-02-09 20:20:32 -08:00
Kurt
6da235f0e8 Set 3 flawless IVs if randomizing alpha IVs
Closes #3428
2022-02-09 19:26:18 -08:00
Kurt
d17639f956 Add alpha move for encounter slots
oops
Closes #3427
2022-02-09 19:21:45 -08:00
Kurt
9c5955c104
Emulate Height & Weight float calculations matching the game (#3417)
* Accurately implement height/weight calc

* Handle GUI reads

Having Auto off will read and write the values correctly

F6 will handle all the decimal points possible

* Remove no longer needed tolerance check
2022-02-08 18:56:11 -08:00
Kurt
e12f3004ad Post-check defer if catchrate disallows tradeback
Closes #3412
2022-02-07 18:44:29 -08:00
Kurt
e8903505df Min move count: ignore purchased moves 2022-02-05 16:47:19 -08: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
429c80e9f5 Add new abstractions for pkm/personal/mysterygift
Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
2022-02-04 17:26:15 -08:00
Kurt
659fc9978b Stackalloc marking set & raid IV gen 2022-01-08 22:48:33 -08:00
Kurt
b96e2cacd7 Add xmldoc 2022-01-08 09:54:32 -08:00
Kurt
9bddc89c07 Use span if possible instead of new arrays 2022-01-07 20:56:44 -08:00
Kurt
01f1be6f89 Fix incorrect g1 trade trainer char reference 2022-01-07 20:52:26 -08:00
Kurt
8f5f80b391 Only remove space in gen1/2
prior version removed all spaces if < 3, this just early returns before span trimming.
2022-01-07 20:34:35 -08:00
Kurt
f83a9bf833 Expose shiny potential value
Not really digging it currently as it doesn't cover multi-state like AlwaysStar-Or-Never, but that single edge case can be handled elsewhere
2022-01-07 17:48:12 -08:00
Kurt
36bf73818e Source trainers for encounter database
Closes #3364
Related: #3358
2022-01-03 19:33:10 -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
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
5f7caf9ca2 Tweak PB8.FixMemories for importing eggs & handler quirk 2021-12-27 01:53:28 -08:00
Kurt
24e1898410 Update gen4 Shedinja handling
PK4->PK5 fixes gendered Shedinja -> genderless.
Clean up PK4 ball value setters and expose those 2 properties separately.
Add edge case permission for HG/SS Sport Ball Shedinja being legal if evolved on DP (DP doesn't change 0x86, lol)
Copy PokéathlonStat and ball values individually for BK4<->PK4 conversion

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-12-26 20:13:36 -08:00
Kurt
76ab09f024 Inline constant value 2021-12-26 01:06:30 -08:00
Kurt
1d0993f852 Remove EvoBase, relocate functions to call sites
Utilize FormInfo to remap battle forms into hatch forms so the encounter matches something valid, and is flagged later in FormVerifier
2021-12-26 00:57:40 -08:00
Kurt
543359fff6 Add contest stat sheen checking
Closes #3324
2021-12-07 00:54:39 -08:00
Kurt
f55c5bea66 Minor clean
no functional change
2021-12-04 17:56:56 -08:00
Kurt
4046ea0840 Handle encrypted pb8 file detection as pb8 2021-11-30 22:08:15 -08:00
sora10pls
5b04a10fa3 Swap Pioneer and TwinklingStar indexes
silly me
2021-11-25 19:27:02 -05:00