Skip to content

Commit

Permalink
fix for level-bar-maxWidth. fix for setting multipliers to official v…
Browse files Browse the repository at this point in the history
…alues. fix of too many decimals of imprintingBonus. fix for cuddleIntervall-Setting, also increase decimals to 3.
  • Loading branch information
cadaei committed Jan 8, 2017
1 parent 3970d05 commit fac9218
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 56 deletions.
6 changes: 5 additions & 1 deletion ARKBreedingStats/Extraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ public void extractLevels(int speciesI, int level, List<StatIO> statIOs, double
if (imprintingBonusRounded == 1)
imprintingBonus = 1;
else if (Values.V.species[speciesI].breeding != null && Values.V.species[speciesI].breeding.maturationTimeAdjusted > 0)
imprintingBonus = Math.Round(imprintingBonusRounded * Values.V.species[speciesI].breeding.maturationTimeAdjusted * cuddleIntervalMultiplier / 14400) * 14400 / (Values.V.species[speciesI].breeding.maturationTimeAdjusted * cuddleIntervalMultiplier);
{
imprintingBonus = Math.Round(Math.Round(imprintingBonusRounded * Values.V.species[speciesI].breeding.maturationTimeAdjusted / (14400 * cuddleIntervalMultiplier)) * 14400 * cuddleIntervalMultiplier / (Values.V.species[speciesI].breeding.maturationTimeAdjusted), 4);
if (imprintingBonus > 1)
imprintingBonus = 1;
}
else
imprintingBonus = 0;
double imprintingMultiplier = (1 + imprintingBonus * imprintingBonusMultiplier * .2);
Expand Down
19 changes: 12 additions & 7 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private void Form1_Load(object sender, EventArgs e)

// check for updates
DateTime lastUpdateCheck = Properties.Settings.Default.lastUpdateCheck;
if (DateTime.Now.AddDays(-7) > lastUpdateCheck)
if (DateTime.Now.AddDays(-3) > lastUpdateCheck)
checkForUpdates(true);

//// TODO: debug-numbers
Expand Down Expand Up @@ -479,7 +479,7 @@ private void extractionFailed()
labelErrorHelp.Visible = true;
groupBoxPossibilities.Visible = false;
labelDoc.Visible = false;
if (numericUpDownImprintingBonusExtractor.Value > 0)
if (checkBoxAlreadyBred.Checked && numericUpDownImprintingBonusExtractor.Value > 0)
labelImprintingFailInfo.Visible = true;
}

