Commit graph

528 commits

Author SHA1 Message Date
Kurt
43c9cc6bc1 Update HiddenPower.cs 2022-06-29 10:49:39 -07:00
Kurt
5947da9a3f Update HiddenPower.cs 2022-06-26 20:29:15 -07:00
Kurt
b9b4eb1791 Minor tweaks
Bulk: Pass slot origin to legality analysis. Pass the proper personal data for good measure

Personal: check if the form truly does exist for presence check because sometimes the form will default to 0 on OOB

Showdown: Reduce some allocation, be more lenient in casing parse for Nature suffix and Hidden Power manually typed by user. Parse non-english hidden power sets (yay, now usable by all languages even though PS sets are English only!).
2022-06-26 20:02:57 -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
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
51edaac704 Flag pokerus on LGPE, traded starter 2022-06-17 16:38:05 -07:00
Kurt
0093927e15 Use ReadOnlySpan instead of Span if appropriate 2022-06-13 00:04:20 -07:00
Kurt
c66588666c Split box manip default lists from base file
Only change is to allow SM/USUM to allow Heal action

SM/USUM where Transporter messes up PP for VC transfers; otherwise no need for Gen1-5 games.
2022-06-11 15:47:23 -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
893b5d5293 Revise more PB7/PK8->Interface type checks 2022-06-04 21:03:25 -07:00
Kurt
afed55f1e5 Don't yield empty moves on set text export 2022-06-04 16:05:51 -07:00
Kurt
db03a77c55 Refactor Marking access 2022-06-04 00:59:52 -07:00
Kurt
ab723af640 Expose Context for SaveFile/ITrainerInfo 2022-06-03 19:08:46 -07:00
Kurt
df02532697 Misc fixes
Simplify HM memory check (bit permission superset, just check directly)
Disallow BestFriends & Effort on PA8 exclusives
PA8 techrecord permits none.
2022-06-02 20:05:27 -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
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
sora10pls
75f9f39cbf Add BDSP Hall of Origin unlock cheat 2022-05-13 17:25:18 -04:00
Kurt
8c4db878dd Extract logic to set initial mastery move flags
Are we done yet
2022-05-08 10:28:22 -07:00
Kurt
178e5e8bc5 More mastery tweaks for db->pkm + alpha statics
in the RNG generator, defer alpha move mastery flag set for templates to set themselves
2022-05-08 10:06:38 -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
82fae7b350 Revise moveshop move suggest methods 2022-05-07 21:21:29 -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
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
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
7c8f52cbbf Minor clean
invert nesting, add missing if( space, group OT checks together
2022-05-02 23:48:25 -07:00
Kurt
5132f961cc Add server date checks for WA8 gifts 2022-05-02 18:52:43 -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
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
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
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
5260c5214e Move files 2022-04-09 12:01:43 -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
cec408e62a Use different checksum algo (bytewise) if no impl
Closes #3471
2022-04-02 17:58:47 -07:00
Kurt
77473476da Split savedata editing template 2022-04-02 17:58:05 -07:00
Kurt
d95ba482f3 Reduce allocation in methodfinder IV set 2022-03-13 19:39:38 -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
f77b6fa405 Master moveshop moves on set import 2022-03-07 21:45:46 -08:00
Kurt
1185c63b15 Update MoveApplicator.cs 2022-03-07 21:42:51 -08:00
Kurt
33537465ca Simplify batch editor loading method
Lazy init the all-any-byType sorted string list, static ctor unneeded for some nuget users
2022-03-07 19:42:08 -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
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
9632ad44fd Span-ify HiddenPower methods
Zero heap allocation Hidden Power bruteforcing via Heap's algorithm
2022-03-06 00:43:49 -08:00
Kurt
e17483fe46 some linq reduction 2022-03-05 20:03:52 -08:00
Kurt
3ebf5279cc Add .X=*Y (property copy) feature 2022-03-04 22:35:04 -08:00
Kurt
d0f2b6eeb5 Add .CurrentLevel=$suggest for min legal level 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
76afe91bbb Allocation free besides ctor 2022-02-26 21:39:50 -08:00
Kurt
dd4c2a349c Fix moving 5th party slot between boxes
Thanks Burning Justice !

https://projectpokemon.org/home/forums/topic/60789-error-when-attempting-to-edit-pokemon-battle-revolution-save/
2022-02-25 16:32:15 -08:00
Kurt
03b8ceb5ab Allow TypeSuggestion to operate on interfaces
Add ganbaru clear/suggest, lgpe iawakened clear/suggest, hyperatrain/geolocation clear
2022-02-13 11:02:22 -08:00
Easy World
843e065fb4
Add batch command to suggest HeightAbsolute & WeightAbsolute (#3435)
Already available for PB7, this adds it for PA8.
2022-02-13 07:10:26 -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
d17639f956 Add alpha move for encounter slots
oops
Closes #3427
2022-02-09 19:21:45 -08:00
Kurt
2f5635613e Update TechnicalRecordApplicator.cs 2022-02-08 08:55:56 -08:00
Kurt
c7f24eecd0 Parse shiny/gmax Yes with any case/culture 2022-02-08 00:00:52 -08:00
Kurt
a7051107ea Conditionally set PP Ups and Purchase/Mastery flags on set import 2022-02-07 15:40:02 -08:00
Kurt
b20fb39d77 Don't set dex on slot swap within save
Closes #3411
2022-02-07 15:03:26 -08:00
Kurt
10fff124e5 Minor clean 2022-02-04 22:19:04 -08:00
Kurt
16e52cdb19 Add move mastery batch command (MoveMastery)
$suggestAll -> get all
$suggestNone -> remove all
$suggest -> get current moves
2022-02-04 20:04:57 -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
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
a08330ffd4 Update MoveSetApplicator.cs 2022-01-03 22:27:20 -08:00
Kurt
36bf73818e Source trainers for encounter database
Closes #3364
Related: #3358
2022-01-03 19:33:10 -08:00
sora10pls
3f1335e19f Add Zone unlock cheat to BDSP Misc Editor
As with most event work tampering, make sure you keep save backups. Accessing areas before you're intended to will almost certainly break story progression.
2022-01-03 11:06:06 -05: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
dc4a9136ea Remove trailing whitespace 2021-12-27 14:03:41 -08:00
Kurt
76cac85243 Minor clean 2021-12-27 13:50:21 -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
749293fc75 Move BoxManip to subfolder 2021-12-26 19:43:42 -08:00
Kurt
11039f1119 Extract some event unlocking logic for core 2021-12-26 18:21:34 -08:00
Kurt
39f8e9173e Add contest stat batch modification 2021-12-20 19:16:23 -08:00
Kurt
f1fe2f6a8c Minor clean 2021-12-09 19:30:12 -08:00
Kurt
d7e1f65faa Add some xmldoc, file scoped namespaces
Not much of a git diff history for these files so I don't mind them being reformatted.
2021-12-09 18:58:30 -08:00
Kurt
870a38c607 Use primary constructors for some records 2021-12-09 01:08:46 -08:00
Kurt
cacd6e9965 More records/sealing 2021-12-05 23:54:59 -08:00
Kurt
88ddc5822e c#10: readonly record structs
Reduces some boilerplate constructors/equality compares
2021-12-04 18:32:35 -08:00
Kurt
f55c5bea66 Minor clean
no functional change
2021-12-04 17:56:56 -08:00
Kurt
dc0f56e790 Add underground save structure documentation 2021-11-24 00:45:11 -08:00
Kurt
27e899ffdd Yield SP eggs in encounter db, detect "link trade" correctly 2021-11-21 18:36:36 -08:00
Kurt
9d5cff5221 Add daycare reader, show playtime in backup filename 2021-11-20 19:10:42 -08:00
Kurt
b25a7b621f Update BatchEditing.cs 2021-11-19 22:38:37 -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
Kurt
692898fe46 Set metadata for sav on certain paths
Closes #3282
2021-11-07 10:17:03 -08:00
FeralFalcon
3afd51e587
Adding a plethora of event flag data (#3273)
* Add metadata flagging for values

Allows users to set a minimum importance for the list displayed.

Could probably make this checkboxes within the flags UI.

* Add setting to filter out gen8 block names

Allows users to filter out unwanted low-value property names.

Co-authored-by: Kurt <kaphotics@gmail.com>
2021-10-23 11:25:14 -07:00
Kurt
009e37662f
Startup Enhancements, Gen1/2 Save Indication, Export SAV cleaned up (#3275)
* Providing pkm/sav files via command line (dragging files onto exe / associated file launched) will more intelligently source a partner sav/pkm object if not provided.
* Gen1/2 mainline save files now indicate if they are VC era or GB era (legality implications) in the program title bar.
* Fixes loading VC era save backups not being recognized as VC era (`.bak` extension hides `.dat`)
* Export BAK moved to the SAV tab, which allows Export main to be deleted and Export SAV to be used as the single-click for exporting saves. `CTRL-E` is still the hotkey.
2021-10-21 22:13:21 -07:00
Kurt
4fb0f96dc4 Add daycare slot view for lgpe
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-09-16 14:21:44 -07:00
Kurt
a631e5cb4e Rearrange how some memory info is checked
Split into different game contexts
2021-08-22 16:41:57 -07:00
Kurt
28e7473f1a Condense some expressions 2021-08-22 01:26:28 -07:00
Kurt
8f0fb902d1 ArgumentException -> ArgumentOutOfRangeException 2021-08-21 16:51:50 -07:00
Archit Date
27059268ba
un-trim alcremie form strings (cream vs swirl) (#3246)
also use proper alcremie forms for showdown
2021-08-21 13:02:37 -07:00
Kurt
bedc52943e Trailing commas
No functional change
2021-08-20 13:49:20 -07:00
Kurt
c6342a163f Minor clean
variable swaps, simplifications
2021-08-20 13:42:25 -07:00
Kurt
c0d748a975 Add Dream World upload slot indicator
Tested & works on bw & b2w2
Thanks Brokemia for the request!
2021-08-16 11:54:03 -07:00
Kurt
9793e9f1a0 Minor clean
Slap on interface for EntreeSlot
De-magic some 💯 numbers to indicate what they're doing
Improve perf of move-match-relearn check
Add an "else" as valid is never both values (history verifier)
2021-08-13 15:36:30 -07:00
Kurt
a939a2dbd6 Add pkmdb sorting rules for loaded database set 2021-08-06 10:09:16 -07:00
Kurt
0f3e5095c5 Replace more linq usage 2021-08-05 22:39:38 -07:00
Kurt
ebb47867dd Use FileUtil tryget for pkm from path
GetPKMFormatFromExtension is now only used once internally.
2021-08-05 16:29:32 -07:00
Kurt
0c6254835d Add battle agency slots to main window misc viewables 2021-07-26 23:57:05 -07:00
Kurt
51616cc7f9 Handle off by 1 for box/slot differently
Does the opposite as was implemented in 16c8a18928 by updating all downstream users -- batch filters only.
2021-07-20 23:53:33 -07:00
Kurt
6bed33f7f1 Minor tweaks 2021-07-15 20:40:00 -07:00
Kurt
8e5e4487ba Change interface for method call to less restricted
Don't need "Name" or "LongName" for these methods.
2021-07-13 18:22:04 -07:00
Kurt
46f50a3a56 Use named consts for magic gender values
More personal magic value comparisons
2021-07-13 18:22:04 -07:00
Kurt
6ee552b860 Compare propertyvalue for Legal batch
seal the classes, no need to derive (nothing virtual)
2021-07-10 13:45:14 -07:00
Kurt
3fa311f6ed Misc tweaks
more annotations - all bool->out ? are annotated now
fix gender symbol inversion (forgot to set text)
extract some methods to reduce nesting
2021-07-06 08:42:15 -07:00
Kurt
16c8a18928 Show box/slot offset by 1 when loading as SlotCache
Closes #3229
also revises parsing to not ToString(), and doesn't add a skip if the slot is empty
2021-07-03 09:28:35 -07:00
Kurt
103aa9aa4b
Revise EncounterArea and EncounterType for clarity (#3228)
EncounterArea now stores a more specific type'd array for encounter slots. Better iteration and less casting, as the nonspecific `Slots` fetch is rarely referenced.

EncounterType renamed to GroundTile to reflect how it actually works in Gen4. Was previously an ambiguous field that was clarified a little; we can describe it a little better now. Keep the GUI the same to not scare the end users.

Change Trash Byte properties to get/set a Span. Trash Byte legality checking easier on the garbage collector?
2021-06-29 20:58:06 -07:00
Kurt
3e7775fc44
Track a PKM's Box,Slot,StorageFlags,Identifier metadata separately (#3222)
* Track a PKM's Box,Slot,StorageFlags,Identifier metadata separately

Don't store within the object, track the slot origin data separately.

Batch editing now pre-filters if using Box/Slot/Identifier logic; split up mods/filters as they're starting to get pretty hefty.

- Requesting a Box Data report now shows all slots in the save file (party, misc)
- Can now exclude backup saves from database search via toggle (separate from settings preventing load entirely)
- Replace some linq usages with direct code

* Remove WasLink virtual in PKM

Inline any logic, since we now have encounter objects to indicate matching, rather than the proto-legality logic checking properties of a PKM.

* Use Fateful to directly check gen5 mysterygift origins

No other encounter types in gen5 apply Fateful

* Simplify double ball comparison

Used to be separate for deferral cases, now no longer needed to be separate.

* Grab move/relearn reference and update locally

Fix relearn move identifier

* Inline defog HM transfer preference check

HasMove is faster than getting moves & checking contains. Skips allocation by setting values directly.

* Extract more met location metadata checks: WasBredEgg

* Replace Console.Write* with Debug.Write*

There's no console output UI, so don't include them in release builds.

* Inline WasGiftEgg, WasEvent, and WasEventEgg logic

Adios legality tags that aren't entirely correct for the specific format. Just put the computations in EncounterFinder.
2021-06-22 20:23:48 -07:00
Kurt
49b7d4522c Sync missing change 2021-06-09 18:40:17 -07:00
Kurt
2083201ee1 Add ObjectType custom filter logic 2021-06-08 20:28:13 -07:00
Kurt
035584dc7c Extract templating from EditPKMUtil, rename methods 2021-06-07 20:02:57 -07:00
Kurt
871de4e213 Add more xmldoc 2021-06-06 11:56:54 -07:00
Kurt
8c970ec991 Minor tweaks
no functional change, readability++
add more xmldoc
2021-06-03 12:04:19 -07:00
Kurt
138501da2f Minor clean
Condense some expressions
Use less linq
Rename some fields
2021-05-29 15:31:47 -07:00
Kurt
64dbb9ae74 Abstract filter matching
Similar to prior commit adding modifications and suggestions
2021-05-27 14:43:32 -07:00
Kurt
05e37eb073 Extend batch editing to allow for plugins to add new mods 2021-05-27 12:20:00 -07:00
Kurt
236fd2943f Add hgss pokewalker stored pk4 fetch
ty atrius
2021-05-25 10:07:14 -07:00
Kurt
04ea271b8b Update ShowdownSet.cs 2021-05-20 08:24:22 -07:00
Kurt
2655892db1 Choose a gender on unspecified 2021-05-19 17:12:30 -07:00
Kurt
fac7555c50 postfix gender form
handle all permutations of Indeedee-M/F (M/F)

if it detects (F), it uses female, otherwise it uses whatever the detected form was (0/1) and sets the values accordingly.
2021-05-19 13:12:18 -07:00
Kurt
2c820bfbe9 Minor tweaks 2021-05-18 13:29:55 -07:00
Kurt
44affe3caa Add flag unit tests, more xmldoc 2021-05-15 11:32:25 -07:00
Kurt
ebefa0a918 Update ShowdownSet.cs 2021-05-15 10:20:19 -07:00
Kurt
e31980d15e Clean up nickname parsing, make Gender an int type
Breaking change for anyone using IBattleTemplate (alm)
2021-05-14 23:41:14 -07:00
Kurt
50b15cd740 Use range/index
More in line with modernizing the codebase with latest c# syntax

improve web-qr decode speed slightly (no linq skiptake)
get money/coin mask without a temporary string (lol performance)
2021-05-14 15:30:55 -07:00
Kurt
07584a8774 Add chateau score, seaside cycle score
Update some other areas too
looks like this fixes the sube pkx fetch method for extraslots, yay.
2021-05-13 23:12:53 -07:00
Kurt
ceede68861 Minor tweaks 2021-05-07 22:11:10 -07:00
Kurt
31142ee297 Replace some linq usage with direct logic 2021-05-06 23:26:38 -07:00
Kurt
2aed4c3118 Add shedinja dropped ribbons/marking considerations
Nice bug ya got there, gamefreak.

Coulda cleared the AffixedRibbon value instead of copying it on Shedinja creation, and it would have made this unnecessary.

Please ditch the Affixed Ribbon gimmick for future games, thanks!
2021-04-21 15:20:16 -07:00
Kurt
25565e6f07 More pattern matching expressions
Shapes are fancy; nested pattern checks
2021-04-20 02:17:28 -07:00
Kurt
9dfa1077ee Rename internal PKMInfo class to match batch names 2021-04-20 01:50:47 -07:00
Kurt
d9c22b1d74 Move pk1/2 EV maxing to class 2021-04-20 01:50:27 -07:00
Kurt
b64edb751d More xmldoc 2021-04-20 01:50:04 -07:00
Kurt
2f078e6565 Minor tweaks
Make HP IV set use single array fetch, less memory required
add some xmldoc
2021-04-20 01:02:32 -07:00
Kurt
0d45075d4b
Rewrite settings handling; enhance some user experiences (#3193)
- Settings now stored as json next to exe
- Settings now exposes all legality checking setttings that can be changed
- Slot hovering now can play cries in MGDB/PKMDB/etc, not just the main boxes.
- Enhanced hover text for mystery gifts and encounters that have movesets
- Show recently loaded save files in ctrl-f browser
- Toggle auto-load savefile setting to be none/detect-latest/last-loaded
- Custom extensions & extra backup paths can now be configured directly in the json settings
- Settings editor now uses propertygrid & tabs.
2021-04-11 18:09:54 -07:00
Kurt
cfcefca14f Add splitbreed relearn suggest recursion 2021-04-10 11:03:21 -07:00
Kurt
fb972b9782 Update MoveSetApplicator.cs
Closes #3191 , uses a better method
2021-04-09 11:22:10 -07:00
Kurt
673c0d93a6 Extract event flag/work editing from GUI
now <200 lines for editing (ignoring the diff functions), yay
Opening the editor allocates less (no copying save file)
2021-04-05 20:52:49 -07:00
Kurt
0626b0c29b
Add Breeding move ordering logic, and use in legality analysis (#3183)
* Initial bred moveset validation logic

Unpeel the inheritance via recursion and permitted moves

* Volt tackle considerations

* Optimize out empty slot skips

* Add tests, fix off-by-one's

* Require all base moves if empty slot in moveset

* Add test to prove failure per Anubis' provided test

* Tweak enum labels for easier debugging

When two enums share the same underlying value, the ToString/name of the value may be either of the two (or the last defined one, in my debugging). Just give it a separate magic value.

* Fix recursion oopsie

Also check for scenario where no-base-moves but not enough moves to push base moves out

* Add Crystal tutor checks

* Add specialized gen2 verification method

Game loops through father's moves and pushes in one iteration, rather than checking by type.

* Add another case with returning base move

* Add push-out requirement for re-added base moves

* Minor tweaks

Condense tests, fix another off-by-one noticed when creating tests

* Disallow inherited parent levelup moves

Disallow volt tackle on Gen2/R/S

* Split MoveBreed into generation specific classes

Gen2 behaves slightly different from Gen3/4, which behaves slightly different from Gen5... and Gen6 behaves differently too.

Add some xmldoc as the api is starting to solidify

* Add method overload that returns the parse

Verify that the parse order is as expected

* Add reordering suggestion logic

Try sorting first, then go nuclear with rebuilding.

* Return base moves if complete fail

* Set base moves when generating eggs, only.

* Use breed logic to check for egg ordering legality

Don't bother helping for split-breed species
2021-04-04 18:30:01 -07:00
Kurt
645f2b4db5 Revert implicit casting
Looks like netstandard2.0 wasn't meant to receive that new c#9 goodie
2021-03-29 00:14:44 -07:00
Kurt
8d3f990667 Make some properties into consts 2021-03-20 12:47:21 -07:00
Kurt
33e2c64721 Split SAV3 into version classes
Begone are the version-switch cases for value fetching.
2021-03-15 23:51:58 -07:00
Kurt
6bce4eea14 Minor clean
Annotations (nullable), some switch cases for readability
2021-03-14 16:16:55 -07:00
Kurt
49541e6073 Rework mainline sav3 to not operate off chunks
Previous style was to resize the sav buffer and concat all the storage chunks at the end. Allocated a double save file.

Now, just allocate 3 buffers.
2021-03-07 23:22:07 -08:00
Kurt
21e1e6def5 Check format 3/4 for setpidnature 2021-02-02 15:39:41 -08:00
Kurt
f85ee7615d Replace dashes with spaces for cosplay pikachu (rock star)
Can't replace all dashes with spaces, because Pom-Pom Oricorio exists.
2021-02-02 09:19:29 -08:00
Kurt
8db21c2bd0 Update 21.01.30
Latest cumulative update release with mgdb/pget binaries updated.
2021-01-30 10:46:05 -08:00