Commit graph

107 commits

Author SHA1 Message Date
Kurt
e6765d3691 Flag langid=0 when appropriate
only jpn bw ingame trades can lack a languageID.

skip language checks for pk1/pk2 as they have no language stored.
2018-05-26 14:40:02 -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
ca14b43b62 Relocate memory specific data to own file
allows easier handling for memory interactions
2018-05-19 10:04:07 -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
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
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
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
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
ea357cd57a Add GetRandomFeeling
fixes tests & transfers where an explicit range is not legal
2018-04-28 12:59:11 -07:00
Kurt
a48c70ccf2 Add evolution minbound check
https://projectpokemon.org/home/forums/topic/44834-bugabout-event-evolution/?do=findComment&comment=229887

(espeon at level 50 originating from a level 50 eevee gift is not valid)
2018-04-17 20:06:23 -07:00
Kurt
fef1d6e0dd de-linq some evolution dexlevel fetch
use shared IList interface instead of IEnumerable
2018-04-17 19:56:43 -07:00
Kurt
8250bc58cd Fix levelup->evo fetching of next levelup move
Correctly fixes #1163 (test cases added), eg wooper->quagsire would
learn yawn at 31 before evolving; the getmoves wouldn't provide yawn
(stopped at 30) with the old code; the lvl decrement was removed in the
incorrect commit, providing a legal verdict which was obtained
incorrectly (dexlevels were inaccurate)
2018-04-17 19:49:33 -07:00
Kurt
b38abc22e2 Refactoring
add IVersion interface with common interactions
2018-03-30 16:31:40 -07:00
Kurt
214e684ff8 Add GetEncounterMoves method
dictionary mapping common gameversions to their associated obj
2018-03-30 01:02:22 -07:00
Kurt
452ffe2369 Refactoring
relocate location of stuff
2018-03-08 21:18:32 -08:00
Kurt
cbf4038a95 Refactoring
relocate gift data storage out of legal.cs
2018-03-05 22:19:56 -08:00
Kurt
38fb30e847 Remove Punishment from Murkrow USUM eggmoves
Closes #1829

"In Pokémon Ultra Sun and Ultra Moon, Murkrow is programmed to be able
to learn Punishment through breeding, but no other Pokémon in the Flying
Group can pass down Punishment as an Egg Move in those games. Vullaby
and Mandibuzz are the only Flying Egg Group Pokémon that can learn
Punishment, but they cannot pass down the move due to being female-only
species."
2018-02-10 18:56:06 -08:00
Kurt
14fc71a5d2 Fix Zygarde Aura Break formechange detect
original was AltForm != 1, 0 is also invalid so >1 suffices.
remove parameter from method & update usages
2018-02-03 21:12:36 -08:00
Kurt
b603bc87b8 Update shedinja ninjask move checks
check level of source moves for any incompatibility in non-bred cases.
Closes #1805
2018-02-01 19:57:02 -08:00
Kurt
4ac92b9418 Update nincada->shedinja evo chain check
Thanks @admiral-fish & @Marty-D !
2018-01-29 20:52:05 -08:00
Kurt
5472f869cf Remove some crystal vc checks
now legal
assuming x->kor7 sets the language val based on the cart language,
should be good for the kor crystal checks.
2018-01-25 09:14:25 -08:00
Kurt
029539003b FormChange check: use original form not current form
Closes #1758
noticing the different usage for species (encounter species vs current),
iterating over possible dexlevels (unnecessary?)
2018-01-13 12:10:17 -08:00
Kurt
c751c987a9 Add DebutGeneration get
https://projectpokemon.org/home/forums/topic/43378-generation-search-in-pkmdb-andor-batch-editor/

