Commit graph

526 commits

Author SHA1 Message Date
Kurt
e18c2d8fa4 Replace linq with similar but faster logic 2021-08-05 20:47:32 -07:00
sora10pls
2766c2c900 Add new distribution raids
Apparently the theme is summer
2021-08-05 20:03:56 -04:00
Kurt
2f9a60b5e6 Organize byte resources into subfolders 2021-08-05 15:35:29 -07:00
Kurt
66f1b23dc6 Consider the "SkipFormCheck" for gen7 scatterbug static
Rework to match the encounter slot form-ambiguous checks
2021-08-02 20:45:52 -07:00
Kurt
34f750d519 Remove unobtainable static encounters from gen4 tables
We don't do it for inaccessible static encounters in gen7/8, so anyone glitching/cheating will get an unrecognized encounter instead of "hey this exists, but you can't access it" error.
2021-07-30 13:09:26 -07:00
Lusamine
535b63f613 Add Frigid Sea weather bleed for Roaring-Sea Caves Hydreigon/Tyranitar
Co-authored-by: Skadiv <62726360+Skadiv@users.noreply.github.com>
2021-07-29 15:20:22 -05: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
sora10pls
ee004865bd Add fossil distribution raids 2021-07-22 20:08:14 -04: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
sora10pls
85c500529e Add Curry distribution raids 2021-07-08 20:06:30 -04:00
Kurt
103aa9aa4b
Revise EncounterArea and EncounterType for clarity (#3228)
EncounterArea now stores a more specific type'd array for encounter slots. Better iteration and less casting, as the nonspecific `Slots` fetch is rarely referenced.

EncounterType renamed to GroundTile to reflect how it actually works in Gen4. Was previously an ambiguous field that was clarified a little; we can describe it a little better now. Keep the GUI the same to not scare the end users.

Change Trash Byte properties to get/set a Span. Trash Byte legality checking easier on the garbage collector?
2021-06-29 20:58:06 -07:00
sora10pls
285f86d7b2 Add squid distribution raids
You're a kid now, you're a squid now
2021-06-24 20:04:07 -04:00
Kurt
87ac1cbcc9 Unban Sgr7348 encounter 2021-06-18 22:07:27 -07:00
Kurt
2abf95cdf8 Minor clean
expand some expressions, extract some methods, add comments
2021-06-08 20:14:55 -07:00
Lusamine
e66d5eaad5 Remove another duplicated distribution index
Index 24 is the same as 26, but they cross epochs from base to DLC1.
Keep the later one since it encompasses all legal Wild Areas.
2021-06-06 21:46:23 -05:00
Lusamine
72b4975429 Remove inaccessible water nest encounters 2021-06-05 18:11:19 -05:00
Lusamine
aee35cbe81 Clean up duplicated distribution indices
Removes duplicates if every encounter in the same index is the same as a
previous index. The following were affected, and only the first index
was retained.

- 5, 7 (Index 2 has 1 move different on 1 mon)
- 3, 4
- 11, 13
- 16, 18
- 27, 28, 30, 32
- 33, 35
- 36, 38
- 42, 44
- 45, 47
- 48, 50, 52
- 53, 55, 57
- 59, 61
2021-06-05 16:33:41 -05:00
Kurt
ad79833420 Update EncounterEvent.cs 2021-06-04 13:53:02 -07:00
Kurt
8222297da8 Remove enumerating when loading event templates
Just allocate the parent array and pass it to HashSet; having an ICollection, prevents resizing repeatedly and gc'ing the temp array is cheap.

Actually, only create a hashset if we're adding a gift from external DB. Saves on that allocation, and keeps the final result as an array (fastest iterating).
2021-06-04 13:48:02 -07:00
sora10pls
a2492eddd9 Add Frog distribution raids 2021-06-03 20:07:07 -04:00
sora10pls
3fb4bd7db2 Add Wooloo distribution raids
Nice
2021-05-20 20:16:13 -04:00
Kurt
a03f5dcc9d Make EncounterTrade met location use inheritance
hovering would grab ILocation, which didn't use the flexible met location fetch.

Just repoint stuff and have it as a virtual call, since most of these are fixed values, there's no point increasing the size of the classes besides those for gen4.
2021-05-18 17:14:17 -07:00
Kurt
2c820bfbe9 Minor tweaks 2021-05-18 13:29:55 -07:00
Kurt
31142ee297 Replace some linq usage with direct logic 2021-05-06 23:26:38 -07:00
sora10pls
e330eb5cfc Add current Meowth Distribution Raids 2021-04-29 20:08:16 -04:00
sora10pls
00e88b2abd Add World Penguin Day distribution Raids 2021-04-23 11:39:20 -04:00
Kurt
efb3d9aeac Add inaccessible den-rank checks
Rotom Bike water upgrade isn't available until you have sufficient progress, so you can't get these dens with the lowest rank.

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-04-22 21:47:25 -07:00
Kurt
0e4848ad82 minor clean 2021-04-18 18:18:09 -07:00
Lusamine
f2c2a77cfe
Check nest distribution encounters by patch epoch (#3195)
Distribution raid encounters from before each of the DLC patches can only be captured in existing Wild Area locations.
Store the BCAT index in the encounter details and use it to compare when the BCAT was available.
2021-04-18 11:01:42 -07:00
Kurt
63639a1ec8 Add latest distribution raid templates 2021-04-04 20:38:26 -07:00
Lusamine
d3059218c9
Remove gen 8 static encounters from DB if no location (#3181) 2021-04-01 15:09:26 -07:00
Kurt
4daf225379 Add location for colo ereader shadows 2021-03-27 20:32:52 -07:00
Kurt
4bb95e0bd3 Spring raids 2021-03-25 18:28:17 -07:00
Kurt
f86291cc1c Split gen3 encounter listing to have CXD separate 2021-03-21 19:52:48 -07:00
Kurt
8020a44961 Minor simplification
All slots are now initialized via constructor, property can now be init!
Optimize some value fetching for gen7b, as the input data has features that can be abused
2021-03-17 22:40:37 -07:00
Kurt
71d355804a Move enc7b sky encounter fudging to reformatter project
50c53d6b33
2021-03-17 21:59:00 -07:00
Kurt
b4f763f7ef Move bridge-stony copy logic to pkNX
Also trims out empty slots (species=0), less size!

49efb96db9
2021-03-17 18:11:07 -07:00
Kurt
6bce4eea14 Minor clean
Annotations (nullable), some switch cases for readability
2021-03-14 16:16:55 -07:00
sora10pls
08ecac8cb3 Update upcoming Dynamax Crystal encounters 2021-03-02 11:21:56 -05:00
Kurt
eba704a46b Add March raid data
Wonder if they'll fix the gmax Hattrem ;)
2021-02-28 17:19:17 -08:00
Kurt
7afd2ec351 Add Pika 2/25 raids 2021-02-25 16:27:05 -08:00
Kurt
c8b12a9ddc Add safari slots for floette 2/3
Move the array into the constructor; let it get garbage collected rather than leaving it as static
2021-02-21 15:18:58 -08:00
Lusamine
205cf481b0
Add Gyarados/Milotic crossover & disallow marks in Motostoke Gym (#3149)
* Add a Gyarados crossover & disallow marks in Motostoke Gym

* Milotic can be lured across boundary too
2021-02-14 10:13:45 -08:00
Kurt
f583cdd385 Add valentines milcery def
nonshiny is dupe with prior enc
2021-02-12 20:21:13 -08:00
Lusamine
c0b73575e6
Moltres-1 can be caught at Honeycalm Sea (#3147) 2021-02-10 21:02:29 -08:00
sora10pls
eab75b7cba Update HOME date legality
Update dictionary to use proper format (yyyy-mm-dd), as well as verifier to properly check met year.
Also updated IsValidDateWC8 to clamp latest met date based on UTC, like with GO encounters.
2021-02-04 09:12:47 -05:00
Kurt
f6f81ec782 Add initial date checks for HOME gifts 2021-02-03 22:57:59 -08:00
Kurt
51bc48a6a8 Add Cramorant raids 2021-02-03 22:44:15 -08:00
Kurt
e33468db96 Mark (JP-BU)/(JP-GN)(EN-BU) as RB
BU is only Japanese
2021-02-02 22:13:24 -08:00