Files
SoulliesOfficial ac98ec3aef 更新
2026-04-17 12:01:50 -04:00

61 lines
2.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Combat;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSUtilities.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 链式闪电对主目标造成雷Storm属性伤害。
/// 若任意敌方角色有感电ShockedBuff则对这些角色额外执行一次伤害。
/// </summary>
public class ChainLightning : CardLogicBase
{
private AttackContext StormCtx => AttackContext.Default(card)
.WithDamageKeywords(CardKeywords.Storm);
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
CharacterBase mainTarget = targetList[0];
// 获取所有敌方角色
List<CharacterBase> allEnemies = CombatMainManager.Instance.characterController.GetAllEnemies(user);
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Attack"),
Cmd.Do(() =>
{
// 对主目标造成雷属性伤害
AttackTarget(mainTarget, GetTargetedFinalDamage(mainTarget, StormCtx), StormCtx);
}),
Cmd.Do(() =>
{
// 检查所有敌人对有Shocked buff的目标额外执行一次伤害
foreach (CharacterBase enemy in allEnemies)
{
if (enemy.combatBuffSubmodule.HasBuff<Shocked>())
{
// 使用相同的Storm context造成额外伤害
AttackTarget(enemy, GetTargetedFinalDamage(enemy, StormCtx), StormCtx);
}
}
})
);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
}
}
}