This commit is contained in:
2026-03-27 17:27:59 +08:00
parent 0603c60bde
commit 3e161378c7
11 changed files with 142 additions and 70 deletions

Binary file not shown.

View File

@@ -1762,7 +1762,7 @@
<impactSound>Pawn_Melee_BigBash_HitPawn</impactSound>
<!-- 飞行效果 -->
<knockbackFlyerDef>PawnFlyer</knockbackFlyerDef>
<knockbackFlyerDef>ARA_PawnFlyer</knockbackFlyerDef>
<!-- <flightEffecterDef>FlightEffect_Knockback</flightEffecterDef> -->
<landingSound>Longjump_Land</landingSound>
@@ -1778,6 +1778,19 @@
</li>
</comps>
</AbilityDef>
<ThingDef Name="ARA_PawnFlyer" ParentName="PawnFlyerBase">
<defName>ARA_PawnFlyer</defName>
<thingClass>ArachnaeSwarm.SaferPawnFlyer</thingClass>
<pawnFlyer>
<flightSpeed>8</flightSpeed>
</pawnFlyer>
</ThingDef>
<ThingDef ParentName="ARA_PawnFlyer">
<defName>ARA_PawnFlyer_Stun</defName>
<pawnFlyer>
<stunDurationTicksRange>180~240</stunDurationTicksRange>
</pawnFlyer>
</ThingDef>
<AbilityDef>
<defName>ARA_Praetorian_Long_Jump</defName>
<label>禁卫种跳跃</label>

View File

@@ -206,7 +206,7 @@
<li Class="HediffCompProperties_DisappearsOnDeath"/>
<li Class="ArachnaeSwarm.HediffCompProperties_SpawnPawnOnRemoved">
<pawnKindDefs>
<li>ArachnaeBase_Race_Skyhive</li>
<li>ArachnaeBase_Race_Skyhive_Fastdie</li>
</pawnKindDefs>
<spawnCount>1</spawnCount>
<fixedBiologicalAge>0</fixedBiologicalAge>
@@ -285,7 +285,7 @@
<li Class="HediffCompProperties_DisappearsOnDeath"/>
<li Class="ArachnaeSwarm.HediffCompProperties_SpawnPawnOnRemoved">
<pawnKindDefs>
<li>ArachnaeBase_Race_Acidcut</li>
<li>ArachnaeBase_Race_Acidcut_Fastdie</li>
</pawnKindDefs>
<spawnCount>1</spawnCount>
<fixedBiologicalAge>0</fixedBiologicalAge>

View File

@@ -635,7 +635,6 @@
</li>
</stages>
</HediffDef>
<HediffDef>
<defName>ARA_Scavenger_Production_InsectJelly</defName>
@@ -673,4 +672,26 @@
</li>
</stages>
</HediffDef>
<HediffDef>
<defName>ARA_Incubator_FasterDie</defName>
<label>不知朝暮</label>
<description>该阿拉克涅虫族仅仅是为了一个简单的目标而创造,它们死的会比自己的同族更快。</description>
<hediffClass>HediffWithComps</hediffClass>
<isBad>false</isBad>
<defaultLabelColor>(0.8, 0.6, 0.0)</defaultLabelColor>
<scenarioCanAdd>false</scenarioCanAdd>
<stages>
<li>
</li>
</stages>
<comps>
<li Class="HediffCompProperties_DisappearsAndKills">
<disappearsAfterTicks>25200~28800</disappearsAfterTicks>
<showRemainingTime>true</showRemainingTime>
</li>
<li Class="HediffCompProperties_DisappearsOnDeath" />
</comps>
</HediffDef>
</Defs>

View File

