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
reduce nesting (evo.RequiresLevelUp is checked twice, only check once
and handle path)
compact some methods
seal some classes
add a little xmldoc to exposed members
Encounter used to be used to determine if the original encounter was
valid; we now store the encounter object and checking is fast enough --
we don't really care to short-circuit individual verification steps
anymore.
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
push unsaved IVTotal/EVTotal stuff from prior commit
rework exposed types for evo chain
initial trim now uses much less linq
can probably redo the get initial chain to provide a species to break
on...
Add safari min flawless IVs to reroll (can expand if #2025 is required
for egg group15)
Use EV/IVTotal (faster, not linq array based)
Fix missing pumpkaboo form regression, Closes#2026
Relocate swapbits to appropriate class, unneeded in PKM.cs
Can't have species == 0 or invalid gameversion; check for
EncounterInvalid instead.
Egg chain is always valid (since it is not EncounterInvalid) thus always
provide the chain.
Since these 2 are the same, simplify the logic to be shared.
rearrange some parameters for easier flow
Rename "Flag" to "Method"; isn't used besides for indicating the evo
Method.
Remove some unnecessary duplicate checks
- always >=1 in chain at start
- mostEvolved already checked for > maxspeciesgen
continued simplification
core.cs is pretty much the following:
misc one-off junk
moveset fetch
encounter table fetch
evo chain fetch
might eventually move things around a bit further for cleanliness so
that misc meta junk is the only thing that remains in core.
#2015
Can't get a shiny female 1:7 f:m gender ratio transfer after the VC2
bank update; need to respect that when generating random moves for the
pkm by removing any gen2 evo chain data.
update handling that checked for this case to instead check for
equivalence to ability1 instead of 0
was generating a PGF with ability[1] = 0, which is not correct. Just fix
the binaries to behave and get rid of all the workarounds since future
tables don't have missing values.