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 UtmostStrike : CardLogicBase { protected override void SetUpLogicComponents() { AddLogicComponent(); AddLogicComponent().SetCondition(SelectCondition).SetEffect(SelectEffect); } protected override CommandBase PlayEffect(List targetList) { CommandGroup mainGroup = TargetListCommandGroup(targetList, new Cmd_PlayAnimation(user.characterView, "Attack"), new Cmd_PlaySFX("SFX_Basic_SwordStrike"), new Cmd_SpawnVFX("VFX_Basic_RedImpact"), new Cmd_ParamFunction(target => { user.Attack(target, GetFinalDamage(target)); })); //对目标造成伤害 LogicComponent().AddSelectionCommands(ref mainGroup); return mainGroup; } public override void ApplyAttributeChangesByCard() { LogicComponent().SetDamage_Slash(); } private bool SelectCondition(CardInstance card) { return card.cardLogic.contentSubmodule.cardType is not CardType.Attack; } private void SelectEffect(CardInstance card) { CommandQueueManager.Instance.AddCommand(user.deckSubmodule.DiscardCard(card, true), new CommandContext()); } } }