amount of pkm obj classes is pretty high, move the static utility
classes to another folder
breaks usage of pkm.ShowdownText; removes a dependency from PKM.
1123c24b0c
had addressed the loading, however, it did not address the saving
update pkx to not create a new array every time IsPKM is called
(possibly a lot)
extract common nature amp logic
generic ienumerable copyto which now returns count of elements copied
(maybe useful later). prior usages never tried to copy an enumerable
larger than the dest array (now length checked).
condense repeated logic, reduce overall operations
removes 1 array alloc for pkm encryption (shuffle clones the array, so
don't clone->clone)
removes 1 array alloc for pkm decryption (mutate encrypted array), be
aware that no current use cases input an encrypted region and expect the
reference to stay encrypted (always was a temp array).
remove duplicate bounds checks (early return & for loop)
GetBytes returns an array that is immediately discarded (GC pressure)
reduces overhead when loading large pkm collections from save files
(shaved off a couple seconds from my loading from 200+ bak saves)
could probably go faster with unsafe code to r/w ushort directly
then again im profiling under debug but i'd assume the improvements made
actually do improve speed for release builds
get language list now doesn't return new objects (or re-enumerate)
update rand usage to be inclusive for top bound, extend shuffle to
collections
remove unnecessary location overrides (already overriden in legal fetch)
Some species have the same unicode name in CHS and in CHT, so it will lose language info after converting from a in-game string to textbox (The game will use different fonts to distinguish them, bad GF)
This change will give CHT encoding a higher priorty if the pkm is in CHT, although it's possible to get CHS encoding default species name with CHT language ID.
Also fixed previous editing error
Closes#1540 , check for german only characters (gen1/2 can trade
between resulting in only OT being checkable). May be worth changing the
german check to return an int instead and check for other language
specific values.
extract pkm loading routines to smaller methods
reduce code duplication (rely on empty setters to ignore some calls)
should be much easier to understand the load/save process; the original
setup (pk6) was following the structure from 0x00-end, no point still
doing that as everything is now abstracted.
expose some useful IEnumerable methods (sorting / bin->pkm / copy) to
simplify some common operations
change some explicit arrays to IList for flexibility
remove old memecrypto bool (no longer necessary as XP is not supported)
rename some methods for more clarity
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 docs, move some data fetching to more appropriate class
remove old XP memecrypto support handling, was previously removed due to
net standard/core split
refactor memecrypto to handle multiple save sizes (USUM won't be the
same size save file); placeholder -1 for USUM size
More elegant handling for PKM without nicknames that have another
language species name; use that language ID instead of the pkm's
language ID. Since ToLower is not called, Ho-Oh from 3/4->6 now
transfers correctly.
fix gen3 encounterstatic eggs while still on gen3 games; only check the
egg location if still an egg
tighten up gen3 PIDIV compatibility checks, roamer glitch is fixed on
Emerald, and static encounters can't get method 2, and can only have
method 4 if under software emulation (RS Box) since the emu speed is
faaaaast 🚤 /s
http://bulbapedia.bulbagarden.net/wiki/Personality_value#Gender
For a Pokémon with a 50/50 male/female gender ratio, there is actually a
129/256 (50.390625%) chance for the Pokémon to be male and 127/256
(49.609375%) chance for the Pokémon to be female.
remove unnecessary parameter passing
#1163