Skip to content

Commit 558062d

Browse files
committed
Merge branch 'dev'
2 parents 36c5fd3 + f768b50 commit 558062d

File tree

84 files changed

+6754
-3424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+6754
-3424
lines changed

ARKBreedingStats/ARKBreedingStats.csproj

+51-2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
<SubType>Form</SubType>
9393
</Compile>
9494
<Compile Include="importExportGun\ExportGunCreatureFile.cs" />
95+
<Compile Include="importExportGun\ExportGunFileExtensions.cs" />
9596
<Compile Include="importExportGun\ExportGunServerFile.cs" />
9697
<Compile Include="importExportGun\ImportExportGun.cs" />
9798
<Compile Include="importExportGun\ReadExportFile.cs" />
@@ -103,8 +104,15 @@
103104
</Compile>
104105
<Compile Include="library\CreatureSpawnCommand.cs" />
105106
<Compile Include="library\DummyCreatures.cs" />
107+
<Compile Include="StatsOptions\StatOptionsBase.cs" />
108+
<Compile Include="StatsOptions\LevelGraphRepresentation.cs" />
106109
<Compile Include="library\LevelStatusFlags.cs" />
110+
<Compile Include="StatsOptions\StatLevelColors.cs" />
111+
<Compile Include="StatsOptions\StatsOptions.cs" />
112+
<Compile Include="StatsOptions\StatsOptionsSettings.cs" />
113+
<Compile Include="library\TopLevels.cs" />
107114
<Compile Include="multiplierTesting\CalculateMultipliers.cs" />
115+
<Compile Include="multiplierTesting\SpeciesStatsExtractor.cs" />
108116
<Compile Include="multiplierTesting\TaTmSolver.cs" />
109117
<Compile Include="NamePatterns\NameList.cs" />
110118
<Compile Include="NamePatterns\NamePatternEntry.cs">
@@ -115,6 +123,7 @@
115123
<Compile Include="Pedigree\PedigreeCreation.cs" />
116124
<Compile Include="Pedigree\IPedigreeCreature.cs" />
117125
<Compile Include="species\ArkColors.cs" />
126+
<Compile Include="species\Troodonism.cs" />
118127
<Compile Include="uiControls\ArkVersionDialog.cs">
119128
<SubType>Form</SubType>
120129
</Compile>
@@ -136,6 +145,12 @@
136145
<Compile Include="uiControls\Hatching.Designer.cs">
137146
<DependentUpon>Hatching.cs</DependentUpon>
138147
</Compile>
148+
<Compile Include="StatsOptions\HueControl.cs">
149+
<SubType>UserControl</SubType>
150+
</Compile>
151+
<Compile Include="StatsOptions\HueControl.Designer.cs">
152+
<DependentUpon>HueControl.cs</DependentUpon>
153+
</Compile>
139154
<Compile Include="uiControls\LibraryFilterTemplates.cs">
140155
<SubType>Form</SubType>
141156
</Compile>
@@ -152,12 +167,33 @@
152167
<Compile Include="uiControls\PopupMessage.cs">
153168
<SubType>Form</SubType>
154169
</Compile>
170+
<Compile Include="uiControls\ScrollForm.cs">
171+
<SubType>Form</SubType>
172+
</Compile>
173+
<Compile Include="uiControls\ScrollForm.Designer.cs">
174+
<DependentUpon>ScrollForm.cs</DependentUpon>
175+
</Compile>
176+
<Compile Include="StatsOptions\StatLevelGraphOptionsControl.cs">
177+
<SubType>UserControl</SubType>
178+
</Compile>
179+
<Compile Include="StatsOptions\StatLevelGraphOptionsControl.Designer.cs">
180+
<DependentUpon>StatLevelGraphOptionsControl.cs</DependentUpon>
181+
</Compile>
182+
<Compile Include="StatsOptions\LevelGraphOptionsControl.cs">
183+
<SubType>Component</SubType>
184+
</Compile>
155185
<Compile Include="uiControls\StatSelector.cs">
156186
<SubType>UserControl</SubType>
157187
</Compile>
158188
<Compile Include="uiControls\StatSelector.Designer.cs">
159189
<DependentUpon>StatSelector.cs</DependentUpon>
160190
</Compile>
191+
<Compile Include="StatsOptions\StatsOptionsWindow.cs">
192+
<SubType>Form</SubType>
193+
</Compile>
194+
<Compile Include="StatsOptions\StatsOptionsWindow.Designer.cs">
195+
<DependentUpon>StatsOptionsWindow.cs</DependentUpon>
196+
</Compile>
161197
<Compile Include="Updater\AsbManifest.cs" />
162198
<Compile Include="Updater\AsbModule.cs" />
163199
<Compile Include="duplicates\MergingDuplicates.cs" />
@@ -369,7 +405,7 @@
369405
<Compile Include="CreatureInfoInput.Designer.cs">
370406
<DependentUpon>CreatureInfoInput.cs</DependentUpon>
371407
</Compile>
372-
<Compile Include="species\CreatureStat.cs" />
408+
<Compile Include="species\SpeciesStat.cs" />
373409
<Compile Include="species\Kibble.cs" />
374410
<Compile Include="Kibbles.cs" />
375411
<Compile Include="library\CreatureValues.cs" />
@@ -661,6 +697,7 @@
661697
<Compile Include="utils\Convert32.cs" />
662698
<Compile Include="utils\Debouncer.cs" />
663699
<Compile Include="utils\ArkInstallationPath.cs" />
700+
<Compile Include="utils\ExceptionMessages.cs" />
664701
<Compile Include="utils\ExtensionMethods.cs" />
665702
<Compile Include="utils\CreatureListSorter.cs" />
666703
<Compile Include="utils\MessageBoxes.cs" />
@@ -728,15 +765,27 @@
728765
<EmbeddedResource Include="uiControls\Hatching.resx">
729766
<DependentUpon>Hatching.cs</DependentUpon>
730767
</EmbeddedResource>
768+
<EmbeddedResource Include="StatsOptions\HueControl.resx">
769+
<DependentUpon>HueControl.cs</DependentUpon>
770+
</EmbeddedResource>
731771
<EmbeddedResource Include="uiControls\LibraryFilterTemplates.resx">
732772
<DependentUpon>LibraryFilterTemplates.cs</DependentUpon>
733773
</EmbeddedResource>
734774
<EmbeddedResource Include="uiControls\ParentInheritance.resx">
735775
<DependentUpon>ParentInheritance.cs</DependentUpon>
736776
</EmbeddedResource>
777+
<EmbeddedResource Include="uiControls\ScrollForm.resx">
778+
<DependentUpon>ScrollForm.cs</DependentUpon>
779+
</EmbeddedResource>
780+
<EmbeddedResource Include="StatsOptions\StatLevelGraphOptionsControl.resx">
781+
<DependentUpon>StatLevelGraphOptionsControl.cs</DependentUpon>
782+
</EmbeddedResource>
737783
<EmbeddedResource Include="uiControls\StatSelector.resx">
738784
<DependentUpon>StatSelector.cs</DependentUpon>
739785
</EmbeddedResource>
786+
<EmbeddedResource Include="StatsOptions\StatsOptionsWindow.resx">
787+
<DependentUpon>StatsOptionsWindow.cs</DependentUpon>
788+
</EmbeddedResource>
740789
<EmbeddedResource Include="uiControls\VariantSelector.resx">
741790
<DependentUpon>VariantSelector.cs</DependentUpon>
742791
</EmbeddedResource>
@@ -1002,7 +1051,7 @@
10021051
</ItemGroup>
10031052
<ItemGroup>
10041053
<PackageReference Include="FluentFTP">
1005-
<Version>49.0.2</Version>
1054+
<Version>50.0.1</Version>
10061055
</PackageReference>
10071056
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers">
10081057
<Version>3.3.4</Version>

