using Continentis.MainGame.Card; using Continentis.MainGame.Character; using Continentis.MainGame.Commands; using SLSFramework.General; using System.Collections.Generic; using UnityEngine; namespace Continentis.Mods.Basic.Cards.Cleric { public class ChainBlessing : CardLogicBase { public override void SetUpLogicComponents() { AddLogicComponent(); } public override List PlayEffect(List targetList) { CommandGroup mainGroup = new CommandGroup(ExecutionMode.Sequential); mainGroup.AddCommand(new Cmd_PlayAnimation(user.characterView, "Skill")); mainGroup.AddCommand(new Cmd_Function(() => { //Get powe cards in hand var powerCards = new List(); foreach (var card in user.deckSubmodule.HandPile) { if (card.contentSubmodule.cardType == MainGame.Card.CardType.Power) { powerCards.Add(card); } } if (powerCards.TryGetRandom(out CardInstance randomPowerCard)) { var copyCount = GetAttribute("CopyCount"); for (int i = 0; i < copyCount; i++) { CardInstance newCard = CardInstance.GenerateCardInstance(randomPowerCard, user, "Hand"); newCard.cardLogic.SetAttribute("StaminaCost", 0); newCard.GenerateHandCardView("Hand"); } } else { Debug.LogWarning("ChainBlessing: No other power cards in hand to copy."); } })); return new List { mainGroup }; } } }