45 lines
1.7 KiB
C#
45 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
using Continentis.MainGame;
|
|
using Continentis.MainGame.Card;
|
|
using Continentis.MainGame.Character;
|
|
using SLSUtilities.General;
|
|
|
|
namespace Continentis.Mods.Basic.Buffs
|
|
{
|
|
public class FreedomOfMovement : CharacterCombatBuffBase
|
|
{
|
|
public FreedomOfMovement(int stack)
|
|
{
|
|
Initialize(BuffType.Positive, BuffDispelLevel.Basic);
|
|
contentSubmodule = new ContentSubmodule(this)
|
|
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
|
|
|
iconSubmodule = new IconSubmodule(this);
|
|
unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
|
|
|
eventSubmodule = new EventSubmodule(this);
|
|
eventSubmodule.onBeforePlayCard.Add("FreedomOfMovement",
|
|
new PrioritizedAction<CardInstance, List<CharacterBase>>(OnBeforePlayCard));
|
|
}
|
|
|
|
private void OnBeforePlayCard(CardInstance instance, List<CharacterBase> list)
|
|
{
|
|
if (instance.contentSubmodule.cardType == CardType.Power)
|
|
CommandQueueManager.Instance.AddCommand(
|
|
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(unitedStackSubmodule.stackAmount);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
} |