Files
Cielonos/Assets/Scripts/MainGame/Base/BuffSystem/Inheritors/CharacterBuffs/ElectronicDisturbance.cs
SoulliesOfficial f7af60351b 阶段性完成
2025-12-08 05:27:53 -05:00

46 lines
1.6 KiB
C#

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();
}
}
}