Files
Continentis/Assets/Mods/Basic/Characters/CombatBuffs/Cleric/FreedomOfMovement.cs
2025-11-13 00:58:50 -06:00

45 lines
1.7 KiB
C#

using Continentis.MainGame;
using Continentis.MainGame.Character;
using SLSFramework.General;
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Continentis.Mods.Basic.Buffs
{
public class FreedomOfMovement : CharacterCombatBuffBase
{
public FreedomOfMovement(int stack)
{
Initialize(BuffType.Positive, BuffDispelLevel.Basic);
this.contentSubmodule = new ContentSubmodule(this)
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
this.iconSubmodule = new IconSubmodule(this);
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
this.eventSubmodule = new EventSubmodule(this);
this.eventSubmodule.onBeforePlayCard.Add(this.GetType().FullName, new PrioritizedAction<MainGame.Card.CardInstance, System.Collections.Generic.List<CharacterBase>>(OnBeforePlayCard));
}
private void OnBeforePlayCard(MainGame.Card.CardInstance instance, List<CharacterBase> list)
{
if (instance.cardLogic.contentSubmodule.cardType == MainGame.Card.CardType.Power)
{
this.attachedCharacter.deckSubmodule.DrawCards(unitedStackSubmodule.stackAmount);
}
}
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
{
MainGameManager.Instance.basePrefabs.GenerateInfoText("Freedom Of Movement", attachedCharacter.characterView);
if (FindExistingSameBuff(out existingBuff))
{
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
return false;
}
return true;
}
}
}