From 6852c6965bdbc534b230135789c30e02e1952e7a Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Sun, 17 Jul 2016 22:36:17 -0700 Subject: [PATCH] Add & Split out PersonalTable Larger object that will eventually handle more complex logic like form-stat finding and stat calculations. --- Legality/Checks.cs | 6 +- Legality/Core.cs | 20 ++-- PKM/PKX.cs | 2 +- PersonalInfo/PersonalInfo.cs | 67 +++++++------- PersonalInfo/PersonalInfoB2W2.cs | 3 +- PersonalInfo/PersonalInfoBW.cs | 3 +- PersonalInfo/PersonalInfoG3.cs | 3 +- PersonalInfo/PersonalInfoG4.cs | 3 +- PersonalInfo/PersonalInfoORAS.cs | 3 +- PersonalInfo/PersonalInfoXY.cs | 3 +- PersonalInfo/PersonalTable.cs | 97 ++++++++++++++++++++ Saves/SAV3.cs | 6 +- Saves/SAV4.cs | 6 +- Saves/SAV5.cs | 4 +- Saves/SAV6.cs | 2 +- Saves/SaveFile.cs | 2 +- Subforms/Save Editors/Gen6/SAV_HallOfFame.cs | 2 +- Subforms/Save Editors/Gen6/SAV_SecretBase.cs | 4 +- 18 files changed, 172 insertions(+), 64 deletions(-) create mode 100644 PersonalInfo/PersonalTable.cs diff --git a/Legality/Checks.cs b/Legality/Checks.cs index 4d55eda33..a750cd0fe 100644 --- a/Legality/Checks.cs +++ b/Legality/Checks.cs @@ -30,7 +30,7 @@ namespace PKHeX { private LegalityCheck verifyGender() { - if (PersonalInfo.AO[pk6.Species].Gender == 255 && pk6.Gender != 2) + if (PersonalTable.AO[pk6.Species].Gender == 255 && pk6.Gender != 2) return new LegalityCheck(Severity.Invalid, "Genderless Pokémon should not have a gender."); return new LegalityCheck(); @@ -431,8 +431,8 @@ namespace PKHeX } private LegalityCheck verifyAbility() { - int index = PersonalInfo.AO[pk6.Species].FormeIndex(pk6.Species, pk6.AltForm); - int[] abilities = PersonalInfo.AO[index].Abilities; + int index = PersonalTable.AO[pk6.Species].FormeIndex(pk6.Species, pk6.AltForm); + int[] abilities = PersonalTable.AO[index].Abilities; int abilval = Array.IndexOf(abilities, pk6.Ability); if (abilval < 0) return new LegalityCheck(Severity.Invalid, "Ability is not valid for species/form."); diff --git a/Legality/Core.cs b/Legality/Core.cs index 5075ce9d3..9bc6ed5bc 100644 --- a/Legality/Core.cs +++ b/Legality/Core.cs @@ -405,8 +405,8 @@ namespace PKHeX } private static IEnumerable getLVLMoves(int species, int lvl, int formnum) { - int ind_XY = PersonalInfo.XY[species].FormeIndex(species, formnum); - int ind_AO = PersonalInfo.AO[species].FormeIndex(species, formnum); + int ind_XY = PersonalTable.XY[species].FormeIndex(species, formnum); + int ind_AO = PersonalTable.AO[species].FormeIndex(species, formnum); return LevelUpXY[ind_XY].getMoves(lvl).Concat(LevelUpAO[ind_AO].getMoves(lvl)); } private static IEnumerable getEncounterSlots(PK6 pk6) @@ -543,7 +543,7 @@ namespace PKHeX bool ORASTutors = Version == -1 || pk6.AO || !pk6.IsUntraded; if (FormChangeMoves.Contains(species)) // Deoxys & Shaymin & Giratina (others don't have extra but whatever) { - int formcount = PersonalInfo.AO[species].FormeCount; + int formcount = PersonalTable.AO[species].FormeCount; for (int i = 0; i < formcount; i++) r.AddRange(getMoves(species, lvl, i, ORASTutors, Version, LVL, Tutor, Machine)); if (Relearn) r.AddRange(pk6.RelearnMoves); @@ -568,8 +568,8 @@ namespace PKHeX List r = new List { 0 }; if (Version < 0 || Version == 0) { - int index = PersonalInfo.XY[species].FormeIndex(species, form); - PersonalInfo pi = PersonalInfo.XY[index]; + int index = PersonalTable.XY[species].FormeIndex(species, form); + PersonalInfo pi = PersonalTable.XY[index]; if (LVL) r.AddRange(LevelUpXY[index].getMoves(lvl)); if (Tutor) r.AddRange(getTutorMoves(species, form, ORASTutors)); @@ -577,8 +577,8 @@ namespace PKHeX } if (Version < 0 || Version == 1) { - int index = PersonalInfo.AO[species].FormeIndex(species, form); - PersonalInfo pi = PersonalInfo.AO[index]; + int index = PersonalTable.AO[species].FormeIndex(species, form); + PersonalInfo pi = PersonalTable.AO[index]; if (LVL) r.AddRange(LevelUpAO[index].getMoves(lvl)); if (Tutor) r.AddRange(getTutorMoves(species, form, ORASTutors)); @@ -588,13 +588,13 @@ namespace PKHeX } private static IEnumerable getEggMoves(int species, int formnum) { - int ind_XY = PersonalInfo.XY[species].FormeIndex(species, formnum); - int ind_AO = PersonalInfo.AO[species].FormeIndex(species, formnum); + int ind_XY = PersonalTable.XY[species].FormeIndex(species, formnum); + int ind_AO = PersonalTable.AO[species].FormeIndex(species, formnum); return EggMoveAO[ind_AO].Moves.Concat(EggMoveXY[ind_XY].Moves); } private static IEnumerable getTutorMoves(int species, int formnum, bool ORASTutors) { - PersonalInfoORAS pkAO = (PersonalInfoORAS) PersonalInfo.AO[PersonalInfo.AO[species].FormeIndex(species, formnum)]; + PersonalInfoORAS pkAO = (PersonalInfoORAS)PersonalTable.AO[PersonalTable.AO[species].FormeIndex(species, formnum)]; // Type Tutor List moves = TypeTutor.Where((t, i) => pkAO.TypeTutors[i]).ToList(); diff --git a/PKM/PKX.cs b/PKM/PKX.cs index c59fd541f..6b37139a8 100644 --- a/PKM/PKX.cs +++ b/PKM/PKX.cs @@ -181,7 +181,7 @@ namespace PKHeX try { return SpeciesLang.All(list => list[species].ToUpper() != nick); } catch { return false; } } - internal static PersonalInfo[] Personal = PersonalInfo.AO; + internal static PersonalTable Personal = PersonalTable.AO; // Stat Fetching internal static int getMovePP(int move, int ppup) diff --git a/PersonalInfo/PersonalInfo.cs b/PersonalInfo/PersonalInfo.cs index 290125dfd..de085b87b 100644 --- a/PersonalInfo/PersonalInfo.cs +++ b/PersonalInfo/PersonalInfo.cs @@ -4,25 +4,6 @@ namespace PKHeX { public abstract class PersonalInfo { - internal static readonly PersonalInfo[] AO = getArray(Properties.Resources.personal_ao, GameVersion.ORAS); - internal static readonly PersonalInfo[] XY = getArray(Properties.Resources.personal_xy, GameVersion.XY); - internal static readonly PersonalInfo[] B2W2 = getArray(Properties.Resources.personal_b2w2, GameVersion.B2W2); - internal static readonly PersonalInfo[] BW = getArray(Properties.Resources.personal_bw, GameVersion.BW); - internal static readonly PersonalInfo[] HGSS = getArray(Properties.Resources.personal_hgss, GameVersion.HGSS); - internal static readonly PersonalInfo[] Pt = getArray(Properties.Resources.personal_pt, GameVersion.Pt); - internal static readonly PersonalInfo[] DP = getArray(Properties.Resources.personal_dp, GameVersion.DP); - internal static readonly PersonalInfo[] LG = getArray(Properties.Resources.personal_lg, GameVersion.LG); - internal static readonly PersonalInfo[] FR = getArray(Properties.Resources.personal_fr, GameVersion.FR); - internal static readonly PersonalInfo[] E = getArray(Properties.Resources.personal_e, GameVersion.E); - internal static readonly PersonalInfo[] RS = getArray(Properties.Resources.personal_rs, GameVersion.RS); - - protected const int SIZE_G3 = 0x1C; - protected const int SIZE_G4 = 0x2C; - protected const int SIZE_BW = 0x3C; - protected const int SIZE_B2W2 = 0x4C; - protected const int SIZE_XY = 0x40; - protected const int SIZE_AO = 0x50; - protected byte[] Data; public abstract byte[] Write(); public abstract int HP { get; set; } @@ -110,7 +91,25 @@ namespace PKHeX public int BST => HP + ATK + DEF + SPE + SPA + SPD; // Array Retrieval - internal static PersonalInfo[] getArray(byte[] data, GameVersion format) + } + + public class PersonalTable + { + internal static readonly PersonalTable AO = new PersonalTable(Properties.Resources.personal_ao, GameVersion.ORAS); + internal static readonly PersonalTable XY = new PersonalTable(Properties.Resources.personal_xy, GameVersion.XY); + internal static readonly PersonalTable B2W2 = new PersonalTable(Properties.Resources.personal_b2w2, GameVersion.B2W2); + internal static readonly PersonalTable BW = new PersonalTable(Properties.Resources.personal_bw, GameVersion.BW); + internal static readonly PersonalTable HGSS = new PersonalTable(Properties.Resources.personal_hgss, GameVersion.HGSS); + internal static readonly PersonalTable Pt = new PersonalTable(Properties.Resources.personal_pt, GameVersion.Pt); + internal static readonly PersonalTable DP = new PersonalTable(Properties.Resources.personal_dp, GameVersion.DP); + internal static readonly PersonalTable LG = new PersonalTable(Properties.Resources.personal_lg, GameVersion.LG); + internal static readonly PersonalTable FR = new PersonalTable(Properties.Resources.personal_fr, GameVersion.FR); + internal static readonly PersonalTable E = new PersonalTable(Properties.Resources.personal_e, GameVersion.E); + internal static readonly PersonalTable RS = new PersonalTable(Properties.Resources.personal_rs, GameVersion.RS); + + private readonly PersonalInfo[] Table; + + private PersonalTable(byte[] data, GameVersion format) { int size = 0; switch (format) @@ -118,18 +117,18 @@ namespace PKHeX case GameVersion.RS: case GameVersion.E: case GameVersion.FR: - case GameVersion.LG: size = SIZE_G3; break; + case GameVersion.LG: size = PersonalInfoG3.SIZE; break; case GameVersion.DP: case GameVersion.Pt: - case GameVersion.HGSS: size = SIZE_G4; break; - case GameVersion.BW: size = SIZE_BW; break; - case GameVersion.B2W2: size = SIZE_B2W2; break; - case GameVersion.XY: size = SIZE_XY; break; - case GameVersion.ORAS: size = SIZE_AO; break; + case GameVersion.HGSS: size = PersonalInfoG4.SIZE; break; + case GameVersion.BW: size = PersonalInfoBW.SIZE; break; + case GameVersion.B2W2: size = PersonalInfoB2W2.SIZE; break; + case GameVersion.XY: size = PersonalInfoXY.SIZE; break; + case GameVersion.ORAS: size = PersonalInfoORAS.SIZE; break; } if (size == 0) - return null; + { Table = null; return; } byte[][] entries = splitBytes(data, size); PersonalInfo[] d = new PersonalInfo[data.Length / size]; @@ -167,15 +166,21 @@ namespace PKHeX d[i] = new PersonalInfoORAS(entries[i]); break; } - return d; + Table = d; } + public PersonalInfo this[int index] + { + get { return Table[index]; } + set { Table[index] = value; } + } + private static byte[][] splitBytes(byte[] data, int size) { - byte[][] r = new byte[data.Length/size][]; + byte[][] r = new byte[data.Length / size][]; for (int i = 0; i < data.Length; i += size) { - r[i/size] = new byte[size]; - Array.Copy(data, i, r[i/size], 0, size); + r[i / size] = new byte[size]; + Array.Copy(data, i, r[i / size], 0, size); } return r; } diff --git a/PersonalInfo/PersonalInfoB2W2.cs b/PersonalInfo/PersonalInfoB2W2.cs index a080f2920..c3659ac0c 100644 --- a/PersonalInfo/PersonalInfoB2W2.cs +++ b/PersonalInfo/PersonalInfoB2W2.cs @@ -4,9 +4,10 @@ namespace PKHeX { public class PersonalInfoB2W2 : PersonalInfoBW { + public new const int SIZE = 0x4C; public PersonalInfoB2W2(byte[] data) { - if (data.Length != SIZE_B2W2) + if (data.Length != SIZE) return; Data = data; diff --git a/PersonalInfo/PersonalInfoBW.cs b/PersonalInfo/PersonalInfoBW.cs index a14469263..7f26bb365 100644 --- a/PersonalInfo/PersonalInfoBW.cs +++ b/PersonalInfo/PersonalInfoBW.cs @@ -6,9 +6,10 @@ namespace PKHeX public class PersonalInfoBW : PersonalInfo { protected PersonalInfoBW() { } + public const int SIZE = 0x3C; public PersonalInfoBW(byte[] data) { - if (data.Length != SIZE_BW) + if (data.Length != SIZE) return; Data = data; diff --git a/PersonalInfo/PersonalInfoG3.cs b/PersonalInfo/PersonalInfoG3.cs index fdcdd4980..04f8248b4 100644 --- a/PersonalInfo/PersonalInfoG3.cs +++ b/PersonalInfo/PersonalInfoG3.cs @@ -5,9 +5,10 @@ namespace PKHeX public class PersonalInfoG3 : PersonalInfo { protected PersonalInfoG3() { } + public const int SIZE = 0x1C; public PersonalInfoG3(byte[] data) { - if (data.Length != SIZE_G3) + if (data.Length != SIZE) return; Data = data; diff --git a/PersonalInfo/PersonalInfoG4.cs b/PersonalInfo/PersonalInfoG4.cs index 585690bec..14dff8259 100644 --- a/PersonalInfo/PersonalInfoG4.cs +++ b/PersonalInfo/PersonalInfoG4.cs @@ -4,9 +4,10 @@ namespace PKHeX { public class PersonalInfoG4 : PersonalInfoG3 { + public new const int SIZE = 0x2C; public PersonalInfoG4(byte[] data) { - if (data.Length != SIZE_G4) + if (data.Length != SIZE) return; Data = data; diff --git a/PersonalInfo/PersonalInfoORAS.cs b/PersonalInfo/PersonalInfoORAS.cs index b71d8b218..8d398f681 100644 --- a/PersonalInfo/PersonalInfoORAS.cs +++ b/PersonalInfo/PersonalInfoORAS.cs @@ -4,9 +4,10 @@ namespace PKHeX { public class PersonalInfoORAS : PersonalInfoXY { + public new const int SIZE = 0x50; public PersonalInfoORAS(byte[] data) { - if (data.Length != SIZE_AO) + if (data.Length != SIZE) return; Data = data; diff --git a/PersonalInfo/PersonalInfoXY.cs b/PersonalInfo/PersonalInfoXY.cs index b662245d0..5ddc07fc1 100644 --- a/PersonalInfo/PersonalInfoXY.cs +++ b/PersonalInfo/PersonalInfoXY.cs @@ -5,9 +5,10 @@ namespace PKHeX public class PersonalInfoXY : PersonalInfoBW { protected PersonalInfoXY() { } // For ORAS + public new const int SIZE = 0x40; public PersonalInfoXY(byte[] data) { - if (data.Length != SIZE_XY) + if (data.Length != SIZE) return; Data = data; diff --git a/PersonalInfo/PersonalTable.cs b/PersonalInfo/PersonalTable.cs new file mode 100644 index 000000000..3f7cd7fc1 --- /dev/null +++ b/PersonalInfo/PersonalTable.cs @@ -0,0 +1,97 @@ +using System; + +namespace PKHeX +{ + public class PersonalTable + { + internal static readonly PersonalTable AO = new PersonalTable(Properties.Resources.personal_ao, GameVersion.ORAS); + internal static readonly PersonalTable XY = new PersonalTable(Properties.Resources.personal_xy, GameVersion.XY); + internal static readonly PersonalTable B2W2 = new PersonalTable(Properties.Resources.personal_b2w2, GameVersion.B2W2); + internal static readonly PersonalTable BW = new PersonalTable(Properties.Resources.personal_bw, GameVersion.BW); + internal static readonly PersonalTable HGSS = new PersonalTable(Properties.Resources.personal_hgss, GameVersion.HGSS); + internal static readonly PersonalTable Pt = new PersonalTable(Properties.Resources.personal_pt, GameVersion.Pt); + internal static readonly PersonalTable DP = new PersonalTable(Properties.Resources.personal_dp, GameVersion.DP); + internal static readonly PersonalTable LG = new PersonalTable(Properties.Resources.personal_lg, GameVersion.LG); + internal static readonly PersonalTable FR = new PersonalTable(Properties.Resources.personal_fr, GameVersion.FR); + internal static readonly PersonalTable E = new PersonalTable(Properties.Resources.personal_e, GameVersion.E); + internal static readonly PersonalTable RS = new PersonalTable(Properties.Resources.personal_rs, GameVersion.RS); + + private static byte[][] splitBytes(byte[] data, int size) + { + byte[][] r = new byte[data.Length / size][]; + for (int i = 0; i < data.Length; i += size) + { + r[i / size] = new byte[size]; + Array.Copy(data, i, r[i / size], 0, size); + } + return r; + } + + private PersonalTable(byte[] data, GameVersion format) + { + int size = 0; + switch (format) + { + case GameVersion.RS: + case GameVersion.E: + case GameVersion.FR: + case GameVersion.LG: size = PersonalInfoG3.SIZE; break; + case GameVersion.DP: + case GameVersion.Pt: + case GameVersion.HGSS: size = PersonalInfoG4.SIZE; break; + case GameVersion.BW: size = PersonalInfoBW.SIZE; break; + case GameVersion.B2W2: size = PersonalInfoB2W2.SIZE; break; + case GameVersion.XY: size = PersonalInfoXY.SIZE; break; + case GameVersion.ORAS: size = PersonalInfoORAS.SIZE; break; + } + + if (size == 0) + { Table = null; return; } + + byte[][] entries = splitBytes(data, size); + PersonalInfo[] d = new PersonalInfo[data.Length / size]; + + switch (format) + { + case GameVersion.RS: + case GameVersion.E: + case GameVersion.FR: + case GameVersion.LG: + Array.Resize(ref d, 387); + for (int i = 0; i < d.Length; i++) // entries are not in order of natdexID + d[i] = new PersonalInfoG3(entries[PKX.getG3Species(i)]); + break; + case GameVersion.DP: + case GameVersion.Pt: + case GameVersion.HGSS: + for (int i = 0; i < d.Length; i++) + d[i] = new PersonalInfoG4(entries[i]); + break; + case GameVersion.BW: + for (int i = 0; i < d.Length; i++) + d[i] = new PersonalInfoBW(entries[i]); + break; + case GameVersion.B2W2: + for (int i = 0; i < d.Length; i++) + d[i] = new PersonalInfoB2W2(entries[i]); + break; + case GameVersion.XY: + for (int i = 0; i < d.Length; i++) + d[i] = new PersonalInfoXY(entries[i]); + break; + case GameVersion.ORAS: + for (int i = 0; i < d.Length; i++) + d[i] = new PersonalInfoORAS(entries[i]); + break; + } + Table = d; + } + + private readonly PersonalInfo[] Table; + public PersonalInfo this[int index] + { + get { return Table[index]; } + set { Table[index] = value; } + } + } +} diff --git a/Saves/SAV3.cs b/Saves/SAV3.cs index fb49f35c4..c389e959c 100644 --- a/Saves/SAV3.cs +++ b/Saves/SAV3.cs @@ -77,7 +77,7 @@ namespace PKHeX OFS_PouchBalls = BlockOfs[1] + 0x0600; OFS_PouchTMHM = BlockOfs[1] + 0x0640; OFS_PouchBerry = BlockOfs[1] + 0x0740; - Personal = PersonalInfo.RS; + Personal = PersonalTable.RS; break; case GameVersion.FRLG: LegalKeyItems = Legal.Pouch_Key_FRLG; @@ -86,7 +86,7 @@ namespace PKHeX OFS_PouchBalls = BlockOfs[1] + 0x0430; OFS_PouchTMHM = BlockOfs[1] + 0x0464; OFS_PouchBerry = BlockOfs[1] + 0x054C; - Personal = PersonalInfo.FR; // todo split FR & LG + Personal = PersonalTable.FR; // todo split FR & LG break; case GameVersion.E: LegalKeyItems = Legal.Pouch_Key_E; @@ -95,7 +95,7 @@ namespace PKHeX OFS_PouchBalls = BlockOfs[1] + 0x0650; OFS_PouchTMHM = BlockOfs[1] + 0x0690; OFS_PouchBerry = BlockOfs[1] + 0x0790; - Personal = PersonalInfo.E; + Personal = PersonalTable.E; break; } LegalItems = Legal.Pouch_Items_RS; diff --git a/Saves/SAV4.cs b/Saves/SAV4.cs index d9d2b07e0..47ea8a285 100644 --- a/Saves/SAV4.cs +++ b/Saves/SAV4.cs @@ -28,9 +28,9 @@ namespace PKHeX switch (Version) { - case GameVersion.DP: Personal = PersonalInfo.DP; break; - case GameVersion.Pt: Personal = PersonalInfo.Pt; break; - case GameVersion.HGSS: Personal = PersonalInfo.HGSS; break; + case GameVersion.DP: Personal = PersonalTable.DP; break; + case GameVersion.Pt: Personal = PersonalTable.Pt; break; + case GameVersion.HGSS: Personal = PersonalTable.HGSS; break; } if (!Exportable) diff --git a/Saves/SAV5.cs b/Saves/SAV5.cs index d383b6f1f..d4dc3b12b 100644 --- a/Saves/SAV5.cs +++ b/Saves/SAV5.cs @@ -55,7 +55,7 @@ namespace PKHeX LegalMedicine = Legal.Pouch_Medicine_BW; LegalBerries = Legal.Pouch_Berries_BW; - Personal = PersonalInfo.BW; + Personal = PersonalTable.BW; break; case GameVersion.B2W2: // B2W2 BattleBox = 0x20900; @@ -78,7 +78,7 @@ namespace PKHeX LegalMedicine = Legal.Pouch_Medicine_BW; LegalBerries = Legal.Pouch_Berries_BW; - Personal = PersonalInfo.B2W2; + Personal = PersonalTable.B2W2; break; } HeldItems = Legal.HeldItems_BW; diff --git a/Saves/SAV6.cs b/Saves/SAV6.cs index da76600a5..ac9233386 100644 --- a/Saves/SAV6.cs +++ b/Saves/SAV6.cs @@ -21,7 +21,7 @@ namespace PKHeX getSAVOffsets(); HeldItems = ORAS ? Legal.HeldItem_AO : Legal.HeldItem_XY; - Personal = ORAS ? PersonalInfo.AO : PersonalInfo.XY; + Personal = ORAS ? PersonalTable.AO : PersonalTable.XY; if (!Exportable) resetBoxes(); } diff --git a/Saves/SaveFile.cs b/Saves/SaveFile.cs index e7c837e23..2137b0091 100644 --- a/Saves/SaveFile.cs +++ b/Saves/SaveFile.cs @@ -45,7 +45,7 @@ namespace PKHeX public abstract bool ChecksumsValid { get; } public abstract string ChecksumInfo { get; } public abstract int Generation { get; } - public PersonalInfo[] Personal { get; protected set; } + public PersonalTable Personal { get; protected set; } public bool ORASDEMO => Data.Length == SaveUtil.SIZE_G6ORASDEMO; public bool ORAS => Version == GameVersion.OR || Version == GameVersion.AS; diff --git a/Subforms/Save Editors/Gen6/SAV_HallOfFame.cs b/Subforms/Save Editors/Gen6/SAV_HallOfFame.cs index 9176c646f..8ab55fbd7 100644 --- a/Subforms/Save Editors/Gen6/SAV_HallOfFame.cs +++ b/Subforms/Save Editors/Gen6/SAV_HallOfFame.cs @@ -363,7 +363,7 @@ namespace PKHeX private void setForms() { int species = Util.getIndex(CB_Species); - bool hasForms = PersonalInfo.AO[species].HasFormes || new[] { 664, 665, 414 }.Contains(species); + bool hasForms = PersonalTable.AO[species].HasFormes || new[] { 664, 665, 414 }.Contains(species); CB_Form.Enabled = CB_Form.Visible = hasForms; CB_Form.DisplayMember = "Text"; diff --git a/Subforms/Save Editors/Gen6/SAV_SecretBase.cs b/Subforms/Save Editors/Gen6/SAV_SecretBase.cs index d1ab54463..5ad7760b4 100644 --- a/Subforms/Save Editors/Gen6/SAV_SecretBase.cs +++ b/Subforms/Save Editors/Gen6/SAV_SecretBase.cs @@ -411,7 +411,7 @@ namespace PKHeX int newabil = Convert.ToInt16(MT_AbilNo.Text) >> 1; int species = Util.getIndex(CB_Species); int formnum = CB_Form.SelectedIndex; - int[] abils = PersonalInfo.AO[PersonalInfo.AO[species].FormeIndex(species, formnum)].Abilities; + int[] abils = PersonalTable.AO[PersonalTable.AO[species].FormeIndex(species, formnum)].Abilities; // Build Ability List List ability_list = new List @@ -428,7 +428,7 @@ namespace PKHeX private void setForms() { int species = Util.getIndex(CB_Species); - bool hasForms = PersonalInfo.AO[species].HasFormes || new[] { 664, 665, 414 }.Contains(species); + bool hasForms = PersonalTable.AO[species].HasFormes || new[] { 664, 665, 414 }.Contains(species); CB_Form.Enabled = CB_Form.Visible = hasForms; CB_Form.DisplayMember = "Text";