Commit graph

205 commits

Author SHA1 Message Date
Kurt
86720b547b Add <=gen3 pouch giveall
Closes #1225
Resizes array if too long, allows random set or standard (sequential)
set.
2017-06-14 08:42:49 -07:00
Kurt
ffa7529e0f Misc database tweaks
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
2017-06-11 11:08:03 -07:00
Kurt
5117f3a5c9 cap entry of Yellow pikachu friendship
gen1 trainer editor, 0-255

https://projectpokemon.org/forums/forums/topic/40817-request-autoset-yellow-pikachu-friendship-to-255-if-user-inserts-number-higher-than-255/
2017-06-11 00:25:21 -07:00
Kurt
21ab0296f3 small optimizations
Add ccitt method to checksum an existing array
reduce linq usage (faster save retrieval)

misc4 line endings?
2017-06-11 00:23:04 -07:00
pokecal
753964c138 fix Gen4 Misc Resources
add missing FlyDst and use MetLocation string.
add TrainerCard flags to FlagEditor.
add Pt resources.

fix HoneyTree, the BlockOffset needed.
2017-06-11 03:20:55 +09:00
Kurt
8a1691eb91 Let pkmdb fetch from save backups
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)
2017-06-09 23:13:41 -07:00
pokecal
e85e155c65 add FRLG TrainerCard PokemonIcons
I don't know why Chimecho is listed at the very end.
2017-06-04 13:54:16 +09:00
pokecal
497f0c62b2 add BW2 FunfestMission controls
The entree level can display 9999 in game,
but fixed to 999 when it change.

