Commit graph

489 commits

Author SHA1 Message Date
Kurt
1ca1b838c1 Handle traded BDSP eggs & flag HatchCounter=0 2021-11-21 19:29:07 -08:00
Kurt
ba9db5ae99 Ban ball inheritance for bdsp fossils 2021-11-21 17:31:45 -08:00
Kurt
b26f4db6ab Enforce AffixedRibbon -1
All your hacks are still hacks

Re-expose affixed ribbon in the ribbon editor for PB8
Since there's no way to change it in BDSP, flag anything non-neg1
2021-11-20 09:04:09 -08:00
Kurt
723514e89c
Update 21.11.19 - Brilliant Diamond & Shining Pearl (#3289)
Big thanks to @SciresM @sora10pls @Lusamine @architdate @ReignOfComputer for testing and contributing code / test cases. Can't add co-authors from the PR menu :(

Builds will fail because azure pipelines not yet updated with net6.
2021-11-19 18:23:49 -08:00
Kurt
009e37662f
Startup Enhancements, Gen1/2 Save Indication, Export SAV cleaned up (#3275)
* Providing pkm/sav files via command line (dragging files onto exe / associated file launched) will more intelligently source a partner sav/pkm object if not provided.
* Gen1/2 mainline save files now indicate if they are VC era or GB era (legality implications) in the program title bar.
* Fixes loading VC era save backups not being recognized as VC era (`.bak` extension hides `.dat`)
* Export BAK moved to the SAV tab, which allows Export main to be deleted and Export SAV to be used as the single-click for exporting saves. `CTRL-E` is still the hotkey.
2021-10-21 22:13:21 -07:00
Kurt
256b3c66ca Recognize unhatched crystal eggs, 2F pokecenter location
lacking met location data on receipt, can result in 0 for eggs hatched on the second floor of a pokecenter

https://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(Generation_II)

Thanks Freezing Dart!
2021-10-19 21:53:22 -07:00
Kurt
4b263bf9bb Fix pattern matching comparison
Wish I had an analyzer to catch this (missing parens) similar to boolean logic

#3271 - resolves the traded egg recognition issue
2021-10-13 20:05:19 -07:00
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