I also added comments where appropriate, because it took far too long to understand what was going on when reviewing the commit that fixed the original bug.
Rewrote showdown set exporting to be much clearer, added auto-fixing of
relearn moves when importing showdown set (applies suggested relearn
moves)
Simplified main form loading routine (from ~160 to ~25 by extracting
methods)
Closes#1236
pk4/bk4 only, obviously
side note, using static events is no-no, designer auto-removed them.
just manually reapply (as well to others that used it)
Label_Species already has a click event for showdown sets with a
modifierkey; add a default behavior which checks for pk1 and if so, sets
the catch rate to the current species.
Users shouldn't have to look up catch rate values or be responsible for
editing them; they are currently handled by the pk1 object. Setting a
species ID checks if the catch rate is within the species lineage, and
only updates it to the current species if the rate doesn't match any.
With this change, the user can force the catchrate to match the current
species (then change back to the evo form) instead of having to change
the species to a separate lineage that does not have the current (not
displayed) catch rate value.
Closes#1235
999 is true max, set suggested give count to -4 from max (or 1).
Apply giveAll's max value restriction to modifyAll
Prevent giveall/modifyall for PCItems/FreeSpace due to mixed item types.
Closes#1228Closes#1227
delete now interacts with the box manager, now clears from any box
viewer that is open
filtering to just boxes now filters out the external sav pkm
filtering sources now is done prior to any field filtering
Only if compiled in debug; bumps my searchables to 6 figures lol
bulk legality scan yielded one exception (bad CXD pidiv for starters)
bullk sav fetch yielded one exception (unknown type didn't define
SeenFlagOffsets)
encounterinvalid isegg no longer throws exceptions when parsing moves
dropping invalid file paths to main window are now ignored (downloads
from chrome can be manually deleted but still dragged from the downloads
bar)
add pidiv case for manaphy gift
set the usercontrol to inherit from whatever it is placed on; fixes the
clipping issue noted in the forums
Thanks english09, wejhvabewjty, & zkrxpdlf3!
immediately after dropping the file, move the mouse outside of the box
slots
DoDragDrop re-performs the drop event at the same coordinate as the
mouse; if the mouse isn't outside of the box area it'll do nothing, thus
the need to create a new event to fire.
Closes#1178
Track gen1/2 origin game as well as generation
fix pk2 gender setting (incorrect bitmask & wasn't set from tabs)
extend female gender check for gen2 to apply to GS encounters -- if met
location is missing, was traded to gen1 which clears gender.
batch editor needs more powerful variant which can check the base
properties as well; just use the older code from before the .NET
standard commit.
Closes#1158
CatchRateIsItem is always false, thus the catch rate was always
overwritten with the base species catch rate regardless of if the base
species was the encounter.
For species like Metapod who have different catch rates from their base
species, this would invalidate any Metapod capture. So all possible
catch rates are checked.
Instead of setting the catch rate to the base species catch rate, set it
to the current species. Allows user to set the exact catch rate by
toggling between a legendary and the target species...
exercise in deferred execution/state machine, only calculate possible
matches until a sufficiently valid match is obtained. Previous setup
would try to calculate the 'best match' and had band-aid workarounds in
cases where a subsequent check may determine it to be a false match.
There's still more ways to improve speed:
- precalculate relationships for Encounter Slots rather than iterating
over every area
- yielding individual slots instead of an entire area
- group non-egg wondercards by ID in a dict/hashtable for faster
retrieval
reworked some internals:
- EncounterMatch is always an IEncounterable instead of an object, for
easy pattern matching.
- Splitbreed checking is done per encounter and is stored in the
EncounterEgg result
- Encounter validation uses Encounter/Move/RelearnMove/Evolution to
whittle to the final encounter.
As a part of the encounter matching, a lazy peek is used to check if an
invalid encounter should be retained instead of discarded; if another
encounter has not been checked, it'll stop the invalid checks and move
on. If it is the last encounter, no other valid encounters exist so it
will keep the parse for the invalid encounter.
If no encounters are yielded, then there is no encountermatch. An
EncounterInvalid is created to store basic details, and the parse is
carried out.
Breaks some legality checking features for flagging invalid moves in
more detail, but those can be re-added in a separate check (if
splitbreed & any move invalid -> check for other split moves).
Should now be easier to follow the flow & maintain 😄
I recently noticed that some activation use TID/SID,
I will re-check past resources that have abnormal value(e.g.AzureFlute),
after researching BW2,Pt.
the special wallpaper values are +0x10 (ie 0x20, 0x21... instead of
0x10, 0x11) from the contiguous sequence of regular box wallpaper IDs
(anti cheat probing?).
Xor tweak allows for single invert method; use this invert with the base
implementation's method.
Range check for setting the box wallpaper (just in case). The underlying
error was fixed; the 255 val was reading from the wrong offset (now
fixed).
Thanks Scarfy!
https://projectpokemon.org/forums/files/file/1-pkhex/?do=findComment&comment=344
check requireslevelup during evolution validity check, not during tree
generation as movepool fetch treats the 'level' as the max possible
level it was at (not the level it was encountered).
fix dropping pkm from external source causing exception (final return
false caused it to proceed with regular dragdrop operation from source
slot).
#1163
move from validated to textchanged as the user expects the values to
live update
only use the value-cap on validation if the input is not associated with
another control's value
this is now consistent with the IV/EV updating stats
#1163
pkm editor, sav editor, menus, and a manager to glue the storage slots
together
decouples the pkm/sav editors from a static savefile reference.
improves dragdrop/click view/set/delete indication, hides unavailable
contextmenuitems, and fixes a few incorrect references. Box Subviewer
slots now have all the indication/events that the main save editor slots
have.
pls report behavior bugs 👍
Closes#1151 by extending functionality instead of limiting it :)
Users can now export Mystery Gifts from the database in either
MysteryGift files or converted PKM form regardless of current generation
no Nintendo 3DS => null => getPathRoot(null) => exception
provide a fake root if the folder does not exist (to ensure that the
buttons are created with an unavailable path).
Closes#1140
Properly handle egg hatch counters for generated mystery gifts, as well
as HT friendship for gen6+
fetch form specific (friendship doesn't change but abilities fetch
species specific data later, so just fetch once up front). Do not depend
on save file as SAV7 importing PGF may have different abilities
allocated
Pad buttons for folder popup
fix double Japanese/International error message for importing jpk1<->pk1
Closes#1137
allows loading of tab separated value text file "savpaths.txt" which can
also be used to 'favorite' locations (ie, the program checks for
duplicate paths and only adds the first).
folder availability checked on form creation
shortcut: press ctrl-F on main window
Thanks @sora10pls !
Closes#1114
Loads a template file (if it exists) instead of applying default
template info when a new save is loaded. No formats are hardcoded, as
ck3!=xk3!=pk3!=bk4
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
Closes#1090
Saving of the Battle Frontier symbols is clearing the flag
block2 ofs 0x40C = Navel Rock
block2 ofs 0x408 = symbols
bitconverter getbytes was fed an Int64 due to bit shifting ints and
uints. Forcibly cast to uint to keep only 32 bits -> intended behavior.
sneak in RNG readonly
Closes#1003
If the pkm has a bad checksum/sanity or is in a locked slot, it never
incremented the counter. Just increment the counter anyway and write the
msg to console.
Closes#1076
seems kinda lazy as I didn't bother tracking down the suspect that
modifies the save (presumably the hex seed values); those should load
correctly and not change any bytes.
* Fix gen3 abiltiy legality check
Seperate Ability (AbilityBit i.e top bit of IV32) and AbilityNumber
(PID)
Fix in-game trade Electrode's ability
* Fix function deal with "encountermatch is int"
Keep encountermatch as null after UpdateEncounterInfo
* Fix gen5-7 ability check
Consider ability capsule
gen5 personal table have HA, ability_count won't work
Some simplification and avoid duplicate invalid message
* Simplify ability check
Use bool? to mark 3 states
GameVersion CXD needs more info
* Temp fix gen3 in-game trade ability check
Lickitung have 2 regular ability at gen3, there is a AbilityBit and
AbilityNumber mismatch
Guess those ingame trade have static PID
* Change abilitybit to bool and revert change
revert change in UpdateEncounterChain.
let egg encounter / null encounter choose vs.Last().Species as before
* Update Chinese legality translation strings
* Replace the background with a frosty partially transparent image to
snap user attention to the hovered slot
* change cursor to hand symbol when over a draggable box slot
* remove duplicated resource references
* remove unused line in rtc3
use linq to simplify the operation of inserting the ticket key items to
the save file
set back the pouch to the temp sav when adding tickets instead of
waiting until the end
don't change control text (respect localization text)
wurmple index was calculated incorrectly
update main form EC reroll; now that legality checking (and gen1->7) is
implemented the legality indicator will alert the user to their error
instead.
Combo items are now localized automatically by specifying the game IDs
and using the gameinfo values. (odd style is to support eventual message
localization).
program title now indicates XD/C/Batrev instead of just SAV(generation)
* E-Reader berry improvement
Load from the savegame the name of the e-reader berry and show in the item list that name instead of enigma berry if there is any e-reader berry data stored
Also check Legality of the berry, as enigma berry is unrelead in generation 3, but if there is e-berry data if check if the e-berry name is from one of the released cards
* Fix Shedinja moves check in generation 3 format
* Update comments, e-berry code is based in Suloku work for the gen 3 wc-tool
* Move e-reader comunication with Legality class to Main.cs
Remove curly braces in GameInfo
* Undo all changes in SaveUtil.cs
Also updates lang translations for incorrect/missing strings
(ps: uncomment the line in main to copy the current localization strings
to clipboard for ez paste replace into notepad)
Move all sanitization operations from PK* and SAV* to PKX; add general
method for fetching a generation specific string
Changes the Text subform editor to show trash bytes when appropriate.
Special characters to be shown can be easily inserted in the future.
* Fix hgss safari zone encounters
* Add fishing slots at night (hgss)
* Fix Japanese Special Character (gen 4)
* Add gen4 ball with HA legality checking (gen7)
Males can pass the ball with HA females ONLY when they have the same
pokedex number
* Add safari ball with HA checking (gen7)
* Fix ball legality checking for shedninja
Poke Ball only
* Map Unicode Chinese characters to in-game chars
Chinese species names in sun/moon were remapped by GF.
* Add nickname legality check for east asia language
Can not give Chinese or Japanese kanji nickname to pkm.
* Remove hiding nickname textbox for chs/cht
Since remapping and legality checking are implemented, There will be no
strange character or misunderstanding.
Adds game selection subform for RSEFRLG/Memcard game selection
Backs up entire memory card instead of just gci when loading from
memcard
Reduce string usage (easier dialog translation if that ever happens)
Does the memory card store date last saved? Could be used to autodetect
the last saved game and load directly instead of selecting.
The internal data of GC games for purification for shadow pokemon does not have values from 0-non shadow to 100-total shadow, it have values sarting from the initial shadow hearth gauge to 0-non shadow.
Do not allow to resize memory cards nor create a new memory card from a gci files
If the MC contains multiple save files the program ask the user what game he want to edit
only species outside of the NohatchFromEgg is manaphy; if it's a
recognized encounter it's okay. Safer to check generally than having to
update explicitly if there's a mew egg (lol)
remove HGSS check for BugContest, simpler to express as cant be
BugContest without HGSS anyway (implied)
pull out strings from trainer7 (localization cantidate), identify common
operations (getBits from ListBox), use |= instead of +=
Fixes#1007Closes#1008 with a slightly different implementation of the validation
check; other fixes for legality incorporated. Thanks @javierhimura !
Note for the Electrode encounter: both PIDIVs should be method 1 (not
J/K) thus only one is kept in the array.
This only applies to Pickup/honey gather ability procs
179 is incremented if some value is >10000, which is immediately after
photos rated (119)
184 is incremented if GetSelectRankRoyal == 3 (after 159 and 137)
other pairs: 5,137
eh just check Savedata::IncRecord usages
Closes#976
subregion was set first, but changing the country caused it to reset the
subregion to 0/existing value.
thus, load country first then subregion (why not move 3DSReg first 👍
)