Files
Continentis/Assets/Mods/Basic/Cards/Scripts/Cleric/ChainBlessing.cs

50 lines
1.7 KiB
C#
Raw Normal View History

2026-03-20 11:56:50 -04:00
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
2025-11-13 00:58:50 -06:00
using Continentis.MainGame.Commands;
using SLSFramework.General;
2025-11-13 00:58:50 -06:00
using UnityEngine;
namespace Continentis.Mods.Basic.Cards.Cleric
{
public class ChainBlessing : CardLogicBase
{
2025-11-15 12:17:34 -05:00
public override void SetUpLogicComponents()
2025-11-13 00:58:50 -06:00
{
AddLogicComponent<CardLogicComponent_GenerateCards>();
}
2026-03-20 11:56:50 -04:00
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
2026-03-20 11:56:50 -04:00
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() =>
2025-11-13 00:58:50 -06:00
{
2026-03-20 11:56:50 -04:00
var powerCards = new List<CardInstance>();
foreach (var card in user.deckSubmodule.HandPile)
2025-11-13 00:58:50 -06:00
{
2026-03-20 11:56:50 -04:00
if (card.contentSubmodule.cardType == MainGame.Card.CardType.Power)
powerCards.Add(card);
2025-11-13 00:58:50 -06:00
}
2026-03-20 11:56:50 -04:00
if (powerCards.TryGetRandom(out CardInstance randomPowerCard))
2025-11-13 00:58:50 -06:00
{
2026-03-20 11:56:50 -04:00
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");
}
2025-11-13 00:58:50 -06:00
}
2026-03-20 11:56:50 -04:00
else
{
Debug.LogWarning("ChainBlessing: No power cards in hand to copy.");
}
})
);
}
}
}
2026-03-20 11:56:50 -04:00