Commit graph

266 commits

Author SHA1 Message Date
Kurt
3ee6070b98 Fix poketch write
1123c24b0c
had addressed the loading, however, it did not address the saving

update pkx to not create a new array every time IsPKM is called
(possibly a lot)
2018-05-13 20:35:09 -07:00
Kurt
857919bd28 Add basic plugin sys
reference PKHeX.Core, main window loads assemblies & initializes
providing an ISaveProvider and the menustrip control (to insert controls
into)

pretty rough but should allow for inserting external control buttons &
allowing it to edit the UI a little

example: https://github.com/kwsch/PKHeXPluginExample
feedback is appreciated
2018-05-13 12:49:29 -07:00
Kurt
99005d8fc0 Refactoring
more discards & simplifications
2018-05-12 12:28:48 -07:00
Kurt
e2f11edc43 Refactoring
discards, Array.Find over FirstOrDefault
2018-05-12 08:41:29 -07:00
Kurt
5a3c8f4147 Remove trailing whitespace 2018-05-12 08:41:29 -07:00
Kurt
e32495252f Set altform before gender
bb5622f5db (commitcomment-28951163)
2018-05-11 21:48:58 -07:00
Kurt
9c5814346b Add showdownset parse case template test 2018-05-11 21:44:09 -07:00
Kurt
bb5622f5db Fix greninja import
pass null forms thru the converter
Closes #1937
2018-05-11 21:09:39 -07:00
Kurt
4ae1b79ad5 Handle mimikyu totem export
Closes #1935
2018-05-11 17:44:27 -07:00
Kurt
f82e545ab0 Update gender handling
Closes #1934 , unrelated tho
2018-05-10 20:22:32 -07:00
Kurt
815705bc5e Fix gender handling
Closes #1933

if not allowed to be genderless, flag as invalid gender
only permit valid genders after genderless is ruled out
(both done by checking the low bit)
2018-05-10 18:53:23 -07:00
Kurt
16ed4353b2 More generator updates
Store 4g giratina held item for enc->pkm legality
revise usages of GetSaneGender
Rearrange some logic
Better handle impossible version encounters (gen4)

gen 1-5 done, stuck on 659 - bunnelby egg...?
2018-05-09 17:50:56 -07:00
Kurt
3e885a8440 Update forme parse
Closes #1931
2018-05-07 18:24:30 -07:00
Kurt
19a0560474 Misc cleanup
extend byte[]->pkm iterator for specifying start/stop
clean up some in main window
2018-05-06 22:24:25 -07:00
Kurt
7e9b5362d0 Simplify showdownset form handling
replace all dashes with spaces, and vice versa
Closes #1930
2018-05-06 18:46:51 -07:00
Kurt
5cb232d474 Sanity check some showdownset import values 2018-05-06 18:40:51 -07:00
Kurt
71970b3332 Add gen1/3 speciesID direct get/set
https://projectpokemon.org/home/forums/topic/45108-pkhex-suggestion/
2018-05-04 18:05:41 -07:00
Kurt
4b6ee3fbf5 Update 'sorter'
Adds IV count sorting
Adds Itemless & Illegal deleting
Adds Max level modding, item clearing. Handle egg cases sensitively.

remove final sortby for reversal case as the incremental integer
prevents further ordering.

Any suggestions? Keep in mind that some modifications can be done by the
Batch Editor scripts; smart deletions & sorts are highest value
additions ;)
2018-05-01 19:24:47 -07:00
Kurt
4c9177fcb3 Add sort force-reverse
hold control when triggering the sort
sneaky linq to reverse a sort by:
* re-doing the initial sort, then
* reversing the sorted pkm data by using a throwaway increment
* re-doing the final sort
2018-04-30 21:39:12 -07:00
Kurt
bbcbdd80a1 Update 'sorter' with more functionality
Nest item choices into separated groups (based on their overall
function).

Adds 3 more deletion options: eggs, untrained, or not-matching-savefile.
Adds 1 more modification option: Max Friendship of current handler
2018-04-30 17:32:23 -07:00
Kurt
daf093879b More generator updates
all the way up to nidorina

extract some reusable methods
exclude invalid headbutt encounters
use built in randomgender
2018-04-29 18:26:36 -07:00
Kurt
70992138e2 Misc encounter->pkm generating fixes
eggs for Gen1 must be generated in Gen2
gen1 wild encounter initial moves
gen4 abilities have 0 for single ability mons
2018-04-28 16:30:56 -07:00
Kurt
a11a44dde0 Add property set instead of discarding value
lul oops
2018-04-28 15:58:38 -07:00
Kurt
ea357cd57a Add GetRandomFeeling
fixes tests & transfers where an explicit range is not legal
2018-04-28 12:59:11 -07:00
Kurt
71faaee31c Refactor savefile tid/sid to int
can now use TrainerID editor control on a savefile... soon?
2018-04-28 11:06:58 -07:00
Kurt
5ad31ad0c9 Generate pkm qr better
Don't include nature/ability for pre-gen3, export held item string with
correct version context
(whatever for cxd)

