Skip to content

Commit 36c5fd3

Browse files
committed
Merge branch 'dev'
2 parents ca99f6e + a3a047e commit 36c5fd3

30 files changed

+941
-87
lines changed

ARKBreedingStats/ARKBreedingStats.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
<Compile Include="library\DummyCreatures.cs" />
106106
<Compile Include="library\LevelStatusFlags.cs" />
107107
<Compile Include="multiplierTesting\CalculateMultipliers.cs" />
108+
<Compile Include="multiplierTesting\TaTmSolver.cs" />
108109
<Compile Include="NamePatterns\NameList.cs" />
109110
<Compile Include="NamePatterns\NamePatternEntry.cs">
110111
<SubType>Component</SubType>

ARKBreedingStats/Ark.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,5 +232,25 @@ public static class Stats
232232
false, //TemperatureFortitude,
233233
false, //CraftingSpeedMultiplier
234234
};
235+
236+
/// <summary>
237+
/// Returns if the stat is a percentage value.
238+
/// </summary>
239+
public static bool IsPercentage(int statIndex)
240+
{
241+
return statIndex == MeleeDamageMultiplier
242+
|| statIndex == SpeedMultiplier
243+
|| statIndex == TemperatureFortitude
244+
|| statIndex == CraftingSpeedMultiplier;
245+
}
246+
247+
/// <summary>
248+
/// Returns the displayed decimal values of the stat with the given index
249+
/// </summary>
250+
public static int Precision(int statIndex)
251+
{
252+
// damage and speed are percentage values and thus the displayed values have a higher precision
253+
return IsPercentage(statIndex) ? 3 : 1;
254+
}
235255
}
236256
}

ARKBreedingStats/Extraction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public void ExtractLevels(Species species, int level, StatIO[] statIOs, double l
186186
statIOs[s].postTame = PostTamed;
187187

188188
// determine the precision of the input value
189-
float toleranceForThisStat = StatValueCalculation.DisplayedAberration(statIOs[s].Input, Utils.Precision(s), highPrecisionInputs);
189+
float toleranceForThisStat = StatValueCalculation.DisplayedAberration(statIOs[s].Input, Stats.Precision(s), highPrecisionInputs);
190190
//Console.WriteLine($"Precision stat {s}: {toleranceForThisStat}");
191191

192192
MinMaxDouble inputValue = new MinMaxDouble(statIOs[s].Input - toleranceForThisStat, statIOs[s].Input + toleranceForThisStat);

ARKBreedingStats/Form1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public Form1()
214214
statIndex = s
215215
};
216216

