42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using System.Collections.Generic;
|
||
using Continentis.MainGame;
|
||
using Continentis.MainGame.Card;
|
||
using Continentis.MainGame.Character;
|
||
using Continentis.MainGame.Commands;
|
||
using SLSUtilities.General;
|
||
|
||
namespace Continentis.Mods.Basic.Cards
|
||
{
|
||
/// <summary>
|
||
/// 顺劈斩:对全体敌人造成物理伤害。
|
||
/// AOE 范围由卡牌数据的目标配置决定(targetCount = -1)。
|
||
/// </summary>
|
||
public class Cleave : CardLogicBase
|
||
{
|
||
private AttackContext PhysicsCtx => AttackContext.Default(card)
|
||
.WithDamageKeywords(CardKeywords.Physics);
|
||
|
||
public override void SetUpLogicComponents()
|
||
{
|
||
AddLogicComponent<CardLogicComponent_Attack>();
|
||
}
|
||
|
||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||
{
|
||
return Cmd.Sequential(
|
||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||
ForEachTarget(targetList, target => Cmd.Do(() =>
|
||
{
|
||
AttackContext ctx = PhysicsCtx;
|
||
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
|
||
}))
|
||
);
|
||
}
|
||
|
||
public override void ApplyAttributeChangesByCard()
|
||
{
|
||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
|
||
}
|
||
}
|
||
}
|