mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-10-01 21:36:43 -05:00
Add Gym/E4 type randomization filter
This commit is contained in:
@@ -513,7 +513,7 @@ private void Setup()
|
||||
|
||||
private bool randomizing;
|
||||
public static bool rPKM, rSmart, rLevel, rMove, rNoMove, rAbility, rDiffAI,
|
||||
rDiffIV, rClass, rGift, rItem, rDoRand, rRandomMegas,
|
||||
rDiffIV, rClass, rGift, rItem, rDoRand, rRandomMegas, rGymE4Only,
|
||||
rTypeTheme, rTypeGymTrainers, rOnlySingles, rDMG, rSTAB, r6PKM;
|
||||
public static bool[] rThemedClasses = { };
|
||||
public static string[] rTags;
|
||||
@@ -648,8 +648,11 @@ private void Randomize()
|
||||
int itemC = itemvals.Length;
|
||||
int ctr = 0;
|
||||
|
||||
// Trainer Type/Mega Evo
|
||||
int type = GetRandomType(i);
|
||||
bool mevo = rEnsureMEvo.Contains(i);
|
||||
bool typerand = (rTypeTheme && !rGymE4Only) ||
|
||||
(rTypeTheme && (rImportant[i].Contains("GYM") || rImportant[i].Contains("ELITE") || rImportant[i].Contains("CHAMPION")));
|
||||
|
||||
// Randomize Pokemon
|
||||
for (int p = 0; p < CB_numPokemon.SelectedIndex; p++)
|
||||
@@ -661,7 +664,7 @@ private void Randomize()
|
||||
// randomize pokemon
|
||||
int species;
|
||||
pkm = Main.SpeciesStat[species = Randomizer.getRandomSpecies(ref sL, ref ctr)];
|
||||
if (rTypeTheme)
|
||||
if (typerand)
|
||||
{
|
||||
int tries = 0;
|
||||
while (((pkm.Types[0] != type && pkm.Types[1] != type) || ((mevo && p == CB_numPokemon.SelectedIndex - 1 && !megaEvos.Contains(species)))) && tries < 0x10000)
|
||||
|
||||
35
pk3DS/Subforms/TrainerRand.Designer.cs
generated
35
pk3DS/Subforms/TrainerRand.Designer.cs
generated
@@ -43,6 +43,7 @@ private void InitializeComponent()
|
||||
this.NUD_Level = new System.Windows.Forms.NumericUpDown();
|
||||
this.CHK_Level = new System.Windows.Forms.CheckBox();
|
||||
this.GB_Tweak = new System.Windows.Forms.GroupBox();
|
||||
this.CHK_RandomMegaForm = new System.Windows.Forms.CheckBox();
|
||||
this.CHK_6PKM = new System.Windows.Forms.CheckBox();
|
||||
this.CHK_GymTrainers = new System.Windows.Forms.CheckBox();
|
||||
this.CHK_StoryMEvos = new System.Windows.Forms.CheckBox();
|
||||
@@ -64,7 +65,7 @@ private void InitializeComponent()
|
||||
this.NUD_STAB = new System.Windows.Forms.NumericUpDown();
|
||||
this.CB_Moves = new System.Windows.Forms.ComboBox();
|
||||
this.L_Moves = new System.Windows.Forms.Label();
|
||||
this.CHK_RandomMegaForm = new System.Windows.Forms.CheckBox();
|
||||
this.CHK_GymE4Only = new System.Windows.Forms.CheckBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NUD_GiftPercent)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NUD_Level)).BeginInit();
|
||||
this.GB_Tweak.SuspendLayout();
|
||||
@@ -255,6 +256,7 @@ private void InitializeComponent()
|
||||
//
|
||||
this.GB_Tweak.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.GB_Tweak.Controls.Add(this.CHK_GymE4Only);
|
||||
this.GB_Tweak.Controls.Add(this.CHK_RandomMegaForm);
|
||||
this.GB_Tweak.Controls.Add(this.CHK_6PKM);
|
||||
this.GB_Tweak.Controls.Add(this.CHK_GymTrainers);
|
||||
@@ -276,6 +278,17 @@ private void InitializeComponent()
|
||||
this.GB_Tweak.TabStop = false;
|
||||
this.GB_Tweak.Text = "Options";
|
||||
//
|
||||
// CHK_RandomMegaForm
|
||||
//
|
||||
this.CHK_RandomMegaForm.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.CHK_RandomMegaForm.AutoSize = true;
|
||||
this.CHK_RandomMegaForm.Location = new System.Drawing.Point(9, 75);
|
||||
this.CHK_RandomMegaForm.Name = "CHK_RandomMegaForm";
|
||||
this.CHK_RandomMegaForm.Size = new System.Drawing.Size(103, 30);
|
||||
this.CHK_RandomMegaForm.TabIndex = 294;
|
||||
this.CHK_RandomMegaForm.Text = "Allow RandForm\r\nfor Mega PKM";
|
||||
this.CHK_RandomMegaForm.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// CHK_6PKM
|
||||
//
|
||||
this.CHK_6PKM.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
@@ -544,16 +557,17 @@ private void InitializeComponent()
|
||||
this.L_Moves.TabIndex = 331;
|
||||
this.L_Moves.Text = "Moves:";
|
||||
//
|
||||
// CHK_RandomMegaForm
|
||||
// CHK_GymE4Only
|
||||
//
|
||||
this.CHK_RandomMegaForm.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.CHK_RandomMegaForm.AutoSize = true;
|
||||
this.CHK_RandomMegaForm.Location = new System.Drawing.Point(9, 75);
|
||||
this.CHK_RandomMegaForm.Name = "CHK_RandomMegaForm";
|
||||
this.CHK_RandomMegaForm.Size = new System.Drawing.Size(103, 30);
|
||||
this.CHK_RandomMegaForm.TabIndex = 294;
|
||||
this.CHK_RandomMegaForm.Text = "Allow RandForm\r\nfor Mega PKM";
|
||||
this.CHK_RandomMegaForm.UseVisualStyleBackColor = true;
|
||||
this.CHK_GymE4Only.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.CHK_GymE4Only.AutoSize = true;
|
||||
this.CHK_GymE4Only.Enabled = false;
|
||||
this.CHK_GymE4Only.Location = new System.Drawing.Point(141, 129);
|
||||
this.CHK_GymE4Only.Name = "CHK_GymE4Only";
|
||||
this.CHK_GymE4Only.Size = new System.Drawing.Size(125, 17);
|
||||
this.CHK_GymE4Only.TabIndex = 295;
|
||||
this.CHK_GymE4Only.Text = "Theme Gym/E4 Only";
|
||||
this.CHK_GymE4Only.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// TrainerRand
|
||||
//
|
||||
@@ -640,5 +654,6 @@ private void InitializeComponent()
|
||||
private System.Windows.Forms.Label L_Moves;
|
||||
private System.Windows.Forms.CheckBox CHK_6PKM;
|
||||
private System.Windows.Forms.CheckBox CHK_RandomMegaForm;
|
||||
private System.Windows.Forms.CheckBox CHK_GymE4Only;
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,7 @@ private void B_Save_Click(object sender, EventArgs e)
|
||||
RSTE.rDiffAI = CHK_MaxDiffAI.Checked;
|
||||
RSTE.rTypeTheme = CHK_TypeTheme.Checked;
|
||||
RSTE.rTypeGymTrainers = CHK_GymTrainers.Checked;
|
||||
RSTE.rTypeGymE4Only = CHK_GymE4Only.Checked;
|
||||
RSTE.r6PKM = CHK_6PKM.Checked;
|
||||
RSTE.rRandomMegas = CHK_RandomMegaForm.Checked;
|
||||
|
||||
@@ -90,7 +91,9 @@ private void CHK_RandomPKM_CheckedChanged(object sender, EventArgs e)
|
||||
CHK_G4.Checked = CHK_G5.Checked = CHK_G6.Checked =
|
||||
CHK_L.Checked = CHK_E.Checked = CHK_StoryMEvos.Checked =
|
||||
CHK_RandomPKM.Checked;
|
||||
CHK_BST.Checked = CHK_TypeTheme.Checked = CHK_GymTrainers.Checked = CHK_6PKM.Checked = CHK_RandomMegaForm.Checked = false; // Off by default
|
||||
|
||||
CHK_TypeTheme.Checked = CHK_GymTrainers.Checked = CHK_GymE4Only.Checked =
|
||||
CHK_BST.Checked = CHK_6PKM.Checked = CHK_RandomMegaForm.Checked = false; // Off by default
|
||||
}
|
||||
|
||||
private void CHK_Level_CheckedChanged(object sender, EventArgs e)
|
||||
@@ -115,6 +118,8 @@ private void changeGiftPercent(object sender, EventArgs e)
|
||||
private void CHK_TypeTheme_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
CHK_GymTrainers.Enabled = CHK_GymTrainers.Checked = CHK_TypeTheme.Checked;
|
||||
if (!CHK_TypeTheme.Checked)
|
||||
CHK_GymE4Only.Checked = false;
|
||||
}
|
||||
|
||||
private void CHK_RandomClass_CheckedChanged(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user