Add G7BattleTree Supers Unlock

Not checked for legality(e.g.MaxStreaks)
This commit is contained in:
pokecal 2017-03-27 10:15:07 +09:00
parent a3408b37f1
commit f69e4a0c81
3 changed files with 72 additions and 3 deletions

View file

@ -139,6 +139,10 @@ namespace PKHeX.WinForms
this.L_Z = new System.Windows.Forms.Label(); this.L_Z = new System.Windows.Forms.Label();
this.L_X = new System.Windows.Forms.Label(); this.L_X = new System.Windows.Forms.Label();
this.Tab_BattleTree = new System.Windows.Forms.TabPage(); this.Tab_BattleTree = new System.Windows.Forms.TabPage();
this.GB_UnlockSupers = new System.Windows.Forms.GroupBox();
this.CHK_UnlockSuperMulti = new System.Windows.Forms.CheckBox();
this.CHK_UnlockSuperDoubles = new System.Windows.Forms.CheckBox();
this.CHK_UnlockSuperSingles = new System.Windows.Forms.CheckBox();
this.L_Super = new System.Windows.Forms.Label(); this.L_Super = new System.Windows.Forms.Label();
this.L_Regular = new System.Windows.Forms.Label(); this.L_Regular = new System.Windows.Forms.Label();
this.NUD_SMStreak2 = new System.Windows.Forms.NumericUpDown(); this.NUD_SMStreak2 = new System.Windows.Forms.NumericUpDown();
@ -202,6 +206,7 @@ namespace PKHeX.WinForms
((System.ComponentModel.ISupportInitialize)(this.NUD_Y)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Y)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_X)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_X)).BeginInit();
this.Tab_BattleTree.SuspendLayout(); this.Tab_BattleTree.SuspendLayout();
this.GB_UnlockSupers.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_SMStreak2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_SMStreak2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_SCStreak2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_SCStreak2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_SMStreak1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_SMStreak1)).BeginInit();
@ -1294,6 +1299,7 @@ namespace PKHeX.WinForms
// //
// Tab_BattleTree // Tab_BattleTree
// //
this.Tab_BattleTree.Controls.Add(this.GB_UnlockSupers);
this.Tab_BattleTree.Controls.Add(this.L_Super); this.Tab_BattleTree.Controls.Add(this.L_Super);
this.Tab_BattleTree.Controls.Add(this.L_Regular); this.Tab_BattleTree.Controls.Add(this.L_Regular);
this.Tab_BattleTree.Controls.Add(this.NUD_SMStreak2); this.Tab_BattleTree.Controls.Add(this.NUD_SMStreak2);
@ -1322,6 +1328,48 @@ namespace PKHeX.WinForms
this.Tab_BattleTree.Text = "Battle Tree"; this.Tab_BattleTree.Text = "Battle Tree";
this.Tab_BattleTree.UseVisualStyleBackColor = true; this.Tab_BattleTree.UseVisualStyleBackColor = true;
// //
// GB_UnlockSupers
//
this.GB_UnlockSupers.Controls.Add(this.CHK_UnlockSuperMulti);
this.GB_UnlockSupers.Controls.Add(this.CHK_UnlockSuperDoubles);
this.GB_UnlockSupers.Controls.Add(this.CHK_UnlockSuperSingles);
this.GB_UnlockSupers.Location = new System.Drawing.Point(6, 240);
this.GB_UnlockSupers.Name = "GB_UnlockSupers";
this.GB_UnlockSupers.Size = new System.Drawing.Size(199, 40);
this.GB_UnlockSupers.TabIndex = 95;
this.GB_UnlockSupers.TabStop = false;
this.GB_UnlockSupers.Text = "Unlock Super*";
//
// CHK_UnlockSuperMulti
//
this.CHK_UnlockSuperMulti.AutoSize = true;
this.CHK_UnlockSuperMulti.Location = new System.Drawing.Point(144, 18);
this.CHK_UnlockSuperMulti.Name = "CHK_UnlockSuperMulti";
this.CHK_UnlockSuperMulti.Size = new System.Drawing.Size(49, 16);
this.CHK_UnlockSuperMulti.TabIndex = 2;
this.CHK_UnlockSuperMulti.Text = "Multi";
this.CHK_UnlockSuperMulti.UseVisualStyleBackColor = true;
//
// CHK_UnlockSuperDoubles
//
this.CHK_UnlockSuperDoubles.AutoSize = true;
this.CHK_UnlockSuperDoubles.Location = new System.Drawing.Point(73, 18);
this.CHK_UnlockSuperDoubles.Name = "CHK_UnlockSuperDoubles";
this.CHK_UnlockSuperDoubles.Size = new System.Drawing.Size(65, 16);
this.CHK_UnlockSuperDoubles.TabIndex = 1;
this.CHK_UnlockSuperDoubles.Text = "Doubles";
this.CHK_UnlockSuperDoubles.UseVisualStyleBackColor = true;
//
// CHK_UnlockSuperSingles
//
this.CHK_UnlockSuperSingles.AutoSize = true;
this.CHK_UnlockSuperSingles.Location = new System.Drawing.Point(6, 18);
this.CHK_UnlockSuperSingles.Name = "CHK_UnlockSuperSingles";
this.CHK_UnlockSuperSingles.Size = new System.Drawing.Size(61, 16);
this.CHK_UnlockSuperSingles.TabIndex = 0;
this.CHK_UnlockSuperSingles.Text = "Singles";
this.CHK_UnlockSuperSingles.UseVisualStyleBackColor = true;
//
// L_Super // L_Super
// //
this.L_Super.Location = new System.Drawing.Point(243, 37); this.L_Super.Location = new System.Drawing.Point(243, 37);
@ -1964,6 +2012,8 @@ namespace PKHeX.WinForms
((System.ComponentModel.ISupportInitialize)(this.NUD_Y)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Y)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_X)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_X)).EndInit();
this.Tab_BattleTree.ResumeLayout(false); this.Tab_BattleTree.ResumeLayout(false);
this.GB_UnlockSupers.ResumeLayout(false);
this.GB_UnlockSupers.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_SMStreak2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_SMStreak2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_SCStreak2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_SCStreak2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_SMStreak1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_SMStreak1)).EndInit();
@ -2148,5 +2198,9 @@ namespace PKHeX.WinForms
private System.Windows.Forms.ListBox LB_BallThrowTypeLearned; private System.Windows.Forms.ListBox LB_BallThrowTypeLearned;
private System.Windows.Forms.Label L_Stamps; private System.Windows.Forms.Label L_Stamps;
private System.Windows.Forms.ListBox LB_Stamps; private System.Windows.Forms.ListBox LB_Stamps;
private System.Windows.Forms.GroupBox GB_UnlockSupers;
private System.Windows.Forms.CheckBox CHK_UnlockSuperMulti;
private System.Windows.Forms.CheckBox CHK_UnlockSuperDoubles;
private System.Windows.Forms.CheckBox CHK_UnlockSuperSingles;
} }
} }

