Commit graph

594 commits

Author SHA1 Message Date
Kurt
9191f023a3 Minor clean
Nullability annotations and some logic simplification
2020-09-06 11:24:54 -07:00
Kurt
cf9e5ec37f Minor refactoring
Change Ability array to IReadOnlyList, add method to check ability index in personal data
Suppress some message warnings
Change EvolutionChain short-circuit for VC to jump from gen6 directly down to gen2. There aren't any notradeback 1 situations, so a notradeback1 will always start with g=1, so no need for the other if-continue.

Simplify pk5 conversion
2020-09-06 10:53:13 -07:00
Kurt
c1adab9703 Refactoring
Move logic closer to where it is used rather than in larger static classes

EncounterStatic(7): move VC transfer template creation to class, simplify some sanity checks
EvoChain: g==2 case is never hit as the generation check at the top of the loop already skips
2020-09-05 12:11:43 -07:00
Kurt
6b472ffd62 Misc iencounterable->pkm generator fixes
Still some pending stuff like bad mystery gifts

gen2 static encounters on g/s applying met level and not location
gen6 ralts trade (no nickname) being flagged as nicknamed when it shouldn't
gen4 manaphy egg not having a hatch location (worked fine if you transferred it up)
gen3 antishiny gifts not setting their PIDs (jirachi WC3)
gen5 N's pkm gifts setting the wrong nature
gen3 unown not being generated correctly, cosplay pikachu being allowed form0, non-BugCatchingContest no longer require Sport ball, oras dexnav marill now uses the azurill eggmove table
2020-09-03 19:00:46 -07:00
Kurt
c2ec4d55e4 Minor clean
Add some xmldoc, remove some empty lines, move some small logic pieces to a better spot
2020-09-03 14:28:51 -07:00
Kurt
c146e9402f Reduce visibility of internal legality enum 2020-08-30 15:48:34 -07:00
Kurt
a09bac5976 Prevent gmax cap pika
silly stuff indeed

