Commit graph

64 commits

Author SHA1 Message Date
Kurt
3f49a01ae8 Sanity check save file personal info
https://projectpokemon.org/home/forums/topic/65409-2-exception-logs-found-on-latest-pkhex/?do=findComment&comment=290422
2024-07-04 18:42:27 -05:00
Kurt
496c66bd46 Rename box storage slot flag fetch
`IsSlotX` is a little ambiguous; `IsBoxSlotX` much better.
2024-06-29 10:39:59 -05:00
Kurt
0ffb256052 Add slot source legality checks
Useful for save files with misplaced data (you really have to be using the program weirdly to get these flagged).
Stuff like Eggs deposited in Daycare, non-fuseable species in the Fused slots, etc.

Allow HaX to view any slot, & Delete if Set is allowed
2024-06-15 00:14:49 -05:00
Kurt
5af6678784 Update 24.05.05
Fix devutil text update
swap tox & poison icons, move picturebox to the right
add some Legality settings util functions
2024-05-05 23:24:32 -05:00
Kurt
e1b964ad64 Use img instead of color
Still too big
2024-04-17 01:56:09 -05:00
Kurt
35bf97eaf1 Add status indication & switcher popup
Shows on all tabs to make it clear.
Obviously, status condition is only saved in formats that save status condition in their slot's resting format. Gen3 box mons won't store Burn, etc.
2024-04-17 00:35:42 -05:00
Kurt
2b4ecee899 Rename EggEncounter to IsEgg 2024-03-25 00:39:30 -05:00
Kurt
024bd85cc3 Minor tweaks
make PL6 use memory instead of byte[]
make GP1 use memory instead of byte[]
move IEncounterable properties higher to IEncounterTemplate
2024-03-24 20:12:33 -05:00
Kurt
95fbf66a6e
Refactor: Gen3/4 Lead Encounters, property fixing (#4193)
In addition to the Method 1 (and other sibling PIDIV types) correlation, an encounter can only be triggered if the calls prior land on the Method {1} seed. The RNG community has dubbed these patterns as "Method J" (D/P/Pt), "Method K" (HG/SS), and "Method H" (Gen3, coined by yours truly). The basic gist of these is that they are pre-requisites, like the Shadow locks of Colosseum/XD. 

Rename/re-type a bunch of properties to get the codebase more in line with correct property names & more obvious underlying types.
2024-02-22 21:20:54 -06:00
Kurt
10c5adadb8 Misc tweaks
Add more xmldoc
Move files/functions to better spot
Less allocation on hover glow
fix honeytree dppt group/slot/shake rand call (ty real.96)
2024-02-03 14:11:17 -06:00
sora10pls
e36035ebc7 Update Pecharunt sprite per battle data assets
It's smaller than the custom resized one I made from SV assets, but the compression on SV textures is atrocious. Can't win em all /:
2024-01-11 19:41:06 -05:00
Kurt
e6ad7c12cd Wipe transparent pixels in Silvally form sprites
Closes #4103
```
	var pixels = System.Runtime.InteropServices.MemoryMarshal.Cast<byte, uint>(data);
	foreach (ref var x in pixels)
	{
		bool isTransparent = (x >> 24) == 0;
		if (isTransparent)
			x = 0; // ensure rgb is zero too
	}
	ImageUtil.GetBitmap(data, w, h).Save(path);
```
2024-01-02 15:47:06 -08:00
Kurt
5da1ae4849 Handle Gold Bottle Cap 31IV bugfix
HOME fixes anything with 31IVs flagged. S/V no longer in error. Would be an incredible headache to detect "has visited S/V prior to 3.0.0" so just flag it.
It's up to the checker to know about this.
2023-12-20 11:29:50 -08:00
Kurt
9c0e9c31da Add weather marks, rebuild fixed encs
Still a few stragglers, but better overall.
2023-12-18 08:00:21 -08:00
Kurt
01c82e472e
Add support for Indigo Disk (#4111) 2023-12-17 16:41:15 -08:00
Kurt
1fe2b4f29b ArgumentOutOfRangeException
Use the new NET8 API
2023-12-09 15:21:10 -08:00
Kurt
d47bb1d297
Update .NET Runtime to .NET 8.0 (#4082)
With the new version of Visual Studio bringing C# 12, we can revise our logic for better readability as well as use new methods/APIs introduced in the .NET 8.0 BCL.
2023-12-03 20:13:20 -08:00
Kurt
3df5478d11 Minor tweaks, add Gigantamax info class 2023-11-08 23:32:41 -08:00
Kurt
5cf90deaee Use Shiny state in Glow
Closes #4055
Glow the shiny star for all formats.
2023-11-05 14:24:26 -08:00
Kurt
7703576088 Update 23.09.16 - Teal Mask
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>
2023-09-15 23:36:21 -07:00
Kurt
f632aedd15
Encounter Templates: Searching and Creating (#3955)
We implement simple state machine iterators to iterate through every split type encounter array, and more finely control the path we iterate through. And, by using generics, we can have the compiler generate optimized code to avoid virtual calls.

In addition to this, we shift away from the big-5 encounter types and not inherit from an abstract class. This allows for creating a PK* of a specific type and directly writing properties (no virtual calls). Plus we can now fine-tune each encounter type to call specific code, and not have to worry about future game encounter types bothering the generation routines.
2023-08-12 16:01:16 -07:00
sora10pls
72ab75410b Add custom SV sprites for Partner Pikachu/Eevee 2023-05-29 09:58:17 -04:00
Kurt
d2bed713e4 Change Totem sprite indication to orange aura
Closes #3880

Co-Authored-By: Jonathan Herbert <3344332+foohyfooh@users.noreply.github.com>
2023-05-12 14:57:32 -07:00
Kurt
aeb6595887 Show move elemental type in PKM Editor
Note this is only SV types, so moves that had their type changed (=>dark/steel/fairy) will be inaccurate in past game formats.

Would need time to dump the info.
2023-04-04 14:38:07 -07:00
sora10pls
cef70fe874 Update sprites for 1009/1010
These finally got pushed to their servers last night. The Walking Wake sprite on HOME's servers is different from the one in SV 1.2.0, the one in-game likely be updated with the first wave of DLC.

Also remove accidental extra Alcremie sprite (formarg 7 does not exist).
2023-03-15 09:05:57 -04:00
Kurt
0f1fba86f7
S/V 1.2.0 Support (#3819) 2023-02-27 19:12:27 -08:00
sora10pls
3e6a036c54 Add SV style menu sprites for ALL species and forms
only exception is Eternamax Eternatus, rest in Galar

Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
2023-02-09 19:58:12 -05:00
Kurt
aa430b48ca Disallow LGPE event gift OT handling 2023-02-07 21:56:25 -08:00
Lusamine
59e4ad61fb Add white outline to alpha icon 2023-02-06 20:33:22 -06:00
Lusamine
376e8f2d4f Always use white outlines on box shiny icons 2023-02-06 19:36:01 -06:00
Lusamine
8f64f719ad Update shiny stars to modern game icon
This swaps the old red star to a red two-star icon from Switch games.
Improves visibility of the square shiny icon (red/white stars).

Closes #3749
2023-02-06 18:54:40 -06:00
Kurt
88830e0d00
Update from .NET Framework 4.6 to .NET 7 (#3729)
Updates from net46->net7, dropping support for mono in favor of using the latest runtime (along with the performance/API improvements). Releases will be posted as 64bit only for now.

Refactors a good amount of internal API methods to be more performant and more customizable for future updates & fixes.

Adds functionality for Batch Editor commands to `>`, `<` and <=/>=

TID/SID properties renamed to TID16/SID16 for clarity; other properties exposed for Gen7 / display variants.

Main window has a new layout to account for DPI scaling (8 point grid)

Fixed: Tatsugiri and Paldean Tauros now output Showdown form names as Showdown expects
Changed: Gen9 species now interact based on the confirmed National Dex IDs (closes #3724)
Fixed: Pokedex set all no longer clears species with unavailable non-base forms (closes #3720)
Changed: Hyper Training suggestions now apply for level 50 in SV. (closes #3714)
Fixed: B2/W2 hatched egg met locations exclusive to specific versions are now explicitly checked (closes #3691)
Added: Properties for ribbon/mark count (closes #3659)
Fixed: Traded SV eggs are now checked correctly (closes #3692)
2023-01-21 20:02:33 -08:00
Kurt
f5ea250975
Show star square for everything in Gen9 (#3689) 2022-12-18 00:16:29 -08:00
Kurt
6876997110 Use old bitmap layering method for full background
Closes #3656
Better to show stray pixels than to overwrite-blend semi-transparent downscaled images.
2022-11-27 10:56:16 -08:00
Kurt
03182ebd3d Update 22.11.24
Adds support for Scarlet & Violet.

Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-11-24 17:42:17 -08:00
Kurt
186b2f2396 Update dependencies 2022-10-25 13:24:37 -07:00
Kurt
ba53f4a7bc Extract common csproj properties 2022-10-15 17:09:54 -07:00
Kurt
ac9bece46e Remove checksum check for Sprite building
Hot path 99.9999% will never be false
2022-09-02 10:29:32 -07:00
Kurt
d8fe34011d Remove some bounds checks, int->byte form oops
https://github.com/kwsch/PKHeX/pull/3575#issuecomment-1229244453
ty @Kermalis !
2022-08-27 12:53:30 -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
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
538d651aef Misc tweaks
Add xmldoc, simplify some expressions
2022-08-05 11:23:28 -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
sora10pls
3248b1d5f6 Update sprites with latest changes
Tentacruel: fixed Shiny sprite d7a6f6ee11

LA sprites: matches latest from National Dex Project with minor fixes
2022-08-02 09:27:46 -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
15a84d9d7e Minor clean 2022-06-11 09:51:43 -07:00
Kurt
a28c1b628e Clamp stripe height to img height
No more out of range settings crashing the logic :)
2022-06-07 23:59:01 -07:00
Kurt
382ea5cd61 Extract move info api 2022-06-04 13:14:50 -07: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
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