2025-10-31 10:02:30 -04:00
|
|
|
|
using SLSFramework.UModAssistance;
|
2025-10-03 00:02:43 -04:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Continentis.MainGame.Character
|
|
|
|
|
|
{
|
|
|
|
|
|
public abstract partial class CharacterBuffBase : BuffBase<CharacterBase>
|
|
|
|
|
|
{
|
|
|
|
|
|
public CharacterBase attachedCharacter;
|
|
|
|
|
|
public CharacterBase sourceCharacter;
|
|
|
|
|
|
|
2025-10-23 00:49:44 -04:00
|
|
|
|
public IconSubmodule iconSubmodule;
|
|
|
|
|
|
public EventSubmodule eventSubmodule;
|
2025-10-03 00:02:43 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public partial class CharacterBuffBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public override void Apply(CharacterBase attached)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Apply(attached, null);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public abstract void Apply(CharacterBase attachedCharacter, CharacterBase sourceCharacter = null);
|
|
|
|
|
|
}
|
2025-10-31 10:02:30 -04:00
|
|
|
|
|
|
|
|
|
|
public partial class CharacterBuffBase
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 创建一个角色战斗Buff实例
|
|
|
|
|
|
/// 注意,此函数依赖ModManager的类型注册功能,请确保在Mod加载时已注册对应Buff类型
|
|
|
|
|
|
/// 此函数中的T并不是原型参数,而是获取Mod中注册的类型用的
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public T CreateCharacterBuff<T>(params object[] parameters) where T :CharacterCombatBuffBase
|
|
|
|
|
|
{
|
|
|
|
|
|
string buffTypeID = ModManager.GetTypeID(typeof(T));
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(buffTypeID))
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.LogError($"Failed to get buff name for type {typeof(T).FullName}");
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ModManager.CreateInstance<T>(buffTypeID, parameters);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public T CreateCharacterBuff<T>(string buffTypeID, params object[] parameters) where T :CharacterCombatBuffBase
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(buffTypeID))
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.LogError($"Failed to get buff name for type {typeof(T).FullName}");
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ModManager.CreateInstance<T>(buffTypeID, parameters);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-10-03 00:02:43 -04:00
|
|
|
|
}
|