This commit is contained in:
SoulliesOfficial
2025-10-24 09:11:22 -04:00
parent 61a397dd4c
commit 76157e3cb1
329 changed files with 8609 additions and 4549 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.MainGame
@@ -17,20 +18,22 @@ namespace Continentis.MainGame
{
Positive,
Negative,
Neutral
Neutral,
Focusing
}
public abstract partial class BuffBase<T>
public abstract partial class BuffBase<T> : IPrioritized
{
public BuffType buffType;
public BuffDispelLevel dispelThreshold;
public ContentSubmodule contentSubmodule;
protected void Initialize(BuffType buffType, BuffDispelLevel dispelThreshold)
public int Priority { get; private set; }
protected void Initialize(BuffType buffType, BuffDispelLevel dispelThreshold, int priority = 0)
{
this.buffType = buffType;
this.dispelThreshold = dispelThreshold;
this.Priority = priority + (buffType == BuffType.Focusing ? 10000 : 0);
}
}
@@ -105,8 +108,8 @@ namespace Continentis.MainGame
}
/// <summary>
/// Buff被正常移除时调用。在Buff生命周期结束时调用。
/// UntriggerRemove不会调用此函数。但是此函数通常情况下绝不会被调用。
/// Buff被正常移除(包括驱散)时调用。在Buff生命周期结束时调用。
/// UntriggerRemove不会调用此函数。但是UntriggerRemove通常情况下绝不会被调用。
/// </summary>
public virtual void OnBuffRemove()
{

View File

@@ -38,12 +38,12 @@ namespace Continentis.MainGame
/// <param name="willLocalizeFuncText">是否本地化功能描述文本默认为true设为false说明此Buff具有不止一条本地化文本需要切换。</param>
public ContentSubmodule(BuffBase<T> buff, bool willLocalizeFuncText = true) : base(buff)
{
string className = buff.GetType().Name;
this.displayName = ("Buff_" + className + "_DisplayName").Localize();
string modClassName = ModManager.GetModClassName(buff.GetType());
this.displayName = ("Buff_" + modClassName + "_DisplayName").Localize();
if (willLocalizeFuncText)
{
this.originalFunctionText = ("Buff_" + className + "_FunctionText").Localize();
this.originalFunctionText = ("Buff_" + modClassName + "_FunctionText").Localize();
this.interpretedFunctionText = this.originalFunctionText;
}
@@ -83,7 +83,7 @@ namespace Continentis.MainGame
{
if (string.IsNullOrEmpty(iconID))
{
this.iconID = "BuffIcon_" + buff.GetType().Name;
this.iconID = "BuffIcon_" + ModManager.GetModClassName(buff.GetType());
}
else
{
@@ -294,7 +294,6 @@ namespace Continentis.MainGame
stackAmount = Mathf.Min(stackAmount, stackUpperLimit);
}
}
public void AddStack(int amount) => ModifyStack(amount);
public void ReduceStack(int amount) => ModifyStack(-amount);
public void ModifyStack(int amount)