Skip to content

Commit 4ace471

Browse files
committed
Merge branch 'dev'
2 parents 71221cd + febae28 commit 4ace471

16 files changed

+151
-65
lines changed

ARKBreedingStats/ARKBreedingStats.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<ApplicationIcon>ARKSmartBreeding.ico</ApplicationIcon>
5757
</PropertyGroup>
5858
<ItemGroup>
59+
<Reference Include="PresentationCore" />
5960
<Reference Include="System" />
6061
<Reference Include="System.Configuration" />
6162
<Reference Include="System.Core" />

ARKBreedingStats/CreatureBox.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ void SetParentLabel(Label l, string lbText = null, bool clickable = false)
126126
_tt.SetToolTip(l, clickable ? lbText : null);
127127
}
128128

129+
SetParentLabel(LbFather);
130+
129131
if (_creature.Mother != null || _creature.Father != null)
130132
{
131133
SetParentLabel(LbMotherAndWildInfo, _creature.Mother != null ? $"{Loc.S("Mother")}: {_creature.Mother.name}" : null, _creature.Mother != null);
@@ -134,12 +136,14 @@ void SetParentLabel(Label l, string lbText = null, bool clickable = false)
134136
else if (_creature.isBred)
135137
{
136138
SetParentLabel(LbMotherAndWildInfo, "bred, click 'edit' to add parents");
137-
SetParentLabel(LbFather);
138139
}
139-
else
140+
else if (_creature.isDomesticated)
140141
{
141142
SetParentLabel(LbMotherAndWildInfo, "found wild " + _creature.levelFound + (_creature.tamingEff >= 0 ? ", tamed with TE: " + (_creature.tamingEff * 100).ToString("N1") + "%" : ", TE unknown."));
142-
SetParentLabel(LbFather);
143+
}
144+
else
145+
{
146+
SetParentLabel(LbMotherAndWildInfo, "found wild " + _creature.levelFound);
143147
}
144148
statsDisplay1.SetCreatureValues(_creature);
145149
labelNotes.Text = _creature.note;

ARKBreedingStats/Form1.cs

+18-8
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ private void Form1_Load(object sender, EventArgs e)
315315
Environment.Exit(1);
316316
}
317317

318+
statsMultiplierTesting1.SetGameDefaultMultiplier();
319+
318320
for (int s = 0; s < Stats.StatsCount; s++)
319321
{
320322
_statIOs[s].Input = 0;
@@ -1816,28 +1818,35 @@ private void SetStatusOfSelectedCreatures(CreatureStatus s)
18161818

18171819
private void SetCreatureStatus(IEnumerable<Creature> cs, CreatureStatus s)
18181820
{
1819-
bool changed = false;
1820-
List<string> speciesBlueprints = new List<string>();
1821+
var changed = false;
1822+
var deadStatusWasSet = false;
1823+
var changedSpecies = new List<Species>();
18211824
foreach (Creature c in cs)
18221825
{
18231826
if (c.Status != s)
18241827
{
18251828
changed = true;
1829+
deadStatusWasSet = deadStatusWasSet || c.Status.HasFlag(CreatureStatus.Dead);
18261830
c.Status = s;
1827-
if (!speciesBlueprints.Contains(c.speciesBlueprint))
1828-
speciesBlueprints.Add(c.speciesBlueprint);
1831+
if (!changedSpecies.Contains(c.Species))
1832+
changedSpecies.Add(c.Species);
18291833
}
18301834
}
18311835

18321836
if (changed)
18331837
{
18341838
// update list / recalculate topStats
18351839
CalculateTopStats(_creatureCollection.creatures
1836-
.Where(c => speciesBlueprints.Contains(c.speciesBlueprint)).ToList());
1840+
.Where(c => changedSpecies.Contains(c.Species)).ToList());
1841+
Species speciesIfOnlyOne = changedSpecies.Count == 1 ? changedSpecies[0] : null;
1842+
if (s.HasFlag(CreatureStatus.Dead) ^ deadStatusWasSet)
1843+
{
1844+
LibraryInfo.ClearInfo();
1845+
_creatureCollection.ResetExistingColors(speciesIfOnlyOne);
1846+
}
18371847
FilterLibRecalculate();
18381848
UpdateStatusBar();
1839-
SetCollectionChanged(true,
1840-
speciesBlueprints.Count == 1 ? Values.V.SpeciesByBlueprint(speciesBlueprints[0]) : null);
1849+
SetCollectionChanged(true, speciesIfOnlyOne);
18411850
}
18421851
}
18431852

