From 38a0a13014f4bab902411bf8d1a3e0c6c3c4d9b5 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Mon, 3 Feb 2020 12:32:16 -0600 Subject: [PATCH 01/21] Added the ability to save and load settings (presets) --- Paramdomizer/Form1.cs | 222 +++++++++++++++++++++++++++++++++ Paramdomizer/Form1.designer.cs | 29 ++++- Paramdomizer/Form1.resx | 3 - 3 files changed, 250 insertions(+), 4 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index 93ee977..a8f27cf 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -6989,5 +6989,227 @@ private void chkKnockback_CheckedChanged(object sender, EventArgs e) { } + + private void btnLoadPreset_Click(object sender, EventArgs e) + { + OpenFileDialog dialog = new OpenFileDialog(); + dialog.Filter = "presets (*.prndpr)|*.prndpr|All files (*.*)|*.*"; + if (dialog.ShowDialog() == DialogResult.OK) + { + String presetName = dialog.FileName; + Stream s = dialog.OpenFile(); + + Console.WriteLine("Loading..."); + + //header (aka check if is valid config) + byte[] header = new byte[10]; + s.Read(header, 0, 10); + if(header[0] != 30 || header[1] != 10 || header[2] != 40 || header[3] != 10 || header[4] != 50 || + header[5] != 90 || header[6] != 20 || header[7] != 60 || header[8] != 50 || header[9] != 30 ) + { + lblMessage.Name = ""; + lblMessage.Text = "Invalid Preset File!"; + lblMessage.ForeColor = Color.Red; + lblMessage.Visible = true; + s.Close(); + return; + } + + //seed string + byte[] stringBytes = new byte[128]; + s.Read(stringBytes, 0, 128); + txtSeed.Text = System.Text.Encoding.ASCII.GetString(stringBytes); + + //byte reading now so that the checkbox setting can be done in any order (byte reading MUST be done in the order presets have saved) + int w1 = s.ReadByte(); //weapon's 1st byte + int w2 = s.ReadByte(); //weapon's 2nd byte + int e1 = s.ReadByte(); //enemies byte + int ep1 = s.ReadByte(); //enemy and player byte + int a1 = s.ReadByte(); //armor byte + int s1 = s.ReadByte(); //spells byte + int o1 = s.ReadByte(); //other settings byte (options in the other settings tab) + int altRand1 = s.ReadByte(); //alternative randomization (don't randomize by shuffle) + + + //weapons 1st byte + chkWeaponDamage.Checked = getState(w1, 0); + chkWeaponMoveset.Checked = getState(w1, 1); + chkWeaponModels.Checked = getState(w1, 2); + checkBoxWeaponWeight.Checked = getState(w1, 3); + checkBoxWeaponScaling.Checked = getState(w1, 4); + checkBoxWeaponStamina.Checked = getState(w1, 5); + checkBoxWeaponStatMin.Checked = getState(w1, 6); + chkWeaponSpeffects.Checked = getState(w1, 7); + + //weapons 2nd byte + checkBoxWeaponDefense.Checked = getState(w2, 0); + checkBoxWeaponShieldSplit.Checked = getState(w2, 1); + checkBoxWeaponFistNo.Checked = getState(w2, 2); + checkBoxForceUseableStartWeapons.Checked = getState(w2, 3); + + //enemies byte + chkAggroRadius.Checked = getState(e1, 0); + chkTurnSpeeds.Checked = getState(e1, 1); + chkSpeffects.Checked = getState(e1, 2); + + //enemy and player byte + chkStaggerLevels.Checked = getState(ep1, 0); + chkKnockback.Checked = getState(ep1, 1); + chkBullets.Checked = getState(ep1, 2); + chkHitboxSizes.Checked = getState(ep1, 3); + checkBoxNerfHumanityBullets.Checked = getState(ep1, 4); + + //armor byte + checkBoxArmorResistance.Checked = getState(a1, 0); + checkBoxArmorWeight.Checked = getState(a1, 1); + checkBoxArmorPoise.Checked = getState(a1, 2); + checkBoxArmorspEffect.Checked = getState(a1, 3); + + //spells byte + checkBoxUniversalizeCasters.Checked = getState(s1, 0); + checkBoxRandomizeSpellRequirements.Checked = getState(s1, 1); + checkBoxRandomizeSpellSlotSize.Checked = getState(s1, 2); + checkBoxRandomizeSpellQuantity.Checked = getState(s1, 3); + chkMagicAnimations.Checked = getState(s1, 4); + checkBoxForceUseableStartSpells.Checked = getState(s1, 5); + + //other settings byte (options in the other settings tab) + chkItemAnimations.Checked = getState(o1, 0); + chkRandomFaceData.Checked = getState(o1, 1); + chkRingSpeffects.Checked = getState(o1, 2); + chkVoices.Checked = getState(o1, 3); + checkBoxStartingGifts.Checked = getState(o1, 4); + checkBoxPreventSpellGifts.Checked = getState(o1, 5); + checkBoxStartingGiftsAmount.Checked = getState(o1, 6); + checkBoxStartingClasses.Checked = getState(o1, 7); + + //alternative randomization (don't randomize by shuffle) + checkBoxDoTrueRandom.Checked = getState(altRand1, 0); + + + + lblMessage.Name = ""; + lblMessage.Text = "Preset Loaded!"; + lblMessage.ForeColor = Color.Black; + lblMessage.Visible = true; + s.Close(); + } + } + + private void btnSavePreset_Click(object sender, EventArgs e) + { + SaveFileDialog dialog = new SaveFileDialog(); + dialog.Filter = "presets (*.prndpr)|*.prndpr|All files (*.*)|*.*"; + if (dialog.ShowDialog() == DialogResult.OK) + { + String presetName = dialog.FileName; + Stream s = dialog.OpenFile(); + + Console.WriteLine("Saving..."); + + + //Write a 10 byte header to identify the config file; uses first 10 digits of pi multiplied by 10 + byte[] header = new byte[] { 30, 10, 40, 10, 50, 90, 20, 60, 50, 30 }; + s.Write(header, 0, 10); + + + byte[] stringBytes = System.Text.Encoding.ASCII.GetBytes(txtSeed.Text); + if(stringBytes.Length > 128) //has more than 128 characters + { + lblMessage.Name = ""; + lblMessage.Text = "Preset may not have seeds longer than 128 characters."; + lblMessage.ForeColor = Color.Red; + lblMessage.Visible = true; + s.Close(); + return; + } + + //seed string + Array.Resize(ref stringBytes, 128); + s.Write(stringBytes, 0, 128); + + + + //weapons 1st byte + writeByte(s, chkWeaponDamage.Checked, chkWeaponMoveset.Checked, chkWeaponModels.Checked, checkBoxWeaponWeight.Checked, + checkBoxWeaponScaling.Checked, checkBoxWeaponStamina.Checked, checkBoxWeaponStatMin.Checked, chkWeaponSpeffects.Checked); + + //weapons 2nd byte + writeByte(s, checkBoxWeaponDefense.Checked, checkBoxWeaponShieldSplit.Checked, checkBoxWeaponFistNo.Checked, checkBoxForceUseableStartWeapons.Checked); + + //enemies byte + writeByte(s, chkAggroRadius.Checked, chkTurnSpeeds.Checked, chkSpeffects.Checked); + + //enemy and player byte + writeByte(s, chkStaggerLevels.Checked, chkKnockback.Checked, chkBullets.Checked, chkHitboxSizes.Checked, + checkBoxNerfHumanityBullets.Checked); + + //armor byte + writeByte(s, checkBoxArmorResistance.Checked, checkBoxArmorWeight.Checked, checkBoxArmorPoise.Checked, checkBoxArmorspEffect.Checked); + + //spells byte + writeByte(s, checkBoxUniversalizeCasters.Checked, checkBoxRandomizeSpellRequirements.Checked, checkBoxRandomizeSpellSlotSize.Checked, checkBoxRandomizeSpellQuantity.Checked, + chkMagicAnimations.Checked, checkBoxForceUseableStartSpells.Checked); + + //other settings byte (options in the other settings tab) + writeByte(s, chkItemAnimations.Checked, chkRandomFaceData.Checked, chkRingSpeffects.Checked, chkVoices.Checked, + checkBoxStartingGifts.Checked, checkBoxPreventSpellGifts.Checked, checkBoxStartingGiftsAmount.Checked, checkBoxStartingClasses.Checked); + + //alternative randomization (don't randomize by shuffle) + writeByte(s, checkBoxDoTrueRandom.Checked); + + + + lblMessage.Name = ""; + lblMessage.Text = "Preset Saved!"; + lblMessage.ForeColor = Color.Black; + lblMessage.Visible = true; + s.Close(); + } + } + + private void writeByte(Stream s, params bool[] bits) + { + if(bits.Length > 8) + { + throw new Exception("can't assign more than 8 bits per byte"); + } + byte val = 0; + for(int i = 0; i < bits.Length; i++) + { + if(bits[i]) + { + val += (byte)(Math.Pow(2, i)); + } + } + s.WriteByte(val); + } + + private bool getState(int b, int index) + { + //if at end of stream (old preset) defaults newer features that were not included in that preset as unchecked/disabled + if(b == -1) + { + return false; + } + + bool state; + if(index >= 8) + { + throw new Exception("can't read more than 8 bits from a byte"); + } + else if(index < 0) + { + throw new Exception("can't read from a negative index"); + } + uint x = (uint)b; + + x %= (uint)Math.Pow(2, index + 1); + x /= (uint)Math.Pow(2, index); + + state = x == 1; + return state; + } + } } diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index 646d19d..2824455 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -85,6 +85,8 @@ private void InitializeComponent() this.gbSharedCategory = new System.Windows.Forms.GroupBox(); this.gbArmorCategory = new System.Windows.Forms.GroupBox(); this.lblVersion = new System.Windows.Forms.Label(); + this.btnSavePreset = new System.Windows.Forms.Button(); + this.btnLoadPreset = new System.Windows.Forms.Button(); this.gbWeaponCategory.SuspendLayout(); this.gbSpellCategory.SuspendLayout(); this.SuspendLayout(); @@ -205,7 +207,8 @@ private void InitializeComponent() this.chkBullets.TabIndex = 9; this.chkBullets.Text = "Randomize bullets"; this.tooltip.SetToolTip(this.chkBullets, "Randomizes bullets in a lot of ways. ei: it\'s damage, damage type, movement, amon" + - "g other things.\nAppears to effect both player and enemy projectiles."); + "g other things.\nAppears to effect both player and enemy projectiles.\n" + + "Can result in a lot of magic classes having unusable spells."); this.chkBullets.UseVisualStyleBackColor = true; // // chkKnockback @@ -767,11 +770,33 @@ private void InitializeComponent() this.lblVersion.TabIndex = 41; this.lblVersion.Text = "DEV version 0.3d"; // + // btnSavePreset + // + this.btnSavePreset.Location = new System.Drawing.Point(844, 27); + this.btnSavePreset.Name = "btnSavePreset"; + this.btnSavePreset.Size = new System.Drawing.Size(100, 25); + this.btnSavePreset.TabIndex = 46; + this.btnSavePreset.Text = "Save Preset"; + this.btnSavePreset.UseVisualStyleBackColor = true; + this.btnSavePreset.Click += new System.EventHandler(this.btnSavePreset_Click); + // + // btnLoadPreset + // + this.btnLoadPreset.Location = new System.Drawing.Point(738, 27); + this.btnLoadPreset.Name = "btnLoadPreset"; + this.btnLoadPreset.Size = new System.Drawing.Size(100, 25); + this.btnLoadPreset.TabIndex = 47; + this.btnLoadPreset.Text = "Load Preset"; + this.btnLoadPreset.UseVisualStyleBackColor = true; + this.btnLoadPreset.Click += new System.EventHandler(this.btnLoadPreset_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(960, 470); + this.Controls.Add(this.btnLoadPreset); + this.Controls.Add(this.btnSavePreset); this.Controls.Add(this.checkBoxNerfHumanityBullets); this.Controls.Add(this.checkBoxRemaster); this.Controls.Add(this.chkRandomFaceData); @@ -898,6 +923,8 @@ private void InitializeComponent() private System.Windows.Forms.GroupBox gbSharedCategory; private System.Windows.Forms.GroupBox gbArmorCategory; private System.Windows.Forms.Label lblVersion; + private System.Windows.Forms.Button btnSavePreset; + private System.Windows.Forms.Button btnLoadPreset; } } diff --git a/Paramdomizer/Form1.resx b/Paramdomizer/Form1.resx index 8aba833..6b5f2a4 100644 --- a/Paramdomizer/Form1.resx +++ b/Paramdomizer/Form1.resx @@ -120,9 +120,6 @@ 17, 17 - - 17, 17 - Randomizes the minimum stats for a weapon. Fists will be effected unless don't modify fists is enabled From 7299078f44c7d77475fb9507105a933a71ed5211 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Mon, 3 Feb 2020 13:11:09 -0600 Subject: [PATCH 02/21] Allow randomizing based on a backup -allow randomizing based on a backup -changed paramdomizer's backup extension to differentiate itself more -feature allows you to randomize new options without restoring from backup manually -this option *can* be turned off for those who want to randomize the same file continously without loading from backup first --- Paramdomizer/Form1.cs | 27 +++++++++++++++++++++------ Paramdomizer/Form1.designer.cs | 23 ++++++++++++++++++++--- Paramdomizer/Form1.resx | 5 +++++ 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index a8f27cf..c68f754 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -182,28 +182,42 @@ private async void btnSubmit_Click(object sender, EventArgs e) string seed = txtSeed.Text; + //restore files from backup if load from backup is enabled + if (checkBoxLoadFromBackup.Checked && File.Exists(gameDirectory + $"\\param\\GameParam\\GameParam.parambnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.paramdomizerbak")) + { + File.Delete(gameDirectory + $"\\param\\GameParam\\GameParam.parambnd{(checkBoxRemaster.Checked ? ".dcx" : "")}"); + File.Copy(gameDirectory + $"\\param\\GameParam\\GameParam.parambnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.paramdomizerbak", + gameDirectory + $"\\param\\GameParam\\GameParam.parambnd{(checkBoxRemaster.Checked ? ".dcx" : "")}"); + } + if (checkBoxLoadFromBackup.Checked && File.Exists(gameDirectory + $"\\msg\\ENGLISH\\menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.paramdomizerbak")) + { + File.Delete(gameDirectory + $"\\msg\\ENGLISH\\menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}"); + File.Copy(gameDirectory + $"\\msg\\ENGLISH\\menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.paramdomizerbak", + gameDirectory + $"\\msg\\ENGLISH\\menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}"); + } + //create backup of gameparam - if (!File.Exists(gameDirectory + $"\\param\\GameParam\\GameParam.parambnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.bak")) + if (!File.Exists(gameDirectory + $"\\param\\GameParam\\GameParam.parambnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.paramdomizerbak")) { File.Copy(gameDirectory + $"\\param\\GameParam\\GameParam.parambnd{(checkBoxRemaster.Checked ? ".dcx" : "")}", - gameDirectory + $"\\param\\GameParam\\GameParam.parambnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.bak"); + gameDirectory + $"\\param\\GameParam\\GameParam.parambnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.paramdomizerbak"); lblMessage.Text = $"Backed up GameParam.parambnd{(checkBoxRemaster.Checked ? ".dcx" : "")} \n\n"; lblMessage.ForeColor = Color.Black; lblMessage.Visible = true; } //create backups of msgbnds - if (!File.Exists(gameDirectory + $"\\msg\\ENGLISH\\item.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.bak")) + if (!File.Exists(gameDirectory + $"\\msg\\ENGLISH\\item.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.paramdomizerbak")) { File.Copy(gameDirectory + $"\\msg\\ENGLISH\\item.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}", - gameDirectory + $"\\msg\\ENGLISH\\item.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.bak"); + gameDirectory + $"\\msg\\ENGLISH\\item.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.paramdomizerbak"); lblMessage.Text = $"Backed up item.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")} \n\n"; lblMessage.ForeColor = Color.Black; lblMessage.Visible = true; } - if(!File.Exists(gameDirectory + $"\\msg\\ENGLISH\\menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.bak")) + if(!File.Exists(gameDirectory + $"\\msg\\ENGLISH\\menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.paramdomizerbak")) { File.Copy(gameDirectory + $"\\msg\\ENGLISH\\menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}", - gameDirectory + $"\\msg\\ENGLISH\\menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.bak"); + gameDirectory + $"\\msg\\ENGLISH\\menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}.paramdomizerbak"); lblMessage.Text = $"Backed up menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")} \n\n"; lblMessage.ForeColor = Color.Black; lblMessage.Visible = true; @@ -214,6 +228,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) MSGBND menuMSGBND = DataFile.LoadFromFile(gameDirectory + $"\\msg\\ENGLISH\\menu.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}"); MSGBND itemMSGBND = DataFile.LoadFromFile(gameDirectory + $"\\msg\\ENGLISH\\item.msgbnd{(checkBoxRemaster.Checked ? ".dcx" : "")}"); + gameparamBnd.ApplyDefaultParamDefs(); //Hash seed so people can use meme seeds diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index 2824455..41cf0b2 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -35,6 +35,7 @@ private void InitializeComponent() this.lblGamePath = new System.Windows.Forms.Label(); this.txtGamePath = new System.Windows.Forms.TextBox(); this.btnSubmit = new System.Windows.Forms.Button(); + this.checkBoxLoadFromBackup = new System.Windows.Forms.CheckBox(); this.chkRingSpeffects = new System.Windows.Forms.CheckBox(); this.lblMessage = new System.Windows.Forms.Label(); this.chkWeaponModels = new System.Windows.Forms.CheckBox(); @@ -134,6 +135,22 @@ private void InitializeComponent() this.btnSubmit.UseVisualStyleBackColor = true; this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click); // + // checkBoxLoadFromBackup + // + this.checkBoxLoadFromBackup.AutoSize = true; + this.checkBoxLoadFromBackup.Checked = true; + this.checkBoxLoadFromBackup.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxLoadFromBackup.Location = new System.Drawing.Point(268, 440); + this.checkBoxLoadFromBackup.Name = "checkBoxLoadFromBackup"; + this.checkBoxLoadFromBackup.Size = new System.Drawing.Size(204, 17); + this.checkBoxLoadFromBackup.TabIndex = 45; + this.checkBoxLoadFromBackup.Text = "Load from backup before randomizing"; + this.tooltip.SetToolTip(this.checkBoxLoadFromBackup, "If paramdomizer randomized your game in the past, it will load an unrandomized ba" + + "ckup before randomizing again.\nuseful to remove some of the effects of the rando" + + "mizer before randomizing it again.\nparamdomizer now uses a different extension for backuping files to make it easier for it as well as you to accurately tell what the file was like before changes were made. (or to differentiate backups from different randomizers)\n" + + "WARNING: WILL NOT RETURN TO VANILLA IF THE ORIGINAL BACKUP WASNT VANILLA (happens if you run a different randomizer prior to paramdomizer)"); + this.checkBoxLoadFromBackup.UseVisualStyleBackColor = true; + // // chkRingSpeffects // this.chkRingSpeffects.AutoSize = true; @@ -206,9 +223,7 @@ private void InitializeComponent() this.chkBullets.Size = new System.Drawing.Size(112, 17); this.chkBullets.TabIndex = 9; this.chkBullets.Text = "Randomize bullets"; - this.tooltip.SetToolTip(this.chkBullets, "Randomizes bullets in a lot of ways. ei: it\'s damage, damage type, movement, amon" + - "g other things.\nAppears to effect both player and enemy projectiles.\n" + - "Can result in a lot of magic classes having unusable spells."); + this.tooltip.SetToolTip(this.chkBullets, resources.GetString("chkBullets.ToolTip")); this.chkBullets.UseVisualStyleBackColor = true; // // chkKnockback @@ -797,6 +812,7 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(960, 470); this.Controls.Add(this.btnLoadPreset); this.Controls.Add(this.btnSavePreset); + this.Controls.Add(this.checkBoxLoadFromBackup); this.Controls.Add(this.checkBoxNerfHumanityBullets); this.Controls.Add(this.checkBoxRemaster); this.Controls.Add(this.chkRandomFaceData); @@ -874,6 +890,7 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtGamePath; private System.Windows.Forms.Button btnSubmit; private System.Windows.Forms.Label lblMessage; + private System.Windows.Forms.CheckBox checkBoxLoadFromBackup; private System.Windows.Forms.CheckBox chkWeaponModels; private System.Windows.Forms.CheckBox chkWeaponDamage; private System.Windows.Forms.CheckBox chkWeaponMoveset; diff --git a/Paramdomizer/Form1.resx b/Paramdomizer/Form1.resx index 6b5f2a4..8f65ee1 100644 --- a/Paramdomizer/Form1.resx +++ b/Paramdomizer/Form1.resx @@ -120,6 +120,11 @@ 17, 17 + + Randomizes bullets in a lot of ways. ei: it's damage, damage type, movement, among other things. +Appears to effect both player and enemy projectiles. +Can result in a lot of magic classes having unusable spells. + Randomizes the minimum stats for a weapon. Fists will be effected unless don't modify fists is enabled From 19930bd9ef98b1e3d0c88993874357ad19879b73 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Tue, 4 Feb 2020 08:32:16 -0600 Subject: [PATCH 03/21] Added the ability to toggle individual settings of dont randomize by shuffle -Added the ability to toggle individual settings of dont randomize by shuffle -randomize bullets is by default off until I find a way to make more bullets useable --- Paramdomizer/Form1.cs | 71 +++++++------ Paramdomizer/Form1.designer.cs | 75 ++++++++------ Paramdomizer/Form1.resx | 9 +- Paramdomizer/Form2.Designer.cs | 172 +++++++++++++++++++++++++++++++ Paramdomizer/Form2.cs | 29 ++++++ Paramdomizer/Form2.resx | 123 ++++++++++++++++++++++ Paramdomizer/Paramdomizer.csproj | 9 ++ 7 files changed, 425 insertions(+), 63 deletions(-) create mode 100644 Paramdomizer/Form2.Designer.cs create mode 100644 Paramdomizer/Form2.cs create mode 100644 Paramdomizer/Form2.resx diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index c68f754..67f93f4 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -17,10 +17,12 @@ namespace Paramdomizer public partial class Form1 : Form { string gameDirectory = ""; + Form2 TRForm; public Form1() { InitializeComponent(); + TRForm = new Form2(); } private void Form1_Load(object sender, EventArgs e) @@ -1798,7 +1800,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDamage.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the damage it does if (r.Next(3) == 0) @@ -1829,7 +1831,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDamage.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the damage it does if (r.Next(3) == 0) @@ -1860,7 +1862,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDamage.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the damage it does if (r.Next(3) == 0) @@ -1891,7 +1893,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDamage.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the damage it does if (r.Next(3) == 0) @@ -1922,7 +1924,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponScaling.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does if (r.Next(3) == 0) @@ -1958,7 +1960,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponScaling.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does if (r.Next(3) == 0) @@ -1994,7 +1996,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponScaling.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does if (r.Next(3) == 0) @@ -2030,7 +2032,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponScaling.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does if (r.Next(3) == 0) @@ -2069,7 +2071,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponStatMin.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponStatMin.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the stat requirements if (r.Next(3) == 0) @@ -2118,7 +2120,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponStatMin.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponStatMin.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the stat requirements if (r.Next(3) == 0) @@ -2167,7 +2169,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponStatMin.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponStatMin.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the stat requirements if (r.Next(3) == 0) @@ -2216,7 +2218,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponStatMin.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponStatMin.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the stat requirements if (r.Next(3) == 0) @@ -2267,7 +2269,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) //fists dont get weight if (checkBoxWeaponWeight.Checked && Convert.ToInt32(fistcheckprop.GetValue(fistCheckCell, null)) != 1750) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponWeight.Checked) { //small chance that the value will be above a certain value (used to prevent higher values appearing more frequently because outliers are included) if (r.Next(20) == 0) @@ -2296,7 +2298,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponStamina.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponStamina.Checked) { if (r.Next(3) == 0) { @@ -3008,7 +3010,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDamage.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the damage it does if (r.Next(3) == 0) @@ -3039,7 +3041,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDamage.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the damage it does if (r.Next(3) == 0) @@ -3070,7 +3072,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDamage.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the damage it does if (r.Next(3) == 0) @@ -3101,7 +3103,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDamage.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the damage it does if (r.Next(3) == 0) @@ -3132,7 +3134,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponScaling.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does if (r.Next(3) == 0) @@ -3168,7 +3170,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponScaling.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does if (r.Next(3) == 0) @@ -3204,7 +3206,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponScaling.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does if (r.Next(3) == 0) @@ -3240,7 +3242,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponScaling.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does if (r.Next(3) == 0) @@ -3276,7 +3278,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponStatMin.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponStatMin.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the stat requirements if (r.Next(3) == 0) @@ -3312,7 +3314,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponStatMin.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponStatMin.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the stat requirements if (r.Next(3) == 0) @@ -3348,7 +3350,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponStatMin.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponStatMin.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the stat requirements if (r.Next(3) == 0) @@ -3384,7 +3386,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponStatMin.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponStatMin.Checked) { //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the stat requirements if (r.Next(3) == 0) @@ -3425,7 +3427,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) //fists dont get weight if (checkBoxWeaponWeight.Checked && Convert.ToInt32(fistcheckprop.GetValue(fistCheckCell, null)) != 1750) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponWeight.Checked) { //small chance that the value will be above a certain value (used to prevent higher values appearing more frequently because outliers are included) if (r.Next(20) == 0) @@ -3454,7 +3456,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponStamina.Checked) { - if (checkBoxDoTrueRandom.Checked) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponStamina.Checked) { if (r.Next(3) == 0) { @@ -7100,6 +7102,11 @@ private void btnLoadPreset_Click(object sender, EventArgs e) //alternative randomization (don't randomize by shuffle) checkBoxDoTrueRandom.Checked = getState(altRand1, 0); + TRForm.chkTRWeaponDamage.Checked = getState(altRand1, 1); + TRForm.chkTRWeaponWeight.Checked = getState(altRand1, 2); + TRForm.chkTRWeaponScaling.Checked = getState(altRand1, 3); + TRForm.chkTRWeaponStamina.Checked = getState(altRand1, 4); + TRForm.chkTRWeaponStatMin.Checked = getState(altRand1, 5); @@ -7171,7 +7178,8 @@ private void btnSavePreset_Click(object sender, EventArgs e) checkBoxStartingGifts.Checked, checkBoxPreventSpellGifts.Checked, checkBoxStartingGiftsAmount.Checked, checkBoxStartingClasses.Checked); //alternative randomization (don't randomize by shuffle) - writeByte(s, checkBoxDoTrueRandom.Checked); + writeByte(s, checkBoxDoTrueRandom.Checked, TRForm.chkTRWeaponDamage.Checked, TRForm.chkTRWeaponWeight.Checked, TRForm.chkTRWeaponScaling.Checked, + TRForm.chkTRWeaponStamina.Checked, TRForm.chkTRWeaponStatMin.Checked); @@ -7226,5 +7234,10 @@ private bool getState(int b, int index) return state; } + private void btnDoTrueRandomPopup_Click(object sender, EventArgs e) + { + TRForm.ShowDialog(); + } } + } diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index 41cf0b2..dc46e26 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -79,6 +79,9 @@ private void InitializeComponent() this.checkBoxForceUseableStartSpells = new System.Windows.Forms.CheckBox(); this.checkBoxForceUseableStartWeapons = new System.Windows.Forms.CheckBox(); this.tooltip = new System.Windows.Forms.ToolTip(this.components); + this.btnSavePreset = new System.Windows.Forms.Button(); + this.btnLoadPreset = new System.Windows.Forms.Button(); + this.btnDoTrueRandomPopup = new System.Windows.Forms.Button(); this.gbWeaponCategory = new System.Windows.Forms.GroupBox(); this.gbSpellCategory = new System.Windows.Forms.GroupBox(); this.gbEnemiesCategory = new System.Windows.Forms.GroupBox(); @@ -86,8 +89,6 @@ private void InitializeComponent() this.gbSharedCategory = new System.Windows.Forms.GroupBox(); this.gbArmorCategory = new System.Windows.Forms.GroupBox(); this.lblVersion = new System.Windows.Forms.Label(); - this.btnSavePreset = new System.Windows.Forms.Button(); - this.btnLoadPreset = new System.Windows.Forms.Button(); this.gbWeaponCategory.SuspendLayout(); this.gbSpellCategory.SuspendLayout(); this.SuspendLayout(); @@ -145,10 +146,7 @@ private void InitializeComponent() this.checkBoxLoadFromBackup.Size = new System.Drawing.Size(204, 17); this.checkBoxLoadFromBackup.TabIndex = 45; this.checkBoxLoadFromBackup.Text = "Load from backup before randomizing"; - this.tooltip.SetToolTip(this.checkBoxLoadFromBackup, "If paramdomizer randomized your game in the past, it will load an unrandomized ba" + - "ckup before randomizing again.\nuseful to remove some of the effects of the rando" + - "mizer before randomizing it again.\nparamdomizer now uses a different extension for backuping files to make it easier for it as well as you to accurately tell what the file was like before changes were made. (or to differentiate backups from different randomizers)\n" + - "WARNING: WILL NOT RETURN TO VANILLA IF THE ORIGINAL BACKUP WASNT VANILLA (happens if you run a different randomizer prior to paramdomizer)"); + this.tooltip.SetToolTip(this.checkBoxLoadFromBackup, resources.GetString("checkBoxLoadFromBackup.ToolTip")); this.checkBoxLoadFromBackup.UseVisualStyleBackColor = true; // // chkRingSpeffects @@ -217,13 +215,15 @@ private void InitializeComponent() // this.chkBullets.AutoSize = true; this.chkBullets.Checked = true; - this.chkBullets.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkBullets.CheckState = System.Windows.Forms.CheckState.Unchecked; this.chkBullets.Location = new System.Drawing.Point(33, 348); this.chkBullets.Name = "chkBullets"; this.chkBullets.Size = new System.Drawing.Size(112, 17); this.chkBullets.TabIndex = 9; - this.chkBullets.Text = "Randomize bullets"; - this.tooltip.SetToolTip(this.chkBullets, resources.GetString("chkBullets.ToolTip")); + this.chkBullets.Text = "Randomize bullets*"; + this.tooltip.SetToolTip(this.chkBullets, "Randomizes bullets in several ways such as damage, damage type, movement, etc.\r\nA" + + "ppears to effect both player and enemy projectiles.\r\nWARNING: Can result in a lot of magi" + + "c classes having unusable spells."); this.chkBullets.UseVisualStyleBackColor = true; // // chkKnockback @@ -714,6 +714,39 @@ private void InitializeComponent() this.tooltip.InitialDelay = 500; this.tooltip.ReshowDelay = 100; // + // btnSavePreset + // + this.btnSavePreset.Location = new System.Drawing.Point(844, 27); + this.btnSavePreset.Name = "btnSavePreset"; + this.btnSavePreset.Size = new System.Drawing.Size(100, 25); + this.btnSavePreset.TabIndex = 46; + this.btnSavePreset.Text = "Save Preset"; + this.tooltip.SetToolTip(this.btnSavePreset, "Save a preset of your settings and seed to file."); + this.btnSavePreset.UseVisualStyleBackColor = true; + this.btnSavePreset.Click += new System.EventHandler(this.btnSavePreset_Click); + // + // btnLoadPreset + // + this.btnLoadPreset.Location = new System.Drawing.Point(738, 27); + this.btnLoadPreset.Name = "btnLoadPreset"; + this.btnLoadPreset.Size = new System.Drawing.Size(100, 25); + this.btnLoadPreset.TabIndex = 47; + this.btnLoadPreset.Text = "Load Preset"; + this.tooltip.SetToolTip(this.btnLoadPreset, "Load a preset containing settings and a seed from file."); + this.btnLoadPreset.UseVisualStyleBackColor = true; + this.btnLoadPreset.Click += new System.EventHandler(this.btnLoadPreset_Click); + // + // btnDoTrueRandomPopup + // + this.btnDoTrueRandomPopup.Location = new System.Drawing.Point(192, 408); + this.btnDoTrueRandomPopup.Name = "btnDoTrueRandomPopup"; + this.btnDoTrueRandomPopup.Size = new System.Drawing.Size(104, 28); + this.btnDoTrueRandomPopup.TabIndex = 48; + this.btnDoTrueRandomPopup.Text = "More Settings..."; + this.tooltip.SetToolTip(this.btnDoTrueRandomPopup, "Configure detailed settings for Don\'t Randomize by Shuffle."); + this.btnDoTrueRandomPopup.UseVisualStyleBackColor = true; + this.btnDoTrueRandomPopup.Click += new System.EventHandler(this.btnDoTrueRandomPopup_Click); + // // gbWeaponCategory // this.gbWeaponCategory.AutoSize = true; @@ -749,7 +782,7 @@ private void InitializeComponent() // gbOtherCategory // this.gbOtherCategory.AutoSize = true; - this.gbOtherCategory.Location = new System.Drawing.Point(482, 214); + this.gbOtherCategory.Location = new System.Drawing.Point(479, 214); this.gbOtherCategory.Name = "gbOtherCategory"; this.gbOtherCategory.Size = new System.Drawing.Size(466, 116); this.gbOtherCategory.TabIndex = 35; @@ -785,26 +818,6 @@ private void InitializeComponent() this.lblVersion.TabIndex = 41; this.lblVersion.Text = "DEV version 0.3d"; // - // btnSavePreset - // - this.btnSavePreset.Location = new System.Drawing.Point(844, 27); - this.btnSavePreset.Name = "btnSavePreset"; - this.btnSavePreset.Size = new System.Drawing.Size(100, 25); - this.btnSavePreset.TabIndex = 46; - this.btnSavePreset.Text = "Save Preset"; - this.btnSavePreset.UseVisualStyleBackColor = true; - this.btnSavePreset.Click += new System.EventHandler(this.btnSavePreset_Click); - // - // btnLoadPreset - // - this.btnLoadPreset.Location = new System.Drawing.Point(738, 27); - this.btnLoadPreset.Name = "btnLoadPreset"; - this.btnLoadPreset.Size = new System.Drawing.Size(100, 25); - this.btnLoadPreset.TabIndex = 47; - this.btnLoadPreset.Text = "Load Preset"; - this.btnLoadPreset.UseVisualStyleBackColor = true; - this.btnLoadPreset.Click += new System.EventHandler(this.btnLoadPreset_Click); - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -812,6 +825,7 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(960, 470); this.Controls.Add(this.btnLoadPreset); this.Controls.Add(this.btnSavePreset); + this.Controls.Add(this.btnDoTrueRandomPopup); this.Controls.Add(this.checkBoxLoadFromBackup); this.Controls.Add(this.checkBoxNerfHumanityBullets); this.Controls.Add(this.checkBoxRemaster); @@ -942,6 +956,7 @@ private void InitializeComponent() private System.Windows.Forms.Label lblVersion; private System.Windows.Forms.Button btnSavePreset; private System.Windows.Forms.Button btnLoadPreset; + private System.Windows.Forms.Button btnDoTrueRandomPopup; } } diff --git a/Paramdomizer/Form1.resx b/Paramdomizer/Form1.resx index 8f65ee1..aba1090 100644 --- a/Paramdomizer/Form1.resx +++ b/Paramdomizer/Form1.resx @@ -120,10 +120,11 @@ 17, 17 - - Randomizes bullets in a lot of ways. ei: it's damage, damage type, movement, among other things. -Appears to effect both player and enemy projectiles. -Can result in a lot of magic classes having unusable spells. + + If paramdomizer randomized your game in the past, it will load an unrandomized backup before randomizing again. +useful to remove some of the effects of the randomizer before randomizing it again. +paramdomizer now uses a different extension for backuping files to make it easier for it as well as you to accurately tell what the file was like before changes were made. (or to differentiate backups from different randomizers) +WARNING: WILL NOT RETURN TO VANILLA IF THE ORIGINAL BACKUP WASNT VANILLA (happens if you run a different randomizer prior to paramdomizer) Randomizes the minimum stats for a weapon. diff --git a/Paramdomizer/Form2.Designer.cs b/Paramdomizer/Form2.Designer.cs new file mode 100644 index 0000000..2e497cf --- /dev/null +++ b/Paramdomizer/Form2.Designer.cs @@ -0,0 +1,172 @@ +namespace Paramdomizer +{ + partial class Form2 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.btnCloseWindow = new System.Windows.Forms.Button(); + this.chkTRWeaponDamage = new System.Windows.Forms.CheckBox(); + this.chkTRWeaponScaling = new System.Windows.Forms.CheckBox(); + this.chkTRWeaponStamina = new System.Windows.Forms.CheckBox(); + this.chkTRWeaponWeight = new System.Windows.Forms.CheckBox(); + this.chkTRWeaponStatMin = new System.Windows.Forms.CheckBox(); + this.gbWeaponCategory = new System.Windows.Forms.GroupBox(); + this.tooltip = new System.Windows.Forms.ToolTip(this.components); + this.SuspendLayout(); + // + // btnCloseWindow + // + this.btnCloseWindow.Location = new System.Drawing.Point(413, 115); + this.btnCloseWindow.Name = "btnCloseWindow"; + this.btnCloseWindow.Size = new System.Drawing.Size(75, 23); + this.btnCloseWindow.TabIndex = 0; + this.btnCloseWindow.Text = "Close Window"; + this.btnCloseWindow.UseVisualStyleBackColor = true; + this.btnCloseWindow.Click += new System.EventHandler(this.btnCloseWindow_Click); + // + // chkTRWeaponDamage + // + this.chkTRWeaponDamage.AutoSize = true; + this.chkTRWeaponDamage.Checked = true; + this.chkTRWeaponDamage.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRWeaponDamage.Location = new System.Drawing.Point(36, 38); + this.chkTRWeaponDamage.Name = "chkTRWeaponDamage"; + this.chkTRWeaponDamage.Size = new System.Drawing.Size(138, 17); + this.chkTRWeaponDamage.TabIndex = 1; + this.chkTRWeaponDamage.Text = "weapon damage DRBS"; + this.tooltip.SetToolTip(this.chkTRWeaponDamage, "Randomize weapon damage by generating a random number instead of shuffling vanill" + + "a values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); + this.chkTRWeaponDamage.UseVisualStyleBackColor = true; + // + // chkTRWeaponScaling + // + this.chkTRWeaponScaling.AutoSize = true; + this.chkTRWeaponScaling.Checked = true; + this.chkTRWeaponScaling.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRWeaponScaling.Location = new System.Drawing.Point(36, 61); + this.chkTRWeaponScaling.Name = "chkTRWeaponScaling"; + this.chkTRWeaponScaling.Size = new System.Drawing.Size(133, 17); + this.chkTRWeaponScaling.TabIndex = 1; + this.chkTRWeaponScaling.Text = "weapon scaling DRBS"; + this.tooltip.SetToolTip(this.chkTRWeaponScaling, "Randomize weapon scaling by generating a random number instead of shuffling vanil" + + "la values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); + this.chkTRWeaponScaling.UseVisualStyleBackColor = true; + // + // chkTRWeaponStamina + // + this.chkTRWeaponStamina.AutoSize = true; + this.chkTRWeaponStamina.Checked = true; + this.chkTRWeaponStamina.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRWeaponStamina.Location = new System.Drawing.Point(273, 61); + this.chkTRWeaponStamina.Name = "chkTRWeaponStamina"; + this.chkTRWeaponStamina.Size = new System.Drawing.Size(136, 17); + this.chkTRWeaponStamina.TabIndex = 1; + this.chkTRWeaponStamina.Text = "weapon stamina DRBS"; + this.tooltip.SetToolTip(this.chkTRWeaponStamina, "Randomize weapon stamina by generating a random number instead of shuffling vanil" + + "la values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); + this.chkTRWeaponStamina.UseVisualStyleBackColor = true; + // + // chkTRWeaponWeight + // + this.chkTRWeaponWeight.AutoSize = true; + this.chkTRWeaponWeight.Checked = true; + this.chkTRWeaponWeight.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRWeaponWeight.Location = new System.Drawing.Point(273, 38); + this.chkTRWeaponWeight.Name = "chkTRWeaponWeight"; + this.chkTRWeaponWeight.Size = new System.Drawing.Size(131, 17); + this.chkTRWeaponWeight.TabIndex = 1; + this.chkTRWeaponWeight.Text = "weapon weight DRBS"; + this.tooltip.SetToolTip(this.chkTRWeaponWeight, "Randomize weapon weight by generating a random number instead of shuffling vanill" + + "a values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); + this.chkTRWeaponWeight.UseVisualStyleBackColor = true; + // + // chkTRWeaponStatMin + // + this.chkTRWeaponStatMin.AutoSize = true; + this.chkTRWeaponStatMin.Checked = true; + this.chkTRWeaponStatMin.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRWeaponStatMin.Location = new System.Drawing.Point(36, 84); + this.chkTRWeaponStatMin.Name = "chkTRWeaponStatMin"; + this.chkTRWeaponStatMin.Size = new System.Drawing.Size(165, 17); + this.chkTRWeaponStatMin.TabIndex = 1; + this.chkTRWeaponStatMin.Text = "weapon minimum stats DRBS"; + this.tooltip.SetToolTip(this.chkTRWeaponStatMin, "Randomize weapon\'s minimum stats by generating a random number instead of shuffli" + + "ng vanilla values.\nDon\'t Randomize by Shuffle needs to be on for this to functio" + + "n."); + this.chkTRWeaponStatMin.UseVisualStyleBackColor = true; + // + // gbWeaponCategory + // + this.gbWeaponCategory.AutoSize = true; + this.gbWeaponCategory.Location = new System.Drawing.Point(12, 12); + this.gbWeaponCategory.Name = "gbWeaponCategory"; + this.gbWeaponCategory.Size = new System.Drawing.Size(432, 89); + this.gbWeaponCategory.TabIndex = 2; + this.gbWeaponCategory.TabStop = false; + this.gbWeaponCategory.Text = "Weapon Settings:"; + // + // tooltip + // + this.tooltip.AutoPopDelay = 32767; + this.tooltip.InitialDelay = 500; + this.tooltip.ReshowDelay = 100; + // + // Form2 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(500, 150); + this.Controls.Add(this.btnCloseWindow); + this.Controls.Add(this.chkTRWeaponDamage); + this.Controls.Add(this.chkTRWeaponScaling); + this.Controls.Add(this.chkTRWeaponStamina); + this.Controls.Add(this.chkTRWeaponWeight); + this.Controls.Add(this.chkTRWeaponStatMin); + this.Controls.Add(this.gbWeaponCategory); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Form2"; + this.ShowIcon = false; + this.Text = "Paramdomizer - Don\'t Randomize By Shuffle Settings"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + public System.Windows.Forms.Button btnCloseWindow; + public System.Windows.Forms.CheckBox chkTRWeaponDamage; + public System.Windows.Forms.CheckBox chkTRWeaponScaling; + public System.Windows.Forms.CheckBox chkTRWeaponWeight; + public System.Windows.Forms.CheckBox chkTRWeaponStamina; + public System.Windows.Forms.CheckBox chkTRWeaponStatMin; + public System.Windows.Forms.GroupBox gbWeaponCategory; + public System.Windows.Forms.ToolTip tooltip; + } +} \ No newline at end of file diff --git a/Paramdomizer/Form2.cs b/Paramdomizer/Form2.cs new file mode 100644 index 0000000..c4c5e21 --- /dev/null +++ b/Paramdomizer/Form2.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; +using MeowDSIO; +using MeowDSIO.DataFiles; +using System.IO; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.WindowsAPICodePack.Dialogs; + +namespace Paramdomizer +{ + public partial class Form2 : Form + { + public Form2() + { + InitializeComponent(); + } + + private void btnCloseWindow_Click(object sender, EventArgs e) + { + this.Hide(); + } + } +} diff --git a/Paramdomizer/Form2.resx b/Paramdomizer/Form2.resx new file mode 100644 index 0000000..023cd0c --- /dev/null +++ b/Paramdomizer/Form2.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Paramdomizer/Paramdomizer.csproj b/Paramdomizer/Paramdomizer.csproj index 670ca32..5de2490 100644 --- a/Paramdomizer/Paramdomizer.csproj +++ b/Paramdomizer/Paramdomizer.csproj @@ -70,11 +70,20 @@ Form1.cs + + Form + + + Form2.cs + Form1.cs + + Form2.cs + ResXFileCodeGenerator Resources.Designer.cs From d3bd5cdf41c1ff663fc4e5481f3453f231e5f7b5 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Tue, 4 Feb 2020 13:38:18 -0600 Subject: [PATCH 04/21] multiple changes -weighted starting gifts differently -magic based classes will be forced to have at least one attunement slot in their stat sheet so they can cast spells -magic based classes will have their starting spell be no longer than one slot in length -started an attempt at a force bullets to be useable option (does not entirely work yet) --- Paramdomizer/Form1.cs | 292 ++++++++++++++++++++++++--------- Paramdomizer/Form1.designer.cs | 34 ++-- Paramdomizer/Form1.resx | 20 ++- 3 files changed, 249 insertions(+), 97 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index 67f93f4..fd0acd2 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -3839,38 +3839,32 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } } - //now do info grab - foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + if (!dontUseSpell) { - if (cell.Def.Name == "refType") - { - PropertyInfo prop = cell.GetType().GetProperty("Value"); - allSfxVariationIds.Add(Convert.ToInt32(prop.GetValue(cell, null))); - } - else if (cell.Def.Name == "slotLength") - { - PropertyInfo prop = cell.GetType().GetProperty("Value"); - allSlotLengths.Add(Convert.ToInt32(prop.GetValue(cell, null))); - } - else if (cell.Def.Name == "requirementIntellect") + //now do info grab + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) { - if(!dontUseSpell) + if (cell.Def.Name == "refType") + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + allSfxVariationIds.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else if (cell.Def.Name == "slotLength") + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + allSlotLengths.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else if (cell.Def.Name == "requirementIntellect") { PropertyInfo prop = cell.GetType().GetProperty("Value"); allRequirementIntellect.Add(Convert.ToInt32(prop.GetValue(cell, null))); } - } - else if (cell.Def.Name == "requirementFaith") - { - if(!dontUseSpell) + else if (cell.Def.Name == "requirementFaith") { PropertyInfo prop = cell.GetType().GetProperty("Value"); allRequirementFaith.Add(Convert.ToInt32(prop.GetValue(cell, null))); } - } - else if (cell.Def.Name == "maxQuantity") - { - if(!dontUseSpell) + else if (cell.Def.Name == "maxQuantity") { PropertyInfo prop = cell.GetType().GetProperty("Value"); allMaxQuantity.Add(Convert.ToInt32(prop.GetValue(cell, null))); @@ -3896,37 +3890,37 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } } - //now do info insert - foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + if(!dontUseSpell) { - if (cell.Def.Name == "refType") + //now do info insert + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) { - int randomIndex = r.Next(allSfxVariationIds.Count); - Type type = cell.GetType(); - PropertyInfo prop = type.GetProperty("Value"); - - if (chkMagicAnimations.Checked) + if (cell.Def.Name == "refType") { - prop.SetValue(cell, allSfxVariationIds[randomIndex], null); - } + int randomIndex = r.Next(allSfxVariationIds.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); - allSfxVariationIds.RemoveAt(randomIndex); - } - else if (cell.Def.Name == "slotLength") - { - int randomIndex = r.Next(allSlotLengths.Count); - Type type = cell.GetType(); - PropertyInfo prop = type.GetProperty("Value"); - if (checkBoxRandomizeSpellSlotSize.Checked) - { - prop.SetValue(cell, allSlotLengths[randomIndex], null); + if (chkMagicAnimations.Checked) + { + prop.SetValue(cell, allSfxVariationIds[randomIndex], null); + } + + allSfxVariationIds.RemoveAt(randomIndex); } + else if (cell.Def.Name == "slotLength") + { + int randomIndex = r.Next(allSlotLengths.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + if (checkBoxRandomizeSpellSlotSize.Checked) + { + prop.SetValue(cell, allSlotLengths[randomIndex], null); + } - allSlotLengths.RemoveAt(randomIndex); - } - else if (cell.Def.Name == "requirementIntellect") - { - if(!dontUseSpell) + allSlotLengths.RemoveAt(randomIndex); + } + else if (cell.Def.Name == "requirementIntellect") { int randomIndex = r.Next(allRequirementIntellect.Count); Type type = cell.GetType(); @@ -3938,10 +3932,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) allRequirementIntellect.RemoveAt(randomIndex); } - } - else if (cell.Def.Name == "requirementFaith") - { - if(!dontUseSpell) + else if (cell.Def.Name == "requirementFaith") { int randomIndex = r.Next(allRequirementFaith.Count); Type type = cell.GetType(); @@ -3953,10 +3944,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) allRequirementFaith.RemoveAt(randomIndex); } - } - else if (cell.Def.Name == "maxQuantity") - { - if(!dontUseSpell) + else if (cell.Def.Name == "maxQuantity") { int randomIndex = r.Next(allMaxQuantity.Count); Type type = cell.GetType(); @@ -3969,6 +3957,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) allMaxQuantity.RemoveAt(randomIndex); } } + } } } @@ -4825,7 +4814,10 @@ private async void btnSubmit_Click(object sender, EventArgs e) else if (cell.Def.Name == "HitBulletID") { PropertyInfo prop = cell.GetType().GetProperty("Value"); - HitBulletIDVals.Add(Convert.ToInt32(prop.GetValue(cell, null))); + if(!checkBoxForceUseableBullets.Checked || Convert.ToInt32(prop.GetValue(cell, null)) != -1) + { + HitBulletIDVals.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } } else if (cell.Def.Name == "spEffectId0") { @@ -4998,13 +4990,16 @@ private async void btnSubmit_Click(object sender, EventArgs e) int randomIndex = r.Next(atkId_BulletVals.Count); Type type = cell.GetType(); PropertyInfo prop = type.GetProperty("Value"); - if (Convert.ToInt32(prop.GetValue(cell, null)) > 0) + if (Convert.ToInt32(prop.GetValue(cell, null)) > 0 || checkBoxForceUseableBullets.Checked) { if (chkBullets.Checked) { prop.SetValue(cell, atkId_BulletVals[randomIndex], null); } - atkId_BulletVals.RemoveAt(randomIndex); + if(!checkBoxForceUseableBullets.Checked) + { + atkId_BulletVals.RemoveAt(randomIndex); + } } } else if (cell.Def.Name == "sfxId_Bullet") @@ -5230,7 +5225,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) if (chkBullets.Checked) { - prop.SetValue(cell, hitRadiusVals[randomIndex], null); + if(!checkBoxForceUseableBullets.Checked || hitRadiusVals[randomIndex] >= 0.5) + { + prop.SetValue(cell, hitRadiusVals[randomIndex], null); + } + else + { + prop.SetValue(cell, 0.5, null); + } } hitRadiusVals.RemoveAt(randomIndex); @@ -5305,13 +5307,15 @@ private async void btnSubmit_Click(object sender, EventArgs e) int randomIndex = r.Next(HitBulletIDVals.Count); Type type = cell.GetType(); PropertyInfo prop = type.GetProperty("Value"); - - if (chkBullets.Checked) + if (!checkBoxForceUseableBullets.Checked || Convert.ToInt32(prop.GetValue(cell, null)) != -1) { - prop.SetValue(cell, HitBulletIDVals[randomIndex], null); - } + if (chkBullets.Checked) + { + prop.SetValue(cell, HitBulletIDVals[randomIndex], null); + } - HitBulletIDVals.RemoveAt(randomIndex); + HitBulletIDVals.RemoveAt(randomIndex); + } } else if (cell.Def.Name == "spEffectId0") { @@ -5723,6 +5727,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) else if (paramFile.ID == "CHARACTER_INIT_PARAM") { List validItems = new List(); + List validTitaniteItems = new List(); + List validSoulItems = new List(); List validUnstackableItems = new List(); List validRings = new List(); List classStartingLevel = new List(); @@ -5781,11 +5787,11 @@ private async void btnSubmit_Click(object sender, EventArgs e) { validItems.Add(380 + i); } - for (int i = 0; i < 7; i++) + for (int i = 0; i < 7; i++) //fire keeper souls { - validItems.Add(390 + i); + validSoulItems.Add(390 + i); } - for (int i = 0; i < 10; i++) + for (int i = 0; i < 10; i++) //generic soul items { validItems.Add(400 + i); } @@ -5793,11 +5799,11 @@ private async void btnSubmit_Click(object sender, EventArgs e) validItems.Add(501); //Twin Humanities for (int i = 0; i < 12; i++) //boss souls { - validItems.Add(700 + i); + validSoulItems.Add(700 + i); } for (int i = 0; i < 14; i++) //upgrade materia { - validItems.Add(1000 + (i*10)); + validTitaniteItems.Add(1000 + (i*10)); } if(!checkBoxPreventSpellGifts.Checked) //spells, miracles, pyromancies start here { @@ -6007,6 +6013,78 @@ private async void btnSubmit_Click(object sender, EventArgs e) Res = 1; } + if(i >= 6 && i <= 8 && Wil < 10) //6, 7, and 8 are magic based classes. make sure they have at least one attunement slot + { + int WilToAdd = 10 - Wil; + while(WilToAdd > 0) + { + int statToTry = r.Next(7); //0-7 skipping Wil + if(statToTry == 0) //Vit + { + if(Vit > 1) + { + Vit--; + WilToAdd--; + Wil++; + } + } + else if(statToTry == 1) //End + { + if (End > 1) + { + End--; + WilToAdd--; + Wil++; + } + } + else if(statToTry == 2) //Str + { + if (Str > 1) + { + Str--; + WilToAdd--; + Wil++; + } + } + else if (statToTry == 3) //Dex + { + if (Dex > 1) + { + Dex--; + WilToAdd--; + Wil++; + } + } + else if (statToTry == 4) //Mag + { + if (Mag > 1) + { + Mag--; + WilToAdd--; + Wil++; + } + } + else if (statToTry == 5) //Fai + { + if (Fai > 1) + { + Fai--; + WilToAdd--; + Wil++; + } + } + else if (statToTry == 6) //Res + { + if (Res > 1) + { + Res--; + WilToAdd--; + Wil++; + } + } + } + } + classLevels[i] = level; classStats[i, 0] = Vit; classStats[i, 1] = Wil; @@ -6097,11 +6175,35 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if(checkBoxStartingGifts.Checked) { - int randomIndex = r.Next(validItems.Count); - int itemId = validItems[randomIndex]; - itemStartingGifts.Add(itemId); - prop.SetValue(cell, itemId, null); - validItems.RemoveAt(randomIndex); + // 1/3 chance for titanite or boss souls to be chosen + if(r.Next(3) == 0) + { + // 1/2 to be a soul item + if(r.Next(2) == 0) + { + int randomIndex = r.Next(validSoulItems.Count); + int itemId = validSoulItems[randomIndex]; + itemStartingGifts.Add(itemId); + prop.SetValue(cell, itemId, null); + validSoulItems.RemoveAt(randomIndex); + } + else // else be a titanite item + { + int randomIndex = r.Next(validTitaniteItems.Count); + int itemId = validTitaniteItems[randomIndex]; + itemStartingGifts.Add(itemId); + prop.SetValue(cell, itemId, null); + validTitaniteItems.RemoveAt(randomIndex); + } + } + else + { + int randomIndex = r.Next(validItems.Count); + int itemId = validItems[randomIndex]; + itemStartingGifts.Add(itemId); + prop.SetValue(cell, itemId, null); + validItems.RemoveAt(randomIndex); + } } } else if (cell.Def.Name == "itemNum_01") @@ -6144,11 +6246,35 @@ private async void btnSubmit_Click(object sender, EventArgs e) if(r.Next(3) == 0) { isStackable = true; - int randomIndex = r.Next(validItems.Count); - int itemId = validItems[randomIndex]; - itemStartingGifts.Add(itemId); - prop.SetValue(cell, itemId, null); - validItems.RemoveAt(randomIndex); + // 1/3 chance for titanite or boss souls to be chosen + if (r.Next(3) == 0) + { + // 1/2 to be a soul item + if (r.Next(2) == 0) + { + int randomIndex = r.Next(validSoulItems.Count); + int itemId = validSoulItems[randomIndex]; + itemStartingGifts.Add(itemId); + prop.SetValue(cell, itemId, null); + validSoulItems.RemoveAt(randomIndex); + } + else // else be a titanite item + { + int randomIndex = r.Next(validTitaniteItems.Count); + int itemId = validTitaniteItems[randomIndex]; + itemStartingGifts.Add(itemId); + prop.SetValue(cell, itemId, null); + validTitaniteItems.RemoveAt(randomIndex); + } + } + else + { + int randomIndex = r.Next(validItems.Count); + int itemId = validItems[randomIndex]; + itemStartingGifts.Add(itemId); + prop.SetValue(cell, itemId, null); + validItems.RemoveAt(randomIndex); + } } else { @@ -6290,6 +6416,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) prop.SetValue(cell, classStats[classIndex, 6], null); } } + else if (cell.Def.Name == "slotLength") + { + //if slot length is greater than 1, make it length 1 + if (Convert.ToInt32(prop.GetValue(cell, null)) > 1) + { + prop.SetValue(cell, 1, null); + } + } } } } diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index dc46e26..d666eef 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -78,6 +78,7 @@ private void InitializeComponent() this.checkBoxStartingClasses = new System.Windows.Forms.CheckBox(); this.checkBoxForceUseableStartSpells = new System.Windows.Forms.CheckBox(); this.checkBoxForceUseableStartWeapons = new System.Windows.Forms.CheckBox(); + this.checkBoxForceUseableBullets = new System.Windows.Forms.CheckBox(); this.tooltip = new System.Windows.Forms.ToolTip(this.components); this.btnSavePreset = new System.Windows.Forms.Button(); this.btnLoadPreset = new System.Windows.Forms.Button(); @@ -195,7 +196,7 @@ private void InitializeComponent() this.chkWeaponDamage.Size = new System.Drawing.Size(161, 17); this.chkWeaponDamage.TabIndex = 12; this.chkWeaponDamage.Text = "Randomize weapon damage"; - this.tooltip.SetToolTip(this.chkWeaponDamage, "Randomizes weapon damage.\nEffected by Don\'t randomize by shuffle."); + this.tooltip.SetToolTip(this.chkWeaponDamage, "Randomizes weapon damage."); this.chkWeaponDamage.UseVisualStyleBackColor = true; // // chkWeaponMoveset @@ -215,15 +216,13 @@ private void InitializeComponent() // this.chkBullets.AutoSize = true; this.chkBullets.Checked = true; - this.chkBullets.CheckState = System.Windows.Forms.CheckState.Unchecked; + this.chkBullets.CheckState = System.Windows.Forms.CheckState.Checked; this.chkBullets.Location = new System.Drawing.Point(33, 348); this.chkBullets.Name = "chkBullets"; - this.chkBullets.Size = new System.Drawing.Size(112, 17); + this.chkBullets.Size = new System.Drawing.Size(116, 17); this.chkBullets.TabIndex = 9; - this.chkBullets.Text = "Randomize bullets*"; - this.tooltip.SetToolTip(this.chkBullets, "Randomizes bullets in several ways such as damage, damage type, movement, etc.\r\nA" + - "ppears to effect both player and enemy projectiles.\r\nWARNING: Can result in a lot of magi" + - "c classes having unusable spells."); + this.chkBullets.Text = "Randomize bullets"; + this.tooltip.SetToolTip(this.chkBullets, resources.GetString("chkBullets.ToolTip")); this.chkBullets.UseVisualStyleBackColor = true; // // chkKnockback @@ -410,7 +409,7 @@ private void InitializeComponent() this.checkBoxWeaponScaling.Size = new System.Drawing.Size(156, 17); this.checkBoxWeaponScaling.TabIndex = 24; this.checkBoxWeaponScaling.Text = "Randomize weapon scaling"; - this.tooltip.SetToolTip(this.checkBoxWeaponScaling, "Randomizes the scaling of a weapon.\nEffected by Don\'t randomize by shuffle."); + this.tooltip.SetToolTip(this.checkBoxWeaponScaling, "Randomizes the scaling of a weapon."); this.checkBoxWeaponScaling.UseVisualStyleBackColor = true; // // checkBoxWeaponStatMin @@ -436,7 +435,7 @@ private void InitializeComponent() this.checkBoxWeaponWeight.Size = new System.Drawing.Size(154, 17); this.checkBoxWeaponWeight.TabIndex = 27; this.checkBoxWeaponWeight.Text = "Randomize weapon weight"; - this.tooltip.SetToolTip(this.checkBoxWeaponWeight, "Randomizes the weight of a weapon.\nEffected by Don\'t randomize by shuffle."); + this.tooltip.SetToolTip(this.checkBoxWeaponWeight, "Randomizes the weight of a weapon."); this.checkBoxWeaponWeight.UseVisualStyleBackColor = true; // // checkBoxWeaponStamina @@ -449,7 +448,7 @@ private void InitializeComponent() this.checkBoxWeaponStamina.Size = new System.Drawing.Size(159, 17); this.checkBoxWeaponStamina.TabIndex = 25; this.checkBoxWeaponStamina.Text = "Randomize weapon stamina"; - this.tooltip.SetToolTip(this.checkBoxWeaponStamina, "Randomizes the stamina usage of weapons.\nEffected by Don\'t randomize by shuffle."); + this.tooltip.SetToolTip(this.checkBoxWeaponStamina, "Randomizes the stamina usage of weapons."); this.checkBoxWeaponStamina.UseVisualStyleBackColor = true; // // checkBoxWeaponDefense @@ -708,6 +707,19 @@ private void InitializeComponent() "universally useable."); this.checkBoxForceUseableStartWeapons.UseVisualStyleBackColor = true; // + // checkBoxForceUseableBullets + // + this.checkBoxForceUseableBullets.AutoSize = true; + this.checkBoxForceUseableBullets.Checked = true; + this.checkBoxForceUseableBullets.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxForceUseableBullets.Location = new System.Drawing.Point(268, 371); + this.checkBoxForceUseableBullets.Name = "checkBoxForceUseableBullets"; + this.checkBoxForceUseableBullets.Size = new System.Drawing.Size(126, 17); + this.checkBoxForceUseableBullets.TabIndex = 45; + this.checkBoxForceUseableBullets.Text = "Force useable bullets"; + this.tooltip.SetToolTip(this.checkBoxForceUseableBullets, "Forces bullets to be useable. (or at least tries to.)\nAffects both players and enemies."); + this.checkBoxForceUseableBullets.UseVisualStyleBackColor = true; + // // tooltip // this.tooltip.AutoPopDelay = 32767; @@ -862,6 +874,7 @@ private void InitializeComponent() this.Controls.Add(this.checkBoxStartingGiftsAmount); this.Controls.Add(this.checkBoxStartingClasses); this.Controls.Add(this.chkBullets); + this.Controls.Add(this.checkBoxForceUseableBullets); this.Controls.Add(this.chkKnockback); this.Controls.Add(this.chkSpeffects); this.Controls.Add(this.chkWeaponSpeffects); @@ -946,6 +959,7 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox checkBoxStartingClasses; private System.Windows.Forms.CheckBox checkBoxForceUseableStartSpells; private System.Windows.Forms.CheckBox checkBoxForceUseableStartWeapons; + private System.Windows.Forms.CheckBox checkBoxForceUseableBullets; private System.Windows.Forms.ToolTip tooltip; private System.Windows.Forms.GroupBox gbWeaponCategory; private System.Windows.Forms.GroupBox gbSpellCategory; diff --git a/Paramdomizer/Form1.resx b/Paramdomizer/Form1.resx index aba1090..4ec039c 100644 --- a/Paramdomizer/Form1.resx +++ b/Paramdomizer/Form1.resx @@ -117,25 +117,29 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + 17, 17 - + If paramdomizer randomized your game in the past, it will load an unrandomized backup before randomizing again. useful to remove some of the effects of the randomizer before randomizing it again. paramdomizer now uses a different extension for backuping files to make it easier for it as well as you to accurately tell what the file was like before changes were made. (or to differentiate backups from different randomizers) WARNING: WILL NOT RETURN TO VANILLA IF THE ORIGINAL BACKUP WASNT VANILLA (happens if you run a different randomizer prior to paramdomizer) + + + Randomizes bullets in several ways such as damage, damage type, movement, etc. +Affects both player and enemy projectiles. Randomizes the minimum stats for a weapon. Fists will be effected unless don't modify fists is enabled -If enabled the straight sword hilt will have no stat requirements. (To prevent softlocking from starting with no useable weapons) -Effected by Don't randomize by shuffle. +If enabled the straight sword hilt will have no stat requirements. (To prevent softlocking from starting with no useable weapons) Instead of the defualt behavior which is just to randomly shuffle the randomized element, this will attempt to randomize items by not shuffling them. Seeds may not be persistant across different settings if this is enabled. -Supported settings will have tooltip text indicating that it works with this option. +Supported settings are listed in the more settings window for this option. Requires randomize bullets to be enabled. @@ -151,10 +155,10 @@ Also shuffles starting level. Any spells / pyromancies / miracles that a class starts with will have their stat requirements lowered if that class can't cast it at their starting level. Also effects starting caster tools like the pyromancy flame and sorcerer's catalyst. - + + 48 - - + AAABAAUAEBAAAAEAIABoBAAAVgAAABgYAAABACAAiAkAAL4EAAAgIAAAAQAgAKgQAABGDgAAMDAAAAEA From 5650233fc39fdfb43ee8695d733b7ec640e7c10f Mon Sep 17 00:00:00 2001 From: Kiroko Date: Tue, 4 Feb 2020 17:05:10 -0600 Subject: [PATCH 05/21] Added more dont randomize by shuffle support --- Paramdomizer/Form1.cs | 541 ++++++++++++++++++++++++++++++--- Paramdomizer/Form2.Designer.cs | 176 ++++++++++- Paramdomizer/Form2.resx | 4 + 3 files changed, 665 insertions(+), 56 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index fd0acd2..c666d3f 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -1109,7 +1109,15 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorWeight.Checked) { - prop.SetValue(cell, allArmorWeights[randomIndex], null); + if(checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorWeight.Checked) + { + //randomized by 0.1 steps + prop.SetValue(cell, r.Next(196) / 10.0, null); + } + else + { + prop.SetValue(cell, allArmorWeights[randomIndex], null); + } } allArmorWeights.RemoveAt(randomIndex); @@ -1121,7 +1129,22 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorPoise.Checked) { - prop.SetValue(cell, allArmorPoise[randomIndex], null); + if(checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorPoise.Checked) + { + // 1/2 chance to get poise + if(r.Next(2) == 0) + { + prop.SetValue(cell, r.Next(46) + 2, null); + } + else + { + prop.SetValue(cell, 0, null); + } + } + else + { + prop.SetValue(cell, allArmorPoise[randomIndex], null); + } } allArmorPoise.RemoveAt(randomIndex); @@ -1145,7 +1168,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorDefensePhys[randomIndex], null); + if(checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + prop.SetValue(cell, r.Next(104) + 3, null); + } + else + { + prop.SetValue(cell, allArmorDefensePhys[randomIndex], null); + } } allArmorDefensePhys.RemoveAt(randomIndex); @@ -1157,7 +1187,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorDefenseMagic[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + prop.SetValue(cell, r.Next(56) + 1, null); + } + else + { + prop.SetValue(cell, allArmorDefenseMagic[randomIndex], null); + } } allArmorDefenseMagic.RemoveAt(randomIndex); @@ -1169,7 +1206,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorDefenseFire[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + prop.SetValue(cell, r.Next(65) + 2, null); + } + else + { + prop.SetValue(cell, allArmorDefenseFire[randomIndex], null); + } } allArmorDefenseFire.RemoveAt(randomIndex); @@ -1181,7 +1225,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorDefenseThunder[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + prop.SetValue(cell, r.Next(58) + 2, null); + } + else + { + prop.SetValue(cell, allArmorDefenseThunder[randomIndex], null); + } } allArmorDefenseThunder.RemoveAt(randomIndex); @@ -1193,7 +1244,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorDefenseSlash[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + prop.SetValue(cell, r.Next(25) + 3, null); + } + else + { + prop.SetValue(cell, allArmorDefenseSlash[randomIndex], null); + } } allArmorDefenseSlash.RemoveAt(randomIndex); @@ -1205,7 +1263,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorDefenseBlow[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + prop.SetValue(cell, r.Next(116) - 48, null); + } + else + { + prop.SetValue(cell, allArmorDefenseBlow[randomIndex], null); + } } allArmorDefenseBlow.RemoveAt(randomIndex); @@ -1217,7 +1282,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorDefenseThrust[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + prop.SetValue(cell, r.Next(35) - 17, null); + } + else + { + prop.SetValue(cell, allArmorDefenseThrust[randomIndex], null); + } } allArmorDefenseThrust.RemoveAt(randomIndex); @@ -1229,7 +1301,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorResistPoison[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + prop.SetValue(cell, r.Next(91) + 4, null); + } + else + { + prop.SetValue(cell, allArmorResistPoison[randomIndex], null); + } } allArmorResistPoison.RemoveAt(randomIndex); @@ -1241,7 +1320,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorResistDisease[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + prop.SetValue(cell, r.Next(91) + 4, null); + } + else + { + prop.SetValue(cell, allArmorResistDisease[randomIndex], null); + } } allArmorResistDisease.RemoveAt(randomIndex); @@ -1253,7 +1339,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorResistBlood[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + prop.SetValue(cell, r.Next(51) + 4, null); + } + else + { + prop.SetValue(cell, allArmorResistBlood[randomIndex], null); + } } allArmorResistBlood.RemoveAt(randomIndex); @@ -1265,7 +1358,22 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxArmorResistance.Checked) { - prop.SetValue(cell, allArmorResistCurse[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorResistance.Checked) + { + // 1/2 chance to get a value + if(r.Next(1) == 0) + { + prop.SetValue(cell, r.Next(58), null); + } + else + { + prop.SetValue(cell, 0, null); + } + } + else + { + prop.SetValue(cell, allArmorResistCurse[randomIndex], null); + } } allArmorResistCurse.RemoveAt(randomIndex); @@ -2395,7 +2503,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allPhysicalGuard[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + if(checkBoxWeaponShieldSplit.Checked) //this is offensive weapons only + { + prop.SetValue(cell, r.Next(51) + 20, null); + } + else + { + prop.SetValue(cell, r.Next(81) + 20, null); + } + } + else + { + prop.SetValue(cell, allPhysicalGuard[randomIndex], null); + } } allPhysicalGuard.RemoveAt(randomIndex); @@ -2411,7 +2533,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allMagicGuard[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + if (checkBoxWeaponShieldSplit.Checked) //this is offensive weapons only + { + prop.SetValue(cell, r.Next(46) + 5, null); + } + else + { + prop.SetValue(cell, r.Next(96) + 5, null); + } + } + else + { + prop.SetValue(cell, allMagicGuard[randomIndex], null); + } } allMagicGuard.RemoveAt(randomIndex); @@ -2427,7 +2563,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allFireGuard[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + if (checkBoxWeaponShieldSplit.Checked) //this is offensive weapons only + { + prop.SetValue(cell, r.Next(36) + 15, null); + } + else + { + prop.SetValue(cell, r.Next(86) + 15, null); + } + } + else + { + prop.SetValue(cell, allFireGuard[randomIndex], null); + } } allFireGuard.RemoveAt(randomIndex); @@ -2443,7 +2593,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allThunderGuard[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + if (checkBoxWeaponShieldSplit.Checked) //this is offensive weapons only + { + prop.SetValue(cell, r.Next(36) + 15, null); + } + else + { + prop.SetValue(cell, r.Next(86) + 15, null); + } + } + else + { + prop.SetValue(cell, allThunderGuard[randomIndex], null); + } } allThunderGuard.RemoveAt(randomIndex); @@ -2459,7 +2623,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allGuardStability[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + if (checkBoxWeaponShieldSplit.Checked) //this is offensive weapons only + { + prop.SetValue(cell, r.Next(41) + 10, null); + } + else + { + prop.SetValue(cell, r.Next(81) + 10, null); + } + } + else + { + prop.SetValue(cell, allGuardStability[randomIndex], null); + } } allGuardStability.RemoveAt(randomIndex); @@ -2475,7 +2653,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allPoisonResist[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + if (checkBoxWeaponShieldSplit.Checked) //this is offensive weapons only + { + prop.SetValue(cell, r.Next(61), null); + } + else + { + prop.SetValue(cell, r.Next(101), null); + } + } + else + { + prop.SetValue(cell, allPoisonResist[randomIndex], null); + } } allPoisonResist.RemoveAt(randomIndex); @@ -2491,7 +2683,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allDiseaseResist[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + if (checkBoxWeaponShieldSplit.Checked) //this is offensive weapons only + { + prop.SetValue(cell, r.Next(61), null); + } + else + { + prop.SetValue(cell, r.Next(101), null); + } + } + else + { + prop.SetValue(cell, allDiseaseResist[randomIndex], null); + } } allDiseaseResist.RemoveAt(randomIndex); @@ -2507,7 +2713,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allBloodResist[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + if (checkBoxWeaponShieldSplit.Checked) //this is offensive weapons only + { + prop.SetValue(cell, r.Next(61), null); + } + else + { + prop.SetValue(cell, r.Next(101), null); + } + } + else + { + prop.SetValue(cell, allBloodResist[randomIndex], null); + } } allBloodResist.RemoveAt(randomIndex); @@ -2523,7 +2743,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allCurseResist[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + if (checkBoxWeaponShieldSplit.Checked) //this is offensive weapons only + { + prop.SetValue(cell, r.Next(61), null); + } + else + { + prop.SetValue(cell, r.Next(101), null); + } + } + else + { + prop.SetValue(cell, allCurseResist[randomIndex], null); + } } allCurseResist.RemoveAt(randomIndex); @@ -2539,7 +2773,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allGuardBaseRepel[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + if (checkBoxWeaponShieldSplit.Checked) //this is offensive weapons only + { + prop.SetValue(cell, 10, null); + } + else + { + prop.SetValue(cell, r.Next(71) + 10, null); + } + } + else + { + prop.SetValue(cell, allGuardBaseRepel[randomIndex], null); + } } allGuardBaseRepel.RemoveAt(randomIndex); @@ -2555,7 +2803,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allAttackBaseRepel[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + prop.SetValue(cell, r.Next(56) + 15, null); + } + else + { + prop.SetValue(cell, allAttackBaseRepel[randomIndex], null); + } } allAttackBaseRepel.RemoveAt(randomIndex); @@ -3553,7 +3808,22 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allPhysicalGuard[randomIndex], null); + if(checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + // 1/3 chance to have 100 defense + if(r.Next(3) == 0) + { + prop.SetValue(cell, 100, null); + } + else // 65 to 100 + { + prop.SetValue(cell, r.Next(36) + 65, null); + } + } + else + { + prop.SetValue(cell, allPhysicalGuard[randomIndex], null); + } } allPhysicalGuard.RemoveAt(randomIndex); @@ -3569,7 +3839,22 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allMagicGuard[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + // 1/10 chance to have 80-100 defense + if (r.Next(10) == 0) + { + prop.SetValue(cell, r.Next(21) + 80, null); + } + else // 25 to 70 + { + prop.SetValue(cell, r.Next(46) + 25, null); + } + } + else + { + prop.SetValue(cell, allMagicGuard[randomIndex], null); + } } allMagicGuard.RemoveAt(randomIndex); @@ -3585,7 +3870,22 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allFireGuard[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + // 1/2 chance to have 51-100 defense + if (r.Next(2) == 0) + { + prop.SetValue(cell, r.Next(50) + 51, null); + } + else // 10 to 50 + { + prop.SetValue(cell, r.Next(41) + 10, null); + } + } + else + { + prop.SetValue(cell, allFireGuard[randomIndex], null); + } } allFireGuard.RemoveAt(randomIndex); @@ -3601,7 +3901,22 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allThunderGuard[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + // 1/4 chance to have 61-100 defense + if (r.Next(4) == 0) + { + prop.SetValue(cell, r.Next(40) + 61, null); + } + else // 30 to 60 + { + prop.SetValue(cell, r.Next(31) + 30, null); + } + } + else + { + prop.SetValue(cell, allThunderGuard[randomIndex], null); + } } allThunderGuard.RemoveAt(randomIndex); @@ -3617,7 +3932,15 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allGuardStability[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + //30 to 90 + prop.SetValue(cell, r.Next(61) + 30, null); + } + else + { + prop.SetValue(cell, allGuardStability[randomIndex], null); + } } allGuardStability.RemoveAt(randomIndex); @@ -3633,7 +3956,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allPoisonResist[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + prop.SetValue(cell, r.Next(101), null); + } + else + { + prop.SetValue(cell, allPoisonResist[randomIndex], null); + } } allPoisonResist.RemoveAt(randomIndex); @@ -3649,7 +3979,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allDiseaseResist[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + prop.SetValue(cell, r.Next(101), null); + } + else + { + prop.SetValue(cell, allDiseaseResist[randomIndex], null); + } } allDiseaseResist.RemoveAt(randomIndex); @@ -3665,7 +4002,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allBloodResist[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + prop.SetValue(cell, r.Next(101), null); + } + else + { + prop.SetValue(cell, allBloodResist[randomIndex], null); + } } allBloodResist.RemoveAt(randomIndex); @@ -3681,7 +4025,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allCurseResist[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + prop.SetValue(cell, r.Next(101), null); + } + else + { + prop.SetValue(cell, allCurseResist[randomIndex], null); + } } allCurseResist.RemoveAt(randomIndex); @@ -3697,7 +4048,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allGuardBaseRepel[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + prop.SetValue(cell, r.Next(71) + 10, null); + } + else + { + prop.SetValue(cell, allGuardBaseRepel[randomIndex], null); + } } allGuardBaseRepel.RemoveAt(randomIndex); @@ -3713,7 +4071,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponDefense.Checked) { - prop.SetValue(cell, allAttackBaseRepel[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponDefense.Checked) + { + prop.SetValue(cell, r.Next(56) + 15, null); + } + else + { + prop.SetValue(cell, allAttackBaseRepel[randomIndex], null); + } } allAttackBaseRepel.RemoveAt(randomIndex); @@ -3915,7 +4280,37 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxRandomizeSpellSlotSize.Checked) { - prop.SetValue(cell, allSlotLengths[randomIndex], null); + if(checkBoxDoTrueRandom.Checked && TRForm.chkTRSpellSlotSize.Checked) + { + // 1/10 chance to get a non one slot size + if(r.Next(10) == 0) + { + // 2/4 chance for 2; 1/4 for 3; 1/4 for 0 + if(r.Next(2) == 0) + { + if(r.Next(2) == 0) + { + prop.SetValue(cell, 3, null); + } + else + { + prop.SetValue(cell, 0, null); + } + } + else + { + prop.SetValue(cell, 2, null); + } + } + else + { + prop.SetValue(cell, 1, null); + } + } + else + { + prop.SetValue(cell, allSlotLengths[randomIndex], null); + } } allSlotLengths.RemoveAt(randomIndex); @@ -3927,7 +4322,22 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxRandomizeSpellRequirements.Checked) { - prop.SetValue(cell, allRequirementIntellect[randomIndex], null); + if(checkBoxDoTrueRandom.Checked && TRForm.chkTRSpellRequirements.Checked) + { + // 1/3 chance to have no req + if(r.Next(3) == 0) + { + prop.SetValue(cell, r.Next(41) + 10, null); + } + else + { + prop.SetValue(cell, 0, null); + } + } + else + { + prop.SetValue(cell, allRequirementIntellect[randomIndex], null); + } } allRequirementIntellect.RemoveAt(randomIndex); @@ -3939,7 +4349,22 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxRandomizeSpellRequirements.Checked) { - prop.SetValue(cell, allRequirementFaith[randomIndex], null); + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRSpellRequirements.Checked) + { + // 1/3 chance to have no req + if (r.Next(3) == 0) + { + prop.SetValue(cell, r.Next(41) + 10, null); + } + else + { + prop.SetValue(cell, 0, null); + } + } + else + { + prop.SetValue(cell, allRequirementFaith[randomIndex], null); + } } allRequirementFaith.RemoveAt(randomIndex); @@ -3951,7 +4376,22 @@ private async void btnSubmit_Click(object sender, EventArgs e) PropertyInfo prop = type.GetProperty("Value"); if (checkBoxRandomizeSpellQuantity.Checked) { - prop.SetValue(cell, allMaxQuantity[randomIndex], null); + if(checkBoxDoTrueRandom.Checked && TRForm.chkTRSpellQuantity.Checked) + { + // 1/5 chance to roll higher + if(r.Next(5) == 0) + { + prop.SetValue(cell, r.Next(101) + 11, null); + } + else + { + prop.SetValue(cell, r.Next(10) + 1, null); + } + } + else + { + prop.SetValue(cell, allMaxQuantity[randomIndex], null); + } } allMaxQuantity.RemoveAt(randomIndex); @@ -7179,7 +7619,8 @@ private void btnLoadPreset_Click(object sender, EventArgs e) int a1 = s.ReadByte(); //armor byte int s1 = s.ReadByte(); //spells byte int o1 = s.ReadByte(); //other settings byte (options in the other settings tab) - int altRand1 = s.ReadByte(); //alternative randomization (don't randomize by shuffle) + int altRand1 = s.ReadByte(); //alternative randomization's 1st byte (don't randomize by shuffle) + int altRand2 = s.ReadByte(); //alternative randomization's 2nd byte (don't randomize by shuffle) //weapons 1st byte @@ -7234,13 +7675,22 @@ private void btnLoadPreset_Click(object sender, EventArgs e) checkBoxStartingGiftsAmount.Checked = getState(o1, 6); checkBoxStartingClasses.Checked = getState(o1, 7); - //alternative randomization (don't randomize by shuffle) + //alternative randomization's 1st byte (don't randomize by shuffle) checkBoxDoTrueRandom.Checked = getState(altRand1, 0); TRForm.chkTRWeaponDamage.Checked = getState(altRand1, 1); TRForm.chkTRWeaponWeight.Checked = getState(altRand1, 2); TRForm.chkTRWeaponScaling.Checked = getState(altRand1, 3); TRForm.chkTRWeaponStamina.Checked = getState(altRand1, 4); TRForm.chkTRWeaponStatMin.Checked = getState(altRand1, 5); + TRForm.chkTRWeaponDefense.Checked = getState(altRand1, 6); + TRForm.chkTRArmorResistance.Checked = getState(altRand1, 7); + + //alternative randomization's 2nd byte (don't randomize by shuffle) + TRForm.chkTRArmorPoise.Checked = getState(altRand2, 0); + TRForm.chkTRArmorWeight.Checked = getState(altRand2, 1); + TRForm.chkTRSpellRequirements.Checked = getState(altRand2, 2); + TRForm.chkTRSpellSlotSize.Checked = getState(altRand2, 3); + TRForm.chkTRSpellQuantity.Checked = getState(altRand2, 4); @@ -7269,6 +7719,7 @@ private void btnSavePreset_Click(object sender, EventArgs e) s.Write(header, 0, 10); + byte[] stringBytes = System.Text.Encoding.ASCII.GetBytes(txtSeed.Text); if(stringBytes.Length > 128) //has more than 128 characters { @@ -7311,9 +7762,13 @@ private void btnSavePreset_Click(object sender, EventArgs e) writeByte(s, chkItemAnimations.Checked, chkRandomFaceData.Checked, chkRingSpeffects.Checked, chkVoices.Checked, checkBoxStartingGifts.Checked, checkBoxPreventSpellGifts.Checked, checkBoxStartingGiftsAmount.Checked, checkBoxStartingClasses.Checked); - //alternative randomization (don't randomize by shuffle) + //alternative randomization's 1st byte (don't randomize by shuffle) writeByte(s, checkBoxDoTrueRandom.Checked, TRForm.chkTRWeaponDamage.Checked, TRForm.chkTRWeaponWeight.Checked, TRForm.chkTRWeaponScaling.Checked, - TRForm.chkTRWeaponStamina.Checked, TRForm.chkTRWeaponStatMin.Checked); + TRForm.chkTRWeaponStamina.Checked, TRForm.chkTRWeaponStatMin.Checked, TRForm.chkTRWeaponDefense.Checked, TRForm.chkTRArmorResistance.Checked); + + //alternative randomization's 2nd byte (don't randomize by shuffle) + writeByte(s, TRForm.chkTRArmorPoise.Checked, TRForm.chkTRArmorWeight.Checked, TRForm.chkTRSpellRequirements.Checked, TRForm.chkTRSpellSlotSize.Checked, + TRForm.chkTRSpellQuantity.Checked); diff --git a/Paramdomizer/Form2.Designer.cs b/Paramdomizer/Form2.Designer.cs index 2e497cf..d47b37b 100644 --- a/Paramdomizer/Form2.Designer.cs +++ b/Paramdomizer/Form2.Designer.cs @@ -29,19 +29,29 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form2)); this.btnCloseWindow = new System.Windows.Forms.Button(); this.chkTRWeaponDamage = new System.Windows.Forms.CheckBox(); this.chkTRWeaponScaling = new System.Windows.Forms.CheckBox(); this.chkTRWeaponStamina = new System.Windows.Forms.CheckBox(); this.chkTRWeaponWeight = new System.Windows.Forms.CheckBox(); this.chkTRWeaponStatMin = new System.Windows.Forms.CheckBox(); + this.chkTRWeaponDefense = new System.Windows.Forms.CheckBox(); + this.chkTRArmorResistance = new System.Windows.Forms.CheckBox(); + this.chkTRArmorPoise = new System.Windows.Forms.CheckBox(); + this.chkTRArmorWeight = new System.Windows.Forms.CheckBox(); + this.chkTRSpellRequirements = new System.Windows.Forms.CheckBox(); + this.chkTRSpellSlotSize = new System.Windows.Forms.CheckBox(); + this.chkTRSpellQuantity = new System.Windows.Forms.CheckBox(); this.gbWeaponCategory = new System.Windows.Forms.GroupBox(); + this.gbArmorCategory = new System.Windows.Forms.GroupBox(); + this.gbSpellCategory = new System.Windows.Forms.GroupBox(); this.tooltip = new System.Windows.Forms.ToolTip(this.components); this.SuspendLayout(); // // btnCloseWindow // - this.btnCloseWindow.Location = new System.Drawing.Point(413, 115); + this.btnCloseWindow.Location = new System.Drawing.Point(413, 235); this.btnCloseWindow.Name = "btnCloseWindow"; this.btnCloseWindow.Size = new System.Drawing.Size(75, 23); this.btnCloseWindow.TabIndex = 0; @@ -56,9 +66,9 @@ private void InitializeComponent() this.chkTRWeaponDamage.CheckState = System.Windows.Forms.CheckState.Checked; this.chkTRWeaponDamage.Location = new System.Drawing.Point(36, 38); this.chkTRWeaponDamage.Name = "chkTRWeaponDamage"; - this.chkTRWeaponDamage.Size = new System.Drawing.Size(138, 17); + this.chkTRWeaponDamage.Size = new System.Drawing.Size(141, 17); this.chkTRWeaponDamage.TabIndex = 1; - this.chkTRWeaponDamage.Text = "weapon damage DRBS"; + this.chkTRWeaponDamage.Text = "Weapon damage DRBS"; this.tooltip.SetToolTip(this.chkTRWeaponDamage, "Randomize weapon damage by generating a random number instead of shuffling vanill" + "a values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); this.chkTRWeaponDamage.UseVisualStyleBackColor = true; @@ -70,9 +80,9 @@ private void InitializeComponent() this.chkTRWeaponScaling.CheckState = System.Windows.Forms.CheckState.Checked; this.chkTRWeaponScaling.Location = new System.Drawing.Point(36, 61); this.chkTRWeaponScaling.Name = "chkTRWeaponScaling"; - this.chkTRWeaponScaling.Size = new System.Drawing.Size(133, 17); + this.chkTRWeaponScaling.Size = new System.Drawing.Size(136, 17); this.chkTRWeaponScaling.TabIndex = 1; - this.chkTRWeaponScaling.Text = "weapon scaling DRBS"; + this.chkTRWeaponScaling.Text = "Weapon scaling DRBS"; this.tooltip.SetToolTip(this.chkTRWeaponScaling, "Randomize weapon scaling by generating a random number instead of shuffling vanil" + "la values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); this.chkTRWeaponScaling.UseVisualStyleBackColor = true; @@ -84,9 +94,9 @@ private void InitializeComponent() this.chkTRWeaponStamina.CheckState = System.Windows.Forms.CheckState.Checked; this.chkTRWeaponStamina.Location = new System.Drawing.Point(273, 61); this.chkTRWeaponStamina.Name = "chkTRWeaponStamina"; - this.chkTRWeaponStamina.Size = new System.Drawing.Size(136, 17); + this.chkTRWeaponStamina.Size = new System.Drawing.Size(139, 17); this.chkTRWeaponStamina.TabIndex = 1; - this.chkTRWeaponStamina.Text = "weapon stamina DRBS"; + this.chkTRWeaponStamina.Text = "Weapon stamina DRBS"; this.tooltip.SetToolTip(this.chkTRWeaponStamina, "Randomize weapon stamina by generating a random number instead of shuffling vanil" + "la values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); this.chkTRWeaponStamina.UseVisualStyleBackColor = true; @@ -98,9 +108,9 @@ private void InitializeComponent() this.chkTRWeaponWeight.CheckState = System.Windows.Forms.CheckState.Checked; this.chkTRWeaponWeight.Location = new System.Drawing.Point(273, 38); this.chkTRWeaponWeight.Name = "chkTRWeaponWeight"; - this.chkTRWeaponWeight.Size = new System.Drawing.Size(131, 17); + this.chkTRWeaponWeight.Size = new System.Drawing.Size(134, 17); this.chkTRWeaponWeight.TabIndex = 1; - this.chkTRWeaponWeight.Text = "weapon weight DRBS"; + this.chkTRWeaponWeight.Text = "Weapon weight DRBS"; this.tooltip.SetToolTip(this.chkTRWeaponWeight, "Randomize weapon weight by generating a random number instead of shuffling vanill" + "a values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); this.chkTRWeaponWeight.UseVisualStyleBackColor = true; @@ -112,24 +122,144 @@ private void InitializeComponent() this.chkTRWeaponStatMin.CheckState = System.Windows.Forms.CheckState.Checked; this.chkTRWeaponStatMin.Location = new System.Drawing.Point(36, 84); this.chkTRWeaponStatMin.Name = "chkTRWeaponStatMin"; - this.chkTRWeaponStatMin.Size = new System.Drawing.Size(165, 17); + this.chkTRWeaponStatMin.Size = new System.Drawing.Size(168, 17); this.chkTRWeaponStatMin.TabIndex = 1; - this.chkTRWeaponStatMin.Text = "weapon minimum stats DRBS"; + this.chkTRWeaponStatMin.Text = "Weapon minimum stats DRBS"; this.tooltip.SetToolTip(this.chkTRWeaponStatMin, "Randomize weapon\'s minimum stats by generating a random number instead of shuffli" + "ng vanilla values.\nDon\'t Randomize by Shuffle needs to be on for this to functio" + "n."); this.chkTRWeaponStatMin.UseVisualStyleBackColor = true; // + // chkTRWeaponDefense + // + this.chkTRWeaponDefense.AutoSize = true; + this.chkTRWeaponDefense.Checked = true; + this.chkTRWeaponDefense.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRWeaponDefense.Location = new System.Drawing.Point(273, 84); + this.chkTRWeaponDefense.Name = "chkTRWeaponDefense"; + this.chkTRWeaponDefense.Size = new System.Drawing.Size(141, 17); + this.chkTRWeaponDefense.TabIndex = 1; + this.chkTRWeaponDefense.Text = "Weapon defense DRBS"; + this.tooltip.SetToolTip(this.chkTRWeaponDefense, "Randomize weapon\'s defense values by generating random numbers instead of shuffli" + + "ng vanilla values.\nSupports weapon shield split.\nDon\'t Randomize by Shuffle need" + + "s to be on for this to function."); + this.chkTRWeaponDefense.UseVisualStyleBackColor = true; + // + // chkTRArmorResistance + // + this.chkTRArmorResistance.AutoSize = true; + this.chkTRArmorResistance.Checked = true; + this.chkTRArmorResistance.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRArmorResistance.Location = new System.Drawing.Point(36, 126); + this.chkTRArmorResistance.Name = "chkTRArmorResistance"; + this.chkTRArmorResistance.Size = new System.Drawing.Size(137, 17); + this.chkTRArmorResistance.TabIndex = 1; + this.chkTRArmorResistance.Text = "Armor resistance DRBS"; + this.tooltip.SetToolTip(this.chkTRArmorResistance, "Randomize armor\'s defense values by generating random numbers instead of shufflin" + + "g vanilla values.\nDon\'t Randomize by Shuffle needs to be on for this to function" + + "."); + this.chkTRArmorResistance.UseVisualStyleBackColor = true; + // + // chkTRArmorPoise + // + this.chkTRArmorPoise.AutoSize = true; + this.chkTRArmorPoise.Checked = true; + this.chkTRArmorPoise.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRArmorPoise.Location = new System.Drawing.Point(273, 126); + this.chkTRArmorPoise.Name = "chkTRArmorPoise"; + this.chkTRArmorPoise.Size = new System.Drawing.Size(114, 17); + this.chkTRArmorPoise.TabIndex = 1; + this.chkTRArmorPoise.Text = "Armor poise DRBS"; + this.tooltip.SetToolTip(this.chkTRArmorPoise, "Randomize armor\'s poise values by generating random numbers instead of shuffling " + + "vanilla values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); + this.chkTRArmorPoise.UseVisualStyleBackColor = true; + // + // chkTRArmorWeight + // + this.chkTRArmorWeight.AutoSize = true; + this.chkTRArmorWeight.Checked = true; + this.chkTRArmorWeight.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRArmorWeight.Location = new System.Drawing.Point(36, 149); + this.chkTRArmorWeight.Name = "chkTRArmorWeight"; + this.chkTRArmorWeight.Size = new System.Drawing.Size(120, 17); + this.chkTRArmorWeight.TabIndex = 1; + this.chkTRArmorWeight.Text = "Armor weight DRBS"; + this.tooltip.SetToolTip(this.chkTRArmorWeight, "Randomize armor\'s weight values by generating random numbers instead of shuffling" + + " vanilla values.\nDon\'t Randomize by Shuffle needs to be on for this to function." + + ""); + this.chkTRArmorWeight.UseVisualStyleBackColor = true; + // + // chkTRSpellRequirements + // + this.chkTRSpellRequirements.AutoSize = true; + this.chkTRSpellRequirements.Checked = true; + this.chkTRSpellRequirements.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRSpellRequirements.Location = new System.Drawing.Point(36, 191); + this.chkTRSpellRequirements.Name = "chkTRSpellRequirements"; + this.chkTRSpellRequirements.Size = new System.Drawing.Size(145, 17); + this.chkTRSpellRequirements.TabIndex = 1; + this.chkTRSpellRequirements.Text = "Spell requirements DRBS"; + this.tooltip.SetToolTip(this.chkTRSpellRequirements, "Randomize spell requirements by generating random numbers instead of shuffling va" + + "nilla values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); + this.chkTRSpellRequirements.UseVisualStyleBackColor = true; + // + // chkTRSpellSlotSize + // + this.chkTRSpellSlotSize.AutoSize = true; + this.chkTRSpellSlotSize.Checked = true; + this.chkTRSpellSlotSize.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRSpellSlotSize.Location = new System.Drawing.Point(273, 191); + this.chkTRSpellSlotSize.Name = "chkTRSpellSlotSize"; + this.chkTRSpellSlotSize.Size = new System.Drawing.Size(122, 17); + this.chkTRSpellSlotSize.TabIndex = 1; + this.chkTRSpellSlotSize.Text = "Spell slot size DRBS"; + this.tooltip.SetToolTip(this.chkTRSpellSlotSize, resources.GetString("chkTRSpellSlotSize.ToolTip")); + this.chkTRSpellSlotSize.UseVisualStyleBackColor = true; + // + // chkTRSpellQuantity + // + this.chkTRSpellQuantity.AutoSize = true; + this.chkTRSpellQuantity.Checked = true; + this.chkTRSpellQuantity.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRSpellQuantity.Location = new System.Drawing.Point(36, 214); + this.chkTRSpellQuantity.Name = "chkTRSpellQuantity"; + this.chkTRSpellQuantity.Size = new System.Drawing.Size(122, 17); + this.chkTRSpellQuantity.TabIndex = 1; + this.chkTRSpellQuantity.Text = "Spell quantity DRBS"; + this.tooltip.SetToolTip(this.chkTRSpellQuantity, "Randomize spell quantity by generating random numbers instead of shuffling vanill" + + "a values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); + this.chkTRSpellQuantity.UseVisualStyleBackColor = true; + // // gbWeaponCategory // this.gbWeaponCategory.AutoSize = true; this.gbWeaponCategory.Location = new System.Drawing.Point(12, 12); this.gbWeaponCategory.Name = "gbWeaponCategory"; - this.gbWeaponCategory.Size = new System.Drawing.Size(432, 89); + this.gbWeaponCategory.Size = new System.Drawing.Size(450, 89); this.gbWeaponCategory.TabIndex = 2; this.gbWeaponCategory.TabStop = false; this.gbWeaponCategory.Text = "Weapon Settings:"; // + // gbArmorCategory + // + this.gbArmorCategory.AutoSize = true; + this.gbArmorCategory.Location = new System.Drawing.Point(12, 107); + this.gbArmorCategory.Name = "gbArmorCategory"; + this.gbArmorCategory.Size = new System.Drawing.Size(450, 59); + this.gbArmorCategory.TabIndex = 2; + this.gbArmorCategory.TabStop = false; + this.gbArmorCategory.Text = "Armor Settings:"; + // + // gbSpellCategory + // + this.gbSpellCategory.AutoSize = true; + this.gbSpellCategory.Location = new System.Drawing.Point(12, 172); + this.gbSpellCategory.Name = "gbSpellCategory"; + this.gbSpellCategory.Size = new System.Drawing.Size(450, 57); + this.gbSpellCategory.TabIndex = 2; + this.gbSpellCategory.TabStop = false; + this.gbSpellCategory.Text = "Spell Settings:"; + // // tooltip // this.tooltip.AutoPopDelay = 32767; @@ -140,14 +270,23 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(500, 150); + this.ClientSize = new System.Drawing.Size(500, 270); this.Controls.Add(this.btnCloseWindow); this.Controls.Add(this.chkTRWeaponDamage); this.Controls.Add(this.chkTRWeaponScaling); this.Controls.Add(this.chkTRWeaponStamina); this.Controls.Add(this.chkTRWeaponWeight); this.Controls.Add(this.chkTRWeaponStatMin); + this.Controls.Add(this.chkTRWeaponDefense); + this.Controls.Add(this.chkTRArmorResistance); + this.Controls.Add(this.chkTRArmorPoise); + this.Controls.Add(this.chkTRArmorWeight); + this.Controls.Add(this.chkTRSpellRequirements); + this.Controls.Add(this.chkTRSpellSlotSize); + this.Controls.Add(this.chkTRSpellQuantity); this.Controls.Add(this.gbWeaponCategory); + this.Controls.Add(this.gbArmorCategory); + this.Controls.Add(this.gbSpellCategory); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; @@ -166,7 +305,18 @@ private void InitializeComponent() public System.Windows.Forms.CheckBox chkTRWeaponWeight; public System.Windows.Forms.CheckBox chkTRWeaponStamina; public System.Windows.Forms.CheckBox chkTRWeaponStatMin; + public System.Windows.Forms.CheckBox chkTRWeaponDefense; + public System.Windows.Forms.CheckBox chkTRArmorResistance; + public System.Windows.Forms.CheckBox chkTRArmorPoise; + public System.Windows.Forms.CheckBox chkTRArmorWeight; + public System.Windows.Forms.CheckBox chkTRSpellRequirements; + public System.Windows.Forms.CheckBox chkTRSpellSlotSize; + public System.Windows.Forms.CheckBox chkTRSpellQuantity; public System.Windows.Forms.GroupBox gbWeaponCategory; + public System.Windows.Forms.GroupBox gbArmorCategory; + public System.Windows.Forms.GroupBox gbSpellCategory; + //public System.Windows.Forms.GroupBox gbEnemyCategory; + //public System.Windows.Forms.GroupBox gbNPCPCCategory; public System.Windows.Forms.ToolTip tooltip; } } \ No newline at end of file diff --git a/Paramdomizer/Form2.resx b/Paramdomizer/Form2.resx index 023cd0c..00b11b0 100644 --- a/Paramdomizer/Form2.resx +++ b/Paramdomizer/Form2.resx @@ -120,4 +120,8 @@ 17, 17 + + Randomize spell slot size by generating random numbers instead of shuffling vanilla values. (on rare cases a spell will cost 3 or 0 slots) +Don't Randomize by Shuffle needs to be on for this to function. + \ No newline at end of file From d4b6afa6ad14b834f2088a63646d8ac66d4a609a Mon Sep 17 00:00:00 2001 From: Kiroko Date: Wed, 5 Feb 2020 14:21:07 -0600 Subject: [PATCH 06/21] prevent magic adjust going to shit if randomize scaling is on --- Paramdomizer/Form1.cs | 139 ++++++++++++++++++++++++++++++++---------- 1 file changed, 108 insertions(+), 31 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index c666d3f..b98bb1d 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -1397,6 +1397,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) List allAttackCorrectAgility = new List(); List allAttackCorrectMagic = new List(); List allAttackCorrectFaith = new List(); + List allCastingCorrectMagic = new List(); + List allCastingCorrectFaith = new List(); List allAttackProperStrength = new List(); //minimum stats List allAttackProperAgility = new List(); List allAttackProperMagic = new List(); @@ -1620,12 +1622,28 @@ private async void btnSubmit_Click(object sender, EventArgs e) else if (cell.Def.Name == "correctMagic") { PropertyInfo prop = cell.GetType().GetProperty("Value"); - allAttackCorrectMagic.Add(Convert.ToInt32(prop.GetValue(cell, null))); + //if id is between sorcerer catalyst and velka's talisman (is a casting device); treat it's magic and faith correct differently + if(paramRow.ID >= 1300000 && paramRow.ID <= 1367000) + { + allCastingCorrectMagic.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else + { + allAttackCorrectMagic.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } } else if (cell.Def.Name == "correctFaith") { PropertyInfo prop = cell.GetType().GetProperty("Value"); - allAttackCorrectFaith.Add(Convert.ToInt32(prop.GetValue(cell, null))); + //if id is between sorcerer catalyst and velka's talisman (is a casting device); treat it's magic and faith correct differently + if (paramRow.ID >= 1300000 && paramRow.ID <= 1367000) + { + allCastingCorrectFaith.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else + { + allAttackCorrectFaith.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } } else if (cell.Def.Name == "properStrength") { @@ -2099,75 +2117,134 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "correctMagic") { - int randomIndex = r.Next(allAttackCorrectMagic.Count); + bool isCaster = paramRow.ID >= 1300000 && paramRow.ID <= 1367000; + int randomIndex; + if (isCaster) + { + randomIndex = r.Next(allCastingCorrectMagic.Count); + } + else + { + randomIndex = r.Next(allAttackCorrectMagic.Count); + } Type type = cell.GetType(); PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponScaling.Checked) { if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { - //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does - if (r.Next(3) == 0) + if(isCaster) { - //small chance that the value will be above a certain value (used to prevent higher values appearing more frequently because outliers are included) - if (r.Next(20) == 0) + prop.SetValue(cell, r.Next(251) + 0, null); + } + else + { + //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does + if (r.Next(3) == 0) { - //215 is the cap for a stat (tin crystallization catalyst) - prop.SetValue(cell, r.Next(116) + 100, null); + //small chance that the value will be above a certain value (used to prevent higher values appearing more frequently because outliers are included) + if (r.Next(20) == 0) + { + //215 is the cap for a stat (tin crystallization catalyst) + prop.SetValue(cell, r.Next(116) + 100, null); + } + else + { + prop.SetValue(cell, r.Next(101), null); + } } else { - prop.SetValue(cell, r.Next(101), null); + prop.SetValue(cell, r.Next(0), null); } } - else - { - prop.SetValue(cell, r.Next(0), null); - } } else { - prop.SetValue(cell, allAttackCorrectMagic[randomIndex], null); + if(isCaster) + { + prop.SetValue(cell, allCastingCorrectMagic[randomIndex], null); + } + else + { + prop.SetValue(cell, allAttackCorrectMagic[randomIndex], null); + } } } - - allAttackCorrectMagic.RemoveAt(randomIndex); + if(isCaster) + { + allCastingCorrectMagic.RemoveAt(randomIndex); + } + else + { + allAttackCorrectMagic.RemoveAt(randomIndex); + } } else if (cell.Def.Name == "correctFaith") { - int randomIndex = r.Next(allAttackCorrectFaith.Count); + bool isCaster = paramRow.ID >= 1300000 && paramRow.ID <= 1367000; + int randomIndex; + if(isCaster) + { + randomIndex = r.Next(allCastingCorrectFaith.Count); + } + else + { + randomIndex = r.Next(allAttackCorrectFaith.Count); + } Type type = cell.GetType(); PropertyInfo prop = type.GetProperty("Value"); if (checkBoxWeaponScaling.Checked) { if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { - //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does - if (r.Next(3) == 0) + if(isCaster) { - //small chance that the value will be above a certain value (used to prevent higher values appearing more frequently because outliers are included) - if (r.Next(20) == 0) + prop.SetValue(cell, r.Next(251), null); + } + else + { + //if DoTrueRandom, 1/3 chance of an attack type being selected and then randomly role the scaling it does + if (r.Next(3) == 0) { - //215 is the cap for a stat (tin crystallization catalyst) - prop.SetValue(cell, r.Next(116) + 100, null); + //small chance that the value will be above a certain value (used to prevent higher values appearing more frequently because outliers are included) + if (r.Next(20) == 0) + { + //215 is the cap for a stat (tin crystallization catalyst) + prop.SetValue(cell, r.Next(116) + 100, null); + } + else + { + prop.SetValue(cell, r.Next(101), null); + } } else { - prop.SetValue(cell, r.Next(101), null); + prop.SetValue(cell, r.Next(0), null); } } - else - { - prop.SetValue(cell, r.Next(0), null); - } } else { - prop.SetValue(cell, allAttackCorrectFaith[randomIndex], null); + if(isCaster) + { + prop.SetValue(cell, allCastingCorrectFaith[randomIndex], null); + } + else + { + prop.SetValue(cell, allAttackCorrectFaith[randomIndex], null); + } } } - allAttackCorrectFaith.RemoveAt(randomIndex); + if(isCaster) + { + allCastingCorrectFaith.RemoveAt(randomIndex); + } + else + { + allAttackCorrectFaith.RemoveAt(randomIndex); + } } else if (cell.Def.Name == "properStrength") { From a91e7ad5f81e661230172b21c6e29b573faed777 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Wed, 5 Feb 2020 14:46:05 -0600 Subject: [PATCH 07/21] blacklisted models in weapon model randomization -blacklisted some models from weapon model randomization because they gave weapons no hitbox -also version bump to differentiate from current binary --- Paramdomizer/Form1.cs | 90 ++++++++++++++++++++++++++++++---- Paramdomizer/Form1.designer.cs | 2 +- 2 files changed, 82 insertions(+), 10 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index b98bb1d..37689b3 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -1421,6 +1421,72 @@ private async void btnSubmit_Click(object sender, EventArgs e) List allGuardBaseRepel = new List(); List allAttackBaseRepel = new List(); + //a list of weapon models to blacklist the randomization of because they don't have inherit hitboxes for melee use. + List allNoHitboxIDs = new List(); + if(chkWeaponModels.Checked) + { + allNoHitboxIDs.Add(199000); //blank + allNoHitboxIDs.Add(299000); //blank + allNoHitboxIDs.Add(398000); //blank + allNoHitboxIDs.Add(399000); //blank + allNoHitboxIDs.Add(498000); //blank + allNoHitboxIDs.Add(499000); //blank + allNoHitboxIDs.Add(599000); //blank + allNoHitboxIDs.Add(699000); //blank + allNoHitboxIDs.Add(798000); //blank + allNoHitboxIDs.Add(799000); //blank + allNoHitboxIDs.Add(898000); //blank + allNoHitboxIDs.Add(899000); //blank + allNoHitboxIDs.Add(999000); //blank + allNoHitboxIDs.Add(1099000); //blank? + allNoHitboxIDs.Add(1199000); //blank + allNoHitboxIDs.Add(1298000); //blank + allNoHitboxIDs.Add(1299000); //blank + allNoHitboxIDs.Add(1397000); //blank + allNoHitboxIDs.Add(1398000); //blank + allNoHitboxIDs.Add(1399000); //blank + allNoHitboxIDs.Add(1498000); //blank + allNoHitboxIDs.Add(1499000); //blank + allNoHitboxIDs.Add(1599000); //blank + allNoHitboxIDs.Add(1699000); //blank + for(int i = 0; i <= 8; i++) //arrows + { + allNoHitboxIDs.Add(2000000 + (i * 1000)); + } + allNoHitboxIDs.Add(2099000); //arrow + for(int i = 0; i <= 4; i++) //bolts + { + allNoHitboxIDs.Add(2100000 + (i * 1000)); + } + allNoHitboxIDs.Add(2199000); //bolt + for(int i = 4; i <= 7; i++) //unused weapons??? + { + int baseId = 9000000 + (i * 1000); + allNoHitboxIDs.Add(baseId); + allNoHitboxIDs.Add(baseId + 100); + allNoHitboxIDs.Add(baseId + 200); + allNoHitboxIDs.Add(baseId + 400); + allNoHitboxIDs.Add(baseId + 600); + allNoHitboxIDs.Add(baseId + 800); + } + for(int i = 1; i <= 17; i++) //unused weapons??? + { + allNoHitboxIDs.Add(9012000 + (i * 100)); + } + for (int i = 1; i <= 9; i++) //unused weapons??? + { + allNoHitboxIDs.Add(9016000 + (i * 100)); + } + for (int i = 1; i <= 5; i++) //unused weapons??? + { + allNoHitboxIDs.Add(9017000 + (i * 100)); + } + for (int i = 2; i <= 9; i++) //unused weapons??? + { + allNoHitboxIDs.Add(9019000 + (i * 100)); + } + } + //only assign shield ids if shield split is activated List allShieldIDs = new List(); if(checkBoxWeaponShieldSplit.Checked) @@ -1586,8 +1652,11 @@ private async void btnSubmit_Click(object sender, EventArgs e) { if (cell.Def.Name == "equipModelId") { - PropertyInfo prop = cell.GetType().GetProperty("Value"); - allEquipModelIds.Add(Convert.ToInt32(prop.GetValue(cell, null))); + if(!allNoHitboxIDs.Contains(paramRow.ID)) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + allEquipModelIds.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } } else if (cell.Def.Name == "attackBasePhysics") { @@ -1909,15 +1978,18 @@ private async void btnSubmit_Click(object sender, EventArgs e) { if (cell.Def.Name == "equipModelId") { - int randomIndex = r.Next(allEquipModelIds.Count); - Type type = cell.GetType(); - PropertyInfo prop = type.GetProperty("Value"); - if (chkWeaponModels.Checked) + if(!allNoHitboxIDs.Contains(paramRow.ID)) { - prop.SetValue(cell, allEquipModelIds[randomIndex], null); - } + int randomIndex = r.Next(allEquipModelIds.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + if (chkWeaponModels.Checked) + { + prop.SetValue(cell, allEquipModelIds[randomIndex], null); + } - allEquipModelIds.RemoveAt(randomIndex); + allEquipModelIds.RemoveAt(randomIndex); + } } else if (cell.Def.Name == "attackBasePhysics") { diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index d666eef..0ceef36 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -828,7 +828,7 @@ private void InitializeComponent() this.lblVersion.Name = "lblVersion"; this.lblVersion.Size = new System.Drawing.Size(90, 13); this.lblVersion.TabIndex = 41; - this.lblVersion.Text = "DEV version 0.3d"; + this.lblVersion.Text = "DEV version 0.3e"; // // Form1 // From eb2b04e5e89d57efc4950156e0c9d88147c346f6 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Wed, 5 Feb 2020 14:58:10 -0600 Subject: [PATCH 08/21] bows and crossbow weapon model randomization seperated from the rest of the weapons -was causing weapons to have no hitbox on attack. now bows and crossbows can still have different models without effecting other weapons --- Paramdomizer/Form1.cs | 61 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index 37689b3..6e0b9f1 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -1487,6 +1487,31 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } + //a list of bow/crossbow weapon models; bows and crossbows can cause no hitboxes when swapped with regular weapons; this is so their models still get randomized + List allBowIDs = new List(); + List allBowEquipModelIds = new List(); //use this for the model shuffling + if (chkWeaponModels.Checked) + { + for(int i = 0; i <= 30; i++) //bows up to dragonslayer + { + allBowIDs.Add(1200000 + (i * 100)); + } + for (int i = 0; i <= 13; i++) //bows up to darkmoon + { + allBowIDs.Add(1204000 + (i * 100)); + } + for (int i = 0; i <= 3; i++) //crossbows + avelyn + { + int baseId = 1250000 + (i * 1000); + allBowIDs.Add(baseId); + allBowIDs.Add(baseId + 100); + allBowIDs.Add(baseId + 200); + allBowIDs.Add(baseId + 400); + allBowIDs.Add(baseId + 600); + allBowIDs.Add(baseId + 800); + } + } + //only assign shield ids if shield split is activated List allShieldIDs = new List(); if(checkBoxWeaponShieldSplit.Checked) @@ -1655,7 +1680,14 @@ private async void btnSubmit_Click(object sender, EventArgs e) if(!allNoHitboxIDs.Contains(paramRow.ID)) { PropertyInfo prop = cell.GetType().GetProperty("Value"); - allEquipModelIds.Add(Convert.ToInt32(prop.GetValue(cell, null))); + if(!allBowEquipModelIds.Contains(paramRow.ID)) + { + allEquipModelIds.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else + { + allBowEquipModelIds.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } } } else if (cell.Def.Name == "attackBasePhysics") @@ -1980,15 +2012,30 @@ private async void btnSubmit_Click(object sender, EventArgs e) { if(!allNoHitboxIDs.Contains(paramRow.ID)) { - int randomIndex = r.Next(allEquipModelIds.Count); - Type type = cell.GetType(); - PropertyInfo prop = type.GetProperty("Value"); - if (chkWeaponModels.Checked) + if(!allBowEquipModelIds.Contains(paramRow.ID)) { - prop.SetValue(cell, allEquipModelIds[randomIndex], null); + int randomIndex = r.Next(allEquipModelIds.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + if (chkWeaponModels.Checked) + { + prop.SetValue(cell, allEquipModelIds[randomIndex], null); + } + + allEquipModelIds.RemoveAt(randomIndex); } + else + { + int randomIndex = r.Next(allBowEquipModelIds.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + if (chkWeaponModels.Checked) + { + prop.SetValue(cell, allBowEquipModelIds[randomIndex], null); + } - allEquipModelIds.RemoveAt(randomIndex); + allBowEquipModelIds.RemoveAt(randomIndex); + } } } else if (cell.Def.Name == "attackBasePhysics") From 3032c9b5e20c422cb631751bdd294725319b8628 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Wed, 5 Feb 2020 15:27:03 -0600 Subject: [PATCH 09/21] Added "Surprise me" button to randomly set settings --- Paramdomizer/Form1.cs | 83 ++++++++++++++++++++++++++++++++++ Paramdomizer/Form1.designer.cs | 21 +++++++-- Paramdomizer/Form1.resx | 15 ++---- 3 files changed, 106 insertions(+), 13 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index 6e0b9f1..33b5f0b 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -8019,10 +8019,93 @@ private bool getState(int b, int index) return state; } + private bool nextBool(Random x) + { + return x.Next(2) == 0; + } + private void btnDoTrueRandomPopup_Click(object sender, EventArgs e) { TRForm.ShowDialog(); } + + private void btnRandomizeSettings_Click(object sender, EventArgs e) + { + DialogResult result = MessageBox.Show("WARNING: You are about to randomize which settings are enabled and which settings are disabled.\nDo you want to continue?", "Randomize Enabled Settings", MessageBoxButtons.YesNo); + if (result == DialogResult.Yes) + { + Random msr = new Random(); + + //weapons 1st + chkWeaponDamage.Checked = nextBool(msr); + chkWeaponMoveset.Checked = nextBool(msr); + chkWeaponModels.Checked = nextBool(msr); + checkBoxWeaponWeight.Checked = nextBool(msr); + checkBoxWeaponScaling.Checked = nextBool(msr); + checkBoxWeaponStamina.Checked = nextBool(msr); + checkBoxWeaponStatMin.Checked = nextBool(msr); + chkWeaponSpeffects.Checked = nextBool(msr); + + //weapons 2nd + checkBoxWeaponDefense.Checked = nextBool(msr); + checkBoxWeaponShieldSplit.Checked = nextBool(msr); + checkBoxWeaponFistNo.Checked = nextBool(msr); + checkBoxForceUseableStartWeapons.Checked = nextBool(msr); + + //enemies + chkAggroRadius.Checked = nextBool(msr); + chkTurnSpeeds.Checked = nextBool(msr); + chkSpeffects.Checked = nextBool(msr); + + //enemy and player + chkStaggerLevels.Checked = nextBool(msr); + chkKnockback.Checked = nextBool(msr); + chkBullets.Checked = nextBool(msr); + chkHitboxSizes.Checked = nextBool(msr); + checkBoxNerfHumanityBullets.Checked = nextBool(msr); + + //armor + checkBoxArmorResistance.Checked = nextBool(msr); + checkBoxArmorWeight.Checked = nextBool(msr); + checkBoxArmorPoise.Checked = nextBool(msr); + checkBoxArmorspEffect.Checked = nextBool(msr); + + //spells + checkBoxUniversalizeCasters.Checked = nextBool(msr); + checkBoxRandomizeSpellRequirements.Checked = nextBool(msr); + checkBoxRandomizeSpellSlotSize.Checked = nextBool(msr); + checkBoxRandomizeSpellQuantity.Checked = nextBool(msr); + chkMagicAnimations.Checked = nextBool(msr); + checkBoxForceUseableStartSpells.Checked = nextBool(msr); + + //other settings + chkItemAnimations.Checked = nextBool(msr); + chkRandomFaceData.Checked = nextBool(msr); + chkRingSpeffects.Checked = nextBool(msr); + chkVoices.Checked = nextBool(msr); + checkBoxStartingGifts.Checked = nextBool(msr); + checkBoxPreventSpellGifts.Checked = nextBool(msr); + checkBoxStartingGiftsAmount.Checked = nextBool(msr); + checkBoxStartingClasses.Checked = nextBool(msr); + + //alternative randomization's 1st + checkBoxDoTrueRandom.Checked = nextBool(msr); + TRForm.chkTRWeaponDamage.Checked = nextBool(msr); + TRForm.chkTRWeaponWeight.Checked = nextBool(msr); + TRForm.chkTRWeaponScaling.Checked = nextBool(msr); + TRForm.chkTRWeaponStamina.Checked = nextBool(msr); + TRForm.chkTRWeaponStatMin.Checked = nextBool(msr); + TRForm.chkTRWeaponDefense.Checked = nextBool(msr); + TRForm.chkTRArmorResistance.Checked = nextBool(msr); + + //alternative randomization's 2nd + TRForm.chkTRArmorPoise.Checked = nextBool(msr); + TRForm.chkTRArmorWeight.Checked = nextBool(msr); + TRForm.chkTRSpellRequirements.Checked = nextBool(msr); + TRForm.chkTRSpellSlotSize.Checked = nextBool(msr); + TRForm.chkTRSpellQuantity.Checked = nextBool(msr); + } + } } } diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index 0ceef36..ac3fc05 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -82,6 +82,7 @@ private void InitializeComponent() this.tooltip = new System.Windows.Forms.ToolTip(this.components); this.btnSavePreset = new System.Windows.Forms.Button(); this.btnLoadPreset = new System.Windows.Forms.Button(); + this.btnRandomizeSettings = new System.Windows.Forms.Button(); this.btnDoTrueRandomPopup = new System.Windows.Forms.Button(); this.gbWeaponCategory = new System.Windows.Forms.GroupBox(); this.gbSpellCategory = new System.Windows.Forms.GroupBox(); @@ -219,10 +220,11 @@ private void InitializeComponent() this.chkBullets.CheckState = System.Windows.Forms.CheckState.Checked; this.chkBullets.Location = new System.Drawing.Point(33, 348); this.chkBullets.Name = "chkBullets"; - this.chkBullets.Size = new System.Drawing.Size(116, 17); + this.chkBullets.Size = new System.Drawing.Size(112, 17); this.chkBullets.TabIndex = 9; this.chkBullets.Text = "Randomize bullets"; - this.tooltip.SetToolTip(this.chkBullets, resources.GetString("chkBullets.ToolTip")); + this.tooltip.SetToolTip(this.chkBullets, "Randomizes bullets in several ways such as damage, damage type, movement, etc.\r\nA" + + "ffects both player and enemy projectiles."); this.chkBullets.UseVisualStyleBackColor = true; // // chkKnockback @@ -717,7 +719,8 @@ private void InitializeComponent() this.checkBoxForceUseableBullets.Size = new System.Drawing.Size(126, 17); this.checkBoxForceUseableBullets.TabIndex = 45; this.checkBoxForceUseableBullets.Text = "Force useable bullets"; - this.tooltip.SetToolTip(this.checkBoxForceUseableBullets, "Forces bullets to be useable. (or at least tries to.)\nAffects both players and enemies."); + this.tooltip.SetToolTip(this.checkBoxForceUseableBullets, "Forces bullets to be useable. (or at least tries to.)\nAffects both players and en" + + "emies."); this.checkBoxForceUseableBullets.UseVisualStyleBackColor = true; // // tooltip @@ -748,6 +751,16 @@ private void InitializeComponent() this.btnLoadPreset.UseVisualStyleBackColor = true; this.btnLoadPreset.Click += new System.EventHandler(this.btnLoadPreset_Click); // + // btnRandomizeSettings + // + this.btnRandomizeSettings.Location = new System.Drawing.Point(663, 27); + this.btnRandomizeSettings.Name = "btnRandomizeSettings"; + this.btnRandomizeSettings.Size = new System.Drawing.Size(69, 25); + this.btnRandomizeSettings.TabIndex = 47; + this.btnRandomizeSettings.Text = "Roll a Die"; + this.tooltip.SetToolTip(this.btnRandomizeSettings, "Randomizes the state of every setting."); + this.btnRandomizeSettings.Click += new System.EventHandler(this.btnRandomizeSettings_Click); + // // btnDoTrueRandomPopup // this.btnDoTrueRandomPopup.Location = new System.Drawing.Point(192, 408); @@ -837,6 +850,7 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(960, 470); this.Controls.Add(this.btnLoadPreset); this.Controls.Add(this.btnSavePreset); + this.Controls.Add(this.btnRandomizeSettings); this.Controls.Add(this.btnDoTrueRandomPopup); this.Controls.Add(this.checkBoxLoadFromBackup); this.Controls.Add(this.checkBoxNerfHumanityBullets); @@ -970,6 +984,7 @@ private void InitializeComponent() private System.Windows.Forms.Label lblVersion; private System.Windows.Forms.Button btnSavePreset; private System.Windows.Forms.Button btnLoadPreset; + private System.Windows.Forms.Button btnRandomizeSettings; private System.Windows.Forms.Button btnDoTrueRandomPopup; } } diff --git a/Paramdomizer/Form1.resx b/Paramdomizer/Form1.resx index 4ec039c..fbe6a94 100644 --- a/Paramdomizer/Form1.resx +++ b/Paramdomizer/Form1.resx @@ -117,19 +117,14 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + 17, 17 - + If paramdomizer randomized your game in the past, it will load an unrandomized backup before randomizing again. useful to remove some of the effects of the randomizer before randomizing it again. paramdomizer now uses a different extension for backuping files to make it easier for it as well as you to accurately tell what the file was like before changes were made. (or to differentiate backups from different randomizers) WARNING: WILL NOT RETURN TO VANILLA IF THE ORIGINAL BACKUP WASNT VANILLA (happens if you run a different randomizer prior to paramdomizer) - - - Randomizes bullets in several ways such as damage, damage type, movement, etc. -Affects both player and enemy projectiles. Randomizes the minimum stats for a weapon. @@ -155,10 +150,10 @@ Also shuffles starting level. Any spells / pyromancies / miracles that a class starts with will have their stat requirements lowered if that class can't cast it at their starting level. Also effects starting caster tools like the pyromancy flame and sorcerer's catalyst. - - + 48 - + + AAABAAUAEBAAAAEAIABoBAAAVgAAABgYAAABACAAiAkAAL4EAAAgIAAAAQAgAKgQAABGDgAAMDAAAAEA From a50d4a2bf3067ca046a5e1b3b34c07750866adf1 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Fri, 7 Feb 2020 17:18:13 -0600 Subject: [PATCH 10/21] blacklisted covenant of artorias from speffect randomization, disabled enemy speffect randomization by default while looking into enemies not dying bug --- Paramdomizer/Form1.cs | 17 ++++++++++++----- Paramdomizer/Form1.designer.cs | 8 ++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index 33b5f0b..ce732dd 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -906,6 +906,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (paramFile.ID == "EQUIP_PARAM_ACCESSORY_ST") { + List blacklistedIds = new List() { 2200 }; //blacklist covenant of artorias's effect being randomized, preventing some soft locks List allRefIds = new List(); foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) { @@ -914,7 +915,10 @@ private async void btnSubmit_Click(object sender, EventArgs e) if (cell.Def.Name == "refId") { PropertyInfo prop = cell.GetType().GetProperty("Value"); - allRefIds.Add(Convert.ToInt32(prop.GetValue(cell, null))); + if(!blacklistedIds.Contains(Convert.ToInt32(prop.GetValue(cell, null)))) + { + allRefIds.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } } } } @@ -930,12 +934,15 @@ private async void btnSubmit_Click(object sender, EventArgs e) Type type = cell.GetType(); PropertyInfo prop = type.GetProperty("Value"); - if (chkRingSpeffects.Checked) + if(!blacklistedIds.Contains(Convert.ToInt32(prop.GetValue(cell, null)))) { - prop.SetValue(cell, allRefIds[randomIndex], null); - } + if (chkRingSpeffects.Checked) + { + prop.SetValue(cell, allRefIds[randomIndex], null); + } - allRefIds.RemoveAt(randomIndex); + allRefIds.RemoveAt(randomIndex); + } } } } diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index ac3fc05..810138e 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -161,7 +161,7 @@ private void InitializeComponent() this.chkRingSpeffects.Size = new System.Drawing.Size(168, 17); this.chkRingSpeffects.TabIndex = 7; this.chkRingSpeffects.Text = "Randomize SPeffects on rings"; - this.tooltip.SetToolTip(this.chkRingSpeffects, "Randomizes the effects of rings amongst each other."); + this.tooltip.SetToolTip(this.chkRingSpeffects, "Randomizes the effects of rings amongst each other. Does not randomize the covenant of artorias."); this.chkRingSpeffects.UseVisualStyleBackColor = true; // // lblMessage @@ -246,13 +246,13 @@ private void InitializeComponent() // this.chkSpeffects.AutoSize = true; this.chkSpeffects.Checked = true; - this.chkSpeffects.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkSpeffects.CheckState = System.Windows.Forms.CheckState.Unchecked; this.chkSpeffects.Location = new System.Drawing.Point(33, 277); this.chkSpeffects.Name = "chkSpeffects"; this.chkSpeffects.Size = new System.Drawing.Size(185, 17); this.chkSpeffects.TabIndex = 5; - this.chkSpeffects.Text = "Randomize SPeffects on enemies"; - this.tooltip.SetToolTip(this.chkSpeffects, "Randomizes special effects on enemies as well as their attacks."); + this.chkSpeffects.Text = "Randomize SPeffects on enemies*"; + this.tooltip.SetToolTip(this.chkSpeffects, "Randomizes special effects on enemies as well as their attacks.\nWARNING: currently breaks enemy death animations sometimes???"); this.chkSpeffects.UseVisualStyleBackColor = true; // // chkWeaponSpeffects From 07b24b868380665261a86bc372d1aaee7e83187e Mon Sep 17 00:00:00 2001 From: Kiroko Date: Fri, 7 Feb 2020 17:57:37 -0600 Subject: [PATCH 11/21] nerf caster base damage to prevent insane damage from it's improved scaling --- Paramdomizer/Form1.cs | 205 ++++++++++++++++++++++++++------- Paramdomizer/Form1.designer.cs | 2 +- 2 files changed, 164 insertions(+), 43 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index ce732dd..08fd5ef 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -1400,6 +1400,10 @@ private async void btnSubmit_Click(object sender, EventArgs e) List allAttackBaseMagic = new List(); List allAttackBaseFire = new List(); List allAttackBaseThunder = new List(); + List allCastingBasePhysic = new List(); + List allCastingBaseMagic = new List(); + List allCastingBaseFire = new List(); + List allCastingBaseThunder = new List(); List allAttackCorrectStrength = new List(); //scaling List allAttackCorrectAgility = new List(); List allAttackCorrectMagic = new List(); @@ -1633,6 +1637,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) } allShieldIDs.Add(9014000); //Cleansing Greatshield } + //heads up to those who maintain this in the future: //when treat shields seperately is enabled it runs a different set of @@ -1680,6 +1685,19 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } + bool castsMagic = false; + //check if casts magic first + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + if (cell.Def.Name == "enableMagic:1" || cell.Def.Name == "enableVowMagic:1" || cell.Def.Name == "enableSorcery:1") + { + if (Convert.ToBoolean(cell.GetType().GetProperty("Value").GetValue(cell, null)) == true) + { + castsMagic = true; + } + } + } + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) { if (cell.Def.Name == "equipModelId") @@ -1700,22 +1718,54 @@ private async void btnSubmit_Click(object sender, EventArgs e) else if (cell.Def.Name == "attackBasePhysics") { PropertyInfo prop = cell.GetType().GetProperty("Value"); - allAttackBasePhysic.Add(Convert.ToInt32(prop.GetValue(cell, null))); + //if id is between sorcerer catalyst and velka's talisman (is a casting device); treat it's magic and faith correct differently; both dlc catalysts added + if (castsMagic) + { + allCastingBasePhysic.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else + { + allAttackBasePhysic.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } } else if (cell.Def.Name == "attackBaseMagic") { PropertyInfo prop = cell.GetType().GetProperty("Value"); - allAttackBaseMagic.Add(Convert.ToInt32(prop.GetValue(cell, null))); + //if id is between sorcerer catalyst and velka's talisman (is a casting device); treat it's magic and faith correct differently; both dlc catalysts added + if (castsMagic) + { + allCastingBaseMagic.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else + { + allAttackBaseMagic.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } } else if (cell.Def.Name == "attackBaseFire") { PropertyInfo prop = cell.GetType().GetProperty("Value"); - allAttackBaseFire.Add(Convert.ToInt32(prop.GetValue(cell, null))); + //if id is between sorcerer catalyst and velka's talisman (is a casting device); treat it's magic and faith correct differently; both dlc catalysts added + if (castsMagic) + { + allCastingBaseFire.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else + { + allAttackBaseFire.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } } else if (cell.Def.Name == "attackBaseThunder") { PropertyInfo prop = cell.GetType().GetProperty("Value"); - allAttackBaseThunder.Add(Convert.ToInt32(prop.GetValue(cell, null))); + //if id is between sorcerer catalyst and velka's talisman (is a casting device); treat it's magic and faith correct differently; both dlc catalysts added + if (castsMagic) + { + allCastingBaseThunder.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else + { + allAttackBaseThunder.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } } else if (cell.Def.Name == "correctStrength") { @@ -1730,8 +1780,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) else if (cell.Def.Name == "correctMagic") { PropertyInfo prop = cell.GetType().GetProperty("Value"); - //if id is between sorcerer catalyst and velka's talisman (is a casting device); treat it's magic and faith correct differently - if(paramRow.ID >= 1300000 && paramRow.ID <= 1367000) + //if id is between sorcerer catalyst and velka's talisman (is a casting device); treat it's magic and faith correct differently; both dlc catalysts added + if (castsMagic) { allCastingCorrectMagic.Add(Convert.ToInt32(prop.GetValue(cell, null))); } @@ -1743,8 +1793,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) else if (cell.Def.Name == "correctFaith") { PropertyInfo prop = cell.GetType().GetProperty("Value"); - //if id is between sorcerer catalyst and velka's talisman (is a casting device); treat it's magic and faith correct differently - if (paramRow.ID >= 1300000 && paramRow.ID <= 1367000) + //if id is between sorcerer catalyst and velka's talisman (is a casting device); treat it's magic and faith correct differently; both dlc catalysts added + if (castsMagic) { allCastingCorrectFaith.Add(Convert.ToInt32(prop.GetValue(cell, null))); } @@ -2047,7 +2097,11 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "attackBasePhysics") { - int randomIndex = r.Next(allAttackBasePhysic.Count); + int randomIndex; + if(castsMagic) + randomIndex = r.Next(allCastingBasePhysic.Count); + else + randomIndex = r.Next(allAttackBasePhysic.Count); Type type = cell.GetType(); PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) @@ -2058,7 +2112,11 @@ private async void btnSubmit_Click(object sender, EventArgs e) if (r.Next(3) == 0) { damageTypes.Add(0); - int temp = r.Next(371) + 20; + int temp; + if(castsMagic) + temp = r.Next(221) + 20; // lowered damage roll to compensate for higher scaling + else + temp = r.Next(371) + 20; baseDamage += temp; prop.SetValue(cell, temp, null); } @@ -2069,16 +2127,30 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else { - baseDamage += allAttackBasePhysic[randomIndex]; - prop.SetValue(cell, allAttackBasePhysic[randomIndex], null); + if(castsMagic) + { + baseDamage += allCastingBasePhysic[randomIndex]; + prop.SetValue(cell, allCastingBasePhysic[randomIndex], null); + } + else + { + baseDamage += allAttackBasePhysic[randomIndex]; + prop.SetValue(cell, allAttackBasePhysic[randomIndex], null); + } } } - - allAttackBasePhysic.RemoveAt(randomIndex); + if(castsMagic) + allCastingBasePhysic.RemoveAt(randomIndex); + else + allAttackBasePhysic.RemoveAt(randomIndex); } else if (cell.Def.Name == "attackBaseMagic") { - int randomIndex = r.Next(allAttackBaseMagic.Count); + int randomIndex; + if(castsMagic) + randomIndex = r.Next(allCastingBaseMagic.Count); + else + randomIndex = r.Next(allAttackBaseMagic.Count); Type type = cell.GetType(); PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) @@ -2089,7 +2161,11 @@ private async void btnSubmit_Click(object sender, EventArgs e) if (r.Next(3) == 0) { damageTypes.Add(1); - int temp = r.Next(371) + 20; + int temp; + if(castsMagic) + temp = r.Next(221) + 20; // lowered damage roll to compensate for higher scaling + else + temp = r.Next(371) + 20; baseDamage += temp; prop.SetValue(cell, temp, null); } @@ -2100,16 +2176,31 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else { - baseDamage += allAttackBaseMagic[randomIndex]; - prop.SetValue(cell, allAttackBaseMagic[randomIndex], null); + if(castsMagic) + { + baseDamage += allCastingBaseMagic[randomIndex]; + prop.SetValue(cell, allCastingBaseMagic[randomIndex], null); + } + else + { + baseDamage += allAttackBaseMagic[randomIndex]; + prop.SetValue(cell, allAttackBaseMagic[randomIndex], null); + } } } - - allAttackBaseMagic.RemoveAt(randomIndex); + if(castsMagic) + allCastingBaseMagic.RemoveAt(randomIndex); + else + allAttackBaseMagic.RemoveAt(randomIndex); + } else if (cell.Def.Name == "attackBaseFire") { - int randomIndex = r.Next(allAttackBaseFire.Count); + int randomIndex; + if(castsMagic) + randomIndex = r.Next(allCastingBaseFire.Count); + else + randomIndex = r.Next(allAttackBaseFire.Count); Type type = cell.GetType(); PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) @@ -2120,7 +2211,11 @@ private async void btnSubmit_Click(object sender, EventArgs e) if (r.Next(3) == 0) { damageTypes.Add(2); - int temp = r.Next(371) + 20; + int temp; + if(castsMagic) + temp = r.Next(221) + 20; // lowered damage roll to compensate for higher scaling + else + temp = r.Next(371) + 20; baseDamage += temp; prop.SetValue(cell, temp, null); } @@ -2131,16 +2226,30 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else { - baseDamage += allAttackBaseFire[randomIndex]; - prop.SetValue(cell, allAttackBaseFire[randomIndex], null); + if(castsMagic) + { + baseDamage += allCastingBaseFire[randomIndex]; + prop.SetValue(cell, allCastingBaseFire[randomIndex], null); + } + else + { + baseDamage += allAttackBaseFire[randomIndex]; + prop.SetValue(cell, allAttackBaseFire[randomIndex], null); + } } } - - allAttackBaseFire.RemoveAt(randomIndex); + if(castsMagic) + allCastingBaseFire.RemoveAt(randomIndex); + else + allAttackBaseFire.RemoveAt(randomIndex); } else if (cell.Def.Name == "attackBaseThunder") { - int randomIndex = r.Next(allAttackBaseThunder.Count); + int randomIndex; + if(castsMagic) + randomIndex = r.Next(allCastingBaseThunder.Count); + else + randomIndex = r.Next(allAttackBaseThunder.Count); Type type = cell.GetType(); PropertyInfo prop = type.GetProperty("Value"); if (chkWeaponDamage.Checked) @@ -2151,7 +2260,11 @@ private async void btnSubmit_Click(object sender, EventArgs e) if (r.Next(3) == 0) { damageTypes.Add(3); - int temp = r.Next(371) + 20; + int temp; + if(castsMagic) + temp = r.Next(221) + 20; // lowered damage roll to compensate for higher scaling + else + temp = r.Next(371) + 20; baseDamage += temp; prop.SetValue(cell, temp, null); } @@ -2162,12 +2275,22 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else { - baseDamage += allAttackBaseThunder[randomIndex]; - prop.SetValue(cell, allAttackBaseThunder[randomIndex], null); + if(castsMagic) + { + baseDamage += allCastingBaseThunder[randomIndex]; + prop.SetValue(cell, allCastingBaseThunder[randomIndex], null); + } + else + { + baseDamage += allAttackBaseThunder[randomIndex]; + prop.SetValue(cell, allAttackBaseThunder[randomIndex], null); + } } } - - allAttackBaseThunder.RemoveAt(randomIndex); + if(castsMagic) + allCastingBaseThunder.RemoveAt(randomIndex); + else + allAttackBaseThunder.RemoveAt(randomIndex); } else if (cell.Def.Name == "correctStrength") { @@ -2243,9 +2366,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "correctMagic") { - bool isCaster = paramRow.ID >= 1300000 && paramRow.ID <= 1367000; int randomIndex; - if (isCaster) + if (castsMagic) { randomIndex = r.Next(allCastingCorrectMagic.Count); } @@ -2259,7 +2381,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) { if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { - if(isCaster) + if(castsMagic) { prop.SetValue(cell, r.Next(251) + 0, null); } @@ -2287,7 +2409,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else { - if(isCaster) + if(castsMagic) { prop.SetValue(cell, allCastingCorrectMagic[randomIndex], null); } @@ -2297,7 +2419,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } } - if(isCaster) + if(castsMagic) { allCastingCorrectMagic.RemoveAt(randomIndex); } @@ -2308,9 +2430,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "correctFaith") { - bool isCaster = paramRow.ID >= 1300000 && paramRow.ID <= 1367000; int randomIndex; - if(isCaster) + if(castsMagic) { randomIndex = r.Next(allCastingCorrectFaith.Count); } @@ -2324,7 +2445,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) { if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponScaling.Checked) { - if(isCaster) + if(castsMagic) { prop.SetValue(cell, r.Next(251), null); } @@ -2352,7 +2473,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else { - if(isCaster) + if(castsMagic) { prop.SetValue(cell, allCastingCorrectFaith[randomIndex], null); } @@ -2363,7 +2484,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } - if(isCaster) + if(castsMagic) { allCastingCorrectFaith.RemoveAt(randomIndex); } diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index 810138e..8da0e14 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -245,7 +245,7 @@ private void InitializeComponent() // chkSpeffects // this.chkSpeffects.AutoSize = true; - this.chkSpeffects.Checked = true; + this.chkSpeffects.Checked = false; this.chkSpeffects.CheckState = System.Windows.Forms.CheckState.Unchecked; this.chkSpeffects.Location = new System.Drawing.Point(33, 277); this.chkSpeffects.Name = "chkSpeffects"; From 5175d2ba28595b1325f7f4d051875b55851ad6b9 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Sat, 8 Feb 2020 00:46:29 -0600 Subject: [PATCH 12/21] starting equipment and starting spells are always useable and now will be random based on what is useable, changed checkboxes that were for it into force vanilla gear (still makes starting gear useable) --- Paramdomizer/Form1.cs | 1485 +++++++++++++++++++++++++++----- Paramdomizer/Form1.designer.cs | 70 +- Paramdomizer/Form1.resx | 14 +- 3 files changed, 1291 insertions(+), 278 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index 08fd5ef..ab1d480 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -249,6 +249,123 @@ private async void btnSubmit_Click(object sender, EventArgs e) int[] classLevels = new int[10]; int[,] classStats = new int[10, 8]; + + //only assign shield ids if shield split is activated + List allShieldIDs = new List(); + if (checkBoxWeaponShieldSplit.Checked) + { + allShieldIDs.Add(904000); //dark hand + //shields, indexes 1400000 to 1410800; steps of 1000 + for (int i = 0; i < 11; i++) + { + int x = 1400000 + (i * 1000); //starting index of the shield + + //skip the following indexes (no shield there) + if (x != 1407000) + { + allShieldIDs.Add(x); //regular variant + allShieldIDs.Add(x + 100); //crystal variant + allShieldIDs.Add(x + 200); //lightning variant + allShieldIDs.Add(x + 400); //magic variant + allShieldIDs.Add(x + 600); //divine variant + allShieldIDs.Add(x + 800); //fire variant + } + } + //crystal ring shields, indexes 1411000 to 1414600; steps of 100 + for (int i = 0; i < 37; i++) + { + int x = 1411000 + (i * 100); //starting index of the shield + allShieldIDs.Add(x); + } + //shields, indexes 1450000 to 1455800; steps of 1000 + for (int i = 0; i < 6; i++) + { + int x = 1450000 + (i * 1000); //starting index of the shield + + allShieldIDs.Add(x); //regular variant + allShieldIDs.Add(x + 100); //crystal variant + allShieldIDs.Add(x + 200); //lightning variant + allShieldIDs.Add(x + 400); //magic variant + allShieldIDs.Add(x + 600); //divine variant + allShieldIDs.Add(x + 800); //fire variant + } + allShieldIDs.Add(1456000); //crest shield + allShieldIDs.Add(1457000); //dragon crest shield + //shields, indexes 1460000 to 1462800; steps of 1000 + for (int i = 0; i < 3; i++) + { + int x = 1460000 + (i * 1000); //starting index of the shield + + allShieldIDs.Add(x); //regular variant + allShieldIDs.Add(x + 100); //crystal variant + allShieldIDs.Add(x + 200); //lightning variant + allShieldIDs.Add(x + 400); //magic variant + allShieldIDs.Add(x + 600); //divine variant + allShieldIDs.Add(x + 800); //fire variant + } + //shields, indexes 1470000 to 1477800; steps of 1000 + for (int i = 0; i < 8; i++) + { + int x = 1470000 + (i * 1000); //starting index of the shield + + allShieldIDs.Add(x); //regular variant + //skip the following indexes (shields have no variants) + if (x != 1471000 && x != 1473000 && x != 1474000) + { + allShieldIDs.Add(x + 100); //crystal variant + allShieldIDs.Add(x + 200); //lightning variant + allShieldIDs.Add(x + 400); //magic variant + allShieldIDs.Add(x + 600); //divine variant + allShieldIDs.Add(x + 800); //fire variant + } + } + allShieldIDs.Add(1478000); //gargoyle shield + allShieldIDs.Add(1478000 + 100); //crystal variant + allShieldIDs.Add(1478000 + 200); //lightning variant + allShieldIDs.Add(1478000 + 400); //magic variant + allShieldIDs.Add(1478000 + 600); //divine variant + allShieldIDs.Add(1478000 + 800); //fire variant + //shields, indexes 1500000 to 1502800; steps of 1000 + for (int i = 0; i < 7; i++) + { + int x = 1500000 + (i * 1000); //starting index of the shield + + allShieldIDs.Add(x); //regular variant + allShieldIDs.Add(x + 100); //crystal variant + allShieldIDs.Add(x + 200); //lightning variant + allShieldIDs.Add(x + 400); //magic variant + allShieldIDs.Add(x + 600); //divine variant + allShieldIDs.Add(x + 800); //fire variant + } + allShieldIDs.Add(1503000); //Stone Greatshield + allShieldIDs.Add(1505000); //Havel's Greatshield + allShieldIDs.Add(1506000); //Bonewheel shield + allShieldIDs.Add(1506000 + 100); //crystal variant + allShieldIDs.Add(1506000 + 200); //lightning variant + allShieldIDs.Add(1506000 + 400); //magic variant + allShieldIDs.Add(1506000 + 600); //divine variant + allShieldIDs.Add(1506000 + 800); //fire variant + //Greatshields of Artorias, indexes 1507000 to 1510600; steps of 100 + for (int i = 0; i < 37; i++) + { + int x = 1507000 + (i * 100); + } + //shields, indexes 9001000 to 9003800; steps of 1000 + for (int i = 0; i < 3; i++) + { + int x = 9001000 + (i * 1000); //starting index of the shield + + allShieldIDs.Add(x); //regular variant + allShieldIDs.Add(x + 100); //crystal variant + allShieldIDs.Add(x + 200); //lightning variant + allShieldIDs.Add(x + 400); //magic variant + allShieldIDs.Add(x + 600); //divine variant + allShieldIDs.Add(x + 800); //fire variant + } + allShieldIDs.Add(9014000); //Cleansing Greatshield + } + + //main randomization foreach (var paramBndEntry in gameparamBnd) { var paramShortName = paramBndEntry.Name; @@ -1523,122 +1640,6 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } - //only assign shield ids if shield split is activated - List allShieldIDs = new List(); - if(checkBoxWeaponShieldSplit.Checked) - { - allShieldIDs.Add(904000); //dark hand - //shields, indexes 1400000 to 1410800; steps of 1000 - for (int i = 0; i < 11; i++) - { - int x = 1400000 + (i * 1000); //starting index of the shield - - //skip the following indexes (no shield there) - if (x != 1407000) - { - allShieldIDs.Add(x); //regular variant - allShieldIDs.Add(x + 100); //crystal variant - allShieldIDs.Add(x + 200); //lightning variant - allShieldIDs.Add(x + 400); //magic variant - allShieldIDs.Add(x + 600); //divine variant - allShieldIDs.Add(x + 800); //fire variant - } - } - //crystal ring shields, indexes 1411000 to 1414600; steps of 100 - for (int i = 0; i < 37; i++) - { - int x = 1411000 + (i * 100); //starting index of the shield - allShieldIDs.Add(x); - } - //shields, indexes 1450000 to 1455800; steps of 1000 - for (int i = 0; i < 6; i++) - { - int x = 1450000 + (i * 1000); //starting index of the shield - - allShieldIDs.Add(x); //regular variant - allShieldIDs.Add(x + 100); //crystal variant - allShieldIDs.Add(x + 200); //lightning variant - allShieldIDs.Add(x + 400); //magic variant - allShieldIDs.Add(x + 600); //divine variant - allShieldIDs.Add(x + 800); //fire variant - } - allShieldIDs.Add(1456000); //crest shield - allShieldIDs.Add(1457000); //dragon crest shield - //shields, indexes 1460000 to 1462800; steps of 1000 - for (int i = 0; i < 3; i++) - { - int x = 1460000 + (i * 1000); //starting index of the shield - - allShieldIDs.Add(x); //regular variant - allShieldIDs.Add(x + 100); //crystal variant - allShieldIDs.Add(x + 200); //lightning variant - allShieldIDs.Add(x + 400); //magic variant - allShieldIDs.Add(x + 600); //divine variant - allShieldIDs.Add(x + 800); //fire variant - } - //shields, indexes 1470000 to 1477800; steps of 1000 - for (int i = 0; i < 8; i++) - { - int x = 1470000 + (i * 1000); //starting index of the shield - - allShieldIDs.Add(x); //regular variant - //skip the following indexes (shields have no variants) - if (x != 1471000 && x != 1473000 && x != 1474000) - { - allShieldIDs.Add(x + 100); //crystal variant - allShieldIDs.Add(x + 200); //lightning variant - allShieldIDs.Add(x + 400); //magic variant - allShieldIDs.Add(x + 600); //divine variant - allShieldIDs.Add(x + 800); //fire variant - } - } - allShieldIDs.Add(1478000); //gargoyle shield - allShieldIDs.Add(1478000 + 100); //crystal variant - allShieldIDs.Add(1478000 + 200); //lightning variant - allShieldIDs.Add(1478000 + 400); //magic variant - allShieldIDs.Add(1478000 + 600); //divine variant - allShieldIDs.Add(1478000 + 800); //fire variant - //shields, indexes 1500000 to 1502800; steps of 1000 - for (int i = 0; i < 7; i++) - { - int x = 1500000 + (i * 1000); //starting index of the shield - - allShieldIDs.Add(x); //regular variant - allShieldIDs.Add(x + 100); //crystal variant - allShieldIDs.Add(x + 200); //lightning variant - allShieldIDs.Add(x + 400); //magic variant - allShieldIDs.Add(x + 600); //divine variant - allShieldIDs.Add(x + 800); //fire variant - } - allShieldIDs.Add(1503000); //Stone Greatshield - allShieldIDs.Add(1505000); //Havel's Greatshield - allShieldIDs.Add(1506000); //Bonewheel shield - allShieldIDs.Add(1506000 + 100); //crystal variant - allShieldIDs.Add(1506000 + 200); //lightning variant - allShieldIDs.Add(1506000 + 400); //magic variant - allShieldIDs.Add(1506000 + 600); //divine variant - allShieldIDs.Add(1506000 + 800); //fire variant - //Greatshields of Artorias, indexes 1507000 to 1510600; steps of 100 - for (int i = 0; i < 37; i++) - { - int x = 1507000 + (i * 100); - } - //shields, indexes 9001000 to 9003800; steps of 1000 - for (int i = 0; i < 3; i++) - { - int x = 9001000 + (i * 1000); //starting index of the shield - - allShieldIDs.Add(x); //regular variant - allShieldIDs.Add(x + 100); //crystal variant - allShieldIDs.Add(x + 200); //lightning variant - allShieldIDs.Add(x + 400); //magic variant - allShieldIDs.Add(x + 600); //divine variant - allShieldIDs.Add(x + 800); //fire variant - } - allShieldIDs.Add(9014000); //Cleansing Greatshield - } - - //heads up to those who maintain this in the future: //when treat shields seperately is enabled it runs a different set of //loops for getting and setting values. @@ -7137,230 +7138,1240 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } - //force spells to be useable for their class (the classes's casters too); done after class stats can be changed - if (checkBoxForceUseableStartSpells.Checked) + //rerolls starting weapons to be useable if that is allowed + if (!checkBoxDontChangeStartWeapons.Checked) { + bool[,] canUseWeapons = new bool[10, 2]; //mainhand first then offhand weapons (dont assume offhand is always shield) + bool[] offhandIsShield = new bool[10]; + bool[] canUseSecondaries = new bool[4]; //starts with hunter, next 3 indexes are the caster's casting item + + //assign true by default + for (int i = 0; i < 10; i++) + { + for (int j = 0; j < 2; j++) + { + canUseWeapons[i, j] = true; + } + } + for (int i = 0; i < 10; i++) + { + if (checkBoxWeaponShieldSplit.Checked) //if shield should be treated seperately to begin with, treat offhand by shield as default + offhandIsShield[i] = true; + else + offhandIsShield[i] = false; + } + for (int i = 0; i < 4; i++) + { + canUseSecondaries[i] = true; + } + + //check if offhand is shield + if (checkBoxWeaponShieldSplit.Checked) + { + for (int i = 0; i < 10; i++) + { + if (!allShieldIDs.Contains(startingWeapons[i, 1])) //if offhand is not shield + { + offhandIsShield[i] = false; + } + } + } + + //do can use checks foreach (var paramBndEntry in gameparamBnd) { var paramShortName = paramBndEntry.Name; var paramFile = paramBndEntry.Param; - if (paramFile.ID == "MAGIC_PARAM_ST") + if (paramFile.ID == "EQUIP_PARAM_WEAPON_ST") { - foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + //main and offhands + for(int i = 0; i < 10; i++) { - //if is a starting spell - if (startingSpells.Contains(paramRow.ID)) + for(int j = 0; j < 2; j++) { - int spellId = paramRow.ID; - int classIndex = 6; //sorcerer default in case something goes wrong - for (int i = 0; i < startingSpells.Length; i++) //get class index from starting spell list (assuming sorcerer is index 0) - { - if (spellId == startingSpells[i]) - { - classIndex = i + 6; //starting at index of sorcerer - i = startingSpells.Length; - } - } - foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + int weaponId = startingWeapons[i, j]; + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) { - PropertyInfo prop = cell.GetType().GetProperty("Value"); - if (cell.Def.Name == "requirementIntellect") - { - //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 5]) - { - prop.SetValue(cell, classStats[classIndex, 5], null); - } - } - else if (cell.Def.Name == "requirementFaith") - { - //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 6]) - { - prop.SetValue(cell, classStats[classIndex, 6], null); - } - } - else if (cell.Def.Name == "slotLength") + if (paramRow.ID == weaponId) { - //if slot length is greater than 1, make it length 1 - if (Convert.ToInt32(prop.GetValue(cell, null)) > 1) + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) { - prop.SetValue(cell, 1, null); + PropertyInfo prop = cell.GetType().GetProperty("Value"); + if (cell.Def.Name == "properStrength") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 3]) + { + canUseWeapons[i, j] = false; + } + } + else if (cell.Def.Name == "properAgility") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 4]) + { + canUseWeapons[i, j] = false; + } + } + else if (cell.Def.Name == "properMagic") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 5]) + { + canUseWeapons[i, j] = false; + } + } + else if (cell.Def.Name == "properFaith") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 6]) + { + canUseWeapons[i, j] = false; + } + } } } } } } - } - else if (paramFile.ID == "EQUIP_PARAM_WEAPON_ST" && !checkBoxForceUseableStartWeapons.Checked) //caster items are already handled if force useable starting weapons is enabled - { - for(int i = 1; i < secondaryStartingWeapons.Length; i++) + //secondaries + for (int i = 0; i < 4; i++) { - int casterId = secondaryStartingWeapons[i]; //casting item - int classIndex = i + 5; + int weaponId = secondaryStartingWeapons[i]; foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) { - if(paramRow.ID == casterId) + if (paramRow.ID == weaponId) { foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) { PropertyInfo prop = cell.GetType().GetProperty("Value"); - if (cell.Def.Name == "properMagic") + if (cell.Def.Name == "properStrength") { //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 5]) + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i + 5, 3]) { - prop.SetValue(cell, classStats[classIndex, 5], null); + canUseSecondaries[i] = false; } } - else if (cell.Def.Name == "properFaith") + else if (cell.Def.Name == "properAgility") { //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 6]) + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i + 5, 4]) { - prop.SetValue(cell, classStats[classIndex, 6], null); + canUseSecondaries[i] = false; } } - else if (cell.Def.Name == "properStrength") + else if (cell.Def.Name == "properMagic") { //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 3]) + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i + 5, 5]) { - prop.SetValue(cell, classStats[classIndex, 3], null); + canUseSecondaries[i] = false; } } - else if (cell.Def.Name == "properAgility") + else if (cell.Def.Name == "properFaith") { //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 4]) + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i + 5, 6]) { - prop.SetValue(cell, classStats[classIndex, 4], null); + canUseSecondaries[i] = false; } } } } } - } + } + } + + int[,] replacementWeapons = new int[10, 2]; + int[] replacementSecondaries = new int[4]; + //set all replacements to -1 + for(int i = 0; i < 10; i++) + { + for(int j = 0; j < 2; j++) + { + replacementWeapons[i, j] = -1; } } - } + for(int i = 0; i < 4; i++) + { + replacementSecondaries[i] = -1; + } - //forces weapons to be useable for their class - if(checkBoxForceUseableStartWeapons.Checked) - { - foreach (var paramBndEntry in gameparamBnd) + List validWeapons = new List(); //valid non bow or catalyst weapons; unupgraded only + List shieldWeapons = new List(); //unupgraded shields + List bowWeapons = new List(); //unupgraded + List catalystWeapons = new List(); + int pyroFlame = 1330000; + List talismanWeapons = new List(); + + //set unupgraded weapon lists + if (true) //if statement exists to seperate the weapons list from everything else { - var paramShortName = paramBndEntry.Name; - var paramFile = paramBndEntry.Param; - if (paramFile.ID == "EQUIP_PARAM_WEAPON_ST") + //weapons + validWeapons.Add(100000); + validWeapons.Add(101000); + validWeapons.Add(102000); + validWeapons.Add(103000); + validWeapons.Add(104000); + validWeapons.Add(200000); + validWeapons.Add(201000); + validWeapons.Add(202000); + //do not include broken straightsword + validWeapons.Add(204000); + validWeapons.Add(205000); + validWeapons.Add(206000); + validWeapons.Add(207000); + validWeapons.Add(208000); + validWeapons.Add(209000); + validWeapons.Add(210000); + validWeapons.Add(211000); + //do not include straightsword hilt + validWeapons.Add(300000); + validWeapons.Add(301000); + validWeapons.Add(302000); + validWeapons.Add(303000); + validWeapons.Add(304000); + validWeapons.Add(306000); + validWeapons.Add(307000); + validWeapons.Add(309000); + validWeapons.Add(310000); + validWeapons.Add(311000); + validWeapons.Add(314000); + validWeapons.Add(350000); + validWeapons.Add(351000); + validWeapons.Add(352000); + validWeapons.Add(354000); + validWeapons.Add(355000); + validWeapons.Add(400000); + validWeapons.Add(401000); + validWeapons.Add(402000); + validWeapons.Add(403000); + validWeapons.Add(405000); + validWeapons.Add(406000); + validWeapons.Add(450000); + validWeapons.Add(451000); + validWeapons.Add(453000); + validWeapons.Add(500000); + validWeapons.Add(501000); + validWeapons.Add(502000); + validWeapons.Add(503000); + validWeapons.Add(600000); + validWeapons.Add(601000); + validWeapons.Add(602000); + validWeapons.Add(603000); + validWeapons.Add(604000); + validWeapons.Add(700000); + validWeapons.Add(701000); + validWeapons.Add(702000); + validWeapons.Add(703000); + validWeapons.Add(704000); + validWeapons.Add(705000); + validWeapons.Add(750000); + validWeapons.Add(751000); + validWeapons.Add(752000); + validWeapons.Add(753000); + validWeapons.Add(800000); + validWeapons.Add(801000); + validWeapons.Add(802000); + validWeapons.Add(803000); + validWeapons.Add(804000); + validWeapons.Add(809000); + validWeapons.Add(810000); + validWeapons.Add(811000); + validWeapons.Add(812000); + validWeapons.Add(850000); + validWeapons.Add(851000); + validWeapons.Add(852000); + validWeapons.Add(854000); + validWeapons.Add(855000); + validWeapons.Add(856000); + //do not include fists + validWeapons.Add(901000); + validWeapons.Add(902000); + validWeapons.Add(903000); + shieldWeapons.Add(904000); //dark hand is considered a shield by paramdomizer + validWeapons.Add(1000000); + validWeapons.Add(1001000); + validWeapons.Add(1002000); + validWeapons.Add(1003000); + validWeapons.Add(1004000); + validWeapons.Add(1006000); + validWeapons.Add(1050000); + validWeapons.Add(1051000); + validWeapons.Add(1052000); + validWeapons.Add(1100000); + validWeapons.Add(1101000); + validWeapons.Add(1102000); + validWeapons.Add(1103000); + validWeapons.Add(1105000); + validWeapons.Add(1106000); + validWeapons.Add(1107000); + validWeapons.Add(1150000); + validWeapons.Add(1151000); + validWeapons.Add(1600000); //whip + validWeapons.Add(1601000); + validWeapons.Add(9010000); //tracers + validWeapons.Add(9011000); + validWeapons.Add(9012000); //abyss greatsword + validWeapons.Add(9015000); //stone greataxe + validWeapons.Add(9016000); //four pronged prow + validWeapons.Add(9019000); //guardian tail + validWeapons.Add(9020000); //obsidian greatsword + //bows + bowWeapons.Add(1200000); //bows + bowWeapons.Add(1201000); + bowWeapons.Add(1202000); + bowWeapons.Add(1203000); + bowWeapons.Add(1204000); + bowWeapons.Add(1205000); + bowWeapons.Add(1250000); //crossbows + bowWeapons.Add(1251000); + bowWeapons.Add(1252000); //avelyn + bowWeapons.Add(1253000); //sniper crossbow + bowWeapons.Add(9021000); //gough's greatbow + //catalysts + catalystWeapons.Add(1300000); //catalysts + catalystWeapons.Add(1301000); + catalystWeapons.Add(1302000); + catalystWeapons.Add(1303000); + catalystWeapons.Add(1304000); + catalystWeapons.Add(1305000); + catalystWeapons.Add(1306000); + catalystWeapons.Add(1307000); + catalystWeapons.Add(1308000); + catalystWeapons.Add(9017000); //manus catalyst + catalystWeapons.Add(9018000); //oolacile catalyst + //pyro flame was added above + talismanWeapons.Add(1360000); //talismans + talismanWeapons.Add(1361000); + talismanWeapons.Add(1362000); + talismanWeapons.Add(1363000); + talismanWeapons.Add(1365000); + talismanWeapons.Add(1366000); + talismanWeapons.Add(1367000); + //shields + shieldWeapons.Add(1396000); //skull lantern + shieldWeapons.Add(1400000); + shieldWeapons.Add(1401000); + shieldWeapons.Add(1402000); + shieldWeapons.Add(1403000); + shieldWeapons.Add(1404000); + shieldWeapons.Add(1405000); + shieldWeapons.Add(1406000); + shieldWeapons.Add(1408000); + shieldWeapons.Add(1409000); + shieldWeapons.Add(1410000); + shieldWeapons.Add(1411000); + shieldWeapons.Add(1450000); + shieldWeapons.Add(1451000); + shieldWeapons.Add(1452000); + shieldWeapons.Add(1453000); + shieldWeapons.Add(1454000); + shieldWeapons.Add(1455000); + shieldWeapons.Add(1456000); + shieldWeapons.Add(1457000); + shieldWeapons.Add(1460000); + shieldWeapons.Add(1461000); + shieldWeapons.Add(1462000); + shieldWeapons.Add(1470000); + shieldWeapons.Add(1471000); + shieldWeapons.Add(1472000); + shieldWeapons.Add(1473000); + shieldWeapons.Add(1474000); + shieldWeapons.Add(1475000); + shieldWeapons.Add(1476000); + shieldWeapons.Add(1477000); + shieldWeapons.Add(1478000); + shieldWeapons.Add(1500000); + shieldWeapons.Add(1501000); + shieldWeapons.Add(1502000); + shieldWeapons.Add(1503000); + shieldWeapons.Add(1505000); + shieldWeapons.Add(1506000); + shieldWeapons.Add(1507000); + shieldWeapons.Add(9000000); + shieldWeapons.Add(9001000); + shieldWeapons.Add(9002000); + shieldWeapons.Add(9003000); + shieldWeapons.Add(9014000); + } + + //if cant use, find replacements + for(int i = 0; i < 10; i++) + { + //mainhand + if(true || !canUseWeapons[i, 0]) //create a list and select one as a replacement if cant use [currently just randomizes starting weapons if don't change starting weapons is off, remove the true condition to make it only change if the weapon needs rerolling] { - //make all main and off hand weapons useable - for(int i = 0; i < 10; i++) + List useableWeaponIds = new List(); + + //create a list of valid replacements + foreach (var paramBndEntry in gameparamBnd) { - for(int j = 0; j < 2; j++) + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "EQUIP_PARAM_WEAPON_ST") { - int weaponId = startingWeapons[i, j]; foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) { - if(paramRow.ID == weaponId) + bool isCandidate = true; + if(checkBoxWeaponShieldSplit.Checked) + { + if (!validWeapons.Contains(paramRow.ID)) + isCandidate = false; + if (shieldWeapons.Contains(paramRow.ID)) + isCandidate = false; + } + else + { + if (!validWeapons.Contains(paramRow.ID) && !shieldWeapons.Contains(paramRow.ID)) + isCandidate = false; + } + if (bowWeapons.Contains(paramRow.ID) || catalystWeapons.Contains(paramRow.ID)) + isCandidate = false; + if(isCandidate) // if not disqualified yet, run stat checks { foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) { - PropertyInfo prop = cell.GetType().GetProperty("Value"); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); if (cell.Def.Name == "properStrength") { - //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 3]) + if(Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 3]) { - prop.SetValue(cell, classStats[i, 3], null); + isCandidate = false; } } else if (cell.Def.Name == "properAgility") { - //if value is greater than it's classes's stats, lower required stats if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 4]) { - prop.SetValue(cell, classStats[i, 4], null); + isCandidate = false; } } else if (cell.Def.Name == "properMagic") { - //if value is greater than it's classes's stats, lower required stats if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 5]) { - prop.SetValue(cell, classStats[i, 5], null); + isCandidate = false; } } else if (cell.Def.Name == "properFaith") { - //if value is greater than it's classes's stats, lower required stats if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 6]) { - prop.SetValue(cell, classStats[i, 6], null); + isCandidate = false; } } } } + if(isCandidate) //if still a candidate add it + { + useableWeaponIds.Add(paramRow.ID); + } } } } - - //make the secondary main hand weapons useable - for(int i = 0; i < secondaryStartingWeapons.Length; i++) + + if (useableWeaponIds.Count > 0) //if list is not empty pick one { - int weaponId = secondaryStartingWeapons[i]; - int classIndex = i + 5; //starting at hunter (i = 0) - foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + replacementWeapons[i, 0] = useableWeaponIds[r.Next(useableWeaponIds.Count)]; + } + + } + //offhand + if (true || !canUseWeapons[i, 1]) //create a list and select one as a replacement if cant use + { + List useableWeaponIds = new List(); + + //create a list of valid replacements, check if should only consider shields + foreach (var paramBndEntry in gameparamBnd) + { + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "EQUIP_PARAM_WEAPON_ST") { - if (paramRow.ID == weaponId) + bool ogIsShield = allShieldIDs.Contains(startingWeapons[i, 1]); + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) { - foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + bool isCandidate = true; + if(checkBoxWeaponShieldSplit.Checked) { - PropertyInfo prop = cell.GetType().GetProperty("Value"); - if (cell.Def.Name == "properStrength") + if(ogIsShield) { - //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 3]) - { - prop.SetValue(cell, classStats[classIndex, 3], null); - } + if (!shieldWeapons.Contains(paramRow.ID)) + isCandidate = false; } - else if (cell.Def.Name == "properAgility") + else { - //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 4]) - { - prop.SetValue(cell, classStats[classIndex, 4], null); - } + if(!validWeapons.Contains(paramRow.ID)) + isCandidate = false; } - else if (cell.Def.Name == "properMagic") + } + else + { + if (!validWeapons.Contains(paramRow.ID) && !shieldWeapons.Contains(paramRow.ID)) + isCandidate = false; + } + if (bowWeapons.Contains(paramRow.ID) || catalystWeapons.Contains(paramRow.ID)) + isCandidate = false; + if (isCandidate) // if not disqualified yet, run stat checks + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) { - //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 5]) + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + if (cell.Def.Name == "properStrength") { - prop.SetValue(cell, classStats[classIndex, 5], null); + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 3]) + { + isCandidate = false; + } } - } - else if (cell.Def.Name == "properFaith") - { - //if value is greater than it's classes's stats, lower required stats - if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 6]) + else if (cell.Def.Name == "properAgility") + { + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 4]) + { + isCandidate = false; + } + } + else if (cell.Def.Name == "properMagic") + { + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 5]) + { + isCandidate = false; + } + } + else if (cell.Def.Name == "properFaith") { - prop.SetValue(cell, classStats[classIndex, 6], null); + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 6]) + { + isCandidate = false; + } } } } + if (isCandidate) //if still a candidate add it + { + useableWeaponIds.Add(paramRow.ID); + } } } } + + if (useableWeaponIds.Count > 0) //if list is not empty pick one + { + replacementWeapons[i, 1] = useableWeaponIds[r.Next(useableWeaponIds.Count)]; + } + } } - } - //set the text for the appropriate starting gifts - if(checkBoxStartingGifts.Checked) + //secondaries + for(int i = 0; i < 4; i++) + { + if(true || !canUseSecondaries[i]) + { + int classNum = i + 5; //starting at hunter; + List useableWeaponIds = new List(); + + //create a list of valid replacements + foreach (var paramBndEntry in gameparamBnd) + { + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "EQUIP_PARAM_WEAPON_ST") + { + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + bool isCandidate = true; + if (i == 0) // check if is bow or catalyst (depending on class) + { + if(!bowWeapons.Contains(paramRow.ID)) + isCandidate = false; + } + else + { + if(checkBoxUniversalizeCasters.Checked) + { + if (!catalystWeapons.Contains(paramRow.ID) && paramRow.ID != pyroFlame && !talismanWeapons.Contains(paramRow.ID)) + isCandidate = false; + } + else + { + if(i == 1) //sorcerer + { + if (!catalystWeapons.Contains(paramRow.ID)) + isCandidate = false; + } + else if (i == 2) //pyromancer + { + if (paramRow.ID != pyroFlame) + isCandidate = false; + } + else if (i ==3) //cleric + { + if (!talismanWeapons.Contains(paramRow.ID)) + isCandidate = false; + } + } + } + + if (isCandidate) // if not disqualified yet, run stat checks + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + if (cell.Def.Name == "properStrength") + { + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 3]) + { + isCandidate = false; + } + } + else if (cell.Def.Name == "properAgility") + { + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 4]) + { + isCandidate = false; + } + } + else if (cell.Def.Name == "properMagic") + { + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 5]) + { + isCandidate = false; + } + } + else if (cell.Def.Name == "properFaith") + { + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 6]) + { + isCandidate = false; + } + } + } + } + if (isCandidate) //if still a candidate add it + { + useableWeaponIds.Add(paramRow.ID); + } + } + } + } + + if (useableWeaponIds.Count > 0) //if list is not empty pick one + { + replacementSecondaries[i] = useableWeaponIds[r.Next(useableWeaponIds.Count)]; + } + } + } + + //replace weapons if value isnt -1 + foreach (var paramBndEntry in gameparamBnd) + { + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "CHARACTER_INIT_PARAM") + { + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + //if is a starting class and randomizing starting classes + if ((paramRow.ID >= 3000 && paramRow.ID <= 3009)) + { + int classNumber = paramRow.ID - 3000; + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + if (cell.Def.Name == "equip_Wep_Right") + { + if (replacementWeapons[classNumber, 0] != -1) + { + startingWeapons[classNumber, 0] = replacementWeapons[classNumber, 0]; + prop.SetValue(cell, replacementWeapons[classNumber, 0], null); + } + } + else if (cell.Def.Name == "equip_Wep_Left") + { + if (replacementWeapons[classNumber, 1] != -1) + { + startingWeapons[classNumber, 1] = replacementWeapons[classNumber, 1]; + prop.SetValue(cell, replacementWeapons[classNumber, 1], null); + } + } + else if (cell.Def.Name == "equip_Subwep_Right") + { + if (classNumber >= 5 && classNumber <= 8) //if caster or hunter + { + if (replacementSecondaries[classNumber - 5] != -1) + { + secondaryStartingWeapons[classNumber - 5] = replacementSecondaries[classNumber - 5]; + prop.SetValue(cell, replacementSecondaries[classNumber - 5], null); + } + } + } + } + } + } + } + } + foreach (var paramBndEntry in gameparamBnd) + { + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "ITEMLOT_PARAM_ST") + { + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + if (paramRow.ID >= 1810100 && paramRow.ID <= 1810330) //starting gear in the asylum + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + Console.WriteLine(cell.Def.Name); + if (cell.Def.Name == "lotItemId01") //only weapons are modified so no need to change type flag + { + if (paramRow.ID == 1810100) + { + prop.SetValue(cell, startingWeapons[0, 0], null); + } + else if (paramRow.ID == 1810110) + { + prop.SetValue(cell, startingWeapons[0, 1], null); + } + else if (paramRow.ID == 1810120) + { + prop.SetValue(cell, startingWeapons[1, 0], null); + } + else if (paramRow.ID == 1810130) + { + prop.SetValue(cell, startingWeapons[1, 1], null); + } + else if (paramRow.ID == 1810140) + { + prop.SetValue(cell, startingWeapons[2, 0], null); + } + else if (paramRow.ID == 1810150) + { + prop.SetValue(cell, startingWeapons[2, 1], null); + } + else if (paramRow.ID == 1810160) + { + prop.SetValue(cell, startingWeapons[3, 0], null); + } + else if (paramRow.ID == 1810170) + { + prop.SetValue(cell, startingWeapons[3, 1], null); + } + else if (paramRow.ID == 1810180) + { + prop.SetValue(cell, startingWeapons[4, 0], null); + } + else if (paramRow.ID == 1810190) + { + prop.SetValue(cell, startingWeapons[4, 1], null); + } + else if (paramRow.ID == 1810200) + { + prop.SetValue(cell, startingWeapons[5, 0], null); + } + else if (paramRow.ID == 1810210) + { + prop.SetValue(cell, startingWeapons[5, 1], null); + } + else if (paramRow.ID == 1810220) + { + prop.SetValue(cell, secondaryStartingWeapons[0], null); + } + else if (paramRow.ID == 1810230) + { + prop.SetValue(cell, startingWeapons[6, 0], null); + } + else if (paramRow.ID == 1810240) + { + prop.SetValue(cell, startingWeapons[6, 1], null); + } + else if (paramRow.ID == 1810250) + { + prop.SetValue(cell, secondaryStartingWeapons[1], null); + } + else if (paramRow.ID == 1810260) + { + prop.SetValue(cell, startingWeapons[7, 0], null); + } + else if (paramRow.ID == 1810270) + { + prop.SetValue(cell, startingWeapons[7, 1], null); + } + else if (paramRow.ID == 1810280) + { + prop.SetValue(cell, secondaryStartingWeapons[2], null); + } + else if (paramRow.ID == 1810290) + { + prop.SetValue(cell, startingWeapons[8, 0], null); + } + else if (paramRow.ID == 1810300) + { + prop.SetValue(cell, startingWeapons[8, 1], null); + } + else if (paramRow.ID == 1810310) + { + prop.SetValue(cell, secondaryStartingWeapons[3], null); + } + else if (paramRow.ID == 1810320) + { + prop.SetValue(cell, startingWeapons[9, 0], null); + } + else if (paramRow.ID == 1810330) + { + prop.SetValue(cell, startingWeapons[9, 1], null); + } + } + + } + } + } + } + } + } + + + //rerolls starting spells to be useable if that is allowed + if (!checkBoxDontChangeStartSpells.Checked) + { + bool[] canUseSpell = new bool[3] { true, true, true }; //starting with sorcerer (index of 6) + + List allSorceries = new List(); + List allPyromancies = new List(); + List allMiracles = new List(); + + //assign spells to lists + if(true) + { + allSorceries.Add(3000); + allSorceries.Add(3010); + allSorceries.Add(3020); + allSorceries.Add(3030); + allSorceries.Add(3040); + allSorceries.Add(3050); + allSorceries.Add(3060); + allSorceries.Add(3070); + allSorceries.Add(3100); + allSorceries.Add(3110); + allSorceries.Add(3120); + allSorceries.Add(3300); + allSorceries.Add(3310); + allSorceries.Add(3400); + allSorceries.Add(3410); + allSorceries.Add(3500); + allSorceries.Add(3510); + allSorceries.Add(3520); + allSorceries.Add(3530); + allSorceries.Add(3540); + allSorceries.Add(3550); + allSorceries.Add(3600); + allSorceries.Add(3610); + allSorceries.Add(3700); + allSorceries.Add(3710); + allSorceries.Add(3720); + allSorceries.Add(3730); + allSorceries.Add(3740); + allPyromancies.Add(4000); + allPyromancies.Add(4010); + allPyromancies.Add(4020); + allPyromancies.Add(4030); + allPyromancies.Add(4040); + allPyromancies.Add(4050); + allPyromancies.Add(4060); + allPyromancies.Add(4100); + allPyromancies.Add(4110); + allPyromancies.Add(4200); + allPyromancies.Add(4210); + allPyromancies.Add(4220); + allPyromancies.Add(4300); + allPyromancies.Add(4310); + allPyromancies.Add(4360); + allPyromancies.Add(4400); + allPyromancies.Add(4500); + allPyromancies.Add(4510); + allPyromancies.Add(4520); + allPyromancies.Add(4530); + allMiracles.Add(5000); + allMiracles.Add(5010); + allMiracles.Add(5020); + allMiracles.Add(5030); + allMiracles.Add(5040); + allMiracles.Add(5050); + allMiracles.Add(5100); + allMiracles.Add(5110); + allMiracles.Add(5200); + allMiracles.Add(5210); + allMiracles.Add(5300); + allMiracles.Add(5310); + allMiracles.Add(5320); + allMiracles.Add(5400); + allMiracles.Add(5500); + allMiracles.Add(5510); + allMiracles.Add(5520); + allMiracles.Add(5600); + allMiracles.Add(5610); + allMiracles.Add(5700); + allMiracles.Add(5800); + allMiracles.Add(5810); + allMiracles.Add(5900); + allMiracles.Add(5910); + } + + //check if can use spells + foreach (var paramBndEntry in gameparamBnd) + { + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "MAGIC_PARAM_ST") + { + for (int i = 0; i < 3; i++) + { + int spellID = startingSpells[i]; + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + if(paramRow.ID == spellID) + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + if (cell.Def.Name == "requirementIntellect") + { + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i + 6, 5]) + { + canUseSpell[i] = false; + } + } + else if (cell.Def.Name == "requirementFaith") + { + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i + 6, 6]) + { + canUseSpell[i] = false; + } + } + else if (cell.Def.Name == "slotLength") + { + int slotsUsed = Convert.ToInt32(prop.GetValue(cell, null)); + int attunement = classStats[i + 6, 1]; + int[] attunementIncreases = new int[] {0, 10, 12, 14, 16, 19, 23, 28, 34, 41, 50}; //index corresponds to attunement slots + int slotsOfClass = -1; + for(int a = 0; a < attunementIncreases.Length; a++) + { + if(attunement > attunementIncreases[a]) + { + slotsOfClass = a; + } + else + { + a = attunementIncreases.Length; + } + } + if (slotsUsed > slotsOfClass) + { + canUseSpell[i] = false; + } + } + } + } + } + } + } + } + + int[] spellReplacements = new int[3] { -1, -1, -1}; + + //if can't use; find replacements [currently just randomizes starting spells if don't change starting spells is off, remove the true condition to make it only change if the spell needs rerolling] + for(int i = 0; i < 3; i++) + { + if(true || !canUseSpell[i]) + { + int classNumber = i + 6; + List spellCandidates = new List(); + + //create a list of valid replacements + foreach (var paramBndEntry in gameparamBnd) + { + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "MAGIC_PARAM_ST") + { + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + bool isCandidate = true; + if (!checkBoxUniversalizeCasters.Checked) + { + if (allSorceries.Contains(startingSpells[i])) //replacing a sorcery + { + if (!allSorceries.Contains(paramRow.ID)) + isCandidate = false; + } + else if (allPyromancies.Contains(startingSpells[i])) //replacing a pyromancy + { + if (!allPyromancies.Contains(paramRow.ID)) + isCandidate = false; + } + else if (allMiracles.Contains(startingSpells[i])) //replacing a miracle + { + if (!allMiracles.Contains(paramRow.ID)) + isCandidate = false; + } + } + else + { + if (!allSorceries.Contains(paramRow.ID) && !allPyromancies.Contains(paramRow.ID) && !allMiracles.Contains(paramRow.ID)) + isCandidate = false; + } + if (isCandidate) // if not disqualified yet, run stat checks + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + if (cell.Def.Name == "requirementIntellect") + { + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 5]) + { + isCandidate = false; + } + } + else if (cell.Def.Name == "requirementFaith") + { + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 6]) + { + isCandidate = false; + } + } + } + } + if (isCandidate) //if still a candidate add it + { + spellCandidates.Add(paramRow.ID); + } + } + } + } + + + if (spellCandidates.Count > 0) + { + spellReplacements[i] = spellCandidates[r.Next(spellCandidates.Count)]; + } + } + } + + //replace spells if value isnt -1 + foreach (var paramBndEntry in gameparamBnd) + { + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "CHARACTER_INIT_PARAM") + { + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + //if is a magic class + if ((paramRow.ID >= 3006 && paramRow.ID <= 3008) || (paramRow.ID >= 2006 && paramRow.ID <= 2008)) + { + int classNumber; //6-8 + if (paramRow.ID >= 3000) + { + classNumber = paramRow.ID - 3000; + } + else + { + classNumber = paramRow.ID - 2000; + } + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + if (cell.Def.Name == "equip_Spell_01") + { + if (spellReplacements[classNumber - 6] != -1) + { + startingSpells[classNumber - 6] = spellReplacements[classNumber - 6]; + prop.SetValue(cell, spellReplacements[classNumber - 6], null); + } + } + } + } + } + } + } + } + + //forces weapons to be useable for their respective class + foreach (var paramBndEntry in gameparamBnd) + { + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "EQUIP_PARAM_WEAPON_ST") + { + //make all main and off hand weapons useable + for (int i = 0; i < 10; i++) + { + for (int j = 0; j < 2; j++) + { + int weaponId = startingWeapons[i, j]; + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + if (paramRow.ID == weaponId) + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + if (cell.Def.Name == "properStrength") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 3]) + { + prop.SetValue(cell, classStats[i, 3], null); + } + } + else if (cell.Def.Name == "properAgility") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 4]) + { + prop.SetValue(cell, classStats[i, 4], null); + } + } + else if (cell.Def.Name == "properMagic") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 5]) + { + prop.SetValue(cell, classStats[i, 5], null); + } + } + else if (cell.Def.Name == "properFaith") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[i, 6]) + { + prop.SetValue(cell, classStats[i, 6], null); + } + } + } + } + } + } + } + + //make the secondary main hand weapons useable + for (int i = 0; i < secondaryStartingWeapons.Length; i++) + { + int weaponId = secondaryStartingWeapons[i]; + int classIndex = i + 5; //starting at hunter (i = 0) + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + if (paramRow.ID == weaponId) + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + if (cell.Def.Name == "properStrength") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 3]) + { + prop.SetValue(cell, classStats[classIndex, 3], null); + } + } + else if (cell.Def.Name == "properAgility") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 4]) + { + prop.SetValue(cell, classStats[classIndex, 4], null); + } + } + else if (cell.Def.Name == "properMagic") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 5]) + { + prop.SetValue(cell, classStats[classIndex, 5], null); + } + } + else if (cell.Def.Name == "properFaith") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 6]) + { + prop.SetValue(cell, classStats[classIndex, 6], null); + } + } + } + } + } + } + } + } + + //forces spells to be useable for their respective class + foreach (var paramBndEntry in gameparamBnd) + { + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "MAGIC_PARAM_ST") + { + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + //if is a starting spell + if (startingSpells.Contains(paramRow.ID)) + { + int spellId = paramRow.ID; + int classIndex = 6; //sorcerer default in case something goes wrong + for (int i = 0; i < startingSpells.Length; i++) //get class index from starting spell list (assuming sorcerer is index 0) + { + if (spellId == startingSpells[i]) + { + classIndex = i + 6; //starting at index of sorcerer + i = startingSpells.Length; + } + } + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + if (cell.Def.Name == "requirementIntellect") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 5]) + { + prop.SetValue(cell, classStats[classIndex, 5], null); + } + } + else if (cell.Def.Name == "requirementFaith") + { + //if value is greater than it's classes's stats, lower required stats + if (Convert.ToInt32(prop.GetValue(cell, null)) > classStats[classIndex, 6]) + { + prop.SetValue(cell, classStats[classIndex, 6], null); + } + } + else if (cell.Def.Name == "slotLength") + { + //if slot length is greater than 1, make it length 1 + if (Convert.ToInt32(prop.GetValue(cell, null)) > 1) + { + prop.SetValue(cell, 1, null); + } + } + } + } + } + } + } + + //set the text for the appropriate starting gifts + if (checkBoxStartingGifts.Checked) { //bool lists needed to prevent infinite looping because value pairs have to be removed and then added because they cant be modified directly List itemStartingNames = new List() {"", "", "", "", ""}; @@ -7961,7 +8972,7 @@ private void btnLoadPreset_Click(object sender, EventArgs e) checkBoxWeaponDefense.Checked = getState(w2, 0); checkBoxWeaponShieldSplit.Checked = getState(w2, 1); checkBoxWeaponFistNo.Checked = getState(w2, 2); - checkBoxForceUseableStartWeapons.Checked = getState(w2, 3); + checkBoxDontChangeStartWeapons.Checked = getState(w2, 3); //enemies byte chkAggroRadius.Checked = getState(e1, 0); @@ -7987,7 +8998,7 @@ private void btnLoadPreset_Click(object sender, EventArgs e) checkBoxRandomizeSpellSlotSize.Checked = getState(s1, 2); checkBoxRandomizeSpellQuantity.Checked = getState(s1, 3); chkMagicAnimations.Checked = getState(s1, 4); - checkBoxForceUseableStartSpells.Checked = getState(s1, 5); + checkBoxDontChangeStartSpells.Checked = getState(s1, 5); //other settings byte (options in the other settings tab) chkItemAnimations.Checked = getState(o1, 0); @@ -8066,7 +9077,7 @@ private void btnSavePreset_Click(object sender, EventArgs e) checkBoxWeaponScaling.Checked, checkBoxWeaponStamina.Checked, checkBoxWeaponStatMin.Checked, chkWeaponSpeffects.Checked); //weapons 2nd byte - writeByte(s, checkBoxWeaponDefense.Checked, checkBoxWeaponShieldSplit.Checked, checkBoxWeaponFistNo.Checked, checkBoxForceUseableStartWeapons.Checked); + writeByte(s, checkBoxWeaponDefense.Checked, checkBoxWeaponShieldSplit.Checked, checkBoxWeaponFistNo.Checked, checkBoxDontChangeStartWeapons.Checked); //enemies byte writeByte(s, chkAggroRadius.Checked, chkTurnSpeeds.Checked, chkSpeffects.Checked); @@ -8080,7 +9091,7 @@ private void btnSavePreset_Click(object sender, EventArgs e) //spells byte writeByte(s, checkBoxUniversalizeCasters.Checked, checkBoxRandomizeSpellRequirements.Checked, checkBoxRandomizeSpellSlotSize.Checked, checkBoxRandomizeSpellQuantity.Checked, - chkMagicAnimations.Checked, checkBoxForceUseableStartSpells.Checked); + chkMagicAnimations.Checked, checkBoxDontChangeStartSpells.Checked); //other settings byte (options in the other settings tab) writeByte(s, chkItemAnimations.Checked, chkRandomFaceData.Checked, chkRingSpeffects.Checked, chkVoices.Checked, @@ -8178,7 +9189,7 @@ private void btnRandomizeSettings_Click(object sender, EventArgs e) checkBoxWeaponDefense.Checked = nextBool(msr); checkBoxWeaponShieldSplit.Checked = nextBool(msr); checkBoxWeaponFistNo.Checked = nextBool(msr); - checkBoxForceUseableStartWeapons.Checked = nextBool(msr); + checkBoxDontChangeStartWeapons.Checked = nextBool(msr); //enemies chkAggroRadius.Checked = nextBool(msr); @@ -8204,7 +9215,7 @@ private void btnRandomizeSettings_Click(object sender, EventArgs e) checkBoxRandomizeSpellSlotSize.Checked = nextBool(msr); checkBoxRandomizeSpellQuantity.Checked = nextBool(msr); chkMagicAnimations.Checked = nextBool(msr); - checkBoxForceUseableStartSpells.Checked = nextBool(msr); + checkBoxDontChangeStartSpells.Checked = nextBool(msr); //other settings chkItemAnimations.Checked = nextBool(msr); diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index 8da0e14..72e59fc 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -76,8 +76,8 @@ private void InitializeComponent() this.checkBoxNerfHumanityBullets = new System.Windows.Forms.CheckBox(); this.checkBoxStartingGiftsAmount = new System.Windows.Forms.CheckBox(); this.checkBoxStartingClasses = new System.Windows.Forms.CheckBox(); - this.checkBoxForceUseableStartSpells = new System.Windows.Forms.CheckBox(); - this.checkBoxForceUseableStartWeapons = new System.Windows.Forms.CheckBox(); + this.checkBoxDontChangeStartSpells = new System.Windows.Forms.CheckBox(); + this.checkBoxDontChangeStartWeapons = new System.Windows.Forms.CheckBox(); this.checkBoxForceUseableBullets = new System.Windows.Forms.CheckBox(); this.tooltip = new System.Windows.Forms.ToolTip(this.components); this.btnSavePreset = new System.Windows.Forms.Button(); @@ -681,33 +681,35 @@ private void InitializeComponent() this.tooltip.SetToolTip(this.checkBoxStartingClasses, resources.GetString("checkBoxStartingClasses.ToolTip")); this.checkBoxStartingClasses.UseVisualStyleBackColor = true; // - // checkBoxForceUseableStartSpells - // - this.checkBoxForceUseableStartSpells.AutoSize = true; - this.checkBoxForceUseableStartSpells.Checked = true; - this.checkBoxForceUseableStartSpells.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxForceUseableStartSpells.Location = new System.Drawing.Point(257, 68); - this.checkBoxForceUseableStartSpells.Name = "checkBoxForceUseableStartSpells"; - this.checkBoxForceUseableStartSpells.Size = new System.Drawing.Size(159, 17); - this.checkBoxForceUseableStartSpells.TabIndex = 45; - this.checkBoxForceUseableStartSpells.Text = "Force useable starting spells"; - this.tooltip.SetToolTip(this.checkBoxForceUseableStartSpells, resources.GetString("checkBoxForceUseableStartSpells.ToolTip")); - this.checkBoxForceUseableStartSpells.UseVisualStyleBackColor = true; - // - // checkBoxForceUseableStartWeapons - // - this.checkBoxForceUseableStartWeapons.AutoSize = true; - this.checkBoxForceUseableStartWeapons.Checked = true; - this.checkBoxForceUseableStartWeapons.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxForceUseableStartWeapons.Location = new System.Drawing.Point(257, 144); - this.checkBoxForceUseableStartWeapons.Name = "checkBoxForceUseableStartWeapons"; - this.checkBoxForceUseableStartWeapons.Size = new System.Drawing.Size(176, 17); - this.checkBoxForceUseableStartWeapons.TabIndex = 45; - this.checkBoxForceUseableStartWeapons.Text = "Force useable starting weapons"; - this.tooltip.SetToolTip(this.checkBoxForceUseableStartWeapons, "Forces the weapons that a class starts with to be useable by that class (prevents" + - " some softlocking).\nIf this setting is off the straightsword hilt will still be " + - "universally useable."); - this.checkBoxForceUseableStartWeapons.UseVisualStyleBackColor = true; + // checkBoxDontChangeStartSpells + // + this.checkBoxDontChangeStartSpells.AutoSize = true; + this.checkBoxDontChangeStartSpells.Checked = false; + this.checkBoxDontChangeStartSpells.CheckState = System.Windows.Forms.CheckState.Unchecked; + this.checkBoxDontChangeStartSpells.Location = new System.Drawing.Point(257, 68); + this.checkBoxDontChangeStartSpells.Name = "checkBoxDontChangeStartSpells"; + this.checkBoxDontChangeStartSpells.Size = new System.Drawing.Size(159, 17); + this.checkBoxDontChangeStartSpells.TabIndex = 45; + this.checkBoxDontChangeStartSpells.Text = "Don't change starting spells"; + this.tooltip.SetToolTip(this.checkBoxDontChangeStartSpells, "Paramdomizer will not change the starting spells of classes.\n" + + "By default the paramdomizer will attempt to reroll the classes's spells into ones the class can use if minimum stats aren't met.\n" + + "If this setting is turned on or if no match was found, the classes's spells won't be changed but instead will have their stat requirements forced to be useable."); + this.checkBoxDontChangeStartSpells.UseVisualStyleBackColor = true; + // + // checkBoxDontChangeStartWeapons + // + this.checkBoxDontChangeStartWeapons.AutoSize = true; + this.checkBoxDontChangeStartWeapons.Checked = false; + this.checkBoxDontChangeStartWeapons.CheckState = System.Windows.Forms.CheckState.Unchecked; + this.checkBoxDontChangeStartWeapons.Location = new System.Drawing.Point(257, 144); + this.checkBoxDontChangeStartWeapons.Name = "checkBoxDontChangeStartWeapons"; + this.checkBoxDontChangeStartWeapons.Size = new System.Drawing.Size(176, 17); + this.checkBoxDontChangeStartWeapons.TabIndex = 45; + this.checkBoxDontChangeStartWeapons.Text = "Don't change starting weapons"; + this.tooltip.SetToolTip(this.checkBoxDontChangeStartWeapons, "Paramdomizer will not change the starting weapons of classes.\n" + + "By default the paramdomizer will attempt to reroll the classes's weapons into ones the class can use if minimum stats aren't met.\n" + + "If this setting is turned on or if no match was found, the classes's weapons won't be changed but instead will have their stat requirements forced to be useable."); + this.checkBoxDontChangeStartWeapons.UseVisualStyleBackColor = true; // // checkBoxForceUseableBullets // @@ -720,7 +722,7 @@ private void InitializeComponent() this.checkBoxForceUseableBullets.TabIndex = 45; this.checkBoxForceUseableBullets.Text = "Force useable bullets"; this.tooltip.SetToolTip(this.checkBoxForceUseableBullets, "Forces bullets to be useable. (or at least tries to.)\nAffects both players and en" + - "emies."); + "emies.\nWARNING: this feature is currently incomplete."); this.checkBoxForceUseableBullets.UseVisualStyleBackColor = true; // // tooltip @@ -775,7 +777,7 @@ private void InitializeComponent() // gbWeaponCategory // this.gbWeaponCategory.AutoSize = true; - this.gbWeaponCategory.Controls.Add(this.checkBoxForceUseableStartWeapons); + this.gbWeaponCategory.Controls.Add(this.checkBoxDontChangeStartWeapons); this.gbWeaponCategory.Location = new System.Drawing.Point(8, 64); this.gbWeaponCategory.Name = "gbWeaponCategory"; this.gbWeaponCategory.Size = new System.Drawing.Size(468, 180); @@ -786,7 +788,7 @@ private void InitializeComponent() // gbSpellCategory // this.gbSpellCategory.AutoSize = true; - this.gbSpellCategory.Controls.Add(this.checkBoxForceUseableStartSpells); + this.gbSpellCategory.Controls.Add(this.checkBoxDontChangeStartSpells); this.gbSpellCategory.Location = new System.Drawing.Point(479, 123); this.gbSpellCategory.Name = "gbSpellCategory"; this.gbSpellCategory.Size = new System.Drawing.Size(465, 104); @@ -971,8 +973,8 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox checkBoxNerfHumanityBullets; private System.Windows.Forms.CheckBox checkBoxStartingGiftsAmount; private System.Windows.Forms.CheckBox checkBoxStartingClasses; - private System.Windows.Forms.CheckBox checkBoxForceUseableStartSpells; - private System.Windows.Forms.CheckBox checkBoxForceUseableStartWeapons; + private System.Windows.Forms.CheckBox checkBoxDontChangeStartSpells; + private System.Windows.Forms.CheckBox checkBoxDontChangeStartWeapons; private System.Windows.Forms.CheckBox checkBoxForceUseableBullets; private System.Windows.Forms.ToolTip tooltip; private System.Windows.Forms.GroupBox gbWeaponCategory; diff --git a/Paramdomizer/Form1.resx b/Paramdomizer/Form1.resx index fbe6a94..435318f 100644 --- a/Paramdomizer/Form1.resx +++ b/Paramdomizer/Form1.resx @@ -117,9 +117,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + 17, 17 - + If paramdomizer randomized your game in the past, it will load an unrandomized backup before randomizing again. useful to remove some of the effects of the randomizer before randomizing it again. @@ -147,13 +148,12 @@ Will make the straightsword hilt have no stat requirements to use to prevent som Also shuffles starting level. - Any spells / pyromancies / miracles that a class starts with will have their stat requirements lowered if that class can't cast it at their starting level. -Also effects starting caster tools like the pyromancy flame and sorcerer's catalyst. + Any spells / pyromancies / miracles that a class starts with will have their stat requirements lowered if that class can't cast it at their starting level. - + + 48 - - + AAABAAUAEBAAAAEAIABoBAAAVgAAABgYAAABACAAiAkAAL4EAAAgIAAAAQAgAKgQAABGDgAAMDAAAAEA From 540aee8b31272001924ad476d99209764373dae7 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Sat, 8 Feb 2020 17:34:10 -0600 Subject: [PATCH 13/21] blacklisted orange charred ring speffect randomization --- Paramdomizer/Form1.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index ab1d480..c0a6689 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -1023,7 +1023,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (paramFile.ID == "EQUIP_PARAM_ACCESSORY_ST") { - List blacklistedIds = new List() { 2200 }; //blacklist covenant of artorias's effect being randomized, preventing some soft locks + List blacklistedIds = new List() { 2200, 2210 }; //blacklist covenant of artorias and charred ring's effect being randomized, preventing some soft locks List allRefIds = new List(); foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) { From 76b00fbf2172e552f94a925b091e0fc74df29a6a Mon Sep 17 00:00:00 2001 From: Kiroko Date: Sat, 8 Feb 2020 19:03:44 -0600 Subject: [PATCH 14/21] changed armor weight weighting, added bow universalization --- Paramdomizer/Form1.cs | 31 ++++++++++-- Paramdomizer/Form1.designer.cs | 88 ++++++++++++++++++---------------- Paramdomizer/Form1.resx | 22 +++++---- 3 files changed, 90 insertions(+), 51 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index c0a6689..8391e47 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -1235,8 +1235,16 @@ private async void btnSubmit_Click(object sender, EventArgs e) { if(checkBoxDoTrueRandom.Checked && TRForm.chkTRArmorWeight.Checked) { + // 2/3 chance to be 7.0 or under //randomized by 0.1 steps - prop.SetValue(cell, r.Next(196) / 10.0, null); + if(r.Next(3) != 0) + { + prop.SetValue(cell, r.Next(71) / 10.0, null); + } + else + { + prop.SetValue(cell, (r.Next(126) + 70 ) / 10.0, null); + } } else { @@ -2049,6 +2057,21 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } } + else //if bow + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + if (cell.Def.Name == "arrowSlotEquipable:1" || cell.Def.Name == "boltSlotEquipable:1") + { + if(checkBoxUniversalizeBows.Checked) + { + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + prop.SetValue(cell, true, null); + } + } + } + } int baseDamage = 0; bool castsMagic = false; @@ -7831,7 +7854,6 @@ private async void btnSubmit_Click(object sender, EventArgs e) foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) { PropertyInfo prop = cell.GetType().GetProperty("Value"); - Console.WriteLine(cell.Def.Name); if (cell.Def.Name == "lotItemId01") //only weapons are modified so no need to change type flag { if (paramRow.ID == 1810100) @@ -8973,6 +8995,7 @@ private void btnLoadPreset_Click(object sender, EventArgs e) checkBoxWeaponShieldSplit.Checked = getState(w2, 1); checkBoxWeaponFistNo.Checked = getState(w2, 2); checkBoxDontChangeStartWeapons.Checked = getState(w2, 3); + checkBoxUniversalizeBows.Checked = getState(w2, 4); //enemies byte chkAggroRadius.Checked = getState(e1, 0); @@ -9077,7 +9100,8 @@ private void btnSavePreset_Click(object sender, EventArgs e) checkBoxWeaponScaling.Checked, checkBoxWeaponStamina.Checked, checkBoxWeaponStatMin.Checked, chkWeaponSpeffects.Checked); //weapons 2nd byte - writeByte(s, checkBoxWeaponDefense.Checked, checkBoxWeaponShieldSplit.Checked, checkBoxWeaponFistNo.Checked, checkBoxDontChangeStartWeapons.Checked); + writeByte(s, checkBoxWeaponDefense.Checked, checkBoxWeaponShieldSplit.Checked, checkBoxWeaponFistNo.Checked, checkBoxDontChangeStartWeapons.Checked, + checkBoxUniversalizeBows.Checked); //enemies byte writeByte(s, chkAggroRadius.Checked, chkTurnSpeeds.Checked, chkSpeffects.Checked); @@ -9190,6 +9214,7 @@ private void btnRandomizeSettings_Click(object sender, EventArgs e) checkBoxWeaponShieldSplit.Checked = nextBool(msr); checkBoxWeaponFistNo.Checked = nextBool(msr); checkBoxDontChangeStartWeapons.Checked = nextBool(msr); + checkBoxUniversalizeBows.Checked = nextBool(msr); //enemies chkAggroRadius.Checked = nextBool(msr); diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index 72e59fc..6831ec4 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -79,6 +79,7 @@ private void InitializeComponent() this.checkBoxDontChangeStartSpells = new System.Windows.Forms.CheckBox(); this.checkBoxDontChangeStartWeapons = new System.Windows.Forms.CheckBox(); this.checkBoxForceUseableBullets = new System.Windows.Forms.CheckBox(); + this.checkBoxUniversalizeBows = new System.Windows.Forms.CheckBox(); this.tooltip = new System.Windows.Forms.ToolTip(this.components); this.btnSavePreset = new System.Windows.Forms.Button(); this.btnLoadPreset = new System.Windows.Forms.Button(); @@ -130,7 +131,7 @@ private void InitializeComponent() // // btnSubmit // - this.btnSubmit.Location = new System.Drawing.Point(869, 434); + this.btnSubmit.Location = new System.Drawing.Point(869, 447); this.btnSubmit.Name = "btnSubmit"; this.btnSubmit.Size = new System.Drawing.Size(75, 23); this.btnSubmit.TabIndex = 20; @@ -143,7 +144,7 @@ private void InitializeComponent() this.checkBoxLoadFromBackup.AutoSize = true; this.checkBoxLoadFromBackup.Checked = true; this.checkBoxLoadFromBackup.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxLoadFromBackup.Location = new System.Drawing.Point(268, 440); + this.checkBoxLoadFromBackup.Location = new System.Drawing.Point(268, 453); this.checkBoxLoadFromBackup.Name = "checkBoxLoadFromBackup"; this.checkBoxLoadFromBackup.Size = new System.Drawing.Size(204, 17); this.checkBoxLoadFromBackup.TabIndex = 45; @@ -161,12 +162,13 @@ private void InitializeComponent() this.chkRingSpeffects.Size = new System.Drawing.Size(168, 17); this.chkRingSpeffects.TabIndex = 7; this.chkRingSpeffects.Text = "Randomize SPeffects on rings"; - this.tooltip.SetToolTip(this.chkRingSpeffects, "Randomizes the effects of rings amongst each other. Does not randomize the covenant of artorias."); + this.tooltip.SetToolTip(this.chkRingSpeffects, "Randomizes the effects of rings amongst each other. Does not randomize the covena" + + "nt of artorias."); this.chkRingSpeffects.UseVisualStyleBackColor = true; // // lblMessage // - this.lblMessage.Location = new System.Drawing.Point(701, 371); + this.lblMessage.Location = new System.Drawing.Point(701, 384); this.lblMessage.Name = "lblMessage"; this.lblMessage.Size = new System.Drawing.Size(243, 43); this.lblMessage.TabIndex = 6; @@ -218,7 +220,7 @@ private void InitializeComponent() this.chkBullets.AutoSize = true; this.chkBullets.Checked = true; this.chkBullets.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkBullets.Location = new System.Drawing.Point(33, 348); + this.chkBullets.Location = new System.Drawing.Point(33, 365); this.chkBullets.Name = "chkBullets"; this.chkBullets.Size = new System.Drawing.Size(112, 17); this.chkBullets.TabIndex = 9; @@ -232,7 +234,7 @@ private void InitializeComponent() this.chkKnockback.AutoSize = true; this.chkKnockback.Checked = true; this.chkKnockback.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkKnockback.Location = new System.Drawing.Point(268, 325); + this.chkKnockback.Location = new System.Drawing.Point(268, 342); this.chkKnockback.Name = "chkKnockback"; this.chkKnockback.Size = new System.Drawing.Size(169, 17); this.chkKnockback.TabIndex = 16; @@ -245,14 +247,13 @@ private void InitializeComponent() // chkSpeffects // this.chkSpeffects.AutoSize = true; - this.chkSpeffects.Checked = false; - this.chkSpeffects.CheckState = System.Windows.Forms.CheckState.Unchecked; - this.chkSpeffects.Location = new System.Drawing.Point(33, 277); + this.chkSpeffects.Location = new System.Drawing.Point(33, 294); this.chkSpeffects.Name = "chkSpeffects"; - this.chkSpeffects.Size = new System.Drawing.Size(185, 17); + this.chkSpeffects.Size = new System.Drawing.Size(189, 17); this.chkSpeffects.TabIndex = 5; this.chkSpeffects.Text = "Randomize SPeffects on enemies*"; - this.tooltip.SetToolTip(this.chkSpeffects, "Randomizes special effects on enemies as well as their attacks.\nWARNING: currently breaks enemy death animations sometimes???"); + this.tooltip.SetToolTip(this.chkSpeffects, "Randomizes special effects on enemies as well as their attacks.\nWARNING: currentl" + + "y breaks enemy death animations sometimes???"); this.chkSpeffects.UseVisualStyleBackColor = true; // // chkWeaponSpeffects @@ -287,7 +288,7 @@ private void InitializeComponent() this.chkTurnSpeeds.AutoSize = true; this.chkTurnSpeeds.Checked = true; this.chkTurnSpeeds.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkTurnSpeeds.Location = new System.Drawing.Point(268, 254); + this.chkTurnSpeeds.Location = new System.Drawing.Point(268, 271); this.chkTurnSpeeds.Name = "chkTurnSpeeds"; this.chkTurnSpeeds.Size = new System.Drawing.Size(166, 17); this.chkTurnSpeeds.TabIndex = 3; @@ -300,7 +301,7 @@ private void InitializeComponent() this.chkHitboxSizes.AutoSize = true; this.chkHitboxSizes.Checked = true; this.chkHitboxSizes.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkHitboxSizes.Location = new System.Drawing.Point(268, 348); + this.chkHitboxSizes.Location = new System.Drawing.Point(268, 365); this.chkHitboxSizes.Name = "chkHitboxSizes"; this.chkHitboxSizes.Size = new System.Drawing.Size(136, 17); this.chkHitboxSizes.TabIndex = 18; @@ -315,7 +316,7 @@ private void InitializeComponent() this.chkStaggerLevels.AutoSize = true; this.chkStaggerLevels.Checked = true; this.chkStaggerLevels.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkStaggerLevels.Location = new System.Drawing.Point(33, 325); + this.chkStaggerLevels.Location = new System.Drawing.Point(33, 342); this.chkStaggerLevels.Name = "chkStaggerLevels"; this.chkStaggerLevels.Size = new System.Drawing.Size(147, 17); this.chkStaggerLevels.TabIndex = 17; @@ -329,7 +330,7 @@ private void InitializeComponent() this.chkAggroRadius.AutoSize = true; this.chkAggroRadius.Checked = true; this.chkAggroRadius.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkAggroRadius.Location = new System.Drawing.Point(33, 254); + this.chkAggroRadius.Location = new System.Drawing.Point(33, 271); this.chkAggroRadius.Name = "chkAggroRadius"; this.chkAggroRadius.Size = new System.Drawing.Size(140, 17); this.chkAggroRadius.TabIndex = 2; @@ -392,7 +393,7 @@ private void InitializeComponent() // checkBoxRemaster // this.checkBoxRemaster.AutoSize = true; - this.checkBoxRemaster.Location = new System.Drawing.Point(33, 440); + this.checkBoxRemaster.Location = new System.Drawing.Point(33, 453); this.checkBoxRemaster.Name = "checkBoxRemaster"; this.checkBoxRemaster.Size = new System.Drawing.Size(176, 17); this.checkBoxRemaster.TabIndex = 23; @@ -490,7 +491,7 @@ private void InitializeComponent() this.checkBoxWeaponFistNo.Location = new System.Drawing.Point(30, 208); this.checkBoxWeaponFistNo.Name = "checkBoxWeaponFistNo"; this.checkBoxWeaponFistNo.Size = new System.Drawing.Size(105, 17); - this.checkBoxWeaponFistNo.TabIndex = 43; + this.checkBoxWeaponFistNo.TabIndex = 49; this.checkBoxWeaponFistNo.Text = "Don\'t modify fists"; this.tooltip.SetToolTip(this.checkBoxWeaponFistNo, "Fists will not be modified by damage randomization of any other type of weapon ra" + "ndomization"); @@ -499,7 +500,7 @@ private void InitializeComponent() // checkBoxDoTrueRandom // this.checkBoxDoTrueRandom.AutoSize = true; - this.checkBoxDoTrueRandom.Location = new System.Drawing.Point(33, 406); + this.checkBoxDoTrueRandom.Location = new System.Drawing.Point(33, 419); this.checkBoxDoTrueRandom.Name = "checkBoxDoTrueRandom"; this.checkBoxDoTrueRandom.Size = new System.Drawing.Size(153, 30); this.checkBoxDoTrueRandom.TabIndex = 26; @@ -646,7 +647,7 @@ private void InitializeComponent() this.checkBoxNerfHumanityBullets.AutoSize = true; this.checkBoxNerfHumanityBullets.Checked = true; this.checkBoxNerfHumanityBullets.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxNerfHumanityBullets.Location = new System.Drawing.Point(33, 371); + this.checkBoxNerfHumanityBullets.Location = new System.Drawing.Point(33, 388); this.checkBoxNerfHumanityBullets.Name = "checkBoxNerfHumanityBullets"; this.checkBoxNerfHumanityBullets.Size = new System.Drawing.Size(124, 17); this.checkBoxNerfHumanityBullets.TabIndex = 45; @@ -684,31 +685,23 @@ private void InitializeComponent() // checkBoxDontChangeStartSpells // this.checkBoxDontChangeStartSpells.AutoSize = true; - this.checkBoxDontChangeStartSpells.Checked = false; - this.checkBoxDontChangeStartSpells.CheckState = System.Windows.Forms.CheckState.Unchecked; this.checkBoxDontChangeStartSpells.Location = new System.Drawing.Point(257, 68); this.checkBoxDontChangeStartSpells.Name = "checkBoxDontChangeStartSpells"; - this.checkBoxDontChangeStartSpells.Size = new System.Drawing.Size(159, 17); + this.checkBoxDontChangeStartSpells.Size = new System.Drawing.Size(156, 17); this.checkBoxDontChangeStartSpells.TabIndex = 45; - this.checkBoxDontChangeStartSpells.Text = "Don't change starting spells"; - this.tooltip.SetToolTip(this.checkBoxDontChangeStartSpells, "Paramdomizer will not change the starting spells of classes.\n" + - "By default the paramdomizer will attempt to reroll the classes's spells into ones the class can use if minimum stats aren't met.\n" + - "If this setting is turned on or if no match was found, the classes's spells won't be changed but instead will have their stat requirements forced to be useable."); + this.checkBoxDontChangeStartSpells.Text = "Don\'t change starting spells"; + this.tooltip.SetToolTip(this.checkBoxDontChangeStartSpells, resources.GetString("checkBoxDontChangeStartSpells.ToolTip")); this.checkBoxDontChangeStartSpells.UseVisualStyleBackColor = true; // // checkBoxDontChangeStartWeapons // this.checkBoxDontChangeStartWeapons.AutoSize = true; - this.checkBoxDontChangeStartWeapons.Checked = false; - this.checkBoxDontChangeStartWeapons.CheckState = System.Windows.Forms.CheckState.Unchecked; this.checkBoxDontChangeStartWeapons.Location = new System.Drawing.Point(257, 144); this.checkBoxDontChangeStartWeapons.Name = "checkBoxDontChangeStartWeapons"; - this.checkBoxDontChangeStartWeapons.Size = new System.Drawing.Size(176, 17); + this.checkBoxDontChangeStartWeapons.Size = new System.Drawing.Size(173, 17); this.checkBoxDontChangeStartWeapons.TabIndex = 45; - this.checkBoxDontChangeStartWeapons.Text = "Don't change starting weapons"; - this.tooltip.SetToolTip(this.checkBoxDontChangeStartWeapons, "Paramdomizer will not change the starting weapons of classes.\n" + - "By default the paramdomizer will attempt to reroll the classes's weapons into ones the class can use if minimum stats aren't met.\n" + - "If this setting is turned on or if no match was found, the classes's weapons won't be changed but instead will have their stat requirements forced to be useable."); + this.checkBoxDontChangeStartWeapons.Text = "Don\'t change starting weapons"; + this.tooltip.SetToolTip(this.checkBoxDontChangeStartWeapons, resources.GetString("checkBoxDontChangeStartWeapons.ToolTip")); this.checkBoxDontChangeStartWeapons.UseVisualStyleBackColor = true; // // checkBoxForceUseableBullets @@ -716,7 +709,7 @@ private void InitializeComponent() this.checkBoxForceUseableBullets.AutoSize = true; this.checkBoxForceUseableBullets.Checked = true; this.checkBoxForceUseableBullets.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxForceUseableBullets.Location = new System.Drawing.Point(268, 371); + this.checkBoxForceUseableBullets.Location = new System.Drawing.Point(268, 388); this.checkBoxForceUseableBullets.Name = "checkBoxForceUseableBullets"; this.checkBoxForceUseableBullets.Size = new System.Drawing.Size(126, 17); this.checkBoxForceUseableBullets.TabIndex = 45; @@ -725,6 +718,19 @@ private void InitializeComponent() "emies.\nWARNING: this feature is currently incomplete."); this.checkBoxForceUseableBullets.UseVisualStyleBackColor = true; // + // checkBoxUniversalizeBows + // + this.checkBoxUniversalizeBows.AutoSize = true; + this.checkBoxUniversalizeBows.Checked = true; + this.checkBoxUniversalizeBows.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxUniversalizeBows.Location = new System.Drawing.Point(30, 231); + this.checkBoxUniversalizeBows.Name = "checkBoxUniversalizeBows"; + this.checkBoxUniversalizeBows.Size = new System.Drawing.Size(141, 17); + this.checkBoxUniversalizeBows.TabIndex = 43; + this.checkBoxUniversalizeBows.Text = "Universalize cross/bows"; + this.tooltip.SetToolTip(this.checkBoxUniversalizeBows, "Bows and crossbows can now use both types of ammo."); + this.checkBoxUniversalizeBows.UseVisualStyleBackColor = true; + // // tooltip // this.tooltip.AutoPopDelay = 32767; @@ -765,7 +771,7 @@ private void InitializeComponent() // // btnDoTrueRandomPopup // - this.btnDoTrueRandomPopup.Location = new System.Drawing.Point(192, 408); + this.btnDoTrueRandomPopup.Location = new System.Drawing.Point(192, 421); this.btnDoTrueRandomPopup.Name = "btnDoTrueRandomPopup"; this.btnDoTrueRandomPopup.Size = new System.Drawing.Size(104, 28); this.btnDoTrueRandomPopup.TabIndex = 48; @@ -799,7 +805,7 @@ private void InitializeComponent() // gbEnemiesCategory // this.gbEnemiesCategory.AutoSize = true; - this.gbEnemiesCategory.Location = new System.Drawing.Point(11, 231); + this.gbEnemiesCategory.Location = new System.Drawing.Point(11, 248); this.gbEnemiesCategory.Name = "gbEnemiesCategory"; this.gbEnemiesCategory.Size = new System.Drawing.Size(465, 64); this.gbEnemiesCategory.TabIndex = 34; @@ -819,7 +825,7 @@ private void InitializeComponent() // gbSharedCategory // this.gbSharedCategory.AutoSize = true; - this.gbSharedCategory.Location = new System.Drawing.Point(11, 301); + this.gbSharedCategory.Location = new System.Drawing.Point(11, 318); this.gbSharedCategory.Name = "gbSharedCategory"; this.gbSharedCategory.Size = new System.Drawing.Size(465, 87); this.gbSharedCategory.TabIndex = 36; @@ -839,7 +845,7 @@ private void InitializeComponent() // lblVersion // this.lblVersion.AutoSize = true; - this.lblVersion.Location = new System.Drawing.Point(773, 441); + this.lblVersion.Location = new System.Drawing.Point(773, 454); this.lblVersion.Name = "lblVersion"; this.lblVersion.Size = new System.Drawing.Size(90, 13); this.lblVersion.TabIndex = 41; @@ -849,7 +855,8 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(960, 470); + this.ClientSize = new System.Drawing.Size(960, 480); + this.Controls.Add(this.checkBoxUniversalizeBows); this.Controls.Add(this.btnLoadPreset); this.Controls.Add(this.btnSavePreset); this.Controls.Add(this.btnRandomizeSettings); @@ -906,8 +913,8 @@ private void InitializeComponent() this.Controls.Add(this.gbSharedCategory); this.Controls.Add(this.gbArmorCategory); this.Controls.Add(this.lblVersion); - this.Controls.Add(this.gbWeaponCategory); this.Controls.Add(this.gbSpellCategory); + this.Controls.Add(this.gbWeaponCategory); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; @@ -976,6 +983,7 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox checkBoxDontChangeStartSpells; private System.Windows.Forms.CheckBox checkBoxDontChangeStartWeapons; private System.Windows.Forms.CheckBox checkBoxForceUseableBullets; + private System.Windows.Forms.CheckBox checkBoxUniversalizeBows; private System.Windows.Forms.ToolTip tooltip; private System.Windows.Forms.GroupBox gbWeaponCategory; private System.Windows.Forms.GroupBox gbSpellCategory; diff --git a/Paramdomizer/Form1.resx b/Paramdomizer/Form1.resx index 435318f..a87aa71 100644 --- a/Paramdomizer/Form1.resx +++ b/Paramdomizer/Form1.resx @@ -117,10 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + 17, 17 - + If paramdomizer randomized your game in the past, it will load an unrandomized backup before randomizing again. useful to remove some of the effects of the randomizer before randomizing it again. @@ -147,13 +146,20 @@ This setting can be turned off for those who consider themselves hardcore. - - Any spells / pyromancies / miracles that a class starts with will have their stat requirements lowered if that class can't cast it at their starting level. + + Paramdomizer will not change the starting spells of classes. +By default the paramdomizer will attempt to reroll the classes's spells into ones the class can use if minimum stats aren't met. +If this setting is turned on or if no match was found, the classes's spells won't be changed but instead will have their stat requirements forced to be useable. - - - 48 + + Paramdomizer will not change the starting weapons of classes. +By default the paramdomizer will attempt to reroll the classes's weapons into ones the class can use if minimum stats aren't met. +If this setting is turned on or if no match was found, the classes's weapons won't be changed but instead will have their stat requirements forced to be useable. + + 48 + + AAABAAUAEBAAAAEAIABoBAAAVgAAABgYAAABACAAiAkAAL4EAAAgIAAAAQAgAKgQAABGDgAAMDAAAAEA From 1135b8e9df57095ac1937538d88ef38481effc76 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Sat, 8 Feb 2020 19:15:38 -0600 Subject: [PATCH 15/21] prevent arrows from having minimum stats --- Paramdomizer/Form1.cs | 54 ++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index 8391e47..ba13242 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -1648,6 +1648,28 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } + //list of all arrows; used to prevent minimum stat randomization + List allArrowIDS = new List(); + if(true) + { + allArrowIDS.Add(2000000); + allArrowIDS.Add(2001000); + allArrowIDS.Add(2002000); + allArrowIDS.Add(2003000); + allArrowIDS.Add(2004000); + allArrowIDS.Add(2005000); + allArrowIDS.Add(2006000); + allArrowIDS.Add(2007000); + allArrowIDS.Add(2008000); + allArrowIDS.Add(2099000); + allArrowIDS.Add(2100000); + allArrowIDS.Add(2101000); + allArrowIDS.Add(2102000); + allArrowIDS.Add(2103000); + allArrowIDS.Add(2104000); + allArrowIDS.Add(2199000); + } + //heads up to those who maintain this in the future: //when treat shields seperately is enabled it runs a different set of //loops for getting and setting values. @@ -1814,8 +1836,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "properStrength") { - //if not straightsword hilt - if(paramRow.ID != 212000) + //if not straightsword hilt or arrows + if(paramRow.ID != 212000 && !allArrowIDS.Contains(paramRow.ID)) { PropertyInfo prop = cell.GetType().GetProperty("Value"); allAttackProperStrength.Add(Convert.ToInt32(prop.GetValue(cell, null))); @@ -1823,8 +1845,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "properAgility") { - //if not straightsword hilt - if (paramRow.ID != 212000) + //if not straightsword hilt or arrows + if (paramRow.ID != 212000 && !allArrowIDS.Contains(paramRow.ID)) { PropertyInfo prop = cell.GetType().GetProperty("Value"); allAttackProperAgility.Add(Convert.ToInt32(prop.GetValue(cell, null))); @@ -1832,8 +1854,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "properMagic") { - //if not straightsword hilt - if (paramRow.ID != 212000) + //if not straightsword hilt or arrows + if (paramRow.ID != 212000 && !allArrowIDS.Contains(paramRow.ID)) { PropertyInfo prop = cell.GetType().GetProperty("Value"); allAttackProperMagic.Add(Convert.ToInt32(prop.GetValue(cell, null))); @@ -1841,8 +1863,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "properFaith") { - //if not straightsword hilt - if (paramRow.ID != 212000) + //if not straightsword hilt or arrows + if (paramRow.ID != 212000 && !allArrowIDS.Contains(paramRow.ID)) { PropertyInfo prop = cell.GetType().GetProperty("Value"); allAttackProperFaith.Add(Convert.ToInt32(prop.GetValue(cell, null))); @@ -2519,8 +2541,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "properStrength") { - //if not straightsword hilt - if (paramRow.ID != 212000) + //if not straightsword hilt or arrows + if (paramRow.ID != 212000 && !allArrowIDS.Contains(paramRow.ID)) { int randomIndex = r.Next(allAttackProperStrength.Count); Type type = cell.GetType(); @@ -2568,8 +2590,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "properAgility") { - //if not straightsword hilt - if (paramRow.ID != 212000) + //if not straightsword hilt or arrows + if (paramRow.ID != 212000 && !allArrowIDS.Contains(paramRow.ID)) { int randomIndex = r.Next(allAttackProperAgility.Count); Type type = cell.GetType(); @@ -2617,8 +2639,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "properMagic") { - //if not straightsword hilt - if (paramRow.ID != 212000) + //if not straightsword hilt or arrows + if (paramRow.ID != 212000 && !allArrowIDS.Contains(paramRow.ID)) { int randomIndex = r.Next(allAttackProperMagic.Count); Type type = cell.GetType(); @@ -2666,8 +2688,8 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "properFaith") { - //if not straightsword hilt - if (paramRow.ID != 212000) + //if not straightsword hilt or arrows + if (paramRow.ID != 212000 && !allArrowIDS.Contains(paramRow.ID)) { int randomIndex = r.Next(allAttackProperFaith.Count); Type type = cell.GetType(); From c02d352967336ac9c44bd89e0f2bac9e765c52bb Mon Sep 17 00:00:00 2001 From: Kiroko Date: Sat, 8 Feb 2020 19:18:38 -0600 Subject: [PATCH 16/21] arrows wont have their weight randomized --- Paramdomizer/Form1.cs | 56 ++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index ba13242..b184dfd 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -1872,8 +1872,12 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "weight") { - PropertyInfo prop = cell.GetType().GetProperty("Value"); - allWepWeight.Add(Convert.ToDouble(prop.GetValue(cell, null))); + //if not arrow, consider weight + if(!allArrowIDS.Contains(paramRow.ID)) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + allWepWeight.Add(Convert.ToDouble(prop.GetValue(cell, null))); + } } else if (cell.Def.Name == "attackBaseStamina") { @@ -2737,37 +2741,41 @@ private async void btnSubmit_Click(object sender, EventArgs e) } else if (cell.Def.Name == "weight") { - MeowDSIO.DataTypes.PARAM.ParamCellValueRef fistCheckCell = paramRow.Cells.First(c => c.Def.Name == "sortId"); - Type fistchecktype = fistCheckCell.GetType(); - PropertyInfo fistcheckprop = fistchecktype.GetProperty("Value"); - - int randomIndex = r.Next(allWepWeight.Count); - Type type = cell.GetType(); - PropertyInfo prop = type.GetProperty("Value"); - //fists dont get weight - if (checkBoxWeaponWeight.Checked && Convert.ToInt32(fistcheckprop.GetValue(fistCheckCell, null)) != 1750) + //if not an arrow + if(!allArrowIDS.Contains(paramRow.ID)) { - if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponWeight.Checked) + MeowDSIO.DataTypes.PARAM.ParamCellValueRef fistCheckCell = paramRow.Cells.First(c => c.Def.Name == "sortId"); + Type fistchecktype = fistCheckCell.GetType(); + PropertyInfo fistcheckprop = fistchecktype.GetProperty("Value"); + + int randomIndex = r.Next(allWepWeight.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + //fists dont get weight + if (checkBoxWeaponWeight.Checked && Convert.ToInt32(fistcheckprop.GetValue(fistCheckCell, null)) != 1750) { - //small chance that the value will be above a certain value (used to prevent higher values appearing more frequently because outliers are included) - if (r.Next(20) == 0) + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRWeaponWeight.Checked) { - //28 is the cap; weight is randomized in half steps - prop.SetValue(cell, (r.Next(37) + 20) / 2.0, null); + //small chance that the value will be above a certain value (used to prevent higher values appearing more frequently because outliers are included) + if (r.Next(20) == 0) + { + //28 is the cap; weight is randomized in half steps + prop.SetValue(cell, (r.Next(37) + 20) / 2.0, null); + } + else + { + //10 is soft cap; weight is randomized in half steps + prop.SetValue(cell, (r.Next(21)) / 2.0, null); + } } else { - //10 is soft cap; weight is randomized in half steps - prop.SetValue(cell, (r.Next(21)) / 2.0, null); + prop.SetValue(cell, allWepWeight[randomIndex], null); } } - else - { - prop.SetValue(cell, allWepWeight[randomIndex], null); - } - } - allWepWeight.RemoveAt(randomIndex); + allWepWeight.RemoveAt(randomIndex); + } } else if (cell.Def.Name == "attackBaseStamina") { From a39c6c35365fb483e04640f962a47c55ecd478f6 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Sat, 8 Feb 2020 19:51:38 -0600 Subject: [PATCH 17/21] starting arrows/bolts for the hunter will be changed if they cant use it with their current cross/bow this is not an option to turn off, just some logic to prevent bad starts --- Paramdomizer/Form1.cs | 104 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index b184dfd..8304015 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -245,6 +245,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) int[,] startingWeapons = new int[10, 2]; //mainhand first then offhand weapons int[] secondaryStartingWeapons = new int[4]; //starts with hunter, next 3 indexes are the caster's casting item + int hunterStartingArrowsID = -1; int[] classLevels = new int[10]; int[,] classStats = new int[10, 8]; @@ -6710,6 +6711,18 @@ private async void btnSubmit_Click(object sender, EventArgs e) //if is a starting class if(paramRow.ID >= 3000 && paramRow.ID <= 3009) { + //if is hunter + if(paramRow.ID == 3005) + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + if(cell.Def.Name == "equip_Arrow") + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + hunterStartingArrowsID = Convert.ToInt32(prop.GetValue(cell, null)); + } + } + } //if is hunter or spellcaster if(paramRow.ID >= 3005 && paramRow.ID <= 3008) { @@ -7991,6 +8004,97 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } + //rerolls starting arrows on archer if it cant be used with their cross/bow + if (!checkBoxUniversalizeBows.Checked) + { + int weaponID = secondaryStartingWeapons[0]; //hunter's "bow" + List crossbowIDS = new List() { + 1250000, 1250100, 1250200, 1250400, 1250600, 1250800, + 1251000, 1251100, 1251200, 1251400, 1251600, 1251800, + 1252000, 1252100, 1252200, 1252400, 1252600, 1252800, + 1253000, 1253100, 1253200, 1253400, 1253600, 1253800}; + bool isCrossbow = crossbowIDS.Contains(weaponID); + + List boltIDS = new List() { 2100000, 2101000, 2102000, 2103000, 2104000, 2199000 }; + bool isBolt = boltIDS.Contains(hunterStartingArrowsID); + + List validArrows = new List() { 2000000, 2001000, 2002000, 2003000, 2004000, 2005000, 2006000, 2007000, 2008000 }; + List validBolts = new List() { 2100000, 2101000, 2102000, 2103000, 2104000 }; + int newArrowBolt = -1; + + //check if needs new arrowbolt and if so decide what it is + if(isCrossbow && !isBolt) + { + newArrowBolt = validBolts[r.Next(validBolts.Count)]; + } + else if(!isCrossbow && isBolt) + { + newArrowBolt = validArrows[r.Next(validArrows.Count)]; + } + + //if should change, change + if(newArrowBolt != -1) + { + foreach (var paramBndEntry in gameparamBnd) + { + var paramShortName = paramBndEntry.Name; + var paramFile = paramBndEntry.Param; + if (paramFile.ID == "ITEMLOT_PARAM_ST") + { + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + if (paramRow.ID == 1810221) //hunter's starting arrows + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + if (cell.Def.Name == "lotItemId01") //only weapons are modified so no need to change type flag (arrows are weapons) + { + prop.SetValue(cell, newArrowBolt, null); + } + } + } + } + } + else if (paramFile.ID == "CHARACTER_INIT_PARAM") + { + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + if (paramRow.ID == 3005) // hunter menu class + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + if (cell.Def.Name == "equip_Arrow") + { + if(isCrossbow) + { + prop.SetValue(cell, -1, null); + } + else + { + prop.SetValue(cell, newArrowBolt, null); + } + } + else if (cell.Def.Name == "equip_Bolt") + { + if(isCrossbow) + { + prop.SetValue(cell, newArrowBolt, null); + } + else + { + prop.SetValue(cell, -1, null); + } + } + } + } + } + } + } + } + + } //rerolls starting spells to be useable if that is allowed if (!checkBoxDontChangeStartSpells.Checked) From 17fd2aace5b6fa8974fd116e8ceb1fe1044c1e9f Mon Sep 17 00:00:00 2001 From: Kiroko Date: Sat, 8 Feb 2020 20:27:58 -0600 Subject: [PATCH 18/21] seperated enemy speffect randomization --- Paramdomizer/Form1.cs | 12 ++++++---- Paramdomizer/Form1.designer.cs | 44 +++++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index 8304015..3f1f3cb 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -454,7 +454,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) Type type = cell.GetType(); PropertyInfo prop = type.GetProperty("Value"); - if (chkSpeffects.Checked) + if (chkSpeffectsEnemyAttacks.Checked) { prop.SetValue(cell, allSpEffects[randomIndex], null); } @@ -595,7 +595,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) if (!invalidSpeffects.Contains(speffectCheck)) { - if (chkSpeffects.Checked) + if (chkSpeffectsEnemies.Checked) { prop.SetValue(cell, allSPeffects[randomIndex], null); } @@ -9134,7 +9134,8 @@ private void btnLoadPreset_Click(object sender, EventArgs e) //enemies byte chkAggroRadius.Checked = getState(e1, 0); chkTurnSpeeds.Checked = getState(e1, 1); - chkSpeffects.Checked = getState(e1, 2); + chkSpeffectsEnemyAttacks.Checked = getState(e1, 2); + chkSpeffectsEnemies.Checked = getState(e1, 3); //enemy and player byte chkStaggerLevels.Checked = getState(ep1, 0); @@ -9238,7 +9239,7 @@ private void btnSavePreset_Click(object sender, EventArgs e) checkBoxUniversalizeBows.Checked); //enemies byte - writeByte(s, chkAggroRadius.Checked, chkTurnSpeeds.Checked, chkSpeffects.Checked); + writeByte(s, chkAggroRadius.Checked, chkTurnSpeeds.Checked, chkSpeffectsEnemyAttacks.Checked, chkSpeffectsEnemies.Checked); //enemy and player byte writeByte(s, chkStaggerLevels.Checked, chkKnockback.Checked, chkBullets.Checked, chkHitboxSizes.Checked, @@ -9353,7 +9354,8 @@ private void btnRandomizeSettings_Click(object sender, EventArgs e) //enemies chkAggroRadius.Checked = nextBool(msr); chkTurnSpeeds.Checked = nextBool(msr); - chkSpeffects.Checked = nextBool(msr); + chkSpeffectsEnemyAttacks.Checked = nextBool(msr); + chkSpeffectsEnemies.Checked = nextBool(msr); //enemy and player chkStaggerLevels.Checked = nextBool(msr); diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index 6831ec4..b51009f 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -43,7 +43,8 @@ private void InitializeComponent() this.chkWeaponMoveset = new System.Windows.Forms.CheckBox(); this.chkBullets = new System.Windows.Forms.CheckBox(); this.chkKnockback = new System.Windows.Forms.CheckBox(); - this.chkSpeffects = new System.Windows.Forms.CheckBox(); + this.chkSpeffectsEnemies = new System.Windows.Forms.CheckBox(); + this.chkSpeffectsEnemyAttacks = new System.Windows.Forms.CheckBox(); this.chkWeaponSpeffects = new System.Windows.Forms.CheckBox(); this.chkVoices = new System.Windows.Forms.CheckBox(); this.chkTurnSpeeds = new System.Windows.Forms.CheckBox(); @@ -244,17 +245,30 @@ private void InitializeComponent() this.chkKnockback.UseVisualStyleBackColor = true; this.chkKnockback.CheckedChanged += new System.EventHandler(this.chkKnockback_CheckedChanged); // - // chkSpeffects - // - this.chkSpeffects.AutoSize = true; - this.chkSpeffects.Location = new System.Drawing.Point(33, 294); - this.chkSpeffects.Name = "chkSpeffects"; - this.chkSpeffects.Size = new System.Drawing.Size(189, 17); - this.chkSpeffects.TabIndex = 5; - this.chkSpeffects.Text = "Randomize SPeffects on enemies*"; - this.tooltip.SetToolTip(this.chkSpeffects, "Randomizes special effects on enemies as well as their attacks.\nWARNING: currentl" + - "y breaks enemy death animations sometimes???"); - this.chkSpeffects.UseVisualStyleBackColor = true; + // chkSpeffectsEnemies + // + this.chkSpeffectsEnemies.AutoSize = true; + this.chkSpeffectsEnemies.Location = new System.Drawing.Point(268, 294); + this.chkSpeffectsEnemies.Name = "chkSpeffectsEnemies"; + this.chkSpeffectsEnemies.Size = new System.Drawing.Size(189, 17); + this.chkSpeffectsEnemies.TabIndex = 5; + this.chkSpeffectsEnemies.Text = "Randomize SPeffects on enemies*"; + this.tooltip.SetToolTip(this.chkSpeffectsEnemies, "Randomizes special effects on enemies, like stagger, super armor, status immuniti" + + "es, and .\nWARNING: currently breaks enemy death animations sometimes???"); + this.chkSpeffectsEnemies.UseVisualStyleBackColor = true; + // + // chkSpeffectsEnemyAttacks + // + this.chkSpeffectsEnemyAttacks.AutoSize = true; + this.chkSpeffectsEnemyAttacks.Checked = true; + this.chkSpeffectsEnemyAttacks.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkSpeffectsEnemyAttacks.Location = new System.Drawing.Point(33, 294); + this.chkSpeffectsEnemyAttacks.Name = "chkSpeffectsEnemyAttacks"; + this.chkSpeffectsEnemyAttacks.Size = new System.Drawing.Size(195, 17); + this.chkSpeffectsEnemyAttacks.TabIndex = 5; + this.chkSpeffectsEnemyAttacks.Text = "Randomize enemy attack SPeffects"; + this.tooltip.SetToolTip(this.chkSpeffectsEnemyAttacks, "Randomizes special effects of enemy attacks, like bleed and poison."); + this.chkSpeffectsEnemyAttacks.UseVisualStyleBackColor = true; // // chkWeaponSpeffects // @@ -899,7 +913,8 @@ private void InitializeComponent() this.Controls.Add(this.chkBullets); this.Controls.Add(this.checkBoxForceUseableBullets); this.Controls.Add(this.chkKnockback); - this.Controls.Add(this.chkSpeffects); + this.Controls.Add(this.chkSpeffectsEnemyAttacks); + this.Controls.Add(this.chkSpeffectsEnemies); this.Controls.Add(this.chkWeaponSpeffects); this.Controls.Add(this.chkVoices); this.Controls.Add(this.lblMessage); @@ -946,7 +961,8 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox chkWeaponMoveset; private System.Windows.Forms.CheckBox chkBullets; private System.Windows.Forms.CheckBox chkKnockback; - private System.Windows.Forms.CheckBox chkSpeffects; + private System.Windows.Forms.CheckBox chkSpeffectsEnemyAttacks; + private System.Windows.Forms.CheckBox chkSpeffectsEnemies; private System.Windows.Forms.CheckBox chkWeaponSpeffects; private System.Windows.Forms.CheckBox chkVoices; private System.Windows.Forms.CheckBox chkTurnSpeeds; From b31b4358758164537be865327de77698062e0173 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Sat, 8 Feb 2020 20:30:29 -0600 Subject: [PATCH 19/21] prevent enemy scaling speffect from being touched (should improve fog gate randomizer compatibility) --- Paramdomizer/Form1.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index 3f1f3cb..898122b 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -557,7 +557,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) { PropertyInfo prop = cell.GetType().GetProperty("Value"); int speffectCheck = Convert.ToInt32(prop.GetValue(cell, null)); - if (!invalidSpeffects.Contains(speffectCheck)) + if (cell.Def.Name != "spEffectID4" || !invalidSpeffects.Contains(speffectCheck)) { allSPeffects.Add(speffectCheck); } @@ -593,7 +593,7 @@ private async void btnSubmit_Click(object sender, EventArgs e) int speffectCheck = Convert.ToInt32(prop.GetValue(cell, null)); - if (!invalidSpeffects.Contains(speffectCheck)) + if (cell.Def.Name != "spEffectID4" || !invalidSpeffects.Contains(speffectCheck)) { if (chkSpeffectsEnemies.Checked) { From d529f63df1f5b24204f0552df710327c5589bb47 Mon Sep 17 00:00:00 2001 From: Kiroko Date: Sat, 8 Feb 2020 20:48:15 -0600 Subject: [PATCH 20/21] forgot to finish a sentence --- Paramdomizer/Form1.designer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index b51009f..5bbbc25 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -253,8 +253,8 @@ private void InitializeComponent() this.chkSpeffectsEnemies.Size = new System.Drawing.Size(189, 17); this.chkSpeffectsEnemies.TabIndex = 5; this.chkSpeffectsEnemies.Text = "Randomize SPeffects on enemies*"; - this.tooltip.SetToolTip(this.chkSpeffectsEnemies, "Randomizes special effects on enemies, like stagger, super armor, status immuniti" + - "es, and .\nWARNING: currently breaks enemy death animations sometimes???"); + this.tooltip.SetToolTip(this.chkSpeffectsEnemies, "Randomizes special effects on enemies, like stun, super armor, status immuniti" + + "es, and gravelord status.\nWARNING: currently breaks enemy death animations sometimes???"); this.chkSpeffectsEnemies.UseVisualStyleBackColor = true; // // chkSpeffectsEnemyAttacks From fc859c9e496f24b278a726761a71294c35cb85bd Mon Sep 17 00:00:00 2001 From: Kiroko Date: Sun, 28 Jun 2020 01:05:19 -0500 Subject: [PATCH 21/21] Added randomize camera and a disable everything button --- Paramdomizer/Form1.cs | 270 ++++++++++++++++++++++++++++++++- Paramdomizer/Form1.designer.cs | 39 ++++- Paramdomizer/Form2.Designer.cs | 34 ++++- 3 files changed, 335 insertions(+), 8 deletions(-) diff --git a/Paramdomizer/Form1.cs b/Paramdomizer/Form1.cs index 898122b..78e45ed 100644 --- a/Paramdomizer/Form1.cs +++ b/Paramdomizer/Form1.cs @@ -7202,6 +7202,181 @@ private async void btnSubmit_Click(object sender, EventArgs e) } } } + else if (paramFile.ID == "LOCK_CAM_PARAM_ST") + { + List camDistTargetList = new List(); + List rotRangeMinXList = new List(); + List lockRotXShiftRatioList = new List(); + List chrOrgOffset_YList = new List(); + List chrLockRangeMaxRadiusList = new List(); + List camFovYList = new List(); + + //read values + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + if (cell.Def.Name == "camDistTarget") + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + camDistTargetList.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else if (cell.Def.Name == "rotRangeMinX") + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + rotRangeMinXList.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else if (cell.Def.Name == "lockRotXShiftRatio") + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + lockRotXShiftRatioList.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else if (cell.Def.Name == "chrOrgOffset_Y") + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + chrOrgOffset_YList.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else if (cell.Def.Name == "chrLockRangeMaxRadius") + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + chrLockRangeMaxRadiusList.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + else if (cell.Def.Name == "camFovY") + { + PropertyInfo prop = cell.GetType().GetProperty("Value"); + camFovYList.Add(Convert.ToInt32(prop.GetValue(cell, null))); + } + } + } + + //set values + foreach (MeowDSIO.DataTypes.PARAM.ParamRow paramRow in paramFile.Entries) + { + foreach (MeowDSIO.DataTypes.PARAM.ParamCellValueRef cell in paramRow.Cells) + { + if (cell.Def.Name == "camDistTarget") + { + int randomIndex = r.Next(camDistTargetList.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + + if (checkBoxRandomizeCamera.Checked) + { + if(checkBoxDoTrueRandom.Checked && TRForm.chkTRCamera.Checked) + { + prop.SetValue(cell, r.NextDouble() * 13, null); + } + else + { + prop.SetValue(cell, camDistTargetList[randomIndex], null); + } + } + + camDistTargetList.RemoveAt(randomIndex); + } + else if (cell.Def.Name == "rotRangeMinX") + { + int randomIndex = r.Next(rotRangeMinXList.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + + if (checkBoxRandomizeCamera.Checked) + { + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRCamera.Checked) + { + prop.SetValue(cell, (r.Next(50) *-1) - 10, null); + } + else + { + prop.SetValue(cell, rotRangeMinXList[randomIndex], null); + } + } + + rotRangeMinXList.RemoveAt(randomIndex); + } + else if (cell.Def.Name == "lockRotXShiftRatio") + { + int randomIndex = r.Next(lockRotXShiftRatioList.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + + if (checkBoxRandomizeCamera.Checked) + { + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRCamera.Checked) + { + prop.SetValue(cell, r.Next(10) / 10.0, null); + } + else + { + prop.SetValue(cell, lockRotXShiftRatioList[randomIndex], null); + } + } + + lockRotXShiftRatioList.RemoveAt(randomIndex); + } + else if (cell.Def.Name == "chrOrgOffset_Y") + { + int randomIndex = r.Next(chrOrgOffset_YList.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + + if (checkBoxRandomizeCamera.Checked) + { + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRCamera.Checked) + { + prop.SetValue(cell, r.NextDouble() * 3, null); + } + else + { + prop.SetValue(cell, chrOrgOffset_YList[randomIndex], null); + } + } + + chrOrgOffset_YList.RemoveAt(randomIndex); + } + else if (cell.Def.Name == "chrLockRangeMaxRadius") + { + int randomIndex = r.Next(chrLockRangeMaxRadiusList.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + + if (checkBoxRandomizeCamera.Checked) + { + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRCamera.Checked) + { + prop.SetValue(cell, r.Next(15) + 5, null); + } + else + { + prop.SetValue(cell, chrLockRangeMaxRadiusList[randomIndex], null); + } + } + + chrLockRangeMaxRadiusList.RemoveAt(randomIndex); + } + else if (cell.Def.Name == "camFovY") + { + int randomIndex = r.Next(camFovYList.Count); + Type type = cell.GetType(); + PropertyInfo prop = type.GetProperty("Value"); + + if (checkBoxRandomizeCamera.Checked) + { + if (checkBoxDoTrueRandom.Checked && TRForm.chkTRCamera.Checked) + { + prop.SetValue(cell, r.NextDouble() * 90, null); + } + else + { + prop.SetValue(cell, camFovYList[randomIndex], null); + } + } + + camFovYList.RemoveAt(randomIndex); + } + } + } + } } //rerolls starting weapons to be useable if that is allowed @@ -9112,6 +9287,7 @@ private void btnLoadPreset_Click(object sender, EventArgs e) int o1 = s.ReadByte(); //other settings byte (options in the other settings tab) int altRand1 = s.ReadByte(); //alternative randomization's 1st byte (don't randomize by shuffle) int altRand2 = s.ReadByte(); //alternative randomization's 2nd byte (don't randomize by shuffle) + int o2 = s.ReadByte(); // other settings byte 2 //weapons 1st byte @@ -9168,6 +9344,9 @@ private void btnLoadPreset_Click(object sender, EventArgs e) checkBoxStartingGiftsAmount.Checked = getState(o1, 6); checkBoxStartingClasses.Checked = getState(o1, 7); + //other settings byte 2 + checkBoxRandomizeCamera.Checked = getState(o2, 0); + //alternative randomization's 1st byte (don't randomize by shuffle) checkBoxDoTrueRandom.Checked = getState(altRand1, 0); TRForm.chkTRWeaponDamage.Checked = getState(altRand1, 1); @@ -9184,6 +9363,7 @@ private void btnLoadPreset_Click(object sender, EventArgs e) TRForm.chkTRSpellRequirements.Checked = getState(altRand2, 2); TRForm.chkTRSpellSlotSize.Checked = getState(altRand2, 3); TRForm.chkTRSpellQuantity.Checked = getState(altRand2, 4); + TRForm.chkTRCamera.Checked = getState(altRand2, 5); @@ -9262,8 +9442,10 @@ private void btnSavePreset_Click(object sender, EventArgs e) //alternative randomization's 2nd byte (don't randomize by shuffle) writeByte(s, TRForm.chkTRArmorPoise.Checked, TRForm.chkTRArmorWeight.Checked, TRForm.chkTRSpellRequirements.Checked, TRForm.chkTRSpellSlotSize.Checked, - TRForm.chkTRSpellQuantity.Checked); + TRForm.chkTRSpellQuantity.Checked, TRForm.chkTRCamera.Checked); + //other settings byte 2 + writeByte(s, checkBoxRandomizeCamera.Checked); lblMessage.Name = ""; @@ -9363,6 +9545,7 @@ private void btnRandomizeSettings_Click(object sender, EventArgs e) chkBullets.Checked = nextBool(msr); chkHitboxSizes.Checked = nextBool(msr); checkBoxNerfHumanityBullets.Checked = nextBool(msr); + checkBoxForceUseableBullets.Checked = nextBool(msr); //armor checkBoxArmorResistance.Checked = nextBool(msr); @@ -9387,6 +9570,7 @@ private void btnRandomizeSettings_Click(object sender, EventArgs e) checkBoxPreventSpellGifts.Checked = nextBool(msr); checkBoxStartingGiftsAmount.Checked = nextBool(msr); checkBoxStartingClasses.Checked = nextBool(msr); + checkBoxRandomizeCamera.Checked = nextBool(msr); //alternative randomization's 1st checkBoxDoTrueRandom.Checked = nextBool(msr); @@ -9404,6 +9588,90 @@ private void btnRandomizeSettings_Click(object sender, EventArgs e) TRForm.chkTRSpellRequirements.Checked = nextBool(msr); TRForm.chkTRSpellSlotSize.Checked = nextBool(msr); TRForm.chkTRSpellQuantity.Checked = nextBool(msr); + TRForm.chkTRCamera.Checked = nextBool(msr); + } + } + + private void btnDisableAll_Click(object sender, EventArgs e) + { + DialogResult result = MessageBox.Show("WARNING: You are about to change all settings.\nDo you want to continue?", "Disable All Settings", MessageBoxButtons.YesNo); + if (result == DialogResult.Yes) + { + //change all settings to make it so nothing that changes the game is turned on + + //weapons 1st + chkWeaponDamage.Checked = false; + chkWeaponMoveset.Checked = false; + chkWeaponModels.Checked = false; + checkBoxWeaponWeight.Checked = false; + checkBoxWeaponScaling.Checked = false; + checkBoxWeaponStamina.Checked = false; + checkBoxWeaponStatMin.Checked = false; + chkWeaponSpeffects.Checked = false; + + //weapons 2nd + checkBoxWeaponDefense.Checked = false; + checkBoxWeaponShieldSplit.Checked = false; + checkBoxWeaponFistNo.Checked = true; + checkBoxDontChangeStartWeapons.Checked = true; + checkBoxUniversalizeBows.Checked = false; + + //enemies + chkAggroRadius.Checked = false; + chkTurnSpeeds.Checked = false; + chkSpeffectsEnemyAttacks.Checked = false; + chkSpeffectsEnemies.Checked = false; + + //enemy and player + chkStaggerLevels.Checked = false; + chkKnockback.Checked = false; + chkBullets.Checked = false; + chkHitboxSizes.Checked = false; + checkBoxNerfHumanityBullets.Checked = false; + checkBoxForceUseableBullets.Checked = false; + + //armor + checkBoxArmorResistance.Checked = false; + checkBoxArmorWeight.Checked = false; + checkBoxArmorPoise.Checked = false; + checkBoxArmorspEffect.Checked = false; + + //spells + checkBoxUniversalizeCasters.Checked = false; + checkBoxRandomizeSpellRequirements.Checked = false; + checkBoxRandomizeSpellSlotSize.Checked = false; + checkBoxRandomizeSpellQuantity.Checked = false; + chkMagicAnimations.Checked = false; + checkBoxDontChangeStartSpells.Checked = true; + + //other settings + chkItemAnimations.Checked = false; + chkRandomFaceData.Checked = false; + chkRingSpeffects.Checked = false; + chkVoices.Checked = false; + checkBoxStartingGifts.Checked = false; + checkBoxPreventSpellGifts.Checked = false; + checkBoxStartingGiftsAmount.Checked = false; + checkBoxStartingClasses.Checked = false; + checkBoxRandomizeCamera.Checked = false; + + //alternative randomization's 1st + checkBoxDoTrueRandom.Checked = false; + TRForm.chkTRWeaponDamage.Checked = false; + TRForm.chkTRWeaponWeight.Checked = false; + TRForm.chkTRWeaponScaling.Checked = false; + TRForm.chkTRWeaponStamina.Checked = false; + TRForm.chkTRWeaponStatMin.Checked = false; + TRForm.chkTRWeaponDefense.Checked = false; + TRForm.chkTRArmorResistance.Checked = false; + + //alternative randomization's 2nd + TRForm.chkTRArmorPoise.Checked = false; + TRForm.chkTRArmorWeight.Checked = false; + TRForm.chkTRSpellRequirements.Checked = false; + TRForm.chkTRSpellSlotSize.Checked = false; + TRForm.chkTRSpellQuantity.Checked = false; + TRForm.chkTRCamera.Checked = false; } } } diff --git a/Paramdomizer/Form1.designer.cs b/Paramdomizer/Form1.designer.cs index 5bbbc25..4b9ae58 100644 --- a/Paramdomizer/Form1.designer.cs +++ b/Paramdomizer/Form1.designer.cs @@ -81,10 +81,12 @@ private void InitializeComponent() this.checkBoxDontChangeStartWeapons = new System.Windows.Forms.CheckBox(); this.checkBoxForceUseableBullets = new System.Windows.Forms.CheckBox(); this.checkBoxUniversalizeBows = new System.Windows.Forms.CheckBox(); + this.checkBoxRandomizeCamera = new System.Windows.Forms.CheckBox(); this.tooltip = new System.Windows.Forms.ToolTip(this.components); this.btnSavePreset = new System.Windows.Forms.Button(); this.btnLoadPreset = new System.Windows.Forms.Button(); this.btnRandomizeSettings = new System.Windows.Forms.Button(); + this.btnDisableAll = new System.Windows.Forms.Button(); this.btnDoTrueRandomPopup = new System.Windows.Forms.Button(); this.gbWeaponCategory = new System.Windows.Forms.GroupBox(); this.gbSpellCategory = new System.Windows.Forms.GroupBox(); @@ -253,8 +255,9 @@ private void InitializeComponent() this.chkSpeffectsEnemies.Size = new System.Drawing.Size(189, 17); this.chkSpeffectsEnemies.TabIndex = 5; this.chkSpeffectsEnemies.Text = "Randomize SPeffects on enemies*"; - this.tooltip.SetToolTip(this.chkSpeffectsEnemies, "Randomizes special effects on enemies, like stun, super armor, status immuniti" + - "es, and gravelord status.\nWARNING: currently breaks enemy death animations sometimes???"); + this.tooltip.SetToolTip(this.chkSpeffectsEnemies, "Randomizes special effects on enemies, like stun, super armor, status immunities," + + " and gravelord status.\nWARNING: currently breaks enemy death animations sometime" + + "s???"); this.chkSpeffectsEnemies.UseVisualStyleBackColor = true; // // chkSpeffectsEnemyAttacks @@ -745,6 +748,18 @@ private void InitializeComponent() this.tooltip.SetToolTip(this.checkBoxUniversalizeBows, "Bows and crossbows can now use both types of ammo."); this.checkBoxUniversalizeBows.UseVisualStyleBackColor = true; // + // checkBoxRandomizeCamera + // + this.checkBoxRandomizeCamera.AutoSize = true; + this.checkBoxRandomizeCamera.Location = new System.Drawing.Point(504, 336); + this.checkBoxRandomizeCamera.Name = "checkBoxRandomizeCamera"; + this.checkBoxRandomizeCamera.Size = new System.Drawing.Size(118, 17); + this.checkBoxRandomizeCamera.TabIndex = 43; + this.checkBoxRandomizeCamera.Text = "Randomize Camera"; + this.tooltip.SetToolTip(this.checkBoxRandomizeCamera, "Randomizes the camera and camera lockon parameters.\nWARNING: use with caution. Th" + + "is may make the game annoying or impossible to play."); + this.checkBoxRandomizeCamera.UseVisualStyleBackColor = true; + // // tooltip // this.tooltip.AutoPopDelay = 32767; @@ -783,6 +798,16 @@ private void InitializeComponent() this.tooltip.SetToolTip(this.btnRandomizeSettings, "Randomizes the state of every setting."); this.btnRandomizeSettings.Click += new System.EventHandler(this.btnRandomizeSettings_Click); // + // btnDisableAll + // + this.btnDisableAll.Location = new System.Drawing.Point(583, 27); + this.btnDisableAll.Name = "btnDisableAll"; + this.btnDisableAll.Size = new System.Drawing.Size(74, 25); + this.btnDisableAll.TabIndex = 47; + this.btnDisableAll.Text = "Disable All"; + this.tooltip.SetToolTip(this.btnDisableAll, "Adjusts settings to ensure no changes will be made."); + this.btnDisableAll.Click += new System.EventHandler(this.btnDisableAll_Click); + // // btnDoTrueRandomPopup // this.btnDoTrueRandomPopup.Location = new System.Drawing.Point(192, 421); @@ -831,7 +856,7 @@ private void InitializeComponent() this.gbOtherCategory.AutoSize = true; this.gbOtherCategory.Location = new System.Drawing.Point(479, 214); this.gbOtherCategory.Name = "gbOtherCategory"; - this.gbOtherCategory.Size = new System.Drawing.Size(466, 116); + this.gbOtherCategory.Size = new System.Drawing.Size(466, 139); this.gbOtherCategory.TabIndex = 35; this.gbOtherCategory.TabStop = false; this.gbOtherCategory.Text = "Other Settings:"; @@ -861,9 +886,9 @@ private void InitializeComponent() this.lblVersion.AutoSize = true; this.lblVersion.Location = new System.Drawing.Point(773, 454); this.lblVersion.Name = "lblVersion"; - this.lblVersion.Size = new System.Drawing.Size(90, 13); + this.lblVersion.Size = new System.Drawing.Size(87, 13); this.lblVersion.TabIndex = 41; - this.lblVersion.Text = "DEV version 0.3e"; + this.lblVersion.Text = "DEV version 0.3f"; // // Form1 // @@ -871,9 +896,11 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(960, 480); this.Controls.Add(this.checkBoxUniversalizeBows); + this.Controls.Add(this.checkBoxRandomizeCamera); this.Controls.Add(this.btnLoadPreset); this.Controls.Add(this.btnSavePreset); this.Controls.Add(this.btnRandomizeSettings); + this.Controls.Add(this.btnDisableAll); this.Controls.Add(this.btnDoTrueRandomPopup); this.Controls.Add(this.checkBoxLoadFromBackup); this.Controls.Add(this.checkBoxNerfHumanityBullets); @@ -1000,6 +1027,7 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox checkBoxDontChangeStartWeapons; private System.Windows.Forms.CheckBox checkBoxForceUseableBullets; private System.Windows.Forms.CheckBox checkBoxUniversalizeBows; + private System.Windows.Forms.CheckBox checkBoxRandomizeCamera; private System.Windows.Forms.ToolTip tooltip; private System.Windows.Forms.GroupBox gbWeaponCategory; private System.Windows.Forms.GroupBox gbSpellCategory; @@ -1011,6 +1039,7 @@ private void InitializeComponent() private System.Windows.Forms.Button btnSavePreset; private System.Windows.Forms.Button btnLoadPreset; private System.Windows.Forms.Button btnRandomizeSettings; + private System.Windows.Forms.Button btnDisableAll; private System.Windows.Forms.Button btnDoTrueRandomPopup; } } diff --git a/Paramdomizer/Form2.Designer.cs b/Paramdomizer/Form2.Designer.cs index d47b37b..c03a1d2 100644 --- a/Paramdomizer/Form2.Designer.cs +++ b/Paramdomizer/Form2.Designer.cs @@ -43,15 +43,17 @@ private void InitializeComponent() this.chkTRSpellRequirements = new System.Windows.Forms.CheckBox(); this.chkTRSpellSlotSize = new System.Windows.Forms.CheckBox(); this.chkTRSpellQuantity = new System.Windows.Forms.CheckBox(); + this.chkTRCamera = new System.Windows.Forms.CheckBox(); this.gbWeaponCategory = new System.Windows.Forms.GroupBox(); this.gbArmorCategory = new System.Windows.Forms.GroupBox(); this.gbSpellCategory = new System.Windows.Forms.GroupBox(); + this.gbOtherCategory = new System.Windows.Forms.GroupBox(); this.tooltip = new System.Windows.Forms.ToolTip(this.components); this.SuspendLayout(); // // btnCloseWindow // - this.btnCloseWindow.Location = new System.Drawing.Point(413, 235); + this.btnCloseWindow.Location = new System.Drawing.Point(413, 277); this.btnCloseWindow.Name = "btnCloseWindow"; this.btnCloseWindow.Size = new System.Drawing.Size(75, 23); this.btnCloseWindow.TabIndex = 0; @@ -230,6 +232,20 @@ private void InitializeComponent() "a values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); this.chkTRSpellQuantity.UseVisualStyleBackColor = true; // + // chkTRCamera + // + this.chkTRCamera.AutoSize = true; + this.chkTRCamera.Checked = true; + this.chkTRCamera.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTRCamera.Location = new System.Drawing.Point(36, 254); + this.chkTRCamera.Name = "chkTRCamera"; + this.chkTRCamera.Size = new System.Drawing.Size(95, 17); + this.chkTRCamera.TabIndex = 1; + this.chkTRCamera.Text = "Camera DRBS"; + this.tooltip.SetToolTip(this.chkTRCamera, "Randomize camera parameters by generating random numbers instead of shuffling van" + + "illa values.\nDon\'t Randomize by Shuffle needs to be on for this to function."); + this.chkTRCamera.UseVisualStyleBackColor = true; + // // gbWeaponCategory // this.gbWeaponCategory.AutoSize = true; @@ -260,6 +276,16 @@ private void InitializeComponent() this.gbSpellCategory.TabStop = false; this.gbSpellCategory.Text = "Spell Settings:"; // + // gbOtherCategory + // + this.gbOtherCategory.AutoSize = true; + this.gbOtherCategory.Location = new System.Drawing.Point(12, 235); + this.gbOtherCategory.Name = "gbOtherCategory"; + this.gbOtherCategory.Size = new System.Drawing.Size(450, 36); + this.gbOtherCategory.TabIndex = 2; + this.gbOtherCategory.TabStop = false; + this.gbOtherCategory.Text = "Other Settings:"; + // // tooltip // this.tooltip.AutoPopDelay = 32767; @@ -270,7 +296,7 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(500, 270); + this.ClientSize = new System.Drawing.Size(500, 300); this.Controls.Add(this.btnCloseWindow); this.Controls.Add(this.chkTRWeaponDamage); this.Controls.Add(this.chkTRWeaponScaling); @@ -284,9 +310,11 @@ private void InitializeComponent() this.Controls.Add(this.chkTRSpellRequirements); this.Controls.Add(this.chkTRSpellSlotSize); this.Controls.Add(this.chkTRSpellQuantity); + this.Controls.Add(this.chkTRCamera); this.Controls.Add(this.gbWeaponCategory); this.Controls.Add(this.gbArmorCategory); this.Controls.Add(this.gbSpellCategory); + this.Controls.Add(this.gbOtherCategory); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; @@ -312,9 +340,11 @@ private void InitializeComponent() public System.Windows.Forms.CheckBox chkTRSpellRequirements; public System.Windows.Forms.CheckBox chkTRSpellSlotSize; public System.Windows.Forms.CheckBox chkTRSpellQuantity; + public System.Windows.Forms.CheckBox chkTRCamera; public System.Windows.Forms.GroupBox gbWeaponCategory; public System.Windows.Forms.GroupBox gbArmorCategory; public System.Windows.Forms.GroupBox gbSpellCategory; + public System.Windows.Forms.GroupBox gbOtherCategory; //public System.Windows.Forms.GroupBox gbEnemyCategory; //public System.Windows.Forms.GroupBox gbNPCPCCategory; public System.Windows.Forms.ToolTip tooltip;