Files
Continentis/Assets/Mods/Basic/Cards/Scripts/Knight/UtmostStrike.cs

50 lines
1.8 KiB
C#
Raw Normal View History

2025-10-31 10:02:30 -04:00
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
2025-10-30 23:31:29 -04:00
using UnityEngine;
2025-10-31 10:02:30 -04:00
namespace Continentis.Mods.Basic.Cards
2025-10-30 23:31:29 -04:00
{
2025-10-31 10:02:30 -04:00
public class UtmostStrike : CardLogicBase
2025-10-30 23:31:29 -04:00
{
2025-11-15 12:17:34 -05:00
public override void SetUpLogicComponents()
2025-10-31 10:02:30 -04:00
{
AddLogicComponent<CardLogicComponent_Attack>();
AddLogicComponent<CardLogicComponent_SelectHandCards>().SetCondition(SelectCondition).SetEffect(SelectEffect);
}
2025-11-15 12:17:34 -05:00
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
2025-10-31 10:02:30 -04:00
{
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<CharacterBase>(target =>
{
2025-11-15 12:17:34 -05:00
user.Attack(target, GetTargetedFinalDamage(target));
2025-10-31 10:02:30 -04:00
})); //对目标造成伤害
LogicComponent<CardLogicComponent_SelectHandCards>().AddSelectionCommands(ref mainGroup);
2025-11-08 09:50:55 -05:00
return new List<CommandBase> { mainGroup };
2025-10-31 10:02:30 -04:00
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
}
private bool SelectCondition(CardInstance card)
{
2025-11-15 12:17:34 -05:00
return card.contentSubmodule.cardType is not CardType.Attack;
2025-10-31 10:02:30 -04:00
}
private void SelectEffect(CardInstance card)
{
CommandQueueManager.Instance.AddCommand(user.deckSubmodule.DiscardCard(card, true), new CommandContext());
}
2025-10-30 23:31:29 -04:00
}
2025-10-31 10:02:30 -04:00
}