2
0
Fork 0
mirror of https://github.com/kwsch/PKHeX synced 2024-12-14 06:32:35 +00:00
Commit graph

3226 commits

Author SHA1 Message Date
Kurt
c395bbebc4 Cleanup
null ?? null = null
with a cxd check in the verifyAbilityGen3Transfer check, can delete the
earlier cxd check
2017-04-13 09:19:50 -07:00
javierhimura
0af983547d Fix legality issues ()
* Added method getBaseEggSpecies to get the base species when the pokemon was an egg, is needed because for format 1 pokemon with egg origin every time getBaseSpecies is called is returning the gen 1 base species obtaining invalid eggmoves and base egg moves
Also getBaseEggSpecies was using Evolves1 when format = 1 even when asking for a gen2 egg base species, returning Pikachu egg moves (empty list) instead of Pichu egg moves

* Fix ability checking for generation 3 pokemon, likea de Seadra from Issue 
pkm.AbilityNumber have a value assuming PID match ability like a generation 4 pokemon but the validation should be ignored if is a generation 3 pokemon with only one ability in generation 3
Also changed the validation for ingame trades with fixed abilities to check only with generation 3 abilities in the case the species has two abilities generation 3, if only one was possible any PID should be valid with the generation 3 ability
Encounter Trades
Also the check for evolution was wrong, the most evolved species is the first in the evochain, not the last

* Fix evolution chains for gen 3 pokemon in format 4

* Fix ability for generation 3 trades. Ability could not change if there were 2 abilities in generation 3, that means it is irrelevant if the pokemon evolved in gen 4-5, the ability number must match the encounter
2017-04-13 08:48:13 -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
Kurt
552237166f Isolate japanese config from legality settings
Loading the save initially needs it specified by the program (per save
file); when a save is cloned it needs to clone the Japanese parameter

No functional change when used with PKHeX, but other applications of
Core will now function correctly. (init 1 EN save, 1 JP save -> cloned
EN became JP; this no longer happens)

SAV3 is the only save object that needs the JP bool specified... I
wonder if there's some way to reliably detect with just the SAV data...
2017-04-12 18:19:31 -07:00
Kurt
ad962712f1 Merge pull request from pokecal/master
add for gen3
2017-04-12 18:15:36 -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
pokecal
d49fdfbe89 fix gen3 once-saved saves
Catch a case that all BitOrder is 0. (after delete all data)
2017-04-13 04:59:50 +09:00
pokecal
ac20c0574b fix for gen3 subforms
TrainerDataEditor can now show correct OT string.
2017-04-13 04:56:30 +09:00
Kurt
1235bfe17a Simplify ability checks
Broken into smaller methods, adjusted flow. Gen5/6/7 mystery gift
ability check was typical so just use one repeatable method.

Also...
Short circuit unflagged EV check fixed; case where 255 & 248 EVs used
will trip the 508 fishy flag but does not check the Format >= 6 for the
>252 check. Fixed by arranging all the Invalid checks without an
if-else.
2017-04-11 20:55:34 -07:00
javierhimura
6a4588d676 Varios legal analysis improvements and fixes ()
* Ignore Shedinja evolution moves if the encounter species was a Shedinja

* Phione and Manaphy can not inherit level up moves, they hatch only with level 1 moves

* Verify ability for generation 5 events

* Removed unused sevii isle locations for FRLG valid met location

* Verify ability for generation 3 transfer pokemon

* Ability error text

* Fix gender validation

* Cleanup

* Check egg hatch cycles are not greater than species/ gift egg encounter hatch cycles

* Fix FiredRed Charmander moveset, have 67 moves when it only learns 11 moves

* Reduced redundant condition in ability checking
2017-04-11 20:11:58 -07:00
Kurt
30706835ad Fix PGF antishiny generation and nonshiny abils
Move PID modification for ability after all other PID modification methods
Update antishiny xor to match the games
2017-04-11 14:16:28 -07:00
Kamron Batman
b3118afa3b Fixes gen 5 force-shiny generation. ()
Replicates the ingame PID generation for Forced Shiny
2017-04-11 14:07:16 -07:00
Kurt
4fec00dceb Simplify some legality checks
wurmple check expanded to work for all gens, ECPID broken up into
smaller methods
silcoon/cascoon string use the specieslist to fetch localized name
2017-04-10 19:00:58 -07:00
Kurt
c45a9f0428 Transfer legality for HGSS eggs
Faraway place (3002) can be retained on transfer
2017-04-10 18:46:37 -07:00
Kurt
6378eddc62 Add volt tackle special egg move gen3-5
Gen3 only has it on emerald
2017-04-10 18:20:58 -07:00
Kurt
6b65b905cc Cleanup
no need to do unchecked operation as the sum of 0x530 bytes will never
overflow 31 bits.
capitalize Japanese
2017-04-10 16:47:08 -07: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 ()
* 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 
2017-04-10 09:07:29 -07:00
Kurt
765d09fc16 Merge pull request 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 ()
* 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 ()
* 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 ()
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 ()
* 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 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 ()
* 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 ()
* 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 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 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 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 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