-
Notifications
You must be signed in to change notification settings - Fork 48
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 #2274 from planetarium/feature/vampire
Introduce `Vampiric` : `ActionBuff`
- Loading branch information
Showing
17 changed files
with
2,643 additions
and
2,449 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 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
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,81 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Nekoyume.Model.BattleStatus.Arena; | ||
using Nekoyume.Model.Skill; | ||
using Nekoyume.TableData; | ||
|
||
namespace Nekoyume.Model.Buff | ||
{ | ||
[Serializable] | ||
public class Vampiric : ActionBuff | ||
{ | ||
public int BasisPoint { get; } | ||
|
||
public Vampiric(ActionBuffSheet.Row row, int basisPoint) : base(row) | ||
{ | ||
BasisPoint = basisPoint; | ||
} | ||
|
||
public Vampiric(SkillCustomField customField, ActionBuffSheet.Row row) : base(customField, row) | ||
{ | ||
BasisPoint = customField.BuffValue; | ||
} | ||
|
||
protected Vampiric(Vampiric value) : base(value) | ||
{ | ||
BasisPoint = value.BasisPoint; | ||
} | ||
|
||
public override object Clone() | ||
{ | ||
return new Vampiric(this); | ||
} | ||
|
||
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 * BasisPoint / 10000m); | ||
affectedCharacter.Heal(effect); | ||
// Copy new Character with healed. | ||
var infos = new List<BattleStatus.Skill.SkillInfo> | ||
{ | ||
new(affectedCharacter.Id, | ||
affectedCharacter.IsDead, | ||
affectedCharacter.Thorn, | ||
effect, | ||
false, | ||
SkillCategory.Heal, | ||
simulatorWaveTurn, | ||
RowData.ElementalType, | ||
RowData.TargetType, | ||
target: target) | ||
}; | ||
return new BattleStatus.Tick(RowData.Id, | ||
target, | ||
infos, | ||
ArraySegment<BattleStatus.Skill.SkillInfo>.Empty); | ||
} | ||
|
||
public ArenaSkill GiveEffectForArena(ArenaCharacter affectedCharacter, ArenaSkill.ArenaSkillInfo skillInfo, int simulatorWaveTurn) | ||
{ | ||
var clone = (ArenaCharacter)affectedCharacter.Clone(); | ||
var effect = (int)(skillInfo.Effect * BasisPoint / 10000m); | ||
affectedCharacter.Heal(effect); | ||
// Copy new Character with healed. | ||
var infos = new List<ArenaSkill.ArenaSkillInfo> | ||
{ | ||
new(affectedCharacter, | ||
effect, | ||
false, | ||
SkillCategory.Heal, | ||
simulatorWaveTurn, | ||
RowData.ElementalType, | ||
RowData.TargetType) | ||
}; | ||
return new ArenaTick( | ||
clone, | ||
infos, | ||
null); | ||
} | ||
} | ||
} |
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.