ARKBreedingStats/App.config

+11-8
Original file line numberDiff line numberDiff line change
@@ -408,17 +408,11 @@
408408
<setting name="InfoGraphicShowRegionNamesIfNoImage" serializeAs="String">
409409
<value>False</value>
410410
</setting>
411-
<setting name="ChartHueMin" serializeAs="String">
412-
<value>0</value>
413-
</setting>
414-
<setting name="ChartHueMax" serializeAs="String">
415-
<value>120</value>
416-
</setting>
417411
<setting name="ChartHueEvenMin" serializeAs="String">
418-
<value>120</value>
412+
<value>0</value>
419413
</setting>
420414
<setting name="ChartHueEvenMax" serializeAs="String">
421-
<value>200</value>
415+
<value>120</value>
422416
</setting>
423417
<setting name="ChartHueOddMin" serializeAs="String">
424418
<value>240</value>
@@ -538,6 +532,15 @@
538532
<setting name="MoveMutationLevelsOnExtractionIfUnique" serializeAs="String">
539533
<value>True</value>
540534
</setting>
535+
<setting name="TesterLinkWildMutatedLevels" serializeAs="String">
536+
<value>True</value>
537+
</setting>
538+
<setting name="DisplayWarningAboutTooLongNameGenerated" serializeAs="String">
539+
<value>False</value>
540+
</setting>
541+
<setting name="LevelColorWindowRectangle" serializeAs="String">
542+
<value>200, 200, 1000, 650</value>
543+
</setting>
541544
</ARKBreedingStats.Properties.Settings>
542545
</userSettings>
543546
</configuration>

