58 lines
2.2 KiB
C#
58 lines
2.2 KiB
C#
using System;
|
|
using Continentis.MainGame;
|
|
using Continentis.MainGame.Character;
|
|
using SLSUtilities.General;
|
|
using UnityEngine;
|
|
|
|
namespace Continentis.Mods.Basic.Buffs
|
|
{
|
|
public sealed class Strength : CharacterCombatBuffBase, IBuffExtension_IntegerRange
|
|
{
|
|
public Strength(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("PhysicsDamageDealtOffset", stack);
|
|
|
|
(this as IBuffExtension_IntegerRange).Initialize(stack);
|
|
}
|
|
|
|
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
|
{
|
|
MainGameManager.Instance.basePrefabs.GenerateInfoText("Strength", attachedCharacter.characterView);
|
|
|
|
if (FindExistingSameBuff(out existingBuff))
|
|
{
|
|
existingBuff.unitedStackSubmodule.ModifyStack(this.unitedStackSubmodule.stackAmount);
|
|
|
|
int newStack = existingBuff.unitedStackSubmodule.stackAmount;
|
|
existingBuff.generalAttributeSubmodule.numericChange["PhysicsDamageDealtOffset"] = newStack;
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public void OnBecomePositive()
|
|
{
|
|
contentSubmodule.originalFunctionText = "Buff_Basic_Strength_FunctionTextPos".Localize();
|
|
buffType = BuffType.Positive;
|
|
iconSubmodule.Update();
|
|
}
|
|
|
|
public void OnBecomeNegative()
|
|
{
|
|
contentSubmodule.originalFunctionText = "Buff_Basic_Strength_FunctionTextNeg".Localize();
|
|
buffType = BuffType.Negative;
|
|
iconSubmodule.Update();
|
|
}
|
|
}
|
|
} |