Add no-fixed damage moves option

closes #177
This commit is contained in:
Kurt 2017-10-07 22:37:30 -07:00
parent 987dc4abf1
commit 699155906a
8 changed files with 65 additions and 5 deletions

View File

@ -1,4 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using pk3DS.Core.Structures;
@ -31,7 +33,7 @@ public LearnsetRandomizer(GameConfig config, Learnset[] sets)
public bool Learn4Level1 = false;
public bool STAB { set => moverand.rSTAB = value; }
public int[] BannedMoves { set => moverand.BannedMoves = value; }
public IList<int> BannedMoves { set => moverand.BannedMoves = value; }
public decimal rSTABPercent { set => moverand.rSTABPercent = value; }
public void Execute()

View File

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using pk3DS.Core.Structures;
using pk3DS.Core.Structures.PersonalInfo;
@ -33,7 +34,9 @@ public void Execute()
public bool rSTAB = true;
public int rSTABCount = 2;
public decimal rSTABPercent = 100;
public int[] BannedMoves = new int[0];
public IList<int> BannedMoves = new int[0];
public static readonly int[] FixedDamageMoves = { 49, 82 };
private int loopctr = 0;

View File

@ -47,6 +47,7 @@ private void InitializeComponent()
this.CHK_HMs = new System.Windows.Forms.CheckBox();
this.PB_MonSprite = new System.Windows.Forms.PictureBox();
this.CHK_4MovesLvl1 = new System.Windows.Forms.CheckBox();
this.CHK_NoFixedDamage = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_Moves)).BeginInit();
@ -113,6 +114,7 @@ private void InitializeComponent()
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.CHK_NoFixedDamage);
this.groupBox1.Controls.Add(this.CHK_4MovesLvl1);
this.groupBox1.Controls.Add(this.L_Moves);
this.groupBox1.Controls.Add(this.NUD_Moves);
@ -284,6 +286,18 @@ private void InitializeComponent()
this.CHK_4MovesLvl1.Text = "4 Moves\r\n@ Lvl1";
this.CHK_4MovesLvl1.UseVisualStyleBackColor = true;
//
// CHK_NoFixedDamage
//
this.CHK_NoFixedDamage.AutoSize = true;
this.CHK_NoFixedDamage.Checked = true;
this.CHK_NoFixedDamage.CheckState = System.Windows.Forms.CheckState.Checked;
this.CHK_NoFixedDamage.Location = new System.Drawing.Point(5, 266);
this.CHK_NoFixedDamage.Name = "CHK_NoFixedDamage";
this.CHK_NoFixedDamage.Size = new System.Drawing.Size(90, 56);
this.CHK_NoFixedDamage.TabIndex = 14;
this.CHK_NoFixedDamage.Text = "No Fixed\r\nDamage\r\nDragon Rage\r\nSonicboom";
this.CHK_NoFixedDamage.UseVisualStyleBackColor = true;
//
// LevelUpEditor6
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -335,5 +349,6 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox CHK_Expand;
private System.Windows.Forms.PictureBox PB_MonSprite;
private System.Windows.Forms.CheckBox CHK_4MovesLvl1;
private System.Windows.Forms.CheckBox CHK_NoFixedDamage;
}
}

View File

@ -134,6 +134,8 @@ private void B_RandAll_Click(object sender, EventArgs e)
List<int> banned = new List<int> {165, 621}; // Struggle, Hyperspace Fury
if (!CHK_HMs.Checked)
banned.AddRange(HMs.Select(z => (int)z));
if (CHK_NoFixedDamage.Checked)
banned.AddRange(MoveRandomizer.FixedDamageMoves);
setList();
var sets = files.Select(z => new Learnset6(z)).ToArray();

View File

