Commit graph

212 commits

Author SHA1 Message Date
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
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
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
8bf618008a Remove structconverter
Won't work on bigendian architecture for non-byte fields, so just do it manually.
2022-03-25 19:47:23 -07:00
Kurt
8f8726ac5e Disallow encstatic1 yield catchrate not tradeback 2022-03-13 18:29:47 -07:00
Kurt
801892b59e potential revisions for gible (#3462)
ddc6f414df caused it to be `<=` instead of `<`, but maybe the underlying issue was fixed a different way since all tests still pass with this reversion.
2022-03-12 17:39:01 -08: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
5359a140a6 Handle fixed ability for 8b RNG 2022-03-08 08:44:55 -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
3bef0452d6 Update bdsp underground table for area6
819b90f931
Closes #3450
2022-02-26 11:54:24 -08:00
Kurt
d5be6254f3
Add logic for PLA wild RNG correlation (#3443)
Adds structures to read/write saved spawner data such as seeds, counts.
Adds generator and validator to emulate the FixInitSpec builder used by the game logic

Similar to SW/SH raids, validating these in-process is not feasible due to the number crunching required.

This does not handle the encounter slot call or the follow-up level range call. Just the inner FixInitSpec ctor & fill.

level is calc'd:
randFloat(sum) -> slot float
rand.Next() -> gen_seed (for all the details)
rand.NextInt(delta) +min -> level

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-02-20 17:59:48 -08:00
Kurt
10bbf14ff7 Handle test case for no feebas in PLA 2022-02-08 18:55:55 -08:00
Kurt
b0197a84a0 Update lgpe route20 lapras level range
Closes #3380
2022-02-04 00:53:29 -08:00
Kurt
38809f67dd Handle suggestions 2022-01-17 20:21:33 -08:00
Lusamine
96d2ca1dcc Add Wild8RNG generation method 2022-01-16 01:57:56 -06:00
Kurt
682feab3d4 Return evolution chains with more accurate min-max
Closes #3371 ty @Ninjistix !
2022-01-14 00:11:33 -08:00
Kurt
94080eb71a Add prev function for xoroshiro implementations 2022-01-13 18:43:04 -08:00
Kurt
be8b12dbbe Add Prev for xorshift implementation
Add some unit tests (why not?)
2022-01-12 17:05:16 -08:00
Kurt
9cde291595
Enumerate ability permissions in encounter templates, misc updates (#3368) 2022-01-08 22:34:04 -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
defae6727d Check bdsp version exclusive hatch locations
lol srsly

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-12-24 18:39:54 -08:00
Kurt
46f5a9c29a Remove inaccessible zone IDs from hatch location list
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-12-23 01:25:14 -08:00
Kurt
1e0ac7fb26 Ban more BDSP egg moves before HOME
https: //github.com/kwsch/UnityDPtools/pull/2
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-12-20 19:00:48 -08:00
Kurt
f1fe2f6a8c Minor clean 2021-12-09 19:30:12 -08:00
Kurt
56c7c8336a Revise roamer shiny xor checking
shininess unrelated to your trainer ID, lol

probably also applies to other predetermined encounters like underground and radar, but those aren't EC-seed regenerated (?)

Remove unused interface declaration
2021-11-25 08:32:36 -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
92d15bdd03 Rename SetTradeMemoryHT, add SetTradeMemoryHT8
Gen6 behaves differently from Gen8.
Fix broken test case [Arrived via link trade, it had fun! (2) -> (3)]
2021-08-29 13:15:45 -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
92d1666970 Make PIDIV a readonly struct
Add tests to ensure the optimization remains in effect later
2021-08-21 18:24:38 -07:00
Kurt
48024f1245 Add Swarm data get/set for gen3-5
#3245
2021-08-20 19:52:31 -07:00
Kurt
bedc52943e Trailing commas
No functional change
2021-08-20 13:49:20 -07:00
Kurt
e3c28156bf Split legality tests into subtests by folder 2021-08-06 14:33:34 -07:00
Kurt
feb2eab7e5 Subfolder private unit test files
Allows differentiation of certain check types
2021-08-06 13:45:32 -07:00
Kurt
754e7ab821 Add private files legality test method
Dump your legality files into the legality\private folder, and they'll be checked to ensure they're valid.
2021-08-06 13:19:27 -07:00
Kurt
7bd844d5c5 Move min level check for gen1/2 closer to move adder
Check per-evolution min level rather than basing it on the original encounter data.

Correctly parses stuff like a captured level 23 Nidorina that immediately evolves into Nidoqueen, then learns Body Slam.

Passing zero is better than passing 1, as 0 requires no value pushing.

tidy up method signatures in MoveLevelUp so that species is followed by form, and the lookups are textually aligned. Clarify "maxLevel" instead of max/lvl, same as min.
2021-07-22 21:25:15 -07:00
Kurt
5a769312fd Finish renaming EncounterType->GroundTile
Update the localization for GroundTile for english (and Italian, which is untranslated)
2021-07-03 23:25:09 -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
9c9f0f8a94 Get criteria from set details
pretty much futureproof I guess
2021-06-14 21:11:46 -07:00
Kurt
390cf518b8 Revise 4->5 encode table (Half-width symbols)
Manually transferred from English Pt to English B

All revised indexes were the result in Black.

Differences that were not incorporated:
0EE=09794 ♂, not 09325 ⑭
0EF=09792 ♀, not 09326 ⑮
0F2=00215 ×, not 09319 ⑧
0F3=00247 ÷, not 09320 ⑨

Full-width and half-width symbols I think are related to full-width games, which English isn't. Probably has different handling for other language, plus it'd result in other duplicates of the half-width symbols.

Revise not-found char glyph to return ? instead of {terminator}, to match the game's behavior. Again, this might be language specific, but whatever.

Make the Convert char methods public, add a few unit tests.

Closes #3172

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-06-11 19:38:34 -07:00
Kurt
200bdbd553 Sanity check form prior to yield checks 2021-06-06 11:48:54 -07:00
Kurt
2c9b82824a Check static as-egg locations accurately
Thanks @sora10pls
2021-05-21 13:57:07 -07:00
Kurt
99f0978630 Extract random date to util 2021-05-18 16:58:53 -07:00
Kurt
44affe3caa Add flag unit tests, more xmldoc 2021-05-15 11:32:25 -07:00
Kurt
acdbda4e12 Split DateUtil from Util class 2021-05-14 16:46:48 -07:00
Kurt
3ac1882151 Move BinaryCodedDecimal conversions to separate class
Add unit tests, clarify names
2021-05-14 16:32:26 -07:00
Kurt
ef4857fa9f Improve perf of byte->hexstring parse
just use a stringbuilder
2021-05-10 16:07:25 -07:00
Kurt
01f75f8441 Add test for hex string (arbitrary length) convert 2021-05-09 23:33:54 -07:00
Kurt
ceede68861 Minor tweaks 2021-05-07 22:11:10 -07:00
Kurt
c67e01849a Extract 3ds chinese glyph remapping, only do on 3DS games
Optimize some functions within gen7zh for perf (no linq, no allocation)
2021-04-18 18:29:02 -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
012f6678ba Check for dual ability =>evo w/single ability capsule 2021-03-20 17:49:16 -07:00
Kurt
a71d7d1950 Handle gen3 mismatched ability
ty Breil --
https://projectpokemon.org/home/forums/topic/58665-makuhita-in-game-trade-bug-sapphire/
2021-03-20 11:22:56 -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
a235cae9e0 Add Move enum, similar to Species/Ability
dash,apostrophe,space => empty
Z Moves have P/S suffixed
10mil volt thunderbolt "TenM"
2021-01-09 13:07:29 -08:00
Kurt
118e1266a6 Swap lgpe sandshrew/vulpix version restrictions
Closes #3122 ty @FeralFalcon !
2021-01-05 17:30:14 -08:00
Kurt
4cdbb431d8 Fix bad test case data
New legality checks for Transfer Console Region permitted, and removing the inaccessible areas (R1 outskirts rockruff) resulted in these being flagged.

Mutate the data so it's now legal with the updated rules.
2021-01-01 10:51:50 -08:00
Kurt
c119f18af3 spec->species 2020-12-28 22:22:52 -08:00
Kurt
6502c9df33 Condense some expressions, extract static class 2020-12-28 21:42:54 -08:00
Kurt
cce4d80419 Update nuget packages 2020-12-26 09:28:00 -08:00
Kurt
7e4eb86e93 c#9 is not sugar 2020-12-22 21:24:41 -08:00
Kurt
997e0751f3 Minor clean
Handle remainder of c#9 sugar
Fix some spelling mistakes
2020-12-21 23:37:07 -08:00
Kurt
514b60b447 Merge type check with usage in if statements
if x is y with z property true, then :D
2020-12-21 22:33:48 -08:00
Kurt
63aa8dcd43 Bump langver to 9 for other subprojects 2020-12-21 19:12:24 -08:00
Kurt
62018cce1a Unify concepts with different names
AltForm & Form & Forme => Form
GenNumber & Generation => Generation

Extract out SpeciesForm interface, and re-add IGeneration

For those using PKHeX as a dependency, this should be a pretty straightforward manual replacement... GenNumber and AltForm should be quick find-replace`s.
2020-12-10 20:42:30 -08:00
Kurt
15823f6f31 Condense tests 2020-12-05 16:15:32 -08:00
Kurt
5e32e64ac8 Handle MANôA and FALCçN SPA->FRE Gen2 Trades
Transporter remaps certain locale specific chars depending on the source ROM's version.
Since VC can trade between languages, there are 2 Spanish in-game trades that have glyphs subject to remapping, if it's transferred from a French game.

If the spanish trade is transferred from a french game, it must match the mutated string.

ty @Lusamine & helpers :D
2020-11-29 18:17:15 -08:00
Kurt
81110b4231 Upgrade netcore build to NET 5.0
keep with the times, kids

handle some compiler messages
2020-11-14 08:20:48 -08:00
Kurt
df5ebd1f54 Minor clean
Resolve some messages
2020-11-11 21:01:41 -08:00
Kurt
b4c9e90c28 Enhance transparency in failed generator test 2020-11-02 13:03:08 -08:00
Kurt
b492d93f39 Re-add unavailable split evolution cases
Diff to compare binaries for split evo cases, diff output below:
025: Pikachu
08 00 53 00 1A 00 00 00 08 00 53 00 1A 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08 00 53 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
102: Exeggcute
08 00 55 00 67 00 00 00 08 00 55 00 67 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08 00 55 00 67 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
104: Cubone
04 00 00 00 69 00 00 1C 04 00 00 00 69 00 01 1C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
04 00 00 00 69 00 00 1C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
109: Koffing
04 00 00 00 6E 00 01 23 04 00 00 00 6E 00 00 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
04 00 00 00 6E 00 01 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
439: MimeJr
15 00 66 00 7A 00 00 00 15 00 66 00 7A 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
15 00 66 00 7A 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2020-10-24 21:32:48 -07:00
Kurt
1524093099 Revise g5 pid bit check for forced PID statics
Closes #3027

Roamers: Get PID generated externally
NPokemon: Get PID from a fixed value
Forced (Anti)Shiny: Get PID altered

Thanks @LegoFigure11 && Princess Emily (discord 4650) !
2020-10-12 11:04:29 -07:00
Kurt
b4508846a1 Add test case for eggmove tradeback conundrum 2020-10-04 12:22:33 -07:00
Kurt
7efaa5ab71 Minor clean
collapse some expressions
handle some compiler messages
2020-10-03 18:59:36 -07:00
Kurt
833789b1b9 Fix cxd antishiny method detection
Closes #3008 ty @Sephirona !

Do the tsv-psv compare as uint to remove the need for later casts to int
2020-10-03 09:29:26 -07:00
Kurt
fbf7a3658a Check species for static enc match
like all other IEncounterable types, before calling the match method, check species directly
2020-09-24 19:44:48 -07:00
Kurt
416f5fe183 Check Winning/Victory ribbons for gen3 origin based on encounter
Closes #2990 ty @Atrius97 !

Remove the `object Content` accessor only used for Mystery Gifts (used to trickle up the PKM object since the two ribbon interfaces weren't implemented on the IEncounterable). Just make PCD/PGT implement the ribbon interfaces and delegate the get/set to PKM directly.

Rewrite the national ribbon check for clarity
Optimize invalid/missing ribbon string replace to operate on the final string rather than do linq and replace each input. With this we make 1 temp string only, rather than 1-per-ribbon.

Replace hardcoded "Ribbon" strings to use a shared const string in a central spot.
2020-09-18 16:23:17 -07:00
soopercool101
1a1cfbda4a
Fix Hidden Power Power calculations (and add to UI) (#2989)
* Fix broken hidden power power calculation

* Fix broken Gen 2 Hidden Power calculation

* Add parentheses

* WIP UI

* Finalize UI, only show on gens 1-5

* Inline some logic to reduce allocations

* Add unit tests for both hidden power calculation cases

Co-authored-by: Kurt <kaphotics@gmail.com>
2020-09-14 20:06:11 -07:00
Kurt
e125424423 Refine zygarde encounter form checking logic
Closes #2984
ty atrius & matt via discord

Co-Authored-By: Atrius97 <39707481+Atrius97@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2020-09-13 15:45:15 -07:00
Kurt
2e6d1fce1f Flag non-Poké Ball XD teddiursa
Closes #2983 , nice catch @soopercool101 !

Co-Authored-By: soopercool101 <soopercoolstages@gmail.com>
2020-09-13 14:43:48 -07:00
Kurt
7fc8001806 Continued refactoring
EncounterTrade: don't init Location to -1; keep as default 0 and use that as the pivot for default met location. Move Fateful property to the sub-type that uses it (EncounterTrade4, for Ranch).
Move some EncounterStatic->PKM logic that is per-type to the associated type overloaded methods. Rearrange order of properties to be more consistent with interfaces
Gen3: Initialize some classes without using post-constructor setters. The `init` setter functionality coming in c#9 won't be usable as the net46 runtime/netstandard2 doesn't support it on current previews. Do it this way so we can explicity initialize some required properties rather than apply version on a second iteration.
2020-09-13 14:40:10 -07:00
Kurt
407c986c89 Update netcore target from 3.0 to 3.1
.NET 5 is in 2 months, might as well bump things to the current LTS
2020-09-09 18:27:12 -07:00
Kurt
7d817a7316 Update test case for g4 fr egg name 2020-08-26 13:36:13 -07:00
Kurt
a62324a5a1
Refactoring some IEncounterable-type'd object initialization and original-generation evo chain (#2974) 2020-08-21 16:35:49 -07:00
Kurt
993673f0de Minor clean
no functional change
2020-06-27 23:36:53 -05:00
Kurt
6a5bf02126 Add min levels for trades
Make PIDs readonly for trades
Clone FR/LG Lickitung (different min levels)
2020-03-13 21:39:35 -07:00
Kurt
1d5f929981 Fix shiny check behavior for XD nonshadows
XD compares the player TSV against the non-shadow members, which is unnecessary but does result in them being able to cause shiny skips.

Update the VerifyNPC method to remove tsv check, as it's just repeating the logic we've done in the lock generator.

Added a test method that can be stepped through; compare the team results manually since they aren't exposed for interaction.

Closes #2751 , big thanks to @ijuintekka for being so detailed in their investigation/report!

Co-Authored-By: ijuintekka <ijuintekka@users.noreply.github.com>
2020-03-11 19:18:58 -07:00
Kurt
7919beaddc Filter out duplicate moves 2020-03-03 18:23:00 -08:00
Kurt
522dbdbe32 Flute boost/decrease 3->4
Closes #2678 ty @Rayqo
dat level 1 wild pokemon 👍
2020-02-03 18:40:31 -08:00
Kurt
ecfcbbc4cb Verify full raid result with known seed 2020-01-23 00:11:07 -08:00
Kurt
a98ca2351d Don't SetValue to block if not exportable
blank saves do not have the type metadata for the blocks that are spoofed, nor do they have all blocks spoofed.

I suspect things might get more difficult as more value-blocks are identified, which would throw a wrench into things. We'll figure that out at that time :)

Add a test to ensure that the blank save can be created correctly

Closes #2644
2020-01-19 10:25:40 -08:00
Kurt
0cd9c47953 Make Relearn array for encounters readonly
No change em
2020-01-18 16:31:24 -08:00
Kurt
e3cafe5cd6 Relocate getsize to extension method
use sizeof for clarity, add test to ensure bool size is 1 byte (which is always true)
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/sizeof
2020-01-17 21:09:26 -08:00
Kurt
bd9ec72d98 Misc tweaks
Add more direct legality analysis constructors
evo count is >= 1
fix invalid test message
disallow gen2 moves if transferred from gen1
use ^1 instead of len-1 for netcore test project
2020-01-16 23:22:54 -08:00
Kurt
693a630882 Handle nullable field check
doesn't like interacting with FluentAssertions for null check, so just throw an exception
move fEntries out of loop, fieldinfo is same for all (EvolutionTree)
2020-01-12 18:12:31 -08:00
Kurt
525095d962 Update dependencies 2020-01-12 14:45:45 -08:00
Kurt
0dd4d1fe7a Remove unnecessary casts 2020-01-06 17:50:18 -08:00
Kurt
c14c3b14e8 Improve test fail message when invalid
Spits out the reasons why it was deemed invalid
2020-01-05 21:51:53 -08:00
Kurt
35c7195d77 Add custom int/uint parse tests
Correctly handle negative parsing for int by flipping sign at end
optimize out a compare char digit/hex check
2020-01-02 11:11:31 -08:00
Kurt
166f8d82e5 Misc clean
Refactor out some logic, make "en" literals reference one spot (where
appropriate)
2020-01-01 19:07:21 -08:00