set noah3 HP option to off by default, add Ignore side chapter option

rabi_display
Copy Liu 8 years ago
parent 64f7f0b1c2
commit 1c47a1b4da
No known key found for this signature in database
GPG Key ID: 63A453DBF23409AF
  1. 70
      rabiribi_splitter/Form1.Designer.cs
  2. 99
      rabiribi_splitter/Form1.cs

@ -44,8 +44,10 @@
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.t1 = new System.Windows.Forms.Label();
this.t2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.cbSideCh = new System.Windows.Forms.CheckBox();
this.debugLog = new System.Windows.Forms.TextBox();
this.debugArea = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.portNum)).BeginInit();
this.SuspendLayout();
//
@ -129,7 +131,7 @@
//
this.musicLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.musicLabel.AutoSize = true;
this.musicLabel.Location = new System.Drawing.Point(13, 172);
this.musicLabel.Location = new System.Drawing.Point(13, 195);
this.musicLabel.Name = "musicLabel";
this.musicLabel.Size = new System.Drawing.Size(41, 12);
this.musicLabel.TabIndex = 14;
@ -140,7 +142,7 @@
this.cbBoss.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.cbBoss.AutoSize = true;
this.cbBoss.Enabled = false;
this.cbBoss.Location = new System.Drawing.Point(15, 187);
this.cbBoss.Location = new System.Drawing.Point(15, 210);
this.cbBoss.Name = "cbBoss";
this.cbBoss.Size = new System.Drawing.Size(84, 16);
this.cbBoss.TabIndex = 15;
@ -154,9 +156,9 @@
this.cbComputer.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbComputer.Location = new System.Drawing.Point(15, 97);
this.cbComputer.Name = "cbComputer";
this.cbComputer.Size = new System.Drawing.Size(192, 16);
this.cbComputer.Size = new System.Drawing.Size(216, 16);
this.cbComputer.TabIndex = 16;
this.cbComputer.Text = "Split when find the computer";
this.cbComputer.Text = "Split when the computer is found";
this.cbComputer.UseVisualStyleBackColor = true;
//
// cbBoss1
@ -174,8 +176,6 @@
// cbBoss3
//
this.cbBoss3.AutoSize = true;
this.cbBoss3.Checked = true;
this.cbBoss3.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbBoss3.Location = new System.Drawing.Point(15, 141);
this.cbBoss3.Name = "cbBoss3";
this.cbBoss3.Size = new System.Drawing.Size(276, 16);
@ -187,7 +187,7 @@
//
this.linkLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(301, 191);
this.linkLabel1.Location = new System.Drawing.Point(300, 214);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(41, 12);
this.linkLabel1.TabIndex = 20;
@ -212,32 +212,58 @@
this.t2.TabIndex = 22;
this.t2.Text = "label4";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(500, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(59, 12);
this.label1.TabIndex = 23;
this.label1.Text = "DebugArea";
//
// label4
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(253, 191);
this.label4.Location = new System.Drawing.Point(252, 214);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(41, 12);
this.label4.TabIndex = 24;
this.label4.Text = "v0.0.3";
//
// cbSideCh
//
this.cbSideCh.AutoSize = true;
this.cbSideCh.Checked = true;
this.cbSideCh.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbSideCh.Location = new System.Drawing.Point(15, 163);
this.cbSideCh.Name = "cbSideCh";
this.cbSideCh.Size = new System.Drawing.Size(138, 16);
this.cbSideCh.TabIndex = 25;
this.cbSideCh.Text = "Ignore side chapter";
this.cbSideCh.UseVisualStyleBackColor = true;
//
// debugLog
//
this.debugLog.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.debugLog.Location = new System.Drawing.Point(402, 163);
this.debugLog.Multiline = true;
this.debugLog.Name = "debugLog";
this.debugLog.Size = new System.Drawing.Size(0, 43);
this.debugLog.TabIndex = 26;
//
// debugArea
//
this.debugArea.AutoSize = true;
this.debugArea.Location = new System.Drawing.Point(500, 14);
this.debugArea.Name = "debugArea";
this.debugArea.Size = new System.Drawing.Size(78, 16);
this.debugArea.TabIndex = 27;
this.debugArea.Text = "debugArea";
this.debugArea.UseVisualStyleBackColor = true;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(354, 215);
this.ClientSize = new System.Drawing.Size(353, 238);
this.Controls.Add(this.debugArea);
this.Controls.Add(this.debugLog);
this.Controls.Add(this.cbSideCh);
this.Controls.Add(this.label4);
this.Controls.Add(this.label1);
this.Controls.Add(this.t2);
this.Controls.Add(this.t1);
this.Controls.Add(this.linkLabel1);
@ -278,8 +304,10 @@
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Label t1;
private System.Windows.Forms.Label t2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.CheckBox cbSideCh;
private System.Windows.Forms.TextBox debugLog;
private System.Windows.Forms.CheckBox debugArea;
}
}

