40 lines
1.5 KiB
C#
40 lines
1.5 KiB
C#
using Continentis.MainGame;
|
|
using Continentis.MainGame.Character;
|
|
using SLSFramework.General;
|
|
using UnityEngine;
|
|
|
|
namespace Continentis.Mods.Basic.Buffs
|
|
{
|
|
public class KnifeTrick : CharacterCombatBuffBase
|
|
{
|
|
public KnifeTrick(int stack)
|
|
{
|
|
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
|
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.onOtherBuffRemoved.Add("KnifeTrick_AddSharpness", new PrioritizedAction<BuffBase<CharacterBase>>((buff) =>
|
|
{
|
|
if (buff is Sharpness)
|
|
{
|
|
CreateCharacterBuff<Sharpness>(unitedStackSubmodule.stackAmount).Apply(attachedCharacter, attachedCharacter);
|
|
}
|
|
}));
|
|
}
|
|
|
|
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
|
{
|
|
MainGameManager.Instance.basePrefabs.GenerateInfoText("Knife Trick", attachedCharacter.characterView);
|
|
if (FindExistingSameBuff(out existingBuff))
|
|
{
|
|
existingBuff.unitedStackSubmodule.ModifyStack(this.unitedStackSubmodule.stackAmount);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|