(less than) < and (greater than) > not currently supported (no plan to
add, would need to rewrite value eval logic)
2018-01-10 15:40:33 -08:00
Kurt
5bc2e6da88 Refactoring
de-linq some areas where direct accessing is possible (list/array)
2017-12-04 20:16:54 -08:00
Kurt
3483b4bb91 Clean up vc2 legality/transfer stuff 2017-11-24 10:13:42 -08:00
Kurt
6d3ee54d44 Reorder case fallthrough
closes #1631
based on
5859daf1d8
any case -> reverse game order
2017-11-19 13:15:32 -08:00
Kurt
5859daf1d8 Add maxspecies checks for gen7
accesses arrays outside the range for the new USUM species
Closes #1631 , add test case
also adds lycanroc test cases for #1630
2017-11-18 21:50:48 -08:00
Kurt
f7e20a3c43 Misc tweaks
fix roamer3 not setting IVs
fix usum z items rightmost pixel getting chopped off
use Gen* instead of GenNumber for specific cases (faster)
add WasGiftEgg location case for Gen7
remove some unnecessary array allocations
2017-11-17 22:19:23 -08:00
Kamron Batman
d2d04075bc Replaces PCD.pkl with WC4.pkl. Tested and working. 2017-11-17 08:11:49 -08:00
Kurt
064d18c13f Add necrozma special forme moves
not present in the levelup movepool like they should be...
2017-11-12 09:17:59 -08:00
Kurt
af91388792 Return empty enumerables for invalid table fetch
shouldn't ever be called but best practice
2017-11-09 22:17:55 -08:00
Kurt
55820246cf Misc tweaks
mark SOS slots for usum, only permit varied alolan evos to be forme
changed (blocks totem raticate from being matched to non totem forme
inputs)
2017-11-09 16:18:30 -08:00
Kurt
ae773f189b add usum tutor data
one large list at static.rodata:005E6860, formatted to look like AO
table with deletions & insertions at the bottom.
bitflags are used in one large set (not 4 chunks of 4 like prior).
2017-11-08 01:25:10 -08:00
Kurt
9cac3738dc Add handling for mid-chain lowlvl encounter evos
haunter caught at level 20, transferred at 24, leveled once as gengar
did not allow gengar in the chain as it is assumed (incorrectly) that
gengar is evolved after transfer.

determine if the lower levels of the next step's evolution rung are
valid, using the same logic as pikachu case but to handle the other side

Closes #1564

(should probably refactor the encounter chain generator to use the base
encounter data if known, but oh well works fine and isn't a cpu hog)
2017-11-06 18:21:58 -08:00
Kurt
60e719a65a Misc refactoring
more usum prep
don't allocate empty array on every savefile creation (use linq All
comparison)
add percent seen/caught savefile properties for data analysis purposes
2017-10-31 09:24:54 -07:00
Kurt
60562fb44e Use empty enumerable when appropriate
no allocation == no pressure for garbage collector
2017-10-23 15:44:01 -07:00
Kurt
a03ac10fc5 Misc refactoring
no functional change
2017-10-22 23:26:37 -07:00
Kurt
44c80bd722 Exclude light ball pikachu from gen1 species setter
Thanks Dunsparce!

https://projectpokemon.org/home/forums/topic/41880-yellow-version-pikachu-editing-bug/

non-functional change but fix misuse of gameversion checks (used X/Y
instead of YelloW)
2017-10-22 17:11:48 -07:00
Kurt
528593b59e Disallow crystal tutors if VC 2017-10-21 19:01:23 -07:00
Kurt
a75614ed77 Modify eggmove fetch
fetch is exclusively done with version already known; there are cases
where version can change for eggs so it's safer this way.

version change reference (gen6+):

212a489335
2017-10-19 21:20:47 -07:00
Kurt
c7dfc3d9b0 Cleanup
union / count usages
remove unnecessary stuff
2017-10-06 21:03:23 -07:00
Kurt
059451d66e misc tweaks
dictionary species check, max deviation beginnings for USUM
simplification for gen1/2 pokemonlists
2017-10-05 22:37:45 -07:00
Kurt
593f31ff02 hashset contains over array contains
faster++, reduces some linq ToArray() allocations
2017-09-30 14:08:35 -07:00
Kurt
212a489335 Add gen6+ link trade egg edge case
slakoth with play rough with x/y version
why u modify game origin when hatched???
2017-09-28 17:11:30 -07:00
Kurt
ccf9cd2284 Update japanese translation
Thanks smileynation!
2017-09-24 14:44:27 -07:00
Kurt
499126f9a4 Update gen1/2 move fetch
recent commit changed GetEncounterMoves to return 4 always rather than a
variable size array; double check the output for actual movecount
2017-09-24 12:39:12 -07:00
Kurt
9ef2016d35 Encounter Learnset move duplication fix
a level 15/16 magmar has leer/smog twice in its learnset (at level 1 and
at actual levels); returning just the 4 previous learned moves at level
15/16 yields duplicates for Smog. [Smog, Leer, Fire Punch, Smog | Leer,
Ember]. By ignoring moves already added, the true movepool is acquired

also fix TradebackType getting overwritten at the end of the method (in
case of nontradeback like korean/egg)
2017-09-24 10:36:16 -07:00
Kurt
d8c2cdb8e3 Use EnumerateFiles over GetFiles in some cases
https://msdn.microsoft.com/en-us/library/07wt70x2.aspx

iterating as an ienumerable (ie not consuming the whole collection) can
be more efficient by not waiting for the whole collection
2017-09-23 17:02:28 -07:00
Kurt
7974943bcf Refactoring
slight simplification related to #1486
2017-09-23 16:24:22 -07:00