mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
Add test living dex generator
doesn't generate everything due to the evo chain not being 'full' (instead is unevolved singular pkm), nor does it evolve pkm
This commit is contained in:
parent
79b2576c31
commit
9fb7056837
2 changed files with 21 additions and 3 deletions
|
@ -9,9 +9,8 @@ namespace PKHeX.Core
|
|||
// EncounterEgg
|
||||
public static IEnumerable<EncounterEgg> GenerateEggs(PKM pkm, bool all = false)
|
||||
{
|
||||
int tree = pkm.GenNumber;
|
||||
var table = EvolutionTree.GetEvolutionTree(tree);
|
||||
int maxSpeciesOrigin = GetMaxSpeciesOrigin(tree);
|
||||
var table = EvolutionTree.GetEvolutionTree(pkm.Format);
|
||||
int maxSpeciesOrigin = GetMaxSpeciesOrigin(pkm.GenNumber);
|
||||
var evos = table.GetValidPreEvolutions(pkm, maxLevel: 100, maxSpeciesOrigin: maxSpeciesOrigin, skipChecks: true);
|
||||
return GenerateEggs(pkm, evos, all);
|
||||
}
|
||||
|
|
|
@ -1205,5 +1205,24 @@ namespace PKHeX.WinForms.Controls
|
|||
ResetParty();
|
||||
}
|
||||
|
||||
private void GenerateLivingDex()
|
||||
{
|
||||
var bd = SAV.BoxData;
|
||||
|
||||
var tr = SAV;
|
||||
for (int i = 1; i <= 807; i++)
|
||||
{
|
||||
var pk = SAV.BlankPKM;
|
||||
pk.Species = i;
|
||||
pk.Gender = pk.GetSaneGender();
|
||||
if (i == 678)
|
||||
pk.AltForm = pk.Gender;
|
||||
var f = EncounterMovesetGenerator.GeneratePKMs(pk, tr).FirstOrDefault();
|
||||
if (f != null)
|
||||
bd[i] = PKMConverter.ConvertToType(f, SAV.PKMType, out _);
|
||||
}
|
||||
SAV.BoxData = bd;
|
||||
ReloadSlots();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue