Skip to content

Commit

Permalink
format fixes for level-export. added option to enable oxygen-input fo…
Browse files Browse the repository at this point in the history
…r species that don't use that stat (useful for mods that enable it). added taming-stacks for the kraken.
  • Loading branch information
cadaei committed Feb 19, 2017
1 parent b8daba6 commit b04a4ff
Show file tree
Hide file tree
Showing 23 changed files with 151 additions and 106 deletions.
2 changes: 1 addition & 1 deletion ARKBreedingStats/ARKBreedingStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
<DependentUpon>StatWeighting.cs</DependentUpon>
</Compile>
<Compile Include="Taming.cs" />
<Compile Include="TamingFood.cs" />
<Compile Include="species\TamingFood.cs" />
<Compile Include="TamingFoodControl.cs">
<SubType>UserControl</SubType>
</Compile>
Expand Down
3 changes: 3 additions & 0 deletions ARKBreedingStats/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
<setting name="lastSpecies" serializeAs="String">
<value />
</setting>
<setting name="oxygenForAll" serializeAs="String">
<value>False</value>
</setting>
</ARKBreedingStats.Properties.Settings>
</userSettings>
</configuration>
21 changes: 14 additions & 7 deletions ARKBreedingStats/Extraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,30 @@ class Extraction
{
private static Extraction _extraction;
public List<StatResult>[] results = new List<StatResult>[8]; // stores the possible results of all stats as array (wildlevel, domlevel, tamingEff)
public int[] chosenResults = new int[8];
public bool[] fixedResults = new bool[8];
public List<int> statsWithEff = new List<int>();
public int[] chosenResults;
public bool[] fixedResults;
public List<int> statsWithEff;
public bool validResults;
public bool postTamed;
public bool justTamed;
public int[] levelDomFromTorporAndTotalRange = new int[] { 0, 0 }, levelWildFromTorporRange = new int[] { 0, 0 }; // 0: min, 1: max
public int[] lowerBoundWilds = new int[8], lowerBoundDoms = new int[8], upperBoundDoms = new int[8];
public int[] lowerBoundWilds, lowerBoundDoms, upperBoundDoms;
public int wildFreeMax = 0, domFreeMin = 0, domFreeMax = 0; // unassigned levels
public double imprintingBonus;
public bool[] activeStats;

public Extraction()
{
fixedResults = new bool[8];
chosenResults = new int[8];
statsWithEff = new List<int>();
lowerBoundWilds = new int[8];
lowerBoundDoms = new int[8];
upperBoundDoms = new int[8];
activeStats = new bool[8];

for (int s = 0; s < 8; s++)
{
chosenResults[s] = 0;
fixedResults[s] = false;
results[s] = new List<StatResult>();
}
}
Expand Down Expand Up @@ -245,7 +252,7 @@ public void extractLevels(int speciesI, int level, List<StatIO> statIOs, double
// check all possible level-combinations
for (int s = 0; s < 8; s++)
{
if (Values.V.species[speciesI].stats[s].BaseValue > 0) // if stat is used (oxygen sometimes is not)
if (Values.V.species[speciesI].stats[s].BaseValue > 0 && activeStats[s]) // if stat is used (oxygen sometimes is not)
{
statIOs[s].postTame = postTamed;
double inputValue = statIOs[s].Input;
Expand Down
13 changes: 8 additions & 5 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ private void Form1_Load(object sender, EventArgs e)
cbbStatTestingSpecies.SelectedIndex = selectedSpecies;
}

Extraction.E.activeStats = activeStats;

clearAll();
// UI loaded

Expand Down Expand Up @@ -743,7 +745,7 @@ private void comboBoxCreatures_SelectedIndexChanged(object sender, EventArgs e)
sE = comboBoxSpeciesExtractor.SelectedIndex;
for (int s = 0; s < 8; s++)
{
activeStats[s] = (Values.V.species[sE].stats[s].BaseValue > 0);
activeStats[s] = (Values.V.species[sE].stats[s].BaseValue > 0) && (s != 2 || !Values.V.species[sE].doesNotUseOxygen || Properties.Settings.Default.oxygenForAll);
statIOs[s].Enabled = activeStats[s];
}
creatureInfoInputExtractor.SpeciesIndex = sE;
Expand Down Expand Up @@ -1002,8 +1004,7 @@ private void initializeCollection()
breedingPlan1.maxSuggestions = creatureCollection.maxBreedingSuggestions;
tribesControl1.Tribes = creatureCollection.tribes;
tribesControl1.Players = creatureCollection.players;
timerList1.TimerListEntries = creatureCollection.timerListEntries;
timerList1.Creatures = creatureCollection.creatures;
timerList1.CreatureCollection = creatureCollection;
}

private void applySettingsToValues()
Expand Down Expand Up @@ -2378,13 +2379,15 @@ private void exportAsTextToClipboard(Creature c, bool breeding = true, bool ARKm
if (c != null)
{
double colorFactor = 100d / creatureCollection.maxChartLevel;
string output = (ARKml ? Utils.getARKml(c.species, 50, 172, 255) : c.species) + " (Lvl " + (breeding ? c.levelHatched : c.level) + (breeding || c.tamingEff == 1 ? "" : ", TE: " + Math.Round(100 * c.tamingEff, 1) + "%") + (breeding || c.imprintingBonus == 0 ? "" : ", Impr: " + Math.Round(100 * c.imprintingBonus) + "%") + (c.gender != Sex.Unknown ? ", " + c.gender.ToString() : "") + "): ";
string output = (ARKml ? Utils.getARKml(c.species, 50, 172, 255) : c.species)
+ " (Lvl " + (breeding ? c.levelHatched : c.level) + (breeding || c.tamingEff == 1 ? "" : ", TE: " + Math.Round(100 * c.tamingEff, 1) + "%")
+ (breeding || c.imprintingBonus == 0 ? "" : ", Impr: " + Math.Round(100 * c.imprintingBonus, 2) + "%") + (c.gender != Sex.Unknown ? ", " + c.gender.ToString() : "") + "): ";
for (int s = 0; s < 8; s++)
{
if (c.levelsWild[s] >= 0) // ignore unknown oxygen / speed
output += Utils.statName(s, true) + ": " + ((breeding ? c.valuesBreeding[s] : c.valuesDom[s]) * (Utils.precision(s) == 3 ? 100 : 1)) + (Utils.precision(s) == 3 ? "%" : "") +
" (" + (ARKml ? Utils.getARKmlFromPercent(c.levelsWild[s].ToString(), (int)(c.levelsWild[s] * (s == 7 ? colorFactor / 7 : colorFactor))) : c.levelsWild[s].ToString()) +
(ARKml ? (breeding || s == 7 ? "" : ", " + Utils.getARKmlFromPercent(c.levelsDom[s].ToString(), (int)(c.levelsDom[s] * colorFactor))) : ", " + c.levelsDom[s].ToString()) + "); ";
(ARKml ? (breeding || s == 7 ? "" : ", " + Utils.getARKmlFromPercent(c.levelsDom[s].ToString(), (int)(c.levelsDom[s] * colorFactor))) : (breeding || s == 7 ? "" : ", " + c.levelsDom[s].ToString())) + "); ";
}
Clipboard.SetText(output.Substring(0, output.Length - 1));
}
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.21.3")]
[assembly: AssemblyFileVersion("0.21.4")]
12 changes: 12 additions & 0 deletions ARKBreedingStats/Properties/Settings.Designer.cs

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

3 changes: 3 additions & 0 deletions ARKBreedingStats/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@
<Setting Name="lastSpecies" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="oxygenForAll" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
4 changes: 1 addition & 3 deletions ARKBreedingStats/RadarChart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ public void initializeVariables(int maxLevel)
maxPs = new List<Point>();
ps = new List<Point>();
oldLevels = new int[7];
int r = 0;
for (int s = 0; s < 7; s++)
{
int r = oldLevels[s] * maxR / maxLevel;
if (r < 0) r = 0;
if (r > maxR) r = maxR;
double angle = angleSeven * s - offset;
ps.Add(new Point(xm + (int)(r * Math.Cos(angle)), ym + (int)(r * Math.Sin(angle))));

Expand Down
62 changes: 45 additions & 17 deletions ARKBreedingStats/Settings.Designer.cs

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

Loading

0 comments on commit b04a4ff

Please sign in to comment.