Commit graph

3724 commits

Author SHA1 Message Date
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
Kurt
9002d882b2 Misc cleanup
allowInherited was always false as SpecialMoves is never null (?? new
int[0])
2017-04-06 21:23:08 -07:00
wwwwwwzx
fc552fbfbe Fix gen7 Eevee eggs checking and cleanup (#1028)
* Fix Eevee eggs in gen7 and cleanup

Needs to mark EncounterstaticMatch as null after verifyencounterstatic
failure
Egg moves were checked in parseMovesWasEggPreRelearn, so verifyeggmoves
function is unnecessay
No need to search friend safari for gen4 transfer
Simplify parsing special egg moves
Skip level-up moves when checking higher level moves

* Add PokePark Encounter

* Fix eggmoves and eventmoves conflict checking

* Add Egg Pokémon Present Eggs

Solve issue #987
Use special move to distinguish eventegg

* Fix Transferred gen3 egg Checking

Refactoring location in gen4transfer

* Fix species recognition of event eggs

include preevolutions checking

* Check encounter before egg for transferred pkm

Remove prerelearnencouner function.
The existence of RelearnMoves is checked in parseMovesSpecialMoveset
2017-04-06 17:41:25 -07:00
suloku
1dc5831921 Added Honey Tree Editor for DP and Pt savegames. (#1029) 2017-04-06 17:39:36 -07:00
Kurt
92ed589900 Fix move parsing for eggs
no encounter provided => moves not parsed correctly.
Just do the same loop without writing the encounter (as it will only
iterate once).
2017-04-05 21:28:03 -07:00
wwwwwwzx
17c682df58 Misc fixes (#1027)
* Fix Chinese Characters mixup

Some chinese characters are shared by tranditional CH and
simplified CH, should be remapped as a whole. There is no chinese OT/HT.
The remapping only happens at gen7 species nickname

* Fix about HGSS Togepi gift egg

Should upcase eggname when compare egg nickname at generation < 5
Remove unnecessary `wasegg`, it's checked before entering the function
Get egg move from encounter table
EncounterMatch should be as EncounterStatic type not a List.
Remain only special move for in-game gift egg for order checking.
Change default Static moves length to 0
Remove duplicate dratini

* Avoid duplicate relearn move suggestion

The move already in the move list above would be suggested again (was
flagged)

* Fix up some duplicate location strings

Duplicate location string will affact location ID

* Revert conflict parts to merge
2017-04-04 23:11:47 -07:00
Kurt
d4d896e353 Simplify encounter move checking
populates a list of possible encounters and iterates over all of them
the encounterstatic / mystery gift loop check was the same, and all they
provided was a set of special moves. Introduces an interface for easy
moveset retrieval.

fix typo in defaultmetlocation var name
add egg check for mystery gifts if transferred (can't transfer eggs
across generations)
2017-04-04 22:01:48 -07:00
Kurt
b789478a25 Add friend safari cheat macro
Thanks @suloku !
#330
resx stop being goofy
2017-04-04 18:58:32 -07:00
Kurt
e310e206ab Add exception handling for savefile detection
Returns the error message and pops up as usual
bye one-liner :(
2017-04-04 18:55:21 -07:00
Kurt
32fdcf4c10 Minor tweak
no functional change, just split up the filtering from the initial
static fetch
2017-04-03 20:43:13 -07:00
Kurt
cd9987ed09 Cleanup
Removed unnecessary parenthesis
Simplified use of linq
Fixed encounterstatic error (wrong variable referenced in linq)
2017-04-03 20:28:04 -07:00
Kurt
db642a257b Remove unnecessary Dragonite encounter
Thunderpunch is tutorable to Dragonite in B2W2; slightly reduces the
amount of comparisons by yielding the more generous encounter first.

Sprakling -> Sparkling comment typo fixed
2017-04-03 20:07:03 -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
javierhimura
71d452a9c3 Static encounter refactor to return a list for pokemon with multiple statics but different moves (#1023)
* Refactor getValidStaticEncounter to return a list instead only one encounter, for those encounters with the same data except moves like Dream World Dragonite
The treatment of the encounters is similar to the list of mystery gift encounters
parseMovesIsEggPreRelearn change to use only the split breed species equal to the egg species
Remove EventEggMoves array for parseMovesRelearn function, that array is only used for gen2-3 encounters that can be normal eggs or special eggs, gen 4-7 event eggs have the event moves in the SpecialMoves array

* Add optional paramter to the methods for getting evolution tree to use for gen 1 and 2 encounters, when searching for a gen 2 encounter maxSpecies should use gen 2 max and for gen 1 encounters gen 1 max species no matter in what format is the pkm
Also changed the ordenation of encounters by min species to use the less evolution form including generation 2 pre evolutions, for example for a gen 2 Hitmonlee whose static encounter could be gen 2 Tyrogue gift

* Added the same maxspeciesorigin criteria for wild encounters

* Fix memory card restore backup

* Fixed some other parseMoves function where staticencounter was not changed to staticencounter list
Separate VC Events for GB Era Events, VC Events was filter out for valid static encounters if was selected not allow GBCartEra exclusive encounters

* Fix getValidPreEvolutions
2017-04-03 19:59:29 -07:00
Kamron Batman
0d65973421 Fixes obedience flag to fateful encounter flag for palparking. (#1024) 2017-04-02 17:23:54 -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
e9c4b0bcb9 Merge pull request #1021 from javierhimura/master
Load GC Memory Card files and some fixes
2017-04-02 11:23:19 -07:00
javierhimura
b95bfdaba0 Specify in the readme that only MC containing Pokémon savefiles are valid 2017-04-02 18:47:18 +02:00
javierhimura
ab67bf0d60 Split memory card files extension for bin and raw files.
Raw is the extension used by Dolphin and Bin is used by Wii Devolution, both have the exact internal format and size
2017-04-02 17:36:50 +02:00
javierhimura
f22dc2cf9f Update readme file with memory card extension 2017-04-02 17:18:44 +02:00
javierhimura
8655976d0f Merge branch 'master' into kwsch 2017-04-02 17:17:42 +02:00
javierhimura
9c003f1b51 Fix for legallity of Pokemon Box encounters to be included with gen 3 games static tables for every games.
Also split gbcartera game versions into gen 1 events, gen 2 events, stadium and stadium2, leaving GBCartEraOnly as a group of games.
Added Stadium 2 gift pokemon
2017-04-02 17:16:53 +02:00
javierhimura
699dadcccb The UI was checking wrong if a pokemon is shadow or purified
The internal data of GC games for purification for shadow pokemon does not have values from 0-non shadow to 100-total shadow, it have values sarting from the initial shadow hearth gauge to 0-non shadow.
2017-04-02 17:10:40 +02:00
javierhimura
b53a101f20 Fix for XD. XF files testes from inside a memory card only return true in getIsG3XDSAV if ignore the second pass in the for, only the first is equal to the sequence 2017-04-02 16:54:53 +02:00
javierhimura
a38e923e83 Load pokemon savegames directly from gamecube memory card files. This files can be saved again in the same memory card file or exported as a gci file with only the savegame.
Do not allow to resize memory cards nor create a new memory card from a gci files
If the MC contains multiple save files the program ask the user what game he want to edit
2017-04-02 16:53:46 +02:00
wwwwwwzx
ef7ca4f65c Misc legality checks (gen5-7) (#1020)
* Add Flabebe and Pumkaboo altform HA legality check

Fix issue #999
The derived value SpecForm can use for other legality checks

* Add N's pkm and Hidden Grotto shiny legality checks

-fix early return in verifyMisc
-add N's pkm legality check: IVs, OT Name, TID, SID, Shiny
-add Hidden Grotto shiny check

* Fix spelling

* More edge cases for gen6 ball checks

Ban several altform hidden ability with gen3 ball

* Fix gen4 Formcount for altform

Manually fix several bytes (http://i.imgur.com/l0Amuto.png)
2017-04-02 06:39:39 -07:00
Kurt
32b2abf7a9 Update lock capsule legality check
Met locations are modified after performing the event in gen5, resulting
in 2 locations
defer the PCD met location check to this PokéTransfer/Lock Capsule check
2017-04-01 14:38:50 -07:00
Kurt
7052968b58 Fix deoxys handling on gen6+
WasEvent was not yielding true for a past gen specimen as the deoxys
exclusion for ORAS was present. Remove and change handling.
2017-04-01 14:20:00 -07:00
Kurt
500613f98d Fix mystery gift edge cases
Per IRC discussion
2017-04-01 13:54:04 -07:00
Kurt
f00388c4ca Fix 5->6 dropping CNT_Sheen 2017-04-01 13:53:29 -07:00
Kurt
d54bb72d59 Temp fix egg detection
Egg location should be used to detect if it was an egg; encounter
matching should determine if it is a StaticEncounter gift.
2017-04-01 13:02:37 -07:00
Kurt
d800ffdf97 refactoring
Reduce nesting a little
2017-04-01 11:32:59 -07:00
javierhimura
f0e6e96435 parseMoves functions improvement (#1018)
* Add egg locations and gits egg locations for gen 4 and 5
Add WasGiftEgg property and diferenciate from WasEventEgg

* Separate parseMoves Pre Relearn and Post Relearn generations
Separte parseMoves Pre Relearn egg-encounter for non-egg encounters, a gen3 pokemon can be both
Post Relearn IsEgg pokemon should have all moves as relearn moves
parseMovesSketch should not be used for Smeargle inside an egg
WasGiftEgg should not have egg moves

* Fix WasEgg and WasEventEgg functions for Manaphy

* Add gen 5 trade egg location
Check for generation 3 IsEgg if is a gift egg or an event egg that there is a valid encounter for the egg

* Move parseMovesGetGift bellow WasEggPreRelearn. WasEggPreRelearn is already checking for gift encounters, some generation 3 pokemon could be both an egg or an event encounter

* Check for gift egg without valid encounter in verifyEncounterEgg

* Check WasEventEgg without encounter in verifyEncounterEgg
2017-04-01 09:45:13 -07:00
Kurt
7051c42078 Sync missing file
oops
2017-03-31 18:53:30 -07:00
Kurt
05c0a0bdb5 Filter GB Era only encounters if not allowed
All are encounter statics which were identified by GameVersion.SPECIAL;
rename enum value for clearer meaning and prevent these from matching if
not allowed.
2017-03-31 18:49:13 -07:00
Kurt
a1153f1004 Misc simplifications
Segregate gen4 transfer legality check from encounter detection
reorder EncounterSlot[] match test to be before EncounterStatic. Closes
#1016
Fix manaphy gift handling
2017-03-31 18:35:43 -07:00
javierhimura
f0fc473a7e Shedinja evolution moves and some egg fixes (#1015)
* Add getMoves function with min level and max level, usefull for shedjina evolves moves (min level 20) and generation 1 moves ( no move reminder, min level is min encounter level + 1)

Also for gen1 encounters another function should be created to get by the encounter level the four moves that the pokemon learn by default, the last four in its movepool up until the encounter level

* getShedinjaEvolveMoves, function that return the moves that shedinja could learn from Ninjask move pool at the moment when Nincada evolves, in the same format that getValidMovesAllGens

* Add validation in parse moves for shedinja evolve moves.
Shedinja could have any gen3/4 moves from Ninjas learnset but only one is allowed

* Shedinja evolve moves text resources

* Fix egg moves pre-gen 6 validation:
Add skipoption variable to getEggMoves function from pre-gen6 games, to verify egg moves from split breed species
Flag illegal combinations of base egg moves and special egg moves
Return crystal egg moves for gen2 pokemon that can be tradeback to gen 1 games

* Fix for mix between event egg moves and base egg moves

* Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move

* Revert "Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move"

Revert the last change, i search in bulbapedia an there wasn't any nincada distributed with special moves in generation 3 nor 4, making this complicated validation unnecessary

This reverts commit 57f5ac1bbb.

* Fix error
2017-03-31 17:40:30 -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
Kurt
b3c5752476 Cleanup
refactor out the encounter trade screening; fixes the IV check loop (the
continue continued the for loop not the foreach).
Similar approach can be applied later for the encounterstatic checks if
it is to be converted to ienumerable (in which a secondary screen may be
necessary)
2017-03-31 00:04:29 -07:00
Kurt
5011ddca1b Merge pull request #1013 from javierhimura/master
Safari ball and sport ball checking
2017-03-30 23:29:47 -07:00
javierhimura
fcaa2d8b18 Revert unnecessary change 2017-03-31 00:14:52 +02:00
Kurt
1366e767b4 Merge pull request #1014 from pokecal/pokecal-patch-2
Add Gen7 Mega unlock
2017-03-30 14:39:20 -07:00
javierhimura
e93ebf838e Fix species in slots time replace for DPPt 2017-03-30 22:25:08 +02:00
javierhimura
9bac13ced9 Fix deoxys forms to get moves in gen3 format, there is no format info for deoxys in the gen 3 personal tables because deoxys have only 1 form available per game 2017-03-30 21:34:48 +02:00
javierhimura
78216a3b89 Fix for deoxys encounter, also was needed for any other gen 3 transfer encounters.
EncounterMatch was being overwritten, returns for gen3 the last valid encounter found
2017-03-30 21:13:38 +02:00
javierhimura
ab2d18eb8a Fix for Manaphy Egg Gen 4 event encounter
- changed trade egg location in mystery gift search
- adapted getMinLevelEncounter to take into account gen 4 eggs in gen 4 games
- remvoed manaphy for static encounters, is already included in event database
- fix no hatching for an egg check for gen 4 manaphy
2017-03-30 20:58:30 +02: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
javierhimura
70b3b22ab5 Correction in the comments 2017-03-30 13:24:38 +02:00