This commit is contained in:
2026-03-27 12:01:28 +08:00
parent 75717ba814
commit 0603c60bde
19 changed files with 136 additions and 685 deletions

View File

@@ -2,6 +2,14 @@
"Version": 1,
"WorkspaceRootPath": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\hediffs\\ara_gestaltnode\\compgestalt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:hediffs\\ara_gestaltnode\\compgestalt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\hediffs\\ara_hivemind\\hediff_hivemindmaster.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:hediffs\\ara_hivemind\\hediff_hivemindmaster.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\arachnaelog.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:arachnaelog.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
@@ -23,12 +31,38 @@
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "CompGestalt.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Hediffs\\ARA_GestaltNode\\CompGestalt.cs",
"RelativeDocumentMoniker": "Hediffs\\ARA_GestaltNode\\CompGestalt.cs",
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Hediffs\\ARA_GestaltNode\\CompGestalt.cs",
"RelativeToolTip": "Hediffs\\ARA_GestaltNode\\CompGestalt.cs",
"ViewState": "AgIAAEQAAAAAAAAAAAAUwF0AAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-03-27T03:57:27.664Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "Hediff_HiveMindMaster.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Hediffs\\ARA_HiveMind\\Hediff_HiveMindMaster.cs",
"RelativeDocumentMoniker": "Hediffs\\ARA_HiveMind\\Hediff_HiveMindMaster.cs",
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Hediffs\\ARA_HiveMind\\Hediff_HiveMindMaster.cs",
"RelativeToolTip": "Hediffs\\ARA_HiveMind\\Hediff_HiveMindMaster.cs",
"ViewState": "AgIAADQAAAAAAAAAAAAuwFkAAAAuAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-03-27T03:54:02.567Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "ArachnaeLog.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\ArachnaeLog.cs",
"RelativeDocumentMoniker": "ArachnaeLog.cs",
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\ArachnaeLog.cs",
"RelativeToolTip": "ArachnaeLog.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAA0AAAAwAAAAAAAAAA==",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABAAAAANAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-03-26T06:10:50.583Z",
"EditorCaption": ""

View File

@@ -3,7 +3,7 @@ using Verse;
namespace ArachnaeSwarm
{
// DefOf 类放在这里,以便在命名空间内共享
// <EFBFBD><EFBFBD> DefOf <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD>ڹ<EFBFBD><EFBFBD><EFBFBD>
[DefOf]
public static class ARA_TrainableDefOf
{
@@ -93,7 +93,6 @@ namespace ArachnaeSwarm
{
public static StatDef ARA_GestaltBandwidth;
public static StatDef ARA_GestaltBandwidthCost;
public static StatDef ARA_SwarmSpell_Cooldown_Delay;
public static StatDef ARA_SwarmSpell_Level;
static ARA_StatDefOf()
{

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using RimWorld;
using System.Collections.Generic;
using System.Linq;
using Verse;
namespace ArachnaeSwarm
@@ -58,6 +59,7 @@ namespace ArachnaeSwarm
Pawn hiveNode = relation.otherPawn;
if (hiveNode != null && hiveNode.IsGestaltNode(GestaltNodeType.HiveNode))
{
if (tracker.GetControlGroup(hiveNode) == null)
{
tracker.AssignPawnToControlGroup(hiveNode);
@@ -92,7 +94,85 @@ namespace ArachnaeSwarm
GestaltTracker?.GameComponentTick();
}
/// <summary>
/// 强制将主节点的文化赋予无人机
/// </summary>
private void ForceMasterCultureToDrone(Pawn drone)
{
// 检查是否有意识形态系统Ideology DLC
if (ModsConfig.IdeologyActive)
{
// 获取主节点的意识形态
Ideo masterIdeo = this.pawn.Ideo;
if (masterIdeo != null)
{
// 设置无人机的意识形态为主节点的意识形态
if (drone.Ideo != masterIdeo)
{
drone.ideo.SetIdeo(masterIdeo);
ArachnaeLog.Debug($"[ArachnaeSwarm] Set drone {drone.LabelShort} ideology to master's ideology: {masterIdeo.name}");
}
}
else
{
ArachnaeLog.Debug($"[ArachnaeSwarm] Master {this.pawn.LabelShort} has no ideology to assign to drone {drone.LabelShort}");
}
// 强制同步文化相关记忆和状态
SyncCulturalMemories(drone);
}
else
{
ArachnaeLog.Debug($"[ArachnaeSwarm] Ideology DLC not active, skipping cultural assignment for drone {drone.LabelShort}");
}
}
/// <summary>
/// 同步文化相关记忆和状态
/// </summary>
private void SyncCulturalMemories(Pawn drone)
{
try
{
// 清除可能存在的文化冲突记忆
if (drone.needs?.mood != null)
{
// 移除与文化转换相关的负面想法
var thoughtsToRemove = drone.needs.mood.thoughts.memories.Memories
.Where(thought => thought.def.defName.Contains("Cultural") ||
thought.def.defName.Contains("Ideo") ||
thought.def.defName.Contains("Convert"))
.ToList();
foreach (var thought in thoughtsToRemove)
{
drone.needs.mood.thoughts.memories.RemoveMemory(thought);
}
if (thoughtsToRemove.Count > 0)
{
ArachnaeLog.Debug($"[ArachnaeSwarm] Removed {thoughtsToRemove.Count} cultural conflict thoughts from drone {drone.LabelShort}");
}
// 添加蜂群文化适应的正面想法
ThoughtDef culturalHarmonyThought = DefDatabase<ThoughtDef>.GetNamedSilentFail("ARA_CulturalHarmony");
if (culturalHarmonyThought != null)
{
drone.needs.mood.thoughts.memories.TryGainMemory(culturalHarmonyThought);
}
}
// 同步服装和文化偏好
ArachnaeLog.Debug($"[ArachnaeSwarm] Successfully synchronized cultural memories for drone {drone.LabelShort}");
}
catch (System.Exception ex)
{
ArachnaeLog.Debug($"[ArachnaeSwarm] Error synchronizing cultural memories for drone {drone.LabelShort}: {ex.Message}");
}
}
public override void PostExposeData()
{
base.PostExposeData();