mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 04:23:12 +00:00
d47bb1d297
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.
130 lines
9.2 KiB
C#
130 lines
9.2 KiB
C#
using System;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Details about moves in <see cref="EntityContext.Gen9"/>
|
|
/// </summary>
|
|
internal static class MoveInfo9
|
|
{
|
|
public static ReadOnlySpan<byte> MovePP_SV =>
|
|
[
|
|
00, 35, 25, 10, 15, 20, 20, 15, 15, 15, 35, 30, 05, 10, 20, 30, 35, 35, 20, 15,
|
|
20, 20, 25, 20, 30, 05, 10, 15, 15, 15, 25, 20, 05, 35, 15, 20, 20, 10, 15, 30,
|
|
35, 20, 20, 30, 25, 40, 20, 15, 20, 20, 20, 30, 25, 15, 30, 25, 05, 15, 10, 05,
|
|
20, 20, 20, 05, 35, 20, 20, 20, 20, 20, 15, 25, 15, 10, 20, 25, 10, 35, 30, 15,
|
|
10, 40, 10, 15, 30, 15, 20, 10, 15, 10, 05, 10, 10, 25, 10, 20, 40, 30, 30, 20,
|
|
20, 15, 10, 40, 15, 05, 30, 10, 20, 10, 40, 40, 20, 30, 30, 20, 30, 10, 10, 20,
|
|
05, 10, 30, 20, 20, 20, 05, 15, 15, 20, 10, 15, 35, 20, 15, 05, 10, 30, 15, 40,
|
|
20, 10, 10, 05, 10, 30, 10, 15, 20, 15, 40, 20, 10, 05, 15, 10, 05, 10, 15, 30,
|
|
30, 10, 10, 20, 10, 01, 01, 10, 25, 10, 05, 15, 25, 15, 10, 15, 30, 05, 40, 15,
|
|
10, 25, 10, 30, 10, 20, 10, 10, 10, 10, 10, 20, 05, 40, 05, 05, 15, 05, 10, 05,
|
|
10, 10, 10, 10, 20, 20, 40, 15, 05, 20, 20, 25, 05, 15, 10, 05, 20, 15, 20, 25,
|
|
20, 05, 30, 05, 10, 20, 40, 05, 20, 40, 20, 15, 35, 10, 05, 05, 05, 15, 05, 20,
|
|
05, 05, 15, 20, 10, 05, 05, 15, 10, 15, 15, 10, 10, 10, 20, 10, 10, 10, 10, 15,
|
|
15, 15, 10, 20, 20, 10, 20, 20, 20, 20, 20, 10, 10, 10, 20, 20, 05, 15, 10, 10,
|
|
15, 10, 20, 05, 05, 10, 10, 20, 05, 10, 20, 10, 20, 20, 20, 05, 05, 15, 20, 10,
|
|
15, 20, 15, 05, 10, 15, 10, 05, 05, 10, 15, 10, 05, 20, 25, 05, 40, 15, 05, 40,
|
|
15, 20, 20, 05, 15, 20, 20, 15, 15, 05, 10, 30, 20, 30, 15, 05, 40, 15, 05, 20,
|
|
05, 15, 25, 25, 15, 20, 15, 20, 15, 20, 10, 20, 20, 05, 05, 05, 05, 40, 10, 10,
|
|
05, 10, 10, 15, 10, 20, 15, 30, 10, 20, 05, 10, 10, 15, 10, 10, 05, 15, 05, 10,
|
|
10, 30, 20, 20, 10, 10, 05, 05, 10, 05, 20, 10, 20, 10, 15, 10, 20, 20, 20, 15,
|
|
15, 10, 15, 15, 15, 10, 10, 10, 20, 10, 30, 05, 10, 15, 10, 10, 05, 20, 30, 10,
|
|
30, 15, 15, 15, 15, 30, 10, 20, 15, 10, 10, 20, 15, 05, 05, 15, 15, 05, 10, 05,
|
|
20, 05, 15, 20, 05, 20, 20, 20, 20, 10, 20, 10, 15, 20, 15, 10, 10, 05, 10, 05,
|
|
05, 10, 05, 05, 10, 05, 05, 05, 15, 10, 10, 10, 10, 10, 10, 15, 20, 15, 10, 15,
|
|
10, 15, 10, 20, 10, 10, 10, 20, 20, 20, 20, 20, 15, 15, 15, 15, 15, 15, 20, 15,
|
|
10, 15, 15, 15, 15, 10, 10, 10, 10, 10, 15, 15, 15, 15, 05, 05, 15, 05, 10, 10,
|
|
10, 20, 20, 20, 10, 10, 30, 15, 15, 10, 15, 25, 10, 15, 10, 10, 10, 20, 10, 10,
|
|
10, 10, 10, 15, 15, 05, 05, 10, 10, 10, 05, 05, 10, 05, 05, 15, 10, 05, 05, 05,
|
|
10, 10, 10, 10, 20, 25, 10, 20, 30, 25, 20, 20, 15, 20, 15, 20, 20, 10, 10, 10,
|
|
10, 10, 20, 10, 30, 15, 10, 10, 10, 20, 20, 05, 05, 05, 20, 10, 10, 20, 15, 20,
|
|
20, 10, 20, 30, 10, 10, 40, 40, 30, 20, 40, 20, 20, 10, 10, 10, 10, 05, 10, 10,
|
|
05, 05, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01,
|
|
01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 05,
|
|
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 40, 15, 20, 30, 20, 15, 15, 20, 10, 15,
|
|
15, 10, 05, 10, 10, 20, 15, 10, 15, 15, 15, 05, 15, 20, 20, 01, 01, 01, 01, 01,
|
|
01, 01, 01, 01, 05, 05, 10, 10, 10, 20, 10, 10, 10, 05, 05, 20, 10, 10, 10, 01,
|
|
05, 15, 05, 01, 01, 01, 01, 01, 01, 10, 15, 15, 20, 20, 20, 20, 15, 15, 10, 10,
|
|
05, 20, 05, 10, 05, 15, 10, 10, 05, 15, 20, 10, 10, 15, 10, 10, 10, 10, 10, 10,
|
|
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 05, 10, 15, 10, 15,
|
|
05, 05, 05, 10, 15, 40, 10, 10, 10, 15, 10, 10, 10, 10, 05, 05, 05, 10, 05, 20,
|
|
10, 10, 05, 20, 20, 10, 10, 05, 05, 05, 40, 10, 20, 10, 10, 10, 10, 05, 05, 15,
|
|
05, 10, 10, 10, 05, 05, 05, 15, 10, 10, 15, 05, 10, 10, 10, 05, 10, 10, 05, 10,
|
|
10, 10, 10, 10, 15, 15, 10, 10, 10, 05, 15, 10, 10, 10, 10, 10, 10, 15, 15, 05,
|
|
10, 15, 05, 01, 15, 10, 15, 10, 10, 10, 10, 10, 10, 10, 05, 15, 15, 10, 05, 05,
|
|
10, 10, 10, 10, 20, 20, 20, 05, 10, 10, 05, 10, 05, 05, 10, 20, 10, 10, 10, 10,
|
|
10, 05, 15, 10, 10,
|
|
];
|
|
|
|
public static ReadOnlySpan<byte> MoveType_SV =>
|
|
[
|
|
00, 00, 01, 00, 00, 00, 00, 09, 14, 12, 00, 00, 00, 00, 00, 00, 02, 02, 00, 02,
|
|
00, 00, 11, 00, 01, 00, 01, 01, 04, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
|
|
03, 06, 06, 00, 16, 00, 00, 00, 00, 00, 00, 03, 09, 09, 14, 10, 10, 10, 14, 14,
|
|
13, 10, 14, 00, 02, 02, 01, 01, 01, 01, 00, 11, 11, 11, 00, 11, 11, 03, 11, 11,
|
|
11, 06, 15, 09, 12, 12, 12, 12, 05, 04, 04, 04, 03, 13, 13, 13, 13, 13, 00, 00,
|
|
13, 07, 00, 00, 00, 00, 00, 00, 00, 07, 10, 00, 13, 13, 14, 13, 00, 00, 00, 02,
|
|
00, 00, 07, 03, 03, 04, 09, 10, 10, 00, 00, 00, 00, 13, 13, 00, 01, 00, 13, 03,
|
|
00, 06, 00, 02, 00, 10, 00, 11, 00, 13, 00, 03, 10, 00, 00, 04, 13, 05, 00, 00,
|
|
00, 00, 00, 00, 00, 00, 00, 01, 16, 06, 00, 07, 09, 00, 07, 00, 00, 02, 11, 01,
|
|
07, 14, 00, 01, 00, 16, 17, 00, 03, 04, 10, 04, 12, 00, 07, 00, 14, 01, 04, 00,
|
|
15, 05, 11, 00, 17, 05, 00, 00, 00, 12, 06, 08, 00, 00, 00, 00, 00, 00, 00, 00,
|
|
00, 09, 04, 01, 06, 15, 00, 00, 16, 00, 00, 08, 08, 01, 00, 11, 17, 00, 01, 15,
|
|
10, 09, 16, 13, 00, 00, 05, 07, 13, 01, 10, 16, 00, 00, 00, 00, 00, 09, 14, 16,
|
|
16, 09, 16, 00, 01, 00, 00, 00, 12, 16, 00, 13, 13, 00, 00, 11, 01, 13, 00, 01,
|
|
01, 00, 16, 00, 09, 13, 13, 00, 07, 16, 00, 10, 01, 00, 06, 13, 13, 02, 00, 09,
|
|
04, 14, 11, 00, 00, 03, 00, 09, 10, 08, 07, 00, 11, 16, 02, 09, 00, 05, 06, 08,
|
|
11, 00, 13, 10, 06, 07, 13, 01, 04, 14, 10, 11, 02, 14, 08, 00, 00, 15, 11, 01,
|
|
02, 04, 03, 00, 12, 11, 10, 13, 11, 15, 05, 12, 10, 08, 13, 02, 13, 13, 01, 01,
|
|
08, 13, 10, 00, 00, 02, 02, 00, 08, 06, 01, 16, 16, 16, 16, 13, 00, 13, 00, 13,
|
|
03, 00, 00, 00, 13, 13, 16, 00, 11, 16, 03, 13, 10, 12, 09, 01, 01, 05, 03, 16,
|
|
16, 10, 11, 02, 06, 06, 15, 15, 05, 01, 01, 01, 11, 02, 04, 16, 00, 16, 08, 14,
|
|
14, 07, 12, 14, 09, 07, 04, 13, 13, 08, 08, 00, 02, 13, 15, 12, 09, 11, 11, 05,
|
|
03, 03, 08, 08, 05, 00, 05, 11, 02, 00, 06, 12, 11, 10, 06, 06, 06, 05, 00, 15,
|
|
15, 13, 00, 09, 16, 11, 07, 07, 16, 05, 13, 13, 13, 13, 03, 08, 06, 13, 13, 05,
|
|
01, 09, 03, 06, 08, 13, 12, 10, 09, 03, 01, 03, 16, 00, 00, 00, 00, 00, 00, 03,
|
|
13, 01, 13, 10, 00, 13, 07, 02, 08, 01, 09, 16, 02, 00, 00, 01, 00, 09, 10, 09,
|
|
11, 12, 06, 04, 14, 15, 00, 12, 12, 04, 15, 13, 11, 01, 10, 09, 11, 06, 11, 16,
|
|
13, 00, 02, 00, 08, 09, 00, 00, 01, 14, 12, 09, 09, 14, 14, 16, 14, 09, 09, 12,
|
|
01, 01, 03, 04, 06, 06, 07, 07, 00, 12, 12, 11, 11, 14, 17, 16, 16, 17, 17, 17,
|
|
11, 17, 12, 17, 17, 17, 00, 17, 08, 00, 00, 05, 10, 13, 10, 09, 11, 17, 12, 03,
|
|
06, 17, 12, 00, 12, 17, 00, 00, 17, 12, 00, 06, 01, 02, 04, 04, 04, 17, 10, 04,
|
|
02, 16, 00, 00, 01, 01, 02, 02, 03, 03, 04, 04, 05, 05, 06, 06, 07, 07, 08, 08,
|
|
09, 09, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 12, 04,
|
|
06, 03, 07, 16, 10, 14, 17, 04, 11, 11, 11, 00, 03, 00, 08, 16, 06, 08, 13, 06,
|
|
09, 16, 09, 13, 08, 03, 00, 15, 11, 13, 02, 15, 15, 16, 14, 07, 16, 10, 17, 07,
|
|
12, 00, 00, 13, 09, 17, 13, 04, 07, 05, 10, 13, 07, 08, 07, 00, 12, 17, 00, 12,
|
|
09, 12, 13, 13, 08, 07, 17, 05, 15, 12, 10, 02, 12, 10, 12, 09, 13, 16, 11, 14,
|
|
17, 00, 08, 00, 15, 10, 16, 00, 01, 05, 13, 15, 00, 01, 12, 10, 00, 09, 06, 12,
|
|
00, 01, 07, 14, 03, 10, 02, 17, 15, 13, 05, 04, 16, 11, 08, 15, 01, 17, 11, 11,
|
|
09, 08, 08, 12, 15, 11, 12, 11, 11, 17, 17, 10, 16, 16, 01, 15, 08, 13, 08, 15,
|
|
05, 03, 17, 11, 12, 00, 06, 09, 16, 07, 03, 01, 10, 14, 02, 04, 11, 16, 10, 12,
|
|
15, 13, 16, 01, 14, 07, 13, 03, 13, 00, 05, 17, 13, 09, 10, 11, 14, 01, 04, 03,
|
|
13, 07, 08, 01, 07, 16, 02, 12, 04, 13, 13, 00, 06, 01, 07, 13, 15, 10, 11, 08,
|
|
00, 14, 15, 00, 05, 10, 03, 00, 00, 16, 11, 09, 10, 00, 08, 13, 10, 16, 01, 12,
|
|
00, 14, 00, 14, 06, 11, 10, 00, 13, 07, 09, 09, 12, 08, 16, 10, 09, 16, 03, 01,
|
|
17, 00, 11, 11, 11,
|
|
];
|
|
|
|
/// <summary>
|
|
/// Bitflag indexes of moves that are not usable in game.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This is a bitflag array, where each bit represents a move. If the bit is set, the move is not usable in game.
|
|
/// Instead of allocating a hashset, this is a more efficient method (no allocation) with O(1) lookup (faster than HashSet's O(1) lookup).
|
|
/// </remarks>
|
|
public static ReadOnlySpan<byte> DummiedMoves => // 251 moves (502 bytes) => 100 bytes
|
|
[
|
|
0x1C, 0x20, 0x00, 0x0C, 0x00, 0x02, 0x02, 0x00, 0x04, 0x00,
|
|
0x04, 0x00, 0x09, 0x00, 0xA1, 0x22, 0x5D, 0x50, 0x36, 0xC8,
|
|
0xC1, 0x0E, 0x03, 0x42, 0x02, 0x00, 0x00, 0x65, 0x10, 0x22,
|
|
0x00, 0x00, 0x04, 0x0A, 0xA4, 0x80, 0xA7, 0x71, 0x00, 0x51,
|
|
0x91, 0x00, 0x00, 0x04, 0x64, 0x08, 0xA0, 0x67, 0x04, 0x00,
|
|
0x00, 0x00, 0x00, 0xA4, 0x80, 0x28, 0x01, 0x41, 0x04, 0x28,
|
|
0x23, 0x00, 0x04, 0x08, 0x10, 0x00, 0x0C, 0x83, 0xF7, 0xC6,
|
|
0x8A, 0x02, 0x4D, 0x10, 0x80, 0x03, 0xF0, 0xC3, 0xFF, 0xFF,
|
|
0xFF, 0xFF, 0x07, 0x85, 0x26, 0xA0, 0x94, 0xFF, 0x91, 0xE7,
|
|
0xFF, 0xFF, 0xFF, 0x00, 0xEE, 0xFF, 0x7F, 0x0A, 0x00, 0x0D,
|
|
];
|
|
}
|