Fetch form entries for gen4-6 learnsets

Silly Wormadam with different form permissions.
This commit is contained in:
Kurt 2022-12-17 20:36:44 -08:00
parent c776d8db43
commit 1c980a0434
8 changed files with 19 additions and 9 deletions

View file

@ -27,7 +27,7 @@ public sealed class LearnSource4DP : ILearnSource, IEggSource
pi = null;
if (species > MaxSpecies)
return false;
pi = Personal[species];
pi = Personal[species, form];
return true;
}

View file

@ -27,7 +27,7 @@ public sealed class LearnSource4HGSS : ILearnSource, IEggSource
pi = null;
if (species > MaxSpecies)
return false;
pi = Personal[species];
pi = Personal[species, form];
return true;
}

View file

@ -27,7 +27,7 @@ public sealed class LearnSource4Pt : ILearnSource, IEggSource
pi = null;
if (species > MaxSpecies)
return false;
pi = Personal[species];
pi = Personal[species, form];
return true;
}

View file

@ -25,7 +25,7 @@ public sealed class LearnSource5B2W2 : ILearnSource, IEggSource
pi = null;
if (species > MaxSpecies)
return false;
pi = Personal[species];
pi = Personal[species, form];
return true;
}

View file

@ -25,7 +25,7 @@ public sealed class LearnSource5BW : ILearnSource, IEggSource
pi = null;
if (!Personal.IsPresentInGame(species, form))
return false;
pi = Personal[species];
pi = Personal[species, form];
return true;
}

View file

@ -24,7 +24,7 @@ public sealed class LearnSource6AO : ILearnSource, IEggSource
pi = null;
if ((uint)species > MaxSpecies)
return false;
pi = Personal[species];
pi = Personal[species, form];
return true;
}

View file

@ -24,7 +24,7 @@ public sealed class LearnSource6XY : ILearnSource, IEggSource
pi = null;
if (species > MaxSpecies)
return false;
pi = Personal[species];
pi = Personal[species, form];
return true;
}

View file

@ -65,7 +65,17 @@ public sealed class PersonalTable4 : IPersonalTable, IPersonalTable<PersonalInfo
public void LoadTables(BinLinkerAccessor tutors)
{
var table = Table;
for (int i = Legal.MaxSpeciesID_4; i >= 1; i--)
table[i].AddTypeTutors(tutors[i]);
for (ushort i = Legal.MaxSpeciesID_4; i != 0; i--)
{
// Set to form 0 and copy the reference to all other form entries.
var form0 = table[i];
form0.AddTypeTutors(tutors[i]);
var fc = form0.FormCount;
for (byte f = 1; f < fc; f++)
{
var pi = table[form0.FormIndex(i, f)];
pi.TypeTutors = form0.TypeTutors;
}
}
}
}