Commit graph

844 commits

Author SHA1 Message Date
Kurt
a9443be8fa Add bypass for alpha move purchased
ty @Atrius97 for finally nailing the repro on this

Co-Authored-By: Atrius97 <39707481+Atrius97@users.noreply.github.com>
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-05-07 13:48:47 -07:00
Kurt
178069f889 Minor tweaks 2022-05-07 11:47:01 -07:00
Kurt
baa0a8185d Move to more appropriate folder
Pretty sure I've moved this back and forth before, but this is better not in the inner PKM group.
2022-05-07 09:26:49 -07:00
Kurt
8bf0469289 Remove allocations in SpeciesName helpers
Only allocations that remain are the runtime `new string(...)` that is required for the gen1-5 species name quirks.

Inlines some logic for language fetch, and requires slightly less memory.
2022-05-07 09:25:04 -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
124bbf98ad Allow seed of mastery toggling mastered flag
oops
2022-05-06 16:11:52 -07:00
Kurt
59ceec3c65 Extract EffortValues class, add $rand + $suggest
Renames IV/EV verifier field objects for Legality Checks due to class name clashing.
2022-05-06 15:47:54 -07:00
Kurt
9deafa851a
Create initial movesets for Alpha entities correctly, verify initial mastery (#3489)
* Draft checks for encounter slot mastery

* Check encounter mastery flags

* Add moves for LA static encounters that don't follow learnset

* Add moves on crossover LA static encounters

* add alpha moveset population method

Now generates and applies moves as the game does
Updates some handling of other methods to use Span

* Show better message for bad mastery init flags

* Insert descending if candidates have same level

Level 78 Yanmega:
- [01] [10] Quick Attack
- [06] [15] Gust
- [11] [20] Silver Wind
- [18] [28] Hypnosis
- [25] [35] Air Slash
- [34] [45] Ancient Power
- [43] [54] Crunch
- [43] [54] Bug Buzz

Yields:
AlphaMove
Crunch*
Bug Buzz*
Ancient Power

* Descending order due to iteration

Co-authored-by: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-05-06 15:43:23 -07:00
Kurt
6e94eaaaee Add overload for ITrainerInfo blank fetch 2022-05-06 10:42:08 -07:00
Kurt
41578132cf Minor tweaks
Add Get/Set Relearn method to PKM.cs
Alpha Mastered move now indicates incomplete text entry (like moves/relearn)
Split up legal move indication helper class, use DI to allow other implementations of DataSource to be returned (pkhex mobile?).
Remove unused gender refresh method (see previous added UserControl commit)
Add helper method to center control within control
2022-05-02 18:11:31 -07:00
Kurt
fa76da56c9 Inline some Rand32 calls
No functional change
2022-04-26 20:21:26 -07:00
Kurt
5be9863ef4 Sanitize gender on species/form change
clean up some if expressions
2022-04-25 17:30:16 -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
b297351d20 Fix clone deletion, add unique get func 2022-04-17 14:58:52 -07:00
Kurt
2f9e05972f slick switch expression
Might be a target for future refactoring if Format(int) is changed in the future...
2022-04-09 12:25:19 -07:00
Kurt
5260c5214e Move files 2022-04-09 12:01:43 -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
d3749bd4b6 Minor tweaks
Move sociability
inline dictionaries
2022-04-09 00:08:24 -07:00
Kurt
cc1c3e8d42 Refactor stat loading to allow spans
Can load stats without allocating
2022-04-08 21:08:06 -07:00
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