58 lines
1.9 KiB
C#
58 lines
1.9 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 SLSFramework.General;
|
|
|
|
namespace Continentis.Mods.Basic.Cards
|
|
{
|
|
/// <summary>
|
|
/// 切割:对单体目标造成物理伤害,并施加流血 Buff。
|
|
/// </summary>
|
|
public class Cutting : CardLogicBase
|
|
{
|
|
private const string BUFF_BLEED_STACK = "Buff_Bleed_Stack";
|
|
|
|
private AttackContext PhysicsCtx => AttackContext.Default(card)
|
|
.WithDamageKeywords(CardKeywords.Physics);
|
|
|
|
public override void SetUpLogicComponents()
|
|
{
|
|
AddLogicComponent<CardLogicComponent_Attack>();
|
|
}
|
|
|
|
/// <summary>选中目标时更新伤害预览。</summary>
|
|
public override void TargetingEffect(CharacterBase target)
|
|
{
|
|
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, PhysicsCtx));
|
|
}
|
|
|
|
/// <summary>取消选中时以无目标模式刷新预览。</summary>
|
|
public override void UntargetingEffect()
|
|
{
|
|
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(PhysicsCtx));
|
|
}
|
|
|
|
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
|
{
|
|
return ForEachTarget(targetList, target => Cmd.Sequential(
|
|
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
|
Cmd.Do(() =>
|
|
{
|
|
AttackContext ctx = PhysicsCtx;
|
|
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
|
|
|
|
CreateCharacterBuff<Bleed>(GetAttribute(BUFF_BLEED_STACK)).Apply(target, user, this);
|
|
})
|
|
));
|
|
}
|
|
|
|
public override void ApplyAttributeChangesByCard()
|
|
{
|
|
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
|
|
}
|
|
}
|
|
}
|