using System.Collections.Generic; using Continentis.MainGame.Card; using Continentis.MainGame.Character; using Continentis.MainGame.Commands; using SLSUtilities.General; using UnityEngine; namespace Continentis.Mods.Basic.Cards.Cleric { public class ChainBlessing : CardLogicBase { public override void SetUpLogicComponents() { AddLogicComponent(); } public override CommandGroup PlayEffect(List targetList) { return Cmd.Sequential( new Cmd_PlayAnimation(user.characterView, "Skill"), Cmd.Do(() => { 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 power cards in hand to copy."); } }) ); } } }