diff --git a/PKHeX/PKM/PK1.cs b/PKHeX/PKM/PK1.cs index 1509207f9..2be56e445 100644 --- a/PKHeX/PKM/PK1.cs +++ b/PKHeX/PKM/PK1.cs @@ -128,12 +128,14 @@ public override int Species get { return PKX.getG1Species(Data[0]); } set { - // Before updating catch rate, check if non-standard - if (Catch_Rate == PersonalTable.RBY[Species].CatchRate) - Catch_Rate = PersonalTable.RBY[value].CatchRate; + int currentRate = PersonalInfo.CatchRate; Data[0] = (byte)PKX.setG1Species(value); - Type_A = PersonalTable.RBY[value].Types[0]; - Type_B = PersonalTable.RBY[value].Types[1]; + + // Before updating catch rate, check if non-standard + if (Catch_Rate == currentRate) + Catch_Rate = PersonalInfo.CatchRate; + Type_A = PersonalInfo.Types[0]; + Type_B = PersonalInfo.Types[1]; } } @@ -288,7 +290,7 @@ public PK2 convertToPK2() pk2.HeldItem = 0xAD; // Berry break; } - pk2.CurrentFriendship = PersonalTable.C[Species].BaseFriendship; + pk2.CurrentFriendship = pk2.PersonalInfo.BaseFriendship; // Pokerus = 0 // Caught Data = 0 pk2.Stat_Level = PKX.getLevel(Species, EXP); diff --git a/PKHeX/PKM/PK2.cs b/PKHeX/PKM/PK2.cs index 28ce5c418..05ad47e0b 100644 --- a/PKHeX/PKM/PK2.cs +++ b/PKHeX/PKM/PK2.cs @@ -219,7 +219,7 @@ public override ushort[] getStats(PersonalInfo p) public override bool getGenderIsValid() { - int gv = PersonalTable.C[Species].Gender; + int gv = PersonalInfo.Gender; if (gv == 255) return Gender == 2; @@ -247,7 +247,7 @@ public override int Gender { get { - int gv = PersonalTable.C[Species].Gender; + int gv = PersonalInfo.Gender; if (gv == 255) return 2; if (gv == 254) diff --git a/PKHeX/PKM/PK3.cs b/PKHeX/PKM/PK3.cs index eb81b087c..9421a0ee3 100644 --- a/PKHeX/PKM/PK3.cs +++ b/PKHeX/PKM/PK3.cs @@ -33,7 +33,7 @@ public PK3(byte[] decryptedData = null, string ident = null) public override int Gender { get { return PKX.getGender(Species, PID); } set { } } public override int Characteristic => -1; public override int CurrentFriendship { get { return OT_Friendship; } set { OT_Friendship = value; } } - public override int Ability { get { int[] abils = PersonalTable.RS.getAbilities(Species, 0); return abils[abils[1] == 0 ? 0 : AbilityNumber]; } set { } } + public override int Ability { get { int[] abils = PersonalInfo.Abilities; return abils[abils[1] == 0 ? 0 : AbilityNumber]; } set { } } public override int CurrentHandler { get { return 0; } set { } } public override int Egg_Location { get { return 0; } set { } } @@ -167,7 +167,7 @@ public override byte[] Encrypt() } public override bool getGenderIsValid() { - int gv = PersonalTable.RS[Species].Gender; + int gv = PersonalInfo.Gender; if (gv == 255) return Gender == 2; diff --git a/PKHeX/PKM/PK4.cs b/PKHeX/PKM/PK4.cs index cc2ff7f98..96845277b 100644 --- a/PKHeX/PKM/PK4.cs +++ b/PKHeX/PKM/PK4.cs @@ -386,7 +386,7 @@ public override int Characteristic // Methods public override bool getGenderIsValid() { - int gv = PersonalTable.HGSS[Species].Gender; + int gv = PersonalInfo.Gender; if (gv == 255) return Gender == 2; diff --git a/PKHeX/PKM/PK5.cs b/PKHeX/PKM/PK5.cs index 349a777d8..73c7c3986 100644 --- a/PKHeX/PKM/PK5.cs +++ b/PKHeX/PKM/PK5.cs @@ -302,7 +302,7 @@ public override int Characteristic // Methods public override bool getGenderIsValid() { - int gv = PersonalTable.B2W2[Species].Gender; + int gv = PersonalInfo.Gender; if (gv == 255) return Gender == 2; @@ -336,7 +336,7 @@ public PK6 convertToPK6() Ability = Ability }; - int[] abilities = PersonalTable.AO.getAbilities(Species, AltForm); + int[] abilities = PersonalInfo.Abilities; int abilval = Array.IndexOf(abilities, Ability); if (abilval >= 0) pk6.AbilityNumber = 1 << abilval; @@ -520,7 +520,7 @@ public PK6 convertToPK6() pk6.HT_Memory = 4; pk6.HT_Feeling = (int)(Util.rnd32() % 10); // When transferred, friendship gets reset. - pk6.OT_Friendship = pk6.HT_Friendship = PersonalTable.B2W2[Species].BaseFriendship; + pk6.OT_Friendship = pk6.HT_Friendship = PersonalInfo.BaseFriendship; // Antishiny Mechanism ushort LID = (ushort)(PID & 0xFFFF); diff --git a/PKHeX/PKM/PK6.cs b/PKHeX/PKM/PK6.cs index f3b65672e..b26639f4d 100644 --- a/PKHeX/PKM/PK6.cs +++ b/PKHeX/PKM/PK6.cs @@ -14,7 +14,7 @@ public class PK6 : PKM public sealed override int SIZE_PARTY => PKX.SIZE_6PARTY; public override int SIZE_STORED => PKX.SIZE_6STORED; public override int Format => 6; - public override PersonalInfo PersonalInfo => (AO ? PersonalTable.AO : PersonalTable.XY).getFormeEntry(Species, AltForm); + public override PersonalInfo PersonalInfo => PersonalTable.AO.getFormeEntry(Species, AltForm); public PK6(byte[] decryptedData = null, string ident = null) { @@ -440,14 +440,14 @@ public override byte[] Encrypt() } public override bool getGenderIsValid() { - int gv = PersonalTable.AO[Species].Gender; + int gv = PersonalInfo.Gender; if (gv == 255) return Gender == 2; if (gv == 254) - return Gender == 0; - if (gv == 0) return Gender == 1; + if (gv == 0) + return Gender == 0; return true; } @@ -622,7 +622,7 @@ public void TradeFriendshipAffection(string SAV_TRAINER) return; // Reset - HT_Friendship = PersonalTable.AO[Species].BaseFriendship; + HT_Friendship = PersonalInfo.BaseFriendship; HT_Affection = 0; } diff --git a/PKHeX/PKM/PK7.cs b/PKHeX/PKM/PK7.cs index ae1d32ed5..4b11deb0c 100644 --- a/PKHeX/PKM/PK7.cs +++ b/PKHeX/PKM/PK7.cs @@ -448,14 +448,14 @@ public override byte[] Encrypt() } public override bool getGenderIsValid() { - int gv = PersonalTable.AO[Species].Gender; + int gv = PersonalInfo.Gender; if (gv == 255) return Gender == 2; if (gv == 254) - return Gender == 0; - if (gv == 0) return Gender == 1; + if (gv == 0) + return Gender == 0; return true; } @@ -630,7 +630,7 @@ public void TradeFriendshipAffection(string SAV_TRAINER) return; // Reset - HT_Friendship = PersonalTable.AO[Species].BaseFriendship; + HT_Friendship = PersonalInfo.BaseFriendship; HT_Affection = 0; }