暂存4
This commit is contained in:
Binary file not shown.
@@ -210,6 +210,59 @@
|
||||
</li>
|
||||
```
|
||||
|
||||
#### 5.9 `Effect_ModifyVariable`
|
||||
- **功能**: 对一个数值类型的变量进行数学运算(加、减、乘、除)。
|
||||
- **Class**: `WulaFallenEmpire.Effect_ModifyVariable`
|
||||
- **字段**:
|
||||
- `name`: (必须) 要修改的变量的名称。
|
||||
- `value`: (必须) 用于运算的数值。
|
||||
- `operation`: (必须) 执行的运算类型。可选值: `Add`, `Subtract`, `Multiply`, `Divide`。
|
||||
- **示例**:
|
||||
```xml
|
||||
<!-- 将变量 'player_score' 的值增加 10 -->
|
||||
<li Class="WulaFallenEmpire.Effect_ModifyVariable">
|
||||
<name>player_score</name>
|
||||
<value>10</value>
|
||||
<operation>Add</operation>
|
||||
</li>
|
||||
```
|
||||
|
||||
#### 5.10 `Effect_ClearVariable`
|
||||
- **功能**: 从事件上下文中移除一个变量。
|
||||
- **Class**: `WulaFallenEmpire.Effect_ClearVariable`
|
||||
- **字段**:
|
||||
- `name`: (必须) 要移除的变量的名称。
|
||||
- **示例**:
|
||||
```xml
|
||||
<li Class="WulaFallenEmpire.Effect_ClearVariable">
|
||||
<name>quest_completed_flag</name>
|
||||
</li>
|
||||
```
|
||||
|
||||
#### 5.11 `Effect_AddQuest`
|
||||
- **功能**: 给予玩家一个由游戏核心任务系统生成的任务。
|
||||
- **Class**: `WulaFallenEmpire.Effect_AddQuest`
|
||||
- **字段**:
|
||||
- `quest`: (必须) 要给予的 `QuestScriptDef` 的 `defName`。
|
||||
- **示例**:
|
||||
```xml
|
||||
<li Class="WulaFallenEmpire.Effect_AddQuest">
|
||||
<quest>OpportunitySite_BanditCamp</quest>
|
||||
</li>
|
||||
```
|
||||
|
||||
#### 5.12 `Effect_FinishResearch`
|
||||
- **功能**: 立即完成一个指定的科技研究项目。
|
||||
- **Class**: `WulaFallenEmpire.Effect_FinishResearch`
|
||||
- **字段**:
|
||||
- `research`: (必须) 要完成的 `ResearchProjectDef` 的 `defName`。
|
||||
- **示例**:
|
||||
```xml
|
||||
<li Class="WulaFallenEmpire.Effect_FinishResearch">
|
||||
<research>MicroelectronicsBasics</research>
|
||||
</li>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6. 核心概念:条件 (`Condition`)
|
||||
@@ -219,32 +272,54 @@
|
||||
### 已实现的 `Condition` 列表
|
||||
|
||||
#### 6.1 `Condition_VariableEquals`
|
||||
- **功能**: 检查一个变量是否等于指定的值。
|
||||
- **功能**: 检查一个变量是否等于指定的值。支持字符串和数字的比较。
|
||||
- **Class**: `WulaFallenEmpire.Condition_VariableEquals`
|
||||
- **字段**:
|
||||
- `name`: (必须) 要检查的变量的名称。
|
||||
- `value`: (必须) 要比较的值(作为字符串)。
|
||||
- **示例**:
|
||||
- `value`: (可选) 要比较的固定值。
|
||||
- `valueVariableName`: (可选) 存储比较值的变量的名称。如果同时提供了 `value` 和 `valueVariableName`,则优先使用 `valueVariableName`。
|
||||
- **示例 (与固定值比较)**:
|
||||
```xml
|
||||
<li Class="WulaFallenEmpire.Condition_VariableEquals">
|
||||
<name>my_quest_progress</name>
|
||||
<value>1</value>
|
||||
<name>quest_status</name>
|
||||
<value>completed</value>
|
||||
</li>
|
||||
```
|
||||
- **示例 (与另一个变量比较)**:
|
||||
```xml
|
||||
<li Class="WulaFallenEmpire.Condition_VariableEquals">
|
||||
<name>player_choice</name>
|
||||
<valueVariableName>correct_answer</valueVariableName>
|
||||
</li>
|
||||
```
|
||||
|
||||
#### 6.2 `Condition_VariableGreaterThan`
|
||||
- **功能**: 检查一个变量是否大于指定的值。
|
||||
- **Class**: `WulaFallenEmpire.Condition_VariableGreaterThan`
|
||||
- **字段**:
|
||||
#### 6.2 数值比较条件
|
||||
以下所有条件都用于数值比较,并共享相同的字段。
|
||||
|
||||
- **通用字段**:
|
||||
- `name`: (必须) 要检查的变量的名称。
|
||||
- `value`: (必须) 要比较的数值。
|
||||
- **示例**:
|
||||
- `value`: (可选) 要比较的固定数值。
|
||||
- `valueVariableName`: (可选) 存储比较数值的变量的名称。如果同时提供了 `value` 和 `valueVariableName`,则优先使用 `valueVariableName`。
|
||||
|
||||
- **`Condition_VariableGreaterThan`**: 检查变量是否 **大于** 比较值。
|
||||
- **`Condition_VariableLessThan`**: 检查变量是否 **小于** 比较值。
|
||||
- **`Condition_VariableGreaterThanOrEqual`**: 检查变量是否 **大于或等于** 比较值。
|
||||
- **`Condition_VariableLessThanOrEqual`**: 检查变量是否 **小于或等于** 比较值。
|
||||
|
||||
- **示例 (大于固定值)**:
|
||||
```xml
|
||||
<li Class="WulaFallenEmpire.Condition_VariableGreaterThan">
|
||||
<name>player_reputation</name>
|
||||
<value>50</value>
|
||||
</li>
|
||||
```
|
||||
- **示例 (小于或等于另一个变量)**:
|
||||
```xml
|
||||
<li Class="WulaFallenEmpire.Condition_VariableLessThanOrEqual">
|
||||
<name>current_threat_level</name>
|
||||
<valueVariableName>max_allowed_threat</valueVariableName>
|
||||
</li>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
Binary file not shown.
@@ -2,10 +2,6 @@
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{F5AE8C3B-0221-4C16-A128-9A62D521A8FF}|WulaFallenEmpire.csproj|c:\\steam\\steamapps\\common\\rimworld\\mods\\3516260226\\source\\wulafallenempire\\debugactions.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{F5AE8C3B-0221-4C16-A128-9A62D521A8FF}|WulaFallenEmpire.csproj|solutionrelative:debugactions.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{F5AE8C3B-0221-4C16-A128-9A62D521A8FF}|WulaFallenEmpire.csproj|C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\mentalstate_brokenpersonality.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{F5AE8C3B-0221-4C16-A128-9A62D521A8FF}|WulaFallenEmpire.csproj|solutionrelative:mentalstate_brokenpersonality.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
@@ -71,19 +67,6 @@
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "DebugActions.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\DebugActions.cs",
|
||||
"RelativeDocumentMoniker": "DebugActions.cs",
|
||||
"ToolTip": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\DebugActions.cs",
|
||||
"RelativeToolTip": "DebugActions.cs",
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAkAAAAAAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-07-27T07:57:05.014Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"Title": "MentalState_BrokenPersonality.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\MentalState_BrokenPersonality.cs",
|
||||
"RelativeDocumentMoniker": "MentalState_BrokenPersonality.cs",
|
||||
@@ -91,11 +74,12 @@
|
||||
"RelativeToolTip": "MentalState_BrokenPersonality.cs",
|
||||
"ViewState": "AQIAABMAAAAAAAAAAAAAwEsAAAAjAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-07-25T13:51:03.13Z"
|
||||
"WhenOpened": "2025-07-25T13:51:03.13Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"DocumentIndex": 1,
|
||||
"Title": "Recipe_AdministerWulaMechRepairKit.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\Recipe_AdministerWulaMechRepairKit.cs",
|
||||
"RelativeDocumentMoniker": "Recipe_AdministerWulaMechRepairKit.cs",
|
||||
@@ -107,7 +91,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 3,
|
||||
"DocumentIndex": 2,
|
||||
"Title": "WorkGiver_Warden_DeliverEnergy.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\WorkGiver_Warden_DeliverEnergy.cs",
|
||||
"RelativeDocumentMoniker": "WorkGiver_Warden_DeliverEnergy.cs",
|
||||
@@ -119,7 +103,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 4,
|
||||
"DocumentIndex": 3,
|
||||
"Title": "WorkGiverDefExtension_FeedWula.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\WorkGiverDefExtension_FeedWula.cs",
|
||||
"RelativeDocumentMoniker": "WorkGiverDefExtension_FeedWula.cs",
|
||||
@@ -131,7 +115,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 5,
|
||||
"DocumentIndex": 4,
|
||||
"Title": "CompApparelInterceptor.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\CompApparelInterceptor.cs",
|
||||
"RelativeDocumentMoniker": "CompApparelInterceptor.cs",
|
||||
@@ -143,7 +127,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 6,
|
||||
"DocumentIndex": 5,
|
||||
"Title": "Projectile_Launch_Patch.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\HarmonyPatches\\Projectile_Launch_Patch.cs",
|
||||
"RelativeDocumentMoniker": "HarmonyPatches\\Projectile_Launch_Patch.cs",
|
||||
@@ -155,7 +139,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 8,
|
||||
"DocumentIndex": 7,
|
||||
"Title": "IngestPatch.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\IngestPatch.cs",
|
||||
"RelativeDocumentMoniker": "IngestPatch.cs",
|
||||
@@ -167,7 +151,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 7,
|
||||
"DocumentIndex": 6,
|
||||
"Title": "CompUseEffect_WulaSkillTrainer.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\CompUseEffect_WulaSkillTrainer.cs",
|
||||
"RelativeDocumentMoniker": "CompUseEffect_WulaSkillTrainer.cs",
|
||||
@@ -179,7 +163,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 9,
|
||||
"DocumentIndex": 8,
|
||||
"Title": "Building_Wula_DarkEnergy_Engine.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\Building_Wula_DarkEnergy_Engine.cs",
|
||||
"RelativeDocumentMoniker": "Building_Wula_DarkEnergy_Engine.cs",
|
||||
@@ -191,7 +175,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 10,
|
||||
"DocumentIndex": 9,
|
||||
"Title": "HediffComp_RegenerateBackstory.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\HediffComp_RegenerateBackstory.cs",
|
||||
"RelativeDocumentMoniker": "HediffComp_RegenerateBackstory.cs",
|
||||
@@ -203,7 +187,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 11,
|
||||
"DocumentIndex": 10,
|
||||
"Title": "WulaFallenEmpireMod.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\WulaFallenEmpireMod.cs",
|
||||
"RelativeDocumentMoniker": "WulaFallenEmpireMod.cs",
|
||||
@@ -215,7 +199,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 12,
|
||||
"DocumentIndex": 11,
|
||||
"Title": "MechanitorPatch.cs",
|
||||
"DocumentMoniker": "C:\\Steam\\steamapps\\common\\RimWorld\\Mods\\3516260226\\Source\\WulaFallenEmpire\\MechanitorPatch.cs",
|
||||
"RelativeDocumentMoniker": "MechanitorPatch.cs",
|
||||
@@ -224,10 +208,6 @@
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAACEAAAAJAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-07-18T10:20:31.368Z"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{269a02dc-6af8-11d3-bdc4-00c04f688e50}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace WulaFallenEmpire
|
||||
{
|
||||
public string name;
|
||||
public string value;
|
||||
public string valueVariableName;
|
||||
|
||||
public override bool IsMet(out string reason)
|
||||
{
|
||||
@@ -22,11 +23,21 @@ namespace WulaFallenEmpire
|
||||
return false;
|
||||
}
|
||||
|
||||
// Simple string comparison for now. Can be expanded.
|
||||
bool met = variable.ToString() == value;
|
||||
string compareValue = value;
|
||||
if (!string.IsNullOrEmpty(valueVariableName))
|
||||
{
|
||||
compareValue = EventContext.GetVariable<object>(valueVariableName)?.ToString();
|
||||
if (compareValue == null)
|
||||
{
|
||||
reason = $"Comparison variable '{valueVariableName}' not set.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool met = variable.ToString() == compareValue;
|
||||
if (!met)
|
||||
{
|
||||
reason = $"Requires {name} = {value} (Current: {variable})";
|
||||
reason = $"Requires {name} = {compareValue} (Current: {variable})";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -35,25 +46,40 @@ namespace WulaFallenEmpire
|
||||
return met;
|
||||
}
|
||||
}
|
||||
|
||||
public class Condition_VariableGreaterThan : Condition
|
||||
|
||||
public abstract class Condition_CompareVariable : Condition
|
||||
{
|
||||
public string name;
|
||||
public float value;
|
||||
public string valueVariableName;
|
||||
|
||||
protected abstract bool Compare(float var1, float var2);
|
||||
protected abstract string GetOperatorString();
|
||||
|
||||
public override bool IsMet(out string reason)
|
||||
{
|
||||
float variable = EventContext.GetVariable<float>(name, float.MinValue);
|
||||
if (variable == float.MinValue)
|
||||
float variable = EventContext.GetVariable<float>(name, float.NaN);
|
||||
if (float.IsNaN(variable))
|
||||
{
|
||||
reason = $"Variable '{name}' not set.";
|
||||
reason = $"Variable '{name}' not set or not a number.";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool met = variable > value;
|
||||
float compareValue = value;
|
||||
if (!string.IsNullOrEmpty(valueVariableName))
|
||||
{
|
||||
compareValue = EventContext.GetVariable<float>(valueVariableName, float.NaN);
|
||||
if (float.IsNaN(compareValue))
|
||||
{
|
||||
reason = $"Comparison variable '{valueVariableName}' not set or not a number.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool met = Compare(variable, compareValue);
|
||||
if (!met)
|
||||
{
|
||||
reason = $"Requires {name} > {value} (Current: {variable})";
|
||||
reason = $"Requires {name} {GetOperatorString()} {compareValue} (Current: {variable})";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -63,4 +89,27 @@ namespace WulaFallenEmpire
|
||||
}
|
||||
}
|
||||
|
||||
public class Condition_VariableGreaterThan : Condition_CompareVariable
|
||||
{
|
||||
protected override bool Compare(float var1, float var2) => var1 > var2;
|
||||
protected override string GetOperatorString() => ">";
|
||||
}
|
||||
|
||||
public class Condition_VariableLessThan : Condition_CompareVariable
|
||||
{
|
||||
protected override bool Compare(float var1, float var2) => var1 < var2;
|
||||
protected override string GetOperatorString() => "<";
|
||||
}
|
||||
|
||||
public class Condition_VariableGreaterThanOrEqual : Condition_CompareVariable
|
||||
{
|
||||
protected override bool Compare(float var1, float var2) => var1 >= var2;
|
||||
protected override string GetOperatorString() => ">=";
|
||||
}
|
||||
|
||||
public class Condition_VariableLessThanOrEqual : Condition_CompareVariable
|
||||
{
|
||||
protected override bool Compare(float var1, float var2) => var1 <= var2;
|
||||
protected override string GetOperatorString() => "<=";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,8 +264,109 @@ namespace WulaFallenEmpire
|
||||
TaggedString finalText = letterText.Formatted(pawn.Named("PAWN")).AdjustedFor(pawn);
|
||||
PawnRelationUtility.TryAppendRelationsWithColonistsInfo(ref finalText, ref finalLabel, pawn);
|
||||
Find.LetterStack.ReceiveLetter(finalLabel, finalText, letterDef ?? LetterDefOf.PositiveEvent, pawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum VariableOperation
|
||||
{
|
||||
Add,
|
||||
Subtract,
|
||||
Multiply,
|
||||
Divide
|
||||
}
|
||||
|
||||
public class Effect_ModifyVariable : Effect
|
||||
{
|
||||
public string name;
|
||||
public float value;
|
||||
public VariableOperation operation;
|
||||
|
||||
public override void Execute(Dialog_CustomDisplay dialog)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
Log.Error("[WulaFallenEmpire] Effect_ModifyVariable has a null or empty name.");
|
||||
return;
|
||||
}
|
||||
|
||||
float currentValue = EventContext.GetVariable<float>(name, 0f);
|
||||
|
||||
switch (operation)
|
||||
{
|
||||
case VariableOperation.Add:
|
||||
currentValue += value;
|
||||
break;
|
||||
case VariableOperation.Subtract:
|
||||
currentValue -= value;
|
||||
break;
|
||||
case VariableOperation.Multiply:
|
||||
currentValue *= value;
|
||||
break;
|
||||
case VariableOperation.Divide:
|
||||
if (value != 0)
|
||||
{
|
||||
currentValue /= value;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error($"[WulaFallenEmpire] Effect_ModifyVariable tried to divide by zero for variable '{name}'.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
EventContext.SetVariable(name, currentValue);
|
||||
}
|
||||
}
|
||||
|
||||
public class Effect_ClearVariable : Effect
|
||||
{
|
||||
public string name;
|
||||
|
||||
public override void Execute(Dialog_CustomDisplay dialog)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
Log.Error("[WulaFallenEmpire] Effect_ClearVariable has a null or empty name.");
|
||||
return;
|
||||
}
|
||||
EventContext.ClearVariable(name);
|
||||
}
|
||||
}
|
||||
|
||||
public class Effect_AddQuest : Effect
|
||||
{
|
||||
public QuestScriptDef quest;
|
||||
|
||||
public override void Execute(Dialog_CustomDisplay dialog)
|
||||
{
|
||||
if (quest == null)
|
||||
{
|
||||
Log.Error("[WulaFallenEmpire] Effect_AddQuest has a null quest Def.");
|
||||
return;
|
||||
}
|
||||
|
||||
Quest newQuest = Quest.MakeRaw();
|
||||
newQuest.root = quest;
|
||||
newQuest.id = Find.UniqueIDsManager.GetNextQuestID();
|
||||
Find.QuestManager.Add(newQuest);
|
||||
}
|
||||
}
|
||||
|
||||
public class Effect_FinishResearch : Effect
|
||||
{
|
||||
public ResearchProjectDef research;
|
||||
|
||||
public override void Execute(Dialog_CustomDisplay dialog)
|
||||
{
|
||||
if (research == null)
|
||||
{
|
||||
Log.Error("[WulaFallenEmpire] Effect_FinishResearch has a null research Def.");
|
||||
return;
|
||||
}
|
||||
|
||||
Find.ResearchManager.FinishProject(research);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,5 +48,17 @@ namespace WulaFallenEmpire
|
||||
variables.Clear();
|
||||
Log.Message("[EventContext] All variables cleared.");
|
||||
}
|
||||
|
||||
public static void ClearVariable(string name)
|
||||
{
|
||||
if (variables.Remove(name))
|
||||
{
|
||||
Log.Message($"[EventContext] Cleared variable '{name}'.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning($"[EventContext] Tried to clear variable '{name}' but it was not found.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<Compile Include="MentalState_BrokenPersonality.cs" />
|
||||
<Compile Include="MentalStateDefExtension_BrokenPersonality.cs" />
|
||||
<Compile Include="MentalBreakWorker_BrokenPersonality.cs" />
|
||||
<Compile Include="DebugActions.cs" />
|
||||
<Compile Include="EventSystem\DebugActions.cs" />
|
||||
<Compile Include="EventSystem\Condition.cs" />
|
||||
<Compile Include="EventSystem\CustomUIDef.cs" />
|
||||
<Compile Include="EventSystem\Dialog_CustomDisplay.cs" />
|
||||
|
||||
Reference in New Issue
Block a user