reduces loading time (don't have to allocate conversion arrays when
launching a gen7 game), and separates things to easier to manage
locations
reworks gen3 string encode/decode, no longer does 3->4->5 and 5->4->3;
instead goes straight to the end result without an intermediary format.
String sanitization should probably be broken up rather than reused, oh
well.
if conditional checks >=3, and all subsequent checks require Valid; add
this to the continue condition, and remove unnecessary comparisons
update some comments
PK2 doesn't like getting passed null for the byte[] parameter (rightly
so); don't depend on the src code order having the first constructor
being the one with the least arguments
fix it in pk1/2 so that the first constructor has the least args, anyway
remove Identifier param. 99% of the time, identifier is not provided,
resulting in a useless call
end result:
provide 'create new' and 'create from' constructors
For xd, getfinaldata returned a standard 344KB save, but then slapped it together with the inner savedata (0x28000 bytes) rather than using the GCI header. Don't use 'Data'
replace linq for Encrypt/Decrypt pkmdata fetch with faster length check
& optional resize (Span pls!?)
update pk6 comment for why affection is not cleared
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
no functional change, just rewrite some logic for better flow
fix subform popup count restriction (OwnedForms requires forms to be
added/removed manually; it doesn't automatically update)
sanitize box names when dumping boxes with separate folders (and bad box
names)
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
kinda slow, if a save has 900 mons, it has to check 900*900 which is
O(n^2), takes a few seconds
as opposed to just doing a hashset checking contains, would be O(n)
gotta do some fun stuff to make it faster
relocate program language enum
test that test case is proper
move getcompatible & gettemplate to core
remove catch rate changing for pk1 (catchrate editor now used instead)
replace Friendship control click to match shortcut description (used to
do nothing)
Remove some duplicate translation strings
fix gameselect string formatting
apparently systemsounds changed in a recent win10 update, Question is
now silent?? Exclamation is now the same as Asterisk (same as Beep?) Use
hand instead of Exclamation.
only use asterisk for notifications
Set default values to prevent any properties from being null
extract ClearNickname logic for hot path & reusable method
extract item conversion and move to appropriate logic class
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
remove double string replace (now less allocations); only add up values
if they're valid numbers.
builtin int.Parse throws with "1 2", but users can type stupid stuff
like that in the program (so we parse as 12).
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
Reuse some code in netutil for fetching stream (provide useragent for
all uses)
make sav4ranch use dynamicly read offsets to handle both variants
(quicker) #2248
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
Provide gen1/2 gb only version origin fetch for personal/moves ty
shadowmario (i assume this fixes things)
make listbox use ingame font for special characters
2f6e30bb3c (r31924945)
ty @pmarkive
Update handler after friendship update (CurrentHandler needs to update
afterwards)
Fix argument order (gender & nonpresent region data)
#2235 side effect
don't continue; instead seek forward
#2235 part 1, need surgery for part 2 (starter/locked prevents writing
data to the slot, but the slot can still be swapped)
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)!
kinda have to restrict these to 'valid' choices; should be enough of a
selection->result to be adequate for changing version
restart the program after changing the setting; won't take effect until
rebooted.
rearrange pkm version groups for clear break between
twins/siblings/family
clear pokelist for sav7b on non-exportable saves (prevents b1s1 from
showing markings)
rename horohoro (pgo) to non romaji lol, hide daycare/party tabs on
nonexportable save
remove some unnecessary operations
rewrite getallcontrolsoftype to remove ToList() and make generic
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
remove alloc on gc key advancement; advance keys in place
make g6 sizes an explicit comparison instead of new[].Contains
replace Any/Count with Array.Find calls (removes linq dependency from
savetype detection!)
footer is different for Korean saves; checked JP/EN and they use the
2006 date. Probably the same for everyone-but-KO.
Simplify check further, only check the 0x4.... sav as it's the first
region saved to. No point wasting time checking the other!
a previous commit alluded to general/storage being initialized in
different slots
e8644280a1
, gonna ignore what was stated as I can't find any proof with the few
tests I did today (all init on second, and found no backups from that
time)
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.
footer identifiers work just fine for any legitimately created save
file; I might have had the checksum check code for pokesav blank
savefiles
dropping support for bad-blanks in favor of a non-negligible speedup is
favorable :)
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)
settled on the class name; looks like it'll be roughly readable as a
mystery gift so inherit some properties. maybe can get r/w in the
mystery gift editor :)
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.
Didn't really feel like pulling out the shared structure get/set
operations, only the derived properties & overall fixer methods. Should
be easier to maintain if any handling updates.
Clean up pb7 unused stuff; removes ribbon logic since none are used.
c# 8.0 interface defaults can maybe pull out more logic (ex making
FixRelearn and relearn moves into an interface); multiple inheritance
can be useful as features are added/dropped between generations.
Make extrabytes a pkm property (don't mutate array pls)
reconfigure startup loading to only initialize after initial load of sav
& pkm (using blanks if not provided)
there's a value in trainer pokes that gets set to an unused pkm byte
this byte is fetched in the stat/cp calc, but is never used (param
unused)
plans for future? it's right next to friendship in trpoke7b, maybe there
might be another stat amp?
https://www.serebii.net/magikarpjump/trainerrank.shtml
stronger trainer => stronger monz /speculation
remove lockedslots, store & save all teamslots for sav7
differentiate locked slots from overwrite protected slots by emitting an
enum containing info about the slot
locked = can't be replaced, period.
starter/battleteam = can't be pasted over by bulk-pastes
can eventually show more specific sprite layers to denote party
indexes/team#/starter
2d array -> 1d
skip copy by cloning instead
eliminate %24 (number is 0-31) by duplicating 0-7 as 24-31
dropping a modulo, >1 bounds check, and a half loop unroll should be
less cpu cycles :)
Closes#2160 , use Batch Editor to modify slots; it's not worth GUI
presence as it's only saved for party format mons and is undocumented
for anything besides affliction flags