@@ -517,7 +517,7 @@
</li>
</lifeStages>
</PawnKindDef>
<PawnKindDef ParentName="ARA_InsectKindBase">
<PawnKindDef Name="ArachnaeBase_Race_Skyhive" ParentName="ARA_InsectKindBase">
<defName>ArachnaeBase_Race_Skyhive</defName>
<label>阿拉克涅天巢种</label>
<race>ArachnaeBase_Race_Skyhive</race>
@@ -548,6 +548,14 @@
</li>
</lifeStages>
</PawnKindDef>
<PawnKindDef ParentName="ArachnaeBase_Race_Skyhive">
<defName>ArachnaeBase_Race_Skyhive_Fastdie</defName>
<startingHediffs>
<li>
<def>ARA_Incubator_FasterDie</def>
</li>
</startingHediffs>
</PawnKindDef>
<PawnKindDef Name="ArachnaeBase_Race_Acidcut" ParentName="ARA_InsectKindBase">
<defName>ArachnaeBase_Race_Acidcut</defName>
<label>阿拉克涅酸噬种</label>
@@ -569,6 +577,14 @@
</li>
</lifeStages>
</PawnKindDef>
<PawnKindDef ParentName="ArachnaeBase_Race_Acidcut">
<defName>ArachnaeBase_Race_Acidcut_Fastdie</defName>
<startingHediffs>
<li>
<def>ARA_Incubator_FasterDie</def>
</li>
</startingHediffs>
</PawnKindDef>
<PawnKindDef Name="ArachnaeBase_Race_Baneling" ParentName="ARA_InsectKindBase">
<defName>ArachnaeBase_Race_Baneling</defName>
<label>阿拉克涅爆裂种</label>

View File

@@ -2067,7 +2067,7 @@
</graphicData>
<projectile>
<speed>41</speed>
<spawnsPawnKind>ArachnaeBase_Race_Acidcut</spawnsPawnKind>
<spawnsPawnKind>ArachnaeBase_Race_Acidcut_Fastdie</spawnsPawnKind>
<tryAdjacentFreeSpaces>true</tryAdjacentFreeSpaces>
<damageDef>ARA_AcidBurn</damageDef>
<damageAmountBase>10</damageAmountBase>
@@ -2116,7 +2116,7 @@
</graphicData>
<projectile>
<speed>41</speed>
<spawnsPawnKind>ArachnaeBase_Race_Skyhive</spawnsPawnKind>
<spawnsPawnKind>ArachnaeBase_Race_Skyhive_Fastdie</spawnsPawnKind>
<tryAdjacentFreeSpaces>true</tryAdjacentFreeSpaces>
</projectile>
</ThingDef>

View File

@@ -2,16 +2,24 @@
"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\\abilities\\ara_fanshapedstunknockback\\safer_pawnflyer.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:abilities\\ara_fanshapedstunknockback\\safer_pawnflyer.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\\abilities\\ara_fanshapedstunknockback\\compproperties_abilityfanshapedstunknockback.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:abilities\\ara_fanshapedstunknockback\\compproperties_abilityfanshapedstunknockback.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_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}",
"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}",
"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}"
}
],
@@ -22,28 +30,54 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 1,
"SelectedChildIndex": 2,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "CompProperties_AbilityFanShapedStunKnockback.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_FanShapedStunKnockback\\CompProperties_AbilityFanShapedStunKnockback.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_FanShapedStunKnockback\\CompProperties_AbilityFanShapedStunKnockback.cs",
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_FanShapedStunKnockback\\CompProperties_AbilityFanShapedStunKnockback.cs",
"RelativeToolTip": "Abilities\\ARA_FanShapedStunKnockback\\CompProperties_AbilityFanShapedStunKnockback.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAMAAAAXAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-03-27T07:30:03.977Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Safer_PawnFlyer.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_FanShapedStunKnockback\\Safer_PawnFlyer.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_FanShapedStunKnockback\\Safer_PawnFlyer.cs",
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_FanShapedStunKnockback\\Safer_PawnFlyer.cs",
"RelativeToolTip": "Abilities\\ARA_FanShapedStunKnockback\\Safer_PawnFlyer.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAA0AAAAJAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-03-27T07:30:02.935Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"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==",
"ViewState": "AgIAAEIAAAAAAAAAAAAQwD0AAABCAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-03-27T03:57:27.664Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"DocumentIndex": 3,
"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",
@@ -51,12 +85,11 @@
"RelativeToolTip": "Hediffs\\ARA_HiveMind\\Hediff_HiveMindMaster.cs",
"ViewState": "AgIAADQAAAAAAAAAAAAuwFkAAAAuAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-03-27T03:54:02.567Z",
"EditorCaption": ""
"WhenOpened": "2026-03-27T03:54:02.567Z"
},
{
"$type": "Document",
"DocumentIndex": 2,
"DocumentIndex": 4,
"Title": "ArachnaeLog.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\ArachnaeLog.cs",
"RelativeDocumentMoniker": "ArachnaeLog.cs",
@@ -64,8 +97,7 @@
"RelativeToolTip": "ArachnaeLog.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABAAAAANAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-03-26T06:10:50.583Z",
"EditorCaption": ""
"WhenOpened": "2026-03-26T06:10:50.583Z"
}
]
}

