Commit graph

3081 commits

Author SHA1 Message Date
Kurt
a01e164e2e Misc fixes
Add a few more locations for cxd, restrict balls for gift pkm, fix cxd
fateful gifts (loc 254 not first entry in combobox), add special gift
pkm moves (bite for umbreon/eevee), add xd mt battle starters

probably needs more work for fateful determination (obedience flag vs
254 met loc).
2017-05-11 00:15:17 -07: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
d874092e58 Add missing parenthesis 2017-05-10 21:37:54 -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
71b9141962 Split Dream World special move entries
The structure of the downloaded dw pkm only allocates one move; thus,
only 1 special move can be obtained (not 2+). Ends up creating extra
entries.

Eg: Wobbuffet can't have Charm and Encore at the same time in gen6 if
originated from Entree/Black.
2017-05-10 19:01:01 -07:00
Kurt
6d9cbaaec0 Add IOException type write protection check
per recent forum thread
2017-05-10 19:01:01 -07:00
Kurt
5a96169cc2 4->5/6 transfer encountertype preference fix
Add a preference check when appropriate so that invalid encounter types
are not preferred over the wild encounters that may follow.

Closes #1095
2017-05-10 19:01:00 -07:00
Matt
753d18b751 change more Forme displays (#1113)
Xerneas-Normal => Xerneas-Neutral
Zygarde-Normal => Zygarde-50%
Mimikyu-Normal => Mimikyu-Disguised
2017-05-10 12:30:52 -07:00
Kurt
8ff762ce91 Update readme
Updates Hoopa-Normal to Hoopa-Confined
Updates preview image to better reflect current gen7 appearance

Closes #1110, unused as the proposed readme image was boring and hoopa
change copied
2017-05-09 21:36:30 -07:00
Kurt
a4565d71f6 Handle gen4 egg nickname edge case
Egg is not saved as "EGG", it is "Egg". Nice job gf.
Instead of ignoring the nickname flag, detect if it should be used or
not.
Gen4 never uses it. Gen7 doesn't use it when it's a gift, but uses it
for daycare eggs (...).
Closes #1100
2017-05-09 21:11:13 -07:00
Kurt
9eae35ba34 Add uncapturable edge case beast ball
can't catch these in a beast ball as the only encounter is a gift
(porygon & evos, and aerodactyl)

#1100
2017-05-09 19:27:30 -07:00
Kurt
8154af64c3 Fix gen1/2 evo move edge case
Closes #1112
Encounter matched was set to an egg (err 1, core.cs), and the GB
encounter info was not set (err 2, checks.cs).

Fix by preventing eggs if Gen2 is disallowed (reuse allowg1tradeback),
and set the species if it is an egg (future case).

switch pidiv return to null, as it should always be null (not whatever
is returned by the last pidiv finder).
2017-05-09 19:07:21 -07:00
Kurt
d0e2b7784a Fix g4 ingame trade exception
Resolves the Internal Error exception where the EncounterMatch was not
overwritten; in the case of some encounters, an encounterslot[] was
provided -> invalid cast
#1095
2017-05-09 17:55:58 -07:00
Kurt
95eefb45ff Add hidden ability mismatch check for fixed abils
minor refactoring
remove GameVersion.Pt unreachable code for eggmoves
2017-05-08 20:35:06 -07:00
Kurt
cfc99f064f Clean up g7 encounter info
Remove uncapturable static encounters. Location = -1 was never matched;
was a leftover from initial support where encounters were assigned a
location if captured. pk3DS now serves as the raw info view.

Remove ability forcing for Zygarde core encounter
2017-05-08 20:33:42 -07:00
Kurt
f0dcf2b6b2 fix vivillon evo tree branch duplication
doesnt branch per form, formstatsindex is 0.
2017-05-08 20:20:52 -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
Kurt
99b243b4fa Handle CXD egg encounters
There are none. But the detection routine for gen3 can assign cxd pkm as
egg if no other possible encounter is matched, thus we'll flag if the
failure case occurs.

add missing spacing formatting, simplify break->return for egg game
retrieval
2017-05-02 19:08:16 -07:00
Kurt
a5cfaed574 Fix typeinfo exception when loading gen2 saves 2017-05-02 18:03:42 -07:00
Kurt
848c10f096 fix unown bade check
! =
2017-05-02 08:59:55 -07:00
Kurt
24b55b7b79 Add gen3 roamer pidiv detection
add shiny lock for spiky eared pichu
fix wurmple ECPID comparison (only continue if ALL are wurmple)
slightly speed up comparison of LCRNG spreads, may be worth applying
same approach to others.
2017-05-01 23:41:19 -07:00
Kurt
f1db88026b Add frlg unown PIDIV type
The modified form-finding routine generates the PID gen halves in the
reverse order like events. Due to possible collisions with event PIDIVs,
only run it for unown (since that's all it applies to); the analyzing of
PIDIVs to find incorrect usages isn't really feasible (collision) for
this one.
#1103
2017-05-01 08:37:23 -07:00
Kurt
f19d85002b slight tweaks
reduce nesting, formatting; no functional change
2017-05-01 08:25:20 -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
ad6a48b7f1 Add gen3 force shiny event PIDIV detection
matches for berry fix zigzagoon

use correct type comparison for checking if national ribbon is to be set
or not; change XDC to CXD for parity with other references
2017-04-30 22:11:51 -07:00
Kurt
527a830bae Add moon ball for gen4 captures
Closes #1102, Moon Ball is id 23 (0x17)

also:
fix spacing of previous commit
2017-04-30 18:28:29 -07:00
Kurt
a2972b6939 Add EncounterType for E-Speed Dratini
#1095
2017-04-30 17:01:47 -07:00
Kurt
0bad6738d4 Add C/XD specific checks
Pokespot: a given PID will satisfy ~37% of the time, flag pokespot
encounters
I can see hatching eggs being a problem, no idea how this would work
2017-04-30 16:53:54 -07:00
Kurt
1ff2a0fdfa Add preliminary CXD checking
quite a few shadow pkm are obtainable in multiple locations, feeling
like duplicating the entries with different location IDs is the way to
go
2017-04-30 12:17:27 -07:00
Kurt
2a28019ef3 Add gen3 event pidiv detection
includes antishiny mechanism detection, needed 2 new enum values to tag
those.
handle overflow case
2017-04-29 23:18:36 -07:00
Kurt
f613960cdc Fix viewing legality as ck3/xk3
ChecksumValid was returning false
2017-04-29 23:13:21 -07:00
Kurt
e814e7291f Add chain shiny and shinyPGF pidiv detection
delete incorrect legality message entry (used a few lines up for super
training flags), is unused.
fix for transferred 8<=xor<16 PIDs in which case the encryption constant
is used (as it is the unmodified PID)
2017-04-29 20:04:54 -07:00
Kurt
6685ae6228 Sync remaining changes
yay
2017-04-29 16:35:32 -07:00
Kurt
82375ca464 Add PIDIV matching
Includes 1 test for each pkm pidiv type, haven't added absolutely every
method possible but it's enough for now
2017-04-29 16:22:32 -07:00
Kurt
2f0eedbe7c Slight refactoring
use a list to collect legality report instead of building a string
remove unnecessary null check (already checked prior)
2017-04-29 15:45:21 -07:00
Kurt
8a5cf27f61 Fix SAV3 block not found editing
Block 4 is used by the pokedex setter, don't set the bitflag if the
block is yet to be initialized in the save file
Closes #1101

Convert a bunch of scattered magic numbers to constants; no functional
change besides a possible resize of SeenFlagOffsets to chop off missing
block offsets.
2017-04-28 18:03:20 -07:00
Kurt
96a20f0ae5 Remove pk7 fullness/enjoyment clearing
https://projectpokemon.org/forums/forums/topic/40552-fullness-and-enjoyment-pkmn-sun-and-moon/
2017-04-28 17:29:02 -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
3c4d541aeb Merge pull request #1096 from javierhimura/master
Fix issue #1095 and gen 4 egg encounter issue from forums
2017-04-25 18:13:07 -07:00
javierhimura
e186e4a344 Spiritomb is summoned in the outside are of Route 209 from a non-grass tile, that make it an encounter with type none instead of building 2017-04-25 22:54:58 +02:00
javierhimura
29a2b20013 Add maniac tunnel to cave locations 2017-04-25 22:49:15 +02:00
javierhimura
0e3815b048 Fix issue with egg pokemon reported in the forums, gen 4 transfer analysis was returning wild encounters for a pokemon that was egg
Fix issue #1095, added encounter type for swarms and pokeradar safari
Split DP and Pt fossils, they have different encounter type
Change Drifloon to encounter static without type, that stationary pokemon is not in a tail grass tile
Added Burned Tower Suicune Encounter Type
2017-04-25 22:40:10 +02:00
Kurt
6164bc8ceb Merge pull request #1094 from javierhimura/master
Fix error in transfer legality G4.
2017-04-24 18:31:08 -07:00
javierhimura
4f371dbe35 Ignore static encounters if pokemon is insde a safari ball or inside a sports ball, to fix error on Voltorb from HGSS Safari that is mistaken from HGSS static voltorb 2017-04-25 02:55:56 +02:00
javierhimura
1dc6204b61 Fix error in transfer legality G4.
Transfer legality is not checked if the pokemon is a valid static encounter, also an Entei with invalid encounter is returning null as check encounter making the analysis to throw an exception, reported in the forum. Instead check transfer legality and do not return checkresult until the end to add invalid values if Gen4Result is null.
2017-04-25 02:42:15 +02:00
Kurt
e0dc6bce47 Merge pull request #1093 from javierhimura/master
Fix Encounter Type checks
2017-04-24 12:26:46 -07:00
javierhimura
4d9cd1cfc2 Fix Encounter Type checks
Added bug contest as tail grass encounters
Illex Forest as cave encounter
Mark encounter types in the final encounter array to avoid have none encounter in any alt slot
2017-04-24 19:42:27 +02:00