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
20 changes: 10 additions & 10 deletions documentation/DocumentationTest.HpDocumentation.approved.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
- Level 5 - HP: 338
- Level 6 - HP: 361
- Level 7 - HP: 410
- Level 8 - HP: 463
- Level 8 - HP: 436
- Level 9 - HP: 491
- Level 10 - HP: 520
- Level 11 - HP: 581
Expand All @@ -421,7 +421,7 @@
- Level 15 - HP: 788
- Level 16 - HP: 826
- Level 17 - HP: 905
- Level 18 - HP: 988
- Level 18 - HP: 946
- Level 19 - HP: 1031
- Level 20 - HP: 1075
- Level 21 - HP: 1166
Expand All @@ -431,7 +431,7 @@
- Level 25 - HP: 1463
- Level 26 - HP: 1516
- Level 27 - HP: 1625
- Level 28 - HP: 1738
- Level 28 - HP: 1681
- Level 29 - HP: 1796
- Level 30 - HP: 1855
- Level 31 - HP: 1976
Expand All @@ -441,7 +441,7 @@
- Level 35 - HP: 2363
- Level 36 - HP: 2431
- Level 37 - HP: 2570
- Level 38 - HP: 2713
- Level 38 - HP: 2641
- Level 39 - HP: 2786
- Level 40 - HP: 2860
- Level 41 - HP: 3011
Expand All @@ -451,7 +451,7 @@
- Level 45 - HP: 3488
- Level 46 - HP: 3571
- Level 47 - HP: 3740
- Level 48 - HP: 3913
- Level 48 - HP: 3826
- Level 49 - HP: 4001
- Level 50 - HP: 4090
- Level 51 - HP: 4271
Expand All @@ -461,7 +461,7 @@
- Level 55 - HP: 4838
- Level 56 - HP: 4936
- Level 57 - HP: 5135
- Level 58 - HP: 5338
- Level 58 - HP: 5236
- Level 59 - HP: 5441
- Level 60 - HP: 5545
- Level 61 - HP: 5756
Expand All @@ -471,7 +471,7 @@
- Level 65 - HP: 6413
- Level 66 - HP: 6526
- Level 67 - HP: 6755
- Level 68 - HP: 6988
- Level 68 - HP: 6871
- Level 69 - HP: 7106
- Level 70 - HP: 7225
- Level 71 - HP: 7466
Expand All @@ -481,7 +481,7 @@
- Level 75 - HP: 8213
- Level 76 - HP: 8341
- Level 77 - HP: 8600
- Level 78 - HP: 8863
- Level 78 - HP: 8731
- Level 79 - HP: 8996
- Level 80 - HP: 9130
- Level 81 - HP: 9401
Expand All @@ -491,7 +491,7 @@
- Level 85 - HP: 10238
- Level 86 - HP: 10381
- Level 87 - HP: 10670
- Level 88 - HP: 10963
- Level 88 - HP: 10816
- Level 89 - HP: 11111
- Level 90 - HP: 11260
- Level 91 - HP: 11561
Expand All @@ -501,5 +501,5 @@
- Level 95 - HP: 12488
- Level 96 - HP: 12646
- Level 97 - HP: 12965
- Level 98 - HP: 13288
- Level 98 - HP: 13126
- Level 99 - HP: 13451
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using NosCore.Shared.Enumerations;
using System;
using System.Collections.Generic;
using System.Text;

