Cleric card done

This commit is contained in:
FrazeRIP
2025-11-13 00:58:50 -06:00
parent edbae155bd
commit 427674331a
13 changed files with 244 additions and 10 deletions

View File

@@ -2,16 +2,52 @@
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
{
protected override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_GenerateCards>();
}
protected override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
{
return base.PlayEffect(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<CardInstance>();
foreach (var card in user.deckSubmodule.HandPile)
{
if (card.cardLogic.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.cardLogic, 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<CommandBase> { mainGroup };
}
}
}

View File

@@ -2,6 +2,7 @@
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using System.Collections.Generic;
@@ -11,7 +12,12 @@ namespace Continentis.Mods.Basic.Cards.Cleric
{
protected override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
{
return base.PlayEffect(targetList);
CommandGroup mainGroup = TargetListCommandGroup(targetList,
new Cmd_ParamFunction<CharacterBase>(0.01f, target =>
{
CreateCharacterBuff<Buffs.FreedomOfMovement>(GetAttribute("BuffStack")).Apply(target, user, this);
}));
return new List<CommandBase> { mainGroup };
}
}
}

View File

@@ -2,6 +2,8 @@
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
using System.Collections.Generic;
@@ -11,7 +13,12 @@ namespace Continentis.Mods.Basic.Cards.Cleric
{
protected override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
{
return base.PlayEffect(targetList);
CommandGroup mainGroup = TargetListCommandGroup(targetList,
new Cmd_ParamFunction<CharacterBase>(0.01f, target =>
{
CreateCharacterBuff<Withstand>(GetAttribute("BuffStack")).Apply(target, user, this);
}));
return new List<CommandBase> { mainGroup };
}
}
}