diff --git a/.vs/DW3Randomizer/v15/.suo b/.vs/DW3Randomizer/v15/.suo new file mode 100644 index 0000000..1642204 Binary files /dev/null and b/.vs/DW3Randomizer/v15/.suo differ diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..768a5fc --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,7 @@ +{ + "ExpandedNodes": [ + "", + "\\DW3Randomizer" + ], + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..340c952 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/DW3Randomizer/.vs/DW3Randomizer/v15/.suo b/DW3Randomizer/.vs/DW3Randomizer/v15/.suo new file mode 100644 index 0000000..4b4f4c1 Binary files /dev/null and b/DW3Randomizer/.vs/DW3Randomizer/v15/.suo differ diff --git a/DW3Randomizer/DW3Randomizer.sln b/DW3Randomizer/DW3Randomizer.sln new file mode 100644 index 0000000..a36d74c --- /dev/null +++ b/DW3Randomizer/DW3Randomizer.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26228.9 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DW3Randomizer", "DW3Randomizer.csproj", "{425A4055-0EF6-450F-B5B8-1BF910496D54}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {425A4055-0EF6-450F-B5B8-1BF910496D54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {425A4055-0EF6-450F-B5B8-1BF910496D54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {425A4055-0EF6-450F-B5B8-1BF910496D54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {425A4055-0EF6-450F-B5B8-1BF910496D54}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DW3Randomizer/Form1.Designer.cs b/DW3Randomizer/Form1.Designer.cs index 4ef5207..95f7602 100644 --- a/DW3Randomizer/Form1.Designer.cs +++ b/DW3Randomizer/Form1.Designer.cs @@ -35,37 +35,14 @@ private void InitializeComponent() this.lblSHAChecksum = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.lblReqChecksum = new System.Windows.Forms.Label(); - this.chkHalfExpGoldReq = new System.Windows.Forms.CheckBox(); this.btnRandomize = new System.Windows.Forms.Button(); this.btnCompare = new System.Windows.Forms.Button(); this.txtSeed = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); - this.chkDoubleXP = new System.Windows.Forms.CheckBox(); this.btnCompareBrowse = new System.Windows.Forms.Button(); this.label5 = new System.Windows.Forms.Label(); this.txtCompare = new System.Windows.Forms.TextBox(); this.btnNewSeed = new System.Windows.Forms.Button(); - this.label6 = new System.Windows.Forms.Label(); - this.txtDefault1 = new System.Windows.Forms.TextBox(); - this.txtDefault4 = new System.Windows.Forms.TextBox(); - this.txtDefault5 = new System.Windows.Forms.TextBox(); - this.txtDefault6 = new System.Windows.Forms.TextBox(); - this.txtDefault7 = new System.Windows.Forms.TextBox(); - this.txtDefault8 = new System.Windows.Forms.TextBox(); - this.txtDefault9 = new System.Windows.Forms.TextBox(); - this.txtDefault12 = new System.Windows.Forms.TextBox(); - this.txtDefault11 = new System.Windows.Forms.TextBox(); - this.txtDefault10 = new System.Windows.Forms.TextBox(); - this.txtDefault3 = new System.Windows.Forms.TextBox(); - this.txtDefault2 = new System.Windows.Forms.TextBox(); - this.chkRandStores = new System.Windows.Forms.CheckBox(); - this.chkRandEnemyPatterns = new System.Windows.Forms.CheckBox(); - this.chkRandMonsterZones = new System.Windows.Forms.CheckBox(); - this.chkRandEquip = new System.Windows.Forms.CheckBox(); - this.chkRandSpellLearning = new System.Windows.Forms.CheckBox(); - this.chkRandSpellStrength = new System.Windows.Forms.CheckBox(); - this.chkRandTreasures = new System.Windows.Forms.CheckBox(); - this.chkRandStatGains = new System.Windows.Forms.CheckBox(); this.lblIntensityDesc = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.grpMonsterStat = new System.Windows.Forms.GroupBox(); @@ -73,32 +50,78 @@ private void InitializeComponent() this.optMonsterHeavy = new System.Windows.Forms.RadioButton(); this.optMonsterMedium = new System.Windows.Forms.RadioButton(); this.optMonsterLight = new System.Windows.Forms.RadioButton(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.chkRandomizeGP = new System.Windows.Forms.CheckBox(); + this.chkRandomizeXP = new System.Windows.Forms.CheckBox(); + this.label10 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.cboEncounterRate = new System.Windows.Forms.ComboBox(); + this.cboGoldReq = new System.Windows.Forms.ComboBox(); + this.cboExpGains = new System.Windows.Forms.ComboBox(); + this.chkSpeedText = new System.Windows.Forms.CheckBox(); + this.chkFasterBattles = new System.Windows.Forms.CheckBox(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.chkRandomizeMap = new System.Windows.Forms.CheckBox(); + this.chkRandWhoCanEquip = new System.Windows.Forms.CheckBox(); + this.chkRandItemEffects = new System.Windows.Forms.CheckBox(); this.chkSmallMap = new System.Windows.Forms.CheckBox(); + this.chkRandStatGains = new System.Windows.Forms.CheckBox(); + this.chkRandTreasures = new System.Windows.Forms.CheckBox(); + this.chkRandSpellStrength = new System.Windows.Forms.CheckBox(); + this.chkRandSpellLearning = new System.Windows.Forms.CheckBox(); + this.chkRandEquip = new System.Windows.Forms.CheckBox(); + this.chkRandMonsterZones = new System.Windows.Forms.CheckBox(); + this.chkRandEnemyPatterns = new System.Windows.Forms.CheckBox(); + this.chkRandStores = new System.Windows.Forms.CheckBox(); + this.tabPage3 = new System.Windows.Forms.TabPage(); + this.txtDefault2 = new System.Windows.Forms.TextBox(); + this.txtDefault3 = new System.Windows.Forms.TextBox(); + this.txtDefault10 = new System.Windows.Forms.TextBox(); + this.txtDefault11 = new System.Windows.Forms.TextBox(); + this.txtDefault12 = new System.Windows.Forms.TextBox(); + this.txtDefault9 = new System.Windows.Forms.TextBox(); + this.txtDefault8 = new System.Windows.Forms.TextBox(); + this.txtDefault7 = new System.Windows.Forms.TextBox(); + this.txtDefault6 = new System.Windows.Forms.TextBox(); + this.txtDefault5 = new System.Windows.Forms.TextBox(); + this.txtDefault4 = new System.Windows.Forms.TextBox(); + this.txtDefault1 = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.txtFlags = new System.Windows.Forms.TextBox(); this.grpMonsterStat.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.tabPage3.SuspendLayout(); this.SuspendLayout(); // // txtFileName // - this.txtFileName.Location = new System.Drawing.Point(122, 23); + this.txtFileName.Location = new System.Drawing.Point(178, 35); + this.txtFileName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtFileName.Name = "txtFileName"; - this.txtFileName.Size = new System.Drawing.Size(320, 20); + this.txtFileName.Size = new System.Drawing.Size(478, 26); this.txtFileName.TabIndex = 0; this.txtFileName.Leave += new System.EventHandler(this.txtFileName_Leave); // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 23); + this.label1.Location = new System.Drawing.Point(25, 35); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(92, 13); + this.label1.Size = new System.Drawing.Size(135, 20); this.label1.TabIndex = 1; this.label1.Text = "DW3 ROM Image"; // // btnBrowse // - this.btnBrowse.Location = new System.Drawing.Point(448, 21); + this.btnBrowse.Location = new System.Drawing.Point(672, 32); + this.btnBrowse.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnBrowse.Name = "btnBrowse"; - this.btnBrowse.Size = new System.Drawing.Size(75, 23); + this.btnBrowse.Size = new System.Drawing.Size(112, 35); this.btnBrowse.TabIndex = 1; this.btnBrowse.Text = "Browse"; this.btnBrowse.UseVisualStyleBackColor = true; @@ -107,56 +130,49 @@ private void InitializeComponent() // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 78); + this.label2.Location = new System.Drawing.Point(25, 120); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(88, 13); + this.label2.Size = new System.Drawing.Size(131, 20); this.label2.TabIndex = 3; this.label2.Text = "SHA1 Checksum"; // // lblSHAChecksum // this.lblSHAChecksum.AutoSize = true; - this.lblSHAChecksum.Location = new System.Drawing.Point(119, 78); + this.lblSHAChecksum.Location = new System.Drawing.Point(178, 120); + this.lblSHAChecksum.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblSHAChecksum.Name = "lblSHAChecksum"; - this.lblSHAChecksum.Size = new System.Drawing.Size(247, 13); + this.lblSHAChecksum.Size = new System.Drawing.Size(369, 20); this.lblSHAChecksum.TabIndex = 4; this.lblSHAChecksum.Text = "????????????????????????????????????????"; // // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(12, 102); + this.label4.Location = new System.Drawing.Point(25, 157); + this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(50, 13); + this.label4.Size = new System.Drawing.Size(74, 20); this.label4.TabIndex = 5; this.label4.Text = "Required"; // // lblReqChecksum // this.lblReqChecksum.AutoSize = true; - this.lblReqChecksum.Location = new System.Drawing.Point(119, 102); + this.lblReqChecksum.Location = new System.Drawing.Point(178, 157); + this.lblReqChecksum.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblReqChecksum.Name = "lblReqChecksum"; - this.lblReqChecksum.Size = new System.Drawing.Size(244, 13); + this.lblReqChecksum.Size = new System.Drawing.Size(363, 20); this.lblReqChecksum.TabIndex = 6; this.lblReqChecksum.Text = "a867549bad1cba4cd6f6dd51743e78596b982bd8"; // - // chkHalfExpGoldReq - // - this.chkHalfExpGoldReq.AutoSize = true; - this.chkHalfExpGoldReq.Checked = true; - this.chkHalfExpGoldReq.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkHalfExpGoldReq.Location = new System.Drawing.Point(12, 160); - this.chkHalfExpGoldReq.Name = "chkHalfExpGoldReq"; - this.chkHalfExpGoldReq.Size = new System.Drawing.Size(357, 17); - this.chkHalfExpGoldReq.TabIndex = 5; - this.chkHalfExpGoldReq.Text = "Increase experience gain by 133% and half gold requirements for items"; - this.chkHalfExpGoldReq.UseVisualStyleBackColor = true; - // // btnRandomize // - this.btnRandomize.Location = new System.Drawing.Point(448, 447); + this.btnRandomize.Location = new System.Drawing.Point(674, 568); + this.btnRandomize.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnRandomize.Name = "btnRandomize"; - this.btnRandomize.Size = new System.Drawing.Size(75, 23); + this.btnRandomize.Size = new System.Drawing.Size(112, 35); this.btnRandomize.TabIndex = 26; this.btnRandomize.Text = "Randomize!"; this.btnRandomize.UseVisualStyleBackColor = true; @@ -164,9 +180,10 @@ private void InitializeComponent() // // btnCompare // - this.btnCompare.Location = new System.Drawing.Point(448, 76); + this.btnCompare.Location = new System.Drawing.Point(672, 117); + this.btnCompare.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnCompare.Name = "btnCompare"; - this.btnCompare.Size = new System.Drawing.Size(75, 23); + this.btnCompare.Size = new System.Drawing.Size(112, 35); this.btnCompare.TabIndex = 4; this.btnCompare.Text = "Compare"; this.btnCompare.UseVisualStyleBackColor = true; @@ -174,37 +191,28 @@ private void InitializeComponent() // // txtSeed // - this.txtSeed.Location = new System.Drawing.Point(69, 327); + this.txtSeed.Location = new System.Drawing.Point(178, 238); + this.txtSeed.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtSeed.Name = "txtSeed"; - this.txtSeed.Size = new System.Drawing.Size(100, 20); + this.txtSeed.Size = new System.Drawing.Size(148, 26); this.txtSeed.TabIndex = 7; // // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(12, 329); + this.label3.Location = new System.Drawing.Point(25, 241); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(32, 13); + this.label3.Size = new System.Drawing.Size(47, 20); this.label3.TabIndex = 20; this.label3.Text = "Seed"; // - // chkDoubleXP - // - this.chkDoubleXP.AutoSize = true; - this.chkDoubleXP.Checked = true; - this.chkDoubleXP.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkDoubleXP.Location = new System.Drawing.Point(12, 183); - this.chkDoubleXP.Name = "chkDoubleXP"; - this.chkDoubleXP.Size = new System.Drawing.Size(358, 17); - this.chkDoubleXP.TabIndex = 6; - this.chkDoubleXP.Text = "XP +50% for all monsters EXCEPT metal slime/babble, less encounters"; - this.chkDoubleXP.UseVisualStyleBackColor = true; - // // btnCompareBrowse // - this.btnCompareBrowse.Location = new System.Drawing.Point(448, 47); + this.btnCompareBrowse.Location = new System.Drawing.Point(672, 72); + this.btnCompareBrowse.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnCompareBrowse.Name = "btnCompareBrowse"; - this.btnCompareBrowse.Size = new System.Drawing.Size(75, 23); + this.btnCompareBrowse.Size = new System.Drawing.Size(112, 35); this.btnCompareBrowse.TabIndex = 3; this.btnCompareBrowse.Text = "Browse"; this.btnCompareBrowse.UseVisualStyleBackColor = true; @@ -213,244 +221,48 @@ private void InitializeComponent() // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(12, 49); + this.label5.Location = new System.Drawing.Point(25, 75); + this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(94, 13); + this.label5.Size = new System.Drawing.Size(143, 20); this.label5.TabIndex = 24; this.label5.Text = "Comparison Image"; // // txtCompare // - this.txtCompare.Location = new System.Drawing.Point(122, 49); + this.txtCompare.Location = new System.Drawing.Point(178, 75); + this.txtCompare.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtCompare.Name = "txtCompare"; - this.txtCompare.Size = new System.Drawing.Size(320, 20); + this.txtCompare.Size = new System.Drawing.Size(478, 26); this.txtCompare.TabIndex = 2; // // btnNewSeed // - this.btnNewSeed.Location = new System.Drawing.Point(186, 325); + this.btnNewSeed.Location = new System.Drawing.Point(346, 235); + this.btnNewSeed.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnNewSeed.Name = "btnNewSeed"; - this.btnNewSeed.Size = new System.Drawing.Size(75, 23); + this.btnNewSeed.Size = new System.Drawing.Size(112, 35); this.btnNewSeed.TabIndex = 8; this.btnNewSeed.Text = "New Seed"; this.btnNewSeed.UseVisualStyleBackColor = true; this.btnNewSeed.Click += new System.EventHandler(this.btnNewSeed_Click); // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(12, 358); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(77, 13); - this.label6.TabIndex = 25; - this.label6.Text = "Default Names"; - // - // txtDefault1 - // - this.txtDefault1.Location = new System.Drawing.Point(95, 357); - this.txtDefault1.MaxLength = 8; - this.txtDefault1.Name = "txtDefault1"; - this.txtDefault1.Size = new System.Drawing.Size(81, 20); - this.txtDefault1.TabIndex = 9; - // - // txtDefault4 - // - this.txtDefault4.Location = new System.Drawing.Point(198, 357); - this.txtDefault4.MaxLength = 8; - this.txtDefault4.Name = "txtDefault4"; - this.txtDefault4.Size = new System.Drawing.Size(81, 20); - this.txtDefault4.TabIndex = 12; - // - // txtDefault5 - // - this.txtDefault5.Location = new System.Drawing.Point(198, 383); - this.txtDefault5.MaxLength = 8; - this.txtDefault5.Name = "txtDefault5"; - this.txtDefault5.Size = new System.Drawing.Size(81, 20); - this.txtDefault5.TabIndex = 13; - // - // txtDefault6 - // - this.txtDefault6.Location = new System.Drawing.Point(198, 410); - this.txtDefault6.MaxLength = 8; - this.txtDefault6.Name = "txtDefault6"; - this.txtDefault6.Size = new System.Drawing.Size(81, 20); - this.txtDefault6.TabIndex = 14; - // - // txtDefault7 - // - this.txtDefault7.Location = new System.Drawing.Point(301, 357); - this.txtDefault7.MaxLength = 8; - this.txtDefault7.Name = "txtDefault7"; - this.txtDefault7.Size = new System.Drawing.Size(81, 20); - this.txtDefault7.TabIndex = 15; - // - // txtDefault8 - // - this.txtDefault8.Location = new System.Drawing.Point(301, 383); - this.txtDefault8.MaxLength = 8; - this.txtDefault8.Name = "txtDefault8"; - this.txtDefault8.Size = new System.Drawing.Size(81, 20); - this.txtDefault8.TabIndex = 16; - // - // txtDefault9 - // - this.txtDefault9.Location = new System.Drawing.Point(300, 410); - this.txtDefault9.MaxLength = 8; - this.txtDefault9.Name = "txtDefault9"; - this.txtDefault9.Size = new System.Drawing.Size(81, 20); - this.txtDefault9.TabIndex = 17; - // - // txtDefault12 - // - this.txtDefault12.Location = new System.Drawing.Point(407, 410); - this.txtDefault12.MaxLength = 8; - this.txtDefault12.Name = "txtDefault12"; - this.txtDefault12.Size = new System.Drawing.Size(81, 20); - this.txtDefault12.TabIndex = 20; - // - // txtDefault11 - // - this.txtDefault11.Location = new System.Drawing.Point(407, 383); - this.txtDefault11.MaxLength = 8; - this.txtDefault11.Name = "txtDefault11"; - this.txtDefault11.Size = new System.Drawing.Size(81, 20); - this.txtDefault11.TabIndex = 19; - // - // txtDefault10 - // - this.txtDefault10.Location = new System.Drawing.Point(407, 357); - this.txtDefault10.MaxLength = 8; - this.txtDefault10.Name = "txtDefault10"; - this.txtDefault10.Size = new System.Drawing.Size(81, 20); - this.txtDefault10.TabIndex = 18; - // - // txtDefault3 - // - this.txtDefault3.Location = new System.Drawing.Point(95, 410); - this.txtDefault3.MaxLength = 8; - this.txtDefault3.Name = "txtDefault3"; - this.txtDefault3.Size = new System.Drawing.Size(81, 20); - this.txtDefault3.TabIndex = 11; - // - // txtDefault2 - // - this.txtDefault2.Location = new System.Drawing.Point(95, 383); - this.txtDefault2.MaxLength = 8; - this.txtDefault2.Name = "txtDefault2"; - this.txtDefault2.Size = new System.Drawing.Size(81, 20); - this.txtDefault2.TabIndex = 10; - // - // chkRandStores - // - this.chkRandStores.AutoSize = true; - this.chkRandStores.Checked = true; - this.chkRandStores.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRandStores.Location = new System.Drawing.Point(12, 206); - this.chkRandStores.Name = "chkRandStores"; - this.chkRandStores.Size = new System.Drawing.Size(123, 17); - this.chkRandStores.TabIndex = 27; - this.chkRandStores.Text = "Randomize all stores"; - this.chkRandStores.UseVisualStyleBackColor = true; - // - // chkRandEnemyPatterns - // - this.chkRandEnemyPatterns.AutoSize = true; - this.chkRandEnemyPatterns.Checked = true; - this.chkRandEnemyPatterns.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRandEnemyPatterns.Location = new System.Drawing.Point(12, 229); - this.chkRandEnemyPatterns.Name = "chkRandEnemyPatterns"; - this.chkRandEnemyPatterns.Size = new System.Drawing.Size(154, 17); - this.chkRandEnemyPatterns.TabIndex = 28; - this.chkRandEnemyPatterns.Text = "Randomize enemy patterns"; - this.chkRandEnemyPatterns.UseVisualStyleBackColor = true; - // - // chkRandMonsterZones - // - this.chkRandMonsterZones.AutoSize = true; - this.chkRandMonsterZones.Checked = true; - this.chkRandMonsterZones.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRandMonsterZones.Location = new System.Drawing.Point(186, 229); - this.chkRandMonsterZones.Name = "chkRandMonsterZones"; - this.chkRandMonsterZones.Size = new System.Drawing.Size(150, 17); - this.chkRandMonsterZones.TabIndex = 29; - this.chkRandMonsterZones.Text = "Randomize monster zones"; - this.chkRandMonsterZones.UseVisualStyleBackColor = true; - // - // chkRandEquip - // - this.chkRandEquip.AutoSize = true; - this.chkRandEquip.Checked = true; - this.chkRandEquip.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRandEquip.Location = new System.Drawing.Point(186, 206); - this.chkRandEquip.Name = "chkRandEquip"; - this.chkRandEquip.Size = new System.Drawing.Size(320, 17); - this.chkRandEquip.TabIndex = 30; - this.chkRandEquip.Text = "Randomize equipment power, item effects, and who can equip"; - this.chkRandEquip.UseVisualStyleBackColor = true; - // - // chkRandSpellLearning - // - this.chkRandSpellLearning.AutoSize = true; - this.chkRandSpellLearning.Checked = true; - this.chkRandSpellLearning.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRandSpellLearning.Location = new System.Drawing.Point(12, 252); - this.chkRandSpellLearning.Name = "chkRandSpellLearning"; - this.chkRandSpellLearning.Size = new System.Drawing.Size(143, 17); - this.chkRandSpellLearning.TabIndex = 31; - this.chkRandSpellLearning.Text = "Randomize spell learning"; - this.chkRandSpellLearning.UseVisualStyleBackColor = true; - // - // chkRandSpellStrength - // - this.chkRandSpellStrength.AutoSize = true; - this.chkRandSpellStrength.Checked = true; - this.chkRandSpellStrength.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRandSpellStrength.Location = new System.Drawing.Point(186, 252); - this.chkRandSpellStrength.Name = "chkRandSpellStrength"; - this.chkRandSpellStrength.Size = new System.Drawing.Size(149, 17); - this.chkRandSpellStrength.TabIndex = 32; - this.chkRandSpellStrength.Text = "Randomize spell strengths"; - this.chkRandSpellStrength.UseVisualStyleBackColor = true; - // - // chkRandTreasures - // - this.chkRandTreasures.AutoSize = true; - this.chkRandTreasures.Checked = true; - this.chkRandTreasures.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRandTreasures.Location = new System.Drawing.Point(12, 298); - this.chkRandTreasures.Name = "chkRandTreasures"; - this.chkRandTreasures.Size = new System.Drawing.Size(410, 17); - this.chkRandTreasures.TabIndex = 33; - this.chkRandTreasures.Text = "Randomize all treasures and NPCs except Sailor\'s Thigh Bone and Rainbow Drop"; - this.chkRandTreasures.UseVisualStyleBackColor = true; - // - // chkRandStatGains - // - this.chkRandStatGains.AutoSize = true; - this.chkRandStatGains.Checked = true; - this.chkRandStatGains.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRandStatGains.Location = new System.Drawing.Point(12, 275); - this.chkRandStatGains.Name = "chkRandStatGains"; - this.chkRandStatGains.Size = new System.Drawing.Size(127, 17); - this.chkRandStatGains.TabIndex = 34; - this.chkRandStatGains.Text = "Randomize stat gains"; - this.chkRandStatGains.UseVisualStyleBackColor = true; - // // lblIntensityDesc // - this.lblIntensityDesc.Location = new System.Drawing.Point(12, 452); + this.lblIntensityDesc.Location = new System.Drawing.Point(20, 575); + this.lblIntensityDesc.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblIntensityDesc.Name = "lblIntensityDesc"; - this.lblIntensityDesc.Size = new System.Drawing.Size(400, 48); + this.lblIntensityDesc.Size = new System.Drawing.Size(600, 74); this.lblIntensityDesc.TabIndex = 35; this.lblIntensityDesc.Text = "a867549bad1cba4cd6f6dd51743e78596b982bd8"; // // label9 // this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(13, 129); + this.label9.Location = new System.Drawing.Point(25, 198); + this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(76, 13); + this.label9.Size = new System.Drawing.Size(111, 20); this.label9.TabIndex = 39; this.label9.Text = "Random Level"; // @@ -460,18 +272,21 @@ private void InitializeComponent() this.grpMonsterStat.Controls.Add(this.optMonsterHeavy); this.grpMonsterStat.Controls.Add(this.optMonsterMedium); this.grpMonsterStat.Controls.Add(this.optMonsterLight); - this.grpMonsterStat.Location = new System.Drawing.Point(122, 118); + this.grpMonsterStat.Location = new System.Drawing.Point(178, 182); + this.grpMonsterStat.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.grpMonsterStat.Name = "grpMonsterStat"; - this.grpMonsterStat.Size = new System.Drawing.Size(271, 30); + this.grpMonsterStat.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.grpMonsterStat.Size = new System.Drawing.Size(406, 46); this.grpMonsterStat.TabIndex = 38; this.grpMonsterStat.TabStop = false; // // optMonsterSilly // this.optMonsterSilly.AutoSize = true; - this.optMonsterSilly.Location = new System.Drawing.Point(63, 8); + this.optMonsterSilly.Location = new System.Drawing.Point(94, 12); + this.optMonsterSilly.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.optMonsterSilly.Name = "optMonsterSilly"; - this.optMonsterSilly.Size = new System.Drawing.Size(43, 17); + this.optMonsterSilly.Size = new System.Drawing.Size(61, 24); this.optMonsterSilly.TabIndex = 20; this.optMonsterSilly.Text = "Silly"; this.optMonsterSilly.UseVisualStyleBackColor = true; @@ -479,9 +294,10 @@ private void InitializeComponent() // optMonsterHeavy // this.optMonsterHeavy.AutoSize = true; - this.optMonsterHeavy.Location = new System.Drawing.Point(192, 8); + this.optMonsterHeavy.Location = new System.Drawing.Point(288, 12); + this.optMonsterHeavy.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.optMonsterHeavy.Name = "optMonsterHeavy"; - this.optMonsterHeavy.Size = new System.Drawing.Size(71, 17); + this.optMonsterHeavy.Size = new System.Drawing.Size(103, 24); this.optMonsterHeavy.TabIndex = 19; this.optMonsterHeavy.Text = "Ludicrous"; this.optMonsterHeavy.UseVisualStyleBackColor = true; @@ -489,9 +305,10 @@ private void InitializeComponent() // optMonsterMedium // this.optMonsterMedium.AutoSize = true; - this.optMonsterMedium.Location = new System.Drawing.Point(112, 8); + this.optMonsterMedium.Location = new System.Drawing.Point(168, 12); + this.optMonsterMedium.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.optMonsterMedium.Name = "optMonsterMedium"; - this.optMonsterMedium.Size = new System.Drawing.Size(74, 17); + this.optMonsterMedium.Size = new System.Drawing.Size(107, 24); this.optMonsterMedium.TabIndex = 18; this.optMonsterMedium.Text = "Ridiculous"; this.optMonsterMedium.UseVisualStyleBackColor = true; @@ -500,67 +317,539 @@ private void InitializeComponent() // this.optMonsterLight.AutoSize = true; this.optMonsterLight.Checked = true; - this.optMonsterLight.Location = new System.Drawing.Point(9, 8); + this.optMonsterLight.Location = new System.Drawing.Point(14, 12); + this.optMonsterLight.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.optMonsterLight.Name = "optMonsterLight"; - this.optMonsterLight.Size = new System.Drawing.Size(48, 17); + this.optMonsterLight.Size = new System.Drawing.Size(69, 24); this.optMonsterLight.TabIndex = 17; this.optMonsterLight.TabStop = true; this.optMonsterLight.Text = "Light"; this.optMonsterLight.UseVisualStyleBackColor = true; // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Controls.Add(this.tabPage3); + this.tabControl1.Location = new System.Drawing.Point(24, 278); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(812, 253); + this.tabControl1.TabIndex = 41; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.chkRandomizeGP); + this.tabPage1.Controls.Add(this.chkRandomizeXP); + this.tabPage1.Controls.Add(this.label10); + this.tabPage1.Controls.Add(this.label8); + this.tabPage1.Controls.Add(this.label6); + this.tabPage1.Controls.Add(this.cboEncounterRate); + this.tabPage1.Controls.Add(this.cboGoldReq); + this.tabPage1.Controls.Add(this.cboExpGains); + this.tabPage1.Controls.Add(this.chkSpeedText); + this.tabPage1.Controls.Add(this.chkFasterBattles); + this.tabPage1.Location = new System.Drawing.Point(4, 29); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(804, 220); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Adjustments"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // chkRandomizeGP + // + this.chkRandomizeGP.AutoSize = true; + this.chkRandomizeGP.Checked = true; + this.chkRandomizeGP.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandomizeGP.Location = new System.Drawing.Point(316, 45); + this.chkRandomizeGP.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandomizeGP.Name = "chkRandomizeGP"; + this.chkRandomizeGP.Size = new System.Drawing.Size(143, 24); + this.chkRandomizeGP.TabIndex = 18; + this.chkRandomizeGP.Text = "Randomize GP"; + this.chkRandomizeGP.UseVisualStyleBackColor = true; + this.chkRandomizeGP.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandomizeXP + // + this.chkRandomizeXP.AutoSize = true; + this.chkRandomizeXP.Checked = true; + this.chkRandomizeXP.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandomizeXP.Location = new System.Drawing.Point(316, 10); + this.chkRandomizeXP.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandomizeXP.Name = "chkRandomizeXP"; + this.chkRandomizeXP.Size = new System.Drawing.Size(141, 24); + this.chkRandomizeXP.TabIndex = 17; + this.chkRandomizeXP.Text = "Randomize XP"; + this.chkRandomizeXP.UseVisualStyleBackColor = true; + this.chkRandomizeXP.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(8, 92); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(122, 20); + this.label10.TabIndex = 16; + this.label10.Text = "Encounter Rate"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(6, 54); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(89, 20); + this.label8.TabIndex = 15; + this.label8.Text = "Gold Gains"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(8, 15); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(134, 20); + this.label6.TabIndex = 14; + this.label6.Text = "Experience Gains"; + // + // cboEncounterRate + // + this.cboEncounterRate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboEncounterRate.FormattingEnabled = true; + this.cboEncounterRate.Items.AddRange(new object[] { + "400%", + "300%", + "200%", + "150%", + "100%", + "75%", + "50%", + "25%"}); + this.cboEncounterRate.Location = new System.Drawing.Point(164, 84); + this.cboEncounterRate.Name = "cboEncounterRate"; + this.cboEncounterRate.Size = new System.Drawing.Size(121, 28); + this.cboEncounterRate.TabIndex = 13; + this.cboEncounterRate.SelectedIndexChanged += new System.EventHandler(this.determineFlags); + // + // cboGoldReq + // + this.cboGoldReq.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboGoldReq.FormattingEnabled = true; + this.cboGoldReq.Items.AddRange(new object[] { + "200%", + "150%", + "100%", + "50%"}); + this.cboGoldReq.Location = new System.Drawing.Point(164, 46); + this.cboGoldReq.Name = "cboGoldReq"; + this.cboGoldReq.Size = new System.Drawing.Size(121, 28); + this.cboGoldReq.TabIndex = 12; + this.cboGoldReq.SelectedIndexChanged += new System.EventHandler(this.determineFlags); + // + // cboExpGains + // + this.cboExpGains.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboExpGains.FormattingEnabled = true; + this.cboExpGains.Items.AddRange(new object[] { + "500%", + "400%", + "300%", + "200%", + "150%", + "100%", + "50%", + "25%"}); + this.cboExpGains.Location = new System.Drawing.Point(164, 7); + this.cboExpGains.Name = "cboExpGains"; + this.cboExpGains.Size = new System.Drawing.Size(121, 28); + this.cboExpGains.TabIndex = 11; + this.cboExpGains.SelectedIndexChanged += new System.EventHandler(this.determineFlags); + // + // chkSpeedText + // + this.chkSpeedText.AutoSize = true; + this.chkSpeedText.Checked = true; + this.chkSpeedText.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkSpeedText.Location = new System.Drawing.Point(555, 45); + this.chkSpeedText.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkSpeedText.Name = "chkSpeedText"; + this.chkSpeedText.Size = new System.Drawing.Size(164, 24); + this.chkSpeedText.TabIndex = 10; + this.chkSpeedText.Text = "Speedy Text Hack"; + this.chkSpeedText.UseVisualStyleBackColor = true; + this.chkSpeedText.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkFasterBattles + // + this.chkFasterBattles.AutoSize = true; + this.chkFasterBattles.Checked = true; + this.chkFasterBattles.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkFasterBattles.Location = new System.Drawing.Point(555, 10); + this.chkFasterBattles.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkFasterBattles.Name = "chkFasterBattles"; + this.chkFasterBattles.Size = new System.Drawing.Size(203, 24); + this.chkFasterBattles.TabIndex = 9; + this.chkFasterBattles.Text = "Increased Battle Speed"; + this.chkFasterBattles.UseVisualStyleBackColor = true; + this.chkFasterBattles.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.chkRandomizeMap); + this.tabPage2.Controls.Add(this.chkRandWhoCanEquip); + this.tabPage2.Controls.Add(this.chkRandItemEffects); + this.tabPage2.Controls.Add(this.chkSmallMap); + this.tabPage2.Controls.Add(this.chkRandStatGains); + this.tabPage2.Controls.Add(this.chkRandTreasures); + this.tabPage2.Controls.Add(this.chkRandSpellStrength); + this.tabPage2.Controls.Add(this.chkRandSpellLearning); + this.tabPage2.Controls.Add(this.chkRandEquip); + this.tabPage2.Controls.Add(this.chkRandMonsterZones); + this.tabPage2.Controls.Add(this.chkRandEnemyPatterns); + this.tabPage2.Controls.Add(this.chkRandStores); + this.tabPage2.Location = new System.Drawing.Point(4, 29); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(804, 220); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "Randomization"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // chkRandomizeMap + // + this.chkRandomizeMap.AutoSize = true; + this.chkRandomizeMap.Enabled = false; + this.chkRandomizeMap.Location = new System.Drawing.Point(267, 148); + this.chkRandomizeMap.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandomizeMap.Name = "chkRandomizeMap"; + this.chkRandomizeMap.Size = new System.Drawing.Size(151, 24); + this.chkRandomizeMap.TabIndex = 52; + this.chkRandomizeMap.Text = "Randomize map"; + this.chkRandomizeMap.UseVisualStyleBackColor = true; + this.chkRandomizeMap.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandWhoCanEquip + // + this.chkRandWhoCanEquip.AutoSize = true; + this.chkRandWhoCanEquip.Checked = true; + this.chkRandWhoCanEquip.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandWhoCanEquip.Location = new System.Drawing.Point(268, 77); + this.chkRandWhoCanEquip.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandWhoCanEquip.Name = "chkRandWhoCanEquip"; + this.chkRandWhoCanEquip.Size = new System.Drawing.Size(222, 24); + this.chkRandWhoCanEquip.TabIndex = 51; + this.chkRandWhoCanEquip.Text = "Randomize who can equip"; + this.chkRandWhoCanEquip.UseVisualStyleBackColor = true; + this.chkRandWhoCanEquip.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandItemEffects + // + this.chkRandItemEffects.AutoSize = true; + this.chkRandItemEffects.Checked = true; + this.chkRandItemEffects.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandItemEffects.Location = new System.Drawing.Point(268, 43); + this.chkRandItemEffects.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandItemEffects.Name = "chkRandItemEffects"; + this.chkRandItemEffects.Size = new System.Drawing.Size(203, 24); + this.chkRandItemEffects.TabIndex = 50; + this.chkRandItemEffects.Text = "Randomize item effects"; + this.chkRandItemEffects.UseVisualStyleBackColor = true; + this.chkRandItemEffects.Visible = false; + this.chkRandItemEffects.CheckedChanged += new System.EventHandler(this.determineFlags); + // // chkSmallMap // this.chkSmallMap.AutoSize = true; this.chkSmallMap.Checked = true; this.chkSmallMap.CheckState = System.Windows.Forms.CheckState.Checked; this.chkSmallMap.Enabled = false; - this.chkSmallMap.Location = new System.Drawing.Point(186, 275); + this.chkSmallMap.Location = new System.Drawing.Point(268, 184); + this.chkSmallMap.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.chkSmallMap.Name = "chkSmallMap"; - this.chkSmallMap.Size = new System.Drawing.Size(125, 17); - this.chkSmallMap.TabIndex = 40; + this.chkSmallMap.Size = new System.Drawing.Size(184, 24); + this.chkSmallMap.TabIndex = 49; this.chkSmallMap.Text = "Small Map (128x128)"; this.chkSmallMap.UseVisualStyleBackColor = true; + this.chkSmallMap.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandStatGains + // + this.chkRandStatGains.AutoSize = true; + this.chkRandStatGains.Checked = true; + this.chkRandStatGains.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandStatGains.Location = new System.Drawing.Point(7, 149); + this.chkRandStatGains.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandStatGains.Name = "chkRandStatGains"; + this.chkRandStatGains.Size = new System.Drawing.Size(189, 24); + this.chkRandStatGains.TabIndex = 48; + this.chkRandStatGains.Text = "Randomize stat gains"; + this.chkRandStatGains.UseVisualStyleBackColor = true; + this.chkRandStatGains.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandTreasures + // + this.chkRandTreasures.AutoSize = true; + this.chkRandTreasures.Checked = true; + this.chkRandTreasures.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandTreasures.Location = new System.Drawing.Point(7, 184); + this.chkRandTreasures.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandTreasures.Name = "chkRandTreasures"; + this.chkRandTreasures.Size = new System.Drawing.Size(187, 24); + this.chkRandTreasures.TabIndex = 47; + this.chkRandTreasures.Text = "Randomize treasures"; + this.chkRandTreasures.UseVisualStyleBackColor = true; + this.chkRandTreasures.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandSpellStrength + // + this.chkRandSpellStrength.AutoSize = true; + this.chkRandSpellStrength.Checked = true; + this.chkRandSpellStrength.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandSpellStrength.Location = new System.Drawing.Point(268, 114); + this.chkRandSpellStrength.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandSpellStrength.Name = "chkRandSpellStrength"; + this.chkRandSpellStrength.Size = new System.Drawing.Size(223, 24); + this.chkRandSpellStrength.TabIndex = 46; + this.chkRandSpellStrength.Text = "Randomize spell strengths"; + this.chkRandSpellStrength.UseVisualStyleBackColor = true; + this.chkRandSpellStrength.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandSpellLearning + // + this.chkRandSpellLearning.AutoSize = true; + this.chkRandSpellLearning.Checked = true; + this.chkRandSpellLearning.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandSpellLearning.Location = new System.Drawing.Point(7, 114); + this.chkRandSpellLearning.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandSpellLearning.Name = "chkRandSpellLearning"; + this.chkRandSpellLearning.Size = new System.Drawing.Size(212, 24); + this.chkRandSpellLearning.TabIndex = 45; + this.chkRandSpellLearning.Text = "Randomize spell learning"; + this.chkRandSpellLearning.UseVisualStyleBackColor = true; + this.chkRandSpellLearning.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandEquip + // + this.chkRandEquip.AutoSize = true; + this.chkRandEquip.Checked = true; + this.chkRandEquip.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandEquip.Location = new System.Drawing.Point(268, 8); + this.chkRandEquip.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandEquip.Name = "chkRandEquip"; + this.chkRandEquip.Size = new System.Drawing.Size(242, 24); + this.chkRandEquip.TabIndex = 44; + this.chkRandEquip.Text = "Randomize equipment power"; + this.chkRandEquip.UseVisualStyleBackColor = true; + this.chkRandEquip.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandMonsterZones + // + this.chkRandMonsterZones.AutoSize = true; + this.chkRandMonsterZones.Checked = true; + this.chkRandMonsterZones.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandMonsterZones.Location = new System.Drawing.Point(7, 79); + this.chkRandMonsterZones.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandMonsterZones.Name = "chkRandMonsterZones"; + this.chkRandMonsterZones.Size = new System.Drawing.Size(225, 24); + this.chkRandMonsterZones.TabIndex = 43; + this.chkRandMonsterZones.Text = "Randomize monster zones"; + this.chkRandMonsterZones.UseVisualStyleBackColor = true; + this.chkRandMonsterZones.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandEnemyPatterns + // + this.chkRandEnemyPatterns.AutoSize = true; + this.chkRandEnemyPatterns.Checked = true; + this.chkRandEnemyPatterns.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandEnemyPatterns.Location = new System.Drawing.Point(7, 43); + this.chkRandEnemyPatterns.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandEnemyPatterns.Name = "chkRandEnemyPatterns"; + this.chkRandEnemyPatterns.Size = new System.Drawing.Size(230, 24); + this.chkRandEnemyPatterns.TabIndex = 42; + this.chkRandEnemyPatterns.Text = "Randomize enemy patterns"; + this.chkRandEnemyPatterns.UseVisualStyleBackColor = true; + this.chkRandEnemyPatterns.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // chkRandStores + // + this.chkRandStores.AutoSize = true; + this.chkRandStores.Checked = true; + this.chkRandStores.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRandStores.Location = new System.Drawing.Point(7, 8); + this.chkRandStores.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.chkRandStores.Name = "chkRandStores"; + this.chkRandStores.Size = new System.Drawing.Size(183, 24); + this.chkRandStores.TabIndex = 41; + this.chkRandStores.Text = "Randomize all stores"; + this.chkRandStores.UseVisualStyleBackColor = true; + this.chkRandStores.CheckedChanged += new System.EventHandler(this.determineFlags); + // + // tabPage3 + // + this.tabPage3.Controls.Add(this.txtDefault2); + this.tabPage3.Controls.Add(this.txtDefault3); + this.tabPage3.Controls.Add(this.txtDefault10); + this.tabPage3.Controls.Add(this.txtDefault11); + this.tabPage3.Controls.Add(this.txtDefault12); + this.tabPage3.Controls.Add(this.txtDefault9); + this.tabPage3.Controls.Add(this.txtDefault8); + this.tabPage3.Controls.Add(this.txtDefault7); + this.tabPage3.Controls.Add(this.txtDefault6); + this.tabPage3.Controls.Add(this.txtDefault5); + this.tabPage3.Controls.Add(this.txtDefault4); + this.tabPage3.Controls.Add(this.txtDefault1); + this.tabPage3.Location = new System.Drawing.Point(4, 29); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Size = new System.Drawing.Size(804, 220); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "Default Names"; + this.tabPage3.UseVisualStyleBackColor = true; + // + // txtDefault2 + // + this.txtDefault2.Location = new System.Drawing.Point(20, 58); + this.txtDefault2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault2.MaxLength = 8; + this.txtDefault2.Name = "txtDefault2"; + this.txtDefault2.Size = new System.Drawing.Size(120, 26); + this.txtDefault2.TabIndex = 39; + // + // txtDefault3 + // + this.txtDefault3.Location = new System.Drawing.Point(20, 100); + this.txtDefault3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault3.MaxLength = 8; + this.txtDefault3.Name = "txtDefault3"; + this.txtDefault3.Size = new System.Drawing.Size(120, 26); + this.txtDefault3.TabIndex = 40; + // + // txtDefault10 + // + this.txtDefault10.Location = new System.Drawing.Point(488, 18); + this.txtDefault10.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault10.MaxLength = 8; + this.txtDefault10.Name = "txtDefault10"; + this.txtDefault10.Size = new System.Drawing.Size(120, 26); + this.txtDefault10.TabIndex = 47; + // + // txtDefault11 + // + this.txtDefault11.Location = new System.Drawing.Point(488, 58); + this.txtDefault11.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault11.MaxLength = 8; + this.txtDefault11.Name = "txtDefault11"; + this.txtDefault11.Size = new System.Drawing.Size(120, 26); + this.txtDefault11.TabIndex = 48; + // + // txtDefault12 + // + this.txtDefault12.Location = new System.Drawing.Point(488, 100); + this.txtDefault12.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault12.MaxLength = 8; + this.txtDefault12.Name = "txtDefault12"; + this.txtDefault12.Size = new System.Drawing.Size(120, 26); + this.txtDefault12.TabIndex = 49; + // + // txtDefault9 + // + this.txtDefault9.Location = new System.Drawing.Point(328, 100); + this.txtDefault9.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault9.MaxLength = 8; + this.txtDefault9.Name = "txtDefault9"; + this.txtDefault9.Size = new System.Drawing.Size(120, 26); + this.txtDefault9.TabIndex = 46; + // + // txtDefault8 + // + this.txtDefault8.Location = new System.Drawing.Point(330, 58); + this.txtDefault8.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault8.MaxLength = 8; + this.txtDefault8.Name = "txtDefault8"; + this.txtDefault8.Size = new System.Drawing.Size(120, 26); + this.txtDefault8.TabIndex = 45; + // + // txtDefault7 + // + this.txtDefault7.Location = new System.Drawing.Point(330, 18); + this.txtDefault7.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault7.MaxLength = 8; + this.txtDefault7.Name = "txtDefault7"; + this.txtDefault7.Size = new System.Drawing.Size(120, 26); + this.txtDefault7.TabIndex = 44; + // + // txtDefault6 + // + this.txtDefault6.Location = new System.Drawing.Point(175, 100); + this.txtDefault6.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault6.MaxLength = 8; + this.txtDefault6.Name = "txtDefault6"; + this.txtDefault6.Size = new System.Drawing.Size(120, 26); + this.txtDefault6.TabIndex = 43; + // + // txtDefault5 + // + this.txtDefault5.Location = new System.Drawing.Point(175, 58); + this.txtDefault5.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault5.MaxLength = 8; + this.txtDefault5.Name = "txtDefault5"; + this.txtDefault5.Size = new System.Drawing.Size(120, 26); + this.txtDefault5.TabIndex = 42; + // + // txtDefault4 + // + this.txtDefault4.Location = new System.Drawing.Point(175, 18); + this.txtDefault4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault4.MaxLength = 8; + this.txtDefault4.Name = "txtDefault4"; + this.txtDefault4.Size = new System.Drawing.Size(120, 26); + this.txtDefault4.TabIndex = 41; + // + // txtDefault1 + // + this.txtDefault1.Location = new System.Drawing.Point(20, 18); + this.txtDefault1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtDefault1.MaxLength = 8; + this.txtDefault1.Name = "txtDefault1"; + this.txtDefault1.Size = new System.Drawing.Size(120, 26); + this.txtDefault1.TabIndex = 38; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(542, 244); + this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(48, 20); + this.label7.TabIndex = 43; + this.label7.Text = "Flags"; + // + // txtFlags + // + this.txtFlags.Location = new System.Drawing.Point(602, 241); + this.txtFlags.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txtFlags.Name = "txtFlags"; + this.txtFlags.Size = new System.Drawing.Size(230, 26); + this.txtFlags.TabIndex = 42; // // Form1 // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(537, 507); - this.Controls.Add(this.chkSmallMap); + this.ClientSize = new System.Drawing.Size(875, 658); + this.Controls.Add(this.label7); + this.Controls.Add(this.txtFlags); + this.Controls.Add(this.tabControl1); this.Controls.Add(this.label9); this.Controls.Add(this.grpMonsterStat); this.Controls.Add(this.lblIntensityDesc); - this.Controls.Add(this.chkRandStatGains); - this.Controls.Add(this.chkRandTreasures); - this.Controls.Add(this.chkRandSpellStrength); - this.Controls.Add(this.chkRandSpellLearning); - this.Controls.Add(this.chkRandEquip); - this.Controls.Add(this.chkRandMonsterZones); - this.Controls.Add(this.chkRandEnemyPatterns); - this.Controls.Add(this.chkRandStores); - this.Controls.Add(this.txtDefault2); - this.Controls.Add(this.txtDefault3); - this.Controls.Add(this.txtDefault10); - this.Controls.Add(this.txtDefault11); - this.Controls.Add(this.txtDefault12); - this.Controls.Add(this.txtDefault9); - this.Controls.Add(this.txtDefault8); - this.Controls.Add(this.txtDefault7); - this.Controls.Add(this.txtDefault6); - this.Controls.Add(this.txtDefault5); - this.Controls.Add(this.txtDefault4); - this.Controls.Add(this.txtDefault1); - this.Controls.Add(this.label6); this.Controls.Add(this.btnNewSeed); this.Controls.Add(this.btnCompareBrowse); this.Controls.Add(this.label5); this.Controls.Add(this.txtCompare); - this.Controls.Add(this.chkDoubleXP); this.Controls.Add(this.label3); this.Controls.Add(this.txtSeed); this.Controls.Add(this.btnCompare); this.Controls.Add(this.btnRandomize); - this.Controls.Add(this.chkHalfExpGoldReq); this.Controls.Add(this.lblReqChecksum); this.Controls.Add(this.label4); this.Controls.Add(this.lblSHAChecksum); @@ -568,12 +857,20 @@ private void InitializeComponent() this.Controls.Add(this.btnBrowse); this.Controls.Add(this.label1); this.Controls.Add(this.txtFileName); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "Form1"; this.Text = "Dragon Warrior 3 Randomizer"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.Load += new System.EventHandler(this.Form1_Load); this.grpMonsterStat.ResumeLayout(false); this.grpMonsterStat.PerformLayout(); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage1.PerformLayout(); + this.tabPage2.ResumeLayout(false); + this.tabPage2.PerformLayout(); + this.tabPage3.ResumeLayout(false); + this.tabPage3.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -588,37 +885,14 @@ private void InitializeComponent() private System.Windows.Forms.Label lblSHAChecksum; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label lblReqChecksum; - private System.Windows.Forms.CheckBox chkHalfExpGoldReq; private System.Windows.Forms.Button btnRandomize; private System.Windows.Forms.Button btnCompare; private System.Windows.Forms.TextBox txtSeed; private System.Windows.Forms.Label label3; - private System.Windows.Forms.CheckBox chkDoubleXP; private System.Windows.Forms.Button btnNewSeed; private System.Windows.Forms.TextBox txtCompare; private System.Windows.Forms.Label label5; private System.Windows.Forms.Button btnCompareBrowse; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.TextBox txtDefault1; - private System.Windows.Forms.TextBox txtDefault4; - private System.Windows.Forms.TextBox txtDefault5; - private System.Windows.Forms.TextBox txtDefault6; - private System.Windows.Forms.TextBox txtDefault7; - private System.Windows.Forms.TextBox txtDefault8; - private System.Windows.Forms.TextBox txtDefault9; - private System.Windows.Forms.TextBox txtDefault12; - private System.Windows.Forms.TextBox txtDefault11; - private System.Windows.Forms.TextBox txtDefault10; - private System.Windows.Forms.TextBox txtDefault3; - private System.Windows.Forms.TextBox txtDefault2; - private System.Windows.Forms.CheckBox chkRandStores; - private System.Windows.Forms.CheckBox chkRandEnemyPatterns; - private System.Windows.Forms.CheckBox chkRandMonsterZones; - private System.Windows.Forms.CheckBox chkRandEquip; - private System.Windows.Forms.CheckBox chkRandSpellLearning; - private System.Windows.Forms.CheckBox chkRandSpellStrength; - private System.Windows.Forms.CheckBox chkRandTreasures; - private System.Windows.Forms.CheckBox chkRandStatGains; private System.Windows.Forms.Label lblIntensityDesc; private System.Windows.Forms.Label label9; private System.Windows.Forms.GroupBox grpMonsterStat; @@ -626,7 +900,46 @@ private void InitializeComponent() private System.Windows.Forms.RadioButton optMonsterHeavy; private System.Windows.Forms.RadioButton optMonsterMedium; private System.Windows.Forms.RadioButton optMonsterLight; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.CheckBox chkSmallMap; + private System.Windows.Forms.CheckBox chkRandStatGains; + private System.Windows.Forms.CheckBox chkRandTreasures; + private System.Windows.Forms.CheckBox chkRandSpellStrength; + private System.Windows.Forms.CheckBox chkRandSpellLearning; + private System.Windows.Forms.CheckBox chkRandEquip; + private System.Windows.Forms.CheckBox chkRandMonsterZones; + private System.Windows.Forms.CheckBox chkRandEnemyPatterns; + private System.Windows.Forms.CheckBox chkRandStores; + private System.Windows.Forms.TabPage tabPage3; + private System.Windows.Forms.TextBox txtDefault2; + private System.Windows.Forms.TextBox txtDefault3; + private System.Windows.Forms.TextBox txtDefault10; + private System.Windows.Forms.TextBox txtDefault11; + private System.Windows.Forms.TextBox txtDefault12; + private System.Windows.Forms.TextBox txtDefault9; + private System.Windows.Forms.TextBox txtDefault8; + private System.Windows.Forms.TextBox txtDefault7; + private System.Windows.Forms.TextBox txtDefault6; + private System.Windows.Forms.TextBox txtDefault5; + private System.Windows.Forms.TextBox txtDefault4; + private System.Windows.Forms.TextBox txtDefault1; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox txtFlags; + private System.Windows.Forms.CheckBox chkSpeedText; + private System.Windows.Forms.CheckBox chkFasterBattles; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.ComboBox cboEncounterRate; + private System.Windows.Forms.ComboBox cboGoldReq; + private System.Windows.Forms.ComboBox cboExpGains; + private System.Windows.Forms.CheckBox chkRandomizeGP; + private System.Windows.Forms.CheckBox chkRandomizeXP; + private System.Windows.Forms.CheckBox chkRandWhoCanEquip; + private System.Windows.Forms.CheckBox chkRandItemEffects; + private System.Windows.Forms.CheckBox chkRandomizeMap; } } diff --git a/DW3Randomizer/Form1.cs b/DW3Randomizer/Form1.cs index 4ed079b..8cbd432 100644 --- a/DW3Randomizer/Form1.cs +++ b/DW3Randomizer/Form1.cs @@ -9,6 +9,7 @@ namespace DW3Randomizer { public partial class Form1 : Form { + bool loading = true; byte[] romData; byte[] romData2; byte[] monsterOrder = { 0x00, 0x01, 0x68, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, @@ -74,7 +75,8 @@ private void Form1_Load(object sender, EventArgs e) using (TextReader reader = File.OpenText("lastFile.txt")) { txtFileName.Text = reader.ReadLine(); - txtCompare.Text = reader.ReadLine(); + txtFlags.Text = reader.ReadLine(); + determineChecks(); txtDefault1.Text = reader.ReadLine(); txtDefault2.Text = reader.ReadLine(); txtDefault3.Text = reader.ReadLine(); @@ -105,18 +107,13 @@ private void Form1_Load(object sender, EventArgs e) txtDefault10.Text = "Petrus"; txtDefault11.Text = "Hiram"; txtDefault12.Text = "Viron"; + cboEncounterRate.SelectedIndex = 4; + cboExpGains.SelectedIndex = 5; + cboGoldReq.SelectedIndex = 0; } - - //radInsaneIntensity_CheckedChanged(null, null); - // Lower case letters start at 0x0b, Upper case letters start at 0x25. - // Is Q being skipped?! - // bcdef01234 - // 567890abcd - // ef01234 - // 56789abcde - // f012345678 - // 9abcde - + btnNewSeed_Click(null, null); + loading = false; + determineFlags(null, null); } private void btnNewSeed_Click(object sender, EventArgs e) @@ -134,9 +131,7 @@ private void btnRandomize_Click(object sender, EventArgs e) if (!loadRom()) return; - if (txtSeed.Text == "test1") - halfExpAndGoldReq(true); - else if (txtSeed.Text == "output") + if (txtSeed.Text == "output") { textOutput(); return; @@ -149,49 +144,49 @@ private void btnRandomize_Click(object sender, EventArgs e) else { if (chkRandStores.Checked) forceItemSell(); - if (chkHalfExpGoldReq.Checked) halfExpAndGoldReq(); + boostGP(); superRandomize(); - if (chkDoubleXP.Checked) doubleExp(); - } - // ALL ROM Hacks will have greatly increased battle speeds. - romData[0x13a65] = 0x01; - romData[0x13a66] = 0x04; - romData[0x13a67] = 0x08; - romData[0x13a68] = 0x0c; - romData[0x13a69] = 0x10; - romData[0x13a6a] = 0x18; - romData[0x13a6b] = 0x20; - romData[0x852] = 2; // instead of 16 - animation of transition into battle removed, saving 14 frames / start of battle. - romData[0x8ce] = 1; // instead of 12 - flashes to start a battle, saving 11 frames / start of battle. - romData[0x980d] = 1; // instead of 8 - Magic spell flashing, saving 7 or 14 frames / spell casted - romData[0x9827] = 0xea; // NEXT 3 LINES: 1 flash -> 0 flashes - romData[0x9828] = 0xea; - romData[0x9829] = 0xea; - romData[0x9882] = 2; // instead of 12 - Frames of shaking when YOU are hit... saving 10 frames / hit - romData[0x9957] = 1; // Instead of 4 enemy flashes, saving at least 6 frames / hit... probably 12 or even 24 frames / hit. + boostXP(); + adjustEncounters(); + + if (chkSpeedText.Checked) speedText(); + if (chkFasterBattles.Checked) battleSpeed(); + } // Implement DW4 RNG so any currently known manipulations won't work. - //romData[0x3ff93] = 0xe6; - //romData[0x3ff94] = 0x1c; - //romData[0x3ff95] = 0xcd; - //romData[0x3ff96] = 0xd2; - //romData[0x3ff97] = 0x06; - //romData[0x3ff98] = 0xf0; - //romData[0x3ff99] = 0xf9; - //romData[0x3ff9a] = 0x60; - - //romData[0x3c354] = 0x20; - //romData[0x3c355] = 0x83; - //romData[0x3c356] = 0xff; - //romData[0x3c357] = 0xea; - //romData[0x3c358] = 0xea; - - //romData[0x3c35f] = 0x20; - //romData[0x3c360] = 0x83; - //romData[0x3c361] = 0xff; - //romData[0x3c362] = 0xea; - //romData[0x3c363] = 0xea; + romData[0x3c351] = romData[0x7c351] = 0xAD; + romData[0x3c352] = romData[0x7c352] = 0xd2; + romData[0x3c353] = romData[0x7c353] = 0x06; + romData[0x3c354] = romData[0x7c354] = 0x4c; + romData[0x3c355] = romData[0x7c355] = 0x53; + romData[0x3c356] = romData[0x7c356] = 0xc3; + romData[0x3c357] = romData[0x7c357] = 0xf0; + romData[0x3c358] = romData[0x7c358] = 0xfb; + romData[0x3c359] = romData[0x7c359] = 0x4c; + romData[0x3c35a] = romData[0x7c35a] = 0x0a; + romData[0x3c35b] = romData[0x7c35b] = 0xc9; + romData[0x3c35c] = romData[0x7c35c] = 0x20; + romData[0x3c35d] = romData[0x7c35d] = 0x41; + romData[0x3c35e] = romData[0x7c35e] = 0xc3; + romData[0x3c35f] = romData[0x7c35f] = 0xca; + romData[0x3c360] = romData[0x7c360] = 0xd0; + romData[0x3c361] = romData[0x7c361] = 0xfa; + romData[0x3c362] = romData[0x7c362] = 0x60; + romData[0x3c363] = romData[0x7c363] = 0xe6; + romData[0x3c364] = romData[0x7c364] = 0x1c; + romData[0x3c365] = romData[0x7c365] = 0xcd; + romData[0x3c366] = romData[0x7c366] = 0xd2; + romData[0x3c367] = romData[0x7c367] = 0x06; + romData[0x3c368] = romData[0x7c368] = 0x4c; + romData[0x3c369] = romData[0x7c369] = 0x47; + romData[0x3c36a] = romData[0x7c36a] = 0xc3; + + // Speed up item menu loading + romData[0x2b0d] = 0x00; + romData[0x2b0e] = 0xf0; + romData[0x2b0f] = 0x01; + romData[0x2b10] = 0x00; // All ROM hacks will revive ALL characters on a ColdAsACod. // There will be a temporary graphical error if you use less than four characters, but I'm going to leave it be. @@ -278,6 +273,43 @@ private void btnRandomize_Click(object sender, EventArgs e) saveRom(); } + private void battleSpeed() + { + romData[0x13a65] = 0x01; + romData[0x13a66] = 0x04; + romData[0x13a67] = 0x08; + romData[0x13a68] = 0x0c; + romData[0x13a69] = 0x10; + romData[0x13a6a] = 0x18; + romData[0x13a6b] = 0x20; + romData[0x852] = 2; // instead of 16 - animation of transition into battle removed, saving 14 frames / start of battle. + romData[0x8ce] = 1; // instead of 12 - flashes to start a battle, saving 11 frames / start of battle. + romData[0x980d] = 1; // instead of 8 - Magic spell flashing, saving 7 or 14 frames / spell casted + romData[0x9827] = 0xea; // NEXT 3 LINES: 1 flash -> 0 flashes + romData[0x9828] = 0xea; + romData[0x9829] = 0xea; + romData[0x9882] = 2; // instead of 12 - Frames of shaking when YOU are hit... saving 10 frames / hit + romData[0x9957] = 1; // Instead of 4 enemy flashes, saving at least 6 frames / hit... probably 12 or even 24 frames / hit. + } + + private void speedText() + { + romData[0x3a783] = 0x20; + romData[0x3a784] = 0xbd; + romData[0x3a785] = 0xbf; + + romData[0x3a9c7] = 0x90; + romData[0x3a9c8] = 0x1d; + romData[0x3a9c9] = 0xa6; + romData[0x3a9ca] = 0x78; + romData[0x3a9cb] = 0xf0; + romData[0x3a9cc] = 0x06; + + byte[] speedText = { 0xad, 0xd0, 0x6a, 0xf0, 0x03, 0x00, 0x96, 0x2f, 0x20, 0xba, 0xc2, 0xa9, 0x02, 0x8d, 0xd6, 0x06, 0x20, 0x41, 0xc3, 0xa9, 0x00, 0x8d, 0xd6, 0x06, 0x4c, 0x5f, 0xaa }; + for (int i = 0; i < speedText.Length; i++) + romData[0x3bfcd + i] = speedText[i]; + } + private void textGet() { List txtStrings = new List(); @@ -322,7 +354,7 @@ private bool loadRom(bool extra = false) if (extra) romData2 = File.ReadAllBytes(txtCompare.Text); } - catch + catch (Exception ex) { MessageBox.Show("Empty file name(s) or unable to open files. Please verify the files exist."); return false; @@ -332,17 +364,7 @@ private bool loadRom(bool extra = false) private void saveRom() { - string options = (chkHalfExpGoldReq.Checked ? "_half" : ""); - options += (chkDoubleXP.Checked ? "_2xp" : ""); - options += (chkRandStores.Checked ? "_sto" : ""); - options += (chkRandEnemyPatterns.Checked ? "_pat" : ""); - options += (chkRandSpellLearning.Checked ? "_lrn" : ""); - options += (chkRandStatGains.Checked ? "_stat" : ""); - options += (chkRandTreasures.Checked ? "_tres" : ""); - options += (chkRandEquip.Checked ? "_eq" : ""); - options += (chkRandMonsterZones.Checked ? "_zon" : ""); - options += (chkRandSpellStrength.Checked ? "_sstr" : ""); - string finalFile = Path.Combine(Path.GetDirectoryName(txtFileName.Text), "DW3Random_" + txtSeed.Text + options + ".nes"); + string finalFile = Path.Combine(Path.GetDirectoryName(txtFileName.Text), "DW3Random_" + txtSeed.Text + "_" + txtFlags.Text + ".nes"); File.WriteAllBytes(finalFile, romData); lblIntensityDesc.Text = "ROM hacking complete! (" + finalFile + ")"; txtCompare.Text = finalFile; @@ -557,7 +579,6 @@ private bool randomizeMapv5(Random r1) break; case "X": continue; - break; } } @@ -1616,44 +1637,109 @@ private void shipPlacement(int byteToUse, int top, int left, int maxLake = 0) } } - private void doubleExp() + private void boostGP() { - //// Divide encounter rates by three, rounding as needed. - romData[0x944] = 2; // was 4 - romData[0x945] = 5; // was 15 - romData[0x946] = 4; // was 10 - romData[0x947] = 5; // was 15 - romData[0x948] = 6; // was 18 - romData[0x949] = 8; // was 25 - romData[0x94a] = 28; // was 84 - romData[0x94b] = 6; // was 18 - romData[0x94c] = 4; // was 10 - romData[0x94d] = 2; // was 5 - romData[0x94e] = 6; // was 19 - romData[0x94f] = 4; // was 13 - romData[0x950] = 6; // was 19 - romData[0x951] = 7; // was 22 - romData[0x952] = 10; // was 31 - romData[0x953] = 28; // was 84 - romData[0x954] = 7; // was 22 - romData[0x955] = 3; // was 10 + // Replace monster data + for (int lnI = 0; lnI < 125; lnI++) + { + int byteValStart = 0x32e3 + (23 * lnI); + + int gp = romData[byteValStart + 4] + ((romData[byteValStart + 18] % 2) * 256); + switch (cboExpGains.SelectedIndex) + { + case 0: + gp *= 2; + break; + case 1: + gp = gp * 3 / 2; + break; + case 2: + break; + case 3: + gp /= 2; + break; + } + gp = (gp > 1000 ? 1000 : gp); + romData[byteValStart + 4] = (byte)(gp % 256); + romData[byteValStart + 18] = (byte)(romData[byteValStart + 18] - (romData[byteValStart + 18] % 4) + (gp / 256)); + } + } + + private void boostXP() + { // Replace monster data for (int lnI = 0; lnI < 125; lnI++) { int byteValStart = 0x32e3 + (23 * lnI); int xp = romData[byteValStart + 1] + (romData[byteValStart + 2] * 256); - if (lnI != 0x31 && lnI != 0x6c) - xp = xp * 3 / 2; - - xp = (xp > 64000 ? 64000 : xp); + switch (cboExpGains.SelectedIndex) + { + case 0: + xp *= 5; + break; + case 1: + xp *= 4; + break; + case 2: + xp *= 3; + break; + case 3: + xp *= 2; + break; + case 4: + xp = xp * 3 / 2; + break; + case 5: + break; + case 6: + xp /= 2; + break; + case 7: + xp /= 4; + break; + } + xp = (xp > 65500 ? 65500 : xp); romData[byteValStart + 1] = (byte)(xp % 256); romData[byteValStart + 2] = (byte)(xp / 256); } } + private void adjustEncounters() + { + for (int i = 0x944; i <= 0x955; i++) + { + switch (cboEncounterRate.SelectedIndex) + { + case 0: + romData[i] *= 4; + break; + case 1: + romData[i] *= 3; + break; + case 2: + romData[i] *= 2; + break; + case 3: + romData[i] = (byte)(romData[i] * 3 / 2); + break; + case 4: + break; + case 5: + romData[i] = (byte)(romData[i] * 3 / 4); + break; + case 6: + romData[i] /= 2; + break; + case 7: + romData[i] /= 4; + break; + } + } + } + private void forceItemSell() { int[] forcedItemSell = { 0x16, 0x1c, 0x28, 0x32, 0x34, 0x36, 0x3b, 0x3f, 0x42, 0x48, 0x4b, 0x4c, 0x50, 0x52, 0x53, 0x58, 0x59, 0x69, 0x6f, 0x70, 0x71 }; @@ -1694,99 +1780,6 @@ private void forceItemSell() } } - private void halfExpAndGoldReq(bool special = false) - { - romData[0x282fd] = 25; // instead of 24 -> This will raise the exp earned by 133% - - // 0x11be for the multiplier. Maintain two bits except for various key items that I want sold. - // Sword Of Illusion - 5000G - // Sword Of Kings - 35000G - // Armor Of Radiance - 15000G - // Magic Bikini - 10000G - // Armor of Terrafirma - 8000G - // Swordedge Armor - 12000G - // Shield Of Heroes - 10000G - // Golden Crown - 800G - // Unlucky Helmet - 10G - // Ring of Life - 5000G - // Meteorite Armband - 5000G - // Book of Satori - 8000G - // Sage's Stone - 20000G - // Vase Of Draught - 1000G - // Lamp of Darkness - 1000G - // Thief's Key - 500G - // Magic Key - 2000G - // Final Key - 5000G (not sold) - // Echoing Flute - 500G - // Fairy Flute - 2000G - // Silver Harp - 500G - - // Change costs of various items because they might be sold from now on: - // Strength seed: 5000G - // Agility seed: 3000G - // Luck seed: 2500G - // Acorns Of Life: 5000G - // Magic Ball: 800G - // Stone of Sunlight: 10000G - // Staff of change: 3000G - // Stone of Life: 2000G - // Wizard's Ring: 10000G - // Black Pepper: 5000G - // Shoes of Happiness: 5000G - - for (int lnI = 0; lnI < 125; lnI++) - { - // Need to determine original price... - int priceMultiplier = (romData[0x11be + lnI] % 4 == 0 ? 1 : romData[0x11be + lnI] % 4 == 1 ? 10 : romData[0x11be + lnI] % 4 == 2 ? 100 : 1000); - int priceMultiplier2 = (romData[0x123b + lnI] >= 128 ? romData[0x123b + lnI] - 128 : romData[0x123b + lnI]); - // Don't bother reducing the price if it's 0 or 1 piece of gold. - int price = priceMultiplier * priceMultiplier2; - if (price == 0 || price == 1) - continue; - - price /= 2; - - // Remove any price adjustment first. - romData[0x11be + lnI] -= (byte)(romData[0x11be + lnI] % 4); - if (price >= 10000) - { - romData[0x11be + lnI] += 3; // Now multiply by 1000 - price /= 1000; - } - else if (price >= 1000) - { - romData[0x11be + lnI] += 2; // Now multiply by 100 - price /= 100; - } - else if (price >= 100) - { - romData[0x11be + lnI] += 1; // Now multiply by 10 - price /= 10; - } - else - { - romData[0x11be + lnI] += 0; - } - - // Must keep special effects if romData is >= 128 - if (romData[0x123b + lnI] > 128) - romData[0x123b + lnI] = (byte)(128 + price); - else - romData[0x123b + lnI] = (byte)(price); - } - - //// House of healing cost halved - //romData[0x18659] = (20 / 2); - - // Inn prices halved - for (int lnI = 0; lnI < 26; lnI++) - { - int innPrice = romData[0x367c1 + lnI] / 2; - romData[0x367c1 + lnI] -= (byte)(romData[0x367c1 + lnI] % 32); - romData[0x367c1 + lnI] += (byte)innPrice; - } - } - private void superRandomize() { Random r1; @@ -2150,115 +2143,91 @@ private void superRandomize() romData[0x909] = 0x18; // was 0x20 - Mummy Men // We could randomize the Granite Titan and Boss Troll fights too... // Maybe remove two of the Kandar Henchmen in the first fight and place two "bonus monsters" in other fights... - - //// Randomize the first 12 boss fights, but make sure the last four of those involve Atlas, Bazuzu, Zarlox, and Hargon. - //// The 13th and final fight cannot be manipulated: Malroth, and Malroth alone. - //for (int lnI = 0; lnI < 18; lnI++) - //{ - // int byteToUse = 0x8ee + (lnI * 2); - // int byteToUse2 = 0x919 + (lnI * 2); - // int boss1 = (lnI >= 8 ? 78 + (lnI - 8) : ((r1.Next() % 77) + 1)); - // boss1 = (lnI == 0 ? (r1.Next() % 40) + 1 : boss1); - // int quantity1 = (boss1 >= 80 ? 1 : (r1.Next() % monsterSize[boss1]) + 1); - // int boss2 = (lnI == 0 ? (r1.Next() % 40) + 1 : (r1.Next() % 78) + 1); - // romData[byteToUse + 0] = (byte)boss1; - // romData[byteToUse + 1] = (byte)quantity1; - // romData[byteToUse + 2] = (byte)boss2; - // romData[byteToUse + 3] = 8; // It's too many monsters, but the width of the screen will trim the rest of the monsters off. - //} } - if (chkRandEquip.Checked) - { - string[] weaponText = { "Cypress stick", "Club", "Copper sword", "Magic Knife", "Iron Spear", "Battle Axe", "Broad Sword", "Wizard's Wand", - "Poison Needle", "Iron Claw", "Thorn Whip", "Giant Shears", "Chain Sickle", "Thor's Sword", "Snowblast Sword", "Demon Axe", - "Staff of Rain", "Sword of Gaia", "Staff of Reflection", "Sword of Destruction", "Multi - Edge Sword", "Staff of Force", "Sword of Illusion", "Zombie Slasher", - "Falcon Sword", "Sledge Hammer", "Thunder Sword", "Staff of Thunder", "Sword of Kings", "Orochi Sword", "Dragon Killer", "Staff of Judgement", - "Clothes", "Training Suit", "Leather Armor", "Flashy Clothes", "Half Plate Armor", "Full Plate Armor", "Magic Armor", "Cloak of Evasion", - "Armor of Radiance", "Iron Apron", "Animal Suit", "Fightting Suit", "Sacred Robe", "Armor of Hades", "Water Flying Cloth", "Chain Mail", - "Wayfarers Clothes", "Revealing Swimsuit", "Magic Bikini", "Shell Armor", "Armor of Terrafirma", "Dragon Mail", "Swordedge Armor", "Angel's Robe", - "Leather Shield", "Iron Shield", "Shield of Strength", "Shield of Heroes", "Shield of Sorrow", "Bronze Shield", "Silver Shield", "Golden Crown", - "Iron Helmet", "Mysterious Hat", "Unlucky Helmet", "Turban", "Noh Mask", "Leather Helmet", "Iron Mask", "Golden Claw" }; - - // Randomize which items equate to which effects - // Select 21 items randomly from a set defined as follows: - int[] legalEffectItems = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 }; - - List keyEffectItems = new List { 0x10, 0x11 }; - - // Wipe out the use byte by totally resetting the price. - for (int lnI = 0; lnI < legalEffectItems.Length; lnI++) - { - int oldVal = romData[0x11be + legalEffectItems[lnI]]; - romData[0x11be + legalEffectItems[lnI]] = (byte)(oldVal % 32); - //romData[0x11be + legalEffectItems[lnI]] = (byte)(oldVal % 32 >= 16 ? 0x10 : 0x00); - //romData[0x11be + legalEffectItems[lnI]] += (byte)(oldVal % 16 >= 8 ? 0x08 : 0x00); - } - int oldVal1 = romData[0x11be + 0x4a]; - romData[0x11be + 0x4a] = (byte)(oldVal1 % 32); - int oldVal2 = romData[0x11be + 0x5b]; - romData[0x11be + 0x5b] = (byte)(oldVal2 % 32); - - int[] legalItemSpells = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, - 0x30, 0x31, 0x32, 0x34, - 0x38, 0x39, 0x3a }; // restore MP, everyone sneezes, self numb - 54 spells total - - List enemyGroupSpells = new List { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x0a, 0x0b, 0x0d, 0x0e, 0x0f, - 0x10, 0x12, 0x13, 0x15, 0x16, 0x17, 0x18, 0x22, 0x24, 0x25, 0x27, 0x2b, 0x2c }; // 25 - List enemyAllSpells = new List { 0x06, 0x07, 0x08, 0x0c, 0x11, 0x14, 0x39 }; // 7 - List allySelfSpells = new List { 0x1a, 0x1b, 0x1c, 0x23, 0x29, 0x2d, 0x30, 0x32, 0x34, 0x38, 0x3a }; // 11 - List allySelectSpells = new List { 0x20, 0x21, 0x28 }; // 3 - List allyAllSpells = new List { 0x19, 0x1d, 0x1e, 0x1f, 0x26, 0x2a, 0x2e, 0x31 }; // 8 - - for (int lnI = 0; lnI < 21; lnI++) - { - int effectItem = legalEffectItems[r1.Next() % legalEffectItems.Length]; - if (romData[0x11be + effectItem] >= 0x80) // If it's already been selected... - { - lnI--; - } - else - { - romData[0x11be + effectItem] += 0x80; - } - } - - int iSpell = -1; - for (int lnI = 0; lnI < legalEffectItems.Length; lnI++) - { - // Otherwise, randomize the spell it will be using. - if (romData[0x11be + legalEffectItems[lnI]] < 0x80) - continue; - - int effectSpell = legalItemSpells[r1.Next() % legalItemSpells.Length]; - if (effectSpell == 0x38 && keyEffectItems.Contains(effectSpell)) // Can't let a key item potentially crumble! Redo that randomization. - { - lnI--; - continue; - } - - iSpell++; - // Now determine what spell it is... that will determine whether to "attack" yourself, a group of monsters, a selected ally, or all monsters/allies. - if (enemyGroupSpells.Contains(effectSpell)) - romData[0x11be + legalEffectItems[lnI]] += 0x60; - else if (enemyAllSpells.Contains(effectSpell)) - romData[0x11be + legalEffectItems[lnI]] += 0x20; - else if (allySelfSpells.Contains(effectSpell)) // 50/50 chance of targetting for self or an ally. - romData[0x11be + legalEffectItems[lnI]] += (byte)(r1.Next() % 2 == 1 ? 0x00 : 0x40); - else if (allySelectSpells.Contains(effectSpell)) - romData[0x11be + legalEffectItems[lnI]] += 0x40; - else if (allyAllSpells.Contains(effectSpell)) - romData[0x11be + legalEffectItems[lnI]] += 0x00; - - romData[0x13280 + iSpell] = (byte)effectSpell; - } - + //if (chkRandItemEffects.Checked) + //{ + // // Randomize which items equate to which effects + // // Select 21 items randomly from a set defined as follows: + // int[] legalEffectItems = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + // 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + // 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + // 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + // 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 }; + + // List keyEffectItems = new List { 0x10, 0x11 }; + + // // Wipe out the use byte by totally resetting the price. + // for (int lnI = 0; lnI < legalEffectItems.Length; lnI++) + // { + // int oldVal = romData[0x11be + legalEffectItems[lnI]]; + // romData[0x11be + legalEffectItems[lnI]] = (byte)(oldVal % 32); + // //romData[0x11be + legalEffectItems[lnI]] = (byte)(oldVal % 32 >= 16 ? 0x10 : 0x00); + // //romData[0x11be + legalEffectItems[lnI]] += (byte)(oldVal % 16 >= 8 ? 0x08 : 0x00); + // } + // int oldVal1 = romData[0x11be + 0x4a]; + // romData[0x11be + 0x4a] = (byte)(oldVal1 % 32); + // int oldVal2 = romData[0x11be + 0x5b]; + // romData[0x11be + 0x5b] = (byte)(oldVal2 % 32); + + // int[] legalItemSpells = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + // 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + // 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, + // 0x30, 0x31, 0x32, 0x34, + // 0x38, 0x39, 0x3a }; // restore MP, everyone sneezes, self numb - 54 spells total + + // List enemyGroupSpells = new List { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x0a, 0x0b, 0x0d, 0x0e, 0x0f, + // 0x10, 0x12, 0x13, 0x15, 0x16, 0x17, 0x18, 0x22, 0x24, 0x25, 0x27, 0x2b, 0x2c }; // 25 + // List enemyAllSpells = new List { 0x06, 0x07, 0x08, 0x0c, 0x11, 0x14, 0x39 }; // 7 + // List allySelfSpells = new List { 0x1a, 0x1b, 0x1c, 0x23, 0x29, 0x2d, 0x30, 0x32, 0x34, 0x38, 0x3a }; // 11 + // List allySelectSpells = new List { 0x20, 0x21, 0x28 }; // 3 + // List allyAllSpells = new List { 0x19, 0x1d, 0x1e, 0x1f, 0x26, 0x2a, 0x2e, 0x31 }; // 8 + + // for (int lnI = 0; lnI < 21; lnI++) + // { + // int effectItem = legalEffectItems[r1.Next() % legalEffectItems.Length]; + // if (romData[0x11be + effectItem] >= 0x80) // If it's already been selected... + // { + // lnI--; + // } + // else + // { + // romData[0x11be + effectItem] += 0x80; + // } + // } + + // int iSpell = -1; + // for (int lnI = 0; lnI < legalEffectItems.Length; lnI++) + // { + // // Otherwise, randomize the spell it will be using. + // if (romData[0x11be + legalEffectItems[lnI]] < 0x80) + // continue; + + // int effectSpell = legalItemSpells[r1.Next() % legalItemSpells.Length]; + // if (effectSpell == 0x38 && keyEffectItems.Contains(effectSpell)) // Can't let a key item potentially crumble! Redo that randomization. + // { + // lnI--; + // continue; + // } + + // iSpell++; + // // Now determine what spell it is... that will determine whether to "attack" yourself, a group of monsters, a selected ally, or all monsters/allies. + // if (enemyGroupSpells.Contains(effectSpell)) + // romData[0x11be + legalEffectItems[lnI]] += 0x60; + // else if (enemyAllSpells.Contains(effectSpell)) + // romData[0x11be + legalEffectItems[lnI]] += 0x20; + // else if (allySelfSpells.Contains(effectSpell)) // 50/50 chance of targetting for self or an ally. + // romData[0x11be + legalEffectItems[lnI]] += (byte)(r1.Next() % 2 == 1 ? 0x00 : 0x40); + // else if (allySelectSpells.Contains(effectSpell)) + // romData[0x11be + legalEffectItems[lnI]] += 0x40; + // else if (allyAllSpells.Contains(effectSpell)) + // romData[0x11be + legalEffectItems[lnI]] += 0x00; + + // romData[0x13280 + iSpell] = (byte)effectSpell; + // } + //} + + if (chkRandEquip.Checked) { // Totally randomize weapons, armor, shields, helmets (13efb-13f1d, 1a00e-1a08b for pricing) for (int lnI = 0; lnI <= 70; lnI++) { @@ -2319,24 +2288,36 @@ private void superRandomize() } } } + } - string options = (chkHalfExpGoldReq.Checked ? "h" : ""); - options += (chkDoubleXP.Checked ? "d" : ""); - //options += (optNoIntensity.Checked ? "_none" : radSlightIntensity.Checked ? "_slight" : radModerateIntensity.Checked ? "_moderate" : radHeavyIntensity.Checked ? "_heavy" : "_insane"); - string finalFile = Path.Combine(Path.GetDirectoryName(txtFileName.Text), "DW3Random_" + txtSeed.Text + options + "_guide.txt"); + if (chkRandEquip.Checked || chkRandItemEffects.Checked || chkRandWhoCanEquip.Checked) { + string finalFile = Path.Combine(Path.GetDirectoryName(txtFileName.Text), "DW3Random_" + txtSeed.Text + "_" + txtFlags.Text + "_guide.txt"); // Totally randomize who can equip (1a3ce-1a3f0). At least one person can equip something... using (StreamWriter writer = File.CreateText(finalFile)) { + string[] weaponText = { "Cypress stick", "Club", "Copper sword", "Magic Knife", "Iron Spear", "Battle Axe", "Broad Sword", "Wizard's Wand", + "Poison Needle", "Iron Claw", "Thorn Whip", "Giant Shears", "Chain Sickle", "Thor's Sword", "Snowblast Sword", "Demon Axe", + "Staff of Rain", "Sword of Gaia", "Staff of Reflection", "Sword of Destruction", "Multi - Edge Sword", "Staff of Force", "Sword of Illusion", "Zombie Slasher", + "Falcon Sword", "Sledge Hammer", "Thunder Sword", "Staff of Thunder", "Sword of Kings", "Orochi Sword", "Dragon Killer", "Staff of Judgement", + "Clothes", "Training Suit", "Leather Armor", "Flashy Clothes", "Half Plate Armor", "Full Plate Armor", "Magic Armor", "Cloak of Evasion", + "Armor of Radiance", "Iron Apron", "Animal Suit", "Fightting Suit", "Sacred Robe", "Armor of Hades", "Water Flying Cloth", "Chain Mail", + "Wayfarers Clothes", "Revealing Swimsuit", "Magic Bikini", "Shell Armor", "Armor of Terrafirma", "Dragon Mail", "Swordedge Armor", "Angel's Robe", + "Leather Shield", "Iron Shield", "Shield of Strength", "Shield of Heroes", "Shield of Sorrow", "Bronze Shield", "Silver Shield", "Golden Crown", + "Iron Helmet", "Mysterious Hat", "Unlucky Helmet", "Turban", "Noh Mask", "Leather Helmet", "Iron Mask", "Golden Claw" }; + for (int lnI = 0; lnI <= 70; lnI++) { - // Maintain equipment requirements for the starting equipment - if (!(lnI == 0x00 || lnI == 0x01 || lnI == 0x02 || lnI == 0x20 || lnI == 0x22 || lnI == 0x30)) - romData[0x1147 + lnI] = (byte)(r1.Next() % 255 + 1); + if (chkRandWhoCanEquip.Checked) + { + // Maintain equipment requirements for the starting equipment + if (!(lnI == 0x00 || lnI == 0x01 || lnI == 0x02 || lnI == 0x20 || lnI == 0x22 || lnI == 0x30)) + romData[0x1147 + lnI] = (byte)(r1.Next() % 255 + 1); - // EXCEPT those that are "FF", update the "who can use the item" to the people who are allowed to equip the item - if (romData[0x1196 + lnI] != 255 && romData[0x1196 + lnI] != 0 && lnI < 32) - romData[0x1196 + lnI] = romData[0x1147 + lnI]; + // EXCEPT those that are "FF", update the "who can use the item" to the people who are allowed to equip the item + if (romData[0x1196 + lnI] != 255 && romData[0x1196 + lnI] != 0 && lnI < 32) + romData[0x1196 + lnI] = romData[0x1147 + lnI]; + } string equipOut = ""; equipOut += (romData[0x1147 + lnI] % 2 >= 1 ? "Hr " : "-- "); @@ -2382,6 +2363,13 @@ private void superRandomize() int[] pilgrimFight = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53 }; int[] wizardFight = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 53 }; + int[] heroFightLevels = inverted_power_curve(1, 35, 24, 1, r1); + int[] pilgrimFightLevels = inverted_power_curve(1, 35, 24, 1, r1); + int[] wizardFightLevels = inverted_power_curve(1, 35, 24, 1, r1); + int[] heroCommandLevels = inverted_power_curve(1, 35, 8, 1, r1); + int[] pilgrimCommandLevels = inverted_power_curve(1, 35, 8, 1, r1); + int[] wizardCommandLevels = inverted_power_curve(1, 35, 8, 1, r1); + bool legal = false; while (!legal) { @@ -2423,9 +2411,9 @@ private void superRandomize() for (int lnI = 0; lnI < 8; lnI++) { - romData[0x29d6 + heroCommand[lnI]] = (byte)(r1.Next() % 35 + 1); - romData[0x2a15 + pilgrimCommand[lnI]] = (byte)(r1.Next() % 35 + 1); - romData[0x2a54 + wizardCommand[lnI]] = (byte)(r1.Next() % 35 + 1); + romData[0x29d6 + heroCommand[lnI]] = (byte)heroCommandLevels[lnI]; // (byte)(r1.Next() % 35 + 1); + romData[0x2a15 + pilgrimCommand[lnI]] = (byte)pilgrimCommandLevels[lnI]; // (r1.Next() % 35 + 1); + romData[0x2a54 + wizardCommand[lnI]] = (byte)wizardCommandLevels[lnI]; // (r1.Next() % 35 + 1); romData[0x2a93 + pilgrimCommand[lnI]] = romData[0x2a15 + pilgrimCommand[lnI]]; romData[0x2a93 + wizardCommand[lnI]] = romData[0x2a54 + wizardCommand[lnI]]; romData[0x22e7 + 24 + lnI] = (byte)heroCommand[lnI]; @@ -2433,13 +2421,13 @@ private void superRandomize() romData[0x22e7 + 64 + 24 + lnI] = (byte)wizardCommand[lnI]; } romData[0x22e7 + 24] = 38; // Hero learns Return first. - romData[0x29d6 + romData[0x22e7 + 24]] = 2; + romData[0x29d6 + romData[0x22e7 + 24]] = (byte)heroCommandLevels[0]; romData[0x22e7 + 24 + 1] = 59; // ... and Outside - romData[0x29d6 + romData[0x22e7 + 24 + 1]] = 2; + romData[0x29d6 + romData[0x22e7 + 24 + 1]] = (byte)heroCommandLevels[1]; romData[0x22e7 + 32 + 24] = 26; // Wizard learns Heal first. - romData[0x29d6 + romData[0x22e7 + 32 + 24]] = 2; + romData[0x29d6 + romData[0x22e7 + 32 + 24]] = (byte)wizardCommandLevels[0]; romData[0x22e7 + 64 + 24] = 52; // Pilgrim learns Antidote first. - romData[0x29d6 + romData[0x22e7 + 64 + 24]] = 2; + romData[0x29d6 + romData[0x22e7 + 64 + 24]] = (byte)pilgrimCommandLevels[0]; romData[0x29d6 + 63 + romData[0x22e7 + 32 + 24]] = 1; romData[0x29d6 + 126 + romData[0x22e7 + 64 + 24]] = 1; @@ -2447,9 +2435,9 @@ private void superRandomize() for (int lnI = 0; lnI < 24; lnI++) { if (lnI < 16) - romData[0x29d6 + heroFight[lnI]] = (byte)(r1.Next() % 35 + 1); - romData[0x2a15 + pilgrimFight[lnI]] = (byte)(r1.Next() % 35 + 1); - romData[0x2a54 + wizardFight[lnI]] = (byte)(r1.Next() % 35 + 1); + romData[0x29d6 + heroFight[lnI]] = (byte)heroFightLevels[lnI]; // (byte)(r1.Next() % 35 + 1); + romData[0x2a15 + pilgrimFight[lnI]] = (byte)pilgrimFightLevels[lnI]; // (byte)(r1.Next() % 35 + 1); + romData[0x2a54 + wizardFight[lnI]] = (byte)wizardFightLevels[lnI]; // (byte)(r1.Next() % 35 + 1); romData[0x2a93 + pilgrimFight[lnI]] = romData[0x2a15 + pilgrimFight[lnI]]; romData[0x2a93 + wizardFight[lnI]] = romData[0x2a54 + wizardFight[lnI]]; if (lnI < 16) @@ -2491,6 +2479,9 @@ private void superRandomize() if (chkRandTreasures.Checked) { + // If the yellow orb is at a searchable spot, it won't be found unless you change this byte from 0x79 to 0x80+. SUPER WEIRD! + romData[0x31828] = 0xff; + bool legal = false; // Totally randomize treasures... but make sure key items exist before they are needed! @@ -2565,13 +2556,13 @@ private void superRandomize() List treasureList = new List(); byte[] legalTreasures = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x48, 0x49, 0x4b, 0x4c, 0x4e, 0x4f, - 0x50, 0x51, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5c, 0x5d, 0x5f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x48, 0x49, 0x4b, 0x4c, 0x4e, + 0x53, 0x55, 0x56, 0x5c, 0x5f, 0x60, 0x62, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6c, 0x6d, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x78, 0x79, 0x7a, 0x7b, + 0x70, 0x71, 0x73, 0x74, 0x88, 0x90, 0x98, 0xa0, 0xa8, 0xb0, 0xb8, 0xc0, 0xc8, 0xd0, 0xd8, 0xe0, 0xe8, 0xf0, 0xf8, 0xfd, 0xfe, 0xff, 0xfd, 0xfe, 0xff, 0xfd, 0xfe, 0xff, 0xfd, 0xfe, 0xff, 0xfd, 0xfe, 0xff}; for (int lnI = 0; lnI < allTreasureList.Count; lnI++) @@ -2591,31 +2582,9 @@ private void superRandomize() //byte[] keyTreasure = { 37, 116, 124, 130, 133, 133, 133, 133, 165, 165 }; // We need to make sure key items doesn't exceed a certain point in the story. - if ((treasure == 0x58 && lnI >= 6) || - (treasure == 0x57 && lnI >= 8) || - (treasure == 0x59 && lnI >= 36) || - (treasure == 0x5d && lnI >= 56) || - (treasure == 0x4f && lnI >= 74) || - (treasure == 0x5a && lnI >= 88) || - (treasure == 0x51 && lnI >= 119) || - (treasure == 0x54 && lnI >= 120) || - (treasure == 0x11 && lnI >= 126) || - (treasure == 0x77 && lnI >= 129) || - (treasure == 0x78 && lnI >= 129) || - (treasure == 0x79 && lnI >= 129) || - (treasure == 0x7a && lnI >= 129) || - (treasure == 0x7b && lnI >= 129) || - (treasure == 0x7c && lnI >= 129) || - (treasure == 0x72 && !(lnI >= 130 && lnI <= 166)) || - (treasure == 0x10 && !(lnI >= 130 && lnI <= 159)) || - (treasure == 0x75 && !(lnI >= 130 && lnI <= 159))) - continue; // Verify that only one location exists for key items - if (!(treasureList.Contains(treasure) && (treasure == 0x58 || treasure == 0x57 || treasure == 0x59 || treasure == 0x5d || treasure == 0x4f - || treasure == 0x5a || treasure == 0x51 || treasure == 0x54 || treasure == 0x11 || treasure == 0x4f || treasure == 0x53 - || treasure == 0x77 || treasure == 0x78 || treasure == 0x79 || treasure == 0x7a || treasure == 0x7b || treasure == 0x7c - || treasure == 0x5c || treasure == 0x70 || treasure == 0x71 || treasure == 0x72 || treasure == 0x10 || treasure == 0x75))) + if (!(treasureList.Contains(treasure) && (treasure == 0x53 || treasure == 0x5c || treasure == 0x70 || treasure == 0x71))) { legal = true; treasureList.Add(treasure); @@ -2628,118 +2597,234 @@ private void superRandomize() byte[] keyItems = { 0x58, 0x57, 0x59, 0x5d, 0x4f, 0x5a, 0x51, 0x54, 0x11, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x10, 0x75, 0x72, 0x50 }; byte[] minKeyTreasure = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, 130, 130, 0 }; byte[] keyTreasure = { 6, 8, 36, 56, 74, 88, 119, 120, 126, 129, 129, 129, 129, 129, 129, 159, 159, 166, 166 }; - for (int lnI = 0; lnI < keyItems.Length; lnI++) + + int echoingFluteMarker = 0; + for (int lnJ = 0; lnJ < keyItems.Length; lnJ++) { - legal = false; - for (int lnJ = minKeyTreasure[lnI]; lnJ < keyTreasure[lnI]; lnJ++) + int treasureLocation = allTreasure[minKeyTreasure[lnJ] + (r1.Next() % (keyTreasure[lnJ] - minKeyTreasure[lnJ]))]; + if (keyItems.Contains(romData[treasureLocation])) { - if (romData[allTreasure[lnJ]] == keyItems[lnI]) - legal = true; + lnJ--; + continue; } + romData[treasureLocation] = keyItems[lnJ]; + + // Echoing Flute business. 01 = Silver, 02 = Red, 04 = Yellow, 08 = Purple, 10 = Blue, 20 = Green + if (keyItems[lnJ] >= 0x77 && keyItems[lnJ] <= 0x7c) + { + bool finished = false; + byte[] echoLocations; + byte orbNumber = (byte)(Math.Pow(2, Math.Abs(0x77 - keyItems[lnJ]))); + + if (new int[] { 0x29237, 0x29238, 0x29239 }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x2d }; + else if (new int[] { 0x2927b, 0x292C4, 0x292C5, 0x292c6, 0x2927c, 0x2927d }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x9f, 0x3c, 0xed, 0xd6, 0xd7, 0xd8 }; + else if (new int[] { 0x2927e, 0x2927f }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x98, 0xa0, 0xa1, 0xa2 }; + else if (new int[] { 0x29234, 0x29235 }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x14 }; + else if (new int[] { 0x2923a, 0x2923b, 0x29280, 0x29281, 0x29282, 0x29283, 0x29284, 0x29285, 0x29286, 0x29287 }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x2e, 0xa3, 0xa4, 0xa5 }; + else if (new int[] { 0x2925c, 0x31b9c, 0x2925d, 0x2925e, 0x2925f, 0x29260, 0x29261, 0x29262, 0x29263, 0x29264 }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x96, 0x50, 0x51, 0x52, 0x87, 0x55, 0x54, 0x53, 0x56, 0x57 }; + else if (new int[] { 0x29255, 0x29256, 0x29257, 0x29258, 0x29249, 0x2924a }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47 }; + else if (new int[] { 0x29249, 0x2924a, 0x2924b, 0x2924c, 0x2924d, 0x2924e, 0x2924f, 0x292b4, 0x292b5, 0x292b6, 0x292c3, 0x317f4 }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x3b, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5 }; + else if (new int[] { 0x2923c, 0x2923d }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x2f }; + else if (new int[] { 0x29251, 0x292c7, 0x292c8, 0x292c9, 0x292ca, 0x292b7 }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x3d, 0xdb, 0xdc, 0xdd, 0xde }; + else if (new int[] { 0x29242, 0x29240, 0x2923f, 0x2923e, 0x29241, 0x29243, 0x2928b, 0x2928c, 0x2928e, 0x2928d }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x3f, 0xb2 }; + else if (new int[] { 0x31b94, 0x29270 }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x15, 0x85, 0x86 }; + else if (new int[] { 0x292e4, 0x292e7 }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x24, 0x8a }; + else if (new int[] { 0x29272, 0x29271, 0x29273 }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x18, 0x8b, 0x8c }; + else if (new int[] { 0x292d1, 0x292d0, 0x292cf, 0x292cd, 0x292ce, 0x292cc, 0x292cb }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x3e, 0xe4, 0xe5, 0xe6, 0xe7 }; + else if (new int[] { 0x29299, 0x2929c, 0x2929b, 0x2929d, 0x2929a, 0x29298, 0x29293, 0x29294, 0x29295, 0x29291, 0x29292, 0x29296, 0x29297, 0x292a3, 0x292a4, 0x292a2, 0x2929f, 0x2929e, 0x292a0, 0x292a5, 0x292a6, 0x292a1, 0x292a7, 0x29296}.Contains(treasureLocation)) + echoLocations = new byte[] { 0x37, 0xbe, 0xbf }; + else if (new int[] { 0x29246, 0x29248, 0x29247, 0x29245, 0x29244, 0x29290, 0x2928f }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x36, 0xbc, 0xbd }; + else if (new int[] { 0x292e5 }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x06, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x99 }; + else if (new int[] { 0x29277, 0x29276, 0x29275, 0x29278, 0x29279, 0x2927a }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x9c, 0x9d }; + else if (new int[] { 0x29288, 0x29289, 0x2928a }.Contains(treasureLocation)) + echoLocations = new byte[] { 0x32, 0xa8, 0xa9, 0xaa, 0x31 }; + else + echoLocations = new byte[] { }; - // If legal = false, then the item was not found, so we'll have to place it in a treasure somewhere... - while (!legal) - { - byte tRand = (byte)((r1.Next() % (keyTreasure[lnI] - minKeyTreasure[lnI] + 1)) + minKeyTreasure[lnI]); - - bool dupCheck = false; - // Make sure we're not replacing a item that also happens to be key! - for (int lnJ = 0; lnJ < keyItems.Length; lnJ++) + for (int i = 0; i < echoLocations.Length; i++) { - if (romData[allTreasure[tRand]] == keyItems[lnJ]) - dupCheck = true; + romData[0x33c51 + echoingFluteMarker] = orbNumber; + echoingFluteMarker++; + + romData[0x33c51 + echoingFluteMarker] = echoLocations[i]; + echoingFluteMarker++; } - if (dupCheck == false) + while (!finished) { - romData[allTreasure[tRand]] = keyItems[lnI]; - legal = true; } } } + + // Echoing Flute business... + byte[] echoingFlute = { 0xA5, 0x2F, 0xD0, 0x0E, 0x00, 0x1E, 0x2F, 0x00, 0x44, 0x17, 0x00, 0x0D, 0x77, 0x20, 0x33, 0xCB, + 0x38, 0x60, 0xA2, 0x00, 0xBD, 0x41, 0xBC, 0xF0, 0xEB, 0xE8, 0xBC, 0x41, 0xBC, 0xE8, 0x2D, 0xCE, + 0x60, 0xD0, 0xF1, 0xC4, 0x8B, 0xD0, 0xED, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, + 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0x4C, 0x59, 0xA2 }; // 0xC9, 0x04, 0xD0, 0x0B, 0xAD, 0xCD, 0x60, 0xC8, 0xD0, 0xE0, + + for (int i = 0; i < echoingFlute.Length; i++) + { + romData[0x32228 + i] = echoingFlute[i]; + } + + // The Golden Claw location has a trigger that needs to be set so it can only be retrieved once instead of an infinite amount of times. + romData[0x319a0] = romData[0x317f4]; } if (chkRandStores.Checked) { // Totally randomize stores (19 weapon stores, 24 item stores, 248 items total) No store can have more than 12 items. // I would just create random values for 248 items, then determine weapon and item stores out of that! - int[] legalStoreItems = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + byte[] legalStoreWeapons = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, - 0x48, 0x49, 0x4b, 0x4c, 0x4e, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 + }; + byte[] legalStoreItems = { 0x48, 0x49, 0x4b, 0x4c, 0x4e, 0x53, 0x55, 0x56, 0x5f, - 0x60, 0x62, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6c, 0x6d, + 0x60, 0x62, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6c, 0x6f, 0x70, 0x71, 0x73, 0x74, 0x56, 0x65, 0x66, 0x67, 0x68, 0x6c, 0x73, 0x74, 0x56, 0x65, 0x66, 0x67, 0x68, 0x6c, 0x73, 0x74, 0x56, 0x65, 0x66, 0x67, 0x68, 0x6c, 0x73, 0x74 - }; - - int[] storeItems = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - List itemStore = new List(); - List weaponStore = new List(); - for (int lnI = 0; lnI < 248; lnI++) - romData[0x36838 + lnI] = (byte)(legalStoreItems[(r1.Next() % legalStoreItems.Length)]); - - int[] weaponStoreLocations = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247 }; - - int lnMarker = -1; - // Need to make sure this doesn't exceed 11 - int average = 248 / weaponStoreLocations.Length; - for (int lnI = 0; lnI < weaponStoreLocations.Length - 1; lnI++) - { - int storeSize = average; - storeSize += (-3 + (r1.Next() % 7)); - if (storeSize > 12 || average >= 10) - storeSize = 12; - lnMarker += storeSize; - weaponStoreLocations[lnI] = lnMarker; - int avgPart1 = 248 - lnMarker + 1; - int avgPart2 = weaponStoreLocations.Length - lnI - 1; - average = ((248 - lnMarker + 1) / (weaponStoreLocations.Length - lnI - 1)); - } - - // Now we can plug in the numbers... - for (int lnI = 0; lnI < weaponStoreLocations.Length; lnI++) - romData[0x36838 + weaponStoreLocations[lnI]] += 128; - - // Go through each of the stores and check for duplicates. - int startStore = 0; - List storeContents = new List { }; - for (int lnI = 0; lnI < 248; lnI++) - { - bool lastItem = (romData[0x36838 + lnI] >= 128); - int itemToCompare = (romData[0x36838 + lnI] >= 128 ? romData[0x36838 + lnI] - 128 : romData[0x36838 + lnI]); - if (storeContents.Contains(itemToCompare)) - { - romData[0x36838 + lnI] = (byte)((lastItem ? 128 : 0) + legalStoreItems[r1.Next() % legalStoreItems.Length]); - lnI = startStore - 1; - storeContents.Clear(); - continue; - } - storeContents.Add(itemToCompare); - if (lastItem) - { - storeContents.Clear(); - startStore = lnI + 1; - } - } + }; + + int[] weaponStores = { 0x36838, 0x3683f, 0x36846, 0x3684d, 0x36854, 0x3685b, 0x36862, 0x36869, 0x3686e, 0x36874, 0x3687a, 0x36880, 0x36887, 0x3688d, 0x36893, 0x3689a, 0x368a1, 0x368a7, 0x368ae }; // 42 + int[] itemStores = { 0x368b4, 0x368b7, 0x368be, 0x368c4, 0x368ca, 0x368d0, 0x368d6, 0x368db, 0x368e0, 0x368e2, 0x368e6, 0x368ec, 0x368f2, 0x368f4, 0x368fa, 0x368ff, 0x36905, 0x36908, 0x3690e, 0x36914, 0x3691a, 0x36920, 0x36927, 0x3692b }; // 22 + + for (int lnI = 0; lnI < weaponStores.Length; lnI++) + { + List store = new List { }; + bool lastItem = false; + int byteToUse = weaponStores[lnI]; + int lnJ = 0; + do + { + if (romData[byteToUse + lnJ] >= 128) + lastItem = true; + romData[byteToUse + lnJ] = legalStoreWeapons[r1.Next() % legalStoreWeapons.Length]; + bool failure = false; + for (int lnK = 0; lnK < lnJ; lnK++) + if (romData[byteToUse + lnJ] == romData[byteToUse + lnK]) + failure = true; + if (lastItem) + romData[byteToUse + lnJ] += 128; + if (failure) + { + lastItem = false; + continue; + } + lnJ++; + } while (!lastItem); + } + for (int lnI = 0; lnI < itemStores.Length; lnI++) + { + List store = new List { }; + bool lastItem = false; + int byteToUse = itemStores[lnI]; + int lnJ = 0; + do + { + if (romData[byteToUse + lnJ] >= 128) + lastItem = true; + romData[byteToUse + lnJ] = legalStoreItems[r1.Next() % legalStoreItems.Length]; + bool failure = false; + for (int lnK = 0; lnK < lnJ; lnK++) + if (romData[byteToUse + lnJ] == romData[byteToUse + lnK]) + failure = true; + if (lastItem) + romData[byteToUse + lnJ] += 128; + if (failure) + { + lastItem = false; + continue; + } + lnJ++; + } while (!lastItem); + } + + //int[] storeItems = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + //List itemStore = new List(); + //List weaponStore = new List(); + //for (int lnI = 0; lnI < 248; lnI++) + // romData[0x36838 + lnI] = (byte)(legalStoreItems[(r1.Next() % legalStoreItems.Length)]); + + //int[] weaponStoreLocations = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247 }; + + //int lnMarker = -1; + //// Need to make sure this doesn't exceed 11 + //int average = 248 / weaponStoreLocations.Length; + //for (int lnI = 0; lnI < weaponStoreLocations.Length - 1; lnI++) + //{ + // int storeSize = average; + // storeSize += (-3 + (r1.Next() % 7)); + // if (storeSize > 12 || average >= 10) + // storeSize = 12; + // lnMarker += storeSize; + // weaponStoreLocations[lnI] = lnMarker; + // int avgPart1 = 248 - lnMarker + 1; + // int avgPart2 = weaponStoreLocations.Length - lnI - 1; + // average = ((248 - lnMarker + 1) / (weaponStoreLocations.Length - lnI - 1)); + //} + + //// Now we can plug in the numbers... + //for (int lnI = 0; lnI < weaponStoreLocations.Length; lnI++) + // romData[0x36838 + weaponStoreLocations[lnI]] += 128; + + //// Go through each of the stores and check for duplicates. + //int startStore = 0; + //List storeContents = new List { }; + //for (int lnI = 0; lnI < 248; lnI++) + //{ + // bool lastItem = (romData[0x36838 + lnI] >= 128); + // int itemToCompare = (romData[0x36838 + lnI] >= 128 ? romData[0x36838 + lnI] - 128 : romData[0x36838 + lnI]); + // if (storeContents.Contains(itemToCompare)) + // { + // romData[0x36838 + lnI] = (byte)((lastItem ? 128 : 0) + legalStoreItems[r1.Next() % legalStoreItems.Length]); + // lnI = startStore - 1; + // storeContents.Clear(); + // continue; + // } + // storeContents.Add(itemToCompare); + // if (lastItem) + // { + // storeContents.Clear(); + // startStore = lnI + 1; + // } + //} // Inn prices randomized for (int lnI = 0; lnI < 26; lnI++) @@ -2993,6 +3078,20 @@ private void superRandomize() } } + private int[] inverted_power_curve(int min, int max, int arraySize, double powToUse, Random r1) + { + int range = max - min; + double p_range = Math.Pow(range, 1 / powToUse); + int[] points = new int[arraySize]; + for (int i = 0; i < arraySize; i++) + { + double section = (double)r1.Next() / int.MaxValue; + points[i] = (int)Math.Round(max - Math.Pow(section * p_range, powToUse)); + } + Array.Sort(points); + return points; + } + private List addTreasure(List currentList, int[] treasureData) { for (int lnI = 0; lnI < treasureData.Length; lnI++) @@ -3041,25 +3140,6 @@ private int[] swapArray(int[] array, int first, int second) return array; } - // Reserve for another time... - private void button1_Click(object sender, EventArgs e) - { - if (!loadRom()) return; - halfExpAndGoldReq(true); - for (int lnI = 0; lnI < 68; lnI++) - { - int byteToUse = 0x10519 + (lnI * 6); - byte valToUpdate = (byte)(129 + lnI); - romData[byteToUse + 0] = valToUpdate; - romData[byteToUse + 1] = valToUpdate; - romData[byteToUse + 2] = valToUpdate; - romData[byteToUse + 3] = valToUpdate; - romData[byteToUse + 4] = valToUpdate; - romData[byteToUse + 5] = valToUpdate; - } - saveRom(); - } - private void btnCompare_Click(object sender, EventArgs e) { if (!loadRom(true)) return; @@ -3253,7 +3333,7 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e) using (StreamWriter writer = File.CreateText("lastFile.txt")) { writer.WriteLine(txtFileName.Text); - writer.WriteLine(txtCompare.Text); + writer.WriteLine(txtFlags.Text); writer.WriteLine(txtDefault1.Text); writer.WriteLine(txtDefault2.Text); writer.WriteLine(txtDefault3.Text); @@ -3328,5 +3408,82 @@ private StreamWriter outputComposeString(string intro, StreamWriter writer, int writer.WriteLine(); return writer; } + + private void determineChecks() + { + string flags = txtFlags.Text; + int number = convertChartoInt(Convert.ToChar(flags.Substring(0, 1))); + optMonsterLight.Checked = (number == 0); + optMonsterSilly.Checked = (number == 1); + optMonsterMedium.Checked = (number == 2); + optMonsterHeavy.Checked = (number == 3); + + number = convertChartoInt(Convert.ToChar(flags.Substring(1, 1))); + cboExpGains.SelectedIndex = (number % 8); + cboEncounterRate.SelectedIndex = (number / 8); + + number = convertChartoInt(Convert.ToChar(flags.Substring(2, 1))); + cboGoldReq.SelectedIndex = (number % 4); + chkRandomizeXP.Checked = (number % 8 >= 4); + chkRandomizeGP.Checked = (number % 16 >= 8); + chkFasterBattles.Checked = (number % 32 >= 16); + chkSpeedText.Checked = (number >= 32); + + number = convertChartoInt(Convert.ToChar(flags.Substring(3, 1))); + chkRandStores.Checked = (number % 2 == 1); + chkRandEnemyPatterns.Checked = (number % 4 >= 2); + chkRandSpellLearning.Checked = (number % 8 >= 4); + chkRandStatGains.Checked = (number % 16 >= 8); + chkRandTreasures.Checked = (number % 32 >= 16); + chkRandMonsterZones.Checked = (number >= 32); + + number = convertChartoInt(Convert.ToChar(flags.Substring(4, 1))); + chkRandEquip.Checked = (number % 2 == 1); + //chkRandItemEffects.Checked = (number % 4 >= 2); + chkRandItemEffects.Checked = false; + chkRandWhoCanEquip.Checked = (number % 8 >= 4); + chkRandSpellStrength.Checked = (number % 16 >= 8); + chkRandomizeMap.Checked = (number % 32 >= 16); + chkSmallMap.Checked = (number >= 32); + } + + private void determineFlags(object sender, EventArgs e) + { + if (loading) return; + + string flags = ""; + flags += convertIntToChar(optMonsterLight.Checked ? 0 : optMonsterSilly.Checked ? 1 : optMonsterMedium.Checked ? 2 : 3); + flags += convertIntToChar(cboExpGains.SelectedIndex + (8 * cboEncounterRate.SelectedIndex)); + flags += convertIntToChar((cboGoldReq.SelectedIndex) + (chkRandomizeXP.Checked ? 4 : 0) + (chkRandomizeGP.Checked ? 8 : 0) + (chkFasterBattles.Checked ? 16 : 0) + (chkSpeedText.Checked ? 32 : 0)); + flags += convertIntToChar((chkRandStores.Checked ? 1 : 0) + (chkRandEnemyPatterns.Checked ? 2 : 0) + (chkRandSpellLearning.Checked ? 4 : 0) + (chkRandStatGains.Checked ? 8 : 0) + (chkRandTreasures.Checked ? 16 : 0) + (chkRandMonsterZones.Checked ? 32 : 0)); + flags += convertIntToChar((chkRandEquip.Checked ? 1 : 0) + (chkRandItemEffects.Checked ? 2 : 0) + (chkRandWhoCanEquip.Checked ? 4 : 0) + (chkRandSpellStrength.Checked ? 8 : 0) + (chkRandomizeMap.Checked ? 16 : 0) + (chkSmallMap.Checked ? 32 : 0)); + txtFlags.Text = flags; + } + + private string convertIntToChar(int number) + { + if (number >= 0 && number <= 9) + return number.ToString(); + if (number >= 10 && number <= 35) + return Convert.ToChar(55 + number).ToString(); + if (number >= 36 && number <= 61) + return Convert.ToChar(61 + number).ToString(); + if (number == 62) return "!"; + if (number == 63) return "@"; + return ""; + } + + private int convertChartoInt(char character) + { + if (character >= Convert.ToChar("0") && character <= Convert.ToChar("9")) + return character - 48; + if (character >= Convert.ToChar("A") && character <= Convert.ToChar("Z")) + return character - 55; + if (character >= Convert.ToChar("a") && character <= Convert.ToChar("z")) + return character - 61; + if (character == Convert.ToChar("!")) return 62; + if (character == Convert.ToChar("@")) return 63; + return 0; + } } } diff --git a/DW3Randomizer/bin/Debug/DW3Randomizer.exe b/DW3Randomizer/bin/Debug/DW3Randomizer.exe index 2d00fba..562c017 100644 Binary files a/DW3Randomizer/bin/Debug/DW3Randomizer.exe and b/DW3Randomizer/bin/Debug/DW3Randomizer.exe differ diff --git a/DW3Randomizer/bin/Debug/DW3Randomizer.exe.config b/DW3Randomizer/bin/Debug/DW3Randomizer.exe.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/DW3Randomizer/bin/Debug/DW3Randomizer.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DW3Randomizer/bin/Debug/DW3Randomizer.pdb b/DW3Randomizer/bin/Debug/DW3Randomizer.pdb new file mode 100644 index 0000000..0021759 Binary files /dev/null and b/DW3Randomizer/bin/Debug/DW3Randomizer.pdb differ diff --git a/DW3Randomizer/bin/Debug/lastFile.txt b/DW3Randomizer/bin/Debug/lastFile.txt new file mode 100644 index 0000000..e7b5afc --- /dev/null +++ b/DW3Randomizer/bin/Debug/lastFile.txt @@ -0,0 +1,14 @@ +C:\bizhawk\dw3 test\Dragon Warrior III (U) (PRG0) [!].nes +0umGW +Brindar +Ragnar +Adan +Glennard +Theson +Elucidus +Harley +Mathias +Sartris +Petrus +Hiram +Viron diff --git a/DW3Randomizer/obj/Debug/CoreCompileInputs.cache b/DW3Randomizer/obj/Debug/CoreCompileInputs.cache new file mode 100644 index 0000000..4215091 --- /dev/null +++ b/DW3Randomizer/obj/Debug/CoreCompileInputs.cache @@ -0,0 +1 @@ +fc507757433b8be2a3973780b33c6d451bc0a554 diff --git a/DW3Randomizer/obj/Debug/DW3Randomizer.Form1.resources b/DW3Randomizer/obj/Debug/DW3Randomizer.Form1.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/DW3Randomizer/obj/Debug/DW3Randomizer.Form1.resources differ diff --git a/DW3Randomizer/obj/Debug/DW3Randomizer.Properties.Resources.resources b/DW3Randomizer/obj/Debug/DW3Randomizer.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/DW3Randomizer/obj/Debug/DW3Randomizer.Properties.Resources.resources differ diff --git a/DW3Randomizer/obj/Debug/DW3Randomizer.csproj.FileListAbsolute.txt b/DW3Randomizer/obj/Debug/DW3Randomizer.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..d3949b6 --- /dev/null +++ b/DW3Randomizer/obj/Debug/DW3Randomizer.csproj.FileListAbsolute.txt @@ -0,0 +1,9 @@ +C:\Users\Pete10th\Source\Repos\DW3Randomizer\DW3Randomizer\bin\Debug\DW3Randomizer.exe.config +C:\Users\Pete10th\Source\Repos\DW3Randomizer\DW3Randomizer\bin\Debug\DW3Randomizer.exe +C:\Users\Pete10th\Source\Repos\DW3Randomizer\DW3Randomizer\bin\Debug\DW3Randomizer.pdb +C:\Users\Pete10th\Source\Repos\DW3Randomizer\DW3Randomizer\obj\Debug\DW3Randomizer.csprojResolveAssemblyReference.cache +C:\Users\Pete10th\Source\Repos\DW3Randomizer\DW3Randomizer\obj\Debug\DW3Randomizer.Form1.resources +C:\Users\Pete10th\Source\Repos\DW3Randomizer\DW3Randomizer\obj\Debug\DW3Randomizer.Properties.Resources.resources +C:\Users\Pete10th\Source\Repos\DW3Randomizer\DW3Randomizer\obj\Debug\DW3Randomizer.csproj.GenerateResource.Cache +C:\Users\Pete10th\Source\Repos\DW3Randomizer\DW3Randomizer\obj\Debug\DW3Randomizer.exe +C:\Users\Pete10th\Source\Repos\DW3Randomizer\DW3Randomizer\obj\Debug\DW3Randomizer.pdb diff --git a/DW3Randomizer/obj/Debug/DW3Randomizer.csproj.GenerateResource.Cache b/DW3Randomizer/obj/Debug/DW3Randomizer.csproj.GenerateResource.Cache new file mode 100644 index 0000000..341d1a3 Binary files /dev/null and b/DW3Randomizer/obj/Debug/DW3Randomizer.csproj.GenerateResource.Cache differ diff --git a/DW3Randomizer/obj/Debug/DW3Randomizer.csprojResolveAssemblyReference.cache b/DW3Randomizer/obj/Debug/DW3Randomizer.csprojResolveAssemblyReference.cache new file mode 100644 index 0000000..80ad4fb Binary files /dev/null and b/DW3Randomizer/obj/Debug/DW3Randomizer.csprojResolveAssemblyReference.cache differ diff --git a/DW3Randomizer/obj/Debug/DW3Randomizer.exe b/DW3Randomizer/obj/Debug/DW3Randomizer.exe index 2d00fba..562c017 100644 Binary files a/DW3Randomizer/obj/Debug/DW3Randomizer.exe and b/DW3Randomizer/obj/Debug/DW3Randomizer.exe differ diff --git a/DW3Randomizer/obj/Debug/DW3Randomizer.pdb b/DW3Randomizer/obj/Debug/DW3Randomizer.pdb new file mode 100644 index 0000000..0021759 Binary files /dev/null and b/DW3Randomizer/obj/Debug/DW3Randomizer.pdb differ diff --git a/DW3Randomizer/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/DW3Randomizer/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..21c9a11 Binary files /dev/null and b/DW3Randomizer/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/DW3Randomizer/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/DW3Randomizer/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..9924986 Binary files /dev/null and b/DW3Randomizer/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/DW3Randomizer/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/DW3Randomizer/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs new file mode 100644 index 0000000..e69de29 diff --git a/DW3Randomizer/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/DW3Randomizer/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/DW3Randomizer/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/DW3Randomizer/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/DW3Randomizer/obj/Release/CoreCompileInputs.cache b/DW3Randomizer/obj/Release/CoreCompileInputs.cache new file mode 100644 index 0000000..4215091 --- /dev/null +++ b/DW3Randomizer/obj/Release/CoreCompileInputs.cache @@ -0,0 +1 @@ +fc507757433b8be2a3973780b33c6d451bc0a554