Commit graph

430 commits

Author SHA1 Message Date
Kurt
b745d59552 Rearranging
group gen3 structures to their own folder
2018-07-07 21:47:29 -07:00
Kurt
0b1ae2ec67 Add pokeblock3 interaction
no gui but can use core with a rse save file
2018-07-07 21:31:41 -07:00
Kurt
4dcac24f34 Add roamer3 active/level editing 2018-07-07 21:31:07 -07:00
Kurt
ae04218c5f Update eventflagmax for e/frlg
globals.h defines as 288 bytes for RS, and 300 for E & FR respectively

verified event const vals for Emerald making sense
2018-07-07 18:03:52 -07:00
Kurt
d4c1093dd9 Add RS badge flags
make logic generic
2018-07-07 17:01:47 -07:00
Kurt
990eb73f8a Misc simplifications
recordmax is simplified
2018-07-07 15:38:11 -07:00
Kurt
e46aed4b0b Relocate bean logic to core 2018-07-07 15:37:47 -07:00
Kurt
e915cd170b Extract trainer stat to interface / usercontrol 2018-07-07 11:48:03 -07:00
Kurt
2e02ec9719 Refactoring
Move some logic out of saveditor/subs
2018-07-07 11:20:05 -07:00
Alexander Hoischen
517441a982 Implement IsDaycareOccupied for SAV1 (#2036)
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.
2018-06-29 16:18:42 -07:00
Kurt
d15acea6b4 Flag KOR on Battle Revolution savefiles
Closes #2013
2018-06-17 09:27:14 -07:00
Kurt
3a7a257a01 Add export current box to showdown pastes
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.
2018-06-16 21:56:16 -07:00
Kurt
cb5e1239ae Refactoring
Extract game value limits
Rearrange GameVersion util logic extensions
add better gameversion fetch for generator (equivalent to pkmeditor)
2018-06-15 16:00:28 -07:00
Kurt
4778c9c758 Fix RSBOX checksum
Closes #1995
clean up variable names
2018-06-11 09:12:41 -07:00
Kurt
c6765fd26b Remove ORAS arg
...
2018-06-10 14:07:36 -07:00
Kurt
19cb2cda2e Remove MAX giveRegular for ORAS
level 3 is the legitimate max
2018-06-10 12:27:53 -07:00
Kurt
75f4318335 Split S/MAX from base 1-3 levels
ORAS can unlock MAX & Full Recovery flags, add special handling for that
2018-06-10 11:28:20 -07:00
Kurt
29c610870e Rename opower6
match type
2018-06-10 11:03:14 -07:00
Kurt
26f45d44d0 Rework OPower editor
https://projectpokemon.org/home/forums/topic/45683-pkhex-made-odd-number-of-zygarde-cells-usm/?do=findComment&comment=232476

Thanks @sora10pls for documenting what each flag does
2018-06-09 21:04:34 -07:00
Kurt
79f0b3665f Differentiate C/XD cologne IDs
https://projectpokemon.org/home/forums/topic/45685-pokémon-xd-and-scent-bag/
Thanks Asia81!
2018-06-09 12:44:30 -07:00
Kurt
cb4761403a Relocate oras setopower data to sav6 2018-06-09 12:32:55 -07:00
Kurt
5475da05c3 entree forest updates
clamp species list based on savefile
fix form control index set
remove slot from list (avoid duplicates, there's 530 slots and both
games have more than that available).

Closes #1974
2018-05-28 12:49:41 -07:00
Kurt
4b8cb9b8fb Add entree forest editor & randomizer
ezpz

(clear trailing spaces from entree forest comments)
2018-05-28 08:26:52 -07:00
Kurt
730709b33b Add entree forest abstractions
make cryptarray public
2018-05-27 14:19:19 -07:00
Kurt
700ce00d8e Add setting of batrev boxname
unused in gui, no wallpapers
2018-05-23 16:30:22 -07:00
Kurt
199512a9f7 Add box name & repoint party offset
refresh box names on saveslot swap
rework saveslot list to be (name, slotIndex) of valid slots
2018-05-22 19:02:56 -07:00
Kurt
400774595e 0 indexed -> 1 indexed
fixes regression from 2 days ago

e216c38151 (diff-37bd5b548e2b340e5c38fd0961a3eb04L165)

Thanks @ReignOfComputer for pointing this out:
https://github.com/kwsch/PKHeX/pull/1956

(also, update GetSprite since slot is 1-30; box is now -1(and below) if
not originating from a box. Now matches the legality check side
2018-05-21 18:28:54 -07:00
Kurt
620d822fef Misc changes
swallow error for invalid filenames in saveutil -- don't bother
detecting those files.
on fail to getmoveset, return the current moves instead of null.
2018-05-21 17:02:48 -07:00
Kurt
e216c38151 Misc updates
Add GetShowdownSets text output methods
Add party/box overload methods for easier slot setting api
Protect locked slots when importing BoxData
Misc saveditor simplifications
Add wc3->pk3 test
2018-05-19 20:48:03 -07:00
Kurt
9fd5df6e99 Misc pbr ui fixes
remove todo comment
fix exception when refreshing slot coloring
update box when saveslot index changed, not validated.
update boxviewers when saveslot changes
2018-05-19 16:33:06 -07:00
Kurt
047272c2ba Add batrev party viewing/handling
ezpz

party 4 bytes at end:
pkm, 0 (b) party index (b), 0x8000 (be u16)

not sure if there's a better way to detect party count...
2018-05-19 14:42:21 -07:00
Kurt
d772a82953 Move batch editor logic to core
previous hurdle a year ago was propertyinfo fetching not looking at the
base class's properties; dig deeper for all properties to mimic existing
code for netframework

end result is batch editing now possible without gui
2018-05-17 22:43:07 -07:00
Kurt
51a4d8095d Handle jp OT string length copy
Closes #1949
was using international length (11) instead of (6)
2018-05-16 16:58:00 -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
7ce89f0e16 Fix frlg inventory encryptionkey offset
72af1f7880/include/global.h (L219)

0xAF8 is berry powder! Thanks HaiPhuong!
2018-05-11 19:55:40 -07:00
Kurt
232427d002 Rework slot interactivity a little
decentralize some logic, individual view providers now provide the
details rather than detecting from a huge array.

#1925
2018-05-05 08:07:22 -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
57c625d089 Add delete criteria method providing for box clear
Can opt to not delete a slot
2018-04-30 17:29:13 -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
15ce1acfdb update box manipulation
closes #1911 , changes end to be inclusive rather than exclusive. abuse
the optional to let it fill in the end caps.
2018-04-23 19:11:55 -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
488b5215a7 add optional sort param 2018-04-21 15:07:58 -07:00
Kurt
5d8ccf12d4 Fix kor playtime read
Closes #1888
Thanks @Bl4ckSh4rk !
2018-04-06 17:15:34 -07:00
Kurt
1122a3f21e Shift kor gs pokedex bitflag region
-0x20 yields a match for seen/caught

https://projectpokemon.org/home/forums/topic/44692-i-have-a-question-about-gen2-of-pkhex/

Thanks BLACKBIRD!
2018-04-05 17:00:55 -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
Kurt
2f30eb7c78 Fix rsbox checksum calc/write in blockinfo
F004-chk returned 32bits instead of 16
writing was writing to the head of the save file (lol)
2018-03-30 15:56:59 -07:00
Kurt
a0eb658ef2 Extract minimum trainer information requirements
If one wanted to extend ConvertToPKM to other IEncounterables, this
would be the provided obj containing the receiver's info

allows pkm gen without a savefile, which is nice?
2018-03-28 15:55:19 -07:00
Kurt
99a4c55579 Relocate some logic to core
party stats set when setting a slot to a save file
simplify set/delete slotchange duplicate logic
suggest better met locations beyond VC transfers
hatching a gen6 egg applies memories automatically
2018-03-25 19:05:49 -07:00
Kurt
828636856c Change coin cap to fixed 50000
#1746

https://projectpokemon.org/home/forums/topic/44503-bug-report-gen-4-coin-counts/
max is 50000
https://bulbapedia.bulbagarden.net/wiki/Coin_Case

The Coin Case can hold up to 9,999 coins in Generations I, II, and III,
and up to 50,000 coins in Generation IV.
2018-03-24 17:29:48 -07:00
Kurt
c229d5cef4 Add RS & FRLG mail offsets
was only emerald prior
Thansk @Bl4ckSh4rk !

https://projectpokemon.org/home/forums/topic/44433-bug-rubysapphire-mailbox/?do=findComment&comment=228885
2018-03-23 23:06:51 -07:00
Kurt
0d69e803e1 Add gen4/5 synthetic trade logic
was previously present for gen6 and gen7 only, resulting in eggs in
gen4/5 not getting link trade values applied. that's really all.

https://projectpokemon.org/home/forums/topic/44437-bug-eggs-transfer-for-gen-4-dppt-and-hgss/
2018-03-21 21:10:23 -07:00
Kurt
f103a84fbd add duc reading
i dont really want to add more than this, header/footer conversion can
be done separately.
2018-03-21 17:01:07 -07:00
Kurt
9bb4120ff9 add faster pkm slot presence check
instead of checking if the array is empty, only check PID and species
2018-03-18 16:22:21 -07:00
Kurt
88ce27f26b Add R/S roamer data offset
is different from emerald

Thanks TetsuyaGR!

https://projectpokemon.org/home/forums/topic/44407-bug-rubysapphire-roamer-bug/

(use concatall in encounters4)
2018-03-18 08:37:40 -07:00
Kurt
d1a789eeab Fix some pokedex4 behavior
https://projectpokemon.org/home/forums/topic/44347-gen-4-pokédex-forms-incorrectly-readwritten/
2018-03-16 17:54:47 -07:00
Kurt
102550174e Simplification
invalid/unknown usages were incorrectly interchangable; dex-sets were
looking at Unknown which was impossible for some cases.

only use GameVersion.Unknown as a temp placeholder for later resolution
by the user.
2018-03-11 18:07:48 -07:00
Kurt
22bde0af52 Fix incorrect variable reference
new SAV3() throws exception, no more!
2018-03-11 14:42:56 -07:00
Kurt
24982fe8c5 Misc simplifications 2018-02-28 21:05:50 -08:00
Kurt
934757eac1 Add Bank7 r/w 2018-02-24 13:03:32 -08:00
Kurt
f9002c6cc9 Add trashbyte copy for OT import on gen1/2
Closes #1849
NAME_LENGTH is 11 for both gens and the offsets don't vary between
languages, so it's a simple fetch.
2018-02-22 22:42:50 -08:00
Kurt
ee1196a57d Set playedtime accurately
closes #1847
override playtimestring if max time... better than nothing
2018-02-21 15:22:43 -08:00
Kurt
d20f14504e Refactoring
pull out BlockInfo logic, standardize common block checking
reduces array allocations
2018-02-19 11:33:37 -08:00
Matt
43d8f74342 Fix Swampert dex forms (#1839) 2018-02-16 16:30:34 -08:00
Kurt
f8bf3e400b Misc tweaks
Add bulkstorage SaveFile template
remove unused using
un-virtual box property (don't override behavior)
Split new-USUM island names (unused)
Remove island names from valid egg locations (thanks Davil !)

https://projectpokemon.org/home/forums/topic/43874-bug-met-location/?tab=comments#comment-227684
2018-02-15 17:05:45 -08:00
Kurt
d706d825a9 Handle legal pichu form values
Closes #1828 , thanks @SpiredMoth !

slightly optimize batrev key init
fix exception for pkm loading switching between gen3->4 saves
2018-02-10 17:43:00 -08:00
Kurt
07bd2412cb Add all deco unlock
#1819
not exposed via GUI
2018-02-07 18:29:45 -08:00
Kurt
af0e05f6af Fix sav editing from direct memcard saves
Thanks @sora10pls for finding this

(just use the existing MC data)
2018-02-06 20:33:32 -08:00
Kurt
d9d27a52b7 Refactoring
explode xorpad into more reusable ideas
2018-02-01 22:09:31 -08:00
Kurt
1ca9180e21
use SlotList view to dynamically show slots (#1798)
Closes #1795 by redoing the controls

Allows for a specified slot type & offset to be passed, can easily add extra slots by updating the GetExtraSlots extension method.
2018-01-30 18:52:55 -08:00
Kurt
834d115e3a Add extra slot fetch utility
fix resort offset fetch (+=4)
2018-01-29 20:15:51 -08:00
Kurt
e472bfe278 Refactoring
move slotchange to core
2018-01-29 17:52:21 -08:00
Kurt
9085dfd950 Allow backwards conversion on hax
works somewhat on drag&drop individual files, not guaranteed to work for
all pkm formats
https://i.imgur.com/v3i3ON9.png

Closes #1792
2018-01-28 22:47:03 -08:00
Kurt
eb505303bb Fix vc backups acting like gb era saves
ends with .dat only works if the real file ends with dat
load the filename data after stripping off the bak filename data
#1787
2018-01-28 00:03:49 -08:00
Kurt
4c93183575 Add jp vc gen2 sizes
so many so consistent
2018-01-25 18:30:09 -08:00
Kurt
2063cef3e4 Fix arrays not being cloned
don't use the existing data array silly -- i was paranoid long ago for a
reason
all other SAV clone methods don't return the Data array, only these
#1764 additional behavior noted
2018-01-18 14:05:34 -08:00
Kurt
b74bf7d499 Misc simplification
no functional change, just compute hash over array span instead
2018-01-15 17:51:33 -08:00
Kurt
06733d6e34 Refactoring
Split up c-gear skin bitmap, move generic handling to core
2018-01-13 21:31:02 -08:00
Kurt
6caefef181 Add cgb->psk & misc clarifications
Closes #1699
tested on black2 & white, skin isn't corrupt on game boot and appears
correctly

still don't like setpixel/System.Drawing reliance (maybe split logic to
CGearSkin & CGearSkinVisualizer) for PKHeX.Core compat
2018-01-13 16:32:57 -08:00
Kurt
659f2098a9 Fix sav4 coin read
#1746
2018-01-06 21:36:44 -08:00
Kurt
218c20d804 Add sav4 coin edits to misc4
closes #1746
2018-01-06 14:02:55 -08:00
Kurt
34188f275a misc perf improvements
reduce linq usage / reduce obj creation in tight loops
speed++
2017-12-29 10:40:00 -08:00
Kurt
a1f2f8708a Refactoring
pass identifier on cloning pkm
remove unnecessary ref for passing Data (not modifying array reference)
const some magic numbers
2017-12-27 16:36:24 -08:00
Kurt
61b65198f2 Allow box name editing on gen2 2017-12-27 15:52:29 -08:00
Kurt
1e388fb85a Add first unown seen on dex set
immediately after unown dex:

c2a7216d9b/wram.asm (L2714-L2722)

per discussion on forums:

https://projectpokemon.org/home/forums/topic/43179-bug-unown-sprite-glitched-in-pokédex-in-gen2/?tab=comments#comment-225342

expose some useful properties for the pkhex.core api (unlock all, unlock
individual, define which unown shows up)
2017-12-27 09:56:04 -08:00
Kurt
3445b46526 Remove unnecessary array cloning
new objects would always clone the input array; only clone on object
cloning (keep the original array reference on initial creation from
bytes)
2017-12-26 21:38:19 -08:00
Kurt
9e2bd8f64a fix pokewalker course flag set
07FF_FFFF
not
7FFF_FFFF
2017-12-21 14:28:19 -08:00
Kurt
9263856845 Add apricorn pouch editing 2017-12-18 09:36:53 -08:00
Kurt
47eee3aa98 Add roto powers as held items
not gonna add sprites because these are useless, anyone can submit via
pr (image might need downscaling to <15x15)
Closes #1703

remove useless null checks (throws the exact same exception it would if
it were not there, except without detail)
2017-12-16 19:52:06 -08:00
Kurt
2dbdb35955 Misc tweaks
possibly fix UI not-1x scaling screwing up drawn pkm images with
items/shiny/illegal.
simplify some logic -> speed improvements (wow so noticable /s)
2017-12-16 18:29:10 -08:00
Kurt
06ea6d94a2 Allow box layout / wallpaper editing for sav5
was temporarily disabled during sav5 implementation 2y ago, now noticed.
Closes #1702
2017-12-16 14:15:09 -08:00
Kurt
278f7cad25 Add pwt record get/set
thanks @sora10pls
2017-12-14 12:34:03 -08:00
Kurt
816ebf6b0e Refactoring
no functional change
2017-12-11 16:01:24 -08:00
Kurt
0588135b60 sync missing change
g already used
2017-12-11 11:01:57 -08:00
Kurt
f1cabdfa25 Handle setting decrypted pgt pkm gift data 2017-12-11 10:13:08 -08:00
Kurt
5bc2e6da88 Refactoring
de-linq some areas where direct accessing is possible (list/array)
2017-12-04 20:16:54 -08:00
Kurt
3d7b2a2b29 Misc tweaks
RNG frame mismatch -> fishy (for now)
fix xmldoc copypaste
clean up some resharper warnings
2017-12-04 16:26:26 -08:00
Kurt
5a69f1d596 Rework gen3 crc32 to not require a new obj for byte[]
removes toarray in favor of iterating over the source array
maybe with the next c# (span)...
2017-12-04 16:13:18 -08:00
Kurt
a5dbdf91bd Misc tweaks
detect antishiny cxd
remove unused using
don't set caught for seenAll (gen7 dex)
2017-12-04 13:18:28 -08:00
Kurt
792910a485
Merge pull request #1689 from pokecal/master
fix MailBoxEditor
2017-12-03 07:14:49 -08:00
Kurt
09a41f66ba Fix z coordinate writeback 2017-12-03 07:12:52 -08:00
pokecal
0f52f94222 fix MailBoxEditor
add Mail5, almost same as Mail4.
2017-12-04 00:00:14 +09:00
Kurt
bdc9d7edce fix plaza get set
closes #1684
2017-12-02 21:37:46 -08:00
Kurt
2d3203fc1a Refactoring
extract out Mail classes to core
2017-12-02 19:12:04 -08:00
Kurt
fdc52e2c19 Add pkm league starter EC for gen7
Closes #1671
2017-11-29 20:04:01 -08:00
Kurt
4a898b0829 Leave empty item slots for gen7+
game depends on an existing value to check for if the item is truly
"New"
Closes #1670

Don't clear count=0 slots for gen7+
For sorting, put all the count=0 at the near top (any feedback on how
this actually works?)
2017-11-29 19:47:27 -08:00
Kurt
f13cc289a7 Move eventflag offset fetch to SAV2Offsets obj 2017-11-27 16:46:14 -08:00
pokecal
e86b8c670f add Crystal GS EventFlags
have checked with US ver.
2017-11-28 03:35:55 +09:00
Kurt
b30cc933e5 Extract festafacility from gui code
move to core project as a structure/class
2017-11-26 08:47:25 -08:00
Kurt
61ca9232e2 fix sav3 dexflag get/set
incorrectly added bit offset twice
Closes #1660
switch /8 to >>3 for consistency with gets
2017-11-26 08:37:08 -08:00
Kurt
6534ef1919 Refactoring
Reworks festa facility into a get/set object, simplify some operations
naming convention (PascalCase) for methods/properties
closes #1635
2017-11-19 21:25:46 -08:00
Kurt
70ec1fda5e cleanup
wasn't able to view the designer layout so I removed & readded to
project -- works fine now.
uppercase method names
2017-11-19 16:16:44 -08:00
pokecal
3c85b0ead3 add G7 FestivalPlaza Editor
There are too many phrases,
I have no plan to complete all list of phrases.
But I think user can edit phrases of each facility
 by using their phrase settings.
2017-11-20 06:50:39 +09:00
Kurt
469587bbbd Add Rotom OT name
"nah lets just store the OT in the save file twice"

add a double check if OT != RotOT to remind the user
2017-11-18 22:26:57 -08:00
Kurt
3e60bcd5dc fix minior dex set clamp
[0],[cores), ignore all other meteor forms
thanks @sora10pls
2017-11-14 21:55:52 -08:00
Kurt
dbf10d1c29 Add surf score editing
trainer7 Ultra tab
Closes #1605
2017-11-14 21:35:28 -08:00
Kurt
c4f8dabd26 rework dex getting
changes iteration to be per-species rather than per list.
uses the internal 'should i set a bitflag' code rather than a banlist.
2017-11-14 19:14:02 -08:00
Kurt
953f6939a5 Fix double save export memecrypto issue
Closes #1600 , memecrypto is applied on first export but not cleared
prior to second export, thus resulting in a checksum over garbage data
that is permanently lost when the new memecrypto sig is applied.

Solve this by keeping track of memecrypto application status.
2017-11-13 19:34:50 -08:00
Kurt
dbabcb9ef0 Misc updates
fix hall of fame fixed offset
fix ball throw type unlock/learned flags using fixed offset
fix current throw type defaulting to -1 when Nihilist (new USUM style)
by adding in for USUM

add fused slot offset fetching
convert event flag combined byte fetch to use Get/SetEventFlag with
event flag references.

add ZRingUnlocked sav properties & checkbox for toggling

set AlolaTime only if the combobox is enabled (only disabled if not yet
set by game)

Closes #1595
2017-11-12 21:28:34 -08:00
Kurt
fbab1cfbe6 Update usum eventflag max
now these event flags are making sense
2017-11-11 18:58:57 -08:00
Kurt
6127dd7a08 split record maxes
slightly different in USUM, any difference increased the cap:
070  999999->999999999
071  999999->999999999
072  999999->999999999
073  999999->999999999
074  999999->999999999
192  9999->65535
193  9999->65535
194  9999->65535
197  9999->65535

Worth noting that these were undocumented record IDs and likely unused
in Sun/Moon; don't really need to split these tables but good for
documentation purposes.

Trainer7 grabs maxes from the save without specifying version, so add an
overload to default to USUM (even though the unused records will have
bad caps, they're unused in SM so whatever).
2017-11-10 17:37:04 -08:00
Kurt
8ab39cae7b Update dex form handling 2017-11-10 17:08:47 -08:00
Kurt
6057780b4b Fix blank saves array accessing
old blanks modeled sm saves with fixed offsets; since the conversion to
dynamic block offsets, a few offsets need to be manually defined.
2017-11-09 19:26:31 -08:00
Kurt
da5dd5ccb3 remove usum early return for dex bit setting
I highly doubt this is causing save corruption; looked through the
disassembly and the offset ptrs are the same relative to sun/moon.
Implementation is flexible for both as gamefreak allocated enough space
in each bit array.

pokedex editor recognizes bools correctly (including for formes).
2017-11-08 19:34:07 -08:00
Kurt
800ba6cf90 encounter additions
add ingame trade data
add placeholder SOS data containers
add refs to all wild encounters (pelago is same as sm)
unmark some todo's
2017-11-08 15:07:04 -08:00
Kurt
97dcd1a845 Add pokedex forme flag correlation table 2017-11-08 13:29:06 -08:00
Michael Scire
78acb8e13b Fix save resigning for USUM, add resources for new pokemon 2017-11-08 11:31:09 -08:00
Kurt
ece66e1a02 Misc tweaks
allows loading of species > 720 lol
still nowhere near done (large task is resource acquisition)
2017-11-08 00:51:08 -08:00
Kurt
543736d568 Early rough USUM compatibility
need to dump string resources, sprites, and repoint the form list string
fetch later. tons more to do

no guarantee of any working functions
2017-11-08 00:34:32 -08:00
Kurt
d08bd25b4f always clear memecrypto sig on load
allows verification & resigning to work as intended
reverts to code prior to refactor

b1641772e6 (diff-1681616e650971296aa4b549afadd0eaL116)

cleanup suggestions for tests
2017-11-07 16:57:18 -08:00
Kurt
f0cfb0df23 cleanup
shuffle / fix xml doc data
2017-11-06 08:01:33 -08:00
Michael Scire
b1641772e6 Refactor Memecrypto API, Add Memecrypto Tests
Refactors the Memecrypto API to improve generalized usage.

Adds unit tests that verify memecrypto works, so that future changes
don't potentially break the code.
2017-11-06 03:24:48 -08:00
Kurt
2d6b6f7095 Simplify gen7 checksum operations
don't spit out a new byte array for each block, just check with same
array

unrelated: allow pk2's to be selected from file->open when a sav7 is
open
2017-11-04 15:04:21 -07:00
Kurt
d7300ce68f Cleanup
add amoongus route22 encounter
fix typos in comments
resharper suggestions for recent pr
2017-11-02 21:37:28 -07:00
Kurt
008605c4ff Add Gen5 BP editing to simpletrainer
a little bit hacky but exposes the values well enough.
moves the coins entry to the Badges groupbox, and makes it visible
looking like a BP editor (lol)

thanks @sora10pls for finding the offsets!
(blockinfo array isn't really used, is sorta just there for
documentation...)
2017-11-01 21:26:38 -07:00
Kurt
60e719a65a Misc refactoring
more usum prep
don't allocate empty array on every savefile creation (use linq All
comparison)
add percent seen/caught savefile properties for data analysis purposes
2017-10-31 09:24:54 -07:00
Kurt
9bbd7c6551 Save all 5 korean OT characters
Closes #1545, thanks @Bl4ckSh4rk !
2017-10-24 18:49:51 -07:00
Kurt
69cf1eaa9c add more pkhex.core xml documentation
adds a bunch of documentation useful for those unfamiliar with the core
library
2017-10-23 23:12:58 -07:00
Kurt
515a694afa Add LanguageID enum
no functional change, just less-magic-numbers for easier to understand
src
2017-10-22 21:01:08 -07:00
Kurt
44c80bd722 Exclude light ball pikachu from gen1 species setter
Thanks Dunsparce!

https://projectpokemon.org/home/forums/topic/41880-yellow-version-pikachu-editing-bug/

non-functional change but fix misuse of gameversion checks (used X/Y
instead of YelloW)
2017-10-22 17:11:48 -07:00
Kurt
228b0e84fb Simplify some dex interaction
utilize get/set flag method calls, add xml docs for the two methods
2017-10-18 21:43:42 -07:00
Kurt
f5b22d7873 Update 17.10.17
Update event binaries with latest from the Event Gallery
2017-10-17 23:59:14 -07:00
Kurt
886b2ef632 misc refactoring
simplification / splitting, also more usum prep and other readability
updates
2017-10-17 23:19:34 -07:00
Kurt
c3e0d5339c Fix jp gen2 save detection
simplification commit was dyslexic on JP/EN.
20 <-> 30 (EN 20, JP 30 is the correct count)

https://bulbapedia.bulbagarden.net/wiki/Pokémon_Storage_System#Core_series_games

pk2 structure is smaller for jp (smaller strings), thus has 30 cap.
International has 20.
2017-10-16 17:33:09 -07:00
Kurt
f5e595772d Add more sav7 properties 2017-10-14 23:47:16 -07:00
Kurt
331d6ec6a0 Sync missing file
#1523
yeah lol
2017-10-14 16:48:43 -07:00
Kurt
fa310e8c4e Add gen6 map mirror coordinate changing
not sure what they do but the values should match
Closes #1523
2017-10-14 16:32:34 -07:00
Kurt
02c06d154b Split item cap for usum prep 2017-10-10 19:30:55 -07:00
Kurt
c3c4336d43 Add gen3 roamer editor
Thanks BlackShark!
2017-10-10 18:48:14 -07:00
Kurt
79ede6a212 Add gen3 roamer r/w 2017-10-09 21:00:36 -07:00
Kurt
78a557c3cd misc tweaks
simplify some linq usage
2017-10-08 22:14:47 -07:00
Kurt
bee64b495b Remove gen2 auto resizing jpn saves
introduced in the start of sav2, removing doesn't seem to have any
consequences

a3250a0d56 (diff-c6536dcc6b76e8415f41529d664b75d9R24)

closes #1516
2017-10-07 16:46:09 -07:00
Kurt
059451d66e misc tweaks
dictionary species check, max deviation beginnings for USUM
simplification for gen1/2 pokemonlists
2017-10-05 22:37:45 -07:00
Kurt
ea751e26b1 Convert chinese string only if species name
Resolves charmap duplications in the chinese char tables:
多边兽Z (Porygon-Z)
属性:空 (Type Null)
谜拟Q (Mimikyu)
卡璞・鸣鸣 (Tapu-Koko)

Games cannot have a nickname/OT in chinese as of current date... I
assume this will be fixed down the road
2017-10-03 18:15:15 -07:00
Kurt
ec491cdd52 Fix sav2 badge/tmhm clearing
Closes #1505
Thanks @fattard !
2017-10-02 23:17:00 -07:00
Kurt
1e377c2963 interpolation++
no functional change (assumed)
2017-09-29 22:58:25 -07:00
Kurt
ce4e5f739e Fix korean Gold/Silver saving
closes #1496
2017-09-29 19:13:03 -07:00
Kurt
ed1b934374 Misc refactoring
expose some useful IEnumerable methods (sorting / bin->pkm / copy) to
simplify some common operations
change some explicit arrays to IList for flexibility
remove old memecrypto bool (no longer necessary as XP is not supported)
rename some methods for more clarity
2017-09-28 22:20:27 -07:00
Kurt
14697f47d3 misc simplifications
recognize 01 01 01 00 xd saves
simplify some detection to be easier to follow, less lines is nice too
2017-09-27 23:22:41 -07:00
Kurt
8b02f05bd5 Faster crc16 ccitt
insert lenny face here
>4x faster, relative speed is higher for larger input arrays
2017-09-26 23:10:31 -07:00
Kurt
532cee406a Add gen1 overworld respawner 2017-09-25 23:06:16 -07:00
SciresM
4272ad56ae We know what Key 9 is for (Cap Pikachu).
Refactor for Memecrypto API incoming in the next few days.

Gonna add a public overload that takes in a memekey, to facilitate Local Wireless memecrypto.
2017-09-25 17:51:17 -07:00
Kurt
bbff1e086a relax RB/Y detection when no starter chosen
value is 0 until a starter is chosen
2017-09-24 16:58:19 -07:00
Kurt
4950909d97 Add Red/Blue vs Yellow savefile detection
use the player's starter choice species value :)
2017-09-24 16:36:51 -07:00
Kurt
c0f5166184 Fix rtc reset key generation
money into 3 bytes => sum
psypokes only does the 2 lowest bytes, is missing the high byte
Closes #1490
2017-09-24 10:59:35 -07:00
Kurt
12187a5128 Expose gen2 RTC resetkey
#1487

also expose gen1 event flags (well, the crappy ones at least)
constants/event_constants.asm
2017-09-23 22:13:48 -07:00
Kurt
d8c2cdb8e3 Use EnumerateFiles over GetFiles in some cases
https://msdn.microsoft.com/en-us/library/07wt70x2.aspx

iterating as an ienumerable (ie not consuming the whole collection) can
be more efficient by not waiting for the whole collection
2017-09-23 17:02:28 -07:00
Kurt
caf25efb46 Add RTC ResetKey calc 2017-09-23 16:04:02 -07:00
Kurt
c23cc81212 More usum prep
I think egg hatch location checking is wrong for traded eggs (see gen3
vs future games, origin game shouldn't change but could hatch ORAS egg
on XY at XY location?)
2017-09-19 21:35:30 -07:00
Kurt
6611e874c3 more usum prep
species added requires the 'latest personal table' reference to be
USUM's; the other referencs for .SM are fine as there's no possibility
to have a species ID high enough for it to matter.
2017-09-18 22:36:06 -07:00
Kurt
298dc344cf Fix gen3 emerald badge setter
Closes #1452
the bitwise or treated it as an int, which wrote 4 bytes instead of 2,
thus overwriting 16 flyto flags
Thanks @sora10pls & @Tk77185!
2017-09-18 16:06:31 -07:00
Kurt
c07a36c333 Fix event flag get set
yay order of operations
also update prompt messages for more guidance
Closes #1464
2017-09-17 10:16:56 -07:00
Kurt
7efd771bf4 Misc refactoring
add docs, move some data fetching to more appropriate class
remove old XP memecrypto support handling, was previously removed due to
net standard/core split
refactor memecrypto to handle multiple save sizes (USUM won't be the
same size save file); placeholder -1 for USUM size
2017-09-16 11:38:58 -07:00
Kurt
d286fe9731 Extract get/set event flag common SAV method
throw in a little docs
2017-09-13 20:37:18 -07:00
Kurt
73d547b04b Fix gen3 jp OT editing breaking jp detection
Thanks ajxpk!
2017-09-13 18:24:37 -07:00
Kurt
7d8a0e0287 Update kor offsets & r/w operations
Closes #1451 , was caused by empty party writebacks (was reading from
wrong offset
dex caught/owned offset was listed as 0x28AE in the thread, is at 0x2AAE
instead (-0x20 from seen)

should have correct offsets and handling now :)
2017-09-12 19:47:37 -07:00
Kurt
add2fef7a7 Add gen2 korean handling
hypothetical for now, feel free to submit PRs to fix anything that
breaks / was incorrect in the implementation
2017-09-10 19:56:21 -07:00
Kurt
f4d8f6e560 Add generic Gen2 jp Emu save file support
+0x30 footer for RTC
2017-09-08 21:53:08 -07:00
Archit Date
1123c24b0c Fix Gen4 Misc options when no Poketch is obtained. (#1448)
* Fix Gen4 Misc options when no Poketch is obtained.

closes #1447
2017-09-07 12:25:45 -07:00
Kurt
cf61333b40 Add gym team history
thanks vg anon (187997971/188004360)
2017-09-03 17:23:20 -07:00
Kurt
86608f886d Fix incorrect comparison
don't write for gen5, do write for gen1-4.
Closes #1429
2017-08-27 20:39:11 -07:00
Kurt
93f81d554f Misc simplifications
#1417

I'm pretty sure these are trainer stats, so there may be a better way of
presenting these (ie all stats) in the future (if anyone cared). Refer
to gen6/7 trainer stats as reference.
2017-08-27 12:49:05 -07:00
Kurt
b26c670985 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	PKHeX.Core/Saves/SAV4.cs
2017-08-27 12:36:56 -07:00
Kurt
8aa5d9daf0 Add pokewalker initial flags 2017-08-27 12:33:04 -07:00
Egzon Qukovci Jusufi
d0b5ceb8ff Underground Score Editor (help needed) (#1416)
* Underground Score Editor first commit

* not needed space

* changed anchor points

* added dp offsets, ug scores to underground, underground button click code
2017-08-27 12:32:43 -07:00
Kurt
ccc6357294 Misc updates
Re-enable PKM (abstract class) property searching via Database/MGDB
search
Closes #1412 (can now search or exclude certain formats)

Add auto-detection for all supported saves (rather than gen3+ except
GC/PBR)
2017-08-24 18:49:09 -07:00
Kurt
996a219a13 Gen5 international language bits dex fix
Closes #1395
Gen5 save files do not store multilang dex entries for gen5 species

https://bulbapedia.bulbagarden.net/wiki/Foreign_Pok%C3%A9dex_entries#In_Generation_V
2017-08-20 17:52:10 -07:00
Kurt
8e1105e781 Misc fixes
Closes #1409, fr entries weren't tab separated
Closes #1408, editor interface was correct (refer to checkbox order
comment in Pokedex4.cs)
Closes #1407, XY species were copypasted to AO's
2017-08-19 18:43:36 -07:00
Kurt
9864d84704 Misc fixes/improvements
Reduce memory usage for evo method banlist (static banlist references)
Fix gen6 mega evo flag truncation
simplify QR encode/decode logic a little
Don't apply transparency if transparency is already 100% (skip the loop)
Add gen5 wild pid/tid-sid correlation check
Fix validation value reset (loading gen3-4 pkm without looking at met
tab causes the met location to get reset); fixed by prematurely
validating before setting the value
Fix gen3 pkm with gen4 contest ribbons in gen4/5 getting flagged
incorrectly
2017-08-13 00:21:42 -07:00
Kurt
ebecb21b2e Fix cxd strategymemo/shadowinfo export
Closes #1347
Closes #1296
2017-08-06 17:20:04 -07:00
Kurt
4edba19a19 Add platinum wallpaper mapping
dp wallpapers .. pt wallpapers .. hgss wallpapers
contiguous series
24 .. 8 .. 8

Closes #1381
2017-08-05 10:16:55 -07:00
Kurt
80196f75ef Refactoring
split Core.PKX into smaller classes, only StringConverter is exposed for
outside namespaces
2017-07-31 23:03:51 -07:00
Kurt
ee57bc49f0 Add gen3 event flag/variable editing
Template files added for e/frlg, no guarantees.
http://i.imgur.com/ER5rRBn.png
(left+select+b when on groudon/kyogre menu screen)

Closes #1328, thanks @rboninsegna !

Added the ability to prefix flag numbers with 0x, and prefix variable
numbers with 0x40__; will be parsed as hex.
2017-07-13 23:05:59 -07:00
Kurt
c12eba2186 Add Gen6 mega evolution early-unlock edit
TrainerCard offset is 0x14000
http://i.imgur.com/XtsZLmL.png

via:
33011937 ekx
182491428 hbg
tyvm anon
2017-07-12 20:38:24 -07:00
Kurt
04a11ae030 Update gen4 dex seen bitflag setting
now matches general format of SAV_Pokedex4, bit regions were off-by-one.
2017-07-08 19:33:20 -07:00
Kurt
33dff69fb2 Add dp current poketch offset
Closes #1311
2017-07-06 17:32:26 -07:00
Kurt
45c891e64f Add inventory sorting by index number
Closes #1312
2017-07-06 17:24:40 -07:00
sora10pls
951bd6fac4 Fix D/P Mail Item offset 2017-07-05 12:33:04 -04:00
Kurt
4e9b6be8e5 Convert console output to debug output
output messages are now no longer in release builds, as they are only
visible when debugging in an IDE.
2017-07-01 19:43:51 -07:00
Kurt
e373db99c1 Fix honeytree group get
byte 6 sets 0/1/2/3, which is used for the editor
byte 5 says which sub-table to use (0/1/2) if there is something on the
tree.
Closes #1283
2017-06-29 09:09:59 -07:00
sora10pls
9cd85bf1db Misc4 updates 2017-06-23 15:47:52 -04:00
Kurt
86e0374efc Update poketch dropdown/set
#1263
2017-06-22 19:18:14 -07:00
Kurt
1815a7f273 Add current poketch app selection
Closes #1260
2017-06-21 21:07:07 -07:00
Kurt
e697a9edc7 Block parties without battleable pkms
#1257
not perfect but less restrictive, probably more obvious.
2017-06-21 20:24:42 -07:00
Evan Dixon
2636e7ded8 Fixed another potential blank error message
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.
2017-06-20 20:38:33 -05:00
Kurt
b4222c756a Refactoring
reduce cross-class chatter, simplifly large methods to smaller pieces
some speed improvements
2017-06-18 22:27:40 -07:00
Kurt
c01aae3156 sav3 Pad OT name with 0xFF
cap length to current language constraint
Closes #1244
2017-06-18 16:19:05 -07:00
Kurt
3f38b123a3 Refactoring
mostly renaming things, includes a little bit of added sugar and
splitting methods to simplify the codebase.

all methods are now PascalCase
2017-06-17 18:37:19 -07:00
Kurt
8f833d8171 Simplify max item count give/modify
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 #1228
Closes #1227
2017-06-14 18:43:28 -07:00
Kurt
b8069184a2 Fix partycount setting for gen5
only update the party count when appropriate
species present=>only update if below
no species present=>only update if above

Closes #1224
2017-06-13 22:14:17 -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
991978dab6 Ensure cleared move pkms have at least 1 move
#1214
user may not be checking legality (bulk transfer)
2017-06-10 08:39:04 -07: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
Kurt
0ae907e4d0 Update unused byte usage knowledge
DistByte is actually 16bits; no point changing the name.
The 32bits afterwards are form duration (Hoopa/Furfrou only), and only
exist while the PKM is in the player's party.

The game sets an initial value with days to exist in the form before
reverting (probably on game restart), checking the delta between days
saved. Either way, just set a base value when writing it to the party,
else clear the value if it is not supposed to be used.

Thanks @SciresM !
2017-06-06 22:13:12 -07:00
Kurt
6fee7052af Add box sorting by gender
Closes #1185
2017-06-02 08:54:08 -07:00
Kurt
550153e3bc Improve gen3 sav detection
better detect RSE collisions
add auto-detection for japanese games
Closes #1172
2017-05-29 10:33:27 -07:00
pokecal
1bb891a8a3 fix BW2 checksum offset
ExportSAV without changes will become export same data.
2017-05-28 11:01:27 +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
wwwwwwzx
13be5201b1 Several minor fixes and update Chinese translation 2017-05-19 22:05:08 -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
3d498c6a1e Fix BATREV saves converting mystery gifts
OT field needed for gift string get/set. Other values unnecessary for
basic function.
#1151
2017-05-18 17:51:08 -07:00
Kurt
7d39b70d91 Fix wc7 deletion
shift down logic does not apply for array writes; the setter sets empty
slots to fill all required slots
Closes #1142
2017-05-16 21:29:34 -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
a70a4d5e3f Switch to c# 7 get/set expressions
Add gen5 battle box locked flags
no functional change otherwise, just shorter
2017-05-12 20:32:43 -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
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