-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/1.10.0' into bugfix/world-8-skills
- Loading branch information
Showing
42 changed files
with
243 additions
and
1,077 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
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
namespace Lib9c.Tests.Model | ||
{ | ||
using Nekoyume; | ||
using Nekoyume.Model.Buff; | ||
using Nekoyume.Model.Stat; | ||
using Nekoyume.TableData; | ||
using Xunit; | ||
|
||
public class CharacterStatsTest | ||
{ | ||
private readonly TableSheets _tableSheets; | ||
|
||
public CharacterStatsTest() | ||
{ | ||
_tableSheets = new TableSheets(TableSheetsImporter.ImportSheets()); | ||
} | ||
|
||
[Fact] | ||
public void DeBuffLimit() | ||
{ | ||
var stats = | ||
new CharacterStats( | ||
_tableSheets.CharacterSheet[GameConfig.DefaultAvatarCharacterId], | ||
1); | ||
var deBuffLimitSheet = new DeBuffLimitSheet(); | ||
// -100% def but limit -50% stats | ||
var deBuff = new StatBuff(_tableSheets.StatBuffSheet[503012]); | ||
var groupId = deBuff.RowData.GroupId; | ||
deBuffLimitSheet.Set($"group_id,percentage\n{groupId},-50"); | ||
var def = stats.DEF; | ||
stats.AddBuff(deBuff, deBuffLimitSheet: deBuffLimitSheet); | ||
var modifier = deBuffLimitSheet[groupId].GetModifier(deBuff.RowData.StatType); | ||
Assert.Equal(modifier.GetModifiedAll(def), stats.DEF); | ||
|
||
// -500% critical with no limit | ||
var deBuff2 = new StatBuff(_tableSheets.StatBuffSheet[204003]); | ||
Assert.True(stats.CRI > 0); | ||
stats.AddBuff(deBuff2, deBuffLimitSheet: deBuffLimitSheet); | ||
Assert.Equal(0, stats.CRI); | ||
} | ||
} | ||
} |
Oops, something went wrong.