From 3970d05634ae80c63b1c374361d937b7bb64750e Mon Sep 17 00:00:00 2001 From: cadaei Date: Sat, 7 Jan 2017 18:17:08 +0100 Subject: [PATCH] added babyCuddleIntervalMultiplier to settings. Fix for applying multipliers if no library was loaded at startup. --- ARKBreedingStats/CreatureCollection.cs | 1 + ARKBreedingStats/Extraction.cs | 13 +- ARKBreedingStats/Form1.cs | 26 +- ARKBreedingStats/Properties/AssemblyInfo.cs | 2 +- ARKBreedingStats/Settings.Designer.cs | 309 +++++++++++--------- ARKBreedingStats/Settings.cs | 7 + ARKBreedingStats/Taming.cs | 7 +- ARKBreedingStats/TamingControl.cs | 6 +- ARKBreedingStats/ver.txt | 2 +- 9 files changed, 212 insertions(+), 161 deletions(-) diff --git a/ARKBreedingStats/CreatureCollection.cs b/ARKBreedingStats/CreatureCollection.cs index 9d4e0206..171b9b2f 100644 --- a/ARKBreedingStats/CreatureCollection.cs +++ b/ARKBreedingStats/CreatureCollection.cs @@ -28,6 +28,7 @@ namespace ARKBreedingStats public int maxWildLevel = 150; public int maxBreedingSuggestions = 10; public double imprintingMultiplier = 1; + public double babyCuddleIntervalMultiplier = 1; public double tamingSpeedMultiplier = 1; public double tamingFoodRateMultiplier = 1; [XmlArray] diff --git a/ARKBreedingStats/Extraction.cs b/ARKBreedingStats/Extraction.cs index e6195943..81757caf 100644 --- a/ARKBreedingStats/Extraction.cs +++ b/ARKBreedingStats/Extraction.cs @@ -162,7 +162,7 @@ public int filterResultsByFixed(int dontFix = -1) return -1; // -1 is good for this function. A value >=0 means that stat is faulty } - public void extractLevels(int speciesI, int level, List statIOs, double lowerTEBound, double upperTEBound, bool autoDetectTamed, bool tamed, bool justTamed, bool bred, double imprintingBonusRounded, double imprintingBonusMultiplier) + public void extractLevels(int speciesI, int level, List statIOs, double lowerTEBound, double upperTEBound, bool autoDetectTamed, bool tamed, bool justTamed, bool bred, double imprintingBonusRounded, double imprintingBonusMultiplier, double cuddleIntervalMultiplier) { validResults = true; if (autoDetectTamed) @@ -178,10 +178,11 @@ public void extractLevels(int speciesI, int level, List statIOs, double // needed to handle Torpor-bug this.justTamed = justTamed; + // if (imprintingBonusRounded == 1) imprintingBonus = 1; - else if (Values.V.species[speciesI].breeding != null) - imprintingBonus = Math.Round(imprintingBonusRounded * Values.V.species[speciesI].breeding.maturationTimeAdjusted / 14400) * 14400 / Values.V.species[speciesI].breeding.maturationTimeAdjusted; + else if (Values.V.species[speciesI].breeding != null && Values.V.species[speciesI].breeding.maturationTimeAdjusted > 0) + imprintingBonus = Math.Round(imprintingBonusRounded * Values.V.species[speciesI].breeding.maturationTimeAdjusted * cuddleIntervalMultiplier / 14400) * 14400 / (Values.V.species[speciesI].breeding.maturationTimeAdjusted * cuddleIntervalMultiplier); else imprintingBonus = 0; double imprintingMultiplier = (1 + imprintingBonus * imprintingBonusMultiplier * .2); @@ -199,21 +200,23 @@ public void extractLevels(int speciesI, int level, List statIOs, double runTorporRangeAgain = false; torporLevelTamingMultMax = 1; torporLevelTamingMultMin = 1; - if (postTamed && justTamed) + if (postTamed && justTamed && !bred) { torporLevelTamingMultMax = (2 + upperTEBound) / (4 + upperTEBound); torporLevelTamingMultMin = (2 + lowerTEBound) / (4 + lowerTEBound); } levelWildFromTorporRange[0] = (int)Math.Round((statIOs[7].Input / imprintingMultiplier - (postTamed ? Values.V.species[speciesI].stats[7].AddWhenTamed : 0) - Values.V.species[speciesI].stats[7].BaseValue) * torporLevelTamingMultMin / (Values.V.species[speciesI].stats[7].BaseValue * Values.V.species[speciesI].stats[7].IncPerWildLevel), 0); levelWildFromTorporRange[1] = (int)Math.Round((statIOs[7].Input / imprintingMultiplier - (postTamed ? Values.V.species[speciesI].stats[7].AddWhenTamed : 0) - Values.V.species[speciesI].stats[7].BaseValue) * torporLevelTamingMultMax / (Values.V.species[speciesI].stats[7].BaseValue * Values.V.species[speciesI].stats[7].IncPerWildLevel), 0); + + // if level of torpor is higher than the total-level, the torporBug displayed a too high torpor. If the user didn't check the justTamed-checkbox, do it for them and recalculate the true torpor-level if (!runTorporRangeAgain && !justTamed && levelWildFromTorporRange[0] > level) { justTamed = true; this.justTamed = true; runTorporRangeAgain = true; } + // if levelWildFromTorporRange[0] > level, then justTamed has to be true, then run the previous calculation again } while (runTorporRangeAgain); - // if levelWildFromTorporRange[0] > level, then justTamed has to be true, then run the previous calculation again domFreeMin = 0; domFreeMax = 0; diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index 67656441..61eb9dce 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -181,15 +181,14 @@ private void Form1_Load(object sender, EventArgs e) if (Values.V.loadValues() && Values.V.speciesNames.Count > 0) { - creatureCollection.multipliers = Values.V.statMultipliers; - Values.V.applyMultipliersToStats(Values.V.statMultipliers); - - // set species comboboxes - updateSpeciesComboboxes(); - // load last save file: if (Properties.Settings.Default.LastSaveFile != "") loadCollectionFile(Properties.Settings.Default.LastSaveFile); + else + newCollection(); + + // set species comboboxes + updateSpeciesComboboxes(); for (int s = 0; s < 8; s++) { @@ -226,7 +225,7 @@ private void Form1_Load(object sender, EventArgs e) //numericUpDownLevel.Value = 189; //checkBoxAlreadyBred.Checked = true; //numericUpDownImprintingBonusExtractor.Value = 59; - tabControlMain.SelectedTab = tabPageExtractor; + //tabControlMain.SelectedTab = tabPageExtractor; if (!Properties.Settings.Default.OCR) { @@ -310,9 +309,10 @@ private bool extractLevels() Extraction.E.extractLevels(sE, (int)numericUpDownLevel.Value, statIOs, (double)numericUpDownLowerTEffBound.Value / 100, (double)numericUpDownUpperTEffBound.Value / 100, checkBoxWildTamedAuto.Checked, radioButtonTamed.Checked, checkBoxJustTamed.Checked, checkBoxAlreadyBred.Checked, - (double)numericUpDownImprintingBonusExtractor.Value / 100, creatureCollection.imprintingMultiplier); + (double)numericUpDownImprintingBonusExtractor.Value / 100, creatureCollection.imprintingMultiplier, creatureCollection.babyCuddleIntervalMultiplier); - checkBoxJustTamed.Checked = Extraction.E.justTamed; + if (!checkBoxAlreadyBred.Checked) + checkBoxJustTamed.Checked = Extraction.E.justTamed; numericUpDownImprintingBonusExtractor.Value = (decimal)Extraction.E.imprintingBonus * 100; // remove all results that require a total wild-level higher than the max @@ -3022,10 +3022,12 @@ private void showStatsInOverlay() bool enoughFood; double te; TimeSpan duration; - int narcotics, narcoBerries; - Taming.tamingTimes(speciesIndex, (int)wildLevels[0], new List() { foodName }, new List() { foodNeeded }, out foodAmountUsed, out duration, out narcoBerries, out narcotics, out te, out enoughFood); + int narcotics, narcoBerries, bioToxines; + Taming.tamingTimes(speciesIndex, (int)wildLevels[0], new List() { foodName }, new List() { foodNeeded }, out foodAmountUsed, out duration, out narcoBerries, out narcotics, out bioToxines, out te, out enoughFood); string foodNameDisplay = (foodName == "Kibble" ? Values.V.species[speciesIndex].taming.favoriteKibble + " Egg Kibble" : foodName); - extraText += "\nIt takes " + duration.ToString(@"hh\:mm\:ss") + " to tame the creature with " + foodNeeded + "×" + foodNameDisplay + "\n" + narcoBerries + " Narcoberries or " + narcotics + " Narcotics are needed\nTaming Effectiveness: " + Math.Round(100 * te, 1).ToString() + " % (+" + Math.Floor(wildLevels[0] * te / 2).ToString() + " lvl)"; + extraText += "\nIt takes " + duration.ToString(@"hh\:mm\:ss") + " to tame the creature with " + foodNeeded + "×" + foodNameDisplay + + "\n" + narcoBerries + " Narcoberries or " + narcotics + " Narcotics or " + bioToxines + " Bio Toxines are needed" + + "\nTaming Effectiveness: " + Math.Round(100 * te, 1).ToString() + " % (+" + Math.Floor(wildLevels[0] * te / 2).ToString() + " lvl)"; } overlay.setValues(wildLevels, tamedLevels, colors); diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index 807ff370..0090408b 100644 --- a/ARKBreedingStats/Properties/AssemblyInfo.cs +++ b/ARKBreedingStats/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.20.8.1")] +[assembly: AssemblyFileVersion("0.20.8.2")] diff --git a/ARKBreedingStats/Settings.Designer.cs b/ARKBreedingStats/Settings.Designer.cs index b8f78071..2e31dd24 100644 --- a/ARKBreedingStats/Settings.Designer.cs +++ b/ARKBreedingStats/Settings.Designer.cs @@ -36,14 +36,6 @@ private void InitializeComponent() this.buttonAllToOne = new System.Windows.Forms.Button(); this.buttonSetToOfficial = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); - this.multiplierSettingTo = new ARKBreedingStats.MultiplierSetting(); - this.multiplierSettingSp = new ARKBreedingStats.MultiplierSetting(); - this.multiplierSettingDm = new ARKBreedingStats.MultiplierSetting(); - this.multiplierSettingWe = new ARKBreedingStats.MultiplierSetting(); - this.multiplierSettingFo = new ARKBreedingStats.MultiplierSetting(); - this.multiplierSettingOx = new ARKBreedingStats.MultiplierSetting(); - this.multiplierSettingSt = new ARKBreedingStats.MultiplierSetting(); - this.multiplierSettingHP = new ARKBreedingStats.MultiplierSetting(); this.buttonOK = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.checkBoxAutoSave = new System.Windows.Forms.CheckBox(); @@ -66,6 +58,9 @@ private void InitializeComponent() this.label10 = new System.Windows.Forms.Label(); this.numericUpDownDomLevelNr = new System.Windows.Forms.NumericUpDown(); this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.label16 = new System.Windows.Forms.Label(); + this.radioButtonFahrenheit = new System.Windows.Forms.RadioButton(); + this.radioButtonCelsius = new System.Windows.Forms.RadioButton(); this.label12 = new System.Windows.Forms.Label(); this.numericUpDownMaxBreedingSug = new System.Windows.Forms.NumericUpDown(); this.groupBox5 = new System.Windows.Forms.GroupBox(); @@ -74,9 +69,16 @@ private void InitializeComponent() this.numericUpDownTamingFoodRate = new System.Windows.Forms.NumericUpDown(); this.numericUpDownTamingSpeed = new System.Windows.Forms.NumericUpDown(); this.label15 = new System.Windows.Forms.Label(); - this.radioButtonCelsius = new System.Windows.Forms.RadioButton(); - this.radioButtonFahrenheit = new System.Windows.Forms.RadioButton(); - this.label16 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.numericUpDownBabyCuddleIntervalMultiplier = new System.Windows.Forms.NumericUpDown(); + this.multiplierSettingTo = new ARKBreedingStats.MultiplierSetting(); + this.multiplierSettingSp = new ARKBreedingStats.MultiplierSetting(); + this.multiplierSettingDm = new ARKBreedingStats.MultiplierSetting(); + this.multiplierSettingWe = new ARKBreedingStats.MultiplierSetting(); + this.multiplierSettingFo = new ARKBreedingStats.MultiplierSetting(); + this.multiplierSettingOx = new ARKBreedingStats.MultiplierSetting(); + this.multiplierSettingSt = new ARKBreedingStats.MultiplierSetting(); + this.multiplierSettingHP = new ARKBreedingStats.MultiplierSetting(); this.groupBoxMultiplier.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownAutosaveMinutes)).BeginInit(); @@ -92,6 +94,7 @@ private void InitializeComponent() this.groupBox5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTamingFoodRate)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTamingSpeed)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownBabyCuddleIntervalMultiplier)).BeginInit(); this.SuspendLayout(); // // groupBoxMultiplier @@ -183,107 +186,11 @@ private void InitializeComponent() this.label1.TabIndex = 1; this.label1.Text = "TameAdd"; // - // multiplierSettingTo - // - this.multiplierSettingTo.Location = new System.Drawing.Point(6, 256); - this.multiplierSettingTo.Multipliers = new double[] { - 1D, - 1D, - 1D, - 1D}; - this.multiplierSettingTo.Name = "multiplierSettingTo"; - this.multiplierSettingTo.Size = new System.Drawing.Size(288, 26); - this.multiplierSettingTo.TabIndex = 12; - // - // multiplierSettingSp - // - this.multiplierSettingSp.Location = new System.Drawing.Point(6, 230); - this.multiplierSettingSp.Multipliers = new double[] { - 1D, - 1D, - 1D, - 1D}; - this.multiplierSettingSp.Name = "multiplierSettingSp"; - this.multiplierSettingSp.Size = new System.Drawing.Size(288, 26); - this.multiplierSettingSp.TabIndex = 11; - // - // multiplierSettingDm - // - this.multiplierSettingDm.Location = new System.Drawing.Point(6, 204); - this.multiplierSettingDm.Multipliers = new double[] { - 1D, - 1D, - 1D, - 1D}; - this.multiplierSettingDm.Name = "multiplierSettingDm"; - this.multiplierSettingDm.Size = new System.Drawing.Size(288, 26); - this.multiplierSettingDm.TabIndex = 10; - // - // multiplierSettingWe - // - this.multiplierSettingWe.Location = new System.Drawing.Point(6, 178); - this.multiplierSettingWe.Multipliers = new double[] { - 1D, - 1D, - 1D, - 1D}; - this.multiplierSettingWe.Name = "multiplierSettingWe"; - this.multiplierSettingWe.Size = new System.Drawing.Size(288, 26); - this.multiplierSettingWe.TabIndex = 9; - // - // multiplierSettingFo - // - this.multiplierSettingFo.Location = new System.Drawing.Point(6, 152); - this.multiplierSettingFo.Multipliers = new double[] { - 1D, - 1D, - 1D, - 1D}; - this.multiplierSettingFo.Name = "multiplierSettingFo"; - this.multiplierSettingFo.Size = new System.Drawing.Size(288, 26); - this.multiplierSettingFo.TabIndex = 8; - // - // multiplierSettingOx - // - this.multiplierSettingOx.Location = new System.Drawing.Point(6, 126); - this.multiplierSettingOx.Multipliers = new double[] { - 1D, - 1D, - 1D, - 1D}; - this.multiplierSettingOx.Name = "multiplierSettingOx"; - this.multiplierSettingOx.Size = new System.Drawing.Size(288, 26); - this.multiplierSettingOx.TabIndex = 7; - // - // multiplierSettingSt - // - this.multiplierSettingSt.Location = new System.Drawing.Point(6, 100); - this.multiplierSettingSt.Multipliers = new double[] { - 1D, - 1D, - 1D, - 1D}; - this.multiplierSettingSt.Name = "multiplierSettingSt"; - this.multiplierSettingSt.Size = new System.Drawing.Size(288, 26); - this.multiplierSettingSt.TabIndex = 6; - // - // multiplierSettingHP - // - this.multiplierSettingHP.Location = new System.Drawing.Point(6, 74); - this.multiplierSettingHP.Multipliers = new double[] { - 1D, - 1D, - 1D, - 1D}; - this.multiplierSettingHP.Name = "multiplierSettingHP"; - this.multiplierSettingHP.Size = new System.Drawing.Size(288, 26); - this.multiplierSettingHP.TabIndex = 5; - // // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOK.Location = new System.Drawing.Point(480, 488); + this.buttonOK.Location = new System.Drawing.Point(480, 514); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(75, 23); this.buttonOK.TabIndex = 6; @@ -295,7 +202,7 @@ private void InitializeComponent() // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(399, 488); + this.buttonCancel.Location = new System.Drawing.Point(399, 514); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.TabIndex = 7; @@ -377,6 +284,8 @@ private void InitializeComponent() // // groupBox2 // + this.groupBox2.Controls.Add(this.label17); + this.groupBox2.Controls.Add(this.numericUpDownBabyCuddleIntervalMultiplier); this.groupBox2.Controls.Add(this.label13); this.groupBox2.Controls.Add(this.numericUpDownImprintingM); this.groupBox2.Controls.Add(this.label9); @@ -385,7 +294,7 @@ private void InitializeComponent() this.groupBox2.Controls.Add(this.numericUpDownHatching); this.groupBox2.Location = new System.Drawing.Point(323, 294); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(230, 99); + this.groupBox2.Size = new System.Drawing.Size(230, 126); this.groupBox2.TabIndex = 4; this.groupBox2.TabStop = false; this.groupBox2.Text = "Breeding-Multiplier"; @@ -538,13 +447,44 @@ private void InitializeComponent() this.groupBox4.Controls.Add(this.radioButtonCelsius); this.groupBox4.Controls.Add(this.label12); this.groupBox4.Controls.Add(this.numericUpDownMaxBreedingSug); - this.groupBox4.Location = new System.Drawing.Point(323, 399); + this.groupBox4.Location = new System.Drawing.Point(323, 426); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(231, 73); this.groupBox4.TabIndex = 5; this.groupBox4.TabStop = false; this.groupBox4.Text = "Breeding Planner"; // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(6, 47); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(67, 13); + this.label16.TabIndex = 4; + this.label16.Text = "Temperature"; + // + // radioButtonFahrenheit + // + this.radioButtonFahrenheit.AutoSize = true; + this.radioButtonFahrenheit.Location = new System.Drawing.Point(190, 45); + this.radioButtonFahrenheit.Name = "radioButtonFahrenheit"; + this.radioButtonFahrenheit.Size = new System.Drawing.Size(35, 17); + this.radioButtonFahrenheit.TabIndex = 3; + this.radioButtonFahrenheit.TabStop = true; + this.radioButtonFahrenheit.Text = "°F"; + this.radioButtonFahrenheit.UseVisualStyleBackColor = true; + // + // radioButtonCelsius + // + this.radioButtonCelsius.AutoSize = true; + this.radioButtonCelsius.Location = new System.Drawing.Point(148, 45); + this.radioButtonCelsius.Name = "radioButtonCelsius"; + this.radioButtonCelsius.Size = new System.Drawing.Size(36, 17); + this.radioButtonCelsius.TabIndex = 2; + this.radioButtonCelsius.TabStop = true; + this.radioButtonCelsius.Text = "°C"; + this.radioButtonCelsius.UseVisualStyleBackColor = true; + // // label12 // this.label12.AutoSize = true; @@ -645,36 +585,128 @@ private void InitializeComponent() this.label15.Text = "If you have the files Game.ini or GameUserSettings.ini from your server, you can " + "drag&&drop them on this window to read their values."; // - // radioButtonCelsius + // label17 // - this.radioButtonCelsius.AutoSize = true; - this.radioButtonCelsius.Location = new System.Drawing.Point(155, 45); - this.radioButtonCelsius.Name = "radioButtonCelsius"; - this.radioButtonCelsius.Size = new System.Drawing.Size(32, 17); - this.radioButtonCelsius.TabIndex = 2; - this.radioButtonCelsius.TabStop = true; - this.radioButtonCelsius.Text = "C"; - this.radioButtonCelsius.UseVisualStyleBackColor = true; + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(5, 99); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(80, 13); + this.label17.TabIndex = 6; + this.label17.Text = "Cuddle Intervall"; // - // radioButtonFahrenheit + // numericUpDownBabyCuddleIntervalMultiplier // - this.radioButtonFahrenheit.AutoSize = true; - this.radioButtonFahrenheit.Location = new System.Drawing.Point(193, 45); - this.radioButtonFahrenheit.Name = "radioButtonFahrenheit"; - this.radioButtonFahrenheit.Size = new System.Drawing.Size(31, 17); - this.radioButtonFahrenheit.TabIndex = 3; - this.radioButtonFahrenheit.TabStop = true; - this.radioButtonFahrenheit.Text = "F"; - this.radioButtonFahrenheit.UseVisualStyleBackColor = true; + this.numericUpDownBabyCuddleIntervalMultiplier.DecimalPlaces = 2; + this.numericUpDownBabyCuddleIntervalMultiplier.Location = new System.Drawing.Point(166, 97); + this.numericUpDownBabyCuddleIntervalMultiplier.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDownBabyCuddleIntervalMultiplier.Name = "numericUpDownBabyCuddleIntervalMultiplier"; + this.numericUpDownBabyCuddleIntervalMultiplier.Size = new System.Drawing.Size(57, 20); + this.numericUpDownBabyCuddleIntervalMultiplier.TabIndex = 7; + this.numericUpDownBabyCuddleIntervalMultiplier.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); // - // label16 + // multiplierSettingTo // - this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(6, 47); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(67, 13); - this.label16.TabIndex = 4; - this.label16.Text = "Temperature"; + this.multiplierSettingTo.Location = new System.Drawing.Point(6, 256); + this.multiplierSettingTo.Multipliers = new double[] { + 1D, + 1D, + 1D, + 1D}; + this.multiplierSettingTo.Name = "multiplierSettingTo"; + this.multiplierSettingTo.Size = new System.Drawing.Size(288, 26); + this.multiplierSettingTo.TabIndex = 12; + // + // multiplierSettingSp + // + this.multiplierSettingSp.Location = new System.Drawing.Point(6, 230); + this.multiplierSettingSp.Multipliers = new double[] { + 1D, + 1D, + 1D, + 1D}; + this.multiplierSettingSp.Name = "multiplierSettingSp"; + this.multiplierSettingSp.Size = new System.Drawing.Size(288, 26); + this.multiplierSettingSp.TabIndex = 11; + // + // multiplierSettingDm + // + this.multiplierSettingDm.Location = new System.Drawing.Point(6, 204); + this.multiplierSettingDm.Multipliers = new double[] { + 1D, + 1D, + 1D, + 1D}; + this.multiplierSettingDm.Name = "multiplierSettingDm"; + this.multiplierSettingDm.Size = new System.Drawing.Size(288, 26); + this.multiplierSettingDm.TabIndex = 10; + // + // multiplierSettingWe + // + this.multiplierSettingWe.Location = new System.Drawing.Point(6, 178); + this.multiplierSettingWe.Multipliers = new double[] { + 1D, + 1D, + 1D, + 1D}; + this.multiplierSettingWe.Name = "multiplierSettingWe"; + this.multiplierSettingWe.Size = new System.Drawing.Size(288, 26); + this.multiplierSettingWe.TabIndex = 9; + // + // multiplierSettingFo + // + this.multiplierSettingFo.Location = new System.Drawing.Point(6, 152); + this.multiplierSettingFo.Multipliers = new double[] { + 1D, + 1D, + 1D, + 1D}; + this.multiplierSettingFo.Name = "multiplierSettingFo"; + this.multiplierSettingFo.Size = new System.Drawing.Size(288, 26); + this.multiplierSettingFo.TabIndex = 8; + // + // multiplierSettingOx + // + this.multiplierSettingOx.Location = new System.Drawing.Point(6, 126); + this.multiplierSettingOx.Multipliers = new double[] { + 1D, + 1D, + 1D, + 1D}; + this.multiplierSettingOx.Name = "multiplierSettingOx"; + this.multiplierSettingOx.Size = new System.Drawing.Size(288, 26); + this.multiplierSettingOx.TabIndex = 7; + // + // multiplierSettingSt + // + this.multiplierSettingSt.Location = new System.Drawing.Point(6, 100); + this.multiplierSettingSt.Multipliers = new double[] { + 1D, + 1D, + 1D, + 1D}; + this.multiplierSettingSt.Name = "multiplierSettingSt"; + this.multiplierSettingSt.Size = new System.Drawing.Size(288, 26); + this.multiplierSettingSt.TabIndex = 6; + // + // multiplierSettingHP + // + this.multiplierSettingHP.Location = new System.Drawing.Point(6, 74); + this.multiplierSettingHP.Multipliers = new double[] { + 1D, + 1D, + 1D, + 1D}; + this.multiplierSettingHP.Name = "multiplierSettingHP"; + this.multiplierSettingHP.Size = new System.Drawing.Size(288, 26); + this.multiplierSettingHP.TabIndex = 5; // // Settings // @@ -683,7 +715,7 @@ private void InitializeComponent() this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(567, 523); + this.ClientSize = new System.Drawing.Size(567, 549); this.Controls.Add(this.label15); this.Controls.Add(this.groupBox5); this.Controls.Add(this.groupBox4); @@ -720,6 +752,7 @@ private void InitializeComponent() this.groupBox5.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTamingFoodRate)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTamingSpeed)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownBabyCuddleIntervalMultiplier)).EndInit(); this.ResumeLayout(false); } @@ -775,5 +808,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label16; private System.Windows.Forms.RadioButton radioButtonFahrenheit; private System.Windows.Forms.RadioButton radioButtonCelsius; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.NumericUpDown numericUpDownBabyCuddleIntervalMultiplier; } } \ No newline at end of file diff --git a/ARKBreedingStats/Settings.cs b/ARKBreedingStats/Settings.cs index 64f0fd0d..96f95037 100644 --- a/ARKBreedingStats/Settings.cs +++ b/ARKBreedingStats/Settings.cs @@ -64,6 +64,7 @@ private void loadSettings(CreatureCollection cc) numericUpDownMaxBreedingSug.Value = cc.maxBreedingSuggestions; numericUpDownMaxWildLevel.Value = cc.maxWildLevel; numericUpDownImprintingM.Value = (decimal)cc.imprintingMultiplier; + numericUpDownBabyCuddleIntervalMultiplier.Value = (decimal)cc.babyCuddleIntervalMultiplier; numericUpDownTamingSpeed.Value = (decimal)cc.tamingSpeedMultiplier; numericUpDownTamingFoodRate.Value = (decimal)cc.tamingFoodRateMultiplier; checkBoxAutoSave.Checked = Properties.Settings.Default.autosave; @@ -86,6 +87,7 @@ private void saveSettings() cc.maxWildLevel = (int)numericUpDownMaxWildLevel.Value; cc.maxBreedingSuggestions = (int)numericUpDownMaxBreedingSug.Value; cc.imprintingMultiplier = (double)numericUpDownImprintingM.Value; + cc.babyCuddleIntervalMultiplier = (double)numericUpDownBabyCuddleIntervalMultiplier.Value; cc.tamingSpeedMultiplier = (double)numericUpDownTamingSpeed.Value; cc.tamingFoodRateMultiplier = (double)numericUpDownTamingFoodRate.Value; Properties.Settings.Default.autosave = checkBoxAutoSave.Checked; @@ -208,6 +210,11 @@ private void extractSettingsFromFile(string file) { numericUpDownImprintingM.Value = (decimal)d; } + m = Regex.Match(text, @"BabyCuddleIntervalMultiplier ?= ?(\d*\.?\d+)"); + if (m.Success && double.TryParse(m.Groups[1].Value, out d)) + { + numericUpDownBabyCuddleIntervalMultiplier.Value = (decimal)d; + } // GameUserSettings.ini diff --git a/ARKBreedingStats/Taming.cs b/ARKBreedingStats/Taming.cs index 2df3d603..84216368 100644 --- a/ARKBreedingStats/Taming.cs +++ b/ARKBreedingStats/Taming.cs @@ -8,7 +8,7 @@ namespace ARKBreedingStats { public class Taming { - public static void tamingTimes(int speciesI, int level, List usedFood, List foodAmount, out List foodAmountUsed, out TimeSpan duration, out int neededNarcoberries, out int neededNarcotics, out double te, out bool enoughFood) + public static void tamingTimes(int speciesI, int level, List usedFood, List foodAmount, out List foodAmountUsed, out TimeSpan duration, out int neededNarcoberries, out int neededNarcotics, out int neededBioToxines, out double te, out bool enoughFood) { double affinityNeeded = 0, totalTorpor = 0, torporDeplPS = 0, foodAffinity, foodValue, torporNeeded = 0; string food; @@ -18,6 +18,7 @@ public static void tamingTimes(int speciesI, int level, List usedFood, L duration = new TimeSpan(0); neededNarcoberries = 0; neededNarcotics = 0; + neededBioToxines = 0; enoughFood = false; foodAmountUsed = new List(); @@ -40,7 +41,7 @@ public static void tamingTimes(int speciesI, int level, List usedFood, L //total torpor for level totalTorpor = Values.V.species[speciesI].stats[7].BaseValue * (1 + Values.V.species[speciesI].stats[7].IncPerWildLevel * (level - 1)); // torpor depletion per second for level - // here the linear approach of 0.01819 * baseTorporDepletion / level is used.Data shows, it's actual an exponential increase + // here the linear approach of 0.01819 * baseTorporDepletion / level is used. Data shows, it's actual an exponential increase torporDeplPS = taming.torporDepletionPS0 * (1 + 0.01819 * level); } @@ -118,6 +119,8 @@ public static void tamingTimes(int speciesI, int level, List usedFood, L neededNarcoberries = (int)Math.Ceiling(torporNeeded / (7.5 + 3 * torporDeplPS)); // amount of Narcotics(give 40 each over 5s) neededNarcotics = (int)Math.Ceiling(torporNeeded / (40 + 5 * torporDeplPS)); + // amount of BioToxines (give 80 each over 16s) + neededBioToxines = (int)Math.Ceiling(torporNeeded / (80 + 16 * torporDeplPS)); enoughFood = affinityNeeded <= 0; diff --git a/ARKBreedingStats/TamingControl.cs b/ARKBreedingStats/TamingControl.cs index 7683cd8f..f3b57d00 100644 --- a/ARKBreedingStats/TamingControl.cs +++ b/ARKBreedingStats/TamingControl.cs @@ -95,7 +95,7 @@ private void updateTamingData() { int sI = comboBoxSpecies.SelectedIndex; TimeSpan duration; - int narcoBerries, narcotics; + int narcoBerries, narcotics, bioToxines; double te; bool enoughFood; var usedFood = new List(); @@ -107,7 +107,7 @@ private void updateTamingData() foodAmount.Add(tfc.amount); tfc.maxFood = Taming.foodAmountNeeded(sI, (int)nudLevel.Value, tfc.foodName, Values.V.species[sI].taming.nonViolent); } - Taming.tamingTimes(sI, (int)nudLevel.Value, usedFood, foodAmount, out foodAmountUsed, out duration, out narcoBerries, out narcotics, out te, out enoughFood); + Taming.tamingTimes(sI, (int)nudLevel.Value, usedFood, foodAmount, out foodAmountUsed, out duration, out narcoBerries, out narcotics, out bioToxines, out te, out enoughFood); for (int f = 0; f < foodControls.Count; f++) { @@ -119,7 +119,7 @@ private void updateTamingData() int bonusLevel = (int)Math.Floor((double)nudLevel.Value * te / 2); labelResult.Text = "It takes " + duration.ToString(@"hh\:mm\:ss") + " (until " + (DateTime.Now + duration).ToShortTimeString() + ") to tame the " + comboBoxSpecies.SelectedItem.ToString() + "." + "\n\nTaming Effectiveness: " + Math.Round(100 * te, 1).ToString() + " %\nBonus-Level: " + bonusLevel + " (total level after Taming: " + (nudLevel.Value + bonusLevel).ToString() + ")" - + "\n\n" + narcoBerries + " Narcoberries or\n" + narcotics + " Narcotics are needed"; + + "\n\n" + narcoBerries + " Narcoberries or\n" + narcotics + " Narcotics or\n" + bioToxines + " Bio Toxines are needed"; } else labelResult.Text = "Not enough food to tame the creature!"; diff --git a/ARKBreedingStats/ver.txt b/ARKBreedingStats/ver.txt index 7714ad7e..4e893d63 100644 --- a/ARKBreedingStats/ver.txt +++ b/ARKBreedingStats/ver.txt @@ -1 +1 @@ -2530000,0.20.8.1 \ No newline at end of file +2530000,0.20.8.2 \ No newline at end of file