View file

@ -225,6 +225,10 @@ namespace PKHeX.WinForms
for (int i = 0; i < LB_Stamps.Items.Count; i++) for (int i = 0; i < LB_Stamps.Items.Count; i++)
LB_Stamps.SetSelected(i, (stampBits & (1 << i)) != 0); LB_Stamps.SetSelected(i, (stampBits & (1 << i)) != 0);
byte btsu = SAV.BattleTreeSuperUnlocked;
CHK_UnlockSuperSingles.Checked = (btsu & 1) != 0;
CHK_UnlockSuperDoubles.Checked = (btsu & (1 << 1)) != 0;
CHK_UnlockSuperMulti.Checked = (btsu & (1 << 2)) != 0;
} }
private void save() private void save()
{ {
@ -334,6 +338,11 @@ namespace PKHeX.WinForms
stampBits += (uint)(1 << i); stampBits += (uint)(1 << i);
} }
SAV.Stamps = stampBits; SAV.Stamps = stampBits;
byte btsu = 0;
if (CHK_UnlockSuperSingles.Checked) btsu |= 1;
if (CHK_UnlockSuperDoubles.Checked) btsu |= (1 << 1);
if (CHK_UnlockSuperMulti.Checked) btsu |= (1 << 2);
SAV.BattleTreeSuperUnlocked = btsu;
} }
private void clickOT(object sender, MouseEventArgs e) private void clickOT(object sender, MouseEventArgs e)

View file

@ -1284,11 +1284,12 @@ namespace PKHeX.Core
} }
public byte BallThrowTypeUnlocked public byte BallThrowTypeUnlocked
{ {
get { return (byte)(((Data[0x23F5] & 0x0F) << 4) | ((Data[0x23F4] & 0xC0) >> 4)); } get { return (byte)(((BitConverter.ToUInt16(Data, 0x23F4) << 4) >> 10) << 2); }
set set
{ {
Data[0x23F4] = (byte)((Data[0x23F4] & 0x3F) | ((value & 0x0C) << 4)); ushort flags = (ushort)(BitConverter.ToUInt16(Data, 0x23F4) & 0xF03F);
Data[0x23F5] = (byte)((Data[0x23F5] & 0xF0) | ((value & 0xF0) >> 4)); flags |= (ushort)((value & 0xFC) << 4);
BitConverter.GetBytes(flags).CopyTo(Data, 0x23F4);
} }
} }
public byte BallThrowTypeLearned public byte BallThrowTypeLearned
@ -1296,6 +1297,11 @@ namespace PKHeX.Core
get { return (byte)((Data[0x2583] & 0x7F) << 1); } get { return (byte)((Data[0x2583] & 0x7F) << 1); }
set { Data[0x2583] = (byte)((Data[0x2583] & 0x80) | ((value & 0xFE) >> 1)); } set { Data[0x2583] = (byte)((Data[0x2583] & 0x80) | ((value & 0xFE) >> 1)); }
} }
public byte BattleTreeSuperUnlocked
{
get { return (byte)(Data[0x23F9] >> 5); }
set { Data[0x23F9] = (byte)((Data[0x23F9] & 0x1F) | ((value & 0x07) << 5)); }
}
public override bool RequiresMemeCrypto => true; public override bool RequiresMemeCrypto => true;
} }