Commit graph

262 commits

Author SHA1 Message Date
Kurt
20ae99f20d Finish PGF import 2015-12-25 14:07:17 -08:00
Kurt
374f8b0c83 Fix pk6 modifying and event handling logic
Memories won't be modified if the window has it disabled
Geolocations won't be modified if the Pokemon is an event Pokemon and is
so-far untraded.

Misc change: initializing boxes won't do unnecessary calcs.
2015-12-24 15:38:07 -08:00
Kurt
1bb07b5998 Add pgf skeleton & supports
Untested and not intended to be correct; just establishing the framework
for now.
2015-12-22 21:14:50 -08:00
Kurt
54bd371b50 Fix Showdown Export IVs 2015-12-20 10:55:47 -08:00
Kurt
308dfd2c24 Fix Showdown Export nicknames 2015-12-20 10:50:09 -08:00
Kurt
e4e662e2f2 Wonder Card update
Added preview display for all Wonder Cards; consistency in calling them
Wonder Cards.
2015-12-17 21:15:40 -08:00
Kurt
9e4f13d00d Reorganize & SAV Backup
Alt Click the Export SAV button.
Remove Tools Tab and transferred richtextbox outputs to Clipboard
exports.
2015-12-17 18:55:59 -08:00
Kaphotics
36a1550dd3 Add GameSyncID property
Thanks daxtsu for figuring out where this value is stored.

I plan on adding a "GameSync ID" related button in the Main window's SAV tabs.
2015-12-15 11:32:21 -08:00
Kurt
6101fd2123 CopyTo 2015-12-14 07:52:05 -08:00
Kurt
a51bf8389c Switch DataTable to int[][]
Little less silly.
2015-12-13 22:31:34 -08:00
Kurt
627f8e9c91 Remove unused array 2015-12-13 20:12:08 -08:00
Kurt
f015ca5a58 Add support for Forms
PKHeX & Showdown have to have parity with Form descriptions.
2015-12-09 19:57:53 -08:00
Kurt
62df1f473f Add BattleBoxData fetching 2015-12-09 19:40:08 -08:00
Kurt
9013dc0641 Tweak set IO
Return empty string instead of null
Recalculate current level (ignore corrupted stats)
2015-12-09 19:38:09 -08:00
Kurt
71f428cb69 Fix party accessing
Return current party member counts, no blanks
2015-12-09 19:18:39 -08:00
Kurt
f664bbe34f Write PK6 -> ShowdownSet export text 2015-12-09 19:16:50 -08:00
Kurt
dd910e6aa1 Tweak set override logic
If the method defines whether or not the sub should be called, that will
be used. Else, it will use the global setting.
2015-12-08 06:19:34 -08:00
Kurt
a4b5033b1e Mess with showdown exporting
Still nonfunctional, just have to write the encoder after relaying all
relevant information to the ShowdownSet
2015-12-07 21:46:48 -08:00
Kurt
fed7bacac3 Further cleanup of sprite assets
Reduces the size
2015-12-06 22:40:48 -08:00
Kaphotics
5b14b99872 WC6 change 0xFD IV
25+2*31 --> 2*31 (no 25)
2015-12-05 11:29:16 -08:00
Kurt
0ff7c5c152 Tweak IV generation further to account for 0xFD
Thanks Wanderer1391 for continuing the investigation!
2015-12-02 20:42:16 -08:00
Kurt
9ac9739e3e Tweak wc6 Random IV/PID
No longer gives 3 flawless IVs by default (now only for unbreedables);
should now behave even closer to what the game does.
2015-12-02 18:18:23 -08:00
Kurt
b4c4419015 Minor reorganization
CLeaned up some unnecessary parenthesis and simplified a few
expressions.
2015-12-01 23:08:16 -08:00
Kurt
c9dad89e11 Minor refactoring
Cleaned up a little bit of code and used more magic references.
2015-11-29 12:59:13 -08:00
Kurt
864c5bfd65 IVs and Fateful Encounter 2015-11-26 19:14:41 -08:00
Kurt
d2103a96b3 Update friendship/memory logic 2015-11-26 19:07:20 -08:00
Kurt
28390758e6 Implement wc6->pk6
"There's not enough data in the wondercard to faithfully create the
Pokémon!"
2015-11-26 07:49:44 -08:00
Kurt
0ac33a0639 Cleanup
Remove unnecessary logic.
2015-11-25 22:52:23 -08:00
Kurt
520af0ff55 Tweak stat retrieval logic 2015-11-25 22:46:16 -08:00
Kurt
c9d0db23ac Refactoring
Increase flexibility, use game personal data and structure to clearly
define what is going on.

