use 'u' to denote uint values, so that less IL ops are required
~(21->17) in the case of IVs
no functional change, just a fun exercise looking at generated IL and
finding ways to use less ops
hide setters for LegalInfo outside assembly (shouldn't overwrite the
stored values)
update GenNumber to Gen* if appropriate; GenNumber checks for first Gen*
to match, is a little more explicit and quicker than calling twice when
checking a range
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
disable GeneratePKMs from throwing an exception (it's a testing flag,
not to leak out if someone wants a debug dll I guess)
expose FixedGenderFromBiGender
expose ribbon interfaces
still isn't close enough, but removes the usage of decimals for cp calc.
redd.it/ahac9i
CP calc doesn't flag anything I have that is legal, but the calc is
still off by 2 bits at most... whyyyy? Even the same code run in cpp
results in the same inaccuracy? Maybe this is some arm64 difference?
sav1: assign personal table based on (detected/provided) version
catchrate editor: allow to use savefile personal
remove gb era prompt whenever gb/blank loaded; have it as a setting (can
be overridden for VC now). keep allowgbera as autodetect
personaltable: track format for debugging purposes/info
update translations
showdownset: contains char instead of string
gameinfo: static readonly array instead of redefining new on update
legality: order of operation / value reuse / simplification / comments
pkx: compare char instead of single character string
header/footer: move assignment into method as an out instead of ref
24 bytes per object -> 16 bytes
2,624 objects are made for legality checking; reduces from 73KB to 41KB
removing unnecessary clone recreation -> count from 2624 -> 414 (41KB to
6.6KB)
yay 10x reduction; not huge in the big picture but a fun exercise
reducing allocations, increasing clarity by removing some magic numbers
probably can rewrite some of the evo loading/checking for even less, but
good for now.
All IVs are flagged in LGPE even if they're perfect :(
Might have to revisit this for future games and if LGPE transfer out and
maintain these bad flags (this is bad for inspecting parents before
breeding).
Closes#2229 , thanks @SteelPhase (report) and @sora10pls (verified)!
remove linq for characteristic calc (get max IV) and others
remove some reliance on new[] for iv/ev
pk5 replace bitmagic with property get->set copy for cleanliness
the ereader mons are nature/gender locked too, so unroll a little prior
to rechecking the overall team (with ereader mon included). Have to do
it this way as a lock can pop if the ereader data matches a prior spread
before the prior teammate can be generated.
how did this get forgotten so easily lol
added legality check; eggs can't participate in pokestar studio.
not editable from GUI, use ExtraBytes editor.
Re-add 0x86 (array was copied from pk4?) and reorder/comment
Other games may vary the flawless IV count so best to have consistent
declarations
(the vc transfer encounter has 5 or 3 depending if it's a mew/celebi)
maximum is always 3; sometimes we know the max size so specify.
bcl has default size = 0, which then resizes to 4 on first addition
wow such optimization
expand string array check to cast and check against length; batch editor
Nature>=25 causes problems in hover tooltips. Previous commit fixed for
pb7 stat calcs for invalid natures, pretty sure the actual game is
exploitable for stat calcs and invalid natures (bad access), but isn't
exploitable as it's only used to retrieve an enum to switch against.
Closes#2167
Based off sub_71001D16A0 with shortcut modifications:
* code marks new entries for evolution processing later using the low
bit (hence the << 1); in save files I can't see any bits set, but I
can't see anywhere in the code that DOESNT set this bit. Thus the
assumption of post-processing.
As noted in gameplay, a new capture doesn't set Min and Max; it only
sets it if it is above the usual sizing values.
Megas apparently don't set until seen in battle, so don't worry about
setting the other forme based indexes.
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.
Derived from WC7 with minor alterations (dynamic OT/Nickname which is
stored in the Full data). Since the 0x108 is not stored in the save
file, just keep the full data around.