Files
Continentis/Assets/Mods/Basic/Cards/Scripts/General/Attack/UtmostStrike.cs

46 lines
1.6 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;
2026-04-17 12:01:50 -04:00
using SLSUtilities.General;
2025-10-30 23:31:29 -04:00
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
2026-03-20 11:56:50 -04:00
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
2025-10-31 10:02:30 -04:00
{
2026-03-20 11:56:50 -04:00
CommandGroup mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
2025-10-31 10:02:30 -04:00
new Cmd_PlayAnimation(user.characterView, "Attack"),
2025-12-10 18:22:26 -05:00
new Cmd_PlaySFX("SFX_Basic_GeneralMeleeImpact").SetDelay(0.2f),
new Cmd_SpawnVFX("VFX_Basic_DefaultAttack").SetDelay(0.2f),
2026-04-01 12:23:27 -04:00
Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target)))
2026-03-20 11:56:50 -04:00
));
2025-10-31 10:02:30 -04:00
LogicComponent<CardLogicComponent_SelectHandCards>().AddSelectionCommands(ref mainGroup);
2026-03-20 11:56:50 -04:00
return mainGroup;
2025-10-31 10:02:30 -04:00
}
2026-03-20 11:56:50 -04:00
2025-10-31 10:02:30 -04:00
public override void ApplyAttributeChangesByCard()
{
2026-04-08 04:48:35 -04:00
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
2025-10-31 10:02:30 -04:00
}
2026-03-20 11:56:50 -04:00
2025-10-31 10:02:30 -04:00
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
}
2026-03-20 11:56:50 -04:00
2025-10-31 10:02:30 -04:00
private void SelectEffect(CardInstance card)
{
2026-03-20 11:56:50 -04:00
CommandQueueManager.Instance.AddCommand(user.deckSubmodule.DiscardCard(card, true, 0f));
2025-10-31 10:02:30 -04:00
}
2025-10-30 23:31:29 -04:00
}
2025-10-31 10:02:30 -04:00
}