65 lines
2.1 KiB
C#
65 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 SLSFramework.General;
|
|
|
|
namespace Continentis.Mods.Basic.Cards
|
|
{
|
|
/// <summary>
|
|
/// 沙暴:对全体敌人造成多段土属性伤害,并施加目盲 Buff。
|
|
/// AOE 范围由卡牌数据的目标配置决定,动画只播放一次。
|
|
/// </summary>
|
|
public class SandStorm : CardLogicBase
|
|
{
|
|
private const string ATTACK_COUNT = "Attack_Count";
|
|
private const string BUFF_BLIND_COUNT = "Buff_Blind_Count";
|
|
|
|
private AttackContext EarthCtx => AttackContext.Default(card)
|
|
.WithDamageKeywords(CardKeywords.Earth);
|
|
|
|
public override void SetUpLogicComponents()
|
|
{
|
|
AddLogicComponent<CardLogicComponent_Attack>();
|
|
}
|
|
|
|
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
|
{
|
|
int hitCount = GetAttribute(ATTACK_COUNT);
|
|
|
|
CommandGroup hitsGroup = Cmd.Sequential();
|
|
for (int i = 0; i < hitCount; i++)
|
|
{
|
|
hitsGroup.AddCommand(Cmd.After(0.5f, () =>
|
|
{
|
|
AttackContext ctx = EarthCtx;
|
|
foreach (CharacterBase target in targetList)
|
|
{
|
|
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
|
|
}
|
|
}));
|
|
}
|
|
|
|
return Cmd.Sequential(
|
|
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
|
hitsGroup,
|
|
Cmd.Do(() =>
|
|
{
|
|
int blindCount = GetAttribute(BUFF_BLIND_COUNT);
|
|
foreach (CharacterBase target in targetList)
|
|
{
|
|
CreateCharacterBuff<Blind>(blindCount).Apply(target, user, this);
|
|
}
|
|
})
|
|
);
|
|
}
|
|
|
|
public override void ApplyAttributeChangesByCard()
|
|
{
|
|
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
|
|
}
|
|
}
|
|
}
|