using System.Collections.Generic; using Continentis.MainGame.Card; using Continentis.MainGame.Character; using Continentis.MainGame.Commands; using SLSFramework.General; using UnityEngine; namespace Continentis.Mods.Basic.Cards { public class ArcaneMissiles : CardLogicBase { public override void SetUpLogicComponents() { AddLogicComponent(); } public override CommandGroup PlayEffect(List targetList) { // 多段攻击:先等1秒(占位),再对每个目标依次连续打多段 CommandGroup occupiedGroup = Cmd.Sequential( Cmd.After(1f, () => CommandQueueManager.Instance.AddCommand(Cmd.Do(() => Debug.Log("插队指令,等待动画播放完毕"))) ) ); CommandGroup mainGroup = ForEachTarget(targetList, target => { CommandGroup perTargetGroup = Cmd.Sequential(new Cmd_PlayAnimation(user.characterView, "Attack")); int attackCount = GetAttribute("AttackCount"); for (int i = 0; i < attackCount; i++) { perTargetGroup.AddCommand(Cmd.After(0.4f, () => { user.Attack(target, GetTargetedFinalDamage(target)); Debug.Log("攻击命令触发"); })); } return perTargetGroup; }); CommandGroup finalGroup = Cmd.Sequential(Cmd.Do(() => Debug.Log("不插队指令"))); CommandGroup firstGroup = Cmd.Sequential( Cmd.Do(() => Debug.Log("插队指令,抽牌")), new Cmd_DrawCards(user.deckSubmodule, 1) ); return Cmd.Sequential(occupiedGroup, mainGroup, finalGroup, firstGroup); } public override void ApplyAttributeChangesByCard() { LogicComponent().SetDamage_Arcane(); } } }