there aren't any other formed-only-mons in the gmax list
2020-08-29 15:09:37 -07:00
Kurt
1ee459a46c Use language for checking IsNicknamed flag 2020-08-29 10:40:41 -07:00
Kurt
dc9aa7b1df Update extra byte list
0x90 is for dynamax level
2020-08-27 08:37:23 -07:00
ReignOfComputer
f313321126
Gen 4 French Egg Fix (#2978)
* Gen 4 French Egg Fix

Mauvais œuf, je le réparerai. Bon appétit!

Fixes Gen 4 edge case reported by Taya on Discord.

* Tweak flow to handle gen2

Add a comment to indicate why this special handling is required
2020-08-26 10:18:10 -07:00
Kurt
a62324a5a1
Refactoring some IEncounterable-type'd object initialization and original-generation evo chain (#2974) 2020-08-21 16:35:49 -07:00
Kurt
890f3375c9 Misc clean 2020-08-18 15:39:45 -07:00
Kurt
adb55c9e7b Make CanToggleGigantamax have a form argument
no more meowth-1/2 and or perrserker
Closes #2973
2020-08-16 23:06:49 -07:00
Brian Fischer
c4e9bbcc45
Changes to suggested hyper training logic (#2968)
- Changed suggested hyper training logic to not hyper train over some possibly intentional unusual speed IVs
- Showdown import will not do any hyper training on pokemon encountered in gen 8, because with Hidden Power removed from the game in gen 8, all specified IVs in the showdown format are guaranteed to be deliberate for stat purposes.
2020-08-14 21:49:01 -07:00
Kurt
67cea47b56 Fix move record flag check overflow to tracker
Would return true if tracker is set; this bool is only checked if is egg.
Add a check for eggs with home tracker.
2020-08-11 19:42:40 -07:00
Kurt
12d9397c8c Split GO from "GG" gameversion
Make Gen7b as the combined ver for that expression
2020-08-06 18:24:20 -07:00
Kurt
00443dcae4 Minor clean
add xmldoc
remove unnecessary array resizes (see 9f20aa2f4f )
show more extrabytes for gen8; remove unused byte accessor functions
2020-08-02 15:51:22 -07:00
Kurt
3bae646b18 Remove virtual get/set value storage
reduces object size for formats that do not have that kind of data, since they don't need a backing field for ptr/val
2020-08-02 11:25:23 -07:00
Kurt
85d1b0e7ad Split gen6/7 affection stats to interface
not in future formats, doesn't belong
2020-08-02 11:06:30 -07:00
Kurt
e84ce77008 Split memories from main pkm class to interface
pk6/7/8, not pb7
2020-07-31 17:25:14 -07:00
Kurt
b7211000b0 Split Country/Region/ConsoleRegion from ITrainerInfo
Only present in mainline gen6/7 game pairs, so it's not wise to have it for all games
2020-07-31 13:53:42 -07:00
Kurt
27f15d2f20 Split Country/Region/ConsoleRegion to interface 2020-07-31 11:17:31 -07:00
Kurt
12b8060ec1 Use byte instead of int 2020-07-21 23:43:34 -05:00
Kurt
4cb283981b Remove linq from list init, manually allocate
Add some docs cuz gen1 structures are always spooky

gen1 not being exactly same as gen2, and jp != int => 4 different sizes of spookiness
2020-07-21 20:56:41 -05:00
Kurt
d3863f9c63 Minor tweaks
verify relearn: move split check before method call
movelist: don't capture pkm in local method; meowstic ID
pkm: flip argument for easier understanding
2020-07-19 18:30:46 -05:00
Kurt
9f20aa2f4f Remove unnecessary comparison
in Array.Resize, an array is only created if the size is not equivalent
we're just repeating the same logic; let the jit optimize out the null check
2020-07-19 16:35:31 -05:00
Kurt
eb7ed44b29 Finish splitting gen1/2 encounter types from parent class
Results in a little more code, but each path is less tangled
simplify some expressions
remove RBDragonair content in favor of a strict filter for catch rate

Move gen1 trade trainer names to stringconverter, since pk1/pk2 shouldn't refer to legality classes
2020-07-19 13:32:40 -05:00
Kurt
ea609d43a5 Move soup to gmax class (extension methods), fix home gmax starters
Directly accessing CanEatMaxSoup is now forbidden :)

Fixes home galar starters being flagged when gmax-final evos
2020-07-16 21:04:27 -05:00
Kurt
e04b96a9b3 Fix dizzy punch egg recognition & gen2 hatch conter verification
Closes #2939
Fixes #2938

Inline some logic where appropriate for egg levels
2020-07-12 20:58:07 -05:00
Kurt
993673f0de Minor clean
no functional change
2020-06-27 23:36:53 -05:00
Kurt
a7ba178005 Remove unreachable/const logic
Earlier compares result in some logic being unnecessary

The Gen7 level up move compare was actually an oversight, so it's a worthwhile fix :)
2020-06-27 22:44:14 -05:00
Kurt
c565c7ca2c Extract move suggest logic, add battleversion clamp
Closes #2911
2020-06-27 13:06:28 -05:00
Kurt
1ae9cb7602 Handle pika/meow soup evolutions
Can lose gmax flag if its current species is able to eat soup, or its origin species could eat soup

this handles stuff like charmander->charizard, as charmeleon would not pass

hopefully there's never a mid-stage evo that has a gmax form, and its final evo doesn't... (don't get any ideas, gamefreak)
2020-06-24 18:59:26 -05:00
Kurt
6fb2ebe039 Minor clean
add some xmldoc
2020-06-21 19:46:06 -05:00
Kurt
fc4ba1df35 Bounds check ability requested
no longer exception's on RefreshAbility(negative number)
2020-06-21 18:16:18 -05:00
Kurt
645db23706 Extract EvoBase and MoveList from Core
These are really old bloated parts of the original legality checking logic; separating for now to rewrite.
2020-06-20 19:44:05 -05:00
Kurt
4f7845547e Minor clean
Remove met location dynamic sizing for C/XD (already resized for SWSH)
add some xmldoc comments
rename some parameters
2020-06-20 18:23:03 -05:00
ReignOfComputer
41aff36d50
Unblock IoA Mons Auto Dynamax (#2879)
Probably easier to blacklist this way?
2020-06-20 07:52:54 -05:00
Kurt
36dd5ece21 Initial Isle of Armor support
Co-Authored-By: sciresm <sciresm@users.noreply.github.com>
Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
Co-Authored-By: Archit Date <architdate@gmail.com>
2020-06-19 18:51:15 -05:00
Kurt
2cdb5d26db Clean up some method signatures
rename things to be a little more consistent in naming conventions
2020-06-16 21:46:22 -05:00
Kurt
efb628c002 PID Rand: Handle ability bits for gen34 differently from gen5
quite an old method we have here; used to just maintain both low bits from u16. Need to handle things differently for g34/g5.

Rearrange some variable init for slightly better perf, and clean up parameter names

https://projectpokemon.org/home/forums/topic/55750-pkhex-square-shiny/
2020-06-11 09:32:43 -07:00
Kurt
afa368823e Minor clean
handle some compiler messages
2020-05-26 16:59:47 -07:00
Kurt
4f40330af9 Add Dynamax Level = 10 to showdownset if legal
Closes #2835 ; zacian/zamazenta/eternatus can't have a DynamaxLevel other than 0.

Co-Authored-By: Mikewando <mikewando@users.noreply.github.com>
2020-05-16 15:15:41 -07:00
Kirk Scheibelhut
0aa84f3456
Fix minor typos in FormConverter comments (#2831) 2020-05-10 14:27:12 -07:00
Kurt
3100471299 Strip out some unnecessary logic
notnull => no need to check for null manually
2020-04-16 12:58:48 -07:00
Kurt
b8814d2448 Split GG into LGPE (GP/GE), GG (LGPE||GO)
Update usages
2020-04-16 12:48:18 -07:00
Kurt
0ada4cbd77 Remove some unnecessary null checks 2020-04-12 13:20:40 -07:00
Kurt
0b48034f4d && -> ||
we want to decrypt if either are set
(they should be zero as they're the always-null terminators of strings)

ty @Lusamine !
2020-04-06 15:12:51 -07:00
Kurt
270d984130 Minor clean
Remove unnecessary null checks
Mark some methods with nullable type
2020-04-04 19:30:50 -07:00
Kurt
cce28df6e3 Update PKMConverter.cs 2020-03-20 09:28:16 -07:00