there's some "AHTB" files which contain the internal enum names; dump
out a few that seem useful
note they come from different tables, will need to figure out spacing &
if their order is absolute or uses that weird hash in front???
LGPE uses a list of pkm for boxes, and has pointers indicating where
each party member is at
need some logic for handling the sorting. Had suspected this a while
back so this pre-work came in handy (untested tho)
make eventflags offset ptr virtual, I might end up doing things
differently for event flags
One field added to indicate the GO species or whatever; the 891/892
meltan values match here. Might not be only for GO species translation,
might be for fetching models idk
* 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.
can't just re-call base.SetEventFlag with an adjusted flag ID since the
exception checks max.
just override the geteventflag method with a silly adjustment -- we
can't be sure if Block2 is immediately after Block2, so just adjust the
flag r/w to a different offset&flag when appropriate.
fixes r/s badgeflag get/set, oops, meant to modify FRLG's value in the
last commit.
was block2+0x64
8*((0xF80-0xEE0)+0x64) = 0x820
this highlights a critical flaw in event flag reading; it expects the
region to be contiguous in the savedata. it's not. that's super bad, and
event flag r/w for flags >1280 won't work until I work something out
#2128
it's still an imprecise thing, as ingame gifts aren't counted by either
release count isn't tracked, so the number should be roughly >= total
box+party count.
#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
Remove unused sav properties
Add translatable strings for autodetect SAV error suggestion
add speculated gg dex formtable
- no eevee forms
- increments 1 for pikachu since it already exists in table
- stops at mewtwo (no other formed-species available)
im currently setting up skeleton stuff for lgpe since we're <70 days
from release; by doing some pre-work like prior games I can get a good
idea of what needs to be adjusted prior to crunchtime!
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
Closes#2109
Program boots -> load extra locations rather than constantly fetching.
These files won't change location or presence (not an external drive).
just store the locations instead of constantly fetching, we already call
detect once when loading the form anyway.
extract final pkm manipulation logic from pkm editor
add xmldoc to boxmanipulator, add utility class for enum->manip fetching
fix xmldoc referencing removed enum member
relocate boxmanip overview logic to utility class
move SAVPaths file pointer to Main for reuse #2109 , will add to
autodetect in a later commit
open/save dialog with extra extensions: ignore ones already present
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
click ball sprite/label to cycle through legal balls
hold alt to use old behavior (set to pokeball)
hold shift to cycle through legal balls randomly (default behavior goes
poke->color->poke)
want to randomize setting balls? use the ApplyBallLegalRandom method at
the end :)
can't really get too fancy as only one color is stored in the personal
data, pkm aren't one single color.
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
move encountertype datasource providing to core
fix rerolling EC not updating characteristic
remove some repeat logic calls
relocate geolocation name fetch to separate class, add tests to ensure
functionality, add languageID->country/region fetch method
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
hides pid & ec in pkmeditor, gamesync & securevalue in saveditor
easier to share screenshots/stream without leaking identifying
information
fix auto-centering of pkmeditor subwindows when a savefile is detected
on program load(tab_otmisc isn't initialized and reads an incorrect
width)
egg sprites can be a little difficult to see what's underneath (glance
value)
make the new egg sprite method the new default; adds setting to revert
to old behavior
adds translation text for the mega rayq control from #2098
Closes#2095
split out unsketchable moves (struggle/chatter) to separate array
remove trailing spaces (auto fixed by my visual studio plugin), add
space before comment //
use trainerstat editor control in gen6 editor
fill in some details from the disassembly via setrecord usages
still slightly fuzzy on some:
fureai (based on usum idb name, similar logic)
soaring sky counts
looks like there's some other usages of the fields which were outside
the stat range, throwing an exception when loading to NumericUpDown,
added bypass logic
Thanks Holla!
calling Japanese ? X : Y on every single access is too excessive, just
compute one layout for each type whenever the first sav1 requires it.
could probably reduce the amount of properties by reusing others + shift
value; offsets are different due to string lengths being different
Logic is essentially identical; implement a base class and have the
generation specific structures implment the differences.
Reduce the verbosity a little
pk1 boxdata stores current level & current hp, which is only present in
pk2 party data.
if the user drops in pk2(boxdata), the transfer leaves 0 for both
values, which isn't correct.
detect stat_level to determine if values should be regenerated or not.
Thanks HaxAras for finding this :)
some cards may permit being recieved on incorrect games
some wcxfulls permit games they shouldn't (tapu koko flags permit USUM
but games released after the distribution window)
lots of wcx lacking restrictions completely
tested flagging USUM rockruff & zeraora
might be worth discarding MysteryGiftVerifier and instead just using
unused fields for prior formats to supply the data.
use some close synonyms (Reiniciar -> Borrar)
omit some words (potential / training) to keep layout compact
capitalize Equipado to match main window
Closes#2080
Remove unnecessary floor operation, don't fetch stat arrays for each
stat
Current HP is a box stat in pk1 format (offset 0x1), which isn't stored
in box pk2's. If the hp is zero, set it to the current HP.
Thanks HaxAras for the conversion tip!
utilize unchecked byte overflow
remove unnecessary zeroing -- t's immediately after the checksummed
region. even if it was included, chk += 0 is still 0.
extract GetFormDuration to method, remove unused GetIsCompatible
specialized variant (there's a generalized version in SAVUtil.cs,
IsPKMCompatible -- might do another round of WinForms->Core absorption
Closes#2065 Thanks @WEERSOQUEER !
Single evo species weren't getting flagged in the evolution verification
as they early returned (species matched), just move the sanity check
before that
orderby consumes the entire input enumerable in 'sorting' the list;
since we don't care about the order besides a yes/no, just manage the
yield order ourselves.
don't bother using this method more than the spot it's in; was a fun
exercise but other spots are set up for easier debugging
(overall flow is where->deferby->yield), could make things easier to
read but meh
original file path is not saved with the two listed properties, add
FileFolder and relcoate existing FilePath functions to that field
move some GetVariantSAV usages to the string method instead of byte[]
max IVs use flawless method directly with 6 IVs specified
move color blend/stat calc to ImageUtil
move potential string to commonedits
expose color properties for pkmeditor
don't constantly create/dispose brushes for drawing legal moves
bulbapedia is wrong, first 4 bytes are info values:
0x0 = dex order (alphabetical, numerical), unused in frlg
0x1 = mode (unused in frlg), regional vs national
0x2 = national magic rse (always set in frlg)
0x3 = national magic frlg (never set in rse)
refer to disassembly (pokefirered isn't too helpful, less developed.
just compare save files & edit ram!)
the other 2 values being set are the eventflag & event const, could use
the abstraction for those rather than direct ofs writes