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 4, 2023
2 parents 8fad058 + 0f6e7bd commit db8d137
Show file tree
Hide file tree
Showing 30 changed files with 485 additions and 133 deletions.
30 changes: 24 additions & 6 deletions ARKBreedingStats/Ark.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.Linq;
using ARKBreedingStats.species;

namespace ARKBreedingStats
namespace ARKBreedingStats
{
/// <summary>
/// Constants of the game Ark.
Expand Down Expand Up @@ -92,8 +89,7 @@ public static class Ark
#region Colors

public const byte ColorFirstId = 1;
public const byte ColorMaxId = 200;
public const byte DyeFirstId = 201;
public const byte DyeFirstIdASE = 201;
public const byte DyeMaxId = 255;
/// <summary>
/// When choosing a random color for a mutation, ARK can erroneously select an undefined color. Usually this is color id 227 (one too high to be defined).
Expand All @@ -111,6 +107,28 @@ public static class Ark
/// The name is trimmed to this length in game.
/// </summary>
public const int MaxCreatureNameLength = 24;

public enum Game
{
/// <summary>
/// ARK: Survival Evolved (2015)
/// </summary>
ASE,
/// <summary>
/// ARK: Survival Ascended (2023)
/// </summary>
ASA
}

/// <summary>
/// Collection indicator for ARK: Survival Evolved.
/// </summary>
public const string Ase = "ASE";

/// <summary>
/// Collection indicator for ARK: Survival Ascended, also the mod tag id for the ASA values.
/// </summary>
public const string Asa = "ASA";
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/BreedingPlanning/BreedingPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ private void SetBestLevels(int[] bestLevels, IEnumerable<Creature> creatures, bo
: string.Format(Loc.S(bestInSpecies ? "BestPossibleSpeciesLibrary" : "BestPossibleSpeciesLibraryFiltered"), _currentSpecies.name);

Creature crB = new Creature(_currentSpecies, bestLevelsOfWhat,
null, null, 0, new int[Stats.StatsCount], null, 1, true, levelStep: levelStep);
null, null, 0, new int[Stats.StatsCount], null, null, 1, true, levelStep: levelStep);
bool totalLevelUnknown = false;
for (int s = 0; s < Stats.StatsCount; s++)
{
Expand Down
8 changes: 5 additions & 3 deletions ARKBreedingStats/Extraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public void ExtractLevels(Species species, int level, StatIO[] statIOs, double l
if (imprintingBonusList == null)
imprintingBonusList = new List<MinMaxDouble> { new MinMaxDouble(0) };

double[] statImprintMultipliers = species.StatImprintMultipliers;

for (int IBi = 0; IBi < imprintingBonusList.Count; IBi++)
{
_imprintingBonusRange = imprintingBonusList[IBi];
Expand All @@ -133,7 +135,7 @@ public void ExtractLevels(Species species, int level, StatIO[] statIOs, double l
var imprintingMultiplierRanges = new MinMaxDouble[Stats.StatsCount];
for (int s = 0; s < Stats.StatsCount; s++)
{
double statImprintingMultiplier = species.StatImprintMultipliers[s];
double statImprintingMultiplier = statImprintMultipliers[s];
imprintingMultiplierRanges[s] = statImprintingMultiplier != 0
? new MinMaxDouble(1 + _imprintingBonusRange.Min * imprintingBonusMultiplier * statImprintingMultiplier,
1 + _imprintingBonusRange.Max * imprintingBonusMultiplier * statImprintingMultiplier)
Expand Down Expand Up @@ -237,7 +239,7 @@ public void ExtractLevels(Species species, int level, StatIO[] statIOs, double l

MinMaxDouble statImprintingMultiplierRange = new MinMaxDouble(1);
// only use imprintingMultiplier for stats that use them. Stamina and Oxygen don't use ist. Sometimes speed neither.
if (bred && species.StatImprintMultipliers[s] != 0)
if (bred && statImprintMultipliers[s] != 0)
statImprintingMultiplierRange = imprintingMultiplierRanges[s].Clone();

// if dom levels have no effect, just calculate the wild level
Expand Down Expand Up @@ -268,7 +270,7 @@ public void ExtractLevels(Species species, int level, StatIO[] statIOs, double l
}

bool resultWasSortedOutBecauseOfImpossibleTe = false;
for (int lw = minLW; lw < maxLW + 1; lw++)
for (int lw = minLW; lw <= maxLW; lw++)
{
// imprinting bonus is applied to all stats except stamina (s==1) and oxygen (s==2) and speed (s==6)
MinMaxDouble valueWODomRange = new MinMaxDouble(statBaseValue * (1 + stats[s].IncPerWildLevel * lw) * statImprintingMultiplierRange.Min + (PostTamed ? stats[s].AddWhenTamed : 0),
Expand Down
31 changes: 25 additions & 6 deletions ARKBreedingStats/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ARKBreedingStats/Form1.collection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = fal
speciesSelector1.SetSpecies(_creatureCollection.creatures[0].Species);

// set library species to what it was before loading
selectedLibrarySpecies = Values.V.SpeciesByBlueprint(selectedLibrarySpecies?.blueprintPath);
if (selectedLibrarySpecies != null)
listBoxSpeciesLib.SelectedItem = selectedLibrarySpecies;
else if (Properties.Settings.Default.LibrarySelectSelectedSpeciesOnLoad)
Expand Down
Loading

0 comments on commit db8d137

Please sign in to comment.