* Handle some nullable cases
Refactor MysteryGift into a second abstract class (backed by a byte array, or fake data)
Make some classes have explicit constructors instead of { } initialization
* Handle bits more obviously without null
* Make SaveFile.BAK explicitly readonly again
* merge constructor methods to have readonly fields
* Inline some properties
* More nullable handling
* Rearrange box actions
define straightforward classes to not have any null properties
* Make extrabyte reference array immutable
* Move tooltip creation to designer
* Rearrange some logic to reduce nesting
* Cache generated fonts
* Split mystery gift album purpose
* Handle more tooltips
* Disallow null setters
* Don't capture RNG object, only type enum
* Unify learnset objects
Now have readonly properties which are never null
don't new() empty learnsets (>800 Learnset objects no longer created,
total of 2400 objects since we also new() a move & level array)
optimize g1/2 reader for early abort case
* Access rewrite
Initialize blocks in a separate object, and get via that object
removes a couple hundred "might be null" warnings since blocks are now readonly getters
some block references have been relocated, but interfaces should expose all that's needed
put HoF6 controls in a groupbox, and disable
* Readonly personal data
* IVs non nullable for mystery gift
* Explicitly initialize forced encounter moves
* Make shadow objects readonly & non-null
Put murkrow fix in binary data resource, instead of on startup
* Assign dex form fetch on constructor
Fixes legality parsing edge cases
also handle cxd parse for valid; exit before exception is thrown in FrameGenerator
* Remove unnecessary null checks
* Keep empty value until init
SetPouch sets the value to an actual one during load, but whatever
* Readonly team lock data
* Readonly locks
Put locked encounters at bottom (favor unlocked)
* Mail readonly data / offset
Rearrange some call flow and pass defaults
Add fake classes for SaveDataEditor mocking
Always party size, no need to check twice in stat editor
use a fake save file as initial data for savedata editor, and for
gamedata (wow i found a usage)
constrain eventwork editor to struct variable types (uint, int, etc),
thus preventing null assignment errors
Extract Species Name logic to SpeciesName
Extract Language logic to Language
Remove FormConverter wrapper for string[] fetch
Rearrange some logic to more appropriate locations, update access
modifiers / types
Move some pkm array methods to arrayutil, make generic
PKX.GetVCLanguage was a dupe of _K12.GuessedLanguage() so just expose
the method
PKX is now back to pkm data manip only
SetPINGA{S}(pk, criteria) -> pid,iv, nature, gender, ability (stats
future?)
memes aside, this is where criteria data is forced
Split N encounterstatic (has fixed PID and special flag) from
EncounterStaticPID
be explicit that the string is empty rather than possibly missing
disallow encrypted export for BK4 (they're not encrypted), removes type
check
simplify replaceall in showdownset (don't call ReplaceAll 4x, just get
valid chars and rebuild)
simplify get ribbon sprite name (precompute ToLower and appended values
Starter Pikachu & Eevee have different growth rates than their base
forms (seriously WHY?)
remove old api surface in PKX as a breaking change as adding the
parameter is necessary.
Check max case for level first, then iterate upwards (eliminates inner
if)
change wc* nature to sbyte (update comparisons, 0xFF too magic-y)
use Rand.Next(x) instead of (0, x)
some cards may permit being recieved on incorrect games
some wcxfulls permit games they shouldn't (tapu koko flags permit USUM
but games released after the distribution window)
lots of wcx lacking restrictions completely
tested flagging USUM rockruff & zeraora
might be worth discarding MysteryGiftVerifier and instead just using
unused fields for prior formats to supply the data.
all usages besides fetching a 32bit random value should use rand.next
remove unnecessary do-while loop for calculating random EVs (always
returns 510 in total)
Closes#2040 , adds test cases:
invalid bulbasaur.wc3: hidden ability
invalid charmander.pcd: hidden ability
valid camerupt: gen3->4 unevolved mismatch
valid leafeon: pcd mismatch -> evolved now matching
should be much easier to maintain; methods are reused with less overall
nesting
Checks.cs initially started out small, but over the years it has grown
to handle multiple types of checks. With all these checks next to
eachother, it's hard to see the overall groups. Splitting them up
(potentially further?) allows for more focused maintenance &
understanding.
Not sure if I'm happy with the overall bandaids used (checks no longer
done within LegalityAnalysis so variable repointing is excessively
used), but I'm happier the way it is now compared to the huge Checks.cs
pgf/wc6/wc7 received on future game -> random version
could eventually be replaced with a get-sane-version which checks if
OriginGame == 0.
fix wc3 random RS giving E (R+1=E)
If one wanted to extend ConvertToPKM to other IEncounterables, this
would be the provided obj containing the receiver's info
allows pkm gen without a savefile, which is nice?
Gen5 does not follow the same convention, 0 = non, 1 = rnd, 2 = always;
not gonna bother updating for just that one
bool? occupies 2 bytes; enum:byte is 1 byte.
should probably move validity checking logic into the IEncounterable
objects instead...
indicates met location for transferred mons
most gen1/2 encounters won't show values due to the location not being
stored respective to the string tables (anyone wanna do a location remap
after initial load?)
don't bother converting to pkm then generating the sprite off that; use
the overload with int/bool
removes sav/pkm dependency for generating gift descriptions, and
standardizes the names a little. maybe a PKMBase interface would be
useful...
species added requires the 'latest personal table' reference to be
USUM's; the other referencs for .SM are fine as there's no possibility
to have a species ID high enough for it to matter.
Add global link mission stats (thanks Holla!)
remove some ToArray() linq in favor of direct copies
Relocate encounter suggestion logic to separate class
Closes#1396, addresses other edge cases like entree-non HA & happiny
egg.
remove legality check's use of reflection which checked individual
properties; add interfaces to interact with the ribbons of each PKM
type. With this, every ribbon attribute is accessible via its
corresponding interface (cast)
will have to add checks for individual interfaces as per #1250
I didn't feel like adding much documentation, is pretty straightforward.
Cast a pkm object to the desired ribbon set; if not null, can access
ribbons regardless of pkm format.
Properly handle egg hatch counters for generated mystery gifts, as well
as HT friendship for gen6+
fetch form specific (friendship doesn't change but abilities fetch
species specific data later, so just fetch once up front). Do not depend
on save file as SAV7 importing PGF may have different abilities
allocated
Pad buttons for folder popup
fix double Japanese/International error message for importing jpk1<->pk1