Commit graph

3048 commits

Author SHA1 Message Date
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
Kurt
7a508590a3 Update 170424
Updates wc7 event dbs
Fixes string raw copy for text editor
2017-04-23 21:44:12 -07:00
Kurt
dc911351fe Import pk2pk functionality
Exposes reflective conversion capability and sanity checking methods for
use in the class library.
2017-04-23 20:33:17 -07:00
Kurt
d84f101dc6 Store base type and matched type
parent class via Type, actual class via MatchedType. It's better to have
a general solution for future additions/separations (like
EncounterStaticShadow) or EncounterTradePID
add more encounter type recognition
override gen4 transferred encounter detection to prefer EncounterTrades
skip encountertype check if encounter is not valid

Closes #1091
Closes #1092
2017-04-23 17:53:22 -07:00
Kurt
4bf567c7b3 Add berryfix macro to gen3 RTC editor
arbitrary date set
2017-04-23 14:02:52 -07:00
Kurt
a9ff3aceaa Fix Navel Rock clearing issue
Closes #1090
Saving of the Battle Frontier symbols is clearing the flag

block2 ofs 0x40C = Navel Rock
block2 ofs 0x408 = symbols

bitconverter getbytes was fed an Int64 due to bit shifting ints and
uints. Forcibly cast to uint to keep only 32 bits -> intended behavior.

sneak in RNG readonly
2017-04-23 12:07:45 -07:00
Kurt
2b1bc213aa Prep for next wave of implementation
need to get a release out beforehand tho
2017-04-23 09:18:46 -07:00
Kurt
d402c1ee61 Merge pull request #1088 from javierhimura/master
Move validation for evolutions by move, and fix static typed encounters
2017-04-23 09:16:55 -07:00
Kurt
779d0a3b43 Merge pull request #1089 from pokecal/master
fix G4 Miscs
2017-04-23 08:57:56 -07:00
pokecal
748919bb71 fix G4 Miscs
for add DP stats
2017-04-23 23:55:29 +09:00
javierhimura
43eea1c93c Include MoveReminder in preevolution moves and post evolution moves 2017-04-23 16:50:36 +02:00
javierhimura
52b54c04d9 Reduced for in getValidPostEvolutionMoves 2017-04-23 16:48:23 +02:00
javierhimura
263f416edc Fix function name, this return all valid moves after evolving, not only the exclusive moves 2017-04-23 16:46:14 +02:00
javierhimura
710b126f60 Check moves for pokemon that evolved leveling up while learning a specific move, if they have 4 moves they must have at least the move that make them evolve or one move that can be learned after evolving
Fix generation 4 static encounters for those that have none encounter and those with not encounter type implemented yet
Fix comprobation of encounter type is static to include the new typed class
2017-04-23 14:54:52 +02:00
Kurt
016497bece Refactoring r2
Don't calculate suggested moves until prompted
Don't check EncounterType for gen7 pkm (no field to check)
2017-04-22 21:00:06 -07:00
Kurt
bcf1e63310 Refactoring
Simplify EncounterStatic type check as it is gen4 specific -> gen4
specific child class
Checks.cs: Move transfer legality check back to end as Gen4Result needs
to be defined (not null)
Rename EncounterType of Analysis class to avoid conflict with the
EncounterType enum
2017-04-22 13:04:12 -07:00
javierhimura
c847ef1d71 Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione

* Cave encounter types DPPt

* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf

* Added new legality texts

* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only

* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output

* Clean up

* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality

* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis

* Do not make wild encounters prevail static encounter if the pokemon was an egg

* Changed type of WildEncounter variable to EncounterSlot[]

* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 11:49:49 -07:00
Kurt
45066be82b Merge pull request #1084 from pokecal/master
add G4 BattleFrontier controls
2017-04-22 08:04:24 -07:00
pokecal
c2f1fb4df6 add G4 BattleFrontier controls
Editable many values. It seems a batch button needs,
but little demand, I have not made it.
2017-04-22 21:40:02 +09:00
Kurt
298691a94e Fix frlg wish egg legality checks
Add the second special move to the movepool
Closes #1069
2017-04-21 23:01:09 -07:00
Kurt
5bf14642e5 Expand logging for invalid batch edits
Closes #1003
If the pkm has a bad checksum/sanity or is in a locked slot, it never
incremented the counter. Just increment the counter anyway and write the
msg to console.
2017-04-20 21:04:51 -07:00
Kurt
5c96066b13 Slightly speed up database scrolling
no linq operations
still sluggish due to generating the sprites multiple times (not cached)
#1071
2017-04-20 20:52:08 -07:00
Kurt
0506359c41 Fix pk3 marking overflow issue
Closes #1062
Closes #1047
For those affected, use the batch editor to edit MarkValue from 255 to
0.

=MarkValue=255
.MarkValue=0
2017-04-20 20:37:08 -07:00
Kurt
346a9c9d4f Fix evolution invalid check
inserted optional param jumped in, resulting in incorrect inputs to the
method.
Closes #1080
2017-04-20 19:51:35 -07:00
Kurt
1aa386a537 Fix GC save cloning
optional method params led to calling the wrong method, just force all
params
2017-04-20 19:38:48 -07:00
Kurt
6bd2e3b20a Update egg related legality checks for g4
#1078
unhatched -> hatched when checking a hatched egg
faraway check for Pt as well as HGSS.
2017-04-19 21:39:05 -07:00
Kurt
36515b8178 Prevent moving boxes if any team slot is in box
Closes #1079
2017-04-19 20:54:49 -07:00
Kurt
ef35055d4e Fix directory not found issue
Thanks ArcticLoveBunny!
2017-04-19 18:47:42 -07:00
Kurt
757cf11f52 Database improvements
Reduce linq usage (toarray) and just use the actual index
Implement GetHashCode for Mystery Gifts to only add unique data arrays
#1071
2017-04-19 03:15:54 -07:00
Kurt
ceaf7547ad Merge pull request #1077 from wwwwwwzx/master
Fix Japanese choonpu in gen3 string
2017-04-18 07:26:57 -07:00
wwwwwwzx
3f51e119c7 Fix Japanese choonpu in gen3 string
Fix gen3->gen4 encoded value mapping. Also replace choonpu in gen4 unicode table
with later generation format.
2017-04-18 03:30:26 -07:00
Kurt
5d9962d102 Mark SAV as unmodified upon load
Closes #1076
seems kinda lazy as I didn't bother tracking down the suspect that
modifies the save (presumably the hex seed values); those should load
correctly and not change any bytes.
2017-04-17 23:36:46 -07:00
Kurt
3fcf92c9ba Misc tweaks
add namespace using, reduce nesting slightly
no functional change
2017-04-17 23:34:02 -07:00
Kurt
0ea8e392f8 Merge pull request #1068 from pokecal/master
adds for Gen3
2017-04-17 21:15:56 -07:00