mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-09-13 20:55:18 -05:00
Fix gen6 gift/static form randomization
if BST wasn't selected then it'd do a simple loop and return; added code was missing from that section simplify the code a little to only use one loop. #127
This commit is contained in:
@@ -159,20 +159,9 @@ private void B_RandAll_Click(object sender, EventArgs e)
|
||||
"Abort: Cancel");
|
||||
if (ync != DialogResult.Yes && ync != DialogResult.No)
|
||||
return;
|
||||
if (ync == DialogResult.No)
|
||||
{
|
||||
for (int i = 0; i < LB_Gifts.Items.Count; i++)
|
||||
{
|
||||
LB_Gifts.SelectedIndex = i;
|
||||
if (CB_Species.SelectedIndex == 448)
|
||||
continue; // skip Lucario, battle needs to mega evolve
|
||||
int species = Util.rand.Next(1, 721);
|
||||
CB_Species.SelectedIndex = species;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Randomize by BST
|
||||
bool bst = ync == DialogResult.Yes;
|
||||
int[] sL = Randomizer.getSpeciesList(CHK_G1.Checked, CHK_G2.Checked, CHK_G3.Checked, CHK_G4.Checked, CHK_G5.Checked, CHK_G6.Checked, false,
|
||||
CHK_L.Checked, CHK_E.Checked);
|
||||
int ctr = 0;
|
||||
@@ -183,7 +172,7 @@ private void B_RandAll_Click(object sender, EventArgs e)
|
||||
if (species == 448)
|
||||
continue; // skip Lucario, battle needs to mega evolve
|
||||
|
||||
species = Randomizer.getRandomSpecies(ref sL, ref ctr, species, true, Main.SpeciesStat);
|
||||
species = Randomizer.getRandomSpecies(ref sL, ref ctr, species, bst, Main.SpeciesStat);
|
||||
CB_Species.SelectedIndex = species;
|
||||
NUD_Form.Value = Randomizer.GetRandomForme(species, false, true);
|
||||
NUD_Gender.Value = 0; // random
|
||||
|
||||
@@ -122,18 +122,9 @@ private void B_RandAll_Click(object sender, EventArgs e)
|
||||
"Abort: Cancel");
|
||||
if (ync != DialogResult.Yes && ync != DialogResult.No)
|
||||
return;
|
||||
if (ync == DialogResult.No)
|
||||
{
|
||||
for (int i = 0; i < LB_Encounters.Items.Count; i++)
|
||||
{
|
||||
LB_Encounters.SelectedIndex = i;
|
||||
int species = Util.rand.Next(1, 721);
|
||||
CB_Species.SelectedIndex = species;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Randomize by BST
|
||||
bool bst = ync == DialogResult.Yes;
|
||||
int[] sL = Randomizer.getSpeciesList(CHK_G1.Checked, CHK_G2.Checked, CHK_G3.Checked, CHK_G4.Checked, CHK_G5.Checked, CHK_G6.Checked, false,
|
||||
CHK_L.Checked, CHK_E.Checked);
|
||||
int ctr = 0;
|
||||
@@ -142,7 +133,7 @@ private void B_RandAll_Click(object sender, EventArgs e)
|
||||
LB_Encounters.SelectedIndex = i;
|
||||
|
||||
int species = CB_Species.SelectedIndex;
|
||||
species = Randomizer.getRandomSpecies(ref sL, ref ctr, species, true, Main.SpeciesStat);
|
||||
species = Randomizer.getRandomSpecies(ref sL, ref ctr, species, bst, Main.SpeciesStat);
|
||||
CB_Species.SelectedIndex = species;
|
||||
NUD_Form.Value = Randomizer.GetRandomForme(species, false, true);
|
||||
NUD_Gender.Value = 0; // random
|
||||
|
||||
Reference in New Issue
Block a user