@ -8,6 +8,7 @@
using System.Windows.Forms;
using pk3DS.Core;
using pk3DS.Core.Randomizers;
using pk3DS.Core.Structures;
using pk3DS.Core.Structures.PersonalInfo;
@ -524,6 +525,7 @@ private void Setup()
public static bool rPKM, rSmart, rLevel, rMove, rNoMove, rAbility, rDiffAI,
rDiffIV, rClass, rGift, rItem, rDoRand, rRandomMegas, rGymE4Only,
rTypeTheme, rTypeGymTrainers, rOnlySingles, rDMG, rSTAB, r6PKM;
public static bool rNoFixedDamage;
internal static bool[] rThemedClasses = { };
private static string[] rTags;
private static int[] megaEvos;
@ -545,7 +547,9 @@ private void B_Randomize_Click(object sender, EventArgs e)
}
private void Randomize()
{
int[] banned = { 165, 621 }; // Struggle, Hyperspace Fury
List<int> banned = new List<int> { 165, 621 }; // Struggle, Hyperspace Fury
if (rNoFixedDamage)
banned.AddRange(MoveRandomizer.FixedDamageMoves);
rImportant = new string[CB_TrainerID.Items.Count];
rTags = Main.Config.ORAS ? GetTagsORAS() : GetTagsXY();
mEvoTypes = GetMegaEvolvableTypes();

View File

@ -65,6 +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_NoFixedDamage = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.NUD_GiftPercent)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_Level)).BeginInit();
this.GB_Tweak.SuspendLayout();
@ -569,11 +570,24 @@ private void InitializeComponent()
this.L_Moves.TabIndex = 331;
this.L_Moves.Text = "Moves:";
//
// CHK_NoFixedDamage
//
this.CHK_NoFixedDamage.AutoSize = true;
this.CHK_NoFixedDamage.Checked = true;
this.CHK_NoFixedDamage.CheckState = System.Windows.Forms.CheckState.Checked;
this.CHK_NoFixedDamage.Location = new System.Drawing.Point(182, 297);
this.CHK_NoFixedDamage.Name = "CHK_NoFixedDamage";
this.CHK_NoFixedDamage.Size = new System.Drawing.Size(90, 56);
this.CHK_NoFixedDamage.TabIndex = 332;
this.CHK_NoFixedDamage.Text = "No Fixed\r\nDamage\r\nDragon Rage\r\nSonicboom";
this.CHK_NoFixedDamage.UseVisualStyleBackColor = true;
//
// TrainerRand
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 410);
this.Controls.Add(this.CHK_NoFixedDamage);
this.Controls.Add(this.L_Moves);
this.Controls.Add(this.CB_Moves);
this.Controls.Add(this.CHK_OnlySingles);
@ -653,5 +667,6 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox CHK_6PKM;
private System.Windows.Forms.CheckBox CHK_RandomMegaForm;
private System.Windows.Forms.CheckBox CHK_GymE4Only;
private System.Windows.Forms.CheckBox CHK_NoFixedDamage;
}
}

View File

@ -47,6 +47,7 @@ private void InitializeComponent()
this.CHK_HMs = new System.Windows.Forms.CheckBox();
this.PB_MonSprite = new System.Windows.Forms.PictureBox();
this.CHK_4MovesLvl1 = new System.Windows.Forms.CheckBox();
this.CHK_NoFixedDamage = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_Moves)).BeginInit();
@ -113,6 +114,7 @@ private void InitializeComponent()
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.CHK_NoFixedDamage);
this.groupBox1.Controls.Add(this.CHK_4MovesLvl1);
this.groupBox1.Controls.Add(this.L_Moves);
this.groupBox1.Controls.Add(this.NUD_Moves);
@ -277,13 +279,25 @@ private void InitializeComponent()
// CHK_4MovesLvl1
//
this.CHK_4MovesLvl1.AutoSize = true;
this.CHK_4MovesLvl1.Location = new System.Drawing.Point(0, 154);
this.CHK_4MovesLvl1.Location = new System.Drawing.Point(5, 154);
this.CHK_4MovesLvl1.Name = "CHK_4MovesLvl1";
this.CHK_4MovesLvl1.Size = new System.Drawing.Size(67, 30);
this.CHK_4MovesLvl1.TabIndex = 12;
this.CHK_4MovesLvl1.Text = "4 Moves\r\n@ Lvl1";
this.CHK_4MovesLvl1.UseVisualStyleBackColor = true;
//
// CHK_NoFixedDamage
//
this.CHK_NoFixedDamage.AutoSize = true;
this.CHK_NoFixedDamage.Checked = true;
this.CHK_NoFixedDamage.CheckState = System.Windows.Forms.CheckState.Checked;
this.CHK_NoFixedDamage.Location = new System.Drawing.Point(5, 266);
this.CHK_NoFixedDamage.Name = "CHK_NoFixedDamage";
this.CHK_NoFixedDamage.Size = new System.Drawing.Size(90, 56);
this.CHK_NoFixedDamage.TabIndex = 13;
this.CHK_NoFixedDamage.Text = "No Fixed\r\nDamage\r\nDragon Rage\r\nSonicboom";
this.CHK_NoFixedDamage.UseVisualStyleBackColor = true;
//
// LevelUpEditor7
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -335,5 +349,6 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox CHK_Expand;
private System.Windows.Forms.PictureBox PB_MonSprite;
private System.Windows.Forms.CheckBox CHK_4MovesLvl1;
private System.Windows.Forms.CheckBox CHK_NoFixedDamage;
}
}

View File

@ -132,6 +132,10 @@ private void B_RandAll_Click(object sender, EventArgs e)
{
setList();
var sets = files.Select(z => new Learnset7(z)).ToArray();
var banned = new List<int>(new[] {165, 621, 464}.Concat(Legal.Z_Moves)); // Struggle, Hyperspace Fury, Dark Void
if (CHK_NoFixedDamage.Checked)
banned.AddRange(MoveRandomizer.FixedDamageMoves);
var rand = new LearnsetRandomizer(Main.Config, sets)
{
Expand = CHK_Expand.Checked,
@ -141,7 +145,7 @@ private void B_RandAll_Click(object sender, EventArgs e)
STAB = CHK_STAB.Checked,
rSTABPercent = NUD_STAB.Value,
STABFirst = CHK_STAB.Checked,
BannedMoves = new[] { 165, 621, 464 }.Concat(Legal.Z_Moves).ToArray(), // Struggle, Hyperspace Fury, Dark Void
BannedMoves = banned,
Learn4Level1 = CHK_4MovesLvl1.Checked,
};
rand.Execute();