This commit is contained in:
Stardust3D 2022-01-22 15:02:58 +01:00
parent eeb61f1faa
commit 34522848ea
10 changed files with 135 additions and 126 deletions

View file

@ -54,20 +54,20 @@ namespace RJW_patch_Autopsy
//rjwArtificialThings.Count(), rjwNaturalDiffs.Count(), rjwArtificialThings.Count(), rjwArtificialDiffs.Count()));
//Simulate success chance scaled with skill etc.
rjwNaturalThings.ToList().ForEach(t =>
rjwNaturalThings.ForEach(t =>
{
if (Rand.Chance(Math.Min(skillChance, recipeInfo.NaturalChance))) results.Add(t);
});
rjwArtificialThings.ToList().ForEach(t =>
rjwArtificialThings.ForEach(t =>
{
if (Rand.Chance(Math.Min(skillChance, recipeInfo.BionicChance))) results.Add(t);
});
//Remove all parts that were tried to harves from the corpse
rjwNaturalDiffs.ToList().ForEach(d => corpse.InnerPawn.health.RemoveHediff(d));
rjwArtificialDiffs.ToList().ForEach(d => corpse.InnerPawn.health.RemoveHediff(d));
//Remove all parts that were tried to harvest from the corpse
rjwNaturalDiffs.ForEach(d => corpse.InnerPawn.health.RemoveHediff(d));
rjwArtificialDiffs.ForEach(d => corpse.InnerPawn.health.RemoveHediff(d));
if (results.Count() > recipeInfo.PartNumber)
if (results.Count > recipeInfo.PartNumber)
{
var random = new Random();
__result = results.OrderBy(i => random.Next()).Take(recipeInfo.PartNumber);