ARKBreedingStats/Ark.cs

+30-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using ARKBreedingStats.values;
2+
using System;
23

34
namespace ARKBreedingStats
45
{
@@ -155,6 +156,26 @@ public enum Game
155156
/// Collection indicator for ARK: Survival Ascended, also the mod tag id for the ASA values.
156157
/// </summary>
157158
public const string Asa = "ASA";
159+
160+
/// <summary>
161+
/// The default cuddle interval is 8 hours.
162+
/// </summary>
163+
private const int DefaultCuddleIntervalInSeconds = 8 * 60 * 60;
164+
165+
/// <summary>
166+
/// Returns the imprinting gain per cuddle, dependent on the maturation time and the cuddle interval multiplier.
167+
/// </summary>
168+
/// <param name="maturationTime">Maturation time in seconds</param>
169+
public static double ImprintingGainPerCuddle(double maturationTime)
170+
{
171+
var multipliers = Values.V.currentServerMultipliers;
172+
// this is assumed to be the used formula
173+
var maxPossibleCuddles = maturationTime / (DefaultCuddleIntervalInSeconds * multipliers.BabyImprintAmountMultiplier);
174+
var denominator = maxPossibleCuddles - 0.25;
175+
if (denominator < 0) return 0;
176+
if (denominator < multipliers.BabyCuddleIntervalMultiplier) return 1;
177+
return Math.Min(1, multipliers.BabyCuddleIntervalMultiplier / denominator);
178+
}
158179
}
159180

160181
/// <summary>
@@ -168,35 +189,27 @@ public static class Stats
168189
public const int StatsCount = 12;
169190

170191
public const int Health = 0;
192+
/// <summary>
193+
/// Stamina, or Charge Capacity for glow species
194+
/// </summary>
171195
public const int Stamina = 1;
172196
public const int Torpidity = 2;
197+
/// <summary>
198+
/// Oxygen, or Charge Regeneration for glow species
199+
/// </summary>
173200
public const int Oxygen = 3;
174201
public const int Food = 4;
175202
public const int Water = 5;
176203
public const int Temperature = 6;
177204
public const int Weight = 7;
205+
/// <summary>
206+
/// MeleeDamageMultiplier, or Charge Emission Range for glow species
207+
/// </summary>
178208
public const int MeleeDamageMultiplier = 8;
179209
public const int SpeedMultiplier = 9;
180210
public const int TemperatureFortitude = 10;
181211
public const int CraftingSpeedMultiplier = 11;
182212

