Files
Continentis/Assets/Mods/Basic/Cards/Scripts/General/Attack/UtmostStrike.cs
SoulliesOfficial ac98ec3aef 更新
2026-04-17 12:01:50 -04:00

46 lines
1.6 KiB
C#

using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSUtilities.General;
namespace Continentis.Mods.Basic.Cards
{
public class UtmostStrike : CardLogicBase
{
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
AddLogicComponent<CardLogicComponent_SelectHandCards>().SetCondition(SelectCondition).SetEffect(SelectEffect);
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
CommandGroup mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Attack"),
new Cmd_PlaySFX("SFX_Basic_GeneralMeleeImpact").SetDelay(0.2f),
new Cmd_SpawnVFX("VFX_Basic_DefaultAttack").SetDelay(0.2f),
Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target)))
));
LogicComponent<CardLogicComponent_SelectHandCards>().AddSelectionCommands(ref mainGroup);
return mainGroup;
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
}
private bool SelectCondition(CardInstance card)
{
return card.contentSubmodule.cardType is not CardType.Attack;
}
private void SelectEffect(CardInstance card)
{
CommandQueueManager.Instance.AddCommand(user.deckSubmodule.DiscardCard(card, true, 0f));
}
}
}