-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2026 from planetarium/release/0.3.0
Merge `Release/0.3.0` into development
- Loading branch information
Showing
47 changed files
with
456 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace Lib9c.Tests.Action | ||
{ | ||
using System; | ||
using Nekoyume.Battle; | ||
using Xunit; | ||
|
||
public class HitHelperTest | ||
{ | ||
[Fact] | ||
public void GetHitStep2() | ||
{ | ||
// copy from previous logic | ||
int GetHitStep2Legacy(int attackerHit, int defenderHit) | ||
{ | ||
attackerHit = Math.Max(1, attackerHit); | ||
defenderHit = Math.Max(1, defenderHit); | ||
var additionalCorrection = (int)((attackerHit - defenderHit / 3m) / defenderHit * 100); | ||
return Math.Min( | ||
Math.Max(additionalCorrection, HitHelper.GetHitStep2AdditionalCorrectionMin), | ||
HitHelper.GetHitStep2AdditionalCorrectionMax); | ||
} | ||
|
||
for (int i = 0; i < 9; i++) | ||
{ | ||
for (int j = 0; j < 9; j++) | ||
{ | ||
var legacy = GetHitStep2Legacy(i, j); | ||
var current = HitHelper.GetHitStep2(i, j); | ||
Assert.True(legacy == current, $"{i}, {j}, {legacy}, {current}"); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule .Libplanet
updated
5 files
+17 −0 | CHANGES.md | |
+1 −1 | Libplanet.Explorer/Libplanet.Explorer.csproj | |
+83 −34 | Libplanet.RocksDBStore/RocksDBStore.cs | |
+17 −0 | Libplanet/ByteUtil.cs | |
+4 −4 | Libplanet/Libplanet.csproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.