Update moveeditor7 with more detail

closes #367
This commit is contained in:
Kurt 2018-08-27 18:12:14 -07:00
parent 5574ab2944
commit 74ec237824
4 changed files with 167 additions and 98 deletions

View File

@ -43,8 +43,8 @@ public class Move7 : Move
public int ZPower { get => Data[0x20]; set => Data[0x20] = (byte)value; } // 33
public int ZEffect { get => Data[0x21]; set => Data[0x21] = (byte)value; } // 34
public int Z3 { get => Data[0x22]; set => Data[0x22] = (byte)value; } // 35
public int ZPercent { get => Data[0x23]; set => Data[0x23] = (byte)value; } // 36
public RefreshType RefreshAfflictType { get => (RefreshType)Data[0x22]; set => Data[0x22] = (byte)value; } // 35
public int RefreshAfflictPercent { get => Data[0x23]; set => Data[0x23] = (byte)value; } // 36
public MoveFlag7 Flags { get => (MoveFlag7)BitConverter.ToUInt32(Data, 0x24); set => BitConverter.GetBytes((uint)value).CopyTo(Data, 0x24); }
}

View File

@ -0,0 +1,11 @@
namespace pk3DS.Core.Structures
{
public enum RefreshType : byte
{
None,
Disheveled,
Mud,
Dust,
Dry,
}
}

View File

