Commit graph

160 commits

Author SHA1 Message Date
Kurt
8bc949152d Enhance IEncounterable list summarization
separates by type (wild, egg, etc) then groups by generation, listing
the locations and games that can obtain it in that location
2019-03-19 22:05:13 -07:00
Kurt
72ec264f4c Prevent g7 silvally from learning fire/water pledge
https://bulbapedia.bulbagarden.net/wiki/Silvally_(Pok%C3%A9mon)#Trivia
has the two bitflags set but the game only tutors the first bitflag it
sees
2019-02-19 22:57:07 -08:00
Kurt
f481404503 Misc clean 2019-02-02 10:19:41 -08:00
Kurt
8652677a79 Misc tweaks
showdownset: contains char instead of string
gameinfo: static readonly array instead of redefining new on update
legality: order of operation / value reuse / simplification / comments
pkx: compare char instead of single character string
header/footer: move assignment into method as an out instead of ref
2019-01-20 21:55:28 -08:00
Kurt
75202c7a89 Misc updates
reducing allocations, increasing clarity by removing some magic numbers
probably can rewrite some of the evo loading/checking for even less, but
good for now.
2019-01-06 16:22:45 -08:00
Kurt
0c9b760470 Move GetIV to pkm, misc simplifications
remove linq for characteristic calc (get max IV) and others
remove some reliance on new[] for iv/ev
pk5 replace bitmagic with property get->set copy for cleanliness
2019-01-05 10:51:41 -08:00
Kurt
28fec9882b Add pkm variant for beluga 2018-11-13 19:10:31 -08:00
Kurt
39f98a4a94 Misc qol updates
Check max case for level first, then iterate upwards (eliminates inner
if)
change wc* nature to sbyte (update comparisons, 0xFF too magic-y)
use Rand.Next(x) instead of (0, x)
2018-10-27 21:59:31 -07:00
Kurt
ed3699fbb4 Update Ho-Oh mattle check
More languages than Italian have a rule-breaking name. Rework checks a
bit
Flag eggs more accurately
Update force hatch to move Link Trade met location to Egg Location

fix Ho-oh -> Ho-Oh text strings (correctness is key!)
2018-10-27 16:06:06 -07:00
Kurt
359a529870 Misc updates
Move some logic around, fix style warnings
2018-10-27 08:53:09 -07:00
Kurt
2ad103dd46 Extract gb specific core logic to separate class 2018-10-09 21:07:13 -07:00
Kurt
4deb5080d1 Misc tweaks
rearrange getmove with respect to tutors; verifycurrentmoves was getting
tutor moves in levelup
extract not-found hint fetch
Expose gen5 block objects (so I can play with saves in linqpad)
2018-10-06 18:45:15 -07:00
Kurt
f507ab7081 Misc parse settings reorg
makes it more centralized for defining parsing settings, maybe can have
flags to change severity of certain preferential checks
2018-10-05 19:58:30 -07:00
Kurt
ce9d3abbe4 Misc reorganization
Move logical checks using encounter data out of Core.cs

might be possible to excise legality checking objects from
Legal/PKHeX.Core so that a 'slimmer' core can be made
2018-10-04 18:52:00 -07:00
Kurt
cc20bb38d7 misc updates
use arrays instead of list when capacity known
use enums for const decoration
remove unnecessary aliases
2018-09-01 19:55:08 -07:00
Kurt
91c37ab573 Update legality check message string style
V### names weren't enjoyable to work with; use similar verbose style as
the program message strings.

updating the translation files with the remapped variable names shortly

