Commit graph

98 commits

Author SHA1 Message Date
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
javierhimura
ea86032480 Comments and a fix for AllowGen2Crystal function 2017-09-23 21:00:57 +02:00
javierhimura
f3743e490b Korean language restrictions
Restriction happens because Korean can not trade with non-Korean GB era games
- There is no Korean release for gen 1 pokemon, included VC
- With no gen1 pokemon means any Korean gen2 is Gen2_NotTradeback, that means no gen1 origin nor moves are Legal
- Crystal was never released in Korean
- Pokemon Stadium 2 was never released in Korean, that means no move reminder for gen 2 korean pokemon

- Generation 4 can not trade between Korean and not Korean games, but Korean games can use the palpark with any language

Chinese language restrictions
There is no Chinese release for gen 1 and 2 pokemon games, VC Chinese games are in Japanese
2017-09-23 20:46:10 +02:00
javierhimura
eda97f4b49 Do not allow gen2 preevolutions for VC1 pokemon in generation 7 2017-09-23 13:16:33 +02:00
javierhimura
f129701ee6 Do not allow gen2 evolutions in generation 2 for VC1 pokemon, gen2 preevolutions are allowed 2017-09-23 13:12:03 +02:00
javierhimura
efc60c3bf8 Change VC1 pokemon tradeback initial status to allow VC2 origin, there is no way to know if the pokemon was traded to gen7 after or before VC2 release
Do not allow gen1 evolutions for VC2 pokemon without gen1 evolutions or preevolutions
2017-09-23 12:58:46 +02:00
Kurt
6e579abfc3 Misc changes
* allow gen2 to have evolutions on gen1 when transferred to gen7
(Core.cs)
* handle korean strings on transfer slightly better (pk2.cs)
* auto-set johto location when changing game ID
* auto-detect VC saves (all have extensions with .dat)

Closes #1478 , thanks @NinFanBoyFTW !
2017-09-22 17:54:43 -07:00
Kurt
a21a70ee4c Fix gen2->7 encounter move args
#1476
suicune water gun
2017-09-22 15:33:33 -07:00
Kurt
aa3393e5b2 Misc languageID legality checking update
Checks for max language ID on transferred pkm (gen5 pkm on gen7 can't
have CHS/CHT etc)
handles edge case for JPN B/W ingame trades
update pk5->pk6 transfer logic to bump langID 0 to 1.
Thanks HaxAras & Britty for providing samples!
2017-09-15 17:43:31 -07:00
Kurt
387d9375c3 Refactor split gender breeding logic
Inherit Levelup moves & hidden ability (gen5) issues addressed
2017-09-14 18:52:34 -07:00