Commit graph

3758 commits

Author SHA1 Message Date
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
d09f8a98ed Unban gen3 enigma berry
Closes #1048
2017-04-10 09:07:29 -07:00
Kurt
765d09fc16 Merge pull request #1046 from wwwwwwzx/master
Fix yellow super rod encounters reading
2017-04-10 05:13:49 -07:00
javierhimura
d6c6eb1063 Various legallity checks added and fixed (#1049)
* Fix required move count for Butterfree and Gyarados

* Ruby Sapphire Southern Island legendaries do not have fateful encounter

* Added missing event egg for generation 3
Filter generation 3 event egg by game origin, an egg pokemon remains with the original game no matter in what game it hached

* Filter the event egg static table better than individual pokemon from the table

* Generation 4 do not allow to EV train at level 100, for level 100 encounter pokemon (like events) EV only can be trained with vitamins, with a maximum value of 100

* Fix incorrect string

* Generation 2 eggs can not be infected with Pokérus

* Fix gyarados count slots
2017-04-10 05:11:07 -07:00
wwwwwwzx
23af46a46f Fix yellow super rod encounters reading
Species ID is read before level. Found the mapping method between raw data and actual number
but can't figure out any direct function between them
2017-04-10 01:16:06 -07:00
Kurt
ea65d39f69 gen3 ingame event item fateful flags
Special handling for gen3 detection due to multiple static encounters
for lati@s having mixed fateful flags.
2017-04-09 22:20:07 -07:00
wwwwwwzx
35352b0259 Misc fixes & Some tweaks for legality check (#1044)
* Add gen3-6 unreleased items

* Fix string converter

fix traditional chinese char offset
fix out-of-range crash

* Fix ivs and ability check for VC transfer

Refetch the static enconter for VC transfer after moves checks
update legality string translation
impl non-HA ability matching

* Add ivs legality check for wc gift
2017-04-09 21:59:44 -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
ReignOfComputer
ef0348f341 Latest Save Fix (#1043)
This seems to do it for me. Previously, it looped all the way to the
earliest save and loaded that. This stops the search at the first match
ordered by descending write time.
2017-04-09 21:34:12 -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
6d2c09f629 Fix nickname check when traded between languages 2017-04-09 18:28:22 -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
javierhimura
409fea10d0 Generation 1 No move deleter edge cases (#1041)
* Fix getMoves with maxlevel 100

* Complete edge cases for pokemon generation 1 getUsedMoveSlots
There are pokemon who learn moves only in yellow and that moves are optional
Also some pokemon if they evolve at the minimum possible level they do before learning the fourth move, until the level when the evolution learn it the 4th move is optional
Redone the part for special pokemons like stone evolution and pikachu and nidoran family

* Missed distinct

* Fix comment

* Fixed moves in getUsedMoveSlots
2017-04-09 16:41:01 -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
df73b2d97b Merge pull request #1040 from pokecal/pokecal-patch-2
Poketch DotArtEdit
2017-04-09 14:08:08 -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
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