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
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# Dignity Table
- 1 Default - Max: 200 Min: -99

- 2 Dubious - Max: -100 Min: -200

- 3 Dreadful - Max: -201 Min: -400

- 4 Unqualified - Max: -401 Min: -600

- 5 Useless - Max: -601 Min: -800

- 6 Failed - Max: -801 Min: -1000
Original file line number Diff line number Diff line change
@@ -1,64 +1,33 @@
# Reputation Table
- 1 GreenBeginner - Min: 0 Max: 50

- 2 BlueBeginner - Min: 51 Max: 150

- 3 RedBeginner - Min: 151 Max: 250

- 4 GreenTrainee - Min: 251 Max: 500

- 5 BlueTrainee - Min: 501 Max: 750

- 6 RedTrainee - Min: 751 Max: 1000

- 7 GreenExperienced - Min: 1001 Max: 2250

- 8 BlueExperienced - Min: 2251 Max: 3500

- 9 RedExperienced - Min: 3501 Max: 5000

- 10 GreenSoldier - Min: 5001 Max: 9500

- 11 BlueSoldier - Min: 9501 Max: 19000

- 12 RedSoldier - Min: 19001 Max: 25000

- 13 GreenExpert - Min: 25001 Max: 40000

- 14 BlueExpert - Min: 40001 Max: 60000

- 15 RedExpert - Min: 60001 Max: 85000

- 16 GreenLeader - Min: 85001 Max: 115000

- 17 BlueLeader - Min: 115001 Max: 150000

- 18 RedLeader - Min: 150001 Max: 190000

- 19 GreenMaster - Min: 190001 Max: 235000

- 20 BlueMaster - Min: 235001 Max: 285000

- 21 RedMaster - Min: 285001 Max: 350000

- 22 GreenNos - Min: 350001 Max: 500000

- 23 BlueNos - Min: 500001 Max: 1500000

- 24 RedNos - Min: 1500001 Max: 2500000

- 25 GreenElite - Min: 2500001 Max: 3750000

- 26 BlueElite - Min: 3750001 Max: 5000000

- 27 RedElite - Min: 5000001 Max: 9223372036854775807

- 28 GreenLegend - Min: 5000001 Max: 9223372036854775807

- 29 BlueLegend - Min: 5000001 Max: 9223372036854775807

- 30 AncientHero - Min: 5000001 Max: 9223372036854775807

- 31 MysteriousHero - Min: 5000001 Max: 9223372036854775807

- 32 LegendaryHero - Min: 5000001 Max: 9223372036854775807
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Speed Table
- Adventurer : 11
- Swordman : 11
- Archer : 12
- Magician : 10
- MartialArtist : 11
2 changes: 1 addition & 1 deletion src/NosCore.Algorithm/NosCore.Algorithm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<RepositoryUrl>https://github.com/NosCoreIO/NosCore.Algorithm.git</RepositoryUrl>
<PackageIconUrl></PackageIconUrl>
<PackageTags>nostale, noscore, nostale private server source, nostale emulator</PackageTags>
<Version>0.3.0</Version>
<Version>0.4.0</Version>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Description>NosCore's Algorithm</Description>
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
Expand Down
15 changes: 15 additions & 0 deletions src/NosCore.Algorithm/SpeedService/ISpeedService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// __ _ __ __ ___ __ ___ ___
// | \| |/__\ /' _/ / _//__\| _ \ __|
// | | ' | \/ |`._`.| \_| \/ | v / _|
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
// -----------------------------------

using NosCore.Shared.Enumerations;

namespace NosCore.Algorithm.SpeedService
{
public interface ISpeedService
{
byte GetSpeed(CharacterClassType entityClass);
}
}
30 changes: 30 additions & 0 deletions src/NosCore.Algorithm/SpeedService/SpeedService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// __ _ __ __ ___ __ ___ ___
// | \| |/__\ /' _/ / _//__\| _ \ __|
// | | ' | \/ |`._`.| \_| \/ | v / _|
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
// -----------------------------------

using System.Collections.Generic;
using NosCore.Shared.Enumerations;

namespace NosCore.Algorithm.SpeedService
{
public class SpeedService : ISpeedService
{
private readonly Dictionary<CharacterClassType, byte> _data = new Dictionary<CharacterClassType, byte>();

public SpeedService()
{
_data[CharacterClassType.Adventurer] = 11;
_data[CharacterClassType.Swordman] = 11;
_data[CharacterClassType.Archer] = 12;
_data[CharacterClassType.Magician] = 10;
_data[CharacterClassType.MartialArtist] = 11;
}

public byte GetSpeed(CharacterClassType entityClass)
{
return _data[entityClass];
}
}
}
19 changes: 17 additions & 2 deletions test/NosCore.Algorithm.Tests/DocumentationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ public void ReputationDocumentation()
var reputationService = new ReputationService.ReputationService();

var resultBuilder = new StringBuilder("# Reputation Table");
resultBuilder.AppendLine();
foreach (var reput in Enum.GetValues(typeof(ReputationType)).Cast<ReputationType>())
{
resultBuilder.AppendLine();
var result = reputationService.GetReputation(reput);
resultBuilder.AppendLine($"- {(byte)reput,2} {reput.ToString().PadRight(16)} - Min: {result.Item1} Max: {result.Item2}");
if (reput < ReputationType.GreenLegend)
Expand All @@ -179,9 +179,9 @@ public void DignityDocumentation()
var dignityService = new DignityService.DignityService();

var resultBuilder = new StringBuilder("# Dignity Table");
resultBuilder.AppendLine();
foreach (var dignity in Enum.GetValues(typeof(DignityType)).Cast<DignityType>())
{
resultBuilder.AppendLine();
var result = dignityService.GetDignity(dignity);
resultBuilder.AppendLine($"- {(byte)dignity,2} {dignity.ToString().PadRight(11)} - Max: {result.Item1} Min: {result.Item2}");
Assert.AreEqual(dignity, dignityService.GetLevelFromDignity(result.Item1));
Expand Down Expand Up @@ -211,6 +211,21 @@ public void SecondaryDamageDocumentation()
Approvals.Verify(WriterFactory.CreateTextWriter(resultBuilder.ToString(), "md"));
}

[TestMethod]
public void SpeedDocumentation()
{
var speedService = new SpeedService.SpeedService();

var resultBuilder = new StringBuilder("# Speed Table");
resultBuilder.AppendLine();
foreach (var @class in Enum.GetValues(typeof(CharacterClassType)).Cast<CharacterClassType>())
{
resultBuilder.AppendLine($"- {@class} : {speedService.GetSpeed(@class)}");
}

Approvals.Verify(WriterFactory.CreateTextWriter(resultBuilder.ToString(), "md"));
}

[TestMethod]
public void HitRateDocumentation()
{
Expand Down