diff --git a/pk3DS/Subforms/Gen7/StaticEncounterEditor7.Designer.cs b/pk3DS/Subforms/Gen7/StaticEncounterEditor7.Designer.cs index 28c3737..06734a2 100644 --- a/pk3DS/Subforms/Gen7/StaticEncounterEditor7.Designer.cs +++ b/pk3DS/Subforms/Gen7/StaticEncounterEditor7.Designer.cs @@ -30,6 +30,8 @@ private void InitializeComponent() { this.TC_Tabs = new System.Windows.Forms.TabControl(); this.Tab_Gifts = new System.Windows.Forms.TabPage(); + this.CB_GNature = new System.Windows.Forms.ComboBox(); + this.L_GNature = new System.Windows.Forms.Label(); this.CHK_IsEgg = new System.Windows.Forms.CheckBox(); this.CHK_GIV3 = new System.Windows.Forms.CheckBox(); this.CB_SpecialMove = new System.Windows.Forms.ComboBox(); @@ -124,6 +126,7 @@ private void InitializeComponent() this.NUD_TLevel = new System.Windows.Forms.NumericUpDown(); this.LB_Trade = new System.Windows.Forms.ListBox(); this.Tab_Randomizer = new System.Windows.Forms.TabPage(); + this.B_ModifyLevel = new System.Windows.Forms.Button(); this.NUD_LevelBoost = new System.Windows.Forms.NumericUpDown(); this.CHK_Level = new System.Windows.Forms.CheckBox(); this.B_RandAll = new System.Windows.Forms.Button(); @@ -145,8 +148,6 @@ private void InitializeComponent() this.B_Starters = new System.Windows.Forms.Button(); this.B_Save = new System.Windows.Forms.Button(); this.B_Cancel = new System.Windows.Forms.Button(); - this.CB_GNature = new System.Windows.Forms.ComboBox(); - this.L_GNature = new System.Windows.Forms.Label(); this.TC_Tabs.SuspendLayout(); this.Tab_Gifts.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.NUD_GGender)).BeginInit(); @@ -228,6 +229,23 @@ private void InitializeComponent() this.Tab_Gifts.Text = "Gifts"; this.Tab_Gifts.UseVisualStyleBackColor = true; // + // CB_GNature + // + this.CB_GNature.FormattingEnabled = true; + this.CB_GNature.Location = new System.Drawing.Point(187, 119); + this.CB_GNature.Name = "CB_GNature"; + this.CB_GNature.Size = new System.Drawing.Size(121, 21); + this.CB_GNature.TabIndex = 511; + // + // L_GNature + // + this.L_GNature.Location = new System.Drawing.Point(131, 117); + this.L_GNature.Name = "L_GNature"; + this.L_GNature.Size = new System.Drawing.Size(55, 23); + this.L_GNature.TabIndex = 510; + this.L_GNature.Text = "Nature:"; + this.L_GNature.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // // CHK_IsEgg // this.CHK_IsEgg.AutoSize = true; @@ -285,11 +303,6 @@ private void InitializeComponent() this.NUD_GGender.Name = "NUD_GGender"; this.NUD_GGender.Size = new System.Drawing.Size(34, 20); this.NUD_GGender.TabIndex = 20; - this.NUD_GGender.Value = new decimal(new int[] { - 2, - 0, - 0, - 0}); // // CHK_G_Lock // @@ -374,11 +387,6 @@ private void InitializeComponent() // NUD_GLevel // this.NUD_GLevel.Location = new System.Drawing.Point(187, 30); - this.NUD_GLevel.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); this.NUD_GLevel.Name = "NUD_GLevel"; this.NUD_GLevel.Size = new System.Drawing.Size(48, 20); this.NUD_GLevel.TabIndex = 1; @@ -983,11 +991,6 @@ private void InitializeComponent() // NUD_ELevel // this.NUD_ELevel.Location = new System.Drawing.Point(187, 30); - this.NUD_ELevel.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); this.NUD_ELevel.Name = "NUD_ELevel"; this.NUD_ELevel.Size = new System.Drawing.Size(48, 20); this.NUD_ELevel.TabIndex = 9; @@ -1281,9 +1284,9 @@ private void InitializeComponent() this.L_TTID.AutoSize = true; this.L_TTID.Location = new System.Drawing.Point(252, 123); this.L_TTID.Name = "L_TTID"; - this.L_TTID.Size = new System.Drawing.Size(28, 13); + this.L_TTID.Size = new System.Drawing.Size(53, 13); this.L_TTID.TabIndex = 27; - this.L_TTID.Text = "TID:"; + this.L_TTID.Text = "Gen 7 ID:"; this.L_TTID.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // L_TID @@ -1386,11 +1389,6 @@ private void InitializeComponent() // NUD_TLevel // this.NUD_TLevel.Location = new System.Drawing.Point(187, 30); - this.NUD_TLevel.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); this.NUD_TLevel.Name = "NUD_TLevel"; this.NUD_TLevel.Size = new System.Drawing.Size(48, 20); this.NUD_TLevel.TabIndex = 17; @@ -1413,6 +1411,7 @@ private void InitializeComponent() // // Tab_Randomizer // + this.Tab_Randomizer.Controls.Add(this.B_ModifyLevel); this.Tab_Randomizer.Controls.Add(this.NUD_LevelBoost); this.Tab_Randomizer.Controls.Add(this.CHK_Level); this.Tab_Randomizer.Controls.Add(this.B_RandAll); @@ -1426,6 +1425,16 @@ private void InitializeComponent() this.Tab_Randomizer.Text = "Randomizer Options"; this.Tab_Randomizer.UseVisualStyleBackColor = true; // + // B_ModifyLevel + // + this.B_ModifyLevel.Location = new System.Drawing.Point(316, 111); + this.B_ModifyLevel.Name = "B_ModifyLevel"; + this.B_ModifyLevel.Size = new System.Drawing.Size(70, 23); + this.B_ModifyLevel.TabIndex = 512; + this.B_ModifyLevel.Text = "× Current"; + this.B_ModifyLevel.UseVisualStyleBackColor = true; + this.B_ModifyLevel.Click += new System.EventHandler(this.ModifyLevels); + // // NUD_LevelBoost // this.NUD_LevelBoost.DecimalPlaces = 2; @@ -1434,7 +1443,7 @@ private void InitializeComponent() 0, 0, 131072}); - this.NUD_LevelBoost.Location = new System.Drawing.Point(301, 110); + this.NUD_LevelBoost.Location = new System.Drawing.Point(267, 112); this.NUD_LevelBoost.Maximum = new decimal(new int[] { 3, 0, @@ -1454,7 +1463,7 @@ private void InitializeComponent() this.CHK_Level.AutoSize = true; this.CHK_Level.Checked = true; this.CHK_Level.CheckState = System.Windows.Forms.CheckState.Checked; - this.CHK_Level.Location = new System.Drawing.Point(169, 111); + this.CHK_Level.Location = new System.Drawing.Point(135, 113); this.CHK_Level.Name = "CHK_Level"; this.CHK_Level.Size = new System.Drawing.Size(130, 17); this.CHK_Level.TabIndex = 510; @@ -1487,9 +1496,9 @@ private void InitializeComponent() this.GB_Tweak.Controls.Add(this.CHK_G3); this.GB_Tweak.Controls.Add(this.CHK_G2); this.GB_Tweak.Controls.Add(this.CHK_G1); - this.GB_Tweak.Location = new System.Drawing.Point(122, 136); + this.GB_Tweak.Location = new System.Drawing.Point(129, 135); this.GB_Tweak.Name = "GB_Tweak"; - this.GB_Tweak.Size = new System.Drawing.Size(258, 144); + this.GB_Tweak.Size = new System.Drawing.Size(258, 145); this.GB_Tweak.TabIndex = 508; this.GB_Tweak.TabStop = false; this.GB_Tweak.Text = "Extra Randomization Tweaks"; @@ -1683,23 +1692,6 @@ private void InitializeComponent() this.B_Cancel.UseVisualStyleBackColor = true; this.B_Cancel.Click += new System.EventHandler(this.B_Cancel_Click); // - // CB_GNature - // - this.CB_GNature.FormattingEnabled = true; - this.CB_GNature.Location = new System.Drawing.Point(187, 119); - this.CB_GNature.Name = "CB_GNature"; - this.CB_GNature.Size = new System.Drawing.Size(121, 21); - this.CB_GNature.TabIndex = 511; - // - // L_GNature - // - this.L_GNature.Location = new System.Drawing.Point(131, 117); - this.L_GNature.Name = "L_GNature"; - this.L_GNature.Size = new System.Drawing.Size(55, 23); - this.L_GNature.TabIndex = 510; - this.L_GNature.Text = "Nature:"; - this.L_GNature.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // // StaticEncounterEditor7 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1877,5 +1869,6 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox CHK_GIV3; private System.Windows.Forms.ComboBox CB_GNature; private System.Windows.Forms.Label L_GNature; + private System.Windows.Forms.Button B_ModifyLevel; } } \ No newline at end of file diff --git a/pk3DS/Subforms/Gen7/StaticEncounterEditor7.cs b/pk3DS/Subforms/Gen7/StaticEncounterEditor7.cs index 647d543..33c7e2e 100644 --- a/pk3DS/Subforms/Gen7/StaticEncounterEditor7.cs +++ b/pk3DS/Subforms/Gen7/StaticEncounterEditor7.cs @@ -448,10 +448,11 @@ private void B_Starters_Click(object sender, EventArgs e) if (CHK_Item.Checked) t.HeldItem = items[Util.rnd32() % items.Length]; + if (CHK_Level.Checked) + t.Level = Randomizer.getModifiedLevel(t.Level, NUD_LevelBoost.Value); + if (CHK_RemoveShinyLock.Checked) t.ShinyLock = false; // in case any user modifications locked the starters - - // no level boosting } getListBoxEntries(); @@ -479,6 +480,9 @@ private void B_RandAll_Click(object sender, EventArgs e) t.Species = specrand.GetRandomSpecies(t.Species); t.Form = formrand.GetRandomForme(t.Species); + if (CHK_AllowMega.Checked) + formrand.AllowMega = true; + if (CHK_Item.Checked) t.HeldItem = items[Util.rnd32() % items.Length]; @@ -494,6 +498,9 @@ private void B_RandAll_Click(object sender, EventArgs e) t.Form = formrand.GetRandomForme(t.Species); t.RelearnMoves = move.GetCurrentMoves(t.Species, t.Form, t.Level, 4); + if (CHK_AllowMega.Checked) + formrand.AllowMega = true; + if (CHK_Item.Checked) t.HeldItem = items[Util.rnd32() % items.Length]; @@ -509,6 +516,9 @@ private void B_RandAll_Click(object sender, EventArgs e) t.Form = formrand.GetRandomForme(t.Species); t.TradeRequestSpecies = specrand.GetRandomSpecies(t.TradeRequestSpecies); + if (CHK_AllowMega.Checked) + formrand.AllowMega = true; + if (CHK_Item.Checked) t.HeldItem = items[Util.rnd32() % items.Length]; @@ -576,5 +586,30 @@ private void ExportEncounters() var s = Encounters.Select(z => z.GetSummary() + $" // {specieslist[z.Species]} @ ???"); Clipboard.SetText(string.Join(Environment.NewLine, g.Concat(s))); } + + private void ModifyLevels(object sender, EventArgs e) + { + if (WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Modify all current Levels?", "Cannot undo.") != DialogResult.Yes) return; + + // encounter + for (int i = 0; i < LB_Encounter.Items.Count; i++) + { + LB_Encounter.SelectedIndex = i; + NUD_ELevel.Value = Randomizer.getModifiedLevel((int)NUD_ELevel.Value, NUD_LevelBoost.Value); + } + // gift + for (int i = 0; i < LB_Gift.Items.Count; i++) + { + LB_Gift.SelectedIndex = i; + NUD_GLevel.Value = Randomizer.getModifiedLevel((int)NUD_GLevel.Value, NUD_LevelBoost.Value); + } + // trade + for (int i = 0; i < LB_Trade.Items.Count; i++) + { + LB_Trade.SelectedIndex = i; + NUD_TLevel.Value = Randomizer.getModifiedLevel((int)NUD_TLevel.Value, NUD_LevelBoost.Value); + } + WinFormsUtil.Alert("Modified all Levels according to specification!"); + } } -} +} \ No newline at end of file