Merge pull request #245 from sora10pls/master

Fix USUM species not appearing
This commit is contained in:
Kurt 2017-12-07 11:06:45 -08:00 committed by GitHub
commit 698f03317a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 26 deletions

View File

@ -12,8 +12,8 @@ public class GameConfig
private const int FILECOUNT_ORASDEMO = 301;
private const int FILECOUNT_ORAS = 299;
private const int FILECOUNT_SMDEMO = 239;
private const int FILECOUNT_SM = 311; // only a guess for now
private const int FILECOUNT_USUM = 333; // only a guess for now
private const int FILECOUNT_SM = 311;
private const int FILECOUNT_USUM = 333;
public readonly GameVersion Version = GameVersion.Invalid;
public GARCReference[] Files { get; private set; }
@ -237,7 +237,7 @@ public string getGARCFileName(string requestedGARC)
public bool ORAS => Version == GameVersion.ORAS || Version == GameVersion.ORASDEMO;
public bool SM => Version == GameVersion.SM || Version == GameVersion.SMDEMO;
public bool USUM => Version == GameVersion.USUM;
public int MaxSpeciesID => XY || ORAS ? 721 : SM ? 802 : 807;
public int MaxSpeciesID => XY || ORAS ? Legal.MaxSpeciesID_6 : SM ? Legal.MaxSpeciesID_7_SM : Legal.MaxSpeciesID_7_USUM;
public int GARCVersion => XY || ORAS ? GARC.VER_4 : GARC.VER_6;
public int Generation
{

View File

@ -41,11 +41,11 @@ private void LoadAO()
private void LoadSM()
{
MaxSpeciesID = Legal.MaxSpeciesID_7;
MaxMoveID = Legal.MaxMoveID_7;
MaxItemID = Legal.MaxItemID_7;
MaxSpeciesID = Legal.MaxSpeciesID_7_SM;
MaxMoveID = Legal.MaxMoveID_7_SM;
MaxItemID = Legal.MaxItemID_7_SM;
HeldItems = Legal.HeldItems_SM;
MaxAbilityID = Legal.MaxAbilityID_7;
MaxAbilityID = Legal.MaxAbilityID_7_SM;
}
private void LoadUSUM()
@ -53,8 +53,8 @@ private void LoadUSUM()
MaxSpeciesID = Legal.MaxSpeciesID_7_USUM;
MaxMoveID = Legal.MaxMoveID_7_USUM;
MaxItemID = Legal.MaxItemID_7_USUM;
HeldItems = Legal.HeldItems_SM;
MaxAbilityID = Legal.MaxAbilityID_7;
HeldItems = Legal.HeldItems_USUM;
MaxAbilityID = Legal.MaxAbilityID_7_USUM;
}
}
}

View File

@ -225,6 +225,7 @@ public static partial class Legal
622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658,
695, 696, 697, 698, 699, 700, 701, 702, 703,
719,
723, 724, 725, 726, 727, 728
};
}
}

View File