MAX PassPowers require 9999 costs.
2017-06-03 14:35:24 +09:00
pokecal
c54cd30a3c add EventFlags resources BW2
resources about legendaries
2017-06-03 11:45:24 +09:00
Kurt
3eedf1a6d5 Run database search async
disable button while searching, prevents GUI locking up when searching a
large database.
2017-05-29 19:18:18 -07:00
Kurt
87e99bf183 Split reflection usage for winforms project
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
2017-05-28 14:49:36 -07:00
Kurt
858aa50689 Refactor encounter matching
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 😄
2017-05-27 21:17:57 -07:00
pokecal
32815d0c4b add BW2 KeySystem Unlock
I excepted first 8 keys(used for check selected value),
they are very easy to edit in game.
2017-05-27 19:32:19 +09:00
pokecal
0cae317770 add EventFlags resources BW
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.
2017-05-26 19:17:28 +09:00
Kurt
be80a6b9da Fix HGSS wallpaper get/set & editing
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
2017-05-23 21:38:15 -07:00
Kurt
11b2dc35d7 Refactor main form into smaller pieces
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 👍
2017-05-22 21:55:12 -07:00
pokecal
ea33a2cb77 add EventFlags resources HGSS
Fix DP for consistency.
(now all DP&HGSS flag/const position number is same as in game used)
Checked with HG. SS not checked. (Groudon flag unknown)
2017-05-19 11:21:27 +09:00
Kurt
46c0f4f30c Add exporting pkm/mg from mgdb
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
2017-05-18 18:10:58 -07:00
Kurt
a415ca78df Fix folder location fetch & x/c/bk# extension fetch
Closes #1149
2017-05-17 20:39:10 -07:00
sora10pls
c6c76c3983 Folder List enhancements 2017-05-17 21:25:48 -04:00
Kurt
de3b89c409 Tweak path loading
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
2017-05-16 21:44:02 -07:00
Kurt
f674d45854 Misc changes
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
2017-05-16 20:34:24 -07:00
Kurt
1659405dc4 Add quick folder open menu item
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 !
2017-05-16 16:27:43 -07:00
Kurt
2bfa98db09 Refactor dragdrop managing logic
Relocate class out of main form for reusability/less lines in main.cs
refactored to be a bit more oop
2017-05-16 08:56:13 -07:00
Kurt
404651774a Further simplifications
Gender color display was copypasted everywhere, now just call the gender
color method.
2017-05-13 12:51:33 -07:00
Kurt
5ec3521d48 More c#7 shorthand
outs & pattern matching, other simplifications
2017-05-13 10:20:25 -07:00
Kurt
bbdb21c626 Separate forms from clone check
Only really useful for unowns that have been RNG'd to have the same
PID...
2017-05-13 00:04:04 -07:00
pokecal
d134abcd4a add EventFlags resources DP
This resources include some flags, not all,
that be changed when defeated/captured in game,
but sufficient to repop.
2017-05-13 10:15:13 +09:00
Kurt
aeb90d262c Cleanup 2017-05-12 09:33:12 -07:00
Evan Dixon
52c4fbbe97 Converted PKHeX.Core to .Net Standard
Refactored and rearranged things as needed to allow the change
2017-05-11 23:34:18 -05:00
Kurt
83962419db Simplify trash editing load
Gen5 allows editing of the final terminator; just use the raw length as
the amount of trash byte entries to show.
2017-05-10 22:52:14 -07:00
Kurt
803ff951db Add IVs to database clone search hash
simplify expression of clone searching
2017-04-27 09:15:16 -07:00
Kurt
ece845cd17 Add item modify existing counts
Closes #1097
2017-04-25 21:18:14 -07:00
Kurt
7a508590a3 Update 170424
Updates wc7 event dbs
Fixes string raw copy for text editor
2017-04-23 21:44:12 -07:00
Kurt
4bf567c7b3 Add berryfix macro to gen3 RTC editor
arbitrary date set
2017-04-23 14:02:52 -07:00
Kurt
a9ff3aceaa Fix Navel Rock clearing issue
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
2017-04-23 12:07:45 -07:00
pokecal
748919bb71 fix G4 Miscs
for add DP stats
2017-04-23 23:55:29 +09:00
pokecal
c2f1fb4df6 add G4 BattleFrontier controls
Editable many values. It seems a batch button needs,
but little demand, I have not made it.
2017-04-22 21:40:02 +09:00
Kurt
5bf14642e5 Expand logging for invalid batch edits
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.
2017-04-20 21:04:51 -07:00
Kurt
5c96066b13 Slightly speed up database scrolling
no linq operations
still sluggish due to generating the sprites multiple times (not cached)
#1071
2017-04-20 20:52:08 -07:00
Kurt
36515b8178 Prevent moving boxes if any team slot is in box
Closes #1079
2017-04-19 20:54:49 -07:00
Kurt
757cf11f52 Database improvements
Reduce linq usage (toarray) and just use the actual index
Implement GetHashCode for Mystery Gifts to only add unique data arrays
#1071
2017-04-19 03:15:54 -07:00
Kurt
3fcf92c9ba Misc tweaks
add namespace using, reduce nesting slightly
no functional change
2017-04-17 23:34:02 -07:00
pokecal
0adbf85177 add Gen3(Em) BattleFrontiers
Controls for trainerCard icons, streaks.
2017-04-16 15:59:16 +09:00
pokecal
a4f43f2afd add Gen3 Badge
without RS
2017-04-16 15:58:07 +09:00
Kurt
abcd541266 Add party stat calc to report window 2017-04-15 14:38:43 -07:00
Kurt
8a8b43948b Improve visual interactivity with storage slots
* 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
2017-04-13 23:05:19 -07:00
Kurt
bbc6915114 Add RTC Editor for Gen3
FRLG doesn't have an RTC, so only permit the editor on RS & E.
2017-04-13 19:11:01 -07:00
Kurt
2f59710eee Refactoring
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)
2017-04-12 23:42:08 -07:00
pokecal
a336849519 add gen3(Em) FerryTicket control
Button that issue tickets may not be necessary.
2017-04-13 06:02:34 +09:00
Kurt
dbae1fb932 Tweak gameselect parameters
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)
2017-04-10 16:28:44 -07:00
Kurt
5d4e36ca9e Visual tweaks for texttrash editor
Border around flowlayoutpanels
Grow size of flowlayoutpanel if it is the only one being shown
misc textbox length fixes
2017-04-09 21:53:57 -07:00
Kurt
ad46176fd2 Misc trash text fixes 2017-04-09 20:07:24 -07:00
Kurt
471a90ced6 Fix trash editor on gen3
now spawns the correct amount of numericupdowns
2017-04-09 19:50:53 -07:00
Kurt
a01e3694be Cleanup
Reduce nesting
while loop if / continue checks at the end didn't do anything
(did the manual merge cause the entire file to get fudged?)
2017-04-09 14:18:45 -07:00
Kurt
f443a7d35a Merge branch 'master' into pokecal-patch-2 2017-04-09 14:07:56 -07:00
Kurt
691493cafe String editing refactor
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.
2017-04-09 14:06:50 -07:00
pokecal
7805d4a042 Poketch DotArtEdit
drag&drop will import file, click will edit directly.
2017-04-10 04:57:11 +09:00
pokecal
7d430387f8 add Gen4 MiscEditForm
there is now only a tab Poketch.
2017-04-08 18:20:16 +09:00
Kurt
d19ab6159f Refactor Honey Tree editing
Tucks the honey tree properties behind a class, brings the user closer
to raw data by allowing selection of any group/slot of the table.
2017-04-06 21:47:28 -07:00
suloku
1dc5831921 Added Honey Tree Editor for DP and Pt savegames. (#1029) 2017-04-06 17:39:36 -07:00
Kurt
65fab7542e Cap coins/bp for gen3
Closes #1022
2017-04-02 14:08:11 -07:00
Kurt
3ae6256459 Refactoring
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.
2017-04-02 13:42:42 -07:00
Kurt
a8ce39d310 Fix button anchors for event flag editor
Form can't be widened anyway; maybe in the future.
2017-04-02 11:34:37 -07:00
Kurt
5b204dfff6 Misc simplifications
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 +=
2017-03-31 01:12:49 -07:00
pokecal
2f149a539d Add Gen7 Mega unlock
This checkbox just unlock the MegaButton in battle.
I have tested wildPokemon battle, not checked about InternetBattle.
2017-03-31 03:21:05 +09:00
Kurt
7feb5a8451 Add Pickup item record
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
2017-03-29 00:58:19 -07:00
pokecal
f69e4a0c81 Add G7BattleTree Supers Unlock
Not checked for legality(e.g.MaxStreaks)
2017-03-27 11:04:25 +09:00
pokecal
dce4b839b1 Add controls of G7Stamp,BallThrow
Some function has already included in SAV7, but no controls?
Add function about BallThrow Flags.
2017-03-27 04:50:38 +09:00
Kurt
e779498aae Cap gen6 boxes unlocked at 30
Closes #975
Doesn't hide the 31st box from the editor, only prevents
adding&selecting 31 from the dropdown for unlocked count.
2017-03-23 18:17:22 -07:00
Kurt
9104dd5f98 Cleanup
Add gen5 hidden ability check for pkm that shouldn't have hidden ability
(wonder if there's any pkm that can be encountered in wild / grotto)

time to extract more strings
2017-03-22 19:43:31 -07:00
pokecal
5b85c4dfdc fix gen4dex forms
mismatch of formFlag and languageFlag also fixed.
full editing of DexUpgrade added.
DP,with SetToSavOption,some mons otherLangDexFlag will be edit.
2017-03-22 17:01:02 +09:00
Kurt
68fe715774 Add party data editing for batch editor
functions properly for games without a party (RS BOX) by checking if a
party exists
if there's ever a game that doesn't have a box, it'll work for that too
:P
2017-03-21 19:27:45 -07:00
pokecal
e3b501d2ee Upgrade with NationalDexMode (#960)
Just edit dex. Events unchanged.
2017-03-20 20:14:37 -07:00
Kurt
127d2c2aaa static analysis fixes
fixes the friend safari form checks (if else were chained incorrectly)
argumentorder of some unused sections (BV date, canlearnmachinemove)
2017-03-20 00:03:31 -07:00
Kurt
deac1724c7 Add gen4/5 event concatenated binaries
events now show up in the event browser too

pcd(4)/pgf(5) will be used for encounter matching by the legality check.
2017-03-19 16:19:59 -07:00
Kurt
a099d18c9c Alpha 3-5 legality checking
Incorporates files from #190
Skeleton added for future implementations; currently missing gifts,
encounter info, and the fine tuning that follows.
Basically sets up areas for future implementation... feel free to submit
pull requests filling in the EncounterStatic/EncounterTrade blocks with
the basic info. I'll probably focus on gen5->4->3 in terms of priority.

Encounter slots need to be marked up for encounter slot legality (yay
32bit RNG), and will be used for PIDIV detection too.

XD/C is not in this round of implementation. Pretty much every pkm 3-5
will show up as invalid until this round of dev is finished.
2017-03-18 16:50:34 -07:00
Kurt
7d77455b54 Don't set count MaxInputLength regardless of mode
Closes #941
2017-03-17 00:52:48 -07:00
Kurt
9da79379f8 Pokédex refactoring
Add ability to get SeenCount & CaughtCount
switch gen1/2/3 get/set to use int species (since that's all they end up
using), removes the need to create a pk6 template for setting the flag
via the dex editor.
2017-03-14 22:41:15 -07:00
Kurt
b98954e20b Add stamp value fetching, fashion info
lowest 4 bits are used for something else; stamps are bits 4-18
exposes wardrobe (fashion item list) as a tuple (IsOwned, IsNew)
reduce nesting in tr7, add comment on fashion bitflag setup, inb4
someone sets it the array to 01 and crossdresses ;)
2017-03-14 00:45:14 -07:00
Kurt
e5c516e828 Properly hide joyful tab
Now populates for emerald saves
2017-03-13 09:10:50 -07:00
pokecal
e5f10fe65e new value about pokeRefresh 2017-03-13 17:22:27 +09:00
pokecal
1e4c4b8f53 add tooltip for stats
tip for stats name(show long name), stats value(seconds, show how long it means)
2017-03-13 17:21:08 +09:00
Kurt
fe66a65464 Misc updates
Closes #860 by adding in prompt for Gen1 saves to determine if the save
originated from VC. Will disable Gen2 legality sources when checking pk1
files.

--

Fixes froslass/gallade evolution tree pruning movesets. For whatever
reason, the level argument of the Evolution is not 0 when using the
item; I manually edited the evos_sm.pkl binary to set the 2 evolutions
from [XX] -> 00.

Fixes gen1 ingame trades slipping through the getEncounter12 preference.
Gen2 has set TIDs, so check if TID is set.

Loosens checks for Gen7 trades (including prior transfers) as trading
between games clears the memory.

Add 3 more g7 trainer stat records too.

Thanks Holla!

--

Add getMoves(100) optimization as gen7 learnsets can grab 1->100, better
than looping over the range every time it's checked.
2017-03-12 16:36:23 -07:00
Kurt
ff2dc1356b Add more g7 trainer stats
A little bit of clarification provided for some
Thanks tastymeatball!
2017-03-11 10:40:55 -08:00
Kurt
08a7f818f2 Add 8 more g7 trainer stat records
Thanks tastymeatball & Holla!
2017-03-10 17:50:57 -08:00
Kurt
0715f133d2 Add misc info editor for gen3
Closes #193
If there's more offsets found, this would be the place to edit oddball
stats.

Also threw in BP/Coin (& Rival Name FRLG only) editing.
2017-03-09 19:38:57 -08:00
ReignOfComputer
13aa01ff99 Check for Null Event Constant Difference before Clipboard Export (#930)
Prevents ArgumentNullException.
2017-03-08 23:31:22 -08:00
Kurt
0a1a30eb5a Update 170308
Tweak batch editor behavior to show Any first (used by any pk* type),
sort alphabetically too. Highlights the propertytype text if the
property is not present for the type.
2017-03-08 00:16:34 -08:00
Kurt
baac850409 Gen4 dex fixes
Fix form1 offset for getter
move formNames into check (only fetch if forms exist for the dex
entries)
Add all forms to seen side when seen is toggled (behaves like gender)
2017-03-07 23:52:47 -08:00
Kurt
ea47d958ca Misc tweaks
Fix exceptions / insufficient behavior in pokedex4
change gen2 tutor name to be consistent with other gen variable names
replace gen2 trade checkresult with nothing as all properties are
already checked.
2017-03-07 23:41:05 -08:00
Kurt
4874c174d8 Add gen4 pokedex editor
Fixes the setDex implementation for gen4
why u have to be so weird gen4
hgss has 0x1C extra form flags in the first form array... unused?
2017-03-06 22:43:46 -08:00
Kurt
c1ab0699d3 Fix forme set
Don't think this matters but use the correct method.
2017-03-05 20:57:05 -08:00
Kurt
5ecf01e481 Add gen5 pokedex editor
Cloned and modified from XY's editor

might as well simplify the dex setting for gen5. / -> >>, % -> &
2017-03-05 17:34:30 -08:00
Kurt
664eb05b65 Update 170305
Update changelog
Throw in 2 more trainer stats, thanks tastymeatball!
2017-03-05 12:41:25 -08:00
Kurt
27e2888345 Add more g7 stats
30 in this batch :O
thanks tastymeatball!
2017-03-05 11:41:12 -08:00
Kurt
19600263bd Fix 'complete dex' macro seen bit setting
Only set if the gender allows for it
Could possibly check the enabled state instead but this is more obvious

Closes #772
2017-03-04 17:32:07 -08:00
Kurt
33359b1526 Add more g7 stats
Thanks tastymeatball!
2017-03-03 21:18:18 -08:00
Kurt
5c7ef42b54 Update reflection property fetching
Closes #919

Properties fetched would return PKM.cs properties (not declared in XK3
or PK3), such as Hidden Power Type.

The setter for Hidden Power type is unused everywhere, but was called
via reflection on transfer away from xk3/ck3 format. This caused IVs to
be tampered with in most cases.

By only fetching Declared properties (ie, within XK3.cs only), only the
'real' shared properties will be transferred. Extending this to the
batch editor, we can use this Declared-only filtering to grab more pkm
formats. While things are being updated, throw in pk1/pk2/bk4/ck3/xk3
formats to the dropdown.
2017-03-02 21:00:41 -08:00
pokecal
77dd8d1829 add Vivillon FormValue
This code will not change the value, even if the value is illegal.
2017-03-03 04:22:18 +09:00