remap list: https://pastebin.com/jybkVDAK
2018-09-01 14:11:12 -07:00
Kurt
4dc04cb4b9 Add pelago status value check + etc
0, [9,19] are set (didn't see 15), but there's also a switch case which
references all values 0-19.

these values are used by a 80 sbyte array (4*20) in the Resort.cro

remove usages of "goto case"
2018-08-27 20:44:26 -07:00
Kurt
eec14645ef Lessen string length severity on egg encounters
Hatched eggs can have mismatched languages<->OT/Nick restrictions
2018-08-15 15:26:42 -07:00
Kurt
b6de41bfa7 Add OT name max length checks
Closes #2094
2018-08-15 14:58:55 -07:00
Kurt
279c9d4665 Fix tradeback detect for gen2->1->2 evolve case
https://projectpokemon.org/home/forums/topic/46909-certain-gen-i-moves-are-showing-invalid/

Thanks Raptor385!
2018-08-04 13:36:05 -07:00
Kurt
30a614484e Update STADIUM ot checks again
jp: 1999 if stadium1, 2000 if stadium2
en: 2000

jp: always same OT
en: lowercase if stadium2, uppercase if stadium1

https://projectpokemon.org/home/forums/topic/46893-pkhex-bug-stadium-ot-issue/
2018-08-03 07:38:29 -07:00
Kurt
f4bfdb8311 Remove unnecessary empty array allocations
yay net 4.6
read more: http://justinvp.com/2015/07/20/array-empty/
2018-08-01 18:30:51 -07:00
Kurt
c8563a3737 Respacening
Style guidelines, handle a bunch of files
no functional change
2018-07-26 19:34:27 -07:00
Kurt
711157f3ea Refactoring
Extract trainer pkm origin check to interface extension
2018-07-25 20:40:57 -07:00
Kurt
f0fc4b0693 remove alias'd properties 2018-07-25 19:43:02 -07:00
Kurt
f0090669bb Update catch rate related logic
#2071
2018-07-24 19:33:42 -07:00
Kurt
3c4ba0d52b Misc cleanup 2018-07-22 17:26:19 -07:00
Kurt
1ff8ebf777 Misc overload add/use
Some values are already computed; pass them in to overloads for quicker
execution
2018-07-19 19:38:44 -07:00
Kurt
93876d98eb Fix CanInhabitGen1 comparison
extracted and forgot to double check the boolean comparison when
inverting the return value

https://projectpokemon.org/home/forums/topic/46148-bug-gen-1-moves-and-legendaries-incorrectly-flagged-in-gen-2-game/

Thanks Raptor385!
2018-07-09 21:59:38 -07:00
Kurt
326522c76f Misc simplifications
cache splitbreed species as another class
reduce linq usage in evolution validity check
reuse egg hatch method
2018-07-04 09:15:20 -07:00
Kurt
3674a11cfe Misc simplifications
absorb verifier calls into the parsing methods
2018-07-01 17:07:29 -07:00
Kurt
d477e19cf0 Simplify ball/catchrate lineage checks
should speed up egg ball checking a bit since we've already computed the
original species
gen1 catch rate, just move the chain fetch there.
2018-07-01 10:15:10 -07:00
Kurt
0d3c6eef74 Refactoring
Relocate fixed OTs to core (iencounterable & checks now reference same
values)
2018-06-23 09:49:04 -07:00
Kurt
346c401727 Rework initial evochain trim
push unsaved IVTotal/EVTotal stuff from prior commit
rework exposed types for evo chain
initial trim now uses much less linq

can probably redo the get initial chain to provide a species to break
on...
2018-06-22 17:59:02 -07:00
Kurt
c1f4e2a9ff Refactoring
Relocate & simplify some logic
2018-06-21 20:13:41 -07:00
Kurt
47d8220915 Evo chain Simplifications
Rename "Flag" to "Method"; isn't used besides for indicating the evo
Method.
Remove some unnecessary duplicate checks
- always >=1 in chain at start
- mostEvolved already checked for > maxspeciesgen
2018-06-20 19:42:45 -07:00
Kurt
f10cc183a7 Refactoring
Relocate Evolution Chain logic
minor reorg of check arguments for nesting / grouping
2018-06-19 17:14:22 -07:00
Kurt
f3ef122214 Refactoring
continued simplification

core.cs is pretty much the following:
misc one-off junk
moveset fetch
encounter table fetch
evo chain fetch

might eventually move things around a bit further for cleanliness so
that misc meta junk is the only thing that remains in core.
2018-06-18 21:56:30 -07:00
Kurt
0c06506a8d Refactoring
remove some unneeded logic
moves in gen1/2 can be reordered, sequence match should be intersect
(full) contains match.
2018-06-18 19:57:32 -07:00
Kurt
2e1081086d Refactoring
Split evolution data specific DexLevel properties from DexLevel

use IReadOnlyList instead of IList for covariant collection
2018-06-18 19:10:21 -07:00
Kurt
bff5a3cd9a Add altform permissive checks for gen1/2
Should always be zero, but necessary for regional variant evolutions
needing to be excluded
#2018 (not fixed yet)
2018-06-17 21:54:04 -07:00
Kurt
c3cbb0fc44 Fix gen2 vc1 evo prune
https://github.com/kwsch/PKHeX/issues/1999#issuecomment-397818377

evo chain had already pruned tyrogue due to level 20 transfer level
(lvl19 tyrogue not possible), can't just remove last entry. Remove any
entry after the g1 species.
2018-06-16 09:06:12 -07:00
Kurt
49c36e2173 Misc legality gen tweaks
bypass savefile language checks if no language set
fix gen2 static gift egg that is really a wild encounter -- egg flag was
set & not cleared -> no wild pkm, bad! Adds test case for this.
(probably isn't a better place to clear, enforces only once per
generation rather than on every yield/end of every static yield)
2018-06-15 18:47:17 -07:00
Kurt
5579c4c80d Tidy up MoveLevelUp
use the Learn objects from prior commits for adding a range of moves
2018-06-13 22:03:58 -07:00
Kurt
b9652a835d Weaken gen2 egg species checks for pre-evos in gen1
VC can inhabit both gens

Add Tradeback setting setter for legality tests
Add GBCartEra setting setter for legality tests

Thanks @iiippppk !
2018-06-12 18:46:31 -07:00
Kurt
9faba26e90 Add egg base move branch
Closes #1991
Thanks @iiippppk  !

Improve pk2 version detect to better provide gs vs c egg base moves
2018-06-11 07:23:48 -07:00
Kurt
c9d0811281 Handle evolutions-in-eggs case for past gen (2/3)
Closes #1989
Thanks @iiippppk !

(eggs don't always come at level 1, past gen has level 5)
2018-06-10 19:38:06 -07:00
Kurt
e105f2b589 Refactoring
fix b2w2 egg base levelup reference (not bw, b2w2!), doesn't really
matter much except for better indication (possibly?)
remove some unnecessary linq ToArray() calls
continue relocating code out of Core
2018-06-10 17:55:03 -07:00
Kurt
d94fc65367 Refactoring
continued reduction in Core size, simplify/clean up usages
2018-06-10 14:45:25 -07:00
Kurt
3f1195a2d4 Refactoring
Remove duplication of levelup fetch
relocate some stuff to a more appropriate area
2018-06-10 10:44:05 -07:00