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
convert all dictionaries to char-byte instead of string (saves 50KB on
compressed dll, lul)
update OT string comparison for pre/post transfer specimens
Showing "TRAINER" for all languages isn't correct, just show a mapped
character
Closes#2049 , thanks @egzonqj & @WEERSOQUEER !
Closes#20454ac92b9418
had added it; assuming to undo lvl-1 => lvl for gen3/4.
Level Up, Learn Nincada Move, Evolve to Ninjask & spawn Shedinja, then
learn any Ninjask Moves. Gen3 reverses the spawn&learnNinjask steps,
which is handled separately
Thanks @XxPhoenix1996xX !
tfw they store full egg data there too -- show that in the sidebar
Tested on C & GS (english), assumedly works fine for other languages
(based on the disassembly?)
according to the disassembly it all makes more sense; a small block and
a large block are stored in RAM
util calc helps convert between contiguous section offset to a chunked
offset
eg: emerald daycare starts at large 0x3030, which converts to
chunk4@0x1B0
reduce pk3/ck3/xk3 logic, share AbilityBit property within _K3, and when
loading, type check (favored over hardcoding individual load cases)
pull some non-gui code from PKMEditor to core/etc for general data
fetching
Yeah forgot that extremely bad RNG rolls (0,0,0,0,0) leaves 510
remaining, and the last EV can't have that much
rework loop to be simpler & quicker by checking the last IV for validity
only
(don't bother keeping it unrolled
all usages besides fetching a 32bit random value should use rand.next
remove unnecessary do-while loop for calculating random EVs (always
returns 510 in total)
Closes#2040 , adds test cases:
invalid bulbasaur.wc3: hidden ability
invalid charmander.pcd: hidden ability
valid camerupt: gen3->4 unevolved mismatch
valid leafeon: pcd mismatch -> evolved now matching
should be much easier to maintain; methods are reused with less overall
nesting
reduce nesting (evo.RequiresLevelUp is checked twice, only check once
and handle path)
compact some methods
seal some classes
add a little xmldoc to exposed members
Encounter used to be used to determine if the original encounter was
valid; we now store the encounter object and checking is fast enough --
we don't really care to short-circuit individual verification steps
anymore.
This commit implements IsDaycareOccupied for generation 1 saves. The
byte which tracks if the daycare is occupied should normally only be
0x01 or 0x00, so I decided that all other values mean that the daycare
is probably corrupted and thus not occupied. SetDaycareOccupied is not
implemented, since I am not sure what other flags the game normally sets
in this scenario and daycare is read-only anyway.
The GUI displays the Pokemon's index to the right for some reason, but I
don't have saves to test this for other generations, so it might be
unrelated to this change.
gender: take top 4 bits of gr:
31 = 0x1F = 1
63 = 0x3F = 3
127 = 0x7F = 7
191 = 0xBF = 11
See the pattern? If we change the compares from >= to >, we -1. All
numbers match except for the 25/75 ratio pkm... which unveils the
problem.
Simplify the calc for these using the logic above, which fixes the error
and makes the code easier to read!
Thanks SystemError for assisting :)
easy modification which isn't 'random' resulting in a slightly higher
chance of retaining the current gender if possible. threshold values can
change genders (1f:7m), but is slicker overall
Checks.cs initially started out small, but over the years it has grown
to handle multiple types of checks. With all these checks next to
eachother, it's hard to see the overall groups. Splitting them up
(potentially further?) allows for more focused maintenance &
understanding.
Not sure if I'm happy with the overall bandaids used (checks no longer
done within LegalityAnalysis so variable repointing is excessively
used), but I'm happier the way it is now compared to the huge Checks.cs
push unsaved IVTotal/EVTotal stuff from prior commit
rework exposed types for evo chain
initial trim now uses much less linq
can probably redo the get initial chain to provide a species to break
on...
Add safari min flawless IVs to reroll (can expand if #2025 is required
for egg group15)
Use EV/IVTotal (faster, not linq array based)
Fix missing pumpkaboo form regression, Closes#2026
Relocate swapbits to appropriate class, unneeded in PKM.cs
Can't have species == 0 or invalid gameversion; check for
EncounterInvalid instead.
Egg chain is always valid (since it is not EncounterInvalid) thus always
provide the chain.
Since these 2 are the same, simplify the logic to be shared.
rearrange some parameters for easier flow
Rename "Flag" to "Method"; isn't used besides for indicating the evo
Method.
Remove some unnecessary duplicate checks
- always >=1 in chain at start
- mostEvolved already checked for > maxspeciesgen
continued simplification
core.cs is pretty much the following:
misc one-off junk
moveset fetch
encounter table fetch
evo chain fetch
might eventually move things around a bit further for cleanliness so
that misc meta junk is the only thing that remains in core.
#2015
Can't get a shiny female 1:7 f:m gender ratio transfer after the VC2
bank update; need to respect that when generating random moves for the
pkm by removing any gen2 evo chain data.
Rework box fetch in SaveFile to be a little more flexible, can now fetch
a single box
Hold control to... export all boxes :)
I wonder if there's a decorator that showdown skips when importing lines
that can help differentiate the boxes since there's the potential for
hundreds output (ie comments in a showdown set?) doubt it.
update handling that checked for this case to instead check for
equivalence to ability1 instead of 0
was generating a PGF with ability[1] = 0, which is not correct. Just fix
the binaries to behave and get rid of all the workarounds since future
tables don't have missing values.
Fixed gender PCD with dynamic PID needs to check gender validity (some
korean card had it)
Fixed wc3 generated force-hatching to unflag fateful for non-frlg and to
hatch on the designated game just in case
stuck on a PGF issue where ability doesn't match PID, need to revisit
that PID creation...
Card #: 0002 - がくえんさい×ポケモンプレゼント
bypass savefile language checks if no language set
fix gen2 static gift egg that is really a wild encounter -- egg flag was
set & not cleared -> no wild pkm, bad! Adds test case for this.
(probably isn't a better place to clear, enforces only once per
generation rather than on every yield/end of every static yield)
Closes#2004
no changes had been submitted since originally committed on 3/5/2015; 3y
of inactivity.
users can always place "lang_en" to replace the english translation with
their own GUI strings; not worth maintaining non-series language
support.
Although Pokémon Ruby, Sapphire, and Emerald include a location pointer
for "Mirage Island", any Wynaut caught here will simply display "Met on
Route 130" in their summary. This is because the player is technically
still on Route 130's map.
Can't get anything with that location ID as an egg or as wild
egg fetch returns array, need to add to the collection
force everything as readonly to prevent adds outside of the constructor
Closes#1988
Thanks @iiippppk !
fix b2w2 egg base levelup reference (not bw, b2w2!), doesn't really
matter much except for better indication (possibly?)
remove some unnecessary linq ToArray() calls
continue relocating code out of Core