Commit graph

563 commits

Author SHA1 Message Date
Kurt
99ebc47866 Extract TrainerName const to static class
Central location for where these values are defined.
2024-07-06 01:35:50 -05:00
Kurt
07a08fa328 Add some xmldoc 2024-06-29 10:55:01 -05:00
Kurt
496c66bd46 Rename box storage slot flag fetch
`IsSlotX` is a little ambiguous; `IsBoxSlotX` much better.
2024-06-29 10:39:59 -05:00
Kurt
6b51250f88 Misc tweaks
PK5-PKMEditor no longer sets Hidden Ability flag for Rotom under HaX -- only set if unique hidden ability.
Differentiate move source tagging for HOME, DexNav, and GB-Evolution
fix some comma spacing
2024-06-15 18:38:05 -05:00
Kurt
f6bcc8a216 Minor clean
StringBuilder.Append has some fancy interpolation handling in the latest NET8 so it's more clean than multiple append calls.
2024-06-15 00:57:44 -05:00
Kurt
0ffb256052 Add slot source legality checks
Useful for save files with misplaced data (you really have to be using the program weirdly to get these flagged).
Stuff like Eggs deposited in Daycare, non-fuseable species in the Fused slots, etc.

Allow HaX to view any slot, & Delete if Set is allowed
2024-06-15 00:14:49 -05:00
Kurt
67fc0d0885 Misc tweaks
Add Cap Pikachu const value updating for USUM, also set Magearna const for USUM (not only SM)
Remove `NotDistributed` property from WC3 as only CXD events used it, no longer WC3 type.
Delete ArrayUtil; move remaining methods into the StorageUtil class that used them for compressing/inserting bulk into boxes.
Add shiny wormhole flag
Extract byte array strings into spans, faster tests and less overhead.
2024-06-09 08:52:32 -05:00
Kurt
06b8ec03ae Allow startup to detect memory card single-sav
Closes #4296
2024-06-07 09:42:52 -05:00
Kurt
7d05e12c7f Misc tweaks
Fix pk6/7 pkmeditor export, now retaining status condition instead of wiping it
Abstract b2w2 key system to a save block; better documentation on its odd mechanics
Allow gen1-3 filename language/ver detect to work if the filename is ` `->`_` (discord attachments changing spaces to underscores); also revise canadian French emerald filename pattern
others: negligible perf/using standard library functions
2024-06-01 17:44:32 -05:00
Kurt
ca2bd3baf4 Minor clean
No functional change
2024-05-27 10:33:25 -05:00
Kurt
3811f8d114 Misc tweaks 2024-05-18 00:40:29 -05:00
Kurt
7b6abc0520 Reduce alloc for ot/nick by raw trash reads
Legality check now catches buffer overflow mons.
Now that I have each type exposing a trash length & charcount, should be easy to have some reusable trash byte measuring methods (see the old branch)
2024-05-12 14:46:58 -05:00
Kurt
08ed482555 Revise gender symbol remapping
Handles Nidoran's shenanigans as well as more clear method names
- Add normalization for PK7->PK8 (no more 0xE... usage for the gender symbols... maybe more chars?)
- Not sure if Gen3 gamecube encoding needs sanitizing. Who is transferring Nidoran to CXD? :)

Requires some silly usage of Language passing as arguments. Future improvements can be made to revise the half/full encoding determination when setting a string. Probably has issues since we're just doing a naive check without considering nicknames w/ special chars.

Closes #4174
2024-05-12 10:47:55 -05:00
Kurt
dcb23c7981 Allow adding/hiding extra properties in Report grid
#3933 3.
top level settings for Report

1. was already implemented with the file namer settings on dump

