not enough documentation to know what every single flag does; just be
lenient
I assume that flags being present XK3->PK3 will set fateful, so we could
remove that logic...
Exposing bitflags for editing isn't fun for the editor, so just ignore
it behind the fateful bool get/set.
fateful required for all xk3 origin
#2289
transfer level exp and current exp not being different enough, which
limits the amount of natures possible. Could handle the 100&<=2 cases
the same way, but keep the branches for faster cases.
fix bad test cases
Not version specific; I'm assuming the 00020003 PID is a result of
hacking the save file to change OT gender. Legitimate saves haven't
yielded the Hardy PID. Changing gender probably results in a bad
pointer, fetching the wrong value.
Closes#2290
Fresh day, fresh tests of the new code :)
Fix assert conditions
Add extra considerations
Detected clones should be skipped for PID/EC/TID checks -- should
probably detect this a different way rather than checking a computed
string (bool array of flags for the clone check results)
EvolutionSet was just an object that hides an array, with no logic
was planning to use the EvolutionSet to do the evolution checks, but
EvolutionTree was required to connect the evolution chains together
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
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.
* Rewrite tests with XUnit and .Net Core
* Add better "because" message
* Skipping test that was not ready & convert the fact to a theory
* Tweak casing
* Convert select date tests to theories
* Make the GetStringList load lock safer
Update comments / xmldoc
Add a savefile storage compressor (ie array[] with empty interstitials
-> list); return true if the compression moved anything (repopulate
views), and the count of occupied slots in the list.
Add saveblock base class; I haven't really liked how SAV6/7 do all the
logic; I'll still expose properties that will then point to a saveblock.
Cuts down clutter.
Add template Dex manipulator, with gen6/7 implementations
Speculate sequential gp/ge gameversion IDs
Unused after assignment, but if I rework the validation check to return the teamlock result instead of a bool I can spit out the Species-PID generated list as extra info. Helps identify the as-generated conditions if there are multiple teamlocks possible for an encounter (multiple shadow mons, seen vs unseen).
Now accounts for the shiny locks & associated restrictions, abusing the
recursion by setting & unsetting the required CPU Trainer's shiny value.
Repoint all test methods to use the new obj methods
A lot of internal information is nice to have saved; create a copy of
the static class's logic and pepper in some state variables (Required
CPU Shiny Value) to account for the weird edge cases.
Code is essentially the same as the static methods, except for more
fleshed out logic in the AllLock interrupt checking and the eventual
Trainer checks.
Now gets count=2 tests working
yield return new SeedFrame { FrameID = ctr + (l.Seen ? 5 : 7), PID = pid
};
used to be ctr + 6, needs to alternate even-odd
all 2 lock cases pass, but didn't make lock3's pass. Something else is
still amiss :)
break out some classes for the solidified lock objects
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)
More languages than Italian have a rule-breaking name. Rework checks a
bit
Flag eggs more accurately
Update force hatch to move Link Trade met location to Egg Location
fix Ho-oh -> Ho-Oh text strings (correctness is key!)
Thanks @ijuintekka ! Closes#2148
Will check later for commented out tests that should pass.
May end up turning on the first-shadow-lock check feature prior to
release.
Currently toggled off, can be optionally toggled on (I'm not sure that
it's perfect? Random save files have stuff flagged since they don't
match the lock; will have to investigate later)
commented out test calls = not working
will have to debug in more detail later; the first lock is always
working at least.
data sourced from
https://github.com/ijuintekka/Eligor/blob/master/Eligor/Spread.cs , not
sure if it's perfect.
can't cleanly condense deviating team appearances as double-shadow leads
can't be selectively encountered. didn't feel like modding lockfinder's
recursive algo to be smarter.
rearrange getmove with respect to tutors; verifycurrentmoves was getting
tutor moves in levelup
extract not-found hint fetch
Expose gen5 block objects (so I can play with saves in linqpad)
Move logical checks using encounter data out of Core.cs
might be possible to excise legality checking objects from
Legal/PKHeX.Core so that a 'slimmer' core can be made
location ID was originally added by:
afde4514e2 (diff-83a32d69355a64376bc77bd07e338a33R446)
I
have another save file that uses met location 110 (like this one) so I
assume it was originally a copypaste error from Sudowoodo.
Change Trade strings to not allocate separate empty arrays.
#2126
Receiving a lower leveled species from GSC will evolve it away from the
required species, ruling it unavailable.
Receiving a Machoke will evolve it, so can't reuse for Haunter trade
results in:
- precomputed GetTable() reference
- no casting when iterating for matches
- no db null checks, as they are initally Array.Empty<T>();
reduces noise a little & slightly faster
can now check individual strings / identifiers in a LegalityAnalysis
object by:
var la = new LegalityAnalysis(pkm);
var parse = la.Info.Parse;
if (parse.Any(z => ReferenceEquals(z.Comment, LegalityCheckStrings.X))
...
should be faster than doing string.Contains
V### names weren't enjoyable to work with; use similar verbose style as
the program message strings.
updating the translation files with the remapped variable names shortly
remap list: https://pastebin.com/jybkVDAK
0, [9,19] are set (didn't see 15), but there's also a switch case which
references all values 0-19.
these values are used by a 80 sbyte array (4*20) in the Resort.cro
remove usages of "goto case"
use shared class for pk1/2 setnotnicknamed
fix extendedeurope values (copypaste from extendedAmericas)
move ball out of verifiers, move nature/movetype with ball
could use concurrentdictionary but after reading some perf drawbacks vs
manual locks, just do it manually. regex checking is the real slow part,
whatever
add some comments to describe