Expand Down Expand Up @@ -1085,7 +1085,7 @@ private void loadCollectionFile(string fileName, bool keepCurrentCreatures = fal
{
creatureCollection.multipliers = oldMultipliers;
if (creatureCollection.multipliers == null)
creatureCollection.multipliers = Values.V.statMultipliers;
creatureCollection.multipliers = Values.V.getOfficialMultipliers();
}

applyMultipliersToValues();
Expand All @@ -1111,8 +1111,8 @@ private void loadCollectionFile(string fileName, bool keepCurrentCreatures = fal
creatureBoxListView.CreatureCollection = creatureCollection;
for (int s = 0; s < 8; s++)
{
statIOs[s].cc = creatureCollection;
testingIOs[s].cc = creatureCollection;
statIOs[s].barMaxLevel = creatureCollection.maxWildLevel / 3;
testingIOs[s].barMaxLevel = creatureCollection.maxWildLevel / 3;
}

lastAutoSaveBackup = DateTime.Now.AddMinutes(-10);
Expand Down Expand Up @@ -1493,12 +1493,12 @@ private void newCollection()
{
if (collectionDirty)
{
if (MessageBox.Show("Your Creature Collection has been modified since it was last saved, are you sure you want to discard your changes and quit without saving?", "Discard Changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No)
if (MessageBox.Show("Your Creature Collection has been modified since it was last saved, are you sure you want to discard your changes and create a new Library without saving?", "Discard Changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No)
return;
}

if (creatureCollection.multipliers == null)
creatureCollection.multipliers = Values.V.statMultipliers;
creatureCollection.multipliers = Values.V.getOfficialMultipliers();
// use previously used multipliers again in the new file
double[][] oldMultipliers = creatureCollection.multipliers;

Expand Down Expand Up @@ -2630,6 +2630,11 @@ private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
creatureBoxListView.maxDomLevel = creatureCollection.maxDomLevel;
breedingPlan1.maxSuggestions = creatureCollection.maxBreedingSuggestions;
fileSync.changeFile(currentFileName);
for (int s = 0; s < 8; s++)
{
statIOs[s].barMaxLevel = creatureCollection.maxWildLevel / 3;
testingIOs[s].barMaxLevel = creatureCollection.maxWildLevel / 3;
}
setCollectionChanged(true);
}
}
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.20.8.2")]
[assembly: AssemblyFileVersion("0.20.8.3")]
72 changes: 36 additions & 36 deletions ARKBreedingStats/Settings.Designer.cs

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

11 changes: 4 additions & 7 deletions ARKBreedingStats/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ private void saveSettings()
{
for (int s = 0; s < 8; s++)
{
cc.multipliers[s] = multSetter[s].Multipliers;
for (int sm = 0; sm < 4; sm++)
cc.multipliers[s][sm] = multSetter[s].Multipliers[sm];
}
cc.breedingMultipliers[0] = (double)numericUpDownHatching.Value;
cc.breedingMultipliers[1] = (double)numericUpDownMaturation.Value;
Expand Down Expand Up @@ -113,15 +114,11 @@ private void buttonAllToOne_Click(object sender, EventArgs e)

private void buttonSetToOfficial_Click(object sender, EventArgs e)
{
cc.multipliers = Values.V.statMultipliers;
if (cc.multipliers.Length > 7)
if (Values.V.statMultipliers.Length > 7)
{
for (int s = 0; s < 8; s++)
{
if (cc.multipliers[s].Length > 3)
{
multSetter[s].Multipliers = cc.multipliers[s];
}
multSetter[s].Multipliers = Values.V.statMultipliers[s];
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions ARKBreedingStats/StatIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class StatIO : UserControl
public int statIndex;
private bool domZeroFixed;
ToolTip tt = new ToolTip();
public CreatureCollection cc;
public int barMaxLevel = 45;

public StatIO()
{
Expand Down Expand Up @@ -206,7 +206,7 @@ public void Clear()

private void numLvW_ValueChanged(object sender, EventArgs e)
{
int lengthPercentage = (int)((int)numLvW.Value * (300.0f / (cc!=null? cc.maxWildLevel:40))); // in percentage of the max-barwidth
int lengthPercentage = 100 * (int)numLvW.Value / barMaxLevel; // in percentage of the max-barwidth

if (lengthPercentage > 100) { lengthPercentage = 100; }
if (lengthPercentage < 0) { lengthPercentage = 0; }
Expand All @@ -220,7 +220,7 @@ private void numLvW_ValueChanged(object sender, EventArgs e)

private void numLvD_ValueChanged(object sender, EventArgs e)
{
int lengthPercentage = (int)((int)numLvD.Value * (300.0f / (cc!=null? cc.maxWildLevel:40))); // in percentage of the max-barwidth
int lengthPercentage = 100 * (int)numLvD.Value / barMaxLevel; // in percentage of the max-barwidth

if (lengthPercentage > 100) { lengthPercentage = 100; }
if (lengthPercentage < 0) { lengthPercentage = 0; }
Expand Down
12 changes: 12 additions & 0 deletions ARKBreedingStats/Values.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,17 @@ public void applyMultipliersToBreedingTimes(double[] multipliers)
}
}

public double[][] getOfficialMultipliers()
{
double[][] offMultipliers = new double[8][];
for (int s = 0; s < 8; s++)
{
offMultipliers[s] = new double[4];
for (int sm = 0; sm < 4; sm++)
offMultipliers[s][sm] = statMultipliers[s][sm];
}
return offMultipliers;
}

}
}
2 changes: 1 addition & 1 deletion ARKBreedingStats/ver.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2530000,0.20.8.2
2530000,0.20.8.3

0 comments on commit fac9218

Please sign in to comment.