183-
/// <summary>
184-
/// Index of additive taming multiplier in stat multipliers.
185-
/// </summary>
186-
public const int IndexTamingAdd = 0;
187-
/// <summary>
188-
/// Index of multiplicative taming multiplier in stat multipliers.
189-
/// </summary>
190-
public const int IndexTamingMult = 1;
191-
/// <summary>
192-
/// Index of domesticated level multiplier in stat multipliers.
193-
/// </summary>
194-
public const int IndexLevelDom = 2;
195-
/// <summary>
196-
/// Index of wild level multiplier in stat multipliers.
197-
/// </summary>
198-
public const int IndexLevelWild = 3;
199-
200213
/// <summary>
201214
/// Returns the stat-index for the given order index (like it is ordered in game).
202215
/// </summary>

ARKBreedingStats/BreedingPlanning/BreedingPlan.cs

+16-3
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ private void DoCalculateBreedingScoresAndDisplayPairs()
289289
bool considerMutationLimit = nudBPMutationLimit.Value >= 0;
290290

291291
bool creaturesMutationsFilteredOut = false;
292+
bool noCreaturesWithTopStatsInBothSexes = false;
292293

293294
// only consider creatures with top stats if breeding for that
294295
Creature[] females, males;
@@ -301,6 +302,7 @@ private void DoCalculateBreedingScoresAndDisplayPairs()
301302
{
302303
females = _females.Where(c => c.topStatsCountBP > 0).ToArray();
303304
males = _males?.Where(c => c.topStatsCountBP > 0).ToArray();
305+
noCreaturesWithTopStatsInBothSexes = !females.Any() || (males?.Any() != true && !_currentSpecies.noGender);
304306
}
305307

306308
// filter by tags
@@ -399,7 +401,7 @@ private void DoCalculateBreedingScoresAndDisplayPairs()
399401

