diff --git a/PKHeX.Core/Legality/Encounters/EncounterTrade.cs b/PKHeX.Core/Legality/Encounters/EncounterTrade.cs index 5fce416df..091963e6c 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterTrade.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterTrade.cs @@ -246,7 +246,7 @@ public virtual bool IsMatch(PKM pkm, int lvl) if (CurrentLevel != -1 && CurrentLevel > pkm.CurrentLevel) return false; - if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, pkm.Species)) + if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species)) return false; if (OTGender != -1 && OTGender != pkm.OT_Gender) return false; diff --git a/PKHeX.Core/MysteryGifts/MysteryGift.cs b/PKHeX.Core/MysteryGifts/MysteryGift.cs index 578b734fd..4b90d1b16 100644 --- a/PKHeX.Core/MysteryGifts/MysteryGift.cs +++ b/PKHeX.Core/MysteryGifts/MysteryGift.cs @@ -132,12 +132,12 @@ public abstract class MysteryGift : IEncounterable, IMoveset, IGeneration, ILoca public PKM ConvertToPKM(ITrainerInfo SAV) => ConvertToPKM(SAV, EncounterCriteria.Unrestricted); public abstract PKM ConvertToPKM(ITrainerInfo SAV, EncounterCriteria criteria); - protected abstract bool IsMatchExact(PKM pkm, IEnumerable vs); + protected abstract bool IsMatchExact(PKM pkm); protected abstract bool IsMatchDeferred(PKM pkm); public EncounterMatchRating IsMatch(PKM pkm, IEnumerable vs) { - if (!IsMatchExact(pkm, vs)) + if (!IsMatchExact(pkm)) return EncounterMatchRating.None; if (IsMatchDeferred(pkm)) return EncounterMatchRating.Deferred; diff --git a/PKHeX.Core/MysteryGifts/PCD.cs b/PKHeX.Core/MysteryGifts/PCD.cs index 1893b135e..65eaa0dd8 100644 --- a/PKHeX.Core/MysteryGifts/PCD.cs +++ b/PKHeX.Core/MysteryGifts/PCD.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; namespace PKHeX.Core { @@ -130,7 +128,7 @@ public override PKM ConvertToPKM(ITrainerInfo SAV, EncounterCriteria criteria) public bool CanBeReceivedBy(int pkmVersion) => (CardCompatibility >> pkmVersion & 1) == 1; - protected override bool IsMatchExact(PKM pkm, IEnumerable vs) + protected override bool IsMatchExact(PKM pkm) { var wc = Gift.PK; if (!wc.IsEgg) @@ -162,7 +160,7 @@ protected override bool IsMatchExact(PKM pkm, IEnumerable vs) return false; } - if (wc.AltForm != pkm.AltForm && vs.All(dl => !Legal.IsFormChangeable(pkm, dl.Species))) + if (wc.AltForm != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species)) return false; if (wc.Ball != pkm.Ball) return false; diff --git a/PKHeX.Core/MysteryGifts/PGF.cs b/PKHeX.Core/MysteryGifts/PGF.cs index a9ba78bee..aecbfc8dd 100644 --- a/PKHeX.Core/MysteryGifts/PGF.cs +++ b/PKHeX.Core/MysteryGifts/PGF.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Text; namespace PKHeX.Core @@ -333,7 +331,7 @@ private void SetIVs(PKM pk) pk.IVs = finalIVs; } - protected override bool IsMatchExact(PKM pkm, IEnumerable vs) + protected override bool IsMatchExact(PKM pkm) { if (!IsEgg) { @@ -366,7 +364,8 @@ protected override bool IsMatchExact(PKM pkm, IEnumerable vs) return false; } - if (Form != pkm.AltForm && vs.All(dl => !Legal.IsFormChangeable(pkm, dl.Species))) return false; + if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species)) + return false; if (Level != pkm.Met_Level) return false; if (Ball != pkm.Ball) return false; diff --git a/PKHeX.Core/MysteryGifts/PGT.cs b/PKHeX.Core/MysteryGifts/PGT.cs index 224496e0c..d74cc52cc 100644 --- a/PKHeX.Core/MysteryGifts/PGT.cs +++ b/PKHeX.Core/MysteryGifts/PGT.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; namespace PKHeX.Core @@ -263,7 +262,7 @@ public static bool IsRangerManaphy(PKM pkm) return met == Locations.LinkTrade4 || met == 0; } - protected override bool IsMatchExact(PKM pkm, IEnumerable vs) => false; + protected override bool IsMatchExact(PKM pkm) => false; protected override bool IsMatchDeferred(PKM pkm) => false; } } diff --git a/PKHeX.Core/MysteryGifts/WB7.cs b/PKHeX.Core/MysteryGifts/WB7.cs index 4c7d95fc5..fec894bbf 100644 --- a/PKHeX.Core/MysteryGifts/WB7.cs +++ b/PKHeX.Core/MysteryGifts/WB7.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Text; @@ -474,7 +473,7 @@ private void SetIVs(PKM pk) pk.IVs = finalIVs; } - protected override bool IsMatchExact(PKM pkm, IEnumerable vs) + protected override bool IsMatchExact(PKM pkm) { if (pkm.Egg_Location == 0) // Not Egg { @@ -490,7 +489,7 @@ protected override bool IsMatchExact(PKM pkm, IEnumerable vs) if (EncryptionConstant != 0 && EncryptionConstant != pkm.EncryptionConstant) return false; } - if (Form != pkm.AltForm && vs.All(dl => !Legal.IsFormChangeable(pkm, dl.Species))) + if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species)) return false; if (IsEgg) diff --git a/PKHeX.Core/MysteryGifts/WC3.cs b/PKHeX.Core/MysteryGifts/WC3.cs index 3b9c49411..0dd9b8ae1 100644 --- a/PKHeX.Core/MysteryGifts/WC3.cs +++ b/PKHeX.Core/MysteryGifts/WC3.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; namespace PKHeX.Core { @@ -207,7 +206,7 @@ private static GameVersion GetRandomVersion(GameVersion version) } } - protected override bool IsMatchExact(PKM pkm, IEnumerable vs) + protected override bool IsMatchExact(PKM pkm) { // Gen3 Version MUST match. if (Version != 0 && !(Version).Contains((GameVersion)pkm.Version)) diff --git a/PKHeX.Core/MysteryGifts/WC6.cs b/PKHeX.Core/MysteryGifts/WC6.cs index f28e7b52b..c36b874aa 100644 --- a/PKHeX.Core/MysteryGifts/WC6.cs +++ b/PKHeX.Core/MysteryGifts/WC6.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Text; @@ -454,7 +453,7 @@ private void SetIVs(PKM pk) pk.IVs = finalIVs; } - protected override bool IsMatchExact(PKM pkm, IEnumerable vs) + protected override bool IsMatchExact(PKM pkm) { if (pkm.Egg_Location == 0) // Not Egg { @@ -475,7 +474,8 @@ protected override bool IsMatchExact(PKM pkm, IEnumerable vs) if (EncryptionConstant != 0 && EncryptionConstant != pkm.EncryptionConstant) return false; if (Language != 0 && Language != pkm.Language) return false; } - if (Form != pkm.AltForm && vs.All(dl => !Legal.IsFormChangeable(pkm, dl.Species))) return false; + if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species)) + return false; if (IsEgg) { diff --git a/PKHeX.Core/MysteryGifts/WC7.cs b/PKHeX.Core/MysteryGifts/WC7.cs index 5d9b11f9b..4e252320c 100644 --- a/PKHeX.Core/MysteryGifts/WC7.cs +++ b/PKHeX.Core/MysteryGifts/WC7.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Text; @@ -490,7 +489,7 @@ public bool IsAshGreninjaWC7(PKM pkm) return CardID == 2046 && (pkm.SID << 16 | pkm.TID) == 0x79F57B49; } - protected override bool IsMatchExact(PKM pkm, IEnumerable vs) + protected override bool IsMatchExact(PKM pkm) { if (pkm.Egg_Location == 0) // Not Egg { @@ -506,7 +505,7 @@ protected override bool IsMatchExact(PKM pkm, IEnumerable vs) if (Language != 0 && Language != pkm.Language) return false; } - if (Form != pkm.AltForm && vs.All(dl => !Legal.IsFormChangeable(pkm, dl.Species))) + if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species)) { if (Species == (int)Core.Species.Rockruff && Form == 1 && pkm.Species == 745 && pkm.AltForm == 2) { diff --git a/PKHeX.Core/MysteryGifts/WC8.cs b/PKHeX.Core/MysteryGifts/WC8.cs index 75626a08d..6a8c42026 100644 --- a/PKHeX.Core/MysteryGifts/WC8.cs +++ b/PKHeX.Core/MysteryGifts/WC8.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Text; using static PKHeX.Core.RibbonIndex; @@ -487,7 +486,7 @@ private void SetIVs(PKM pk) pk.IVs = finalIVs; } - protected override bool IsMatchExact(PKM pkm, IEnumerable vs) + protected override bool IsMatchExact(PKM pkm) { if (pkm.Egg_Location == 0) // Not Egg { @@ -503,7 +502,7 @@ protected override bool IsMatchExact(PKM pkm, IEnumerable vs) if (EncryptionConstant != 0 && EncryptionConstant != pkm.EncryptionConstant) return false; } - if (Form != pkm.AltForm && vs.All(z => !Legal.IsFormChangeable(pkm, z.Species))) + if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species)) return false; if (IsEgg) diff --git a/PKHeX.Core/MysteryGifts/WR7.cs b/PKHeX.Core/MysteryGifts/WR7.cs index ec7f9e567..08ef1b034 100644 --- a/PKHeX.Core/MysteryGifts/WR7.cs +++ b/PKHeX.Core/MysteryGifts/WR7.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Text; namespace PKHeX.Core @@ -98,7 +97,7 @@ public LanguageID LanguageReceived // Mystery Gift implementation public override int Format => 7; - protected override bool IsMatchExact(PKM pkm, IEnumerable vs) => false; + protected override bool IsMatchExact(PKM pkm) => false; protected override bool IsMatchDeferred(PKM pkm) => false; public override int Location { get; set; } public override int EggLocation { get; set; }