@@ -2855,7 +2864,8 @@ private void SetCreatureValuesToInfoInput(CreatureValues cv, CreatureInfoInput i
28552864

28562865
private void toolStripButtonSaveCreatureValuesTemp_Click(object sender, EventArgs e)
28572866
{
2858-
_creatureCollection.creaturesValues.Add(GetCreatureValuesFromExtractor());
2867+
_creatureCollection.creaturesValues = _creatureCollection.creaturesValues.Append(GetCreatureValuesFromExtractor())
2868+
.OrderBy(c => c.Species?.DescriptiveNameAndMod).ThenBy(c => c.name).ToList();
28592869
SetCollectionChanged(true);
28602870
UpdateTempCreatureDropDown();
28612871
}

ARKBreedingStats/Form1.extractor.cs

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ private void ShowSumOfChosenLevels()
114114
if (allValid)
115115
{
116116
radarChartExtractor.SetLevels(_statIOs.Select(s => s.LevelWild).ToArray());
117-
toolStripButtonSaveCreatureValuesTemp.Visible = false;
118117
cbExactlyImprinting.BackColor = Color.Transparent;
119118
var species = speciesSelector1.SelectedSpecies;
120119
var checkTopLevels = _topLevels.TryGetValue(species, out int[] topSpeciesLevels);

ARKBreedingStats/Form1.library.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private Creature AddCreatureToCollection(bool fromExtractor = true, long motherA
4444
{
4545
input = creatureInfoInputExtractor;
4646
bred = rbBredExtractor.Checked;
47-
te = _extractor.UniqueTamingEffectiveness();
47+
te = rbWildExtractor.Checked ? -3 : _extractor.UniqueTamingEffectiveness();
4848
imprinting = _extractor.ImprintingBonus;
4949
}
5050
else

ARKBreedingStats/Form1.tester.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,12 @@ private void PbCreatureColorsExtractor_Click(object sender, EventArgs e)
365365
{
366366
Species = speciesSelector1.SelectedSpecies,
367367
levelsWild = GetCurrentWildLevels(true),
368-
levelsDom = GetCurrentDomLevels(true)
368+
levelsDom = GetCurrentDomLevels(true),
369+
tamingEff = _extractor.UniqueTamingEffectiveness(),
370+
isBred = rbBredExtractor.Checked,
371+
imprintingBonus = _extractor.ImprintingBonus
369372
};
370373

371-
creature.tamingEff = _extractor.UniqueTamingEffectiveness();
372-
creature.isBred = rbBredExtractor.Checked;
373-
creature.imprintingBonus = _extractor.ImprintingBonus;
374374
creatureInfoInputExtractor.SetCreatureData(creature);
375375
creature.RecalculateAncestorGenerations();
376376
creature.RecalculateNewMutations();

ARKBreedingStats/Properties/AssemblyInfo.cs

+1-1
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.51.0.0")]
33+
[assembly: AssemblyFileVersion("0.51.1.0")]
3434
[assembly: NeutralResourcesLanguage("en")]
3535

ARKBreedingStats/_manifest.json

+1-1
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.51.0.0"
7+
"version": "0.51.1.0"
88
},
99
"SpeciesColorImages": {
1010
"Id": "SpeciesColorImages",

ARKBreedingStats/json/values/_manifest.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"mod": { "id": "1139775728", "tag": "Confuciusornis", "title": "Confuciusornis" }
3636
},
3737
"1169020368-Trex.json": {
38-
"version": "357.3.1678038097",
38+
"version": "357.4.1679236349",
3939
"mod": { "id": "1169020368", "tag": "Trex", "title": "Ark Creature Rebalance (AG Reborn)" }
4040
},
4141
"1178308359-ShadDragon.json": {
@@ -72,7 +72,7 @@
7272
"mod": { "id": "1356703358", "tag": "Primal_Fear_Noxious_Creatures", "title": "Primal Fear Noxious Creatures" }
7373
},
7474
"1373744537-AC2.json": {
75-
"version": "356.11.1676323618",
75+
"version": "357.4.1679590122",
7676
"mod": { "id": "1373744537", "tag": "AC2", "title": "Additional Creatures 2: Wild Ark" }
7777
},
7878
"1379111008-RealismPlus.json": {
@@ -104,7 +104,7 @@
104104
"mod": { "id": "1522327484", "tag": "Additions_Pack", "title": "ARK Additions!" }
105105
},
106106
"1523045986-Paranoia.json": {
107-
"version": "356.5.1668722824",
107+
"version": "357.4.1679444826",
108108
"mod": { "id": "1523045986", "tag": "Paranoia", "title": "Additional Creatures 2: Paranoia!" }
109109
},
110110
"1565015734-BetterDinosTest.json": {
@@ -145,7 +145,7 @@
145145
"mod": { "id": "1662691167", "tag": "Senior", "title": "Additional Creatures: Senior Class" }
146146
},
147147
"1675895024-NoUntameables.json": {
148-
"version": "356.5.1675695969",
148+
"version": "357.4.1678903474",
149149
"mod": { "id": "1675895024", "tag": "NoUntameables", "title": "No Untameables" }
150150
},
151151
"1676159020-Aquaria.json": {
@@ -243,7 +243,7 @@
243243
"mod": { "id": "2000326197", "tag": "ExtraResources", "title": "Event Assets" }
244244
},
245245
"2003934830-Beasts.json": {
246-
"version": "356.12.1677099299",
246+
"version": "357.4.1678923214",
247247
"mod": { "id": "2003934830", "tag": "Beasts", "title": "Prehistoric Beasts" }
248248
},
249249
"2019846325-ApexMod.json": {
@@ -331,7 +331,7 @@
331331
"mod": { "id": "883957187", "tag": "WyvernWorld", "title": "Wyvern World" }
332332
},
333333
"893735676-AE.json": {
334-
"version": "356.5.1675949309",
334+
"version": "357.5.1679775865",
335335
"mod": { "id": "893735676", "tag": "AE", "title": "Ark Eternal" }
336336
},
337337
"895711211-ClassicFlyers.json": {

ARKBreedingStats/library/Creature.cs

+7
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,13 @@ public override int GetHashCode()
299299
public void CalculateLevelFound(int? levelStep)
300300
{
301301
levelFound = 0;
302+
303+
if (!isDomesticated)
304+
{
305+
levelFound = LevelHatched;
306+
return;
307+
}
308+
302309
if (isBred || tamingEff < 0) return;
303310

304311
if (levelStep.HasValue)

ARKBreedingStats/library/CreatureCollection.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Collections.Generic;
66
using System.Linq;
77
using System.Runtime.Serialization;
8-
using System.Text;
98
using ARKBreedingStats.mods;
109

1110
namespace ARKBreedingStats.Library
@@ -484,7 +483,10 @@ internal ColorExisting[] ColorAlreadyAvailable(Species species, byte[] colorIds,
484483
for (int i = 0; i < usedColorCount + 1; i++) speciesExistingColors[i] = new List<int>();
485484
foreach (Creature c in creatures)
486485
{
487-
if (c.flags.HasFlag(CreatureFlags.Placeholder) || c.Species == null || c.speciesBlueprint != species.blueprintPath)
486+
if (c.flags.HasFlag(CreatureFlags.Placeholder)
487+
|| c.flags.HasFlag(CreatureFlags.Dead)
488+
|| c.Species == null
489+
|| c.speciesBlueprint != species.blueprintPath)
488490
continue;
489491

490492
for (int i = 0; i < usedColorCount; i++)

ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.Designer.cs

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs

+47-13
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using ARKBreedingStats.miscClasses;
22
using ARKBreedingStats.uiControls;
33
using System;
4-
using System.Collections.Generic;
54
using System.Drawing;
65
using System.Windows.Forms;
6+
using System.Windows.Input;
77

88
namespace ARKBreedingStats.multiplierTesting
99
{
@@ -68,7 +68,14 @@ public partial class StatMultiplierTestingControl : UserControl
6868
/// Singleplayer extra multiplier for taming multiplier.
6969
/// </summary>
7070
private double _spTm;
71+
/// <summary>
72+
/// Values of currently saved settings.
73+
/// </summary>
7174
private double[] _multipliersOfSettings;
75+
/// <summary>
76+
/// Values of default game values.
77+
/// </summary>
78+
public double[] StatMultipliersGameDefault;
7279

7380
/// <summary>
7481
/// The values of this stat. 0: Base, 1: Iw, 2: Id, 3: Ta, 4: Tm
@@ -490,30 +497,57 @@ private void calculateIBMToolStripMenuItem_Click(object sender, EventArgs e)
490497

491498
private void resetIwMToolStripMenuItem_Click(object sender, EventArgs e)
492499
{
493-
nudIwM.Value = (decimal)_multipliersOfSettings[3];
500+
ResetMultiplier(3, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control));
494501
}
495502

496503
private void resetTaMToolStripMenuItem_Click(object sender, EventArgs e)
497504
{
498-
nudTaM.Value = (decimal)_multipliersOfSettings[0];
505+
ResetMultiplier(0, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control));
499506
}
500507

501508
private void resetTmMToolStripMenuItem_Click(object sender, EventArgs e)
502509
{
503-
nudTmM.Value = (decimal)_multipliersOfSettings[1];
510+
ResetMultiplier(1, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control));
504511
}
505512

506513
private void resetIdMToolStripMenuItem_Click(object sender, EventArgs e)
507514
{
508-
nudIdM.Value = (decimal)_multipliersOfSettings[2];
515+
ResetMultiplier(2, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control));
509516
}
510517

511518
private void resetAllMultiplierOfThisStatToolStripMenuItem_Click(object sender, EventArgs e)
512519
{
513-
nudTaM.Value = (decimal)_multipliersOfSettings[0];
514-
nudTmM.Value = (decimal)_multipliersOfSettings[1];
515-
nudIdM.Value = (decimal)_multipliersOfSettings[2];
516-
nudIwM.Value = (decimal)_multipliersOfSettings[3];
520+
ResetMultiplier(-1, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control));
521+
}
522+
523+
/// <summary>
524+
/// Reset multiplier value to the current value in the settings, if gameDefault is true, the game default values are used.
525+
/// </summary>
526+
private void ResetMultiplier(int index, bool gameDefault = false)
527+
{
528+
var multipliersToUse = gameDefault ? StatMultipliersGameDefault : _multipliersOfSettings;
529+
switch (index)
530+
{
531+
case 0:
532+
nudTaM.Value = (decimal)multipliersToUse[0];
533+
return;
534+
case 1:
535+
nudTmM.Value = (decimal)multipliersToUse[1];
536+
return;
537+
case 2:
538+
nudIdM.Value = (decimal)multipliersToUse[2];
539+
return;
540+
case 3:
541+
nudIwM.Value = (decimal)multipliersToUse[3];
542+
return;
543+
case -1:
544+
// set all
545+
nudTaM.Value = (decimal)multipliersToUse[0];
546+
nudTmM.Value = (decimal)multipliersToUse[1];
547+
nudIdM.Value = (decimal)multipliersToUse[2];
548+
nudIwM.Value = (decimal)multipliersToUse[3];
549+
return;
550+
}
517551
}
518552

519553
private void setWildLevelToClosestValueToolStripMenuItem_Click(object sender, EventArgs e)
@@ -711,7 +745,7 @@ private void btCalculateIwM_Click(object sender, EventArgs e)
711745

712746
private void btResetIwM_Click(object sender, EventArgs e)
713747
{
714-
nudIwM.Value = (decimal)_multipliersOfSettings[3];
748+
ResetMultiplier(3, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control));
715749
}
716750

717751
private void btCalculateTaM_Click(object sender, EventArgs e)
@@ -721,7 +755,7 @@ private void btCalculateTaM_Click(object sender, EventArgs e)
721755

722756
private void btResetTaM_Click(object sender, EventArgs e)
723757
{
724-
nudTaM.Value = (decimal)_multipliersOfSettings[0];
758+
ResetMultiplier(0, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control));
725759
}
726760

727761
private void btCalculateTmM_Click(object sender, EventArgs e)
@@ -731,7 +765,7 @@ private void btCalculateTmM_Click(object sender, EventArgs e)
731765

732766
private void btResetTmM_Click(object sender, EventArgs e)
733767
{
734-
nudTmM.Value = (decimal)_multipliersOfSettings[1];
768+
ResetMultiplier(1, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control));
735769
}
736770

737771
private void btCalculateDomLevel_Click(object sender, EventArgs e)
@@ -746,7 +780,7 @@ private void btCalculateIdM_Click(object sender, EventArgs e)
746780

747781
private void btResetIdM_Click(object sender, EventArgs e)
748782
{
749-
nudIdM.Value = (decimal)_multipliersOfSettings[2];
783+
ResetMultiplier(2, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control));
750784
}
751785

752786
private void btCalculateTE_Click(object sender, EventArgs e)

0 commit comments

Comments
 (0)