Commit graph

2640 commits

Author SHA1 Message Date
Kurt
936a0e927a Handle unavailable hidden abilities for bdsp
EncounterSlots now expose Ability, so no need for manual checks there.
2022-01-17 21:44:21 -08:00
Kurt
66c00e4f8a Add EC/PID checks for bdsp in-game trades
all data stored in the object is pre-computed from the EC xoroshiro (similar to roamers); all have a fixed seed.
2022-01-17 20:22:17 -08:00
Kurt
38809f67dd Handle suggestions 2022-01-17 20:21:33 -08:00
sora10pls
93083616dd Extend Ranked Ribbon availability for GO encounters
Also hange >= to > because of new GO => HOME met date legality.9/1/2022 is legal if it was transferred in somewhere like Kiribati or New Zealand, but 9/2/2022 isn't.
2022-01-16 14:53:04 -05:00
Lusamine
96d2ca1dcc Add Wild8RNG generation method 2022-01-16 01:57:56 -06:00
Kurt
682feab3d4 Return evolution chains with more accurate min-max
Closes #3371 ty @Ninjistix !
2022-01-14 00:11:33 -08:00
Kurt
94080eb71a Add prev function for xoroshiro implementations 2022-01-13 18:43:04 -08:00
Lusamine
5dfd7996f7 Uncomment 3 IV static Rotom and Ditto from SWSH
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/page/10/#comment-272386
Thanks to air6ornepig for reporting.
2022-01-13 13:16:15 -06:00
Kurt
be8b12dbbe Add Prev for xorshift implementation
Add some unit tests (why not?)
2022-01-12 17:05:16 -08:00
Kurt
bb2a63bbce Split min sheen calc for 3 & 4, revise limits
Thanks @SadisticMystic!

