Commit graph

4225 commits

Author SHA1 Message Date
Kurt
5b42dc8ae4 Minor clean 2021-08-22 00:05:41 -07:00
Kurt
92d1666970 Make PIDIV a readonly struct
Add tests to ensure the optimization remains in effect later
2021-08-21 18:24:38 -07:00
Kurt
65c5890e1f Make NPCLock a readonly struct
Reduces allocation, improves locality of data since the contents take less size than a pointer (can pass byval)
2021-08-21 17:44:43 -07:00
Kurt
ae0ca49628 Arrange CXD Shadow encounters, add ShadowID documentation 2021-08-21 17:01:50 -07:00
Kurt
c9b838b492 Inline clone method
More obvious what it does
2021-08-21 16:52:06 -07:00
Kurt
8f0fb902d1 ArgumentException -> ArgumentOutOfRangeException 2021-08-21 16:51:50 -07:00
Archit Date
27059268ba
un-trim alcremie form strings (cream vs swirl) (#3246)
also use proper alcremie forms for showdown
2021-08-21 13:02:37 -07:00
Kurt
8f4f86e88e Update WC8.cs 2021-08-21 11:50:24 -07:00
Kurt
5da9b4a70a Force alignment
FieldOffset isn't implied, fun.
2021-08-20 22:07:09 -07:00
Kurt
05364212ba Update Encount5.cs 2021-08-20 20:53:23 -07:00
Kurt
9ef93552c9 Add ability to set swarms for gen3 2021-08-20 20:50:16 -07:00
Kurt
48024f1245 Add Swarm data get/set for gen3-5
#3245
2021-08-20 19:52:31 -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
liketolike
8b4730a2ee
Update zh translation (#3241)
Adds Gen2 zh const/flag name files
Adds Gen7 zh lgpe flag names
Updates GUI translation
Updates gen3,4 const/flag files
2021-08-19 20:19:49 -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
sora10pls
5379bad7ff Add new distribution raids 👻 2021-08-19 21:20:56 -04:00
Kurt
c0d748a975 Add Dream World upload slot indicator
Tested & works on bw & b2w2
Thanks Brokemia for the request!
2021-08-16 11:54:03 -07:00
Kurt
a926923a6b Remove Fullness/Enjoyment from ExtraBytes
They show up in the memory editor
2021-08-15 19:32:50 -07:00
Kurt
05d745afe5 Fix inverted format search 2021-08-15 19:32:33 -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
31ddaf2bc4 Don't defer on ability mismatch 2021-08-15 11:07:59 -07:00
Kurt
42330eb771 Memories and special moves, bite the bullet
Allocate a list :(
We need to keep all the secondary deferred around, since they have special movepools.
2021-08-15 09:47:31 -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
e1c8ab8d96 Fix remapped glyph
Future updates to glyph remapping to come later
2021-08-13 17:25:20 -07:00
Kurt
44e360f7c7 Add Wolfe coal gift ahead of actual release 2021-08-13 17:24:49 -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
cad09e68bb Fix source string returns
I blame the goofy "move egg" names confusing me
Reorder some so that the switch case is sequential and can be optimized by jit as a jumptable
2021-08-12 17:32:25 -07:00
sora10pls
803fe84f04 Add form strings for Eiscue, Morpeko, and Zacian/Zamazenta
Ice Face, Full Belly Mode, and Hero of Many Battles (strings trimmed where appropriate)
2021-08-07 13:22:14 -04:00
Kurt
ad8d622443 Rearrange text resources
Put legality stuff with legality
2021-08-06 20:20:12 -07:00
Kurt
89372145b7 Extract legality report (invalids) methods 2021-08-06 16:12:11 -07:00
Kurt
b8e203bdef Remove invalidmatch tracking
The Encounter verifier method rarely rejects as our inner encounter matching methods are all-or-nothing. Don't bother keeping references for this bloat.
Ran the unit tests and nothing hit this logic.
2021-08-06 15:38:39 -07:00
Kurt
9f8642f7d2 Hide Generation/Game setters behind mutation method 2021-08-06 15:35:49 -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
a939a2dbd6 Add pkmdb sorting rules for loaded database set 2021-08-06 10:09:16 -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
5ec2b12ae5 Handle some warnings for release build
Unused usings; just make PIDType stuff visible.
2021-08-06 09:41:39 -07:00
Kurt
0094492bd2 Update 21.08.06
Update mgdb with latest
2021-08-06 00:34:31 -07:00
Kurt
0f3e5095c5 Replace more linq usage 2021-08-05 22:39:38 -07:00
Kurt
e18c2d8fa4 Replace linq with similar but faster logic 2021-08-05 20:47:32 -07:00
Kurt
5c472a400d Expand shorthand parameters
int i => int index, or whatever the value is representing.
2021-08-05 20:33:25 -07:00
Kurt
a1f5c76790 Fix pgl jpeg save 2021-08-05 19:38:47 -07:00
Kurt
edcf3a9bd6 Remove duplicate no-item for gen6 held item list 2021-08-05 18:54:08 -07:00
Kurt
c409026a69 Merge branch 'master' of https://github.com/kwsch/PKHeX 2021-08-05 17:16:15 -07:00
Kurt
4e669468c3 Pass parse result list to encounter info fetch ctor
Old: when an encounter is found, we copied the contents of the list into our analysis list.
Since we stop when we find a suitable encounter, the old list is useless. By sharing the same list, there's no consequence. Reduces allocation by ~56B each analysis object!

Simplification reduces the amount of method calls by 1
2021-08-05 17:16:13 -07:00
Kurt
59d480c834 Minor tweaks
Discard empty pkm files (species 0) when loading boxes or templates
Add more xmldoc
Simplify some method parameter names for readability
2021-08-05 17:05:39 -07:00
sora10pls
2766c2c900 Add new distribution raids
Apparently the theme is summer
2021-08-05 20:03:56 -04:00
Kurt
ebb47867dd Use FileUtil tryget for pkm from path
GetPKMFormatFromExtension is now only used once internally.
2021-08-05 16:29:32 -07:00
Kurt
2f9a60b5e6 Organize byte resources into subfolders 2021-08-05 15:35:29 -07:00
Kurt
cc0397f087 Misc tweaks
Improved readability
2021-08-05 15:18:43 -07:00
sora10pls
bfcf081e5b Fix XY multiplayer sprite display
Reorder enums; Serena before Calem
2021-08-05 16:22:06 -04:00
Kurt
ab3795abaa Handle enc->pk7 form-random vivillon Island Scan static 2021-08-05 12:36:47 -07:00
Kurt
0a74f6c33d Ignore species for rby if not present
encounter moves not present for those, lol
2021-08-05 12:36:19 -07:00
Kurt
9f4ff5f070 Update SearchSettings.cs 2021-08-05 12:07:40 -07:00
Kurt
d1fb38b9cf Set correlation with unrestricted details if failed 2021-08-04 19:58:25 -07:00
Kurt
616acc8bbd Misc fixes 2021-08-04 19:54:04 -07:00
Kurt
83a72df7cc Include gen1 encounter moves in not-needed list
Might result in some illegal matches as it includes it for all evolutions in the chain, but whatever. Could probably rewrite the generator to only generate for different starting-species, but it's fine now.

Inline the max level calc
2021-08-04 19:07:20 -07:00
Kurt
2f5e2016bc
Only use the TreatWarningsAsErrors for debug build (#3237)
* Update PKHeX.Core.csproj
2021-08-04 00:13:58 -07:00
Lusamine
0f1f0166ce Check for Fishing flag in case of grass spawns
Handles exceptions like Chewtle in high level area of Route 2, which are
in the Normal weather grass slots as well as the fishing slots.
2021-08-03 23:12:09 -05:00
Lusamine
2858c6636d Minor adjustments to area slot extensions
Invert check for crossover to disallow hidden (there are more symbol
tables). Galar Mine No. 2 has hidden fishing slots as well as curry.
HiddenMain3 SlotType was never used so it was removed.

Updates pkl to remove HiddenMain3.
2021-08-03 13:03:04 -05:00
Kurt
8a75435dc0 Add crossover from-to stub for anubis 2021-08-02 23:54:44 -07:00
Kurt
277b1b658d Un-nest 3ds console region bitflags
Insert 3DS into the name to indicate that it's for the 3DS
2021-08-02 20:59:40 -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
140f814f90 Update EncounterMovesetGenerator.cs 2021-08-02 20:25:16 -07:00
Kurt
c1e6693b9c Change GeoTrack props to byte too
if u say so, archit
2021-08-02 20:03:11 -07:00
Kurt
d0a558a211 Update MoveList.cs 2021-08-02 19:56:09 -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
8af275312a Localize Vivillon non-native legality string 2021-08-02 12:49:29 -05: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
Kurt
c1f13923c8 Update EncounterSlot7.cs 2021-08-02 08:57:03 -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
Kurt
26f7364a9c Condense more expressions
Easier to read as pattern matching
2021-08-01 16:21:30 -07:00
Kurt
846f9506fb Misc form handling update (EncounterSlots)
Mark gen7 Minior slots with 31
Mark gen2 Unown slots with 31
Mark gen4 Unown slots with 31
2021-07-31 22:41:52 -07:00
Kurt
f46bda3f75 Condense some expressions, parameter names
Enable warnings as errors, so that future pull requests can't submit nullable warning content
2021-07-31 22:38:04 -07:00
Kurt
1bc5cb1113 Handle special form cases for IsSane 2021-07-31 20:50:29 -07:00
Kurt
d8c2114770 Update PGT.cs 2021-07-31 19:50:27 -07:00
Kurt
0d3cb1f6ad Shorten string get/set to valid range
Implicit terminator set
2021-07-31 19:46:14 -07:00
sora10pls
3fdf1396aa Update TrainerFashion6 structure
Rename EyeShadow => Eyeliner, fixes labeling for fields and getters for lip color and freckles data
2021-07-31 16:00:10 -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
e2db713621 Update EncounterSlot8.cs 2021-07-31 00:01:55 -07: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
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
Kurt
a57e12db59 Remove unobtainable encounter slots from gen4 tables 2021-07-30 13:06:15 -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
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
Kurt
a10d1df9ca Extract pkm filename'ing logic to allow behavior replacing
injecting dependencies

replace the virtual inheritance with a type check
2021-07-28 19:28:56 -07:00
Kurt
fc03076093 Fix dunsparce swarm slots
Thanks Purrmewtations !
a12cd8f227
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=267911
2021-07-27 18:45:46 -07:00
Kurt
0c6254835d Add battle agency slots to main window misc viewables 2021-07-26 23:57:05 -07:00
Kurt
4ed0e30ace Minor tweaks
Muh infinitesimally small perf gainz found while waiting for next dota match
2021-07-26 23:33:56 -07:00
Kurt
97683932a1 Lowercase method paremeters 2021-07-26 15:31:46 -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
Kurt
d8b8b622cf Only allow brilliant boost if max level for slot
https://discord.com/channels/401014193211441153/805157881501450270/869223485795336232
2021-07-26 14:33:41 -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