From a89b13027b72b7db20ad202e74c28b0fd1a8c778 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 18 Dec 2023 20:27:57 -0800 Subject: [PATCH] Update gen9 sketch disallow --- PKHeX.Core/Moves/MoveInfo.cs | 22 +++++++++++++++++-- .../Saves/Substructures/Gen5/Chatter5.cs | 11 ++++------ .../Saves/Substructures/Misc/IChatter.cs | 1 - 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/PKHeX.Core/Moves/MoveInfo.cs b/PKHeX.Core/Moves/MoveInfo.cs index 4a835966b..d5bca37a2 100644 --- a/PKHeX.Core/Moves/MoveInfo.cs +++ b/PKHeX.Core/Moves/MoveInfo.cs @@ -82,7 +82,7 @@ public static class MoveInfo /// /// Checks if the move is a Starmobile-only move. /// - public static bool IsMoveTorque(ushort move) => move - (uint)BlazingTorque <= 3; + public static bool IsMoveTorque(ushort move) => move - (uint)BlazingTorque <= 4; /// /// Checks if the is unable to be used in battle. @@ -165,6 +165,7 @@ public static class MoveInfo // Unreleased (int)LightofRuin => false, + (int)MalignantChain => false, _ => IsMoveKnowable(move), }; @@ -178,10 +179,27 @@ public static class MoveInfo { Gen6 when move is (int)ThousandArrows or (int)ThousandWaves => false, Gen8b when IsDummiedMove(MoveInfo8b.DummiedMoves, move) => false, - Gen9 when IsDummiedMove(MoveInfo9.DummiedMoves, move) => false, + Gen9 when IsDummiedMove(MoveInfo9.DummiedMoves, move) || DisallowSketch9.Contains(move) => false, _ => true, }; + /// + /// Moves that cannot be sketched in . + /// + private static ReadOnlySpan DisallowSketch9 => + [ + (ushort)DarkVoid, + (ushort)HyperspaceFury, + //(ushort)BreakneckBlitzP, // 3.0.0 has this move set, but this move is disallowed with our other checks + (ushort)RevivalBlessing, + (ushort)BlazingTorque, // Revavroom + (ushort)WickedTorque, // Revavroom + (ushort)NoxiousTorque, // Revavroom + (ushort)CombatTorque, // Revavroom + (ushort)MagicalTorque, // Revavroom + (ushort)TeraStarstorm, + ]; + private static int GetMaxMoveID(EntityContext context) => context switch { Gen1 => Legal.MaxMoveID_1, diff --git a/PKHeX.Core/Saves/Substructures/Gen5/Chatter5.cs b/PKHeX.Core/Saves/Substructures/Gen5/Chatter5.cs index 9356879f0..f37c98eef 100644 --- a/PKHeX.Core/Saves/Substructures/Gen5/Chatter5.cs +++ b/PKHeX.Core/Saves/Substructures/Gen5/Chatter5.cs @@ -18,12 +18,9 @@ public sealed class Chatter5 : SaveBlock, IChatter public Span Recording => Data.AsSpan(Offset + sizeof(uint), IChatter.SIZE_PCM); - public int ConfusionChance + public int ConfusionChance => !Initialized ? 0 : (Recording[99] ^ Recording[499] ^ Recording[699]) switch { - get => !Initialized ? 0 : (Recording[99] ^ Recording[499] ^ Recording[699]) switch - { - < 100 or >= 150 => 10, - _ => 0, - }; - } + < 100 or >= 150 => 10, + _ => 0, + }; } diff --git a/PKHeX.Core/Saves/Substructures/Misc/IChatter.cs b/PKHeX.Core/Saves/Substructures/Misc/IChatter.cs index b05b1c3e7..2534afa0c 100644 --- a/PKHeX.Core/Saves/Substructures/Misc/IChatter.cs +++ b/PKHeX.Core/Saves/Substructures/Misc/IChatter.cs @@ -1,5 +1,4 @@ using System; -using System.Reflection.Metadata; namespace PKHeX.Core;