https: //github.com/kwsch/PKHeX/commit/9ce0da6c46ebea3c7c6edd1f1e0571e5ecbec739#r63579484
Co-Authored-By: Russell Jones <questiondesk@gmail.com>
2022-01-11 23:29:01 -08:00
Kurt
da9d09ea76 Misc tweaks
No functional change
2022-01-11 22:53:20 -08:00
Kurt
0742c1b891 More sneaky updates
Revises initial seeding mechanism to match games
Use structlayout to get/init 64bit state numbers
2022-01-10 22:33:37 -08:00
Kurt
79e22be419 Add more constructors
Ease of use
2022-01-10 22:06:22 -08:00
Kurt
73575624cf Define specific moveset for Odd Egg / extremespeed mons
Closes #3370
2022-01-10 21:27:04 -08:00
Kurt
03cedd4d8b Split xorshift128 to separate RNG
Blame ILCA for using RandomRangeInt to generate unsigned 32bit numbers :D
2022-01-10 21:07:27 -08:00
Kurt
659fc9978b Stackalloc marking set & raid IV gen 2022-01-08 22:48:33 -08:00
Kurt
9cde291595
Enumerate ability permissions in encounter templates, misc updates (#3368) 2022-01-08 22:34:04 -08:00
Kurt
437c79925d More poffin min sheen fudge 2022-01-08 10:57:51 -08:00
Kurt
933294b3c9 Update NicknameVerifier.cs 2022-01-08 10:43:53 -08:00
Kurt
75a438ca44 Misc tweaks 2022-01-08 10:33:02 -08:00
Kurt
209d295f58 More handling for traded Meister magikarp
what a meme
All these edge cases make me want to move all this trade OT/Nick validation into the EncounterTrade classes and just get an enum indicating what is wrong with the trainer/OT details...
2022-01-08 09:59:35 -08:00
Lusamine
522790b8e6 Add Giant's Bed static encounter Trevenant crossover
Co-Authored-By: Skadiv <62726360+Skadiv@users.noreply.github.com>
2022-01-07 21:00:44 -06:00
Kurt
f83a9bf833 Expose shiny potential value
Not really digging it currently as it doesn't cover multi-state like AlwaysStar-Or-Never, but that single edge case can be handled elsewhere
2022-01-07 17:48:12 -08:00
Kurt
36bf73818e Source trainers for encounter database
Closes #3364
Related: #3358
2022-01-03 19:33:10 -08:00
Kurt
47071b41f3
Refactoring: Span-based value writes and method signatures (#3361)
Existing `get`/`set` logic is flawed in that it doesn't work on Big Endian operating systems, and it allocates heap objects when it doesn't need to.

`System.Buffers.Binary.BinaryPrimitives` in the `System.Memory` NuGet package provides both Little Endian and Big Endian methods to read and write data; all the `get`/`set` operations have been reworked to use this new API. This removes the need for PKHeX's manual `BigEndian` class, as all functions are already covered by the BinaryPrimitives API.

The `StringConverter` has now been rewritten to accept a Span to read from & write to, no longer requiring a temporary StringBuilder.

Other Fixes included:
- The Super Training UI for Gen6 has been reworked according to the latest block structure additions.
- Cloning a Stadium2 Save File now works correctly (opening from the Folder browser list).
- Checksum & Sanity properties removed from parent PKM class, and is now implemented via interface.
2022-01-02 21:35:59 -08:00
Lusamine
a9896022ed Allow Ninjask moves on Gen 4 Sport Ball Shedinja 2022-01-02 21:12:46 -06:00
Kurt
bee4a54148 Ignore encounter if bad catch rate
Waffling on this, let's just be less lenient in error messages and just outright reject the encounter.
2022-01-02 15:03:04 -08:00
Kurt
7b4099030a Properly flag gmax in bdsp 2022-01-01 23:11:45 -08:00
sora10pls
eb71576803 Add New Year's distribution raid data 2021-12-31 19:04:35 -05:00
Kurt
2de2ed4985 Merge branch 'master' of https://github.com/kwsch/PKHeX 2021-12-31 13:52:37 -08:00
sora10pls
a02e97a8af Unban alternate Lake Verity zone
As you progress the story in the Sinnoh games, the water level in Lake Verity will rise allowing you to Surf and reach the Verity Cavern. When this happens differs between DP/BDSP and Pt.

Zone 323 has nothing to do with it being early-game and only when Rowan's briefcase is present, but rather the differing water level. Riley's Riolu Egg can be hatched here without trading, as well.

Co-Authored-By: Billo-PS <63661653+Billo-PS@users.noreply.github.com>
2021-12-28 17:26:05 -05:00
Kurt
dc4a9136ea Remove trailing whitespace 2021-12-27 14:03:41 -08:00
Kurt
76cac85243 Minor clean 2021-12-27 13:50:21 -08:00
Kurt
cc8ac7a4f1 Remove unnecessary warning suppression
fixed dat .editorconfig in vs22
Catching general exceptions is okay because this program handles user modified data that can potentially be corrupt.
2021-12-27 12:09:15 -08:00
Kurt
29fd17a6f9 Add friendsafari to HA metadata permission 2021-12-26 23:05:25 -08:00
Kurt
24e1898410 Update gen4 Shedinja handling
PK4->PK5 fixes gendered Shedinja -> genderless.
Clean up PK4 ball value setters and expose those 2 properties separately.
Add edge case permission for HG/SS Sport Ball Shedinja being legal if evolved on DP (DP doesn't change 0x86, lol)
Copy PokéathlonStat and ball values individually for BK4<->PK4 conversion

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-12-26 20:13:36 -08:00
Kurt
f50684b794 Remove childless xmldoc 2021-12-26 19:44:04 -08:00
Kurt
3d7967fcfe Fix recognition for cutecharm Nincada->Shedinja
GetGender would return 2, which would abort the Cute Charm check since genderless is not able to be cute-charm'd.
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=271537
2021-12-26 18:22:41 -08:00
Kurt
1d0993f852 Remove EvoBase, relocate functions to call sites
Utilize FormInfo to remap battle forms into hatch forms so the encounter matches something valid, and is flagged later in FormVerifier
2021-12-26 00:57:40 -08:00
Kurt
b348e38a3e Don't do DP english->jpn bug for BDSP 2021-12-26 00:06:10 -08:00
Kurt
192ef23052 Allow gen5 deerling and sawsbuck slots to be any form [0,3] 2021-12-26 00:00:38 -08:00
Kurt
49a2cd19d0 template=>pk4: Only ENG->JPN if DP, not Pt
Language bug was fixed after ENG DP (for other localizations, and Pt)
2021-12-25 23:59:18 -08:00
Kurt
9ce0da6c46 Add bdsp approximations for min sheen calcs
Closes #3351
2021-12-25 18:51:02 -08:00
Kurt
fbb9e0bf0e Flag original catchrates on g1->g2->g1 transfers
Closes #3328
2021-12-25 18:44:37 -08:00
Kurt
13e0f35e00 Add munchlax slot checking for DPPt/BDSP honey trees
Closes #3352
2021-12-25 13:48:28 -08:00
Kurt
2d34411203 Fix g8 meister magikarp matching
5b2ad8703c
2021-12-25 12:57:05 -08:00
Kurt
defae6727d Check bdsp version exclusive hatch locations
lol srsly

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-12-24 18:39:54 -08:00
Lusamine
8612404f84 Add Slippery Slope Weavile static encounter 2021-12-24 20:06:31 -06:00
Kurt
42d24ad183 Add sketch check for bdsp legends signature moves
Can't learn these yet
2021-12-23 01:57:53 -08:00
Kurt
46f5a9c29a Remove inaccessible zone IDs from hatch location list
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-12-23 01:25:14 -08:00
Kurt
606818b835 Bounds check sketch move IDs for generation
Smeargle no longer permitted to have Eerie Spell in gen6 format :)
2021-12-23 01:24:47 -08:00
Kurt
38a4135bcd Span-ify the unpacking of mini arcs
cuts out some of the internal c# sanity checking for better perf
2021-12-20 18:37:45 -08:00
sora10pls
260036a90b Add Holiday 2021 distribution raid data 🎄 2021-12-16 19:04:28 -05:00
Kurt
6b2ea0894e Bypass encounter slot check for radar slots
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=271406
https://discord.com/channels/401014193211441153/679178558597496872/908489378043686944
2021-12-12 13:16:27 -08:00
sora10pls
c05b79b532 Handle Route 229 <=> Route 230 crossover case 2021-12-12 09:18:57 -05:00
Kurt
5b2ad8703c Handle g8 meister magikarp language goofiness
Only 5 & 1 language IDs are used
2021-12-11 22:23:05 -08:00
Kurt
47a1fd10e4 Allow surf crossover from r223<->pkmleague
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-12-11 21:31:32 -08:00
Kurt
aa968f56aa File scoped namespace for drawing projects
Extract color util to separate class as it's not entirely image related.
2021-12-10 00:15:04 -08:00
Kurt
9f920405df Revise gen3 sheen max extrapolation
any contest stat sum above 73 can have any sheen if you really give it trash blocks, lol

not trying to bruteforce the exact combination of consumed blocks/poffins, so these clamps may permit impossible intermediate values, but these are infrequent and meh.

Closes #3325
2021-12-09 23:33:54 -08:00
Kurt
2e20e75168 Temp handling for bdsp case 2021-12-09 19:53:43 -08:00
Kurt
f1fe2f6a8c Minor clean 2021-12-09 19:30:12 -08:00
Kurt
e84932badd Remove unnecessary trailing comma
nit
2021-12-09 19:10:50 -08:00
Kurt
18469a78aa Set legal default ball for bdsp bred egg templates 2021-12-09 18:39:03 -08:00
Lusamine
e617beb604 Add Lost Tower to zones where Radar can't be used 2021-12-09 11:02:12 -06:00
Kurt
870a38c607 Use primary constructors for some records 2021-12-09 01:08:46 -08:00
Kurt
51c75dd102 Explicitly implement IFixedAbilityNumber on all templates 2021-12-09 00:46:59 -08:00
Kurt
90956f3b05 Flag encounter slots that cannot obtain HA or use ability patch
Ex: old chateau Gastly in bdsp cannot have HA as it is not different from base abilities
2021-12-08 23:43:32 -08:00
Kurt
aa78152856 Implement hidden ability (pokeradar) possibility for slots
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-12-08 23:41:50 -08:00
Kurt
0bb4534870 Reset contest stats to enc instead of zeroed
Can't lower contest stats, but there's no cases of them giving a pkm with contest stats in a game that can't obtain contest stats -- let's just reset instead of zero for futureproofing.

Make them extension methods too; add an overload if you want to purposefully maximize them.
2021-12-08 22:43:56 -08:00
sora10pls
88822b4e68 Update minimum Egg hatch cycle legality
0 is legal in most cases except for Gen2 and BDSP!

...it's technically possible to get 0 in BDSP if you have autosave turned on and have an Egg in your party after hatching one before it, but it will hatch immediately on your next game startup, so disallow it anyway.
2021-12-07 20:38:00 -05:00
Kurt
543359fff6 Add contest stat sheen checking
Closes #3324
2021-12-07 00:54:39 -08:00
Kurt
fcd97d5989 Don't add TR moves as possible for BDSP origin 2021-12-06 00:01:13 -08:00
Kurt
cacd6e9965 More records/sealing 2021-12-05 23:54:59 -08:00
Kurt
40ed5898af Merge extended property patterns 2021-12-04 18:37:47 -08:00
Kurt
88ddc5822e c#10: readonly record structs
Reduces some boilerplate constructors/equality compares
2021-12-04 18:32:35 -08:00
Kurt
f55c5bea66 Minor clean
no functional change
2021-12-04 17:56:56 -08:00
Kurt
9a1b2719ec Add simple legal item filtering for giveall
Closes #3318

Gen8: if held item, only give if can be legally held; if dmax crystal, only give if available.
Gen8b: if held item, only give if can be legally held
Others: unimplemented; pull requests accepted.
2021-12-04 12:24:32 -08:00
Kurt
3e59d481c4 Move bred pokeball short circuit to gen-specific function
Now flags safari-exclusive species in pokeballs
2021-12-04 10:52:57 -08:00
Lusamine
aef7987f82 Enable SWSH restaurant memory
Obtained by eating at the Circhester restaurant in story mode!
2021-12-03 16:58:07 -06:00
Kurt
95454246b8 Skip eggs for EncounterTrade check
yay reusing Link Trade egg met locations wrong, ty ilca
2021-12-01 10:38:12 -08:00
Matt
483547f631
Update Tables8bs.cs 2021-12-01 06:16:45 -05:00
Kurt
1c82b707f3 Add xmldoc, add egglevel get central location 2021-11-30 17:09:46 -08:00
Kurt
091e2c28cd Add safari-only breed balls 2021-11-30 15:41:47 -08:00
Kurt
ef183ca1ff Rearrange special case 2021-11-30 15:16:04 -08:00
sora10pls
03c3f4a343 Force Poké Ball for all Riolu Eggs
Happiny not affected because Chansey is in the wild.
2021-11-30 16:14:53 -05:00
Kurt
5b2bd2ef7e Simplify expression
don't need to re-fetch when it's already in the stack
2021-11-28 14:34:28 -08:00
Kurt
488b411716 Check for bdsp traded eggs being re-flagged for Nicknamed 2021-11-28 14:32:41 -08:00
sora10pls
dfff798855 Label more BDSP flags/work vals 2021-11-27 23:12:29 -05:00
Kurt
b34977d498 Fix feebas prism scale evo criteria ban 2021-11-26 21:16:13 -08:00
Kurt
d9a87f908d Update RibbonVerifier.cs 2021-11-26 19:37:29 -08:00
Kurt
66a2046e5a Fix move search loop 2021-11-26 16:50:30 -08:00
Kurt
435dbb0b57 Disallow sister version exclusive ribbons for exclusive forms
Spiky pichu cannot receive Sinnoh ribbons
Cosplay pikachu cannot receive Kalos ribbons

Closes #3286

Co-Authored-By: Kermalis <29823718+Kermalis@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-11-26 15:41:24 -08:00
Kurt
54d54a0f39 Restrict Twinkling to require ContestStar as well 2021-11-25 20:51:17 -08:00
Kurt
a761704a34 Split Trainer verifier into TrainerName and TrainerID
verify BDSP legality restrictions

Enforce nonzero TID/SID in Trainer Editor window (can use Block Data editor to set whatever without restriction, idc).

#3305
2021-11-25 19:15:42 -08:00
Kurt
d9012b7d90 Disallow int.MaxValue seed for roamers
nice RNG quirk
2021-11-25 18:09:31 -08:00
sora10pls
a1fd2bded2 Unban Gold Bottle Cap
Available via Battle Tower rewards. Still can't find EV feathers or Prism Scale anywhere, though.
2021-11-25 19:51:21 -05:00
sora10pls
b7e19cf06a Update BDSP item banlist, ban Prism Scale evo for Feebas 2021-11-25 17:24:23 -05:00
Kurt
3f5c01a0b8 Update shiny-type preserving from faketid
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-11-25 13:34:53 -08:00
Kurt
ae2c5080a5 Set nicknamed flag in GUI depending on encounter
#3311
2021-11-25 12:40:42 -08:00
Kurt
9d55fa9d80 Update ribbon legality for BDSP rules
Closes #3307
2021-11-25 12:28:23 -08:00
Kurt
614ae6855b Allow ignored egg moves for v1.0 unpatched games
They didn't reference the TamagoWazaIgnore table until v1.1 lmao

mimic BDSP's index fetching and just grab the array of eggmoves directly to avoid the abstraction method's overhead

set evotree back to private because don't need direct access anymore
2021-11-25 11:24:34 -08:00
Kurt
56c7c8336a Revise roamer shiny xor checking
shininess unrelated to your trainer ID, lol

probably also applies to other predetermined encounters like underground and radar, but those aren't EC-seed regenerated (?)

Remove unused interface declaration
2021-11-25 08:32:36 -08:00
Kurt
039095d75c Revise zero hw checks
fishy by default, opt in
ignore certain encounters
2021-11-24 23:03:30 -08:00
Kurt
203b764829 Add zero height/weight flagging setting
because people couldn't hacc responsibly, I might as well give them a nudge in the right direction.

Doesn't mean I won't check your "random" choices distribution.
2021-11-24 19:29:02 -08:00
Kurt
199b695c76 Update bdsp 30000 met locations per v1.1 2021-11-24 13:11:08 -08:00
Kurt
ecee6ae8a1 Fix dropdown suggested green moves from showing swsh moves
Extract the IsLandlocked check to the IsMovesetRestricted which already exists.
2021-11-23 22:58:41 -08:00
Lusamine
f34bc9c3fa Add Slippery Slope static encounter Trevenant
Closes #3287
2021-11-23 10:26:11 -06:00
Kurt
cd5c220ddc Show correct HatchCounter value for BDSP traded eggs
Yay abstractions to hide away the quirks.

BDSP traded eggs set HT_Friendship and the CurrentHandler flag, but the HatchCounter is always the OT_Friendship value.

Trades always receive BaseFriendship, instead of a hardcoded 50. Necessary to not hardcode because it's immutable for eggs.

Clicking the hatch counter label now sets it to the legal minimum hatch counter (best), and control clicking sets it to the max (worst). Check the encounter template for the true maximum.
2021-11-21 19:53:13 -08:00
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
sora10pls
3db6b69c09 Add Poffin ingredient berries to item arrays
Closes #3301
2021-11-21 08:14:48 -05:00
Kurt
3e677bf6c0 Add elemental beam type tutors for BDSP 2021-11-20 16:50:44 -08:00
Kurt
c355a5f65d Revise form match criteria for Burmy slots - can be any cloak 2021-11-20 09:59:14 -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
b2fd51ddab Revise roamer locations: source from mvpoke
Route 220 (00485) now valid

now invalid:
Route 224 (00411)
Route 225 (00412)
Route 227 (00414)
Route 228 (00416)
Route 229 (00420)

matt assumed dppt locations were reused, but not entirely :)

Closes #3296
2021-11-20 09:02:24 -08:00
Kurt
721d489402 Fix TM indexes (oops)
I guess none of us really tested TMs to notice

Closes #3293
2021-11-19 23:31:02 -08:00
Kurt
93aaad6cd4 Revert net6 to net5
would rather have pipeline builds for those keen right now
2021-11-19 23:19:41 -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
sora10pls
ac9f3941c1 Add new distribution raids 🧬 2021-11-18 19:17:56 -05:00
Kurt
8a48730adf Lessen severity of Gen1 missing moves if leveled up once
Closes #3277
2021-10-29 21:25:48 -07:00
sora10pls
338bc562bb Add new distribution raids 🦊👻 2021-10-28 20:05:02 -04: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
93d5f0886a Update Overworld8RNG.cs 2021-10-17 17:40:38 -07:00
Kurt
910f9a651b Fix CuteCharm frame yield off-by-one call index
Closes #3271 , thanks @valthisse !
2021-10-15 18:23:51 -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
Matt
b5bc24de35
Unban Pika/vee Dynamax Crystal encounters 2021-10-09 21:40:49 -04:00
Kurt
df34f2b5c4 Disallow downleveled watchtower self hosted shinies 2021-10-09 17:12:54 -07:00
Kurt
507eef43e7 Move enum to separate file 2021-10-09 16:25:36 -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
Kurt
2ed8056ea4 Trailing commas 2021-10-08 12:42:32 -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
cb204f335b Clamp gen1 learning of moves for min move count
Hope this doesn't regress for stadium tutoring moves

RB eevee with special 2-move set was being flagged (wanted 4 moves cuz the base 2 aren't the normal levelup moves)

capture references for more concise expressions
2021-10-07 23:55:15 -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
3f438a8169 Min movecount: handle more edge cases with latest api
Still should be rewritten to traverse all possible moveset building actions
2021-10-03 18:10:53 -07:00
Kurt
f53f46c2e4 Revise ability patch/capsule message
Fix PCD logic flow
2021-10-02 10:25:52 -07:00
Kurt
015afdf369 Hardcode kiribati date shift offset
Should have been "UTC+12"
We can just inline the shifting since it'll always add 12 hours to the current UTC time, thus that's the maximum date value possible
2021-10-01 08:35:11 -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
Kurt
aa334a55f1 Revise future date clamping to use max current date
Transfers use local date rather than UTC date, so we gotta allow dates up to kiribati's current date :)

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-09-30 20:15:19 -07:00
Kurt
d4b20b8082 Add nickname checks for WC3, add non-english ageto/colo
Closes #3260

Co-Authored-By: FeralFalcon <33670476+FeralFalcon@users.noreply.github.com>
2021-09-30 19:57:52 -07:00
Kurt
ca35623124 Remove phantom invisible character, fix de mattle ho-oh
#3260 part 1

I searched for more instances of the phantom character, and found the one instance in gen7 zh flags :D

Co-Authored-By: FeralFalcon <33670476+FeralFalcon@users.noreply.github.com>
2021-09-30 19:29:22 -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
sora10pls
769021cf77 Add Alolan distribution raids 🏝 2021-09-30 20:04:58 -04:00
Kurt
6a2f778c9a Allow reload for debug build 2021-09-21 19:42:14 -07:00
Kurt
ea90c9095f Fix early return bool
oops
Probably should be doing this in a branch before pushing :)
2021-09-17 18:15:19 -07:00
Kurt
425f0067c3 Add min level for new gbl types 2021-09-17 17:58:38 -07:00
Kurt
25316fbaef Add IV ceiling for GBL GO encounters 2021-09-17 17:56:15 -07:00
sora10pls
ffdd950a71 Disallow all Dynamax Crystals as held items
They cannot be given to a Pokémon to hold in-game. Also label new Pikachu/Eevee Dynamax Crystals.

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-09-16 20:15:22 -04:00
sora10pls
93cb6de183 Add Solrock/Lunatone distribution raids + new Dynamax Crystals 2021-09-16 20:11:10 -04:00
Kurt
c3051b3002 Fix special beam move order
Differs from gen4 which has frenzy plant last
2021-09-16 12:50:55 -07:00
sora10pls
e166f86027 Update Evolution enums
Tyrogue => Hitmonlee and Tyrogue => Hitmontop were reversed. 5c4475a237
2021-09-16 08:53:14 -04:00
Kurt
2874f6fc69 Revise pichu volt tackle egg handling
Clean up ParseMovesWasEggPreRelearn as only EncounterEgg call into it, and no EncounterEgg has a special moves interface implemented.
2021-09-15 18:43:18 -07:00
Kurt
63580a2835 Minor tweaks
For BigEndian we don't have to invert the array access if we just iterate backwards :)
Fix xmldoc for gen1 trades ampersand
Add xmldoc for enc trade classes

No functional change.
2021-09-15 18:13:17 -07:00
Lusamine
25313ad58d Eternatus can trigger legendary encounter memory 2021-09-15 20:04:09 -05:00
Lusamine
a779000097 Include Thunderstorm for Honeycalm Sea Seadra 2021-09-12 16:14:22 -05: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
80d1712b72 Mark stuff with enums, remove unused arrays
Fix shuffled comments for FormInfo
Remove unnecessary Reset on ctor, all fields are already the default
2021-09-07 20:57:19 -07:00
Kurt
a9374560ec Don't recurse, jump straight to eventual method for splitbreeds
Don't check splitbreed if generation <= 2, move that check upwards.
2021-09-07 15:40:14 -07:00
Kurt
91c7c28c6f Inline form changeable species lists 2021-09-07 15:35:36 -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
41b1aaeb19 Search mystery gift relearn moves for needed moves
Add to encountertrades searcher, for futureproofing

solves gen8 mg searching volt tackle pikachu
2021-09-06 11:43:42 -07:00
Lusamine
9751a75f59 Free Sgr7121 GMax Duraludon 2021-09-06 13:26:18 -05:00
Kurt
99231b978e Prevent egg generator from yielding unbreedable species-forms
The "IsPresentInGame" will likely have to be refactored out as an interface, as future games (BDSP) will likely have partial national dex content
2021-09-06 10:48:32 -07:00
Lusamine
4cb525aac1 Restrict memory 39 general locations for SWSH 2021-09-06 12:39:08 -05:00
Kurt
5079b4f311 Handle cutecharm ambiguous seed-frames
Iterate over all possible seed frames that yield the IV pattern; nature is right before IV rands (PID is algorithmic from gender ratio and prior nature call).
Split up GetFrames into stepwise methods, clean up parameter passing
2021-09-06 00:35:40 -07:00
sora10pls
9bd0104954 Add new distribution raids 🧹 2021-09-02 20:04:14 -04:00
Lusamine
2f2cb43bd0 Disallow memory 17 from SWSH
It's a 1% memory that is impossible to obtain normally, but was missed earlier since it occurs on the in-game Throh/Sawk trades.
2021-08-29 19:22:09 -05: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
348fa4c9fa Force Gen2 Red Gyarados to be male only, fixed IVs
Closes #3251

Uses fixed IVs to force shininess (rather than mutating DVs)
1f9e688b76/engine/battle/core.asm (L6103-L6110)

Co-Authored-By: CanoeHope <43196464+CanoeHope@users.noreply.github.com>
2021-08-29 13:23:34 -07:00
Kurt
92d15bdd03 Rename SetTradeMemoryHT, add SetTradeMemoryHT8
Gen6 behaves differently from Gen8.
Fix broken test case [Arrived via link trade, it had fun! (2) -> (3)]
2021-08-29 13:15:45 -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
1ac125d335 Add Gen8 memory table data
The middle table in poke_memory.prmb contains the analogue of Gen6's memory table data. All existing memory data is the same, with 20 memories added.

Feeling bitflags are the same as before, but as we've noticed, feeling 0 is not obtainable. All the feelings are value upshifted by 1. This is why the game shows a blank line for Gen6 Feeling-0, as that game was [0,23] not [1,24] for the span of feeling strings.

Memories with 1% chance are actually 0% due to how they if-abort in the game code. Nice bug, GameFreak! @Lusamine had previously committed the unobtainable memories, derived from the community's empirical data.
2021-08-29 13:06:44 -07:00
Lusamine
3627ff4104 Disallow specific memories from SWSH
Never observed these in 20k+ memories, and I wasn't able to trigger them myself either.
2021-08-29 10:42:16 -05:00
Skadiv
809557715d
Add Wyndon to the sign memory locations (#3252) 2021-08-29 09:38:15 -05:00
Lusamine
e85a75e796 Add Wyndon as a location for sitting on bench memory 2021-08-29 01:28:42 -05:00
Kurt
02e9d07745 Update EvolutionTree.cs 2021-08-28 14:44:07 -07:00
Lusamine
81f2744af2 Add story raid species for Dynamax memory 2021-08-28 15:55:47 -05:00
Kurt
c65fda5e7d Allow HM moves in gen2-4 eggs
Yay silly inheritance
ty atrius
2021-08-28 13:54:58 -07:00
Kurt
7434af48bf Fix HT know move memory deferral
Checks if it can know the move up until the current format, rather than origin game
2021-08-28 13:44:10 -07:00
Kurt
65b7102d4e Permit gen1/2 format eggs to have eggmoves (GS)
Thanks Psyduck!
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/page/10/?tab=comments#comment-268691
2021-08-27 23:11:21 -07:00
LegoFigure11
eeaf19f1c2
Fix incorrect met locations in XD GoD (#3250)
The Hexagon Brothers can be rematched in Phenac City if their shadows aren't snagged at the Cipher Lab, but Seedot, Houndour, Gulpin, and Spheal are all encountered outdoors (Phenac City (XD) [100]). Mareep and Baltoy are both encountered downstairs in the Mayor's House (Phenac City (XD) [096]).

Relevant .xk3 files: https://cdn.discordapp.com/attachments/537784151970021376/880816626176495626/Phenac_Rematches.zip
2021-08-27 07:33:12 -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
87a268fa7f Clean up memory generation parameter fetching 2021-08-25 19:45:47 -07:00
Kurt
0e2dac3ff6 Minor tweaks
Empty return for invalid species encountertemplate fetch
Expose property for ck3 @ 0xD7
show legal memory context items rather than gen8 always
2021-08-25 19:23:15 -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
c1a7d04c5c Fix ck3 fateful read
Hope 555e81205d was actually incorrect and that this is finally correct
2021-08-24 22:23:45 -07:00
Kurt
ffcd2e96e0 Fateful Mattle Ho-oh on japanese colosseum
must have been an oopsie they reverted for international releases
Thanks @liketolike !

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
#3242
2021-08-24 19:29:51 -07:00
Kurt
6e3bcd5b66 Encounter visualization: Show ball and differentiate visually 2021-08-24 14:03:20 -07:00
Kurt
2e3a6cc719 Fix memory 6 (pokecenter) compare for gen8 2021-08-23 23:06:33 -07:00
Kurt
a3633bb562 Update MemoryContext8.cs 2021-08-23 19:15:39 -07:00
Kurt
d684b9fa14 Disallow starter pika/vee on opposite game storage 2021-08-23 16:46:03 -07:00
Kurt
86fde6d42e Memory 3 updates, revert todo 2021-08-22 23:39:23 -07:00
Kurt
3a8947cc59 Allow battleversion-ambiguous relearn move 2021-08-22 22:23:59 -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