Helps for implementing future games.
2015-11-25 22:20:09 -08:00
Kurt
8a2e7f3f74 Fix ternary null input
Having a ternary result in null creates a new param of []{ null },
instead of a true null.
2015-11-25 18:28:21 -08:00
Kaphotics
03a773f9bb Update WC6.cs
Initialize the default size of wc6 to 0x108
2015-11-25 18:08:54 -08:00
Kurt
7469150a02 Add Wondercard class 2015-11-22 13:38:16 -08:00
Kurt
19ff462fff Relocate PokePuff sav properties 2015-11-21 19:17:35 -08:00
Kurt
0064d1b497 Finish conversion of tr stats to SAV6 properties 2015-11-21 17:23:00 -08:00
Kurt
925699af0d Fix Trainer Info editor issues + bugfixes
Fixed reported bugs by Wanderer1391; found a bunch more as a side effect
of refactoring. Didn't like how so many values were hard coded so I
moved them all into the SAV6 class for easier r/w.

Re-enabled the Map Coordinate editing for non-ramsavs.
Updated the Map Coordinate display to the ingame coordinate style (using
NumericUpDowns), the coordinates for player.X and player.Y are divided
by 18 to get the current cell coordinates.
2015-11-20 22:02:15 -08:00
Kurt
b16ee55ed4 Assign an identifier for PK6 box/spot origin 2015-11-15 22:03:36 -08:00
Kurt
e4bc9e58f0 Box and Party properties for easy manipulation 2015-11-15 21:58:34 -08:00
Kurt
861881a37d Allow new instance of PK6 with no arguments 2015-11-15 21:56:00 -08:00
Kurt
c15cbe2870 Separated initialization bool for clear purpose
formInitialized is for closing the splash screen and showing the main
form.
fieldsInitialized is for setting up and not running updates until fields
are ready to be updated.

Arceus is now the initial species instead of language dependent
(Abomasnow).
2015-11-05 22:59:55 -08:00
Kurt
f67441cc89 Change byte to int
Allows it to be easier used by comboboxes; SelectedValue = (byte) does
not work.
Instead of having these cast to int whenever used, this way is more
preferable.
2015-10-27 17:58:53 -07:00
Kurt
76d6320b21 Simplify Friendship modification on set
Copies instead of highbounds.
Added supporting property in PK6 class.
2015-10-25 18:46:17 -07:00
Kurt
b1c0beff74 Send "chunk uninitialized detection" to class
yeah, get educated.
2015-10-24 16:52:25 -07:00
Kurt
101c0ad80f Minor bugfixes and cleanup
Added an Edited property for the save
blank slot (encrypted) is initialized once and can be used elsewhere
instead of constantly being recreated for no reason.
Fixed having 32 boxes for non-saves

All SAV editing forms now set the Edited flag when saving->close.
2015-10-24 16:33:44 -07:00
Kurt
1b514bc84f Move SAV box sorting to class 2015-10-24 12:31:29 -07:00
Kurt
775dc74287 Add trade friendship altering
Special cases allow friendship to be min/maxed anyway.
Added get/set for current friendship.
2015-10-24 11:57:07 -07:00
Kurt
25fca4964b Implement Trade logic when Set
Friendship and Affection are still not modified.
This may cause an issue with users who edit mons with their OT as
current handler and set friendship to 255, and the program makes the HT
with 0 friendship.

Can't really code in an alert as it'd be an annoyance for users. Gotta
think about it more :)
2015-10-24 11:29:03 -07:00
Kurt
f14a06a8bd Fix initialization for non-saves
When initializing with a zero-byte array (ie, starting the program and
just having blank data), the box/party have specific offsets.

Also got rid of the silly default switch cases which can just be
achieved earlier.
2015-10-24 09:52:02 -07:00
Kurt
661052bcf9 Refactoring of Save File Usage
Probably breaks a thing or two... time to get testing after this new
commit.

Wrapping the stored 'savefile' into an object which handles its use
allows a clearer separation of function and easier maintenance or future
updates.

May eventually move all get/sets for each form to allow property
fetching from any window, all logic handled within the class.
2015-10-23 20:13:32 -07:00
Kurt
d85936467e Add dex overriding from method call
A little shuffling of info too for ease of use.
2015-10-23 20:10:03 -07:00
Kurt
d5484d265b Implement global settings for on-set methods
This makes it so that the program can turn off these methods for every
instance unless the implemented method explicitly says otherwise.

