Commit graph

690 commits

Author SHA1 Message Date
Kurt
3b635be77f Flag nonparsed
removed parsedvalid/invalid, unnecessary I guess
2018-05-22 18:57:39 -07:00
Kurt
c103220e0c Handle gen3->4->5 levelup evochain pruning
Gen7 weavile can exist in gen4 as sneasel; existing code had pruned it
from gen4. Skip pruning for this case
probably overdid the checks but whatever. works.

Thanks /u/ThrowawayReddNinja for pointing out this false flagged case
with an example!
2018-05-20 10:35:58 -07:00
Kurt
407cca38dd Update generator to handle link celebi
Had relearnmoves defined but no current moves; better for generator to
spit out all moves rather than the special move (hold back)

store current moves for all link gifts
2018-05-20 09:06:32 -07:00
Kurt
cd3b24c122 Handle smeargle generating
Needed moves is essentially none (unless you have invalid sketch moves).
2018-05-20 08:19:03 -07:00
Kurt
1f8c72af5a Handle EncounterTrade without moves specified
Similar to EncounterStatic handling
Thanks @architdate for pointing this out
2018-05-19 21:49:26 -07:00
Kurt
a7f9f69b02 Remove Type property
verbose summary uses the encountermatch's current type; the "x is y"
check is more than sufficient.
2018-05-19 12:21:16 -07:00
Kurt
b670f525fb Split up evolution classes
Too many classes in the same file, break up.

simplify things a little in EncounterArea (remove passing thru nulls,
should throw excpetion immediately if misconfigured).
2018-05-19 12:07:50 -07:00
Kurt
ca14b43b62 Relocate memory specific data to own file
allows easier handling for memory interactions
2018-05-19 10:04:07 -07:00
Kurt
23083317d7 Refactoring
pull out GameStrings

add debug output for crystal headbutt trees
fix qrpkm item access
2018-05-18 21:35:57 -07:00
Kurt
95b4d0820d Minor reorganization
amount of pkm obj classes is pretty high, move the static utility
classes to another folder

