Commit graph

482 commits

Author SHA1 Message Date
Kurt
dd9b31dbbe Remove unnecessary property
template stores the version; no need to refer to store it separate from the object
Generation being separate is fine for now
2021-10-08 23:30:03 -07:00
sora10pls
7722baa826 Update RibbonVerifier.cs
Series 11 allows restricted Pokémon and runs until January 31st, 2022.
2021-10-08 09:41:57 -04:00
Kurt
97af5a31c1 Rewrite gen1 trade evo check
Closes #3266 ty @CanoeHope !
2021-10-07 23:56:01 -07:00
Kurt
5fe38e1707 Allow wc3 nickname flag due to 3->4 nick detection omission
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-10-05 22:46:21 -07:00
Kurt
f53f46c2e4 Revise ability patch/capsule message
Fix PCD logic flow
2021-10-02 10:25:52 -07:00
Kurt
f2dc3f1245 Exclude granbull/vibrava/flygon as single abilities
per the personal data in emerald, they are the only species that go from 2 distinct abilities to 1; since the game does not update the abilityNumber on evolution, it has the second ability being the same as the first, instead of the usual [ability,none] for all other single ability species.
2021-09-30 21:42:44 -07:00
sora10pls
c9fed1ce70 Update BallVerifier.cs 2021-09-30 20:12:54 -04:00
sora10pls
9ec879bd99 Allow non-Poké Ball for Alolan starters
thank you game freak
2021-09-30 20:08:27 -04:00
Lusamine
4e398322b0
More memory legality checks (#3256)
* Add more memory legality checks

Includes the following new memory checks:
- 4: met in link-trade, allows all possible genlocs except dangerous place
- 7: successful fishing, allows fishable species in gen 6 and 8
- 9: paying attention to another mon, allows only available species for gen 8
- 29: encountering legendary Pokémon, only seen on Zacian, Zamazenta, Calyrex so far
- 32: riding a bike, only in genlocs where biking is possible
- 75: taken to Nursery and placed with a mon, allows only available species for gen 8

Unstubs lotto check and applies it to gen 6.

Co-Authored-By: Skadiv <62726360+Skadiv@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>

* Loto-ID only has one t

* Crown Shrine has another genloc outside

* Consistent Loto name for array

Co-authored-by: Skadiv <62726360+Skadiv@users.noreply.github.com>
Co-authored-by: Matt <17801814+sora10pls@users.noreply.github.com>
2021-09-12 12:01:45 -07:00
Kurt
1d00e17217 Add properties for cleaner interaction 2021-09-07 15:31:54 -07:00
Kurt
2575d73144 Add IFixedAbilityNumber, hide vivillon region flags
tfw can't using static a private class in the file, gotta be explicit.
2021-09-06 18:11:32 -07:00
Kurt
17c32db8b5 Minor fixes
Replace hardcoded move int with enum val
Lillipup->Rockruff
personal_swsh: remove pledge bitflags (missed in CT update)
2021-09-06 18:04:14 -07:00
Kurt
adb7466a22 More memory legality additions
probably worthwhile to move the checks into the context, and return an enum -> switch to generate checkresult
2021-08-29 15:56:09 -07:00
Kurt
2f3e496e6f Change defunct gen8 location memory setting to check 1%
Refer to previous commit, the apply-memory has a 1% chance of failing for 100% memories, resulting in the ability to have 0-memory HT via link trades.

In-game trades caused the previous logic, as those forget to set the HT memory (likely the same logic flaw as skipping the nickname check via game settings).
2021-08-29 13:09:26 -07:00
Kurt
92f30e26cc Add misc memory checks for gen8 memID 42/51/70 args
Closes #3249

Co-Authored-By: Skadiv <62726360+Skadiv@users.noreply.github.com>
2021-08-26 21:20:52 -07:00
Kurt
6ea0d9f3bb Handle bank transferred memory feelings 5->6
Apparently they don't use the bit-permission table in Bank to get a random feeling, and instead just do rand(0,10).

Our logic to set a random feeling for bank transfers is still fine, because we set [0,10) within the bit table.
2021-08-25 10:37:53 -07:00
Kurt
d684b9fa14 Disallow starter pika/vee on opposite game storage 2021-08-23 16:46:03 -07:00
Kurt
a631e5cb4e Rearrange how some memory info is checked
Split into different game contexts
2021-08-22 16:41:57 -07:00
Kurt
b099b8d82c More genloc memory refinements
starting to see the flaws in how things are organized
2021-08-22 11:10:29 -07:00
Kurt
40d1249f1e Add genloc checks for gen8 memories 1,2,3
Can definitely be refined as these memories can restrict to capture/hatch/gift encounters. The multi-value arrays can also be restricted for non-hatches too (maybe first element if WasEgg?)

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-08-22 01:40:08 -07:00
Kurt
28e7473f1a Condense some expressions 2021-08-22 01:26:28 -07:00
Kurt
cd12962a50 Remove Tradeback state caching in PKM data
Since we have more metadata with move learn sourcing, we can check if it was traded to gen2 to get new moves / deleted.

Adjust call sites appropriately
might have some issues, to be ironed out maybe
2021-08-20 15:59:54 -07:00
Kurt
bedc52943e Trailing commas
No functional change
2021-08-20 13:49:20 -07:00
Kurt
c6342a163f Minor clean
variable swaps, simplifications
2021-08-20 13:42:25 -07:00
Kurt
9f249ef4d6 Add bounds check for API purposes
chris doing things funkily, might as well range check ourselves before blindly accessing the array

Use a const value for vivillon max wild form value
2021-08-19 18:59:24 -07:00
Kurt
934628b077 Pre-filter memory mismatch on moves
All over the place with prior commits; everything should be correct (and more robust) now.
2021-08-15 14:23:15 -07:00
Kurt
7c60363b38 Rework match ranking to have multi levels of deferral 2021-08-15 09:28:47 -07:00
Kurt
24e77e7382 Handle form changing for move memories
Doesn't invalidate any of the statements made today.

ty @Lusamine for identifying these cases.
2021-08-14 20:20:13 -07:00
Kurt
db1cbf8cce Handle raids with specific TR moves tripping memory checks
Defer the ones that have the memory and don't have the move; we'll likely find another match else settle for this one.
2021-08-14 19:47:52 -07:00
Kurt
9793e9f1a0 Minor clean
Slap on interface for EntreeSlot
De-magic some 💯 numbers to indicate what they're doing
Improve perf of move-match-relearn check
Add an "else" as valid is never both values (history verifier)
2021-08-13 15:36:30 -07:00
Kurt
a0bdb1a40e Fix OT->HT memory string output for HT verifier
Use the `memory.Handler string` value rather than recomputing. (lines 51, 64 pf memverify)
2021-08-12 17:33:31 -07:00
Kurt
391c6d4af6 Use Generation property when available 2021-08-06 15:34:28 -07:00
Kurt
69a907c5e7 Pass encounter object to innermost ability verifier
Fixes stuff for format3 CXD encounters as the side-games applied ability bits regardless of a second ability existing.
2021-08-06 15:26:21 -07:00
Kurt
70e10478dd Extract fog boost location check 2021-08-06 14:54:32 -07:00
Kurt
c126cd968a Only boost templates to 60 in wild area
No functional change for legality checks, so should be fine unless you're trying to get tiny edge case stuff.
2021-08-06 09:42:27 -07:00
Kurt
8a75435dc0 Add crossover from-to stub for anubis 2021-08-02 23:54:44 -07:00
Kurt
1efebe51d3 Simplify Country/Region/ConsoleRegion to byte from int
Only exists in gen6/7 games.
2021-08-02 19:43:57 -07:00
Lusamine
928abfac3e
Properly check Vivillon form legality (#3235)
This uses more current crowdsourced information to update the country
and subregion tables for Vivillon forms. It's possible to change the
country/subregion within a 3DS console region, so only forms that cannot
be obtained for a console region are flagged as illegal. If a form is
not native to the country/subregion, it is marked as Fishy instead.

https://docs.google.com/spreadsheets/d/e/2PACX-1vTVVOEZbXLVQvjIdzGACpZ_IrOWgVDBr_Wa-xULK3191BP9lf1tep-z-PsmcAfaH_aE56j3GHDX_9UO/pubhtml
2021-08-02 08:57:21 -07:00
Matt
f6a652c360
Update RibbonVerifier.cs
Official announcement in Pokémon HOME (mobile) states that Series 10 lasts until October 31, not August 31 as mentioned on Serebii.
2021-08-02 10:49:32 -04:00
sora10pls
b9291cc061 Update SWSH Ranked met date restrictions
Series 10 runs until 8/31/2021 and allows usage of restricted Pokémon.
2021-07-31 12:37:13 -04:00
Kurt
de94876822 Minor tweaks
no functional change
2021-07-30 16:22:10 -07:00
Kurt
7c697a519e Make EncounterArea parent reference protected, expose properties 2021-07-30 14:05:23 -07:00
Kurt
a159da0abf Reduce allocations of default valid/invalid
Condense some expressions, make some comments/params clear and consistent.
2021-07-30 13:05:34 -07:00
Kurt
a64782d313 Prevent fog slots/statics from being valid when not boosted to 60
Flag Misty(fog) mark as invalid when pkm is from Main wild area && not boosted
^ Check before the slot/static specific methods to have a one-liner :)
2021-07-26 15:01:21 -07:00
Lusamine
ab33df2fc9
Enforce weather legality for SWSH (#3221)
* Add weather types by location

Creates a dictionary of possible weather types for each SWSH location.
Unlisted locations may only have Normal weather or do not have any
encounter slots.

* Prune unused weather from static encounters

Some encounters were too permissive with weather, e.g. Sandstorm in
Fields of Honor and Challenge Beach; Snowstorm at Dyna Tree Hill.

A few crossover areas that would have limited the possible weathers were
marked with a "(c)". An example is Nidorina from Giant's Bed crossing
to Frostpoint Field, where Raining and Thunderstorm do not occur.

This additionally organizes encounters by location.

* Move location-weather dictionary to EncounterArea8

* Verify weather marks on encounterslot/static encounters

* Adds some static encounters available through weather bleed

Weathers aren't normally available, but these static encounters are
close enough to the boundary that the weather in an adjacent area can be
used to spawn them.

- Frostpoint Field Snorlax with Raining/Thunderstorm from Giant's Bed
- Snowslide Slope Amaura with Raining/Thunderstorm from Giant's Bed
- Frigid Sea Carracosta with Intense_Sun from Three-Point Pass
- Frigid Sea Magmortar with Intense_Sun from Three-Point Pass
- Ballimere Lake Corviknight with Snowstorm from Giant's Bed
- Ballimere Lake Cryogonal with Snowstorm from Giant's Bed
- Ballimere Lake Tyrunt with all weather from Giant's Bed
- Lakeside Cave Ferrothorn with all weather from Ballimere Lake
- Tunnel to the Top Golbat with all weather from Path to the Peak

* Defer weather marks if incompatible, enforce encounterslot weather

This uses the area weather to check fishing slots and tentatively adds
some tables for weather bleed encounterslots.

* Warm-Up Tunnel gets weather bleed from Training Lowlands

* Update for base PKHeX

* Handle weather bleed for SWSH encounter slots

Co-authored-by: Skadiv <62726360+Skadiv@users.noreply.github.com>

* Minor clean

Having duplicate weather marks is illegal, so just auto-partial match them instead of checking the other marks.

* Rearrange slot weather check logic

* Claim reserved byte in SWSH pkl

* No need for two variable names now

* Valid weather marks on tree/fishing should return with main weather

* Fix tree/fishing deferral and add another surf slot weather bleed

* Disallow tree/fishing encounters from using bleed tables

None are currently known at this time, and only hidden grass encounters
have a weather bleed table

* Condense bleed expression, combine tree/fish flag check

* Move weather-bleed check into EncounterArea8

Makes the dictionaries private instead of internal.

Co-authored-by: Skadiv <62726360+Skadiv@users.noreply.github.com>
2021-07-26 14:28:05 -07:00
Kurt
e961694bdb Minor tweaks
Pass evo chain to memory learning machine move
Pass minimum level for GB encounters if present, rather than enc min level
2021-07-22 19:08:56 -07:00
Kurt
8e5e4487ba Change interface for method call to less restricted
Don't need "Name" or "LongName" for these methods.
2021-07-13 18:22:04 -07:00
sora10pls
34c401b7a0 Revise IsHOMEGift, check Card ID for gift date range
Currently, HOME gifts present in wc8.pkl will not be flagged for invalid dates due to them missing their respective Card IDs. This will be fixed with the next stable release, so this works for now.
2021-07-13 18:22:04 -07:00
Kurt
9e665034b7 Implement "Can Buy Item" memory check
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-07-03 13:12:46 -07:00
Kurt
f2183f985f Tighten up memory 71 permissions 2021-06-30 15:56:08 -07:00