@ -92,13 +92,15 @@ private void InitializeComponent()
this.B_Table = new System.Windows.Forms.Button();
this.CLB_Flags = new System.Windows.Forms.CheckedListBox();
this.NUD_ZPower = new System.Windows.Forms.NumericUpDown();
this.NUD_ZPercent = new System.Windows.Forms.NumericUpDown();
this.NUD_ZUnk = new System.Windows.Forms.NumericUpDown();
this.NUD_RefreshAfflictPercent = new System.Windows.Forms.NumericUpDown();
this.CB_ZMove = new System.Windows.Forms.ComboBox();
this.L_ZMove = new System.Windows.Forms.Label();
this.NUD_ZEffect = new System.Windows.Forms.NumericUpDown();
this.L_ZPower = new System.Windows.Forms.Label();
this.L_ZEffect = new System.Windows.Forms.Label();
this.CB_ZEffect = new System.Windows.Forms.ComboBox();
this.CB_AfflictRefresh = new System.Windows.Forms.ComboBox();
this.L_Refresh = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.NUD_HitMax)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_HitMin)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_Priority)).BeginInit();
@ -123,9 +125,7 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.NUD_0xB)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_ZPower)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_ZPercent)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_ZUnk)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_ZEffect)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_RefreshAfflictPercent)).BeginInit();
this.SuspendLayout();
//
// L_Type
@ -146,7 +146,7 @@ private void InitializeComponent()
this.CB_Move.FormattingEnabled = true;
this.CB_Move.Location = new System.Drawing.Point(71, 10);
this.CB_Move.Name = "CB_Move";
this.CB_Move.Size = new System.Drawing.Size(130, 21);
this.CB_Move.Size = new System.Drawing.Size(157, 21);
this.CB_Move.TabIndex = 1;
this.CB_Move.SelectedIndexChanged += new System.EventHandler(this.ChangeEntry);
//
@ -618,9 +618,8 @@ private void InitializeComponent()
//
// RTB
//
this.RTB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.RTB.Location = new System.Drawing.Point(12, 324);
this.RTB.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.RTB.Location = new System.Drawing.Point(12, 370);
this.RTB.Name = "RTB";
this.RTB.ReadOnly = true;
this.RTB.Size = new System.Drawing.Size(316, 51);
@ -818,15 +817,18 @@ private void InitializeComponent()
//
// CLB_Flags
//
this.CLB_Flags.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CLB_Flags.FormattingEnabled = true;
this.CLB_Flags.Location = new System.Drawing.Point(328, 146);
this.CLB_Flags.Name = "CLB_Flags";
this.CLB_Flags.Size = new System.Drawing.Size(103, 229);
this.CLB_Flags.Size = new System.Drawing.Size(103, 274);
this.CLB_Flags.TabIndex = 71;
//
// NUD_ZPower
//
this.NUD_ZPower.Location = new System.Drawing.Point(282, 260);
this.NUD_ZPower.Location = new System.Drawing.Point(71, 343);
this.NUD_ZPower.Maximum = new decimal(new int[] {
255,
0,
@ -836,29 +838,12 @@ private void InitializeComponent()
this.NUD_ZPower.Size = new System.Drawing.Size(40, 20);
this.NUD_ZPower.TabIndex = 72;
//
// NUD_ZPercent
// NUD_RefreshAfflictPercent
//
this.NUD_ZPercent.Location = new System.Drawing.Point(239, 302);
this.NUD_ZPercent.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.NUD_ZPercent.Name = "NUD_ZPercent";
this.NUD_ZPercent.Size = new System.Drawing.Size(40, 20);
this.NUD_ZPercent.TabIndex = 73;
//
// NUD_ZUnk
//
this.NUD_ZUnk.Location = new System.Drawing.Point(282, 302);
this.NUD_ZUnk.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.NUD_ZUnk.Name = "NUD_ZUnk";
this.NUD_ZUnk.Size = new System.Drawing.Size(40, 20);
this.NUD_ZUnk.TabIndex = 74;
this.NUD_RefreshAfflictPercent.Location = new System.Drawing.Point(282, 284);
this.NUD_RefreshAfflictPercent.Name = "NUD_RefreshAfflictPercent";
this.NUD_RefreshAfflictPercent.Size = new System.Drawing.Size(40, 20);
this.NUD_RefreshAfflictPercent.TabIndex = 73;
//
// CB_ZMove
//
@ -866,62 +851,90 @@ private void InitializeComponent()
this.CB_ZMove.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
this.CB_ZMove.DropDownWidth = 150;
this.CB_ZMove.FormattingEnabled = true;
this.CB_ZMove.Location = new System.Drawing.Point(227, 235);
this.CB_ZMove.Location = new System.Drawing.Point(71, 320);
this.CB_ZMove.Name = "CB_ZMove";
this.CB_ZMove.Size = new System.Drawing.Size(95, 21);
this.CB_ZMove.Size = new System.Drawing.Size(157, 21);
this.CB_ZMove.TabIndex = 75;
//
// L_ZMove
//
this.L_ZMove.AutoSize = true;
this.L_ZMove.Location = new System.Drawing.Point(229, 219);
this.L_ZMove.Location = new System.Drawing.Point(18, 323);
this.L_ZMove.Name = "L_ZMove";
this.L_ZMove.Size = new System.Drawing.Size(44, 13);
this.L_ZMove.Size = new System.Drawing.Size(47, 13);
this.L_ZMove.TabIndex = 76;
this.L_ZMove.Text = "Z Move";
//
// NUD_ZEffect
//
this.NUD_ZEffect.Location = new System.Drawing.Point(282, 281);
this.NUD_ZEffect.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.NUD_ZEffect.Name = "NUD_ZEffect";
this.NUD_ZEffect.Size = new System.Drawing.Size(40, 20);
this.NUD_ZEffect.TabIndex = 77;
this.L_ZMove.Text = "Z Move:";
//
// L_ZPower
//
this.L_ZPower.AutoSize = true;
this.L_ZPower.Location = new System.Drawing.Point(229, 262);
this.L_ZPower.Location = new System.Drawing.Point(25, 345);
this.L_ZPower.Name = "L_ZPower";
this.L_ZPower.Size = new System.Drawing.Size(37, 13);
this.L_ZPower.Size = new System.Drawing.Size(40, 13);
this.L_ZPower.TabIndex = 78;
this.L_ZPower.Text = "Power";
this.L_ZPower.Text = "Power:";
//
// L_ZEffect
//
this.L_ZEffect.AutoSize = true;
this.L_ZEffect.Location = new System.Drawing.Point(229, 283);
this.L_ZEffect.Location = new System.Drawing.Point(117, 345);
this.L_ZEffect.Name = "L_ZEffect";
this.L_ZEffect.Size = new System.Drawing.Size(35, 13);
this.L_ZEffect.Size = new System.Drawing.Size(38, 13);
this.L_ZEffect.TabIndex = 79;
this.L_ZEffect.Text = "Effect";
this.L_ZEffect.Text = "Effect:";
//
// CB_ZEffect
//
this.CB_ZEffect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CB_ZEffect.DropDownWidth = 350;
this.CB_ZEffect.FormattingEnabled = true;
this.CB_ZEffect.Location = new System.Drawing.Point(159, 342);
this.CB_ZEffect.Name = "CB_ZEffect";
this.CB_ZEffect.Size = new System.Drawing.Size(129, 21);
this.CB_ZEffect.TabIndex = 80;
//
// CB_AfflictRefresh
//
this.CB_AfflictRefresh.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CB_AfflictRefresh.DropDownWidth = 130;
this.CB_AfflictRefresh.FormattingEnabled = true;
this.CB_AfflictRefresh.Location = new System.Drawing.Point(227, 261);
this.CB_AfflictRefresh.Name = "CB_AfflictRefresh";
this.CB_AfflictRefresh.Size = new System.Drawing.Size(95, 21);
this.CB_AfflictRefresh.TabIndex = 81;
//
// L_Refresh
//
this.L_Refresh.AutoSize = true;
this.L_Refresh.Location = new System.Drawing.Point(229, 245);
this.L_Refresh.Name = "L_Refresh";
this.L_Refresh.Size = new System.Drawing.Size(76, 13);
this.L_Refresh.TabIndex = 82;
this.L_Refresh.Text = "Afflict Refresh:";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(229, 286);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 13);
this.label1.TabIndex = 83;
this.label1.Text = "Percent:";
//
// MoveEditor7
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(439, 381);
this.ClientSize = new System.Drawing.Size(439, 427);
this.Controls.Add(this.label1);
this.Controls.Add(this.L_Refresh);
this.Controls.Add(this.CB_AfflictRefresh);
this.Controls.Add(this.CB_ZEffect);
this.Controls.Add(this.L_ZEffect);
this.Controls.Add(this.L_ZPower);
this.Controls.Add(this.NUD_ZEffect);
this.Controls.Add(this.L_ZMove);
this.Controls.Add(this.CB_ZMove);
this.Controls.Add(this.NUD_ZUnk);
this.Controls.Add(this.NUD_ZPercent);
this.Controls.Add(this.NUD_RefreshAfflictPercent);
this.Controls.Add(this.NUD_ZPower);
this.Controls.Add(this.CLB_Flags);
this.Controls.Add(this.B_Table);
@ -972,9 +985,8 @@ private void InitializeComponent()
this.Controls.Add(this.L_Max);
this.Controls.Add(this.L_Move);
this.Controls.Add(this.CB_Move);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(455, 420);
this.MinimumSize = new System.Drawing.Size(355, 420);
this.Name = "MoveEditor7";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Move Editor";
@ -1005,9 +1017,7 @@ private void InitializeComponent()
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_ZPower)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_ZPercent)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_ZUnk)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_ZEffect)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_RefreshAfflictPercent)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -1079,12 +1089,14 @@ private void InitializeComponent()
private System.Windows.Forms.Button B_Table;
private System.Windows.Forms.CheckedListBox CLB_Flags;
private System.Windows.Forms.NumericUpDown NUD_ZPower;
private System.Windows.Forms.NumericUpDown NUD_ZPercent;
private System.Windows.Forms.NumericUpDown NUD_ZUnk;
private System.Windows.Forms.NumericUpDown NUD_RefreshAfflictPercent;
private System.Windows.Forms.ComboBox CB_ZMove;
private System.Windows.Forms.Label L_ZMove;
private System.Windows.Forms.NumericUpDown NUD_ZEffect;
private System.Windows.Forms.Label L_ZPower;
private System.Windows.Forms.Label L_ZEffect;
private System.Windows.Forms.ComboBox CB_ZEffect;
private System.Windows.Forms.ComboBox CB_AfflictRefresh;
private System.Windows.Forms.Label L_Refresh;
private System.Windows.Forms.Label label1;
}
}

