Files
Continentis/Assets/Mods/Basic/Cards/Scripts/ObsoleteGeneral/Cohesion.cs
2025-11-10 11:18:19 -05:00

43 lines
1.6 KiB
C#

using System.Collections.Generic;
using System.Linq;
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards.General.Skills
{
public class Cohesion : CardLogicBase
{
protected override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_SelectHandCards>().SetCondition(SelectCondition).SetEffect(SelectEffect);
}
protected override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
{
base.PlayEffect(targetList);
CommandGroup mainGroup = new CommandGroup(ExecutionMode.Sequential);
mainGroup.AddCommand(new Cmd_PlayAnimation(user.characterView, "Skill"));
LogicComponent<CardLogicComponent_SelectHandCards>()
.AddSelectionCommands(ref mainGroup, "Card_Basic_Cohesion_SelectionCommandTitle".Localize(), 1);
return new List<CommandBase> { mainGroup };
}
private bool SelectCondition(CardInstance card)
{
CardType type = card.cardLogic.contentSubmodule.cardType;
return type != CardType.Status && type != CardType.Curse;
}
private void SelectEffect(CardInstance card)
{
card.cardLogic.ModifyAttribute("StaminaCost", -1);
card.cardLogic.contentSubmodule.keywords.Add("Retain");
card.cardLogic.contentSubmodule.originalFunctionText += " + $Keyword(\"Retain\")";
card.cardLogic.contentSubmodule.dirtyMark = true;
}
}
}