声音
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// 在 EffectBase.cs 中添加以下类
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
|
||||
namespace WulaFallenEmpire
|
||||
{
|
||||
public class Effect_SetTimedFlag : EffectBase
|
||||
{
|
||||
public string flagName;
|
||||
public int durationTicks; // 持续时间(tick),负数表示永久
|
||||
|
||||
public override void Execute(Window dialog = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(flagName))
|
||||
{
|
||||
Log.Error("[WulaFallenEmpire] Effect_SetTimedFlag has a null or empty flagName.");
|
||||
return;
|
||||
}
|
||||
|
||||
var eventVarManager = Find.World.GetComponent<EventVariableManager>();
|
||||
eventVarManager.SetTimedFlag(flagName, durationTicks);
|
||||
|
||||
string durationInfo = durationTicks < 0 ? "permanent" : $"{durationTicks} ticks";
|
||||
Log.Message($"[EventSystem] Set timed flag '{flagName}' with duration: {durationInfo}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user