Commit graph

2938 commits

Author SHA1 Message Date
Kurt
2c8901f4ca Cleanup
Remove linq usage in learnset
Fix mismatched legality string IDs
2017-04-08 19:05:29 -07:00
javierhimura
a5b1d72f06 Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile

* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array

* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn

* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters

* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves

* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1

* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters

* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon

* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number

* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1

* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class

* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal

* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work

* Add generation 1 parse moves function including default moves

* Clean-up get encounters

* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter

* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon

* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered

* Fix gen 1 eevee and evolutions move checks

* Cleanup

* Move the code to change valid moves for generation 1 to a function

* Fix getMoveMinLevelGBEncounter

* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible

* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-08 17:17:20 -07:00
Kurt
f430e2feee Misc tweaks
no functional change
2017-04-08 11:08:16 -07:00
wwwwwwzx
6ff4003036 Fix B2W2 tutor moves (#1035)
* Fix b2w2 tutor move

Iron tail(231) is taught at Lentimas city.

* Fix B2W2 Tutor Move

Iron tail (231) is taught at Lentimas city. Also fix the string ID of
Tutor Move
2017-04-08 09:08:54 -07:00
Kurt
c51de0620f Merge pull request #1036 from pokecal/pokecal-patch-2
add Gen4 MiscEditForm
2017-04-08 09:07:54 -07:00
pokecal
7d430387f8 add Gen4 MiscEditForm
there is now only a tab Poketch.
2017-04-08 18:20:16 +09:00
Kurt
f962fcff05 Merge pull request #1033 from wwwwwwzx/master
Several minor fixes
2017-04-07 18:23:35 -07:00
wwwwwwzx
136d155c19 Several minor fixes
Fix Moves of EnconterStatic NullReferenceException Error
Fix ball checking of shedinja
Add missing legality check string
2017-04-07 17:45:22 -07:00
Kurt
ee37b09748 Merge pull request #1031 from sora10pls/master
Unban Medichamite and Audinite
2017-04-07 11:00:03 -07:00
sora10pls
df5439df2b Unban Medichamite and Audinite
Now released
2017-04-07 13:27:23 -04:00
Kurt
ad28ab58c3 Merge pull request #1030 from wwwwwwzx/master
Fix and simplify gen4 encounter file reading
2017-04-06 23:20:40 -07:00
wwwwwwzx
2d0469db72 Further simplifying 2017-04-06 22:37:40 -07:00
wwwwwwzx
711cb6e7e4 Fix and simplify gen4 encounter file reading
Change reference offset to absolute offset in order to read data independently and for troubleshooting
Swarms species ID of dppt can be read from encounter raw file (2 x int32 starting from 0x66)
[Swarms species ID of hgss is at 0xBE but lacking encounter type info]
Timereplace slots of dppt only have morning and night slots, the 1st slot is just swarms
Pokeradar slots should replace normal slots 4,5,10,11 (tested)
While replacing slots, skip the encounters with same species ID (always it's because there is no such slots)
2017-04-06 22:07:42 -07:00
wwwwwwzx
7e2c76bbd2 Merge pull request #1 from kwsch/master
Update from upstream repo kwsch/PKHeX
2017-04-06 22:07:21 -07: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
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