@ -32,6 +32,20 @@ namespace rabiribi_splitter
private List<int> lastbosslist = new List<int>();
private int lastnoah3hp = -1;
void DebugLog(string log)
{
if (this.InvokeRequired)
{
this.Invoke(new Action(() =>
{
this.debugLog.AppendText(log + "\n");
}));
}
else
{
this.debugLog.AppendText(log + "\n");
}
}
public Form1()
{
InitializeComponent();
@ -107,6 +121,9 @@ namespace rabiribi_splitter
if (veridx < 0) return;
#region CheckMoney
if (cbComputer.Checked)
@ -122,6 +139,10 @@ namespace rabiribi_splitter
#endregion
int mapid = MemoryHelper.GetMemoryValue<int>(process, StaticData.MapAddress[veridx]);
#region Music
int musicaddr = StaticData.MusicAddr[veridx];
@ -130,7 +151,7 @@ namespace rabiribi_splitter
{
if (lastmusicid != musicid)
{
Console.WriteLine("new music:"+musicid);
DebugLog("new music:"+musicid);
this.Invoke(new Action(() => this.musicLabel.Text = StaticData.MusicNames[musicid]));
var bossmusicflag = StaticData.BossMusics.Contains(musicid);
@ -142,7 +163,7 @@ namespace rabiribi_splitter
if (cbBossStart.Checked || cbBossEnd.Checked)
{
sendsplit();
Console.WriteLine("splilt 1");
DebugLog("splilt 1");
}
this.Invoke(new Action(() => cbBoss.Checked = bossbattle));
@ -152,15 +173,23 @@ namespace rabiribi_splitter
}
if (!bossbattle)
{
if (bossmusicflag) //boss music start!
if (mapid == 5 && cbSideCh.Checked)
{
bossbattle = false;
}
else
{
bossbattle = true;
lastbosslist = new List<int>();
lastnoah3hp = -1;
if (cbBossStart.Checked)
if (bossmusicflag)
{
sendsplit();
Console.WriteLine("splilt 2");
bossbattle = true;
lastbosslist = new List<int>();
lastnoah3hp = -1;
if (cbBossStart.Checked)
{
sendsplit();
DebugLog("splilt 2");
}
}
}
}
@ -172,7 +201,7 @@ namespace rabiribi_splitter
if (cbBossEnd.Checked)
{
sendsplit();
Console.WriteLine("splilt 3");
DebugLog("splilt 3");
}
}
}
@ -194,7 +223,7 @@ namespace rabiribi_splitter
if (cbBoss1.Checked || cbBoss3.Checked)
{
int Noah3HP = -1;
int mapid = MemoryHelper.GetMemoryValue<int>(process, StaticData.MapAddress[veridx]);
if (mapid >= 0 && mapid < StaticData.MapNames.Length)
{
int ptr = MemoryHelper.GetMemoryValue<int>(process, StaticData.EnenyPtrAddr[veridx]);
@ -227,6 +256,7 @@ namespace rabiribi_splitter
if (!bosses.Contains(boss)) //despawn
{
sendsplit();
DebugLog("split:4");
bossbattle = false;
}
@ -239,6 +269,7 @@ namespace rabiribi_splitter
if (bosses.Contains(1053) && Noah3HP < lastnoah3hp && Noah3HP == 1)
{
sendsplit();
DebugLog("split:5");
bossbattle = false;
}
}
@ -255,30 +286,30 @@ namespace rabiribi_splitter
#endregion SpecialBOSS
if (debugArea.Checked)
{
int ptr = MemoryHelper.GetMemoryValue<int>(process, StaticData.EnenyPtrAddr[veridx]);
List<int> bosses = new List<int>();
List<int> HPS = new List<int>();
for (var i = 0; i < 5; i++)
{
ptr += StaticData.EnenyEntitySize[veridx];
// {
// int ptr = MemoryHelper.GetMemoryValue<int>(process, StaticData.EnenyPtrAddr[veridx]);
// List<int> bosses = new List<int>();
// List<int> HPS = new List<int>();
// for (var i = 0; i < 50; i++)
// {
// ptr += StaticData.EnenyEntitySize[veridx];
//
//
// bosses.Add(MemoryHelper.GetMemoryValue<int>(process,
// ptr + StaticData.EnenyEnitiyIDOffset[veridx], false));
// HPS.Add(MemoryHelper.GetMemoryValue<int>(process,
// ptr + StaticData.EnenyEnitiyHPOffset[veridx], false));
//
//
// this.Invoke(new Action(() =>
// {
// t1.Text = string.Join("\n", bosses);
// t2.Text = string.Join("\n", HPS);
// }));
//
// }
// }
bosses.Add(MemoryHelper.GetMemoryValue<int>(process,
ptr + StaticData.EnenyEnitiyIDOffset[veridx], false));
HPS.Add(MemoryHelper.GetMemoryValue<int>(process,
ptr + StaticData.EnenyEnitiyHPOffset[veridx], false));
this.Invoke(new Action(() =>
{
t1.Text = string.Join("\n", bosses);
t2.Text = string.Join("\n", HPS);
}));
}
}
this.Invoke(new Action(() => cbBoss.Checked = bossbattle));
}
else

Loading…
Cancel
Save