400402
if (!selectedFemales.Any() || !selectedMales.Any())
401403
{
402-
NoPossiblePairingsFound(creaturesMutationsFilteredOut);
404+
NoPossiblePairingsFound(creaturesMutationsFilteredOut, noCreaturesWithTopStatsInBothSexes);
403405
}
404406
else
405407
{
@@ -603,7 +605,7 @@ private void DoCalculateBreedingScoresAndDisplayPairs()
603605
/// <summary>
604606
/// Hide unused controls and display info.
605607
/// </summary>
606-
private void NoPossiblePairingsFound(bool creaturesMutationsFilteredOut)
608+
private void NoPossiblePairingsFound(bool creaturesMutationsFilteredOut, bool noCreaturesWithTopStatsInBothSexes)
607609
{
608610
// hide unused controls
609611
pedigreeCreature1.Hide();
@@ -615,7 +617,18 @@ private void NoPossiblePairingsFound(bool creaturesMutationsFilteredOut)
615617
_pcs[2 * i + 1].Hide();
616618
_pbs[i].Hide();
617619
}
618-
lbBreedingPlanInfo.Text = string.Format(Loc.S("NoPossiblePairingForSpeciesFound"), _currentSpecies);
620+
621+
if (noCreaturesWithTopStatsInBothSexes)
622+
{
623+
lbBreedingPlanInfo.Text = $"The breeding mode is set to {Loc.S("rbBPTopStatsCn")}, but currently there is no pair where top stats can be combined."
624+
+ Environment.NewLine + $"You can change the breeding mode to {Loc.S("rbBPHighStats")} to get the best recommendations in this situation."
625+
+ Environment.NewLine + Environment.NewLine
626+
+ string.Format(Loc.S("NoPossiblePairingForSpeciesFound"), _currentSpecies);
627+
}
628+
else
629+
{
630+
lbBreedingPlanInfo.Text = string.Format(Loc.S("NoPossiblePairingForSpeciesFound"), _currentSpecies);
631+
}
619632
lbBreedingPlanInfo.Visible = true;
620633
if (!cbBPIncludeCryoCreatures.Checked
621634
&& CreatureCollection.creatures.Any(c

ARKBreedingStats/CreatureInfoInput.cs

+11-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Drawing;
44
using System.Windows.Forms;
55
using System.Windows.Threading;
6+
using ARKBreedingStats.library;
67
using ARKBreedingStats.Library;
78
using ARKBreedingStats.NamePatterns;
89
using ARKBreedingStats.Properties;
@@ -305,7 +306,7 @@ private void dhmsInputGrown_ValueChanged(object sender, TimeSpan ts)
305306
private void SetMaturationAccordingToGrownUpIn()
306307
{
307308
double maturation = 1;
308-
if (_selectedSpecies.breeding != null && _selectedSpecies.breeding.maturationTimeAdjusted > 0)
309+
if (_selectedSpecies?.breeding != null && _selectedSpecies.breeding.maturationTimeAdjusted > 0)
309310
{
310311
maturation = 1 - dhmsInputGrown.Timespan.TotalSeconds / _selectedSpecies.breeding.maturationTimeAdjusted;
311312
if (maturation < 0) maturation = 0;
@@ -353,8 +354,11 @@ public DateTime? GrowingUntil
353354
get => dhmsInputGrown.changed ? DateTime.Now.Add(dhmsInputGrown.Timespan) : default(DateTime?);
354355
set
355356
{
356-
if (!value.HasValue) return;
357-
dhmsInputGrown.Timespan = value.Value - DateTime.Now;
357+
if (value.HasValue)
358+
dhmsInputGrown.Timespan = value.Value - DateTime.Now;
359+
else
360+
dhmsInputGrown.Timespan = TimeSpan.Zero;
361+
358362
SetMaturationAccordingToGrownUpIn();
359363
}
360364
}
@@ -591,20 +595,20 @@ private void btNamingPatternEditor_Click(object sender, EventArgs e)
591595
/// <summary>
592596
/// Generates a creature name with a given pattern
593597
/// </summary>
594-
public void GenerateCreatureName(Creature creature, Creature alreadyExistingCreature, int[] speciesTopLevels, int[] speciesLowestLevels, Dictionary<string, string> customReplacings, bool showDuplicateNameWarning, int namingPatternIndex)
598+
public void GenerateCreatureName(Creature creature, Creature alreadyExistingCreature, TopLevels topLevels, Dictionary<string, string> customReplacings, bool showDuplicateNameWarning, int namingPatternIndex)
595599
{
596600
SetCreatureData(creature);
597-
CreatureName = NamePattern.GenerateCreatureName(creature, alreadyExistingCreature, _sameSpecies, speciesTopLevels, speciesLowestLevels, customReplacings,
601+
CreatureName = NamePattern.GenerateCreatureName(creature, alreadyExistingCreature, _sameSpecies, topLevels, customReplacings,
598602
showDuplicateNameWarning, namingPatternIndex, false, colorsExisting: ColorAlreadyExistingInformation, libraryCreatureCount: LibraryCreatureCount);
599603
if (CreatureName.Length > Ark.MaxCreatureNameLength)
600604
SetMessageLabelText?.Invoke($"The generated name is longer than {Ark.MaxCreatureNameLength} characters, the name will look like this in game:\r\n" + CreatureName.Substring(0, Ark.MaxCreatureNameLength), MessageBoxIcon.Error);
601605
}
602606

603-
public void OpenNamePatternEditor(Creature creature, int[] speciesTopLevels, int[] speciesLowestLevels, Dictionary<string, string> customReplacings, int namingPatternIndex, Action<PatternEditor> reloadCallback)
607+
public void OpenNamePatternEditor(Creature creature, TopLevels topLevels, Dictionary<string, string> customReplacings, int namingPatternIndex, Action<PatternEditor> reloadCallback)
604608
{
605609
if (!parentListValid)
606610
ParentListRequested?.Invoke(this);
607-
using (var pe = new PatternEditor(creature, _sameSpecies, speciesTopLevels, speciesLowestLevels, ColorAlreadyExistingInformation, customReplacings, namingPatternIndex, reloadCallback, LibraryCreatureCount))
611+
using (var pe = new PatternEditor(creature, _sameSpecies, topLevels, ColorAlreadyExistingInformation, customReplacings, namingPatternIndex, reloadCallback, LibraryCreatureCount))
608612
{
609613
if (pe.ShowDialog() == DialogResult.OK)
610614
{

0 commit comments

Comments
 (0)