MOD!
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public sealed class Basic_Nimble : CombatBuffBase, IBuffExtension_IntegerRange
|
||||
{
|
||||
public Basic_Nimble(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this,false)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, true, -1, stack, true);
|
||||
|
||||
this.generalAttributeSubmodule = new GeneralAttributeSubmodule(this);
|
||||
this.generalAttributeSubmodule.numericChange.Add("DodgeGainOffset", stack);
|
||||
|
||||
(this as IBuffExtension_IntegerRange).Initialize(stack);
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText("Nimble", attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.ModifyStack(this.unitedStackSubmodule.stackAmount);
|
||||
|
||||
int newStack = existingBuff.unitedStackSubmodule.stackAmount;
|
||||
existingBuff.generalAttributeSubmodule.numericChange["DodgeGainOffset"] = newStack;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnBecomePositive()
|
||||
{
|
||||
contentSubmodule.originalFunctionText = "Buff_Basic_Nimble_FunctionTextPos".Localize();
|
||||
buffType = BuffType.Positive;
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
public void OnBecomeNegative()
|
||||
{
|
||||
contentSubmodule.originalFunctionText = "Buff_Basic_Nimble_FunctionTextNeg".Localize();
|
||||
buffType = BuffType.Negative;
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user