using static PKHeX.Core.Species; namespace PKHeX.Core { public interface IEncounterMatch { bool IsMatchExact(PKM pkm, DexLevel dl); EncounterMatchRating GetMatchRating(PKM pkm); } internal static class EncounterMatchExtensions { /// /// Some species do not have a Hidden Ability, but can be altered to have the HA slot via pre-evolution. /// /// Match object /// Species ID /// True if it should not originate as this species. private static bool IsPartialMatchHidden(this IEncounterMatch _, int species) { return species is (int)Metapod or (int)Kakuna or (int)Pupitar or (int)Silcoon or (int)Cascoon or (int)Vibrava or (int)Flygon; } /// /// Some species do not have a Hidden Ability, but can be altered to have the HA slot via pre-evolution. /// /// Match object /// Current Species ID /// Original Species ID /// True if it should not originate as this species. public static bool IsPartialMatchHidden(this IEncounterMatch _, int current, int original) { if (current == original) return false; if (!_.IsPartialMatchHidden(original)) return false; return _.IsPartialMatchHidden(current); } } }