breaks usage of pkm.ShowdownText; removes a dependency from PKM.
2018-05-18 19:33:11 -07:00
Kurt
0e6db90de2 more minor tweaks
add 2 overloads for encounter generator
more simplifications
2018-05-12 18:11:47 -07:00
Kurt
99005d8fc0 Refactoring
more discards & simplifications
2018-05-12 12:28:48 -07:00
Kurt
e2f11edc43 Refactoring
discards, Array.Find over FirstOrDefault
2018-05-12 08:41:29 -07:00
Kurt
5a3c8f4147 Remove trailing whitespace 2018-05-12 08:41:29 -07:00
wwwwwwzx
997d41b6db Fix minlevel of Pangoro/Tyrantrum/Aurorus in gen6 (#1938)
* Fix minlevel of Pangoro/Tyrantrum/Aurorus in gen6

30: level + dark type in the party
32: level + day
33: level + night
34: level + female
Note Meowstic isn't affected due to another entry of level + male (23)

* Minor text usage fix

* Fix xorPID flipping in TransferEC check
2018-05-12 06:57:11 -07:00
Kurt
c2644cc9f0 Flag gendered pkm without gender
for lack of a better message
#1936

add some docs & trycatch bad wavs
2018-05-11 21:05:15 -07:00
Kurt
9fb7056837 Add test living dex generator
doesn't generate everything due to the evo chain not being 'full'
(instead is unevolved singular pkm), nor does it evolve pkm
2018-05-09 21:02:35 -07:00
Kurt
79b2576c31 add overloads for GetPossible
Remove edge case handling for level 2 blissey; updates over the past 2
(yay 2 years of legality checking) can now handle that case without
special handling.
2018-05-09 20:37:11 -07:00
Kurt
9f8e86b2b5 Finish rough generator
* handle gen6+ egg case where egg move count < 4 (cannot displace
Levelup lvl1 moves)
* handle minior altform case

generates all species/encounters possible, yielding 144,094 pkm files
(all detected as legal!)
2018-05-09 19:21:44 -07:00
Kurt
16ed4353b2 More generator updates
Store 4g giratina held item for enc->pkm legality
revise usages of GetSaneGender
Rearrange some logic
Better handle impossible version encounters (gen4)

gen 1-5 done, stuck on 659 - bunnelby egg...?
2018-05-09 17:50:56 -07:00
Kurt
4913ef9647 More generator updates
* B2 has an error in the encounter table for Route 3 Corphish Special
water encounter; GF edited from Basculin-1 to Corphish-1 and forgot to
update the form to 0.
* Ranch Trade egg locations
* Trade gender-PID set correctly
* static roamer glitch does not apply for emerald
* Mirage Island wild Wynaut case now allowed (collision with Gift Wynaut
egg hatched on Mirage Island?)

gen1-3 done; now at 413 (Wormadam) which currently yields an
EncounterEgg AS wormadam, which isn't right...
2018-05-08 21:17:31 -07:00
Kurt
c21f8bf45f More generator updates
Blazing past 251, now stopped at 280 (trade ralts, gender mismatch??)
2018-05-08 20:13:55 -07:00
Kurt
4d60a5a64e More generator updates
* first case of EncounterLink, now works (version, ability, OT memory)
* handle gen2 gb events (not even sure if they pop up, just in case)
* handle gen3 ereader shadow mons
* handle gen4 spiky pichu PID type
* handle gen2 crystal egg met level
2018-05-07 22:53:36 -07:00
Kurt
8902e9662c Add exclusive encounter handling
Handle Faraway Island Mew, handle DP Darkrai/Shaymin & Arceus, handle
not-distributed WC3s.

Now stopping at dex 154 -- one full generation of PKM species IDs can be
completely spawned directly from IEncounterable data!
2018-05-07 22:12:12 -07:00
Kurt
3c31d5798f Continued pkmgen updates
* adds g4 forced shiny seed->pid (Chain Shiny Lake of Rage Gyarados)
* adds cxd starter pid generating handling
* adds g5 forced shiny seed->pid (MG5Shiny Shiny gift Dratini)
* excludes gen4 route45 surf impossible encounters
* actually use ingame trade edge case handler

Up to dragonair (147) yay; yellow dragonair is likely the catch rate
edge case.
2018-05-07 21:16:54 -07:00
Kurt
86bf4201e2 Remove encounterstatic-encounterslot collision case
Exeggutor Island has wild & one static with a fixed ability; the fixed
ability is returned first which causes wild lv40 exeggutors with
ability2 (1/2/H) to be flagged as illegal.
2018-05-07 21:12:42 -07:00
Kurt
734edfae20 Remove cutecharm swarm restriction
only affects species (can't force gender on a fixed gender swarm slot)
https://github.com/kwsch/PKHeX/pull/1314

https://projectpokemon.org/home/forums/topic/45153-bug-cute-charm-swarming-illegal/

Add swarm cutecharm test cases from thread, thanks @PP-theSLAYER !
2018-05-07 16:14:31 -07:00
Kurt
ea2c6260fa Prevent providing beta safari zone encounters
Fixes Krabby / etc.
Fix genderless encounterstatic gender set (Voltorb)

Now at 103, Exeggutor
pretty cool that over 100 species can have every single encounter
generate a legal pkm ;)
might be useful to add metrics to count how many encounters are
generated in a session
2018-04-29 21:56:12 -07:00
Kurt
ab71ea2d8b More generator updates
Graveler (SM Trade) -> Force applying handling trainer details for
ingame trades
Ponyta (Ranch Trade) Apply correct ability for encountertradePID

Up to 98 : Wild Gen2 Krabby (safari zone impossible location needs to
get filtered from possible encounters)
2018-04-29 21:29:34 -07:00
Kurt
997ca29fe6 More generator updates
Checks.cs : fix duplicate analysis result (encountertrade machoke is
legal & illegal), nope, legal.
Core.cs : Add version bypass if none assigned.
EncounterSlot.cs: Handle yellow kadabra
EncounterTrade: Handle must-evolves.

now at 75: graveler (SM trade)
2018-04-29 21:08:49 -07:00
Kurt
1c3a330ab2 Remove clefable from non-obtainable encounters
Can be obtained via game corner
update possible games of origin
clear wasegg flag for next iteration

now at species 64: Kadabra.
2018-04-29 20:04:13 -07:00
Kurt
50d390bd4e Fix gen1 trade version overwrite
only noticable when generating from

up to dex 35, clefairy now. I expect things to ramp up soon...
2018-04-29 19:03:55 -07:00
Kurt
daf093879b More generator updates
all the way up to nidorina

extract some reusable methods
exclude invalid headbutt encounters
use built in randomgender
2018-04-29 18:26:36 -07:00
Kurt
b1549837b1 Update gen2 ingame-trade met location handling 2018-04-29 11:46:49 -07:00
Kurt
b353701d3e More generator updates
adds pokewalker handling

now stuck on GSC Trade Spearow (likely not setting OT details as needed)
2018-04-29 11:33:35 -07:00
Kurt
4214b1be7b More generator fixes/improvements
Fix/add missing gameversion references (BU instead of BW,
pokewalker=HGSS)
increase reuse of pidgenerator & add more generating methods.

seems like it's generating pkm fine besides the PID edge cases, which is
nice
2018-04-29 09:31:13 -07:00
Kurt
08603c5664 Fix xd miror b encounters not receiving versionID
version was set to Encounter_XD, which did not contain the miror b
encounters.

simplify XD check to be O(1) now that version is stored in the encounter
obj
2018-04-29 08:31:57 -07:00
Kurt
120f5380c9 Rework some more pkm generating logic
can get all the way to caterpie
- gen3/4 needs an antishiny,
- gen5 needs shiny&antishiny mech
- else case needs both as well.
2018-04-28 22:56:10 -07:00
Kurt
70992138e2 Misc encounter->pkm generating fixes
eggs for Gen1 must be generated in Gen2
gen1 wild encounter initial moves
gen4 abilities have 0 for single ability mons
2018-04-28 16:30:56 -07:00
Kurt
55f0143400 Handle generating gb2 events & eggs
restrict the simple encounter provider to not spit out cart era only
gifts.
2018-04-28 15:59:33 -07:00
Kurt
b2c54b7a43 Apply trade memory when changing handlers for pk6 2018-04-28 15:58:53 -07:00
Kurt
ea357cd57a Add GetRandomFeeling
fixes tests & transfers where an explicit range is not legal
2018-04-28 12:59:11 -07:00
Kurt
71faaee31c Refactor savefile tid/sid to int
can now use TrainerID editor control on a savefile... soon?
2018-04-28 11:06:58 -07:00
wwwwwwzx
fc72323c2e Add general memory intensity/feeling check (#1916)
* Add general memory intensity/feeling check

Memory setting subroutines: Y: sub_43C1E4 AS: sub_469A94
Memory table RAM address: Y:0x54A4F0 AS: 0x58A134
https://pastebin.com/h1RHL7nR

* Check if egg's OT memory is blank

All empty memory should be checked before common check.
Don't allow eggs to fall through.
2018-04-28 06:26:04 -07:00
Kurt
af8084fd34 Rework cosplay pikachu static encounter population
Now IV3, thanks @wwwwwwzx for finding the hard-coded case (Lati@s is
already IV3).

https://projectpokemon.org/home/forums/topic/45011-illegal-cosplay-pikachu/?tab=comments#comment-230318

remove SkipFormCheck, and just have all 6 populated (so that Form0
pikachu doesn't slip through).
2018-04-27 21:53:00 -07:00
Kurt
3f6b1acc93 Add fixed gender checks for non-GBA/NDS games
Closes #1912 , genderless ~= fixed gender I guess; shouldn't get these
gender-errors unless it's manually tampered data/ShowdownSet

remove unnecessary code in:
* PKMEditor (>=255 is already covered by == 255 and the fact that gt is
always <= 255)
* VerifyGender (3 <= x <= 5) check is already early-returned via
PIDGender check above

Update IsGenderValid knowing that VC mons have a gennumber <= 2
2018-04-23 19:58:29 -07:00
Kurt
1b4ec11335 Add rebattleable Miror B locations to xd shadows
https://projectpokemon.org/home/forums/topic/44957-bug-pokemon-xd-post-game-shadows-flagged-illegal/

if shadow lock sets are ever implemented, would need to update this as
well to 'clone' with the different shadow teams available.
2018-04-23 17:14:52 -07:00
Kurt
0b62ab85a1 Nature -> byte instead of int 2018-04-21 09:18:53 -07:00
Kurt
159928b09b Remove soaring as valid egg hatch loc
hatch ctr doesn't update (steps don't count while soaring)

https://projectpokemon.org/home/forums/topic/44854-is-it-possible-to-hatch-an-egg-while-soaring-in-the-sky/?tab=comments#comment-229931

could probably rename the hashset to indicate that it's only used for
egg hatch locations...
2018-04-18 16:01:12 -07:00
Kurt
c3494c61c1 Fix encountertime comparison for surf mons
surf does not have another slot set; so they were all being set to
Morning.
Could have set all 3 time flags, but kept as 'any'.

will update release binaries with this one
2018-04-18 15:58:21 -07:00