using Cielonos.UI; using SLSUtilities.FunctionalAnimation; using UnityEngine; namespace Cielonos.MainGame.Characters.Buffs { public class ElectronicDisturbance : CharacterBuffBase { public ElectronicDisturbance(int stackAmount) { Initialize(BuffType.Negative, BuffDispelLevel.Strong); this.contentSubmodule = new ContentSubmodule(this); this.unitedStackSubmodule = new UnitedStackSubmodule(this, stackAmount); this.timeSubmodule = new TimeSubmodule(this, true); this.timeSubmodule.AddIntervalAction(() => { this.unitedStackSubmodule.ReduceStack(1); }, 1f); //this.independentStackSubmodule = new IndependentStackSubmodule(this, stackAmount, duration); } public override bool OnBuffApply(out CharacterBuffBase existingBuff) { if (FindExistingSameBuff(out existingBuff)) { //existingBuff.independentStackSubmodule.Merge(this.independentStackSubmodule); existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount); return false; } return true; } public override void OnBuffUpdate() { base.OnBuffUpdate(); if (unitedStackSubmodule.stackAmount >= 100) { new GeneralIncapacitation(5f).Apply(attachedCharacter, sourceCharacter); Remove(); } PlayerCanvas.Instance.bossInfoUIArea[attachedCharacter]?.UpdateArmor(); } } }