Nullable boolzzz
2015-10-23 19:58:23 -07:00
Kurt
f348a27d0c Minor Bug fixes
Properly init offsets for inventory, and fix for genderless bit writing.

ORAS PokeDex editor does not save bools for the current entry when
closing the form; fix will be provided in a later commit.
2015-10-23 19:45:25 -07:00
Kurt
322fceb598 Add new class
Performs SAV operations to match the division already done for PK6.
2015-10-22 00:16:44 -07:00
Kurt
5057be999f Use defined size names 2015-10-21 22:59:22 -07:00
Kurt
f3374aee10 Add constant sizes for easy reference in code 2015-10-21 22:54:50 -07:00
Kurt
2e5f447dce Begin Implementing auto-modification when set
There's a few ways to finish implementing, as the program needs a way to
access Trainer Information on the fly. Quick and dirty way is to add new
global variables and set them when a save file is loaded, and a cleaner
way would be to move the 'savefile' variable into the sav class and do
all accessing from there.

Not yet decided on which. For now, the added items and code still do
nothing.
2015-10-19 19:08:56 -07:00
Kurt
4a1ee57c58 Improve Trading logic to include Banking 2015-10-18 18:33:38 -07:00
Kurt
8885e826a8 Fix sanity get offset 2015-10-13 18:55:05 -07:00
Kurt
bd8ff36e4b Add FileName fetching
Non language specific export, doesn't indicate egg either (the Nickname
will though!)
2015-10-12 17:05:34 -07:00
Kurt
b07359f8dd Add Trade Logic
I don't have TradeFriendshipAffection called by anything; or any of
these methods for that matter. Need to find a solution so that the user
can turn ON/OFF these types of modifications (and ensure that PKHeX
doesn't overwrite any user data).
2015-10-11 14:31:46 -07:00
Kurt
c8bab4d01c Add Generation attributes 2015-10-10 10:11:22 -07:00
Kurt
d9073cea98 Finish first iteration of Database & Search
Should surpass the search options of Pokécheck ;)

Quite easy to add extra search options too!
2015-10-07 20:19:34 -07:00
Kurt
7a77c9a0c0 Fix hidden power setting
Changed the accessing table
2015-10-04 02:11:19 -07:00
Kurt
4acfc8ed8b HPivs to 2d array 2015-10-04 17:20:18 -07:00
Kurt
d9dfda4df2 Replace ExpTable with uint array
Should simplify reading the code too.

#region to hide as it does not collapse normally in vs
2015-10-04 17:16:01 -07:00
Kurt
ded26dccb7 Remove unnecessary sub-classes
Structures was originally intended to be a big class but that'd be way
too messy.
2015-10-04 16:58:17 -07:00
Kurt
b9fdaf5109 Add save->bool (valid) & documentation 2015-10-04 16:56:47 -07:00
Kurt
3cf58aa010 Refactor (clean) shuffle method 2015-10-04 16:37:34 -07:00
Kurt
08969a979c Remove duplicate PK6 class
Has been redefined elsewhere and this instance was never used.
2015-10-03 08:01:48 -07:00
Kurt
2f38ceabab Fix trash & writing too much
OT names can have trash (eggs)

clearing HT by writing 12 would add another (to 13), so down to 11.
2015-09-29 07:44:13 -07:00
Kurt
076a8b369d Memory Editor uses pk6 object & bugfixes
Eggs cannot have memories, and have all edits disabled.
When a pk6 is saved, memories will be cleared if they should not be
present.

Fixed empty regions showing up with data
Fixed not being able to edit the first georegion for an untraded Pokemon

All lock-outs for editing should be correct now.
2015-09-28 21:11:03 -07:00
Kurt
f84f630a0d Fixed Party Stat writing and move cascade
'pkx' array was dummied out, resulting in the pk6 data not receiving the
party stats for writing.

Old bug: Having a Moveset with 1--4 (gap of two) would only remove one
of the blank move slots. Added method in the PK6 class for the (now
correct) fix-code; other fixes that are done when saving are now done in
separate methods as well.
2015-09-27 19:56:17 -07:00
Kurt
714dcf0489 Bitflag fixes 2015-09-24 19:48:55 -07:00
Kurt
4651781d87 Refresh current HP 2015-09-24 00:01:33 -07:00
Kurt
cced16dff4 Tidy up splash screen code
Clearer to just have a spinning thread instead of a timer.
2015-09-24 00:01:15 -07:00
Kurt
578aeb66b0 Fix stackoverflow
Yay recursion
2015-09-23 23:12:30 -07:00
Kurt
f331fb95c9 Minor refactoring
Moved QR text generation and tweaked a few property generations.
2015-09-23 23:02:26 -07:00
Kurt
67aa4753d6 Remove 1MB native support
Finally rid of this monster.