217-
if (Utils.Precision(s) == 3)
217+
if (Stats.IsPercentage(s))
218218
{
219219
statIo.Percent = true;
220220
statIoTesting.Percent = true;

ARKBreedingStats/NamePatterns/NamePattern.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ public static Dictionary<string, string> CreateTokenDictionary(Creature creature
355355
for (int s = 0; s < Stats.StatsCount; s++)
356356
{
357357
dict.Add(StatAbbreviationFromIndex[s], creature.levelsWild[s].ToString());
358-
dict.Add($"{StatAbbreviationFromIndex[s]}_vb", (creature.valuesBreeding[s] * (Utils.Precision(s) == 3 ? 100 : 1)).ToString());
358+
dict.Add($"{StatAbbreviationFromIndex[s]}_vb", (creature.valuesBreeding[s] * (Stats.IsPercentage(s) ? 100 : 1)).ToString());
359359
dict.Add($"istop{StatAbbreviationFromIndex[s]}", speciesTopLevels == null ? (creature.levelsWild[s] > 0 ? "1" : string.Empty) :
360360
creature.levelsWild[s] >= speciesTopLevels[s] ? "1" : string.Empty);
361361
dict.Add($"isnewtop{StatAbbreviationFromIndex[s]}", speciesTopLevels == null ? (creature.levelsWild[s] > 0 ? "1" : string.Empty) :

ARKBreedingStats/Pedigree/PedigreeCreature.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ public Creature Creature
208208
_labels[s].BackColor = Color.WhiteSmoke;
209209
_labels[s].ForeColor = Color.LightGray;
210210
_ttMonospaced.SetToolTip(_labels[s], Utils.StatName(si, false, _creature.Species?.statNames) + ": "
211-
+ $"{_creature.valuesBreeding[si] * (Utils.Precision(si) == 3 ? 100 : 1),7:#,0.0}"
212-
+ (Utils.Precision(si) == 3 ? "%" : string.Empty));
211+
+ $"{_creature.valuesBreeding[si] * (Stats.IsPercentage(si) ? 100 : 1),7:#,0.0}"
212+
+ (Stats.IsPercentage(si) ? "%" : string.Empty));
213213
}
214214
else
215215
{
@@ -234,8 +234,8 @@ public Creature Creature
234234
_labels[s].BackColor = Utils.GetColorFromPercent((int)(_creature.levelsWild[si] * 2.5), _creature.IsTopStat(si) ? 0.2 : 0.7);
235235
_labels[s].ForeColor = Parent?.ForeColor ?? Color.Black; // needed so text is not transparent on overlay
236236
_ttMonospaced.SetToolTip(_labels[s], Utils.StatName(si, false, _creature.Species?.statNames) + ": "
237-
+ $"{_creature.valuesBreeding[si] * (Utils.Precision(si) == 3 ? 100 : 1),7:#,0.0}"
238-
+ (Utils.Precision(si) == 3 ? "%" : string.Empty)
237+
+ $"{_creature.valuesBreeding[si] * (Stats.IsPercentage(si) ? 100 : 1),7:#,0.0}"
238+
+ (Stats.IsPercentage(si) ? "%" : string.Empty)
239239
+ (_creature.levelsMutated == null ? string.Empty
240240
: Environment.NewLine + Loc.S("Mutations") + ": " + _creature.levelsMutated[si]
241241
));

ARKBreedingStats/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
// Revision
3131
//
3232
[assembly: AssemblyVersion("1.0.0.0")]
33-
[assembly: AssemblyFileVersion("0.61.3.0")]
33+
[assembly: AssemblyFileVersion("0.61.4.0")]
3434
[assembly: NeutralResourcesLanguage("en")]
3535

ARKBreedingStats/Stats.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static double CalculateValue(Species species, int stat, int levelWild, in
4848
if (result <= 0) return 0;
4949

5050
if (roundToIngamePrecision)
51-
return Math.Round(result, Utils.Precision(stat), MidpointRounding.AwayFromZero);
51+
return Math.Round(result, Stats.Precision(stat), MidpointRounding.AwayFromZero);
5252

5353
return result;
5454
}

ARKBreedingStats/Utils.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,15 +390,6 @@ public static string StatName(int statIndex, bool abbreviation = false, Dictiona
390390
return abbreviation ? _statNamesAbb[statIndex] : _statNames[statIndex];
391391
}
392392

393-
/// <summary>
394-
/// Returns the displayed decimal values of the stat with the given index
395-
/// </summary>
396-
public static int Precision(int statIndex)
397-
{
398-
// damage and speed are percentage values, need more precision
399-
return (statIndex == Stats.SpeedMultiplier || statIndex == Stats.MeleeDamageMultiplier || statIndex == Stats.CraftingSpeedMultiplier) ? 3 : 1;
400-
}
401-
402393
/// <summary>
403394
/// String that represents a duration.
404395
/// </summary>

ARKBreedingStats/_manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"ARK Smart Breeding": {
55
"Id": "ARK Smart Breeding",
66
"Category": "main",
7-
"version": "0.61.3.0"
7+
"version": "0.61.4.0"
88
},
99
"SpeciesColorImages": {
1010
"Id": "SpeciesColorImages",

0 commit comments

Comments
 (0)