Commit graph

248 commits

Author SHA1 Message Date
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
1b7e0e630c Add template loading when sav loaded
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
2017-05-10 19:24:58 -07:00
Kurt
6d9cbaaec0 Add IOException type write protection check
per recent forum thread
2017-05-10 19:01:01 -07:00
Kurt
d05d6c44f4 Misc ec/pid tweaks
use the encryption constant (pk3-5 return PID on get), fix gen4 using
gen5 correlation
2017-05-03 23:14:34 -07:00
javierhimura
758adf2cff Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* 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
2017-05-01 08:07:20 -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
6efdf64bab Cleanup
Update some comments, adjust performance/flow. No functional changes
2017-04-26 22:05:32 -07:00
javierhimura
b14ac67c1f Generation 1 and 2 legal Improvements (#1099)
* 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
2017-04-26 21:27:59 -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
dc911351fe Import pk2pk functionality
Exposes reflective conversion capability and sanity checking methods for
use in the class library.
2017-04-23 20:33:17 -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
ef35055d4e Fix directory not found issue
Thanks ArcticLoveBunny!
2017-04-19 18:47:42 -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
5d9962d102 Mark SAV as unmodified upon load
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.
2017-04-17 23:36:46 -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
6ea7293ff3 Fix party only battle form legality check
Only set box value if in box
Only check party-only if <= gen6
Closes #1060 , thanks @White-Canary !
2017-04-14 17:49:13 -07:00
wwwwwwzx
06f54bb3d0 Gen3/5 Ability Check Fixes (#1056)
* 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
2017-04-14 16:24:41 -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
Kurt
bb97c0ffef Update wurmple check
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.
2017-04-12 21:38:53 -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
javierhimura
5e87608079 E-reader Berry (#1050)
* 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
2017-04-10 15:59:16 -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
0d8a58d3ab Cleanup
reduce nesting & complexity by splitting into smaller methods
fetch species list on boot instead of every gen1pkm
misc style fixes
2017-04-09 17:43:05 -07:00
Kurt
06f778ac92 Add event nicknamed fishy flag
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)
2017-04-09 16:38:29 -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
b789478a25 Add friend safari cheat macro
Thanks @suloku !
#330
resx stop being goofy
2017-04-04 18:58:32 -07:00
wwwwwwzx
015bdc606b Misc gen4 legality checking fixes (#1025)
* 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.
2017-04-03 20:02:40 -07:00
Kurt
65fab7542e Cap coins/bp for gen3
Closes #1022
2017-04-02 14:08:11 -07:00