Commit graph

565 commits

Author SHA1 Message Date
Kurt
7c8f52cbbf Minor clean
invert nesting, add missing if( space, group OT checks together
2022-05-02 23:48:25 -07:00
Kurt
b51cdfe72f Flag Marks on BDSP/PLA encounters
Note to self: Exclusion lists aren't futureproof; inclusion more resilient :)
2022-05-02 19:27:22 -07:00
Kurt
5132f961cc Add server date checks for WA8 gifts 2022-05-02 18:52:43 -07:00
Kurt
ef3cb34387
Refactor EvoCriteria to be a struct, reduce allocation (#3483)
* Make EvolutionCriteria struct

8 bytes per object instead of 26
Unify LevelMin/LevelMax to match EncounterTemplate
bubble up precise array type for better iteration

* Inline queue operations, less allocation

* Inline some logic

* Update EvolutionChain.cs

* Improve clarity on duplicate move check

* Search reverse

For a dual stage chain, finds it first iteration rather than second.
2022-04-23 21:33:17 -07:00
Kurt
841fcde2b2 Enhance Pokerus api functions
Fixes #3480 ; (0,0) is a valid state regardless of format.
2022-04-14 14:05:32 -07:00
Kurt
a601180821 Extract Pokerus util logic
Simplify some GUI interactions when changing strain. Changing the day selection will update the visibility, no need to manually do it again.
2022-04-09 12:27:16 -07:00
Kurt
6deaf3cb74 More explicit type checks for Encounter class
A little more explicit on what it is actually checking for
2022-03-26 14:53:15 -07:00
Kurt
d91d242719 Stackalloc EV/AV checks 2022-03-13 22:33:17 -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
4e1276a954 -8 bytes from each encounter template
saves about ~1MB RAM savings (>=179,142 objects)
2022-03-06 23:25:47 -08:00
Kurt
7911cd6d5c Seal some classes 2022-03-06 12:16:36 -08:00
Kurt
c51d51d381 More specific primitives for Memories/others 2022-03-06 12:01:47 -08:00
Kurt
f3b3f15035 Add exp > lvl100 check
stop directly writing EXP values lol
2022-03-05 09:12:43 -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
5a71ecc8bb Minor clean 2022-02-24 23:17:16 -08:00
Kurt
cd043bce04 Extract egg met location 2022-02-24 23:14:40 -08:00
Kurt
32789d5609 Fix WB8 friendship check
Similar to WA8 friendship check. Previous personal table repoint didn't work because WB8 have .Version=BDSP.
7b05d0c056

Works fine now.
Closes #3448
2022-02-24 20:17:58 -08:00
Kurt
75bd26d056 Add new Illegal (clone/glitch abuse) flag + check 2022-02-21 20:13:27 -08:00
Kurt
2870163fff Don't check handler friendship if already invalid
prevents generating an unnecessary exception when gen == -1
2022-02-21 17:46:03 -08:00
Kurt
dc3d8e7cec Minor clean 2022-02-14 21:32:52 -08:00
Kurt
7b05d0c056 Fix base friendship check for PLA piplup WA8 2022-02-13 15:25: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
a7051107ea Conditionally set PP Ups and Purchase/Mastery flags on set import 2022-02-07 15:40:02 -08:00
Kurt
b8394516d2 Flag insufficient flawless IVs for eslot8a 2022-02-06 16:08:03 -08:00
Kurt
420dd32aea Allow lower sheen threshold for beauty
Not really worth checking if it is all in beauty; this is just a simple error checker.
Closes #3401
2022-02-06 00:30:38 -08:00
Kurt
e8903505df Min move count: ignore purchased moves 2022-02-05 16:47:19 -08:00
Kurt
3ca8c4c69f Add GV legality check
GUI already did indicate if a value was legal, but this actually flags the pkm in the legality checking report.
2022-02-05 13:48:34 -08:00
Kurt
3793fd4fd3 Landmark Alphas do not have Alpha Moves
nice omission gamefreak
2022-02-05 10:23:00 -08:00
Kurt
b252bc129a Re-enable legality checking error suppression
Forgot to disable it from testing, oops.
2022-02-05 09:31:36 -08:00
Kurt
b72c5bbf1a Fix mystery gift alpha check
Implement IAlpha for good measure
2022-02-04 20:13:36 -08:00
Kurt
eed5bb04e3
Merge pull request #3382 from kwsch/pla
Update 22.02.04
Individual commits from this PR are not cherry-pickable in a vacuum; these were manually re-committed from a staging repo in order to group together changes for general public viewing. There were over 250 commits on the private development repo for this update.
2022-02-04 18:28:17 -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
ff48c824eb Update ContestStatInfo.cs 2022-02-04 00:37:29 -08:00
Kurt
936a0e927a Handle unavailable hidden abilities for bdsp
EncounterSlots now expose Ability, so no need for manual checks there.
2022-01-17 21:44:21 -08:00
sora10pls
93083616dd Extend Ranked Ribbon availability for GO encounters
Also hange >= to > because of new GO => HOME met date legality.9/1/2022 is legal if it was transferred in somewhere like Kiribati or New Zealand, but 9/2/2022 isn't.
2022-01-16 14:53:04 -05:00
Kurt
bb2a63bbce Split min sheen calc for 3 & 4, revise limits
Thanks @SadisticMystic!

https: //github.com/kwsch/PKHeX/commit/9ce0da6c46ebea3c7c6edd1f1e0571e5ecbec739#r63579484
Co-Authored-By: Russell Jones <questiondesk@gmail.com>
2022-01-11 23:29:01 -08:00
Kurt
9cde291595
Enumerate ability permissions in encounter templates, misc updates (#3368) 2022-01-08 22:34:04 -08:00
Kurt
437c79925d More poffin min sheen fudge 2022-01-08 10:57:51 -08:00
Kurt
933294b3c9 Update NicknameVerifier.cs 2022-01-08 10:43:53 -08:00
Kurt
75a438ca44 Misc tweaks 2022-01-08 10:33:02 -08:00
Kurt
209d295f58 More handling for traded Meister magikarp
what a meme
All these edge cases make me want to move all this trade OT/Nick validation into the EncounterTrade classes and just get an enum indicating what is wrong with the trainer/OT details...
2022-01-08 09:59: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
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
7b4099030a Properly flag gmax in bdsp 2022-01-01 23:11:45 -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
9ce0da6c46 Add bdsp approximations for min sheen calcs
Closes #3351
2021-12-25 18:51:02 -08:00
Kurt
fbb9e0bf0e Flag original catchrates on g1->g2->g1 transfers
Closes #3328
2021-12-25 18:44:37 -08:00
Kurt
2d34411203 Fix g8 meister magikarp matching
5b2ad8703c
2021-12-25 12:57:05 -08:00