Skip to content

Commit

Permalink
added taming option Sanguine Elixir
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed May 7, 2023
1 parent fe34aa6 commit 976f32d
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 266 deletions.
1 change: 1 addition & 0 deletions ARKBreedingStats/ARKBreedingStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@
</EmbeddedResource>
<EmbeddedResource Include="TamingControl.resx">
<DependentUpon>TamingControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="TamingFoodControl.resx">
<DependentUpon>TamingFoodControl.cs</DependentUpon>
Expand Down
12 changes: 6 additions & 6 deletions ARKBreedingStats/Taming.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class Taming

public static void TamingTimes(Species species, int level, double tamingSpeedMultiplier, double tamingFoodRateMultiplier,
List<string> usedFood, List<int> foodAmount, out List<int> foodAmountUsed, out TimeSpan duration,
out int neededNarcoberries, out int neededAscerbicMushrooms, out int neededNarcotics, out int neededBioToxins, out double te, out double hunger, out int bonusLevel, out bool enoughFood)
out int neededNarcoberries, out int neededAscerbicMushrooms, out int neededNarcotics, out int neededBioToxins, out double te, out double hunger, out int bonusLevel, out bool enoughFood, bool useSanguineElixir = false)
{
double totalTorpor = 0;
double torporDepletionPerSecond = 0;
Expand All @@ -41,7 +41,7 @@ public static void TamingTimes(Species species, int level, double tamingSpeedMul
if (species != null && species.taming != null)
{

double affinityNeeded = species.taming.affinityNeeded0 + species.taming.affinityIncreasePL * level;
double affinityNeeded = (species.taming.affinityNeeded0 + species.taming.affinityIncreasePL * level) * (useSanguineElixir ? 0.7 : 1);

// test if creature is tamed non-violently, then use wakeTame multipliers
if (!species.taming.nonViolent)
Expand Down Expand Up @@ -147,19 +147,19 @@ public static void TamingTimes(Species species, int level, double tamingSpeedMul
public static void TamingTimes(Species species, int level, double tamingSpeedMultiplier, double tamingFoodRateMultiplier,
string usedFood, int foodAmount,
out List<int> foodAmountUsed, out TimeSpan duration, out int neededNarcoberries, out int neededAscerbicMushrooms, out int neededNarcotics,
out int neededBioToxins, out double te, out double hunger, out int bonusLevel, out bool enoughFood)
out int neededBioToxins, out double te, out double hunger, out int bonusLevel, out bool enoughFood, bool useSanguineElixir = false)
{
TamingTimes(species, level, tamingSpeedMultiplier, tamingFoodRateMultiplier,
new List<string> { usedFood }, new List<int> { foodAmount },
out foodAmountUsed, out duration, out neededNarcoberries, out neededAscerbicMushrooms, out neededNarcotics, out neededBioToxins,
out te, out hunger, out bonusLevel, out enoughFood);
out te, out hunger, out bonusLevel, out enoughFood, useSanguineElixir);
}

public static int FoodAmountNeeded(Species species, int level, double tamingSpeedMultiplier, string foodName, bool nonViolent = false)
public static int FoodAmountNeeded(Species species, int level, double tamingSpeedMultiplier, string foodName, bool nonViolent = false, bool useSanguineElixir = false)
{
if (species != null)
{
double affinityNeeded = species.taming.affinityNeeded0 + species.taming.affinityIncreasePL * level;
double affinityNeeded = (species.taming.affinityNeeded0 + species.taming.affinityIncreasePL * level) * (useSanguineElixir ? 0.7 : 1);

var food = Values.V.GetTamingFood(species, foodName);
if (food == null) return 0;
Expand Down
Loading

0 comments on commit 976f32d

Please sign in to comment.