Closes #1915
2018-04-27 18:24:07 -07:00
Kurt
f5c9873348 Update showdownset handling for gen2/3
Closes #1913 by detecting any required pkm format related to the item.
2018-04-25 18:45:31 -07:00
Kurt
3f6b1acc93 Add fixed gender checks for non-GBA/NDS games
Closes #1912 , genderless ~= fixed gender I guess; shouldn't get these
gender-errors unless it's manually tampered data/ShowdownSet

remove unnecessary code in:
* PKMEditor (>=255 is already covered by == 255 and the fact that gt is
always <= 255)
* VerifyGender (3 <= x <= 5) check is already early-returned via
PIDGender check above

Update IsGenderValid knowing that VC mons have a gennumber <= 2
2018-04-23 19:58:29 -07:00
Kurt
505877763b Update ownership sort
gen4 and below saves don't provide an accurate Version/Game; ignore the
version check if it is not a valid game ID.

secondary sort to current OT name so that same-named OT (ignoring case)
are immediately after the current save's pkms.
2018-04-23 08:25:32 -07:00
Kurt
9e874a0784 Add modify handling to 'sorter' dropdown
adds hatch all eggs in box(es, with shift)
2018-04-22 12:43:18 -07:00
Kurt
19e73a5f85 Generalize meowstic edge case
lang sensitive, account for no nickname as well
#1905
2018-04-22 09:53:52 -07:00
Archit Date
4dfcafc720 Fix Meowstic edge case (#1906)
Edge cases with `-F` as forms are already handled in the code
2018-04-22 09:11:09 -07:00
Kurt
ea227a8113 Extract OrderByTrainer
logic to order-group may be useful for later
2018-04-21 23:03:51 -07:00
Kurt
e2405346a4 Update usage sorting
sort friendship delta with high values to front
reference correct method for usage sort
2018-04-21 21:15:19 -07:00
Kurt
8135820e73 Fix gen3 showdownset import
applying details modifies pkm data, pk3 checks for validity when
determining if it is decrypted or not
#1904
2018-04-21 17:47:32 -07:00
Kurt
2ed003d668 Check legality parse before checking relearn result
closes #1904
2018-04-21 16:42:45 -07:00
Kurt
79f1c780f9 Update ownership sort for better not-mine grouping
After the current save's originated pkms, sort by OT name/gender/ID to
group them together rather than leaving them unsorted.
2018-04-21 16:32:47 -07:00
Kurt
e91cb806e5 Extract extension->prefer format method
fails for 'pkx' (returned 8 instead of 6); establish standard behavior
2018-04-21 14:38:18 -07:00
Kurt
f767b2db0f Differentiate WasEgg (any egg location) from bred
https://projectpokemon.org/home/forums/topic/44838-buggen5-egg/

WasEgg is used for other encounter based checks, so can't reduce the
logic usage
2018-04-17 18:54:38 -07:00
Kurt
6a93a7e435 Fix kor2 string truncation
Closes #1896 , thanks @Narithegreat !
2018-04-11 17:06:13 -07:00
Kurt
7c1f163140 Fix gen4 (and 3 by usage) ’ ' apostrophe -> data
’ is aliased to ' for cleaner display to user; there's no usages of this
method beside gen3/4 strings.

fix early truncation of gen3 strings (don't put terminator on prior
valid char)

https://projectpokemon.org/home/forums/topic/44777-some-little-bug-in-emerald-leafgreen-and-blue-vc/
Thanks cicciochiave!
2018-04-11 16:51:33 -07:00
Kurt
1f9f8c97f1 length check language & trash byte source
https://projectpokemon.org/home/forums/topic/44719-about-channel-jirachi/
future/invalid language values are out of range
fixes the symptom but not the root cause (permitting out of range
languages when generating a wc3->pk3).
2018-04-06 23:36:13 -07:00
Kurt
51612b8977 Add custom sort via passed func params 2018-04-06 21:33:25 -07:00
Kurt
2f57630b4a Clamp abilitynumber value
keep to 3 bitflags
1/2/H
2018-04-04 21:42:02 -07:00
Kurt
f56696bf5c expand sorting capability
can replace the sorting function in SaveFile with any of the other
behaviors (or can just get->sort->set BoxData)
2018-04-04 20:30:49 -07:00
Archit Date
d65652a34e Fix Showdown Imports for Nidoran (#1886)
Showdown Set isn't recognized because of the format `Nidoran-G (G)` where G is M/F
2018-04-04 18:30:54 -07:00
Kurt
bdb6b7a2f1 Add shiny indication for wc3 in mgdb search
https://projectpokemon.org/home/forums/topic/44675-about-event-database/

also fix some xml comments
2018-04-04 09:53:48 -07:00
Kurt
ba4c911566 Refactoring & finish eevee test case
generates a legal pk* for every possible encounter; there's likely other
scenarios and more roughness to smooth out, but seems legit for now
2018-03-31 20:37:36 -07:00
Kurt
32f9f806db Add other iencounterable->pkm generators
not tested
2018-03-31 00:43:41 -07:00
Kurt
2ea1fea5f5 Refactoring
add GameVersion to generation
fix generating pk2 eggs
relocate some logic
2018-03-29 21:00:38 -07:00