Commit graph

3000 commits

Author SHA1 Message Date
Kurt
d3c2d77d11 Misc move/memory tweaks
Disallow max moves from Sketch
Hide dmax moves from legal dropdown lists
Pass ushort for moves for validating memories
Internal class for move pp (hide empty class from dll users)
2022-08-24 20:32:40 -07:00
Kurt
43871e856c Specify some lambdas as static
Rewrite some usages to be more clear
bikeshedding at its finest, ignoring more important things to update/fix :)
2022-08-23 23:11:26 -07:00
Kurt
26b1453002 Narrow ribbon count type from int->byte, split interface
Fix RibbonVerifier4 not checking gen4 contest ribbons correctly
Split IRibbonCommon6 to have memory ribbons separate, as they are not implemented in mystery gifts. Also, we can add the boolean flags to the interface, and check that the boolean is set if count is nonzero.
Fix adding ribbons to Gen8 gift templates
Improve Gen8 template ribbon fetch (no closure, faster IndexOf)
2022-08-23 21:25:22 -07:00
Kurt
eb2cef10c9 Minor clean
Stability intensifies
2022-08-22 23:18:53 -07:00
Kurt
0b458395f1 Fix handling for USUM banned species bypass
Tweak EReader check for Shadow3, more straightforward since we can just check the location ID (nothing else uses that location ID).
2022-08-21 19:15:02 -07:00
Kurt
6441bdadd8
Add specialized struct for Moveset and IV specs (#3572)
`Moveset` struct stores 4 moves, and exposes methods to interact with a moveset.
`IndividualValueSet` stores a 6 IV template (signed).

Performance impact:
* Less allocating on the heap: Moves - (8 bytes member ptr, 20 bytes heap->8 bytes member)
* Less allocating on the heap: IVs - (8 bytes member ptr, 28 bytes heap->8 bytes member)
* No heap pointers, no need to jump to grab data.
* Easy to inline logic for checking if moves are present (no linq usage with temporary collections).

End result is faster ctor times, less memory used, faster program.
2022-08-21 17:34:32 -07:00
Kurt
2cb2531288 Add more xmldoc 2022-08-21 01:39:16 -07:00
Kurt
d0ca8403a9 Minor tweaks
Flag enigma berry on ck3/xk3
Suggest national ribbon if missing
Flag N's pkm if any IV is != 30, even if sum is 180.
2022-08-19 22:37:27 -07:00
Kurt
db0b77c493 Update RibbonVerifierCommon7.cs
Closes #3571
2022-08-19 13:22:39 -07:00
Kurt
44c8e772a3 Fix incorrect method call
Copypasta oops, previous commit at fault.
2022-08-18 01:17:03 -07:00
Kurt
3dde8a7cfa Reduce linq usage, minor perf 2022-08-17 23:48:37 -07:00
Kurt
5140c47e84 Pass missing flag so that remove all can revert 2022-08-17 23:47:15 -07:00
Kurt
136f742299 Flag cross-transfer presence if tracker missing
Can't get a Pioneer Ribbon on SW/SH alolan vulpix lacking a HOME Tracker, assuming you have the HOME Tracker setting enabled.
2022-08-16 15:50:35 -07:00
Kurt
912023d756 Fix 7->prev EncounterMovesetGenerator traversal
The dummy EncounterInvalid has Generation:0, when 7->6/2 depends on which generation the encounter originated on. Change it so that the origin generation gets passed along.
2022-08-16 13:14:48 -07:00
Kurt
f62597cc24 Add shared egg moves to GetAllMoves fetch 2022-08-16 12:42:40 -07:00
Kurt
768047cd80
Legality: Rewrite Ribbon Verifier (#3570)
* Rewrite ribbon verification
* Explicitly verifies all ribbons instead of chained iterators.
* Verifies using only the stack, using `struct` and `Span<T>`. No allocation on heap, or `IEnumerable` iterators.
* Verifies all egg ribbons using a separate method, explicitly implemented. No reflection overhead.
* Separates each ribbon interface to separate `static` classes. Easier to identify code needing change on new game update.
* Extracted logic for specific ribbons. Can easily revise complicated ribbon's acquisition rules.
* Simplifies GiveAll/RemoveAll legal ribbon mutations. No reflection overhead, and no allocation.
* Can be expanded in the future if we need to track conditions for ribbon acquisition (was Sinnoh Champ received in BDSP or Gen4?)

End result is a more performant implementation and easier to maintain & reuse logic.
2022-08-15 21:04:30 -07:00
Kurt
3cccb3a9cd Revise alola champ ribbon check 2022-08-12 10:16:12 -07:00
Kurt
b900361ad3 Permit alolan champ ribbon from mystery gift
silly world pikachu gift
2022-08-11 21:03:08 -07:00
sora10pls
7ad70a04c7 Add latest distribution raid data 👿 2022-08-11 20:07:02 -04:00
Kurt
7c4e5e7b04 Add more xmldoc 2022-08-11 00:46:41 -07:00
Kurt
af87d038aa Delete unused logic 2022-08-11 00:25:16 -07:00
Kurt
d1959d90a4 Move files 2022-08-11 00:24:59 -07:00
Kurt
30f2450a30 Minor clean, xmldoc personal tables 2022-08-11 00:24:25 -07:00
Kurt
59fad0e8cf Minor tweaks
Extract some logic (origin markings)
Revise directives for NET7 targeting, remove old net5 refs
2022-08-05 16:18:42 -07:00
Kurt
54910b8fba Early return if no evos
GO transfers like Snivy can be viewed but shouldn't exist in Gen8. This avoids any exception being thrown for shared move check.
2022-08-05 16:18:06 -07:00
Kurt
999caedf6e Allow viewing of un-convertible GO encounters 2022-08-05 11:23:48 -07:00
Kurt
538d651aef Misc tweaks
Add xmldoc, simplify some expressions
2022-08-05 11:23:28 -07:00
Kurt
87e45b14c8 Disallow BD/SP Tower Master ribbon w/mythicals
Thanks TFSthegreat !
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=278427
2022-08-03 20:27:13 -07:00
Kurt
19b4a26cd7 Use evo history to check visitation
Previously, the history shared Gen8 for Gen8a/Gen8b; now they're distinct.

Add "HasVisited" for other gens
2022-08-03 18:17:46 -07:00
Kurt
9166d0eb64
Refactoring: Move Source (Legality) (#3560)
Rewrites a good amount of legality APIs pertaining to:
* Legal moves that can be learned
* Evolution chains & cross-generation paths
* Memory validation with forgotten moves

In generation 8, there are 3 separate contexts an entity can exist in: SW/SH, BD/SP, and LA. Not every entity can cross between them, and not every entity from generation 7 can exist in generation 8 (Gogoat, etc). By creating class models representing the restrictions to cross each boundary, we are able to better track and validate data.

The old implementation of validating moves was greedy: it would iterate for all generations and evolutions, and build a full list of every move that can be learned, storing it on the heap. Now, we check one game group at a time to see if the entity can learn a move that hasn't yet been validated. End result is an algorithm that requires 0 allocation, and a smaller/quicker search space.

The old implementation of storing move parses was inefficient; for each move that was parsed, a new object is created and adjusted depending on the parse. Now, move parse results are `struct` and store the move parse contiguously in memory. End result is faster parsing and 0 memory allocation.

* `PersonalTable` objects have been improved with new API methods to check if a species+form can exist in the game.
* `IEncounterTemplate` objects have been improved to indicate the `EntityContext` they originate in (similar to `Generation`).
* Some APIs have been extended to accept `Span<T>` instead of Array/IEnumerable
2022-08-03 16:15:27 -07:00
Kurt
d1dad7b8eb Revise check for apply PID shinyxor
was checking stale value

make loop max adjustable by caller; knowingly requesting squares is 1:65,536, so a higher loop count than 50k might guarantee more successes.

Maybe in the future we'd have separate algorithms to pre-choose seeds by choosing a PID and unrolling -> rolling.

Co-Authored-By: Kermalis <29823718+Kermalis@users.noreply.github.com>
2022-08-03 16:11:49 -07:00
sora10pls
54babc2217 Allow Ranked Ribbon on Mythicals, extend availability 2022-08-02 09:23:07 -04:00
Lusamine
7ad9f68dda Add missing static Loop Lagoon Gyarados
Closes #3555
2022-07-22 18:15:24 -05:00
Kurt
7d35517614 Revise AV check string to show which stat invalid 2022-07-10 17:34:46 -07:00
Kurt
3dbf46be92 Handle "random" AV gains from level up 2022-07-10 15:53:33 -07:00
Kurt
42743d8c2f RS: Locations 75/77 unused
Remove from valid hatch location list
Mark as (unused) in text files

Closes #3544

Co-Authored-By: prof64 <80442784+prof64@users.noreply.github.com>
2022-07-04 01:02:47 -07:00
Kurt
cf86cafdf7 Add optional loop for generating min level 2022-07-02 17:10:30 -07:00
Kurt
0605a01b24 Remove unnecessary assignment
PIDIV.None is equivalent to a zeroed field.
2022-07-02 12:24:43 -07:00
Kurt
5c0498ddbe Don't recognize XD eevee->umbreon as colostarter 2022-06-30 17:23:27 -07:00
sora10pls
f3e0ebd163 Add latest distribution raid data 🐇 2022-06-30 20:07:03 -04:00
Kurt
10cfb45e55 BDSP: Allow bred beast ball if species not in SWSH
Remove unnecessary HashSet, all entries are not present in the first hashset comparison. Maybe was true back >4 years ago when initially implemented.
2022-06-29 19:39:08 -07:00
Kurt
6e46f567e9 Replace u16 read with lib 2022-06-29 00:01:14 -07:00
Kurt
41af1085ca Update EvolutionRestrictions.cs 2022-06-26 22:32:51 -07:00
Kurt
b9b4eb1791 Minor tweaks
Bulk: Pass slot origin to legality analysis. Pass the proper personal data for good measure

Personal: check if the form truly does exist for presence check because sometimes the form will default to 0 on OOB

Showdown: Reduce some allocation, be more lenient in casing parse for Nature suffix and Hidden Power manually typed by user. Parse non-english hidden power sets (yay, now usable by all languages even though PS sets are English only!).
2022-06-26 20:02:57 -07:00
Kurt
4cc992b6ee Fix Valid bool set
oops
2022-06-26 16:04:55 -07:00
Kurt
12954a6369 Minor perf improvement (spans)
Remove PKM.EVs, do operations without heap allocation
Reduce usage of PKM.IVs/PKM.Moves, reuse spans if possible.
2022-06-25 23:08:28 -07:00
Kurt
9c086260c6 Fix random level slots (PA8) initial move list 2022-06-22 16:24:11 -07:00
sora10pls
2e9f73ab4d Add PogoType for Ultra Beasts via Field Research
Will need to verify if Beast Balls can be used on other Pokémon, and if generic Poké Balls can be used on Ultra Beasts. We'll see when GO Fest Berlin starts.
2022-06-22 17:19:08 -04:00
Kurt
fc754b346b
File scoped namespaces (#3529)
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces)

Updates all the files, one less level of indentation.

Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
2022-06-18 11:04:24 -07:00
Kurt
78092e070d Allow PA8 HT from Gen7, prefer min from PLA
Closes #3527
ty @spacesonata !
2022-06-18 10:30:14 -07:00
Kurt
51edaac704 Flag pokerus on LGPE, traded starter 2022-06-17 16:38:05 -07:00
sora10pls
b9c42aa56a Add latest distribution raid data 👊💧
Uncatchable Urshifu!
2022-06-16 20:10:56 -04:00
Lusamine
2ed1fc1e86 Poffins can be even worse 2022-06-14 08:22:49 -05:00
Kurt
ce935edcdf xmldoc
no functional change
2022-06-14 00:01:51 -07:00
Kurt
1a3a365d8a Relax gen4/8b poffin sheen max calc
Really bad burnt poffins.
2022-06-13 21:57:57 -07:00
Kurt
78d681751e Check tracker for WB8/WA8 HOME gifts
Refactor logic flow since Gen8 is done & dusted.
2022-06-13 20:39:29 -07:00
Kurt
f53cc768a6 Improve performance of TM fetch 2022-06-13 00:20:00 -07:00
Kurt
10b27c9d95 Fiddle with tutors: no allocation
Besides expanding the move list, no more closures & linq.
2022-06-12 14:02:22 -07:00
Kurt
5ce8938440 Use history for hypertraining possible check
Closes #3520
2022-06-12 09:26:45 -07:00
Kurt
436588eb10 Replace é->e for code symbols
Closes #3519
Usages weren't consistent; since `é` isn't accessible on usual english keyboards, just use regular `e` instead of alt-223 entry.

Not sure why VS preferred to save the text files without an encoding prefix; oh well.
2022-06-11 15:32:12 -07:00
Kurt
cc8cbeb749 Revise gen3 contest stat max sheen disparity
Closes #3517

Co-Authored-By: Atrius97 <39707481+Atrius97@users.noreply.github.com>
2022-06-11 09:36:50 -07:00
Kurt
c3117994cc Allow GO7 handler 0
New current handler verifier settings flag GO => LGPE transfers. Unlike GO => HOME, these transfers use your LGPE OT info, so it's legal to have no HT and have the current handler be OT

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2022-06-08 00:27:24 -07:00
Kurt
c75f543f8b Minor tweaks 2022-06-07 23:32:57 -07:00
Kurt
5ccb678931 Permit Gen7b for GO even if location doesn't match
Feeling like the Move fetching needs to shift away from Generation too.
2022-06-07 20:15:32 -07:00
Kurt
54cb4dc8c8 Minor comment fixes 2022-06-07 03:21:04 -07:00
Kurt
428ce52c27 Add Current Handler checks & toggles
Default settings do not flag, as Database view does not track the savefile (LegalityAnalysis only indirectly references the latest loaded save file, not the true source).

Bulk Analysis will flag them correctly if run. Can be turned off.
2022-06-05 13:18:31 -07:00
Kurt
39a09fbbbe Defer BDSP->PK8 marsh ball mismatches 2022-06-05 11:28:17 -07:00
Kurt
bd5cc538c4 Check met date of WA8/WB8 less than current moment 2022-06-05 10:56:17 -07:00
Kurt
893b5d5293 Revise more PB7/PK8->Interface type checks 2022-06-04 21:03:25 -07:00
Kurt
9c5dc6e6e7 Add MarkValue verifier 2022-06-04 14:30:52 -07:00
Kurt
382ea5cd61 Extract move info api 2022-06-04 13:14:50 -07:00
Kurt
ab723af640 Expose Context for SaveFile/ITrainerInfo 2022-06-03 19:08:46 -07:00
Kurt
dde70f4962 Permit shared egg moves based on current type 2022-06-03 16:54:05 -07:00
Kurt
df02532697 Misc fixes
Simplify HM memory check (bit permission superset, just check directly)
Disallow BestFriends & Effort on PA8 exclusives
PA8 techrecord permits none.
2022-06-02 20:05:27 -07:00
Kurt
ead7c2d973 Update contest stat restrictions for BDSP visitors
Closes #3513
2022-06-02 19:11:37 -07:00
Kurt
e571a0b95f Check catchrate tradeback separately
Closes #3510
Thanks @CodeWithMa !
2022-06-02 18:32:22 -07:00
sora10pls
7d20363d6b Update プロポチャ Piplup end date 2022-05-31 20:21:55 -04:00
Kurt
5bcccc6d92
HOME 2.0.0: Handle conversion behavior & restrictions (#3506)
* Revises legality checks to account for traveling between the three game islands (PLA/BDSP/SWSH)
* Adds conversion mechanisms between the three formats, as well as flexible conversion options to backfill missing data (thanks GameFreak/ILCA for opting for lossy conversion instead of updating the games).
* Adds API abstractions for HOME data storage format (EKH/PKH format 1, aka EH1/PH1).
* Revises some APIs for better usage:
  - `PKM` now exposes a `Context` to indicate the isolation context for legality purposes.
  - Some method signatures have changed to accept `Context` or `GameVersion` instead of a vague `int` for Generation.
  - Evolution History is now tracked in the Legality parse for specific contexts, rather than only per generation.
2022-05-30 21:43:52 -07:00
Kurt
af2ac169e1 Only disallow catchrate enc if !tradeback
Closes #3501
2022-05-30 00:50:35 -07:00
Kurt
32e0bf95b0 Update LevelVerifier.cs
Closes #3499
ty @Ninjistix !
2022-05-19 22:07:09 -07:00
sora10pls
52082e0e9f Add latest distribution raid data 2022-05-19 20:03:48 -04:00
Kurt
a5b46d80f5 Minor tweaks
ShowdownSet: Lessen allocation
MoveTutor: Remove boxing by calling the generic method instead of object method
Xoro8b: Add more xmldoc, use positive constant instead of inverse negative for parity
StadiumUtil: Use built-in endianness reversal methods
2022-05-14 08:28:13 -07:00
Kurt
700236249f Treat random gendered slots correctly 2022-05-10 21:52:01 -07:00
Kurt
2a6026cc80 Load gender values for forced gender slots 2022-05-10 21:46:45 -07:00
Kurt
63784d748d Update LegendsArceusVerifier.cs 2022-05-09 21:24:10 -07:00
Kurt
a21d6c8248 Fix static8a move population 2022-05-08 19:08:44 -07:00
Kurt
0206475ba4 Update LegendsArceusVerifier.cs 2022-05-08 12:33:30 -07:00
Kurt
8c4db878dd Extract logic to set initial mastery move flags
Are we done yet
2022-05-08 10:28:22 -07:00
Kurt
178e5e8bc5 More mastery tweaks for db->pkm + alpha statics
in the RNG generator, defer alpha move mastery flag set for templates to set themselves
2022-05-08 10:06:38 -07:00
Kurt
3e8527f11a Minor tweaks
Reduce allocation in a few places, delete unused stuff, more concise expressions.
2022-05-07 21:25:26 -07:00
Kurt
ccf87242c1 Eliminate boxing on encounter search (criteria)
struct implementing interface is boxed when passed to method that accepts interface (not generic method).
Removes IDexLevel (no other inheritors but EvoCriteria) and uses the primitive the data is stored (array, not IReadOnlyList) for slightly better perf.
2022-05-07 18:29:36 -07:00
Kurt
e34d03d2e5 Update 22.05.08 2022-05-07 14:30:16 -07:00
Kurt
a9443be8fa Add bypass for alpha move purchased
ty @Atrius97 for finally nailing the repro on this

Co-Authored-By: Atrius97 <39707481+Atrius97@users.noreply.github.com>
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-05-07 13:48:47 -07:00
Kurt
178069f889 Minor tweaks 2022-05-07 11:47:01 -07:00
Kurt
58caa37d58 Push alpha move for fixed statics
Oops
2022-05-07 08:52:00 -07:00
Kurt
a57f40ae7d Break up PKX into separate classes
Many years ago, PKX used to be a >4,000 line bloated file, which spun off multiple classes like CommonEdits and most of the early non-GUI PKM related logic. Now, it's just a stub to source the latest generation & personal table.

Separate files = more concise info, and more room to grow to do more advanced things.
Makes the IsPresent methods public (no longer internal).
2022-05-06 20:38:55 -07:00
Kurt
124bbf98ad Allow seed of mastery toggling mastered flag
oops
2022-05-06 16:11:52 -07:00
Kurt
59ceec3c65 Extract EffortValues class, add $rand + $suggest
Renames IV/EV verifier field objects for Legality Checks due to class name clashing.
2022-05-06 15:47:54 -07:00
Kurt
9deafa851a
Create initial movesets for Alpha entities correctly, verify initial mastery (#3489)
* Draft checks for encounter slot mastery

* Check encounter mastery flags

* Add moves for LA static encounters that don't follow learnset

* Add moves on crossover LA static encounters

* add alpha moveset population method

Now generates and applies moves as the game does
Updates some handling of other methods to use Span

* Show better message for bad mastery init flags

* Insert descending if candidates have same level

Level 78 Yanmega:
- [01] [10] Quick Attack
- [06] [15] Gust
- [11] [20] Silver Wind
- [18] [28] Hypnosis
- [25] [35] Air Slash
- [34] [45] Ancient Power
- [43] [54] Crunch
- [43] [54] Bug Buzz

Yields:
AlphaMove
Crunch*
Bug Buzz*
Ancient Power

* Descending order due to iteration

Co-authored-by: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-05-06 15:43:23 -07:00
Kurt
232c65ed3a Update EncounterServerDate.cs
Closes #3488

Co-Authored-By: CanoeHope <43196464+CanoeHope@users.noreply.github.com>
2022-05-06 10:49:05 -07:00
Kurt
4c73f1c592 More strict alpha move check for statics 2022-05-05 20:21:21 -07:00
Kurt
ea87140aea Remove optional gameversion for enc generators
Simplifies some of the logic a little.
2022-05-04 22:28:39 -07:00
Kurt
824e868efe Flag non-pokeball GO shedinja (evo'd from nincada) 2022-05-03 20:17:28 -07:00
Kurt
7c8f52cbbf Minor clean
invert nesting, add missing if( space, group OT checks together
2022-05-02 23:48:25 -07:00
Kurt
b51cdfe72f Flag Marks on BDSP/PLA encounters
Note to self: Exclusion lists aren't futureproof; inclusion more resilient :)
2022-05-02 19:27:22 -07:00
Kurt
5132f961cc Add server date checks for WA8 gifts 2022-05-02 18:52:43 -07:00
Kurt
fa76da56c9 Inline some Rand32 calls
No functional change
2022-04-26 20:21:26 -07:00
Kurt
af141581ee Minor tweaks
Single underscore discards (one of the c# language revisions allowed reusing the single underscore discard).
Remove a temporary allocation in BDSP flag editor
2022-04-26 19:48:09 -07:00
Kurt
ecee948107 Add gender sprites for main GUI
Might trickle this out to the other editors that have gender toggles.
2022-04-24 20:28:56 -07:00
Kurt
ef3cb34387
Refactor EvoCriteria to be a struct, reduce allocation (#3483)
* Make EvolutionCriteria struct

8 bytes per object instead of 26
Unify LevelMin/LevelMax to match EncounterTemplate
bubble up precise array type for better iteration

* Inline queue operations, less allocation

* Inline some logic

* Update EvolutionChain.cs

* Improve clarity on duplicate move check

* Search reverse

For a dual stage chain, finds it first iteration rather than second.
2022-04-23 21:33:17 -07:00
Kurt
959b9e998b Only flag r45 roamer if tile is water
Grass Tile is okay.
2022-04-23 21:10:09 -07:00
Lusamine
9d3f61b708 Fix MMO roll count 2022-04-23 00:44:55 -05:00
Kurt
ff2e890e69 Revise Overworld8a application of PIDIV
Instantiating from template now follows group seed -> spawn 1 correlation, including alpha move.
Differentiates static encounters that don't follow the ow8a correlation, scrambles EC to disassociate.
Adds rand64 to get initial seeds
Set correct level range to match slotSeed; not respecting the slot roll being valid, but whatever.
2022-04-22 21:11:11 -07:00
Kurt
ad249dbb76 Differentiate MO + MMO slot types 2022-04-22 20:33:12 -07:00
Kurt
841fcde2b2 Enhance Pokerus api functions
Fixes #3480 ; (0,0) is a valid state regardless of format.
2022-04-14 14:05:32 -07:00
Kurt
a601180821 Extract Pokerus util logic
Simplify some GUI interactions when changing strain. Changing the day selection will update the visibility, no need to manually do it again.
2022-04-09 12:27:16 -07:00
Kurt
e6cf5d0baf Split PKMConverter into multiple classes
EntityFormat -> detects byte[] -> ctor() PKM
EntityConverter -> converts between pkm formats
RecentTrainerCache -> used by other classes (not within EntityConverter!)
EntityBlank -> creates blank PKM objects indirectly
2022-04-09 01:39:34 -07:00
Kurt
647b5a3f87 Remove duplicate home tracker flagging 2022-04-02 17:58:17 -07:00
sora10pls
1a082ecf04 Unban Darkrai, associated Met Locations, Sketch Dark Void
Also reformat Encounters8b to be consistent with other games' static encounter defs
2022-04-01 06:18:11 -04:00
sora10pls
1b39222edf Add April Fool's 2022 distribution raid data 🌲 2022-03-31 20:03:40 -04:00
Kurt
6deaf3cb74 More explicit type checks for Encounter class
A little more explicit on what it is actually checking for
2022-03-26 14:53:15 -07:00
Kurt
0dc641453b Condense some expressions
Getting close to weeding out all the easy inefficiencies to make me finally tackle the "stop gathering all moves instead of checking individual moves" allocation issue.
2022-03-20 23:28:18 -07:00
Kurt
3d759e1491 Move location lists to separate classes 2022-03-20 21:26:56 -07:00
Kurt
a4533b62d8 Reduce size of display-able met location arrays
shaves 5KB off the core DLL
2022-03-20 19:07:33 -07:00
Kurt
54f1e341f9 Spanify spawner object get 2022-03-20 01:46:24 -07:00
sora10pls
f94c16c40f Add new distribution raids 🦴 2022-03-17 20:04:14 -04:00
sora10pls
5b9b5e4faa Update Tables8bs.cs
Sweet Heart still unobtainable (why did they give it a sprite if it's not functional ingame?)
Azure Flute is now obtainable
Sacred Ash was never obtainable
2022-03-17 14:40:35 -04:00
Kurt
434f89fa0f Merge branch 'master' of https://github.com/kwsch/PKHeX 2022-03-15 19:23:20 -07:00
sora10pls
5c8d1ceeec Unban BDSP Ver. 1.3.0 locations + Sketch Judgment 2022-03-15 21:36:26 -04:00
Kurt
d91d242719 Stackalloc EV/AV checks 2022-03-13 22:33:17 -07:00
Kurt
d95ba482f3 Reduce allocation in methodfinder IV set 2022-03-13 19:39:38 -07:00
Kurt
d5ae6764aa Stackalloc IVs for template->pkm fill 2022-03-13 19:24:08 -07:00
Kurt
8f8726ac5e Disallow encstatic1 yield catchrate not tradeback 2022-03-13 18:29:47 -07:00
Kurt
8afc6814eb Disallow matching BU statics for non-JP 2022-03-13 17:45:01 -07:00
Kurt
4841a01b4e Update GO pickles, move Shiny.Never before Always 2022-03-12 17:39:01 -08:00
Kurt
801892b59e potential revisions for gible (#3462)
ddc6f414df caused it to be `<=` instead of `<`, but maybe the underlying issue was fixed a different way since all tests still pass with this reversion.
2022-03-12 17:39:01 -08:00
Kurt
69fafcab83 Performance: Slightly reduce allocations in moveset validation (#3460)
* Reuses move parse result objects for each encounter parsed in a LegalityCheck attempt, instead of creating a new object.
* Ensures the objects are never-null, and makes cleanup easier.

Slightly adjusts some other parts of the moveset validation to reduce allocations.
2022-03-12 17:39:00 -08:00
Kurt
93255efcb8 Disassociate Shiny enum from WC6 PIDType (#3461)
Have `Shiny.Random` be `0`, so we can skip init on this field for EncounterStatic. Plus makes it a little less brittle for future expansion if shiny qualities change.
2022-03-12 17:38:59 -08:00
Kurt
85b7541c9f Update EncounterArea1.cs 2022-03-10 18:04:39 -08:00
Kurt
5359a140a6 Handle fixed ability for 8b RNG 2022-03-08 08:44:55 -08:00
Kurt
4e1276a954 -8 bytes from each encounter template
saves about ~1MB RAM savings (>=179,142 objects)
2022-03-06 23:25:47 -08:00
Kurt
462ef70ffb SlotNumber/MagnetStatic int->byte
more size reductions
2022-03-06 22:47:03 -08:00
Kurt
8f9de86347 Span-ify BreedInfo, saves 10bytes heap alloc
the Actual result still needs to leave the stack, so that has to be heap allocated.
2022-03-06 13:04:56 -08:00
Kurt
9049ef99fd Minor allocation reduction 2022-03-06 13:03:39 -08:00
Kurt
7911cd6d5c Seal some classes 2022-03-06 12:16:36 -08:00
Kurt
e1414a0bea Move some interfaces to different folder
No code changes
2022-03-06 12:06:50 -08:00
Kurt
c51d51d381 More specific primitives for Memories/others 2022-03-06 12:01:47 -08:00
Kurt
41d2dd9294 Update EncounterTrade for Shiny metadata
Doesn't need to be stored in most cases
Now permits EncounterTrade1 to be shiny
2022-03-05 21:04:18 -08:00
Kurt
e17483fe46 some linq reduction 2022-03-05 20:03:52 -08:00
Kurt
1b266c1e4b Handle PLA MMO formarg deferral
Can capture formarg evolved stuff directly in wild
2022-03-05 18:54:50 -08:00
Kurt
3d9c7dc750 Reduce IAwakened from int->byte 2022-03-05 18:46:03 -08:00
Kurt
b20566eb59 Use actual primitive instead of int
Some interfaces aren't needed to be exposed as int
2022-03-05 18:30:35 -08:00
Kurt
9696da2eb3 Minor clean
Seal ComboItem
Reorder methods for easier reading
Fix BulkGenerator living dex setting CurrentLevel -- needs to be after species,form as EXPGrowth can vary for forms.
2022-03-05 18:13:31 -08:00
Kurt
f3b3f15035 Add exp > lvl100 check
stop directly writing EXP values lol
2022-03-05 09:12:43 -08:00
Kurt
d0f2b6eeb5 Add .CurrentLevel=$suggest for min legal level 2022-03-04 22:34:11 -08:00
Kurt
7443db3564 Update some xmldoc 2022-03-04 22:34:11 -08:00
Kurt
50828fa1bb Change some field types, reduce memory usage 2022-02-28 22:46:59 -08:00
Kurt
2991f62052 Reduce allocation for eggmove loading 2022-02-28 18:24:11 -08:00
Kurt
b0f846ae35 Optimize bdsp eggmove bin
Strip out unused entries
Use form-less loader format (nothing has formed eggmoves), just let shellos-1 use shellos-0's table.
2022-02-28 18:24:11 -08:00
Kurt
21a77f2197 Guard against invalid egg move indexing 2022-02-28 16:57:51 -08:00
Kurt
85e422c225 Compress PLA wild bin resource
Change the data structure so that different locations are tied to the table, rather than separate usages of the table.

This de-bloats from 344KB->85KB and has less runtime memory consumption.
2022-02-27 15:08:53 -08:00
Kurt
c2f7003f38 Update Encounters8a.cs 2022-02-27 14:13:35 -08:00
Kurt
e5e2a3427f Rename Silver SV->SI
SV will likely be the lump for SCarlet and VIolet
2022-02-27 11:16:12 -08:00
Matt
0d96d801ac
Unban Sketch Seed Flare, Oak’s Letter hatch locs 2022-02-27 13:15:01 -05:00
Kurt
ff58d1bb68 BDSP Shaymin encounter uncomment
Now available via oak's letter
2022-02-27 09:00:11 -08:00
Kurt
ccca8abdad Remove fixedball for go7, reset h/w/cp
Now that we have accurate calcs, let's just generate them with the values.
2022-02-25 13:52:50 -08:00
Kurt
5a71ecc8bb Minor clean 2022-02-24 23:17:16 -08:00
Kurt
cd043bce04 Extract egg met location 2022-02-24 23:14:40 -08:00
Kurt
ab62e76505 Handle alolan vulpix suggestion scenario 2022-02-24 22:47:48 -08:00
Kurt
32789d5609 Fix WB8 friendship check
Similar to WA8 friendship check. Previous personal table repoint didn't work because WB8 have .Version=BDSP.
7b05d0c056

Works fine now.
Closes #3448
2022-02-24 20:17:58 -08:00
Kurt
65130a9ae1 temp fix for some fixed h/w statics 2022-02-22 23:18:10 -08:00
Kurt
2753927942 Ignore empty slots in pre-filter
Add Palma property to PK8 per bdsp disassembly
2022-02-22 07:34:43 -08:00
Kurt
75bd26d056 Add new Illegal (clone/glitch abuse) flag + check 2022-02-21 20:13:27 -08:00
Kurt
5b981f2832 Un-secret the bulk PKM validator
Now has its own button next to verify checksums.
2022-02-21 17:46:32 -08:00
Kurt
2870163fff Don't check handler friendship if already invalid
prevents generating an unnecessary exception when gen == -1
2022-02-21 17:46:03 -08:00
Kurt
f1264a1a97 Handle struct default ctor 17.1 handling
Closes #3445
2022-02-21 16:11:58 -08:00
sora10pls
91d1a91142 Add Pokémon Day distribution raids 2022-02-21 19:05:34 -05:00
Kurt
d5be6254f3
Add logic for PLA wild RNG correlation (#3443)
Adds structures to read/write saved spawner data such as seeds, counts.
Adds generator and validator to emulate the FixInitSpec builder used by the game logic

Similar to SW/SH raids, validating these in-process is not feasible due to the number crunching required.

This does not handle the encounter slot call or the follow-up level range call. Just the inner FixInitSpec ctor & fill.

level is calc'd:
randFloat(sum) -> slot float
rand.Next() -> gen_seed (for all the details)
rand.NextInt(delta) +min -> level

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-02-20 17:59:48 -08:00
Kurt
dc3d8e7cec Minor clean 2022-02-14 21:32:52 -08:00
Kurt
7b05d0c056 Fix base friendship check for PLA piplup WA8 2022-02-13 15:25:45 -08:00
Kurt
013fe95c8d Update 22.02.14 2022-02-13 01:18:19 -08:00
Kurt
2267e1a879 Minor tweaks for api consumers
Indicate Shiny.Random on home shiny-possible gifts
More detailed exception message for GetLearnset/GetPersonal
2022-02-12 23:40:28 -08:00
Kurt
d17639f956 Add alpha move for encounter slots
oops
Closes #3427
2022-02-09 19:21:45 -08:00
Kurt
04856122b7 Simplify landmark alpha move match check 2022-02-09 16:17:44 -08:00
Kurt
39e47dbb82 Flag SWSH tutor moves 2022-02-09 15:06:14 -08:00
Kurt
988385e450 Add accurate Colo EReader PID generating
Closes #3421
Needed to force the locks, since they themselves are nature/gender locked.
2022-02-09 09:26:10 -08:00
Kurt
80eac48a49 Fix no alpha move bypass for alphas
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=273294
2022-02-08 23:16:00 -08:00
Kurt
9c5955c104
Emulate Height & Weight float calculations matching the game (#3417)
* Accurately implement height/weight calc

* Handle GUI reads

Having Auto off will read and write the values correctly

F6 will handle all the decimal points possible

* Remove no longer needed tolerance check
2022-02-08 18:56:11 -08:00
Kurt
556f711728 Remove random EC set for Trade8b
EC is fixed, in the template
2022-02-08 17:37:33 -08:00
Kurt
59144ddb0d Check level for new evo methods
Can't learn move below this level
2022-02-07 21:46:05 -08:00
Kurt
e12f3004ad Post-check defer if catchrate disallows tradeback
Closes #3412
2022-02-07 18:44:29 -08:00
Kurt
a7051107ea Conditionally set PP Ups and Purchase/Mastery flags on set import 2022-02-07 15:40:02 -08:00
Kurt
c7ed55ab54 Simplify match rating return value choice
Ensure it is ordered Partial->DeferredErrors->Deferred->Match
2022-02-06 16:14:46 -08:00
Kurt
b8394516d2 Flag insufficient flawless IVs for eslot8a 2022-02-06 16:08:03 -08:00
Kurt
420dd32aea Allow lower sheen threshold for beauty
Not really worth checking if it is all in beauty; this is just a simple error checker.
Closes #3401
2022-02-06 00:30:38 -08:00
Kurt
e8903505df Min move count: ignore purchased moves 2022-02-05 16:47:19 -08:00
Kurt
07b3efd14d Force PID for shiny ponyta 2022-02-05 15:57:34 -08:00
Kurt
3ca8c4c69f Add GV legality check
GUI already did indicate if a value was legal, but this actually flags the pkm in the legality checking report.
2022-02-05 13:48:34 -08:00
Kurt
3793fd4fd3 Landmark Alphas do not have Alpha Moves
nice omission gamefreak
2022-02-05 10:23:00 -08:00
Kurt
b252bc129a Re-enable legality checking error suppression
Forgot to disable it from testing, oops.
2022-02-05 09:31:36 -08:00
Kurt
69ee363663 Fix EncounterSlot form set order, copy expgrowth for consistency
Closes #3387
ty @odin880 !
2022-02-05 00:47:17 -08:00
Kurt
10fff124e5 Minor clean 2022-02-04 22:19:04 -08:00
Kurt
b72c5bbf1a Fix mystery gift alpha check
Implement IAlpha for good measure
2022-02-04 20:13:36 -08:00
Kurt
16e52cdb19 Add move mastery batch command (MoveMastery)
$suggestAll -> get all
$suggestNone -> remove all
$suggest -> get current moves
2022-02-04 20:04:57 -08:00
Kurt
94f2d3ba0b Fix Flawless IV count comparison
lol ty atrius
Closes #3383
2022-02-04 19:31:45 -08:00
Kurt
eed5bb04e3
Merge pull request #3382 from kwsch/pla
Update 22.02.04
Individual commits from this PR are not cherry-pickable in a vacuum; these were manually re-committed from a staging repo in order to group together changes for general public viewing. There were over 250 commits on the private development repo for this update.
2022-02-04 18:28:17 -08:00
Kurt
cdf41c0376 Update program translations 2022-02-04 17:42:00 -08:00
Kurt
0b32cbf132 Update PKHeX.Core abstractions with latest logic
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-02-04 17:35:15 -08:00
Kurt
4c280c4c6d Add BinLinkerAccessor for better startup perf
Read without splitting the arrays by using span instead.
2022-02-04 17:20:56 -08:00
Kurt
ff48c824eb Update ContestStatInfo.cs 2022-02-04 00:37:29 -08:00
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