View File

@ -25,15 +25,17 @@ public MoveEditor7(byte[][] infiles)
private readonly string[] MoveCategories = { "Status", "Physical", "Special", };
private readonly string[] StatCategories = { "None", "Attack", "Defense", "Special Attack", "Special Defense", "Speed", "Accuracy", "Evasion", "All", };
private readonly string[] TargetingTypes =
{ "Single Adjacent Ally/Foe",
private static readonly string[] TargetingTypes =
{
"Single Adjacent Ally/Foe",
"Any Ally", "Any Adjacent Ally", "Single Adjacent Foe", "Everyone but User", "All Foes",
"All Allies", "Self", "All Pokémon on Field", "Single Adjacent Foe (2)", "Entire Field",
"Opponent's Field", "User's Field", "Self",
};
private readonly string[] InflictionTypes =
{ "None",
private static readonly string[] InflictionTypes =
{
"None",
"Paralyze", "Sleep", "Freeze", "Burn", "Poison",
"Confusion", "Attract", "Capture", "Nightmare", "Curse",
"Taunt", "Torment", "Disable", "Yawn", "Heal Block",
@ -41,26 +43,70 @@ public MoveEditor7(byte[][] infiles)
"Ingrain", "??? 0x16", "??? 0x17", "Mute"
};
private readonly string[] MoveQualities =
{ "Only DMG",
private static readonly string[] MoveQualities =
{
"Only DMG",
"No DMG -> Inflict Status", "No DMG -> -Target/+User Stat", "No DMG | Heal User", "DMG | Inflict Status", "No DMG | STATUS | +Target Stat",
"DMG | -Target Stat", "DMG | +User Stat", "DMG | Absorbs DMG", "One-Hit KO", "Affects Whole Field",
"Affect One Side of the Field", "Forces Target to Switch", "Unique Effect", };
"Affect One Side of the Field", "Forces Target to Switch", "Unique Effect",
};
private static readonly string[] ZMoveEffects =
{
"None",
"+1 Attack",
"+2 Attack",
"+3 Attack",
"+1 Defense",
"+2 Defense",
"+3 Defense",
"+1 Special Attack",
"+2 Special Attack",
"+3 Special Attack",
"+1 Special Defense",
"+2 Special Defense",
"+3 Special Defense",
"+1 Speed",
"+2 Speed",
"+3 Speed",
"+1 Accuracy",
"+2 Accuracy",
"+3 Accuracy",
"+1 Evasiveness",
"+2 Evasiveness",
"+3 Evasiveness",
"+1 to all (except Accuracy or Evasiveness)",
"+2 to all (except Accuracy or Evasiveness)",
"+3 to all (except Accuracy or Evasiveness)",
"raises critical-hit ratio two stages",
"resets lowered stats of the user",
"recovers all of user's HP",
"recovers all Hp of the Pokémon switching-in (Memento and Parting Shot)",
"makes the user the center of attention",
"only on Curse: recovers all HP if the user's a Ghost type, +1 Attack otherwise"
};
private void Setup()
{
foreach (string s in movelist) CB_Move.Items.Add(s);
foreach (string s in types) CB_Type.Items.Add(s);
foreach (string s in MoveCategories) CB_Category.Items.Add(s);
foreach (string s in StatCategories) CB_Stat1.Items.Add(s);
foreach (string s in StatCategories) CB_Stat2.Items.Add(s);
foreach (string s in StatCategories) CB_Stat3.Items.Add(s);
foreach (string s in TargetingTypes) CB_Targeting.Items.Add(s);
foreach (string s in MoveQualities) CB_Quality.Items.Add(s);
foreach (string s in InflictionTypes) CB_Inflict.Items.Add(s);
foreach (string s in movelist) CB_ZMove.Items.Add(s);
foreach (var s in Enum.GetNames(typeof(MoveFlag7)).Skip(1)) CLB_Flags.Items.Add(s);
char[] ps = { 'P', 'S' }; // Distinguish Physical/Special Z-Moves
for (int i = 622; i < 658; i++)
movelist[i] += $" ({ps[i % 2]})";
CB_Move.Items.AddRange(movelist);
CB_Type.Items.AddRange(types);
CB_Category.Items.AddRange(MoveCategories);
CB_Stat1.Items.AddRange(StatCategories);
CB_Stat2.Items.AddRange(StatCategories);
CB_Stat3.Items.AddRange(StatCategories);
CB_Targeting.Items.AddRange(TargetingTypes);
CB_Quality.Items.AddRange(MoveQualities);
CB_Inflict.Items.AddRange(InflictionTypes);
CB_ZMove.Items.AddRange(movelist);
var flagnames = Enum.GetNames(typeof(MoveFlag7)).Skip(1).ToArray();
CLB_Flags.Items.AddRange(flagnames);
CB_ZEffect.Items.AddRange(ZMoveEffects);
CB_Inflict.Items.Add("Special");
var refreshtypes = Enum.GetNames(typeof(RefreshType));
CB_AfflictRefresh.Items.AddRange(refreshtypes);
CB_Move.Items.RemoveAt(0);
CB_Move.SelectedIndex = 0;
@ -70,7 +116,7 @@ private void Setup()
private void ChangeEntry(object sender, EventArgs e)
{
setEntry();
SetEntry();
entry = Array.IndexOf(movelist, CB_Move.Text);
GetEntry();
}
@ -117,9 +163,9 @@ private void GetEntry()
var move = new Move7(data);
CB_ZMove.SelectedIndex = move.ZMove;
NUD_ZPower.Value = move.ZPower;
NUD_ZEffect.Value = move.ZEffect;
NUD_ZPercent.Value = move.ZPercent;
NUD_ZUnk.Value = move.Z3;
CB_ZEffect.SelectedIndex = move.ZEffect;
CB_AfflictRefresh.SelectedIndex = (int)move.RefreshAfflictType;
NUD_RefreshAfflictPercent.Value = move.RefreshAfflictPercent;
var flags = (uint)move.Flags;
for (int i = 0; i < CLB_Flags.Items.Count; i++)
@ -127,7 +173,7 @@ private void GetEntry()
}
}
private void setEntry()
private void SetEntry()
{
if (entry < 1) return;
byte[] data = files[entry];
@ -166,9 +212,9 @@ private void setEntry()
{
ZMove = CB_ZMove.SelectedIndex,
ZPower = (int) NUD_ZPower.Value,
ZEffect = (int) NUD_ZEffect.Value,
ZPercent = (int) NUD_ZPercent.Value,
Z3 = (int) NUD_ZUnk.Value
ZEffect = CB_ZEffect.SelectedIndex,
RefreshAfflictPercent = (int) NUD_RefreshAfflictPercent.Value,
RefreshAfflictType = (RefreshType)CB_AfflictRefresh.SelectedIndex
};
uint flagval = 0;
@ -181,7 +227,7 @@ private void setEntry()
private void CloseForm(object sender, FormClosingEventArgs e)
{
setEntry();
SetEntry();
RandSettings.SetFormSettings(this, groupBox1.Controls);
}