46 lines
1.7 KiB
C#
46 lines
1.7 KiB
C#
using Continentis.MainGame;
|
|
using Continentis.MainGame.Character;
|
|
using SLSFramework.General;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Continentis.MainGame.Card;
|
|
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("FreedomOfMovement", new PrioritizedAction<CardInstance, List<CharacterBase>>(OnBeforePlayCard));
|
|
}
|
|
|
|
private void OnBeforePlayCard(CardInstance instance, List<CharacterBase> list)
|
|
{
|
|
if (instance.contentSubmodule.cardType == CardType.Power)
|
|
{
|
|
CommandQueueManager.Instance.AddCommand(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;
|
|
}
|
|
}
|
|
}
|