There still exists a bug when loading the pk6 data to tabs; still need
to fix that before it's stable.
2015-09-23 22:45:44 -07:00
Kurt
5b3623caa5 Remove use of Regex 2015-09-23 22:44:15 -07:00
Kurt
1879bdf4e3 Bitflag and usage fixes 2015-09-23 22:21:53 -07:00
Kurt
809148ed54 Refactoring round two
Introduced the fully editable PK6 class object, which is now used by
PKHeX's pk6 editor, as well as updated the Box Data Report. Readability
should be increased as no

Includes bug fixes:
Odaxis' report regarding Event Flag Editor
Showdown sets using "Trait" instead of "Ability" (old old style) now can
be read.
Imported showdown sets will not use the imported gender label (instead
uses the current style, same 'value')
2015-09-23 20:29:31 -07:00
Kurt
d4ea56cfd6 Heavy refactoring
Remove numerous inter-form dependencies, remove hard-coded offsets,
update a few spots to use better programming practices.

Should increase the readability of PKHeX's source code.
2015-09-20 20:34:09 -07:00
Kurt
9e64212a33 Revert e8b7b14 Commit
Needs to trim at the first index of a null terminator; not all empty
characters at the end.

Revenge of the Trash Bytes 😆
2015-09-18 16:33:37 -07:00
Kurt
f45ff5125c Fix Hidden Power Argument Usage
getHPType's input order needed to be updated -- the form usage was
changed via the characteristic fix commit.
2015-09-07 13:02:18 -07:00
Kurt
84586f2da9 Fix untrimmed showdown set 2015-09-04 18:50:14 -07:00
Kurt
e8b7b14efa Simplify \0 trimming 2015-08-08 21:44:52 -07:00
Kurt
22c63b4662 Use existing getSprite method
I thought I caught all these duplicate sprite fetch methods...
2015-08-06 20:50:26 -07:00
Kurt
6e9afc032e Undo https switch; the used apis don't use it
They worked just fine previously, just reverting.
2015-07-26 10:02:30 -07:00
Kurt
8dfa356a77 Fix form/nickname detection
Check for the form name in the inversion check
2015-07-21 18:17:10 -07:00
Spanti Nicola (RyDroid)
d656058524 Minor changes 2015-07-21 00:52:11 +02:00
Kurt
04229d1b9a Tweak set detection, added lineskip 2015-07-02 17:15:56 -07:00
Kurt
c1005945fd Sanitize apostrophes
King's Shield, King's Rock, Farfetch'd are notable examples of Showdown
strings differing from game default strings.
2015-06-13 00:30:45 -07:00
Kurt
bbf43d7e34 Refactoring and Showdown Bug Fix
Thanks Odaxis for reporting the Showdown import edge case with Mr. Mime!
2015-04-28 07:39:50 -07:00
Kurt
6b841cce2b Showdown import allow inverted nicknames
Thanks Favna for the edge case; simple implementation.
2015-04-16 23:03:01 -07:00
Kurt
a003db55b4 Import sets without items
Thanks Favna for bringing this to my attention!
http://projectpokemon.org/forums/showthread.php?45955
2015-04-14 17:50:16 -07:00
Kurt
8f2bc04a82 Fix hidden power string detection 2015-04-01 17:20:09 -07:00
Kurt
1aa77e2c9b Set Import Fixes & Trash Byte Fix
Set will now import gender and set nickname properly, also will now
import Showdown's stat descriptions.

Latest OT will now write only enough bytes and won't overwrite any
previous names, leading to trash bytes. Fun.
2015-03-18 20:45:06 -07:00
Kurt
0839f1b43c Finish implementing Showdown/Smogon paste importing
Some other minor tweaks to smooth the code.
2015-03-16 19:25:59 -07:00
Kurt
b906491d2f Refactoring, QR operations -> method 2015-03-13 19:59:51 -07:00
Kurt
b56edf1fec Continued Refactoring
Should be good now, a lot of silly stuff removed.
2015-03-11 21:44:12 -07:00