60 lines
2.1 KiB
C#
60 lines
2.1 KiB
C#
using System.Collections.Generic;
|
|
using Continentis.MainGame;
|
|
using Continentis.MainGame.Card;
|
|
using Continentis.MainGame.Character;
|
|
using Continentis.MainGame.Commands;
|
|
using Continentis.Mods.Basic.Buffs;
|
|
using SLSUtilities.General;
|
|
|
|
namespace Continentis.Mods.Basic.Cards
|
|
{
|
|
/// <summary>
|
|
/// 冻伤:对单体目标造成冰属性伤害,并施加冻结和易伤 Buff。
|
|
/// </summary>
|
|
public class Frostbite : CardLogicBase
|
|
{
|
|
private const string BUFF_FREEZE_COUNT = "Buff_Freeze_Count";
|
|
private const string BUFF_VULNERABLE_COUNT = "Buff_Vulnerable_Count";
|
|
|
|
private AttackContext IceCtx => AttackContext.Default(card)
|
|
.WithDamageKeywords(CardKeywords.Ice);
|
|
|
|
public override void SetUpLogicComponents()
|
|
{
|
|
AddLogicComponent<CardLogicComponent_Attack>();
|
|
}
|
|
|
|
/// <summary>选中目标时更新伤害预览。</summary>
|
|
public override void TargetingEffect(CharacterBase target)
|
|
{
|
|
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, IceCtx));
|
|
}
|
|
|
|
/// <summary>取消选中时以无目标模式刷新预览。</summary>
|
|
public override void UntargetingEffect()
|
|
{
|
|
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(IceCtx));
|
|
}
|
|
|
|
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
|
{
|
|
return ForEachTarget(targetList, target => Cmd.Sequential(
|
|
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
|
Cmd.Do(() =>
|
|
{
|
|
AttackContext ctx = IceCtx;
|
|
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
|
|
|
|
CreateCharacterBuff<Freeze>(GetAttribute(BUFF_FREEZE_COUNT)).Apply(target, user, this);
|
|
CreateCharacterBuff<Vulnerable>(GetAttribute(BUFF_VULNERABLE_COUNT)).Apply(target, user, this);
|
|
})
|
|
));
|
|
}
|
|
|
|
public override void ApplyAttributeChangesByCard()
|
|
{
|
|
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
|
|
}
|
|
}
|
|
}
|