Commit graph

45 commits

Author SHA1 Message Date
Kurt
5ce3e734b8
Skip initial cctor alloc on non-byte primitives (#3850)
Runtime/jit repoints these to the dll rather than heap if we're Little Endian (always, otherwise will allocate like before).

Eliminates quite a few static constructors, so even faster startup. Items later.
2023-03-25 17:55:55 -07:00
Kurt
d6e83362b3 Fix binarysearch result compare
Method returns a negative number if not found; not always -1
https://projectpokemon.org/home/forums/topic/62246-g3-xd-move-tutor-legality/
2022-09-05 08:50:27 -07:00
Kurt
3c232505e5
Refactoring: Narrow some value types (Species, Move, Form) (#3575)
In this pull request I've changed a ton of method signatures to reflect the more-narrow types of Species, Move# and Form; additionally, I've narrowed other large collections that stored lists of species / permitted values, and reworked them to be more performant with the latest API spaghetti that PKHeX provides. Roamer met locations, usually in a range of [max-min]<64, can be quickly checked using a bitflag operation on a UInt64. Other collections (like "Is this from Colosseum or XD") were eliminated -- shadow state is not transferred COLO<->XD, so having a Shadow ID or matching the met location from a gift/wild encounter is a sufficient check for "originated in XD".
2022-08-26 23:43:36 -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
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
382ea5cd61 Extract move info api 2022-06-04 13:14:50 -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
3d9c7dc750 Reduce IAwakened from int->byte 2022-03-05 18:46:03 -08:00
Kurt
2ed8056ea4 Trailing commas 2021-10-08 12:42:32 -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
3816d25f7b Condense some expressions
Simplify legal held item array creation, reduce linq usage in startup
Discard unreleased item array references; no need to retain after startup
2021-01-12 22:38:18 -08:00
Kurt
c432a15a20 Relocate some tables to a location closer to where they're used 2021-01-02 00:46:09 -08:00
Kurt
98be0f6739 Target type'd new 2020-12-21 17:17:56 -08:00
Kurt
01c597cba7 GO checks round 2 2020-11-12 20:41:01 -08:00
Matt
a0d97f6f89
Unban GO Shiny Vulpix (#3020)
Autumn Event 2020
2020-10-09 08:27:48 -07:00
Matt
185c499bff
Unban GO Shiny Doduo (#2994)
Mega Buddy Challenge
2020-09-22 09:23:58 -07:00
Matt
150ff88235
Unban GO Shiny Porygon (#2993)
September 2020 Community Day
2020-09-19 17:27:25 -07:00
Matt
e2b5d9d816
Unban GO Shiny Staryu (#2962)
Enigma Week 2020
2020-08-08 11:19:51 -07:00
Matt
f66d8d2ea5
Unban GO Shiny Tangela (#2949)
GO Fest 2020
2020-07-25 08:37:13 -07:00
Matt
10adb9b8c1
Unban GO Shiny Bellsprout (#2945) 2020-07-16 14:59:46 -05:00
Kurt
36dd5ece21 Initial Isle of Armor support
Co-Authored-By: sciresm <sciresm@users.noreply.github.com>
Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
Co-Authored-By: Archit Date <architdate@gmail.com>
2020-06-19 18:51:15 -05:00
Matt
383cf3e514
Unban GO Shiny Voltorb (#2829)
Philadelphia Safari Zone.
2020-05-08 07:48:24 -07:00
Matt
333693775e
Update GO Shiny Banlist (#2827)
Remove Venonat (Throwback Challenge 2020: Kanto).
Also switch to using enum like SWSH Hidden Ability banlist -- evolution families all on one line.
2020-04-30 17:05:44 -07:00
Matt
be229d03fb
Update GO Shiny Banlist (#2808)
Forgot to update when the Easter event began. Removes Shiny Exeggcute/Exeggutor.
2020-04-13 13:57:34 -07:00
Matt
7cb80fdbc5
Update GO Shiny Banlist (#2731)
- Valentine’s Day Event (Chansey)
- Raid Day (Lickitung)
- February Community Day (Rhyhorn)
2020-02-21 19:40:10 -08:00
Kurt
c730dfa1ba Remove empty ushort[1], improve item combo fetch
held item list now allocates less (concat arrays instead of ienumerables)
item list already prunes out of range items, so simplify data source fetch
simplify item list prune (return as list, so we can call RemoveAll instead of Where.ToList)
2020-01-24 23:29:45 -08:00
Matt
ea80718919 Unban GO Shiny Tentacool (#2468)
* Unban GO Shiny Tentacool

* Also unban GO Shiny Meowth
2019-11-19 13:54:29 -08:00
Matt
72a751b9ce Update GO Shiny Banlist (#2397)
oddish family
2019-10-02 20:04:49 -07:00
Matt
84f72ed2b9 Unban GO Shiny Mewtwo (#2387)
Ultra Bonus Unlock (Week 3)
2019-09-16 15:04:52 -07:00
Matt
5ab0005de7 Update GO Shiny Banlist (#2384)
Ultra Unlock Bonus, Week 2.
2019-09-09 21:07:30 -07:00
Matt
fb4a33ce7e
Unban GO Shiny Poliwag
Yokohama GO Fest
2019-08-05 21:06:57 -04:00
Matt
79127d02e4 Update GO Shiny banlist (#2365) 2019-07-26 15:33:19 -07:00
Matt
9cab2e366d Misc Let's Go updates (#2361) 2019-07-15 09:05:53 -07:00
Kurt
1de685c6d8 Add Happy Hour/Hold Hands
per confirmation from @PP-theSLAYER

https://projectpokemon.org/home/forums/topic/53818-these-events-are-flagged/?do=findComment&comment=246918
they probably won't release these two moves tho, LGPE has become stale
2019-07-08 22:18:15 -07:00
Kurt
90cc8ca3ec Add Celebrate for lgpe valid move filter
event move only
still haven't bothered finding the table in the exefs that results in
the pkm with an oob move being dummied. hardcoded based on data for now
:)
2019-07-08 22:14:21 -07:00
Kurt
4eb3f8529b Filter Species & Moves for legal combobox display
LGPE will missingno your pokemon if it's not a Kanto/M&M, or one of its
moves is not obtainable. For the user's benefit, filter down these
sources to the non-baddata list.

Item filtering and ball filtering might be something to think about for
the future, but not much benefit vs effort.
2019-06-29 08:19:01 -07:00
Matt
08ea140f17 Update GO Shiny banlist for GO 3rd Anniversary (#2342)
* Update GO Shiny banlist for GO 3rd Anniversary
2019-06-28 11:04:23 -07:00
Matt
59a7e247cb Update GO Shiny banlist (#2325) 2019-06-13 08:46:53 -07:00
Matt
186adca755 Unban GO Shiny Onix (#2323) 2019-06-10 22:33:34 -07:00
Matt
316430985a Unban Shiny Seel (#2293) 2019-05-01 14:23:08 -07:00
Matt
091e64571b Update GO shiny banlist (#2292) 2019-04-29 15:32:17 -07:00
Matt
963cb1aa99 Unban GO Shiny Lapras (#2287) 2019-04-17 22:49:58 -07:00
Matt
b8c490ae2e Update GO shiny banlist (#2286) 2019-04-17 12:53:13 -07:00
Kurt
289a36cbd4 Relocate tables to folder
less overpopulated folders
2019-04-12 14:12:30 -07:00
Renamed from PKHeX.Core/Legality/Tables7b.cs (Browse further)