@ -5,16 +5,17 @@ namespace pk3DS.Core
{
public static partial class Legal
{
internal const int MaxSpeciesID_7 = 802;
internal const int MaxMoveID_7 = 720;
internal const int MaxItemID_7 = 920;
internal const int MaxAbilityID_7 = 232;
internal const int MaxBallID_7 = 0x1A; // 26
internal const int MaxSpeciesID_7_SM = 802;
internal const int MaxMoveID_7_SM = 719;
internal const int MaxItemID_7_SM = 920;
internal const int MaxAbilityID_7_SM = 232;
internal const int MaxBallID_7_SM = 0x1A; // 26
internal const int MaxGameID_7 = 41; // Crystal (VC?)
internal const int MaxSpeciesID_7_USUM = 802;
internal const int MaxMoveID_7_USUM = 720;
internal const int MaxItemID_7_USUM = 920;
internal const int MaxSpeciesID_7_USUM = 807;
internal const int MaxMoveID_7_USUM = 728;
internal const int MaxItemID_7_USUM = 959;
internal const int MaxAbilityID_7_USUM = 233;
#region Met Locations
@ -106,7 +107,14 @@ public static partial class Legal
internal static readonly ushort[] Pouch_ZCrystalHeld_SM = { // Piece
776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 798, 799, 800, 801, 802, 803, 804, 805, 806, 836
};
internal static readonly ushort[] Pouch_ZCrystal_USUM = { // Bead
927, 928, 929, 930, 931, 932
};
internal static readonly ushort[] Pouch_ZCrystalHeld_USUM = { // Piece
921, 922, 923, 924, 925, 926
};
internal static readonly ushort[] HeldItems_SM = new ushort[1].Concat(Pouch_Items_SM).Concat(Pouch_Berries_SM).Concat(Pouch_Medicine_SM).Concat(Pouch_ZCrystalHeld_SM).ToArray();
internal static readonly ushort[] HeldItems_USUM = new ushort[1].Concat(HeldItems_SM).Concat(Pouch_ZCrystalHeld_USUM).ToArray();
internal static readonly int[] AlolanOriginForms =
{
019, // Rattata
@ -114,7 +122,7 @@ public static partial class Legal
027, // Sandshrew
028, // Sandslash
037, // Vulpix
038, // Ninetails
038, // Ninetales
050, // Diglett
051, // Dugtrio
052, // Meowth
@ -204,7 +212,7 @@ public static partial class Legal
715, // Fairy Gem
};
#endregion
internal static readonly bool[] ReleasedHeldItems_7 = Enumerable.Range(0, MaxItemID_7+1).Select(i => HeldItems_SM.Contains((ushort)i) && !UnreleasedHeldItems_7.Contains(i)).ToArray();
internal static readonly bool[] ReleasedHeldItems_7 = Enumerable.Range(0, MaxItemID_7_SM+1).Select(i => HeldItems_SM.Contains((ushort)i) && !UnreleasedHeldItems_7.Contains(i)).ToArray();
public static readonly HashSet<int> Totem_Alolan = new HashSet<int>
{

View File

@ -157,7 +157,7 @@ private void AddGen2Species(List<int> list)
if (L)
{
list.AddRange(Enumerable.Range(243, 3)); // Dogs
list.AddRange(Enumerable.Range(243, 3)); // Beasts
list.AddRange(Enumerable.Range(249, 2)); // Lugia & Ho-Oh
}
if (E) list.Add(251); // Celebi
@ -173,26 +173,33 @@ private void AddGen3Species(List<int> list)
private void AddGen4Species(List<int> list)
{
list.AddRange(Enumerable.Range(387, 93));
if (L) list.AddRange(Enumerable.Range(480, 9)); //
if (E) list.AddRange(Enumerable.Range(489, 5)); //
if (L) list.AddRange(Enumerable.Range(480, 9)); // Sinnoh Legends
if (E) list.AddRange(Enumerable.Range(489, 5)); // Phione, Manaphy, Darkrai, Shaymin, Arceus
}
private void AddGen5Species(List<int> list)
{
list.AddRange(Enumerable.Range(495, 143));
if (L) list.AddRange(Enumerable.Range(638, 9)); list.Add(494); //
if (E) list.AddRange(Enumerable.Range(647, 3)); //
if (L) list.AddRange(Enumerable.Range(638, 9)); list.Add(494); // Unova Legends
if (E) list.AddRange(Enumerable.Range(647, 3)); // Keldeo, Meloetta, Genesect
}
private void AddGen6Species(List<int> list)
{
list.AddRange(Enumerable.Range(650, 66));
if (L) list.AddRange(Enumerable.Range(716, 3)); //
if (E) list.AddRange(Enumerable.Range(719, 3)); //
if (L) list.AddRange(Enumerable.Range(716, 3)); // Kalos Legends
if (E) list.AddRange(Enumerable.Range(719, 3)); // Diancie, Hoopa, Volcanion
}
private void AddGen7Species(List<int> list)
{
list.AddRange(Enumerable.Range(722, 67));
if (L) list.AddRange(Enumerable.Range(785, 16)); // Tapus, Legends, UBs
if (E) list.AddRange(Enumerable.Range(801, 2)); // Magearna, Marshadow
if (MaxSpeciesID == 807) // USUM
{
if (L) list.AddRange(Enumerable.Range(803, 4)); // Poipole, Naganadel, Stakataka, Blacephalon
if (E) list.Add(807); // Zeraora
}
}
public int[] RandomSpeciesList => Enumerable.Range(1, MaxSpeciesID).ToArray();