Commit graph

656 commits

Author SHA1 Message Date
Kurt
41a3989b53 Consolidate encounterlink into mysterygift
use synthetic wondercards to match link gifts
2019-01-12 23:50:31 -08:00
Kurt
4f1375ad6a Add route 1 to sky location table
Closes #2241 ty @Ninjistix !
2019-01-12 17:21:57 -08:00
Kurt
950ddcf9fd Reduce npclock object size
24 bytes per object -> 16 bytes
2,624 objects are made for legality checking; reduces from 73KB to 41KB
removing unnecessary clone recreation -> count from 2624 -> 414 (41KB to
6.6KB)
yay 10x reduction; not huge in the big picture but a fun exercise
2019-01-06 20:58:57 -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
4dad475fcd Fix colo lock check regression
oops; tests pass now
2019-01-04 00:10:44 -08:00
Kurt
90e5776dbc Update ereader 0IV detection
the ereader mons are nature/gender locked too, so unroll a little prior
to rechecking the overall team (with ereader mon included). Have to do
it this way as a lock can pop if the ereader data matches a prior spread
before the prior teammate can be generated.
2019-01-03 21:29:19 -08:00
Kurt
272a29a641 Differentiate DP/Pt Shaymin
fateful isn't on dp shaymin even though it's an illegal encounter
2019-01-03 17:04:32 -08:00
Kurt
bd6494d8c7 recognize gen12 italian trade OT
https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?page=3
Thanks ThePunish3D!
2019-01-03 15:47:41 -08:00
Kurt
bd56999b20 Increase search flexibility
add more version fetch methods, add reset method to reset encounter
priority
#2219
2018-12-30 17:30:57 -08:00
Kurt
2ecd3f1f30 Replace IV3 with FlawlessIVCount
Other games may vary the flawless IV count so best to have consistent
declarations
(the vc transfer encounter has 5 or 3 depending if it's a mew/celebi)
2018-12-30 10:33:00 -08:00
Kurt
82eae79823 Remove cosplay fixed IV
Was added a few months ago
https://github.com/kwsch/PKHeX/pull/2117

Game ignores the fixed IVs and instead does 3 flawless IVs
2018-12-30 01:10:53 -08:00
Kurt
78ff441e8b Update iencounterable api with new criteria arg
rearrange some logic for clearer function (extract some methods)
2018-12-29 22:24:34 -08:00
Kurt
c2422d6927 Misc updates
possibly gonna update the iencounterable api for criteria
check/enforcement, rather than just generating random encounter data.
2018-12-29 22:19:44 -08:00
Kurt
d5a8d29088 Misc updates
reduce some allocs, clearer names/enum usage
2018-12-27 20:24:24 -08:00
Kurt
2d75e93ef0 Move encounter matching logic to iencounterable
generator logic is now clean
2018-12-27 01:00:08 -08:00
Kurt
22b9da58e2 Add priority setting for yielding possible encs 2018-12-15 21:34:50 -08:00
Kurt
ec4088b1fe Cleanly lay out hgss swarm data 2018-12-02 14:46:17 -08:00
Kurt
77a4691a58 Add remainder of relicanth swarm data
https://projectpokemon.org/home/forums/topic/48702-bug-ss-relicanth-encounter-error/
Thanks finalevil151!
2018-12-02 14:39:24 -08:00
Kurt
d41197828b Misc fixes
apply version after adding (was previously left as Unknown version ID)
add Route 9 to rarespawn flying list (thanks @sora10pls )
2018-11-29 16:06:25 -08:00
Kurt
71f1e6238a Misc fixes 2018-11-23 10:15:49 -08:00
Kurt
58080f36c9 Add WB7 and legality detection logic
Derived from WC7 with minor alterations (dynamic OT/Nickname which is
stored in the Full data). Since the 0x108 is not stored in the save
file, just keep the full data around.
2018-11-21 12:24:41 -08:00
Kurt
0ebfb38717 Add Route 20 to sky encounter rarespawn list
Thanks @ReignOfComputer !
2018-11-20 23:00:16 -08:00
Kurt
7bd3bfc52e Update rarespawn restrictions for birds 2018-11-20 13:38:49 -08:00
Kurt
ba1a7c2bcf Fix broken tests
rework getblank for version specific
2018-11-19 16:14:49 -08:00
Kurt
4022d7fea9 Add check for invalid pgo shiny transfer
Thanks @sora10pls !
2018-11-19 13:07:21 -08:00
Kurt
70fe7f58ee Remove eevee, revert porygon 2018-11-18 20:39:15 -08:00
Kurt
67cc6bdead Account for wild catch combo/lure level boost
Route 4 sandshrew captured at level 13 (12 is max)
+1 for now, not sure if it can go higher
2018-11-18 16:17:39 -08:00
Kurt
17348c1808 Add bird rare spawns 2018-11-18 10:36:28 -08:00
Kurt
1c0b2488ef Update lapras/porygon gift locationIDs
Thanks Asia81!
2018-11-18 09:41:52 -08:00
Kurt
029e0e0a08 Manually add rare slot locations
placeholder; hopefully this isn't permanent
2018-11-17 15:12:32 -08:00
Kurt
a2eef9deae Misc fixes
it is version exclusive; fix magikarp speed IV
2018-11-16 16:44:25 -08:00
Kurt
720e04ff91 Allow 7b trades to be shiny
remove the todo, thanks twittersphere

remove version exclusivity for puppycat (can be done on either ver)
2018-11-16 14:20:06 -08:00
Kurt
ed5abbd686 Add puppycat NPC location
Thanks (twitter) thelostdogg!
2018-11-15 18:39:30 -08:00
Kurt
94b924fdfc Add ingame trade IVs and random AV notes
exclusive maximum, not inclusive
2018-11-15 17:35:34 -08:00
Kurt
22063d3907 Add ingame trade met locations 2018-11-14 23:04:40 -08:00
Kurt
830c2cbb29 Add GO encounter area/slots
Level ranges per species TBD
2018-11-14 17:40:41 -08:00
Kurt
24c541eeef Get savefile-context sensitive pkm
Generating a IEncounterable -> SAV for pb7 can't start with pk7
2018-11-13 19:19:20 -08:00
Kurt
f11fa8752c Use pkm format specific evolutions, gg deviations
GG has slightly different evos from usum, don't bother adding a new
binary.
2018-11-13 19:04:58 -08:00
Kurt
5abbe6dceb Add fetching for lgpe encounters (legality checks) 2018-11-11 22:46:03 -08:00
Kurt
101149eb2e Skip eggs for gg (like cxd) 2018-11-11 14:19:02 -08:00
Kurt
9d2be1da9f Add beginnings for 7b encounter asset fetch 2018-11-11 13:12:24 -08:00
Kurt
1827b32d8f Add init function for wc7 gg files
pretty sure these will pop up soon as the pball plus doesn't send the
mew itself
2018-11-11 13:09:04 -08:00
Kurt
f38c46f5ec Misc updates 2018-11-10 21:07:31 -08:00
Kurt
453f43edd8 Allow shiny xd duking gifts
https://projectpokemon.org/home/forums/topic/48279-issue-with-ribbon-legality-shiny-dukings-and-japanese-text/
2018-11-08 18:58:52 -08:00
Evan Dixon
9c87ad2977 Port tests to .Net Core (#2156)
* Rewrite tests with XUnit and .Net Core
* Add better "because" message
* Skipping test that was not ready & convert the fact to a theory
* Tweak casing
* Convert select date tests to theories
* Make the GetStringList load lock safer
2018-11-06 15:25:35 -08:00
Kurt
daf41da91b Add more pokewalker moves
Thanks theSlayer!
2018-11-03 12:42:11 -07:00
Admiral-Fish
69b6ea57a3 More nature lock data (#2154)
* Fix lock data

Don't have data on Speal phenac, Spheal post, and Ursaring from colo so can't verify that.

* Fix e-reader data
2018-11-01 22:38:33 -07:00
Kurt
fe989d48fe Misc prep updates
Update comments / xmldoc
Add a savefile storage compressor (ie array[] with empty interstitials
-> list); return true if the compression moved anything (repopulate
views), and the count of occupied slots in the list.
Add saveblock base class; I haven't really liked how SAV6/7 do all the
logic; I'll still expose properties that will then point to a saveblock.
Cuts down clutter.
Add template Dex manipulator, with gen6/7 implementations
Speculate sequential gp/ge gameversion IDs
2018-11-01 15:38:09 -07:00
Admiral-Fish
6a5ee7bf6d Fix Electabuzz data (#2151) 2018-10-31 23:16:13 -07:00
Kurt
8f9cc6cd7e Fix xmldoc ampersands 2018-10-31 13:52:09 -07:00
Kurt
908c98b876 Switch lock checks to newer more complete check obj
Now accounts for the shiny locks & associated restrictions, abusing the
recursion by setting & unsetting the required CPU Trainer's shiny value.

Repoint all test methods to use the new obj methods
2018-10-29 22:49:04 -07:00
Kurt
afffaaa43c Enable full shadow lock checks
If you find any edge cases (the code does not account for shiny locks
yet) pls lmk, would be nice to have confirmed tests :) :)
2018-10-29 19:44:30 -07:00
Kurt
35143630a0 Add ereader locks 2018-10-29 19:43:32 -07:00
Kurt
1b57acc6a7 Check all locks for legality checking
Single->All
2018-10-28 20:28:56 -07:00
Kurt
a728e97d40 Fix Butterfree lock
Ninetales is female
2018-10-28 20:28:02 -07:00
Kurt
4268239c12 Continue work on shadow lock checks
Now gets count=2 tests working

yield return new SeedFrame { FrameID = ctr + (l.Seen ? 5 : 7), PID = pid
};
used to be ctr + 6, needs to alternate even-odd
all 2 lock cases pass, but didn't make lock3's pass. Something else is
still amiss :)

break out some classes for the solidified lock objects
2018-10-28 11:15:40 -07: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
a3e7c4837e Rewrite trade OT/Nick verification, g4 shuckie
Shuckie in HG is not the same as Shuckie in SS.
Use the relatively-recent Nick/OT properties instead of digging through
the encounter table & strings. Ends up being slightly faster.

Thanks theSlayer!

https://projectpokemon.org/home/files/file/3048-kirks-shuckie/?tab=comments#comment-1424
2018-10-27 13:37:03 -07:00
Kurt
e8ad1e227f Update shadow lock table
Thanks @ijuintekka ! Closes #2148
Will check later for commented out tests that should pass.

May end up turning on the first-shadow-lock check feature prior to
release.
2018-10-26 11:14:42 -05:00
Kurt
3d0d8fa649 Add first shadow lock check
Currently toggled off, can be optionally toggled on (I'm not sure that
it's perfect? Random save files have stuff flagged since they don't
match the lock; will have to investigate later)
2018-10-21 21:07:33 -05:00
Kurt
8c4a17335f Add first shadow lock test method
Everything should always pass the first lock check; will add shortly to
any cxd encounter checks
2018-10-21 20:55:02 -05:00
Kurt
c0aae6ab78 Add cxd lock check info & begin troubleshooting
commented out test calls = not working
will have to debug in more detail later; the first lock is always
working at least.

data sourced from
https://github.com/ijuintekka/Eligor/blob/master/Eligor/Spread.cs , not
sure if it's perfect.

can't cleanly condense deviating team appearances as double-shadow leads
can't be selectively encountered. didn't feel like modding lockfinder's
recursive algo to be smarter.
2018-10-20 21:03:04 -05:00
Kurt
93af3e61b7 Add handling for Mt Battle Ho-Oh (italian) edgecase
https://projectpokemon.org/home/forums/topic/47917-colosseum-italian-ho-oh/

there's no shadow ID, so it can have both the short (transferred back)
or full name (never transferred) as CK3 without side effects.

allow 10chars in pkmeditor
2018-10-13 08:07:15 -07:00
Kurt
e8552affca More gb restriction relocations 2018-10-10 16:32:02 -07:00
Kurt
2ad103dd46 Extract gb specific core logic to separate class 2018-10-09 21:07:13 -07:00
Kurt
f65bc2e984 Reduce allocations for gen1 move parse
use shared interfaces
2018-10-07 15:36:32 -07:00
Kurt
fd1009476e Minor logic simplifications
reduce size of encountermoves, split into separate object
only execute gb movedata adjustments for gb
2018-10-06 19:44:50 -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
dc839333b7 Add more parse settings
allows consumers to tweak debatable settings
2018-10-06 13:43:05 -07:00
Kurt
66faa43e03 Add gen6+ fixed ability hot path
Closes #2135
2018-10-06 11:24:46 -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
03a05364ab Update colo suicune ++
location ID was originally added by:

afde4514e2 (diff-83a32d69355a64376bc77bd07e338a33R446)

I
have another save file that uses met location 110 (like this one) so I
assume it was originally a copypaste error from Sudowoodo.

Change Trade strings to not allocate separate empty arrays.
2018-10-04 08:14:53 -07:00
Kurt
4bbb1f54b9 Change burned tower suicune encounter type
was initially set by this commit

0e3815b048

field test resulted in Cave/HoO type
https://projectpokemon.org/home/files/file/2953-burned-tower-suicune/
2018-10-03 16:46:55 -07:00
Kurt
db30fea38c Remove gsc dodrio trade OT trailing space
Closes #2126
Rewrite trade OT validation by using the trade's OTs property
2018-09-19 19:09:29 -07:00
Kurt
d5816795bf Remove split gsc trade levels for tradeevo species
#2126
Receiving a lower leveled species from GSC will evolve it away from the
required species, ruling it unavailable.
Receiving a Machoke will evolve it, so can't reuse for Haunter trade
2018-09-19 19:08:10 -07:00
Kurt
65272d460a stricter mysterygift references
results in:
- precomputed GetTable() reference
- no casting when iterating for matches
- no db null checks, as they are initally Array.Empty<T>();

reduces noise a little & slightly faster
2018-09-15 16:22:07 -07:00
Kurt
df321d14b5 Reorder checks
most common path is now first
2018-09-15 16:13:17 -07:00
Kurt
b280ffcfef style updates
should be pretty much it
2018-09-14 22:37:47 -07:00
Matt
fc91819410 Add XY Magikarp trade IVs (#2117)
* Add XY Magikarp trade IVs

* Add Cosplay Pikachu IVs
2018-09-12 11:02:11 -07:00
Kurt
f444c41ee3 Remove nick req on g5 gigalith trade
Closes #2114
2018-09-08 10:45:30 -07:00
Kurt
1750c69b01 Update pcd version distro check
some events have fixed version IDs in the gift data

https://projectpokemon.org/home/forums/topic/47365-vgc-shiny-milotic-usa-pkhex/
2018-09-05 16:09:30 -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
6a225ad091 Add mr mime to usum additions for egg balls 2018-08-26 09:43:11 -07:00
Kurt
7403c0f91a Add more pokewalker moves
igglybuff wish, happiny heal bell, and the elemental punches to round
things out even though they can be tutored

https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?do=findComment&comment=234991
2018-08-08 17:35:06 -07:00
Kurt
1486b7f14a Misc style & minor tweaks
Remove move combobox flicker hack (no longer necessary)
Add more Array.Empty usages
cache mysterygift sizes
seal some classes

no functionality changes
2018-08-02 20:11:42 -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
c46924d220 Use wcxfull version/language restriction data
some cards may permit being recieved on incorrect games

some wcxfulls permit games they shouldn't (tapu koko flags permit USUM
but games released after the distribution window)
lots of wcx lacking restrictions completely

tested flagging USUM rockruff & zeraora

might be worth discarding MysteryGiftVerifier and instead just using
unused fields for prior formats to supply the data.
2018-07-27 22:26:27 -07:00
Kurt
c8563a3737 Respacening
Style guidelines, handle a bunch of files
no functional change
2018-07-26 19:34:27 -07:00
Kurt
75801e22e0 Update egg location -> encounter generating checks
WasEgg only checks for EncounterEgg valid locations; check for any value
instead.
2018-07-26 14:55:49 -07:00
Kurt
b97e967304 Misc cleanup 2018-07-22 17:14:22 -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
614d2629ce Remove unnecessary ref passing
object is already passed byref, don't need to repoint the reference
2018-07-19 18:09:37 -07:00
Kurt
9a91619580 Update vc1 invalid transfer pruning
Closes #2065 Thanks @WEERSOQUEER !

Single evo species weren't getting flagged in the evolution verification
as they early returned (species matched), just move the sanity check
before that
2018-07-19 16:42:45 -07:00
Kurt
ff4ca47ebe Remove GBEncounterData boxing
Interfaces implement enough detail, so can simplify
extract local methods (likely will be inlined)

less obj allocations = faster!
2018-07-18 16:37:21 -07:00
Kurt
1c75093e27 Specify altform for ranch shellos
1 not 0

https://projectpokemon.org/home/files/file/336-shellos/?do=findComment&comment=1290&tab=comments
2018-07-18 07:15:46 -07:00
Kurt
a100488142 add gen12 generator kadabra catch rate case
https://projectpokemon.org/home/forums/topic/46259-yellow-kadabra/

Thanks Cloud AC !

update misc verifier for catchrate to better indicate for
any->nontradeback scenarios
2018-07-17 16:54:23 -07:00
Kurt
fe7fea877b Replace boolean OrderBy with DeferBy
orderby consumes the entire input enumerable in 'sorting' the list;
since we don't care about the order besides a yes/no, just manage the
yield order ourselves.

don't bother using this method more than the spot it's in; was a fun
exercise but other spots are set up for easier debugging
(overall flow is where->deferby->yield), could make things easier to
read but meh
2018-07-17 16:28:42 -07:00
Kurt
7ec1cab9a7 Update gen1/2 trade generator to emit gen1 if match
Closes #2060
2018-07-16 15:22:40 -07:00
Kurt
83e61923f7 Add bw/2 jellicent deferral case
https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?tab=comments#comment-233860

Thanks paf!
2018-07-13 13:48:27 -07:00
Kurt
f8c43d4a06 Rework gen1 trade OT handling
convert all dictionaries to char-byte instead of string (saves 50KB on
compressed dll, lul)
update OT string comparison for pre/post transfer specimens

Showing "TRAINER" for all languages isn't correct, just show a mapped
character

Closes #2049 , thanks @egzonqj & @WEERSOQUEER !
2018-07-10 16:45:24 -07:00
Kurt
027d898f3d Update Yancy Curtis trade OT checks
Thanks paf!
https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/
2018-07-10 12:37:40 -07:00
Kamron Batman
5ecd3b1875 Adds distribution for Negai Boshi Jirachi (#2043)
* Adds distribution for Negai Boshi Jirachi

* Updates negai boshi to have the proper game origins
2018-07-08 16:21:49 -07:00
Kurt
397de97f3c Remove excessive references to Util.Rand32()
all usages besides fetching a 32bit random value should use rand.next
remove unnecessary do-while loop for calculating random EVs (always
returns 510 in total)
2018-07-04 11:30:43 -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
d11a89d52d Move relearn required flag to checkmoveresult
reduce usage for non gen6+ relearn move cases
save contains result for later usage instead of recomputing the inverse
2018-07-01 21:34:17 -07:00
Kurt
bc6c361746 Reduce linq usage
reuse variables instead of re-fetching (pkm.Species)
add overload for HashSet<int> contains vs ICollection
merge BattleOnly to one hashset
2018-07-01 10:49:11 -07:00
Kurt
3cf78ff3a2 Permit metronome for Pokewalker Cleffa
Closes #2033
2018-06-25 19:15:37 -07:00
Kurt
ea6842e5eb Refactoring
improve readability
2018-06-23 12:37:01 -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
b502d11428 Replace evolution check
already have evolution obj from parsing moves, use it instead
2018-06-22 21:40:41 -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
eb35d71fcc Flag East Gastrodon from Friend Safari... correctly
Closes #2023
2018-06-21 20:26:21 -07:00
Kurt
8387da64fb Disallow East Gastrodon friendsafari
Closes #2023
2018-06-21 20:22:14 -07:00
Kurt
2ef12f635f Continued refactoring
move sylveon check to requireslevelup
need to make this generic for transfer species gaps
2018-06-20 15:59:57 -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
f8a1d26694 Fill empty ability values with ability1
update handling that checked for this case to instead check for
equivalence to ability1 instead of 0

was generating a PGF with ability[1] = 0, which is not correct. Just fix
the binaries to behave and get rid of all the workarounds since future
tables don't have missing values.
2018-06-15 23:41:07 -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
cb5e1239ae Refactoring
Extract game value limits
Rearrange GameVersion util logic extensions
add better gameversion fetch for generator (equivalent to pkmeditor)
2018-06-15 16:00:28 -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
64a64b8ce1 Add special handling for gen1 encounter move fetch
Begin splitting of GetMovesLevelUp per-gen into per-version
2018-06-12 18:35:56 -07:00
Kurt
242fc295b4 Handle smeargle egg case
#1993
Just use precomputed array since it can only know sketch
2018-06-11 08:03:10 -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
3f1195a2d4 Refactoring
Remove duplication of levelup fetch
relocate some stuff to a more appropriate area
2018-06-10 10:44:05 -07:00
Kurt
3b84f33776 Misc changes
Revert linq chain
Closes #1987

change encountermatch comparison (never null), add comparison for vc
output
remove unused strings (will get removed from translation files in later
update)
2018-06-10 00:26:33 -07:00
Kurt
021ac7c54f Refactoring
where!contains -> except
relocate special tutor
2018-06-09 16:04:06 -07:00
Kurt
ee3fda46f2 fix method name typo 2018-06-09 08:04:40 -07:00
Kurt
a494a6b37a Don't generate move check order for an invalid ver 2018-06-08 20:36:52 -07:00
Kurt
1202474cd5 Defer & flag VC korean unobtainable encounters
Closes #1985
2018-06-06 21:49:30 -07:00
Kurt
e52ae06721 Add version check
16 bits for version flags, should be more than enough.

should probably rework it from a packed ushort to a class...
2018-06-05 22:20:30 -07:00
Kurt
323db29374 Handle volt tackle special egg move
edge case turns the [] into an ienumerable, better than calling another
to-list.
2018-06-05 21:38:38 -07:00
Kurt
e7fc30ac7a Add mysterygift region/language restriction code
Closes #1317
Needs the events crew to produce serialized binaries with hash-flag data
for each generation before proceeding any further. I'm not really
interested in doing all the work for events since it doesn't impact
battle legality.
2018-06-05 18:27:08 -07:00
Kurt
ae3b6a7fa1 Simplify IContestStats usage
remove new[] creating for checking if any contest stats exist
(HasContestStats)
2018-06-02 21:19:03 -07:00
Kurt
15b5de11c0 Handle hatched wc3 metlevel oddballs
Closes #1978

Met Level at 5, when hatched ingame is reset to 0.
2018-06-02 07:50:48 -07:00
Kurt
f237476ccc Add nickname reset modify
nickname reset clears except for encountertrades (some have fixed
nicknames).

remove untraded check for HT memory verification, has to be traded if it
has a HT memory.
2018-05-31 19:49:47 -07:00
Kurt
4b8cb9b8fb Add entree forest editor & randomizer
ezpz

(clear trailing spaces from entree forest comments)
2018-05-28 08:26:52 -07:00
Kurt
c31ab63a1a Initialize mgdb for tests that need it initialized
don't initialize multiple times
2018-05-27 15:57:28 -07:00
Kurt
a57cdb5f48 Update fateful handling
#1970
add files as test cases
2018-05-27 14:38:03 -07:00
Kurt
4c1e014a53 Fix mgdb viewing cxd gifts
Closes #1972
2018-05-27 14:16:56 -07:00
Kurt
ae27c10dc2 Misc cxd fixes
#1970
2018-05-27 12:18:27 -07:00
Kurt
6a3b422a14 Fix xd fateful gift pkm
stored as wc3's, make "Version" from IVersion rather than int so that
"WasXD" recognizes it.

Update handling for fateful encounter trade-away cases.

#1970
2018-05-27 10:11:01 -07:00
Kurt
f7a61cf72c Flag version exclusive trades with incorrect ver
Closes #1969
2018-05-27 06:59:27 -07:00
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
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
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
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
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
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
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
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
f767b2db0f Differentiate WasEgg (any egg location) from bred
https://projectpokemon.org/home/forums/topic/44838-buggen5-egg/

WasEgg is used for other encounter based checks, so can't reduce the
logic usage
2018-04-17 18:54:38 -07:00
Kurt
7a77b4524f Add b2w2 route 23 amoonguss
https://projectpokemon.org/home/forums/topic/44798-bug-report-amoonguss-encount-error-b2w2/
Thanks smileynation!
2018-04-14 08:47:02 -07:00
Kurt
b8a5ccdf7d Simplify shedinja evo move check
Closes #1895 , re-verified with pkm provided in #1805
there's no shedinja gift, always is an evolution

seal some forms to remove virt call in constructor warning
2018-04-10 17:00:28 -07:00
Kurt
be285917b9 Update ingame trade data
https://projectpokemon.org/home/forums/topic/44726-bug-in-game-trader-pokemon-flagged-illegal/

Thanks Jimmy Cerno!
2018-04-07 12:34:06 -07:00
Kurt
547c799eeb Handle gen1/2 static encounters
levelup starts after initial moves
2018-04-02 17:51:37 -07:00
Kurt
39f1805940 Fix gen2 met data setting 2018-04-01 20:25:40 -07:00
Kurt
d4e38dded0 Refactor time of day check/validate
Fixes time of day flitering property reference (met_day is always 0, so
it never reached)
2018-04-01 20:22:10 -07:00
Kurt
867c705597 Fix broken gen2 tests
add oddish to the mix
2018-04-01 15:51:55 -07:00
Kurt
d42eb4372f Fix 4 egg move gen2 oddish
egg moves also can be taught in gen1, which causes the learn source to
be locked to a tradeback (removing egg moves that have IDs greater than
RBY's moves). Simplify gen<=2 parse preference ordering with this
addition to force egg moves to be acknowledged.
2018-04-01 15:04:53 -07:00
Kurt
07b2568b1f Fix g2 caterpie generating
has no egg moves -> no moves generated!
2018-04-01 15:02:27 -07:00
Kurt
5e55b916fa Handle fixed gender statics
Seems like a PID/Nature/Gender/Ability smart-setter is necessary for
other encounters
2018-03-31 21:55:59 -07:00
Kurt
ba4c911566 Refactoring & finish eevee test case
generates a legal pk* for every possible encounter; there's likely other
scenarios and more roughness to smooth out, but seems legit for now
2018-03-31 20:37:36 -07:00
Kurt
32f9f806db Add other iencounterable->pkm generators
not tested
2018-03-31 00:43:41 -07:00
Kurt
0b4adf9763 Sync missing content
fixes tests
2018-03-30 22:11:24 -07:00
Kurt
0597833899 Track version of slots/static/trades
I think I set the version at the appropriate times to get all encounter
objects
2018-03-30 21:38:57 -07:00
Kurt
a89c0c3312 Rename egg game->version
add more gameversions (soon)
2018-03-30 21:37:01 -07:00
Kurt
b38abc22e2 Refactoring
add IVersion interface with common interactions
2018-03-30 16:31:40 -07:00