namespace NosCore.Algorithm.CloseDefenceService
{
Expand Down
4 changes: 2 additions & 2 deletions src/NosCore.Algorithm/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using NosCore.Shared.Enumerations;
using NosCore.Shared.Enumerations;
using System;

namespace NosCore.Algorithm
{
Expand Down
6 changes: 1 addition & 5 deletions src/NosCore.Algorithm/DamageService/DamageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
// -----------------------------------

using NosCore.Algorithm.HpService;
using System;
using System.Collections.Generic;
using System.Text;
using NosCore.Shared.Enumerations;

namespace NosCore.Algorithm.DamageService
Expand All @@ -19,8 +15,8 @@ public class DamageService : IDamageService
public DamageService()
{
_minDamage[(byte)CharacterClassType.Adventurer, 0] = 10;
_minDamage[(byte)CharacterClassType.Swordsman, 0] = 10;
_minDamage[(byte)CharacterClassType.Archer, 0] = 60;
_minDamage[(byte)CharacterClassType.Swordsman, 0] = 10;
_minDamage[(byte)CharacterClassType.Mage, 0] = 10;
_minDamage[(byte)CharacterClassType.MartialArtist, 0] = 10;

Expand Down
1 change: 0 additions & 1 deletion src/NosCore.Algorithm/DignityService/DignityService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NosCore.Algorithm.DignityService;
using NosCore.Shared.Enumerations;

namespace NosCore.Algorithm.DignityService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using NosCore.Shared.Enumerations;
using System;
using System.Collections.Generic;
using System.Text;

namespace NosCore.Algorithm.DistanceDefenceService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using NosCore.Shared.Enumerations;
using System;
using System.Collections.Generic;
using System.Text;

namespace NosCore.Algorithm.DistanceDodgeService
{
Expand Down
3 changes: 0 additions & 3 deletions src/NosCore.Algorithm/DodgeService/HitDodgeService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using NosCore.Shared.Enumerations;
using System;
using System.Collections.Generic;
using System.Text;

namespace NosCore.Algorithm.HitDodgeService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// -----------------------------------

using System;
using NosCore.Algorithm.ExperienceService;

namespace NosCore.Algorithm.HeroExperienceService
{
Expand Down
3 changes: 0 additions & 3 deletions src/NosCore.Algorithm/HitRateService/HitRateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
// -----------------------------------

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

namespace NosCore.Algorithm.HitRateService
Expand Down
88 changes: 7 additions & 81 deletions src/NosCore.Algorithm/HpService/HpService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,92 +12,18 @@ namespace NosCore.Algorithm.HpService
public class HpService : IHpService
{
private readonly long[,] _hpData = new long[Constants.ClassCount, Constants.MaxLevel];
public readonly int[][] ClassConstants = new int[][] { new int[] { 0, 0, 0 }, new int[] { 8, 2, 0 }, new int[] { 3, 6, 1 }, new int[] { 0, 2, 8 }, new int[] { 5, 3, 2 } };

public HpService()
{
// Adventurer HP
var basicHp = 205;
var basicInc = 15;
for (var i = 0; i < Constants.MaxLevel; i++)
{
basicInc++;
basicHp += basicInc;

_hpData[(byte)CharacterClassType.Adventurer, i] = basicHp;
}

var swordHp = 190;
var swordInc = 14;
for (var i = 0; i < Constants.MaxLevel; i++)
{
var increase2 = (i - 2) % 10 == 0;
var increase3 = (i - 3) % 10 == 0;
var increase4 = (i - 4) % 10 == 0;
var increase5 = (i - 5) % 10 == 0;
var increase7 = (i - 7) % 10 == 0;
var increase8 = (i - 8) % 10 == 0;
var increase9 = (i - 9) % 10 == 0;

swordInc++;
swordHp += swordInc;

if (increase2 || increase3 || increase4 || increase5 || increase7 || increase8 || increase9 || i % 10 == 0)
{
swordInc++;
swordHp += swordInc;
}

_hpData[(byte)CharacterClassType.Swordsman, i] = swordHp;
}

var magecHp = 205;
var mageInc = 15;
for (var i = 0; i < Constants.MaxLevel; i++)
{
mageInc++;
magecHp += mageInc;

_hpData[(byte)CharacterClassType.Mage, i] = magecHp;
}

var archerHp = 190;
var archerInc = 14;
for (var i = 0; i < Constants.MaxLevel; i++)
{
var increase4 = (i - 4) % 10 == 0;
var increase7 = (i - 7) % 10 == 0;

archerInc++;
archerHp += archerInc;

if (increase4 || increase7 || i % 10 == 0)
{
archerInc++;
archerHp += archerInc;
}

_hpData[(byte)CharacterClassType.Archer, i] = archerHp;
}

var fighterHp = 190;
var fighterInc = 14;
for (var i = 0; i < Constants.MaxLevel; i++)
{
foreach (CharacterClassType classType in Enum.GetValues(typeof(CharacterClassType)))
{
var increase2 = (i - 2) % 10 == 0;
var increase4 = (i - 4) % 10 == 0;
var increase6 = (i - 6) % 10 == 0;
var increase7 = (i - 7) % 10 == 0;

fighterInc++;
fighterHp += fighterInc;

if (increase2 || increase4 || increase6 || increase7 || i % 10 == 0)
for (var i = 0; i < Constants.MaxLevel; i++)
{
fighterInc++;
fighterHp += fighterInc;
var hpx = i + 1 + Math.Floor(i * (double)(ClassConstants[(int)classType][0]) / 10);
var hp = (0.5 * Math.Pow(hpx, 2)) + (15.5 * hpx) + 205;
_hpData[(int)classType, i] = (long)hp;
}

_hpData[(byte)CharacterClassType.MartialArtist, i] = fighterHp;
}
}
public long GetHp(CharacterClassType @class, byte level)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
// -----------------------------------

using NosCore.Shared.Enumerations;

using NosCore.Shared.Enumerations;
namespace NosCore.Algorithm.JobExperienceService
{
public class JobExperienceService : IJobExperienceService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using NosCore.Shared.Enumerations;
using System;
using System.Collections.Generic;
using System.Text;

namespace NosCore.Algorithm.MagicDefenceService
{
Expand Down
1 change: 0 additions & 1 deletion src/NosCore.Algorithm/MpService/MpService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
// -----------------------------------

using System;
using NosCore.Shared.Enumerations;

namespace NosCore.Algorithm.MpService
Expand Down
2 changes: 1 addition & 1 deletion src/NosCore.Algorithm/NosCore.Algorithm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<RepositoryUrl>https://github.com/NosCoreIO/NosCore.Algorithm.git</RepositoryUrl>
<PackageIconUrl></PackageIconUrl>
<PackageTags>nostale, noscore, nostale private server source, nostale emulator</PackageTags>
<Version>0.6.2</Version>
<Version>0.6.3</Version>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Description>NosCore's Algorithm</Description>
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
// -----------------------------------

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

namespace NosCore.Algorithm.SecondaryDamageService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using NosCore.Shared.Enumerations;
using System;
using System.Collections.Generic;
using System.Text;

namespace NosCore.Algorithm.SecondaryHitRateService
{
Expand Down