Skip to content

Commit

Permalink
fix Vampiric calculating logic to using basis point from percent
Browse files Browse the repository at this point in the history
  • Loading branch information
sonohoshi committed Dec 6, 2023
1 parent 07c48b1 commit 430145f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .Lib9c.Tests/Model/PlayerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ public void Vampiric(int duration, int percent)
var prevAttack = logList.Take(i).OfType<Nekoyume.Model.BattleStatus.NormalAttack>()
.Last();
Assert.Equal(
(int)(prevAttack.SkillInfos.First().Effect * vampiric.Percentage / 100m),
(int)(prevAttack.SkillInfos.First().Effect * vampiric.BasisPoint / 10000m),
healInfo.Effect);
}
}
Expand Down
14 changes: 7 additions & 7 deletions Lib9c/Model/Buff/Vampiric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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<BattleStatus.Skill.SkillInfo>
Expand All @@ -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<ArenaSkill.ArenaSkillInfo>
Expand Down

0 comments on commit 430145f

Please sign in to comment.