From 430145f381527cdd2533c8883a254718f1241405 Mon Sep 17 00:00:00 2001 From: sonohoshi Date: Wed, 6 Dec 2023 15:15:16 +0900 Subject: [PATCH] fix Vampiric calculating logic to using basis point from percent --- .Lib9c.Tests/Model/PlayerTest.cs | 2 +- Lib9c/Model/Buff/Vampiric.cs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.Lib9c.Tests/Model/PlayerTest.cs b/.Lib9c.Tests/Model/PlayerTest.cs index 819cf52f32..ead2f76dfe 100644 --- a/.Lib9c.Tests/Model/PlayerTest.cs +++ b/.Lib9c.Tests/Model/PlayerTest.cs @@ -648,7 +648,7 @@ public void Vampiric(int duration, int percent) var prevAttack = logList.Take(i).OfType() .Last(); Assert.Equal( - (int)(prevAttack.SkillInfos.First().Effect * vampiric.Percentage / 100m), + (int)(prevAttack.SkillInfos.First().Effect * vampiric.BasisPoint / 10000m), healInfo.Effect); } } diff --git a/Lib9c/Model/Buff/Vampiric.cs b/Lib9c/Model/Buff/Vampiric.cs index 59538c70f7..e85f688875 100644 --- a/Lib9c/Model/Buff/Vampiric.cs +++ b/Lib9c/Model/Buff/Vampiric.cs @@ -9,21 +9,21 @@ namespace Nekoyume.Model.Buff [Serializable] public class Vampiric : ActionBuff { - public int Percentage { get; } + public int BasisPoint { get; } - public Vampiric(ActionBuffSheet.Row row, int percentage) : base(row) + public Vampiric(ActionBuffSheet.Row row, int basisPoint) : base(row) { - Percentage = percentage; + BasisPoint = basisPoint; } public Vampiric(SkillCustomField customField, ActionBuffSheet.Row row) : base(customField, row) { - Percentage = customField.BuffValue; + BasisPoint = customField.BuffValue; } protected Vampiric(Vampiric value) : base(value) { - Percentage = value.Percentage; + BasisPoint = value.BasisPoint; } public override object Clone() @@ -34,7 +34,7 @@ public override object Clone() public BattleStatus.Skill GiveEffect(CharacterBase affectedCharacter, BattleStatus.Skill.SkillInfo skillInfo, int simulatorWaveTurn, bool copyCharacter = true) { var target = copyCharacter ? (CharacterBase) affectedCharacter.Clone() : null; - var effect = (int)(skillInfo.Effect * Percentage / 100m); + var effect = (int)(skillInfo.Effect * BasisPoint / 10000m); affectedCharacter.Heal(effect); // Copy new Character with healed. var infos = new List @@ -59,7 +59,7 @@ public BattleStatus.Skill GiveEffect(CharacterBase affectedCharacter, BattleStat public ArenaSkill GiveEffectForArena(ArenaCharacter affectedCharacter, ArenaSkill.ArenaSkillInfo skillInfo, int simulatorWaveTurn) { var clone = (ArenaCharacter)affectedCharacter.Clone(); - var effect = (int)(skillInfo.Effect * Percentage / 100m); + var effect = (int)(skillInfo.Effect * BasisPoint / 10000m); affectedCharacter.Heal(effect); // Copy new Character with healed. var infos = new List