Skip to content

Commit

Permalink
Merge pull request #113 from DnDGen/develop
Browse files Browse the repository at this point in the history
10.5.0
  • Loading branch information
cidthecoatrack authored Mar 10, 2023
2 parents a82269b + bdf5802 commit a609905
Show file tree
Hide file tree
Showing 91 changed files with 116 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

<ItemGroup>
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1">
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<ItemGroup>
<PackageReference Include="DnDGen.Stress" Version="3.4.0" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1">
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DnDGen.Infrastructure" Version="4.3.0" />
<PackageReference Include="DnDGen.Infrastructure" Version="4.3.1" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1">
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DnDGen.Infrastructure" Version="4.3.0" />
<PackageReference Include="DnDGen.RollGen" Version="15.4.2" />
<PackageReference Include="DnDGen.Infrastructure" Version="4.3.1" />
<PackageReference Include="DnDGen.RollGen" Version="15.5.0" />
<PackageReference Include="Ninject" Version="3.3.6" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1">
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<ItemGroup>
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1">
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private void SetUpRoll(int lower, int upper, int result)
{
var mockPartial = new Mock<PartialRoll>();
mockPartial.Setup(p => p.AsSum<int>()).Returns(result);
var roll = RollHelper.GetRollWithMostEvenDistribution(lower, upper);
var roll = RollHelper.GetRollWithMostEvenDistribution(lower, upper, true);

mockDice.Setup(d => d.Roll(roll)).Returns(mockPartial.Object);
}
Expand Down
17 changes: 14 additions & 3 deletions DnDGen.TreasureGen.Tests.Unit/Tables/AmountConstantsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,20 @@ public class AmountConstantsTests
[TestCase(AmountConstants.Range7d6, 7, 6)]
public void RangeConstant(string constant, int quantity, int die, int multiplier = 1, int bonus = 0)
{
var lower = quantity * multiplier + bonus;
var upper = quantity * die * multiplier + bonus;
var roll = RollHelper.GetRollWithFewestDice(lower, upper);
var roll = $"{quantity}d{die}";

if (bonus > 0)
roll += $"+{bonus}";

if (die == 1)
roll = quantity.ToString();

if (multiplier > 1)
{
var lower = quantity * multiplier + bonus;
var upper = quantity * die * multiplier + bonus;
roll = RollHelper.GetRollWithFewestDice(lower, upper);
}

Assert.That(constant, Is.EqualTo(roll));
}
Expand Down
6 changes: 3 additions & 3 deletions DnDGen.TreasureGen/DnDGen.TreasureGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>10.4.0</Version>
<Version>10.5.0</Version>
<Authors>Karl M. Speer</Authors>
<Company>DnDGen</Company>
<Product>TreasureGen</Product>
Expand Down Expand Up @@ -966,8 +966,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DnDGen.Infrastructure" Version="4.3.0" />
<PackageReference Include="DnDGen.RollGen" Version="15.4.2" />
<PackageReference Include="DnDGen.Infrastructure" Version="4.3.1" />
<PackageReference Include="DnDGen.RollGen" Version="15.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public int GenerateFor(string itemType, string name)
}

var result = rangeDataSelector.SelectFrom(TableNameConstants.Collections.Set.ChargeLimits, name);
var roll = RollHelper.GetRollWithMostEvenDistribution(result.Minimum, result.Maximum);
var roll = RollHelper.GetRollWithMostEvenDistribution(result.Minimum, result.Maximum, true);

return dice.Roll(roll).AsSum();
}
Expand Down
6 changes: 3 additions & 3 deletions DnDGen.TreasureGen/Tables/AmountConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ internal static class AmountConstants
public const string Range2d12 = "2d12";
public const string Range2d12x10 = "20d12";
public const string Range2d100 = "2d100";
public const string Range3d3 = "2d4+1";
public const string Range3d4 = "1d10+2";
public const string Range3d3 = "3d3";
public const string Range3d4 = "3d4";
public const string Range3d4x10 = "10d10+20";
public const string Range3d4x100 = "100d10+200";
public const string Range3d4x1000 = "1000d10+2000";
Expand Down Expand Up @@ -94,6 +94,6 @@ internal static class AmountConstants
public const string Range5d6x100 = "500d6";
public const string Range6d4x100 = "200d10+400";
public const string Range6d6 = "6d6";
public const string Range7d6 = "5d8+2";
public const string Range7d6 = "7d6";
}
}
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level100Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level20Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level21Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level22Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level23Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level24Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level25Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level26Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level27Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level28Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level29Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level30Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level31Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level32Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level33Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level34Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level35Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level36Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level37Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level38Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level39Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level40Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level41Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
2 changes: 1 addition & 1 deletion DnDGen.TreasureGen/Tables/Goods/Levels/Level42Goods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</percentile>
<percentile>
<lower>39</lower>
<content>Art,5d8+2</content>
<content>Art,7d6</content>
<upper>100</upper>
</percentile>
</percentiles>
Loading

0 comments on commit a609905

Please sign in to comment.