private void UpdateTamingData() { if (!updateCalculation || selectedSpecies == null) { return; } if (selectedSpecies.taming == null) { NoTamingData(); return; } this.Enabled = true; UpdateKOCounting(); TimeSpan duration = new TimeSpan(); int narcoBerries = 0, narcotics = 0, bioToxines = 0, bonusLevel = 0; double te = 0; neededHunger = 0; bool enoughFood = false; var usedFood = new List <string>(); var foodAmount = new List <int>(); var foodAmountUsed = new List <int>(); quickTamingInfos = "n/a"; int level = (int)nudLevel.Value; if (selectedSpecies.taming.eats != null) { int foodCounter = selectedSpecies.taming.eats.Count; foreach (TamingFoodControl tfc in foodControls) { if (foodCounter == 0) { break; } foodCounter--; usedFood.Add(tfc.FoodName); foodAmount.Add(tfc.amount); tfc.maxFood = Taming.FoodAmountNeeded(selectedSpecies, level, tamingSpeedMultiplier, tfc.FoodName, selectedSpecies.taming.nonViolent); tfc.tamingDuration = Taming.TamingDuration(selectedSpecies, tfc.maxFood, tfc.FoodName, tamingFoodRateMultiplier, selectedSpecies.taming.nonViolent); } Taming.TamingTimes(selectedSpecies, level, tamingSpeedMultiplier, tamingFoodRateMultiplier, usedFood, foodAmount, out foodAmountUsed, out duration, out narcoBerries, out narcotics, out bioToxines, out te, out neededHunger, out bonusLevel, out enoughFood); for (int f = 0; f < foodAmountUsed.Count; f++) { foodControls[f].foodUsed = foodAmountUsed[f]; } } if (enoughFood) { labelResult.Text = $"It takes {Utils.durationUntil(duration)} to tame the {selectedSpecies.name}.\n\n" + $"Taming Effectiveness: {Math.Round(100 * te, 1)} %\n" + $"Bonus-Level: +{bonusLevel} (total level after Taming: {(nudLevel.Value + bonusLevel)})\n\n" + $"Food has to drop by {neededHunger:F1} units.\n\n" + $"{narcoBerries} Narcoberries or\n" + $"{narcotics} Narcotics or\n" + $"{bioToxines} Bio Toxines are needed{firstFeedingWaiting}"; labelResult.Text += kibbleRecipe; } else if (foodAmountUsed.Count == 0) { labelResult.Text = Loc.s("noTamingData"); } else { labelResult.Text = Loc.s("notEnoughFoodToTame"); } numericUpDownCurrentTorpor.ValueSave = (decimal)(selectedSpecies.stats[(int)StatNames.Torpidity].BaseValue * (1 + selectedSpecies.stats[(int)StatNames.Torpidity].IncPerWildLevel * (level - 1))); nudTotalFood.Value = (decimal)(selectedSpecies.stats[(int)StatNames.Food].BaseValue * (1 + selectedSpecies.stats[(int)StatNames.Food].IncPerWildLevel * (level / 7))); // approximating the food level nudCurrentFood.Value = nudTotalFood.Value; UpdateTimeToFeedAll(enoughFood); //// quicktame infos if (foodAmountUsed.Count > 0) { quickTamingInfos = Taming.QuickInfoOneFood(selectedSpecies, level, tamingSpeedMultiplier, tamingFoodRateMultiplier, foodControls[0].FoodName, foodControls[0].maxFood, foodControls[0].foodNameDisplay); // show raw meat or mejoberries as alternative (often used) for (int i = 1; i < usedFood.Count; i++) { if (usedFood[i] == "Raw Meat" || usedFood[i] == "Mejoberry") { quickTamingInfos += "\n\n" + Taming.QuickInfoOneFood(selectedSpecies, level, tamingSpeedMultiplier, tamingFoodRateMultiplier, foodControls[i].FoodName, foodControls[i].maxFood, foodControls[i].foodNameDisplay); break; } } quickTamingInfos += "\n\n" + koNumbers + "\n\n" + boneDamageAdjustersImmobilization + firstFeedingWaiting + kibbleRecipe; } }