not sure how I want to do dragdrop-multi, but I did recently add a record type for `ConcatenatedEntitySet`...
2024-05-10 19:32:28 -05:00
Kurt
e0172b601c Allow randomizing IV32
Really shouldn't use it.
2024-05-10 19:30:01 -05:00
Kurt
bd4ea9656d Misc tweaks
Fix block editor GUI not showing named blocks (`Equals` is easily repointed...)
No functional change for the others, just reusing/cleaning irks.
2024-05-10 01:22:26 -05:00
Kurt
0f4024952e Minor clean
indexof -> contains
trailing space
some variable reuse
pcdata/boxdata less janky handling
2024-05-01 00:49:43 -05:00
Kurt
bb6e45db60 Refactor out legality settings, add more settings
Extract PP verifier
Add disabling of wordfilter for formats < 6
Add context-specific bypasses for nickname/handler checks
2024-04-26 14:33:03 -05:00
Kurt
093264bc24 Add IStringConverter, impl on PKM & SaveFile
use in trash editor to translate strings, from PKM instead of SAV.
Closes #4222
2024-04-23 00:57:17 -05:00
Kurt
1b294f7c97
Refactor: Split Gen1/2 string & pokelist conversion methods (#4251)
* Split Gen1/2 string & pokelist conversion methods

* Refactor pokelist to direct read/write, skip on save if blanked

* Add settings editor for SaveLanguage overrides
2024-04-22 14:42:22 -06:00
Kurt
2b4ecee899 Rename EggEncounter to IsEgg 2024-03-25 00:39:30 -05:00
Kurt
024bd85cc3 Minor tweaks
make PL6 use memory instead of byte[]
make GP1 use memory instead of byte[]
move IEncounterable properties higher to IEncounterTemplate
2024-03-24 20:12:33 -05:00
Kurt
95eb008125 Misc tweaks
no functional change
2024-03-20 09:42:28 -05:00
Kurt
2259551ace Event Diff: move version check closer to init
Sanity Check method checks the objects that expose the flagwork, which no longer is always a save file.
2024-03-17 13:55:27 -05:00
Kurt
7122c5c3f5 Fix database search returning empty w/ unfiltered
Closes #4211
Also fix box dump not creating folder and Surprise Trade block optionally existing in SV saves.
2024-03-11 13:00:08 -05:00
Jonathan Herbert
c651c6f6cd
Deduplicate Gen 6-8 PlayTime Logic (#4208)
Slightly overengineered but a fun experiment to de-duplicate some logic.
2024-03-10 08:50:32 -06:00
Kurt
3e25ed9d32 Show sv surprise trade slots in misc tab 2024-03-05 22:04:13 -06:00
Kurt
f32a1ddc7a Misc fixes
event flag editor gen5-7
rs/frlg/dp/hgss enc->pkm version choice
pb7 party stats loading
daycare slot now shows when present
remove unnecessary `GameVersion.Unknown`, use Invalid instead. Might be worth removing Invalid in favor of changing `Any=0` to `None=0`.
2024-03-05 09:42:20 -06:00
Kurt
fa80dac2ac
Refactoring: Rework saveblock to be Memory<byte> based (#4200) 2024-03-03 23:13:16 -06:00
Kurt
8da8f34896 Use TimeProvider.System instead of manual impl
Introduced in .NET 8; use it.
Remove unnecessary [Serializable] tags (binary/XML serialization are not used), will eventually be obsoleted by c# ;)
2024-02-23 20:37:29 -06:00
Kurt
034658b764 Remove extra Memory forcing
Closes #4133
Refactors most of the `Trade` methods
Fix default egg friendship to 120
Fix Version value exposed for Gen4 saves (and others)
2024-02-23 17:01:36 -06:00
Kurt
95fbf66a6e
Refactor: Gen3/4 Lead Encounters, property fixing (#4193)
In addition to the Method 1 (and other sibling PIDIV types) correlation, an encounter can only be triggered if the calls prior land on the Method {1} seed. The RNG community has dubbed these patterns as "Method J" (D/P/Pt), "Method K" (HG/SS), and "Method H" (Gen3, coined by yours truly). The basic gist of these is that they are pre-requisites, like the Shadow locks of Colosseum/XD. 

Rename/re-type a bunch of properties to get the codebase more in line with correct property names & more obvious underlying types.
2024-02-22 21:20:54 -06:00
Kurt
f99e4e54f3 Batch Editor: Combine simple & complex EC rand
Just pipe everything to the complicated EC pathway and allow it to select for biases. Swap input preferences to retain a proper EC for dudun/maus.
Closes #4179
2024-01-29 17:41:12 -08:00
Kurt
48646fd001 Batch edit: return error code on exception
#4177
2024-01-29 16:10:25 -08:00
Kurt
ab5fd54079 Narrow Dynamax Level compare for swsh den seeds
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=287889

Adjust Showdown import to only set these values to PK8.
2024-01-22 19:06:38 -08:00
Kurt
f2209ec7fd Add better handling for specific GO transfers
No formarg or bad EC evolution peek -> search for higher species rather than from the bottom.
2024-01-12 18:58:23 -08:00
Kurt
0ca20ff096 Reimplement applied Markings individual get/set
Closes #4156
Extracts to an interface, varied implementations in the appropriate PKM classes. No longer an abstract property inherited from the base `PKM` class.
2024-01-09 20:53:31 -08:00
Kurt
96aed1e3c5 Set default version ID for gen3 pkm templates
ur welcome matt
2024-01-08 19:56:51 -08:00
Kurt
d7473db6af Add plugin stub for notifying GUI language change 2024-01-08 19:56:04 -08:00
Kurt
8fa951bcd7 Refactoring
Catch_Rate => CatchRate
Make Location* classes public
Extract a few methods, make public
Merge EncounterUtil & EncounterUtil1
add xmldoc
add missing deferral for Nest8 templates
improve binlinker span fetch to a single read (-1)
2024-01-03 23:06:09 -08:00
Kurt
424cbcff21 Misc tweaks
ShowdownSet: Fix indentation, use explicit const
ItemStorage8BDSP: Rename GetAll->GetAllHeld to match others
EncounterLearn: Guard against >4 length enumerables, use explicit versions for S/V
EggMoves: Read u16[] directly rather than manually
SaveFinder: simplify expression
SAV_Database: extract func
SAV_Encounters: use RoM to match Moveset generator
2024-01-02 15:45:35 -08:00
Kurt
d25fab0e87 Change box dump to use a form
Closes #4122
2023-12-30 14:36:33 -08:00
Kurt
581d5158dc Pass ribbon temp struct byref
Quicker than creating defensive copies for each Parse call. Do the same for IV-set passing.
Not worth for binlinker as it's never passed multiple times / deref'd often.
2023-12-30 11:40:10 -08:00
Kurt
9897630b08 Fix off-by-1 for Hidden Power hover preview card 2023-12-29 10:07:37 -08:00
sora10pls
807b9031b1 Add more save block labels, Necrozma fusion move handling 2023-12-26 09:36:13 -05:00
Kurt
6d0b4f77e4 Fix Gen2 quick hidden power calc 2023-12-21 19:04:08 -08:00
Kurt
61d958e07a Fix blueberry raids & stellar showdown parse 2023-12-17 19:45:13 -08:00
Kurt
01c82e472e
Add support for Indigo Disk (#4111) 2023-12-17 16:41:15 -08:00
Jonathan Herbert
07cd05d1c1
Fix Some Missed Conversions To Collection Expressions (#4096) 2023-12-17 16:38:53 -08:00
Kurt
1fe2b4f29b ArgumentOutOfRangeException
Use the new NET8 API
2023-12-09 15:21:10 -08:00