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>(OnBeforePlayCard)); } private void OnBeforePlayCard(MainGame.Card.CardInstance instance, List 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; } } }