Commit graph

1927 commits

Author SHA1 Message Date
Kurt
7cb484834c Handle max possible level for transferred & evolved-to-new-species
A Gen3 level 26 sylveon with a met level of 25 in Generation 8:
Transferred as Eevee at level 25, and leveled up to 26=>Sylveon
If we use met_level (25), we need to decrease 1 as we evolve. No, use Current Level and ensure the max isn't above the bare minimum (met level)
2020-10-08 15:35:50 -07:00
Kurt
3686ee9ec4 Set suggested Encounter Type on Met Location click too
Closes #3010
2020-10-08 15:01:23 -07:00
Kurt
ea9076ad4c Account for revised evolution conditions for gen4 new-evos in gen8+ 2020-10-08 14:28:34 -07:00
Kurt
9e4ec32e94 Revise nickname check; language-source retained in gen8+ 2020-10-08 14:14:59 -07:00
Kurt
b4eeaf847c Disallow lang-traded eggs mismatching nickname on gen8+
Starting in Generation 8, hatched language-traded eggs will take the Language from the trainer that hatched it.
Transferring from Gen7->Gen8 realigns the Nickname string to the Language, if not nicknamed.
2020-10-08 14:01:36 -07:00
Kurt
0de76b57b1 Handle incorrect bred stunfisk local form value
The game uses 0x5E if 0x5A+everstone, otherwise it uses 0x58
For determining the seed species-form, we want to use everstone breeds as that resolves to the correct species-form values.

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
Co-Authored-By: Marty-D <1645989+Marty-D@users.noreply.github.com>
2020-10-08 13:12:25 -07:00
ShadowMario3
482dbf0b17
Update Encounters2.cs (#3017)
Fix OT for PCNY eggs
2020-10-08 08:32:18 -07:00
ShadowMario3
9516458491
Changed es1e to allow multi-OT (#3016)
* es1e allows multi-OT, merged Stadium Psyduck OTs, added Yoshira Mew

* fixed spacing on Gen 1 event OTs
2020-10-08 07:10:10 -07:00
ShadowMario3
7aac80769b
Update Encounters2.cs (#3015)
Met + Current level data for non-Egg PCNY Pokémon and Egg legality for PCNY Pokémon fixed.
2020-10-07 18:42:14 -07:00
Kurt
e3ef9bbbff Add current level property for met:X current:Y 2020-10-07 15:35:12 -07:00
Kurt
dad01cb522 Check egg state, reduce verbosity for language type 2020-10-07 15:28:58 -07:00
ShadowMario3
a81e675d26
Update Encounters2.cs (#3014)
Added the remaining PCNY events. Still need to fix shiny Pokemon where Met Level is 5 but current level is 40, 50, or 70 depending on Pokemon).
2020-10-07 11:43:34 -07:00
Kurt
5d40009a0c Add multi-OT for es2e, apply special details on enc->pkm 2020-10-07 10:36:28 -07:00
ShadowMario3
4bae0e823a
Update Encounters2.cs (#3013)
Started to add some Gen 2 PCNY Event Pokemon and fixed Stadium 2 events.
2020-10-06 22:12:05 -07:00
Kurt
6616996905 Relocate N OT logic
Make Legal.cs not care about encounter data :)
2020-10-06 20:09:14 -07:00
Kurt
fe7a4df17e Clean out some gb era version flagging 2020-10-06 20:05:38 -07:00
Kurt
6e1cbfcfe5 Split GB event types and segregate per VC/GB
Handle yielding in the moveset generator as well

Future commits will trim down unused values/abstractions; probably can get all the stadium stuff handled innately
2020-10-06 19:35:03 -07:00
ShadowMario3
1681fc776b
Update Encounters2.cs (#3011)
Fix Sing Pichu index number.
2020-10-06 10:59:18 -07:00
Kurt
aa43904869 Add stad2 boxnames, registered flag handling 2020-10-05 08:29:17 -07:00
Kurt
6938d2f94d Split VivillonTables into two classes
Indicate that the content is for 3DS specific logic
Reduce restriction for parameters requiring IGeoTrack => IRegionOrigin
2020-10-04 14:15:13 -07:00
Kurt
36827f795d Remove gen1 flagged moves if they can originate from egg
Revises the tradeback status to remove any index that could have been sourced from egg moves instead.

really should refactor this TradebackStatus away, but Move validation still remains one of the un-refined parts of the legality checks :P
2020-10-04 12:21:05 -07:00
Kurt
757456bf06 Move reset action to class 2020-10-04 12:08:16 -07:00
Kurt
f8de9fe1bf Minor tweaks
now that stadium saves all expose registered teams, can just call from the parent class
rental sk2's have no TID; add that to the requirement to not get flagged for missing OT
2020-10-04 09:26:15 -07:00
Kurt
d13b893351 Use PKHeX as blanksav language
Closes #3009

Make QRPK7 implement IEncounterable and remove hardcoded PKHeX strings
Let force hatching for WC3 eggs try to hatch from the savefile's language, then revert to english if failed to set an OT.
2020-10-04 08:59:33 -07:00
Kurt
5853888020 Minor Stadium behavior enhancements
Use underscores for enum for ToString replacing with spaces
Don't flag empty-OT as SK2; Stadium0/1 use the "TRAINER" as rental, but leave it blank for SK2.
Don't set any terminators for an OT string if the string is empty; just wipe the buffer.
2020-10-03 21:56:57 -07:00
Kurt
833789b1b9 Fix cxd antishiny method detection
Closes #3008 ty @Sephirona !

Do the tsv-psv compare as uint to remove the need for later casts to int
2020-10-03 09:29:26 -07:00
Kurt
2f04ef7a32 Check PK4.EncounterType for BK4 format 2020-10-02 18:09:00 -07:00
Kurt
52a67f2425 Add Stadium2 Support
Introducing a new PKM format: SK2
Split ICaughtData2 off of PK2 so it can be shared with SK2 when type-checks occur
Add conversion for PK2<->SK2
Split the split-buffer handling for GBPKM to GBPKML (what a name), so that I can reuse shared accessor logic for SK2.
2020-10-02 18:08:40 -07:00
Kurt
af4fa8078e Add 10/1 raids
spooky
2020-09-30 17:08:04 -07:00
Kurt
cc3a807fa9 Add default met location for gen3 roamers
Closes #3004
2020-09-29 23:07:42 -07:00
Matt
4888d2368a
Restrict Isle of Armor Raichu-1 Ability (#3006)
Only allows Ability 1 (all slots are Surge Surfer).
2020-09-28 12:13:15 -07:00
Kurt
cafcd3df2e Change affixed ribbon-mark check to also consider ribbons 2020-09-27 18:19:10 -07:00
Kurt
6243135f28 Minor clean
Move Home8 location to Locations.cs for documentation
Move FestaFacility to correct folder
Remove unnecessary public modifier on interface method
Pass the program's Version to any loaded plugins, if they wanted to check compatibility...?
2020-09-25 23:55:31 -07:00
Kurt
7b19e3fb7f Add affixed ribbon legality check
https://github.com/kwsch/PKHeX/issues/3001#issuecomment-698749761
2020-09-25 19:37:38 -07:00
Kurt
6ed60fd35d Flag suspicious PIDs for shiny VC transfers
Configurable setting

Closes #3002
2020-09-25 18:04:44 -07:00
Kurt
fbf7a3658a Check species for static enc match
like all other IEncounterable types, before calling the match method, check species directly
2020-09-24 19:44:48 -07:00
Kurt
fd5e38fdda Remove artist ribbon restriction requiring master ribbon
Closes #2997 ty @sarahlicity for an interesting bypass mechanic :P
2020-09-23 20:47:48 -07:00
Lusamine
b915f3c363
Tower of Waters / Tower of Darkness are valid Met Locations (#2996) 2020-09-23 09:15:49 -07:00
Matt
185c499bff
Unban GO Shiny Doduo (#2994)
Mega Buddy Challenge
2020-09-22 09:23:58 -07:00
Matt
150ff88235
Unban GO Shiny Porygon (#2993)
September 2020 Community Day
2020-09-19 17:27:25 -07:00
Kurt
b039dd28b6 Use reference to personal info rather than fetching again 2020-09-19 07:52:50 -07:00
Lusamine
b90419ba63
Akala Meadow does not exist (#2992) 2020-09-18 19:50:10 -07:00
Kurt
416f5fe183 Check Winning/Victory ribbons for gen3 origin based on encounter
Closes #2990 ty @Atrius97 !

Remove the `object Content` accessor only used for Mystery Gifts (used to trickle up the PKM object since the two ribbon interfaces weren't implemented on the IEncounterable). Just make PCD/PGT implement the ribbon interfaces and delegate the get/set to PKM directly.

Rewrite the national ribbon check for clarity
Optimize invalid/missing ribbon string replace to operate on the final string rather than do linq and replace each input. With this we make 1 temp string only, rather than 1-per-ribbon.

Replace hardcoded "Ribbon" strings to use a shared const string in a central spot.
2020-09-18 16:23:17 -07:00
Kurt
1a6f5163a4 Add mid-september raids 2020-09-17 18:16:16 -07:00
Kurt
e125424423 Refine zygarde encounter form checking logic
Closes #2984
ty atrius & matt via discord

Co-Authored-By: Atrius97 <39707481+Atrius97@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2020-09-13 15:45:15 -07:00
Kurt
2e6d1fce1f Flag non-Poké Ball XD teddiursa
Closes #2983 , nice catch @soopercool101 !

Co-Authored-By: soopercool101 <soopercoolstages@gmail.com>
2020-09-13 14:43:48 -07:00
Kurt
7fc8001806 Continued refactoring
EncounterTrade: don't init Location to -1; keep as default 0 and use that as the pivot for default met location. Move Fateful property to the sub-type that uses it (EncounterTrade4, for Ranch).
Move some EncounterStatic->PKM logic that is per-type to the associated type overloaded methods. Rearrange order of properties to be more consistent with interfaces
Gen3: Initialize some classes without using post-constructor setters. The `init` setter functionality coming in c#9 won't be usable as the net46 runtime/netstandard2 doesn't support it on current previews. Do it this way so we can explicity initialize some required properties rather than apply version on a second iteration.
2020-09-13 14:40:10 -07:00
Kurt
346c284994 Allow pkrs on gen2 eggs
See #1257 item 7; it appears this info on Bulbapedia is incorrect -- disassembly does not care if the pkm slot is an egg or not.

5f197c53f4/engine/events/pokerus/pokerus.asm (L7)
2020-09-10 21:53:43 -07:00
Kurt
ec16202f73 Check for missing gen1 OT names
oops
2020-09-09 22:43:32 -07:00
Kurt
01fb233e48 Minor tweaks
Extract some interfaces
Suppress some warning messages with commented reasons if appropriate
2020-09-09 12:47:24 -07:00
Kurt
5d3bc289b6 seal hunting
Mark things as sealed as they shouldn't be inherited from or overriden in a derived class.
2020-09-07 13:51:13 -07:00
Kurt
03e227c744 Allow steel-typed magnemite for gbera
ty MrPerson0!
2020-09-06 18:36:37 -07:00
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
8a3804e4b3 Reduce static constructor requirements
Gen1: all are Trade1 objects, and all get the values set; just set the value in the object initializer
Gen2: all are Trade2 objects, set the same version

Gen2 all static encounters already have a version marked. Only thing remaining is to set the language.
2020-09-05 13:06:08 -07:00
Kurt
81e98b5549 Update EncounterStatic7.cs 2020-09-05 12:33:00 -07:00
Kurt
079ceb2752 Disallow forms completely in gen2 2020-09-05 12:25:32 -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
cf67d156ad Move Gen1/2 Encounter yielding to separate class
Specialize some of the methods so that Korean and non-tradeback cases are handled with simplified logic.
2020-09-05 10:07:02 -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
90f2ea1749 8/31 - Electric Grass 2020-08-31 18:09:15 -07:00
Kurt
ad4b560071 Minor clean
Remove RibbonWishing as property, just calc on the fly since it's a single case
Update type info for vc transfer to indicate it's an es7
Split up dreamworld encounters as intended, fix logic lol
2020-08-30 22:37:14 -07:00
Kurt
adb74ffed0 Update Trainer Name verifier with template TID/SIDs
might be better to just have a HashSet<int> and use id32, but eh this isn't some blacklist-checker.
2020-08-30 19:59:21 -07:00
Kurt
9667e86446 Simplify dreamworld encounter init
precompute result size
set Gen5 as lumped group for common encounters
remove linq usage (besides Sum call, whatever)
GetEncounters now only filters the in-game static encounters rather than the dreamworld too, as those are already filtered by separate arrays.
2020-08-30 19:51:44 -07:00
Kurt
e3ad6ec55d Make multiple-met locations a single object instance
make trade have Any again; it's a marker to apply the gameversion since we're lazy
2020-08-30 19:24:24 -07:00
Kurt
9ce09c8b1b Minor clean 2020-08-30 16:16:22 -07:00
Kurt
5a391bc20c Make EncounterStatic abstract, make Generation property abstract
Merge EncounterGift8 with EncounterStatic8 since there isn't much need to have two separate classes
2020-08-30 16:10:24 -07:00
Kurt
75da70069c Remove access to modified captured variable
Get the variable rather than indexing into the array each time

Simplify some expressions in sav7 for readability
Make SAV_EventFlags use comboitem explicitly by type rather than an anonymous type with same member names
2020-08-30 15:48:11 -07:00
Kurt
13ee3745f2 Remove some unecessary setter requirements 2020-08-30 15:44:13 -07:00
Kurt
1bc7994137 Remove usage of linq for duplicate count
Check successive move slots after the current index rather than doing a count eq >= 2.

Flag all empty slots prior to a filled move slot, rather than flagging a full slot as invalid because "empty move".
2020-08-30 15:43:29 -07:00
Kurt
81a693bafe Make Generation property get-only per class
don't need to store an int since it's a const-per-class
2020-08-30 15:35:59 -07:00
Kurt
ce5897ff94 Move version value from Slot to Area to reduce member size & value passing
Restrict some setters to protected only
2020-08-30 11:08:21 -07:00
Kurt
6ee7a8724b
Offload EncounterSlot loading logic to reduce complexity (#2980)
* Rework gen1 slot loading

Slot templates are precomputed from ROM data and just loaded straight in, with tight coupling to the encounter area (grouped by slot types).

* Revise fuzzy met check for underleveled wild evos

Example: Level 23 poliwhirl in RBY as a level 50 poliwhirl, will assume the chain is 25-50 for poliwhirl (as poliwag evolves at 25). Instead of revising the origin chain, just ignore the evo min level in the comparison.

Previous commit fixed it for gen1.

* Rework gen2-4 slot loading

Gen4 not finished, Type Encounter data and some edge encounters not recognizing yet...

* Add feebas slots for old/good encounters

* Begin moving properties

Great news! Gen5-7 need to be de-dumbed like Gen1-4.

Then I can remove the bang (!) on the Area accessor and ensure that it's never null!

* Split off XD pokespot slot encounter table type

* Set area in constructor

* Deduplicate g3 roaming encounters

* Deduplicate xd encounter locations (rebattle)

Only difference is met location; no need to create 500 extra encounter objects. A simple contains check is ok (rarely in gen3 format).

* Make all slots have a readonly reference to their parent area

* Minor clean

* Remove "Safari" slot type flag

Can be determined via other means (generation-location), allows us to reduce the size of SlotType member to a byte

Output of slot binaries didn't preserve the Safari flag anyway.

* Update SlotType.cs

* Handle type encounters correctly

* Merge safari area into regular xy area

* Merge dexnav accessor logic

* fix some logic so that tests pass again

rearrange g5 dw init to be done outside of static constructor (initializer instead)
PIDGenerator: friend safari slots now generate with required flawless IV count

* Add cianwood tentacool gift encounter

* Remove unnecessary abstractions

Fake area just returned a slot; since Slots have a non-null reference to the area, we can just return the slot and use the API to grab a list of possible slots for the chain.

Increase restrictiveness of location/type get-set operations

* Minor tweaks, pass parameters

DexNav observed state isn't necessary to use, only need to see if it's possible to dexnav. Now that we have metadata for slots, we can.

* Remove unused legality tables
2020-08-30 10:23:22 -07:00
Kurt
c1bc371d76 Update EncounterGenerator.cs 2020-08-29 23:50:59 -07:00
Kurt
e532a29e72 Allow gen1 moves on gen2 met data pk2's
Thanks MrPerson0 on discord for notifying us of this mechanic. Stadium 2 can utilize Gen1 learnset data while keeping them in PK2 format, retaining the met data.
2020-08-29 23:47:03 -07:00
Kurt
780e8bf2bf Branch to specific iterator
Similar to fuzzy matches for gen3/4 iterators
2020-08-22 14:52:17 -07:00
Kurt
42453bdcd8 Update EncounterArea8.cs 2020-08-22 14:12:16 -07:00
Kurt
816f35d042 Split file 2020-08-22 11:59:43 -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
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
Matt
1d0ca29e8c
Misc changes (#2969)
Adjust EggItemShift to account for using the big Egg sprite
Add Marowak to non-transferrable Totems (none of the USUM Totems can be transferred to SWSH)
2020-08-14 13:56:37 -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
71456d98fb Handle unhatched manaphy egg
Closes #2965
2020-08-09 20:02:28 -07:00
Kurt
6645481829 Flag gen3 world ribbon as invalid
Closes #2963
not like anyone actually has this ribbon
2020-08-08 22:55:44 -07:00
Matt
e2b5d9d816
Unban GO Shiny Staryu (#2962)
Enigma Week 2020
2020-08-08 11:19:51 -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
56d1eed483 Ban alolan split evolutions for lgpe origin in gen8 2020-08-06 18:21:40 -07:00
Lusamine
f611d0b780
pika pi (#2960) 2020-08-05 19:10:35 -07:00
Kurt
2b4e2a8fa1 Update Core.cs 2020-08-05 10:57:07 -07:00
Kurt
ad6728fb5c Minor tweaks
Check egg encounter for state rather than re-deriving some properties on the fly
Only check memories if memories are exposed
Remove debug assert (not always true?)
2020-08-04 22:56:55 -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
497639d48e 7/31 distribution raids 2020-07-31 18:13:29 -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
36684ab867 Minor clean
Simplify some expressions
2020-07-31 11:20:48 -07:00
Kurt
27f15d2f20 Split Country/Region/ConsoleRegion to interface 2020-07-31 11:17:31 -07:00
Kurt
05ac8acb5f Phenac City Hexagon Brothers rebattle
Closes #2951
2020-07-29 13:45:33 -07:00
Kurt
14da3a6539 Unban payapa 2020-07-28 10:26:44 -07:00
Kurt
7bd9ae8aeb Simplify cxd antishiny pidiv detect
Only check player ID
Closes #2952

Had originally intended to just recognize the PIDIV and check it in the lock verifier, but this is more straightforward since we don't have to check CPU TSV.
2020-07-26 09:49:33 -07:00
Kurt
7bd36ca0c8 Minor clean
Fix xmldoc, revert ??= because whatever nullable logic plugin I have isn't detecting this right
2020-07-26 08:54:52 -07:00
Matt
3a02bf457f
Update GO minimum Level requirements (#2953)
GO Fest 2020 made Alolan Marowak available in wild spawns, and further testing has proved that Raid/Research PKM can be  downleveled to 15 after trading to low-level accounts.

This'll probably end up being deprecated in the future when we have GO->HOME transfer checks, in addition to IV checking.
2020-07-26 08:27:21 -07:00
Matt
f66d8d2ea5
Unban GO Shiny Tangela (#2949)
GO Fest 2020
2020-07-25 08:37:13 -07: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
a6a3c6eaaa Refactoring
change some expressions for better perf/readability
2020-07-19 17:48:45 -05:00
Kurt
40ce63873d Reduce gen1 encounter legality startup alloc by 5KB
Use precomputed counts to remove the need to store a cache of read values

rename some variables in ReadSlots1FishingYellow
2020-07-19 14:08:56 -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
e4092e64df Relocate gen3 ereader berry logic 2020-07-18 22:51:55 -05:00
Kurt
acd97c6287 Pass evolution chain for generation memory check
chain details are already computed; pass them in
2020-07-18 21:57:15 -05:00
Kurt
35435b539e Refactoring
move some logic around
2020-07-18 21:51:38 -05:00
Kurt
085889d419 Pass evolution to trade match check 2020-07-18 21:50:28 -05:00
Kurt
705822c965 Abstract some gen1/2 encounter types from their parent class 2020-07-18 15:36:30 -05:00
Kurt
8fae396b76 Inject matching dexlevel for form comparison 2020-07-18 13:29:16 -05:00
Kurt
0f38478878 Fix gen2 evolution-egg test case 2020-07-18 13:06:14 -05:00
Kurt
1ecafd8db3
Update Encounters8NestDist.cs
Puts the new encounters in the correct array; the new encounters should now be recognized on the other game version.
2020-07-17 12:18:28 -05:00
Kurt
8c52932bbe Under da sea
did they just give up on version exclusive raids?
get yo shiny wailord
2020-07-16 21:18:37 -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
Matt
10adb9b8c1
Unban GO Shiny Bellsprout (#2945) 2020-07-16 14:59:46 -05:00
Kurt
4d3fd395e1 Add bypass for DP rotom, skip splitbreed if chain doesn't have splitbreed 2020-07-13 22:30:20 -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
53e2432818 Fix gen2 egg species get
feraligatr isn't in gen8 evolution table yet
Closes #2937
2020-07-11 11:40:20 -05:00
Kurt
255498b2f8 Allow chatelaine memory ^ skillful check on format >= 8
Check the memory for RibbonTowerMaster; if the memory is present, permit the lack of ribbon if it was granted via past gen and has the other ribbon.

Simplify !(x || !y) to !x && y

Closes #2926 ty @randomdice101
2020-07-09 22:53:57 -05:00
Lusamine
fdfa10e881
Add a few static/crossover encounters (#2932) 2020-07-08 22:59:08 -05:00
Matt
fa7c8929b1
Update SWSH enc binaries, fix Rotom form/move issues (#2927)
Some zone names were mislabeled in pkNX -- Staryu are not scripted encounters!
Remove altform specific moves from distro/static Rotom, which would erroneously allow illegal mismatches (e.g. Hydro Pump Rotom-1); thanks Abyzab (Discord)!
2020-07-05 11:45:53 -05:00
Lusamine
39040358c1
Add a Whiscash (#2921) 2020-07-03 14:31:19 -05:00
Kurt
e207031920 Shuckle Magic Coat -> Encore
Nice typo! Ty sora10pls(matt) & too salty (via discord)
2020-07-03 10:48:31 -05:00
Kurt
0198179133 Add fixed raid news content
no change in species/form from the crownite ore one afaik; common for both games???

fix type of rigel encount so it shows up in block editor, with correct name (ty matt)
2020-06-29 21:10:12 -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
3138fb20c6 Refactor some method signatures
vs -> chain (clarity on what it is; an evolution chain, rather than e.v.o.s - vs)
Clamp origin chain for transferred where we can use the max origin level
2020-06-27 22:18:29 -05:00
Kurt
065c1cc6d4 Specify version on all defined wc3
rearrange some setters for visual appearances

Closes #2904
2020-06-27 14:21:45 -05:00
Kurt
5f58250b17 Pass species param to exists-in check
Closes #2905
2020-06-27 14:04:28 -05:00
Kurt
d2ef98f7d4 Add underground staryu encounters
not in any of our dumps, like crabrawler?
why gf
Closes #2913
2020-06-27 13:56:29 -05:00
Kurt
c565c7ca2c Extract move suggest logic, add battleversion clamp
Closes #2911
2020-06-27 13:06:28 -05:00
Kurt
0836d3191d Rewrite some magic gender value logic
it's always been a byte for ratios, but we never know; plus, it's a little more self documenting
2020-06-27 12:01:28 -05:00
Kurt
294d861f86 Set StatNature on IEncounterable->PKM
Mystery Gift formats already set it appropriately in their individual implementations

Closes #2901
2020-06-27 11:46:23 -05:00
Kurt
16cf59c851 Add an evolved formchange case for lycanroc
things shouldn't be this way, but encounterstatic doesn't currently accept a SpeciesForm evolution link in the matching function, so we can't know when the form changed legally.

Encounter Slots do it fine for the most part... might need to refactor the matching API so that it behaves a little smarter

Closes #2912
2020-06-27 11:44:56 -05:00
Lusamine
565c9a590e
Add some cross boundary encounters (#2910) 2020-06-26 23:31:23 -05:00
Matt
3f09afd4cb
Update TradeGift_R1 (#2909)
Both games have a pair of version exclusive trades on The Isle of Armor, as noted on Bulbapedia.
2020-06-26 11:00:45 -05:00
Chris
0c3a95fb19
Specify Legends & Sublegend species explicitly (#2907)
self documenting
don't replace other lists of species IDs tho
2020-06-25 15:11:30 -05:00
Kurt
ce5a09055a Merge branch 'master' of https://github.com/kwsch/PKHeX 2020-06-24 18:59:30 -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
Matt
a5b72bd1ce
Update VerifyVersionEvolution for Gen 8 Lycanroc (#2903)
SWSH changed Rockruff->Lycanroc to only depend on time of day, not Version as well. Cosmoem still needs both, though.
2020-06-24 07:34:55 -05:00
Lusamine
bc1538efa5
Add some IoA cross-boundary encounters (#2902) 2020-06-24 07:34:26 -05:00
Archit Date
fd48938c8e
fix encounter criteria ability via number (#2898) 2020-06-22 22:41:15 -05:00
Kurt
a2d9f06350 Differentiate AbilityType from AbilityNumber
invert ability index favoring so that the first ability index is most favored

ability num:
-1=>0/1/2
0=>0/1,
1=>0
2 =>1
4=>2

Ability Type:
0,1,2=>0,1,2
3=>0/1
4=>0/1/2

Should probably get rid of AbilityNumber definition usage but it's so entwined in the trade/static definitions...
2020-06-22 22:01:42 -05:00
Kurt
93308ca4ae Account for losing/gaining gmax for comparison
Don't defer for static, and don't skip for WC8

skip home gifts with player OT when SID7 not 0 (all home OTs have 6digit TID and 0 SID)
2020-06-22 21:29:21 -05:00
Matt
dcb5c1e936
Update IsMatchLocation to allow Isle of Armor Dens (#2895) 2020-06-22 10:07:50 -05:00
Kurt
6fb2ebe039 Minor clean
add some xmldoc
2020-06-21 19:46:06 -05:00
Kurt
7e69202669 Use criteria for getting ability 2020-06-21 18:16:34 -05:00
Kurt
fc4ba1df35 Bounds check ability requested
no longer exception's on RefreshAbility(negative number)
2020-06-21 18:16:18 -05:00
Abyzab
a797459543
Additional Cross Boundary Edge Cases (#2891)
* Additional Cross Boundary Edge Cases

The static spawn point right outside Brawlers' cave, all of the pokemon are able to chase the player into the cave and be caught

https://cdn.discordapp.com/attachments/401014193211441161/724112694088695918/a0f06577821f60edf119308675de7894.png
https://cdn.discordapp.com/attachments/401014193211441161/724117077698281502/JPEG_20200621_002242.jpg

Unsure if there were more that spawn in this point that have the same behaviour, but these were the ones I found (w/ Ano0onymouse
 for Shield ones)
2020-06-21 09:33:29 -05:00
Kurt
523f101c82 Add barraskewda location
Closes #2889

Co-Authored-By: Abyzab <abyzab@users.noreply.github.com>
2020-06-20 20:26:54 -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
17f8ad97a9 Fix neutral mint index
hardy is index 0. and isn't a mint
2020-06-20 15:05:34 -05:00
Kurt
c36c233e1d Fix galarian slowbro form compare
Really should be doing this with evo chain compares rather than edge cases, but whatever
2020-06-20 13:38:12 -05:00
Kurt
4c7c6532bb Check ability deferral with more scrutiny 2020-06-20 13:14:44 -05:00
Kurt
eedaca8712 Fix mistake
oops lol
2020-06-20 12:09:03 -05:00
Kurt
8f24477197
Weezing ingame trade can be any ability 2020-06-20 11:37:37 -05:00
ReignOfComputer
19d0f4572c
Unlock IoA Egg Locations (#2880)
Fixes https://github.com/kwsch/PKHeX/issues/2877.
2020-06-20 07:51:28 -05:00
ReignOfComputer
2e584f43fc
Additional Statics (#2883) 2020-06-20 07:51:04 -05:00
Chris
63add7d929
Fix Master Rank Ribbon (#2874) 2020-06-19 23:20:19 -05:00
Kurt
6002dfb739 Revise master rank ribbon again
ty terry & chris
2020-06-19 21:51:57 -05:00
Kurt
69dbde1bb4 Check battleversion state for past-gen master rank ribbon 2020-06-19 21:24:58 -05:00
Kurt
e72a58bdee Dump latest translatable strings 2020-06-19 20:18:37 -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
db30170cc5 Update EncounterArea7g.cs
Kinda ugly but works for now
Closes #2861
2020-06-16 22:40:43 -05:00
Kurt
27cce4dcd2 Disallow galar master rank ribbon on legends
Closes #2858
2020-06-16 22:16:21 -05:00
Kurt
f51e3673da Update AbilityVerifier.cs
incorrectly edited (ability number needs to be bit0/1/2 not none/any other permutation)
Closes #2860
2020-06-16 22:13:21 -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
f7d2101500 Update Encounters8NestDist.cs 2020-06-06 09:53:14 -07:00
Kurt
9b89ee09ec Fix downlevel comparison
(for good? pls)
https://i.redd.it/7g2c4d3kisc41.png
ty anubis

remove GetMinimalLevel override, as it's doing the same thing as LevelMin. When regenerating the pkm, we aren't doing anything downlevel related.
2020-06-06 09:00:52 -07:00
Kurt
3af369c152 ★Sgr6879 (Copperajah) 2020-06-05 07:31:40 -07:00
Kurt
321a2d120f Add new distribution raids
Add Copperajah crystal (commented); uncomment when released?
2020-06-02 07:09:49 -07:00
Kurt
a2996e6b55 Unban gen8 bred HA starters
HOME gift -> breed
2020-06-02 07:09:17 -07:00
Kurt
16c9865505 Update EncounterStatic8N.cs 2020-06-01 14:07:26 -07:00
Kurt
ff849b9c5b Allow fullness values for format8
ty anubis
this totally isn't fullness, but the toys increase the value (saturation?)
2020-05-31 13:29:13 -07:00
Kurt
5c0d6d0f31 Extract downlevel check for reuse; clamp edge moves to max raid lvl 2020-05-31 13:28:14 -07:00
Kurt
3fcb29e68a Remove some reliance on GenNumber 2020-05-31 12:12:48 -07:00
Kurt
9ff01bccc6 Add ToString override for debugging 2020-05-31 12:12:20 -07:00
Kurt
6aab8ca449 Minor renaming/type change of passed args
Next commit will have more changes where we remove some reliance on PKM.GenNumber, in favor of the passed encounter's generation
2020-05-31 12:12:07 -07:00
Kurt
afa368823e Minor clean
handle some compiler messages
2020-05-26 16:59:47 -07:00
Matt
9b6190a3e9
Add Gigantamax Meowth Distribution Raids (#2842) 2020-05-25 17:39:07 -07:00
Kurt
7c6ea78c63 Add fullness legality check
Closes #2836

Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
2020-05-24 20:00:32 -07:00
Kurt
d8cd75908b Handle gen2 gift egg collision with low hatch cycle req
Closes #2824
ty @KR1dude !

change miscverifier to use OT_Friendship instead of CurrentFriendship.
2020-05-24 10:46:08 -07:00
Kurt
4a5a913142 Handle downleveled cases correctly
Downleveled shared nest can't go below 20
Downleveled self nest can only happen for 1 or 3 badges and certain star counts, and the result can't be shiny
2020-05-23 22:17:47 -07:00
Kurt
0cdc225224 Kecleon: Comment out static in favor of dexnav encounterslot
Encounter Generator stops yielding if anything was yielded (assumes things that are static encounters can't have anything else that would match).

DexNav boosts the wild level (from 25/27) up to the same level 30 of the static encounter.

Thanks @KR1dude !

Co-Authored-By: KR1dude <kr1dude@users.noreply.github.com>
2020-05-20 18:24:55 -07:00
Kurt
6970c3a5fb Remove IVersion.set property, as separate interface
I don't want people to mutate IEncounterable.Version; it's only intended to be set on-load
2020-05-19 21:46:05 -07:00
Kurt
301350d32b Make IEncounterable expose IVersion get 2020-05-19 21:07:30 -07:00
Kurt
cce3d5d9f5 Handle race condition on get->set new cached string
overwrite add if it somehow was added from another thread in between lock checks
2020-05-19 20:40:51 -07:00
Kurt
232a9de32e Add gmax ev 2020-05-18 17:04:31 -07:00
Kurt
6164884700 Merge IGeneration into IEncounterable
all but egg exposed it; now, just make egg expose it and remove the unnecessary interface

we still need to Set generation for non-eggs/mgift, so have a separate Settable interface for internal purposes.
2020-05-17 12:32:28 -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
Kurt
1b5292cb04 append shared egg-moves rather than early return
dl[0].Species is the same as pk.Species; more clear && array access might be slower

only append shared egg moves if shared egg moves exist
2020-05-15 22:49:11 -07:00
Kurt
c8a141534c make enc move gen tree fetch non-pkm specific
just need to get all evo chains possible

fetching a GO leafeon, need to reverse leafeon->eevee, but the LGPE evo chains don't know about leafeon

works fine now
2020-05-15 21:59:06 -07:00
Kurt
3210ced006 Add new gmax-pikachu distribution details
can be shiny
can be any ability
still can't evolve

can't wait for gmax-eevee when this bcat expires ;)
2020-05-11 17:17:27 -07:00
Kurt
045e289c0a Account for antishiny skip on the NPC mon right before shadow
pretty much a copy from the other method with simplifications
2020-05-11 16:52:09 -07:00
Kurt
9b0e74dd2a Update ContestStatVerifier.cs 2020-05-11 16:51:10 -07:00
Kurt
4decaa73f7 Verify Contest stats on gen5 origin
extract to separate logic class; only gen3+ call this (was originally called by gen6+); only really needs to include gen5
2020-05-09 20:47:32 -07:00
Kurt
8650b5ceb2 Verify g4 tower ribbons as invalid on >=g5 origin
https://projectpokemon.org/home/forums/topic/57026-gen-5-contest-stats-ribbons-bugissue/
2020-05-09 20:45:19 -07:00
Kurt
5fc15dc9c8 Correctly prevent xd locked shinies
oops, 7fd7a86074 was not correct (only handled lockless) -- the verifier doesn't check the final shadow pokemon (not a lock).

https://projectpokemon.org/home/forums/topic/57014-shiny-shadow-pok%C3%A9mon-from-xd-shown-as-legal-pkhex-legality-check-error/
2020-05-08 10:07:21 -07:00
Matt
383cf3e514
Unban GO Shiny Voltorb (#2829)
Philadelphia Safari Zone.
2020-05-08 07:48:24 -07:00
Matt
333693775e
Update GO Shiny Banlist (#2827)
Remove Venonat (Throwback Challenge 2020: Kanto).
Also switch to using enum like SWSH Hidden Ability banlist -- evolution families all on one line.
2020-04-30 17:05:44 -07:00
Kurt
67b19f7244 Update Encounters8NestDist.cs
Bye bye invalid drilbur, nice meme GF

The first rotom2 in Shield had its moves changed too. Keep that rotom-2 since Discharge can't be learned at that level.

since sw and sh have the same drilbur, it moves from sw -> common.
2020-04-28 11:36:03 -07:00
Kurt
2e390573bc Add new meta distribution raids 2020-04-27 17:44:36 -07:00
Kurt
a55b4da05c Add evo data for mimejr-0 => mrmime-0 (no gen8) 2020-04-26 12:00:45 -07:00
Matt
068f6e2f5f
Fix Big Sprite ItemShiftY (#2816)
Strange Souvenir and Room Service would get cut off since they're tall.
Also remove Adventure Guide from resources, and add Discount Coupon to Gen 7 unreleased items.
2020-04-25 11:05:12 -07:00
Kurt
0edbef8ba4 Add more HA banlist
definitely more
2020-04-24 08:24:12 -07:00
Kurt
913d2773bf Pass form when form doesn't match encounter
This is still a horrible hack, needs to be done similar to encounter slots

handle the galar NFE formchange cases
2020-04-23 20:53:57 -07:00
Kurt
e9406599e0 Remove more unnecessary null checks 2020-04-16 13:11:27 -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
a9a748e82d Update EncounterTradeGenerator.cs 2020-04-16 11:06:54 -07:00
Kurt
ba30f33045 Update EncounterStatic.cs
Closes #2810
2020-04-16 09:30:20 -07:00
Kurt
9b56eef821 Add deferral case for shiny type 2020-04-15 18:30:29 -07:00
Kurt
ee1cfa8912 Hanle some compiler messages 2020-04-14 10:52:19 -07:00
Kurt
40d000fdce Extract reusable method 2020-04-14 10:08:02 -07:00
Matt
be229d03fb
Update GO Shiny Banlist (#2808)
Forgot to update when the Easter event began. Removes Shiny Exeggcute/Exeggutor.
2020-04-13 13:57:34 -07:00
Kurt
67e9809ecd Require exact form matching 2020-04-12 19:41:03 -07:00
Kurt
33bdacebe8 Minor tweaks
Handle some compiler/extension suggestions
2020-04-12 16:07:59 -07:00
Kurt
0ada4cbd77 Remove some unnecessary null checks 2020-04-12 13:20:40 -07:00
Kurt
30d21e4532 Extract out showdown set interface 2020-04-12 13:05:29 -07:00
Kurt
a94c754c3f More shedinja edge cases
Don't allow shedinja evolution moves if it wasn't evolved in that generation
2020-04-12 11:28:03 -07:00
Kurt
8ac61d7ff7 Allow antishiny CXD spreads for some checks 2020-04-11 23:14:16 -07:00
Kurt
2e0aba55b2 Add Easter distribution raids
No difference in sword exclusives
2020-04-09 23:04:29 -07:00
Kurt
7fd7a86074 Shiny check lockless XD shadow encounters 2020-04-09 14:14:48 -07:00
Kurt
4d061c561a Add initial marking checks 2020-04-06 16:32:23 -07:00
Kurt
fdc174ea99 Fix raichu-a banned evolution in g7 s/m
add a comment and parenthesis in something unrelated

Closes #2807 ty @MichiS97 !
2020-04-06 08:10:49 -07:00
Kurt
270d984130 Minor clean
Remove unnecessary null checks
Mark some methods with nullable type
2020-04-04 19:30:50 -07:00
Matt
6f39f25189
Misc changes (#2806)
Add small Female Hippopotas/Hippowdon sprites (Closes #2789)
Add Pt Togepi Gift Egg Event Constant (Closes #2801)
Remove Pokémon Den from Egg Locations (Closes #2804)
Fix Shiny Dhelmise sprite (as per 3774e0dd34)
2020-04-04 17:10:41 -07:00
Matt
f7a83dea2c
Force Ability 1 for SWSH Gift Charmander (#2800)
As per new findings with latest commit of pkNX: 5016baf9ea
2020-03-27 17:47:13 -07:00
Chris
f6ad77ab04
Fix item check for silvally (pixie plate)
Remove the comparison, was a copy/paste from Arceus 3y ago
a7339ae26f
2020-03-27 12:15:22 -07:00
Kurt
d73457a395 Update Encounters8NestDist.cs 2020-03-26 08:40:16 -07:00
Kurt
9e8858ac51 Allow traded gen8 eggs to have OT linktrade mem
Stupid lacking game checks
2020-03-25 19:18:52 -07:00
Kurt
84abc04d07 3/25 Wild Area News
Restrict abilities for crystal raids (corviknight always hidden, everything else can be anything-except-hidden).
2020-03-25 19:02:09 -07:00
Kurt
a7026236cc Fix order of operations
underflow behavior is desired; (uint)(10-15/10) results in zero
2020-03-25 14:37:41 -07:00
Kurt
f4952faa6f Add zh2 trade localization
ye it's different from the zh strings, resulting in different nick/OT

ty @Lusamine !

add another gyarados location while we're here
2020-03-21 10:48:26 -07:00
Kurt
5402c5d108 Update Analysis.cs 2020-03-20 23:26:45 -07:00
Kurt
aaf6642d31 Rename Data -> BinLinker 2020-03-20 15:18:59 -07:00
Kurt
799e4852cf Minor clean 2020-03-20 13:33:15 -07:00
Kurt
dbfcef2efe Move files to group subfolder 2020-03-20 12:13:37 -07:00
Archit Date
e3e46209e9
add back watchtower as a legal location (#2796)
made an oopsie, Watchtower Ruins also apparently includes 2 extra dens that can spawn encounters that are not 8NC. Den 17 is locked to 8NC encounters only, but location-wise there is no difference between Den 15,16,17
2020-03-20 07:22:44 -07:00
Kurt
c8343e9f5d Update EncounterArea8.cs 2020-03-19 22:15:01 -07:00
Kurt
72e0fbe225 Update EncounterArea8.cs 2020-03-19 21:06:46 -07:00
Kurt
61cbf04c2e Fix comparison to watchtower, not wild area
unshuffle the IVs for comparison, oops
2020-03-19 21:04:17 -07:00
Kurt
a188317e84 Add another diggersby location
ty @Lusamine
2020-03-19 20:50:58 -07:00
Kurt
27d1feafd7 Revise egg wc3 fateful check to return instead of break
Emerald has the same met locations too, which doesn't clear fateful. So if it was hatched in an RS(E) location, we can't know for sure.

Closes #2790 , but keep in mind the posted file is illegal anyways -- can't get egg move aromatherapy with wish.
2020-03-19 17:05:16 -07:00
Kurt
090f83d197 Unban and337 as held item 2020-03-18 22:31:41 -07:00
Kurt
093586bb69 Update Encounters8NestDist.cs 2020-03-18 22:23:21 -07:00
Kurt
d06949bdb3 Update min level clamps, actually compare req PID
Closes #2787
The commit a couple days ago added the missing minimum level restrictions; community documentation was slightly misleading but we should be good now.

The PID check was nonfunctional (compared A==A or A==A*), rather than actually checking the fixed PID.

Co-Authored-By: feralfalcon <feralfalcon@users.noreply.github.com>
2020-03-18 12:23:09 -07:00