继续
This commit is contained in:
58
Assets/Mods/Basic/Characters/CombatBuffs/General/Prowess.cs
Normal file
58
Assets/Mods/Basic/Characters/CombatBuffs/General/Prowess.cs
Normal file
@@ -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 Prowess : CharacterCombatBuffBase, IBuffExtension_IntegerRange
|
||||
{
|
||||
public Prowess(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("Prowess", 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_Prowess_FunctionTextPos".Localize();
|
||||
buffType = BuffType.Positive;
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
public void OnBecomeNegative()
|
||||
{
|
||||
contentSubmodule.originalFunctionText = "Buff_Basic_Prowess_FunctionTextNeg".Localize();
|
||||
buffType = BuffType.Negative;
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user