This commit is contained in:
sora10pls
2017-12-18 22:25:48 -05:00
3 changed files with 7 additions and 5 deletions

View File

@@ -73,7 +73,7 @@ public int GetRandomSpeciesType(int oldSpecies, int type)
loopctr++;
return newSpecies;
}
private bool GetIsTypeMatch(int newSpecies, int type) => SpeciesStat[newSpecies].Types.Any(z => z == type) || loopctr > 9000;
private bool GetIsTypeMatch(int newSpecies, int type) => type == -1 || SpeciesStat[newSpecies].Types.Any(z => z == type) || loopctr > 9000;
public int GetRandomSpecies(int oldSpecies)
{
@@ -118,11 +118,11 @@ private bool IsSpeciesBSTBad(PersonalInfo oldpkm, PersonalInfo pkm)
{
if (!rBST)
return false;
// Base stat total has to be close
// Base stat total has to be close to original BST
int expand = loopctr / MaxSpeciesID;
int lo = pkm.BST * l / (h + expand);
int hi = pkm.BST * (h + expand) / l;
return lo > oldpkm.BST || oldpkm.BST > hi;
int lo = oldpkm.BST * l / (h + expand);
int hi = oldpkm.BST * (h + expand) / l;
return lo > pkm.BST || pkm.BST > hi;
}
private int[] InitializeSpeciesList()

View File

@@ -98,6 +98,7 @@ private void B_Save_Click(object sender, EventArgs e)
Shedinja = true,
rBST = CHK_BST.Checked,
rEXP = false,
};
RSTE.rSpeciesRand.Initialize();

View File

@@ -592,6 +592,7 @@ private void B_Randomize_Click(object sender, EventArgs e)
E = CHK_E.Checked,
L = CHK_L.Checked,
rBST = CHK_BST.Checked,
rEXP = false,
};
rnd.Initialize();