Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Nov 5, 2023
2 parents db8d137 + 79de83f commit 6d4d848
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 23 deletions.
3 changes: 2 additions & 1 deletion ARKBreedingStats/Extraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ public void ExtractLevels(Species species, int level, StatIO[] statIOs, double l

MinMaxDouble inputValue = new MinMaxDouble(statIOs[s].Input - toleranceForThisStat, statIOs[s].Input + toleranceForThisStat);
double statBaseValue = stats[s].BaseValue;
if (PostTamed && s == Stats.Health) statBaseValue *= (double)species.TamedBaseHealthMultiplier;// + 0.00000000001; // todo double-precision handling
if (PostTamed && s == Stats.Health && species.TamedBaseHealthMultiplier != null)
statBaseValue *= species.TamedBaseHealthMultiplier.Value;// + 0.00000000001; // todo double-precision handling

bool withTEff = (PostTamed && stats[s].MultAffinity > 0);
if (withTEff) { StatsWithTE.Add(s); }
Expand Down
6 changes: 4 additions & 2 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System.IO.Compression;
using System.Linq;
using System.Windows.Forms;
using ARKBreedingStats.importExportGun;
using ARKBreedingStats.mods;
using ARKBreedingStats.NamePatterns;
using ARKBreedingStats.utils;
Expand Down Expand Up @@ -462,7 +463,7 @@ private void Form1_Load(object sender, EventArgs e)
var filterPresets = Properties.Settings.Default.LibraryFilterPresets;
if (filterPresets != null)
ToolStripTextBoxLibraryFilter.AutoCompleteCustomSource.AddRange(filterPresets);

UpdateAsaIndicator();
UpdatePatternButtons();

Expand Down Expand Up @@ -2315,14 +2316,15 @@ private List<Species> DetermineSpeciesFromStats(double[] stats, string speciesNa
double baseValue;
double incWild;
double possibleLevel;
var tamedBaseHealthMultiplier = species.TamedBaseHealthMultiplier ?? 1;
for (int s = Stats.StatsCount - 1; s >= 0; s--)
{
baseValue = species.stats[s].BaseValue;
incWild = species.stats[s].IncPerWildLevel;
if (incWild > 0)
{
//possibleLevel = ((statIOs[s].Input - species.stats[s].AddWhenTamed) - baseValue) / (baseValue * incWild); // this fails if creature is wild
possibleLevel = (_statIOs[s].Input * (s == 0 && (species.TamedBaseHealthMultiplier ?? 1) < 1 ? 1 / species.TamedBaseHealthMultiplier.Value : 1) - baseValue) / (baseValue * incWild);
possibleLevel = (_statIOs[s].Input * (s == Stats.Health && tamedBaseHealthMultiplier < 1 ? 1 / tamedBaseHealthMultiplier : 1) - baseValue) / (baseValue * incWild);

if (possibleLevel < 0)
{
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.57.0.1")]
[assembly: AssemblyFileVersion("0.57.0.2")]
[assembly: NeutralResourcesLanguage("en")]

4 changes: 2 additions & 2 deletions ARKBreedingStats/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public static double CalculateValue(Species species, int stat, int levelWild, in
&& species.StatImprintMultipliers[stat] != 0
)
imprintingM = 1 + species.StatImprintMultipliers[stat] * imprintingBonus * Values.V.currentServerMultipliers.BabyImprintingStatScaleMultiplier;
if (stat == 0)
tamedBaseHP = (float)species.TamedBaseHealthMultiplier;
if (stat == Stats.Health)
tamedBaseHP = species.TamedBaseHealthMultiplier ?? 1;
}
//double result = Math.Round((species.stats[stat].BaseValue * tamedBaseHP * (1 + species.stats[stat].IncPerWildLevel * levelWild) * imprintingM + add) * domMult, Utils.precision(stat), MidpointRounding.AwayFromZero);
// double is too precise and results in wrong values due to rounding. float results in better values, probably ARK uses float as well.
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ARK Smart Breeding": {
"Id": "ARK Smart Breeding",
"Category": "main",
"version": "0.57.0.1"
"version": "0.57.0.2"
},
"SpeciesColorImages": {
"Id": "SpeciesColorImages",
Expand Down
23 changes: 14 additions & 9 deletions ARKBreedingStats/json/values/_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"mod": { "id": "1083349027", "tag": "SpeedyFlyers", "title": "Najs Speedy Flyers" }
},
"1090809604-Pyria.json": {
"version": "358.11.1693620638",
"version": "358.17.1697371762",
"mod": { "id": "1090809604", "tag": "Pyria", "title": "Pyria: Mythos Evolved" }
},
"1092784125-Gryphons.json": {
Expand Down Expand Up @@ -72,7 +72,7 @@
"mod": { "id": "1356703358", "tag": "Primal_Fear_Noxious_Creatures", "title": "Primal Fear Noxious Creatures" }
},
"1373744537-AC2.json": {
"version": "358.11.1695149665",
"version": "358.17.1696878102",
"mod": { "id": "1373744537", "tag": "AC2", "title": "Additional Creatures 2: Wild Ark" }
},
"1379111008-RealismPlus.json": {
Expand Down Expand Up @@ -108,15 +108,15 @@
"mod": { "id": "1522327484", "tag": "Additions_Pack", "title": "ARK Additions!" }
},
"1523045986-Paranoia.json": {
"version": "357.4.1679444826",
"version": "358.17.1698793027",
"mod": { "id": "1523045986", "tag": "Paranoia", "title": "Additional Creatures 2: Paranoia!" }
},
"1558114752-Radioactive.json": {
"version": "358.11.1616346857",
"mod": { "id": "1558114752", "tag": "Radioactive", "title": "Dino Hybrids & more!" }
},
"1565015734-BetterDinosTest.json": {
"version": "356.12.1659982227",
"version": "358.17.1698789125",
"mod": { "id": "1565015734", "tag": "BetterDinosTest", "title": "Better Dinos" }
},
"1576299694-ElementalDinos.json": {
Expand Down Expand Up @@ -153,7 +153,7 @@
"mod": { "id": "1662691167", "tag": "Senior", "title": "Additional Creatures: Senior Class" }
},
"1675895024-NoUntameables.json": {
"version": "358.11.1695172002",
"version": "358.17.1697910148",
"mod": { "id": "1675895024", "tag": "NoUntameables", "title": "No Untameables" }
},
"1676159020-Aquaria.json": {
Expand Down Expand Up @@ -247,7 +247,7 @@
"mod": { "id": "1934081600", "tag": "SoloFarmAnky", "title": "Solo Farm Mod" }
},
"1979037318-IceWyverns.json": {
"version": "358.11.1695151363",
"version": "358.17.1696373342",
"mod": { "id": "1979037318", "tag": "IceWyverns", "title": "Shads Critter Reworks" }
},
"1984129536-MTSMod.json": {
Expand Down Expand Up @@ -311,7 +311,7 @@
"mod": { "id": "2362246280", "tag": "GigaFullTame", "title": "Giga Full Tame" }
},
"2447186973-ArkOmega.json": {
"version": "358.11.1695446237",
"version": "358.17.1697907008",
"mod": { "id": "2447186973", "tag": "ArkOmega", "title": "Ark Omega" }
},
"2453342929-MoreDragonsMod.json": {
Expand Down Expand Up @@ -351,7 +351,7 @@
"mod": { "id": "2902657380", "tag": "Dinohunterworld", "title": "Dino Hunter World" }
},
"2953890191-ExtraAberrantVariants.json": {
"version": "358.11.1693427566",
"version": "358.17.1696339026",
"mod": { "id": "2953890191", "tag": "ExtraAberrantVariants", "title": "Extra Aberrant Variants" }
},
"3035755339-PortsOfAtlas.json": {
Expand Down Expand Up @@ -379,7 +379,7 @@
"mod": { "id": "883957187", "tag": "WyvernWorld", "title": "Wyvern World" }
},
"893735676-AE.json": {
"version": "358.10.1691991018",
"version": "358.17.1696662074",
"mod": { "id": "893735676", "tag": "AE", "title": "Ark Eternal" }
},
"895711211-ClassicFlyers.json": {
Expand All @@ -398,6 +398,11 @@
"version": "340.3.1532328552",
"mod": { "id": "919470289", "tag": "SSFlyer", "title": "SSFlyer" }
},
"ASA-values.json": {
"version": "25.53.449745",
"format": "1.15-asa",
"mod": { "id": "ASA", "tag": "", "title": "Ark: Survival Ascended" }
},
"CrystalIsles-CrystalIsles.json": {
"version": "345.39.8870324.1",
"mod": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ public bool Percent
/// <summary>
/// Taming Bonus Health Multiplier
/// </summary>
public float? TBHM
public float TBHM
{
set => nudTBHM.Value = value != null ? (decimal)value : 1;
set => nudTBHM.Value = (decimal)value;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public void SetSpecies(Species species, bool forceUpdate = false)
_statControls[s].Visible = species.UsesStat(s);
_statControls[s].StatName = $"[{s}]{Utils.StatName(s, true, species.statNames)}";
}
_statControls[Stats.Health].TBHM = _selectedSpecies.TamedBaseHealthMultiplier;
_statControls[Stats.Health].TBHM = _selectedSpecies.TamedBaseHealthMultiplier ?? 1;
}

private void btUpdateSpecies_Click(object sender, EventArgs e)
Expand Down
5 changes: 1 addition & 4 deletions ARKBreedingStats/species/Species.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,7 @@ private void Initialize(StreamingContext _)

if (fullStatsRawLength != -0)
fullStatsRaw = completeRaws;

if (TamedBaseHealthMultiplier == null)
TamedBaseHealthMultiplier = 1;


if (colors?.Length == 0)
colors = null;
if (colors != null && colors.Length < Ark.ColorRegionCount)
Expand Down

0 comments on commit 6d4d848

Please sign in to comment.