Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/NosCore.Algorithm/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ internal class Constants
internal const byte MaxShellOptionLevel = 12;
internal const byte MinShellValueLevel = 30;
internal const byte MaxSpPerfection = 100;
internal const byte MaxSumLevel = 5;
internal static readonly int ClassCount = Enum.GetNames(typeof(CharacterClassType)).Length;
}
}
5 changes: 5 additions & 0 deletions src/NosCore.Algorithm/SumService/ISumService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ namespace NosCore.Algorithm.SumService
/// </summary>
public interface ISumService
{
/// <summary>
/// Gets the highest level the sum tables cover; a combined level above it cannot be summed
/// </summary>
byte MaxLevel => Constants.MaxSumLevel;

/// <summary>
/// Gets the success rate for a summoning operation at a specific level
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions src/NosCore.Algorithm/SumService/SumService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ namespace NosCore.Algorithm.SumService
/// </summary>
public class SumService : ISumService
{
/// <inheritdoc />
public byte MaxLevel => Constants.MaxSumLevel;

internal static readonly byte[] SuccessRate = { 100, 100, 85, 70, 50, 20 };
internal static readonly ushort[] Price = { 1500, 3000, 6000, 12000, 24000, 48000 };
internal static readonly byte[] SandCost = { 5, 10, 15, 20, 25, 30 };
Expand Down
2 changes: 1 addition & 1 deletion test/NosCore.Algorithm.Tests/DocumentationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public void SumDocumentation()

var resultBuilder = new StringBuilder($"# Sum Table");
resultBuilder.AppendLine();
for (byte i = 0; i < 6; i++)
for (byte i = 0; i <= sumService.MaxLevel; i++)
{
resultBuilder.AppendLine(
$"- Sum {i + 1} - Rate: {sumService.GetSuccessRate(i)}% - Cost: {sumService.GetPrice(i)} - Sand: {sumService.GetSandCost(i)}");
Expand Down
Loading