View File

@@ -0,0 +1,39 @@
using RimWorld;
using RimWorld.Planet;
using UnityEngine;
using Verse;
using Verse.AI;
using Verse.Sound;
namespace ArachnaeSwarm
{
public class SaferPawnFlyer : PawnFlyer
{
// 重写TickInterval增加空值检查
protected override void TickInterval(int delta)
{
// 如果FlyingThing为空直接销毁并返回
if (FlyingThing == null || FlyingThing.Destroyed)
{
Destroy();
return;
}
base.TickInterval(delta);
}
// 重写RespawnPawn增加空值检查
protected override void RespawnPawn()
{
// 如果FlyingThing为空直接销毁并返回
if (FlyingThing == null || FlyingThing.Destroyed)
{
Destroy();
return;
}
// 调用基类方法
base.RespawnPawn();
}
}
}

View File

@@ -36,6 +36,7 @@
<ItemGroup>
<Compile Include="Abilities\ARA_FanShapedStunKnockback\CompAbilityEffect_FanShapedStunKnockback.cs" />
<Compile Include="Abilities\ARA_FanShapedStunKnockback\CompProperties_AbilityFanShapedStunKnockback.cs" />
<Compile Include="Abilities\ARA_FanShapedStunKnockback\Safer_PawnFlyer.cs" />
<Compile Include="Abilities\ARA_HediffBlacklist\CompAbilityEffect_HediffBlacklist.cs" />
<Compile Include="Abilities\ARA_HediffBlacklist\CompProperties_AbilityHediffBlacklist.cs" />
<Compile Include="Abilities\ARA_HediffGacha\CompAbilityEffect_HediffGacha.cs" />

View File

@@ -59,6 +59,7 @@ namespace ArachnaeSwarm
Pawn hiveNode = relation.otherPawn;
if (hiveNode != null && hiveNode.IsGestaltNode(GestaltNodeType.HiveNode))
{
ForceMasterCultureToDrone(hiveNode, pawn);
if (tracker.GetControlGroup(hiveNode) == null)
{
@@ -98,13 +99,13 @@ namespace ArachnaeSwarm
/// <summary>
/// 强制将主节点的文化赋予无人机
/// </summary>
private void ForceMasterCultureToDrone(Pawn drone)
private void ForceMasterCultureToDrone(Pawn drone,Pawn master)
{
// 检查是否有意识形态系统Ideology DLC
if (ModsConfig.IdeologyActive)
{
// 获取主节点的意识形态
Ideo masterIdeo = this.pawn.Ideo;
Ideo masterIdeo = master.Ideo;
if (masterIdeo != null)
{
@@ -115,13 +116,6 @@ namespace ArachnaeSwarm
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
{
@@ -129,50 +123,6 @@ namespace ArachnaeSwarm
}
}
/// <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();