diff --git a/1.6/1.6/Assemblies/ArachnaeSwarm.dll b/1.6/1.6/Assemblies/ArachnaeSwarm.dll
index 9474e7e..ec778dc 100644
Binary files a/1.6/1.6/Assemblies/ArachnaeSwarm.dll and b/1.6/1.6/Assemblies/ArachnaeSwarm.dll differ
diff --git a/1.6/1.6/Defs/AbilityDefs/ARA_Abilities.xml b/1.6/1.6/Defs/AbilityDefs/ARA_Abilities.xml
index c6e1339..d183457 100644
--- a/1.6/1.6/Defs/AbilityDefs/ARA_Abilities.xml
+++ b/1.6/1.6/Defs/AbilityDefs/ARA_Abilities.xml
@@ -1621,27 +1621,33 @@
- ARA_Locust_Needle_Fire
-
- 阿拉克涅蝗虫种使用可以喷射剧毒尾针的毒针腺对敌方进行一轮射击。
- True
- False
- 90
+ ARA_Locust_AcidSprayBurst
+
+ 阿拉克涅蝗虫种向目标地点喷射腐蚀性酸液。
+ ArachnaeSwarm/UI/Abilities/ARA_AcidSprayBurst
+ 180
true
- ArachnaeSwarm/UI/Abilities/ARA_Toxic_Needle_Fire
+ 300
+ AcidSpray_Warmup
Verb_CastAbility
- 24
- 0
- SpitterSpit
- Heatspikes_Tail
+ 16
+ 0.01
+ AcidSpray_Resolve
- True
+ true
-
- Bullet_ARA_RW_Basic_Fist_Needle_Gun
+
+
+ ARA_Proj_StrongSludgeSpray
+ 4
+ AcidSpray_Directional
+
+
+ 1
+ 3
diff --git a/1.6/1.6/Defs/PawnKindDef/ARA_PawnKinds.xml b/1.6/1.6/Defs/PawnKindDef/ARA_PawnKinds.xml
index bd51210..8ec7aed 100644
--- a/1.6/1.6/Defs/PawnKindDef/ARA_PawnKinds.xml
+++ b/1.6/1.6/Defs/PawnKindDef/ARA_PawnKinds.xml
@@ -683,7 +683,7 @@
- ARA_Locust_Needle_Fire
+ ARA_Locust_AcidSprayBurst
diff --git a/1.6/1.6/Defs/Thing_building/ARA_WormholeDefs.xml b/1.6/1.6/Defs/Thing_building/ARA_WormholeDefs.xml
index e8dd46e..b692bd8 100644
--- a/1.6/1.6/Defs/Thing_building/ARA_WormholeDefs.xml
+++ b/1.6/1.6/Defs/Thing_building/ARA_WormholeDefs.xml
@@ -126,99 +126,4 @@
TraversePitGate
-
-
- ARA_WormholePortal_Spawner
-
- 一只阿拉克涅坑道种的尾部正在地下活动——毫无疑问,它很快就要破土而出了!
- ArachnaeSwarm.BuildingGroundSpawner_WormholePortal
- false
- true
- true
- Normal
- false
- RealtimeOnly
- (2, 2)
- UI/Icons/UndergroundEmergence
-
- EmergencePointSustained2X2
- EmergencePointComplete2X2
- ARA_WormholePortal_B
- 600
- true
- PitBurrowOpening
-
-
-
-
- 600
- 600
- false
- 3
- true
- false
-
-
-
-
- ARA_WormholePortal_Enermy
-
- 阿拉克涅坑道种的尾巴,是其狭长身躯形成的地下通路的出口。
- false
-
- ArachnaeSwarm/Building/ARA_Wormhole_B
- Graphic_Single
- CutoutComplex
- (4,4)
-
- (2.6, 2.5, 1.6)
- (0,0,-0.1)
-
-
- Building
- Impassable
-
- 500
- 0.5
-
- (2,2)
-
-
- 60
- 30
- 60
- 120
-
-
-
-
-
-
- false
-
-
-
- None
-
-
-
- ARA_WormholePortal
-
- 通过虫洞传送门到达
- ArachnaeSwarm.PawnsArrivalModeWorker_WormholePortal
-
-
- (0, 0)
- (500, 0.3)
- (1000, 0.5)
- (2000, 0.7)
-
-
- false
- Industrial
-
\ No newline at end of file
diff --git a/1.6/1.6/Defs/ThinkTreeDefs/ARA_ThinkTrees.xml b/1.6/1.6/Defs/ThinkTreeDefs/ARA_ThinkTrees.xml
index 03202e2..44c43ec 100644
--- a/1.6/1.6/Defs/ThinkTreeDefs/ARA_ThinkTrees.xml
+++ b/1.6/1.6/Defs/ThinkTreeDefs/ARA_ThinkTrees.xml
@@ -3097,7 +3097,7 @@
65
72
false
- ARA_Locust_Needle_Fire
+ ARA_Locust_AcidSprayBurst
true
true
@@ -3117,10 +3117,6 @@
-
2.9~7.9
@@ -3135,10 +3131,14 @@
65
72
false
- ARA_Locust_Needle_Fire
+ ARA_Locust_AcidSprayBurst
true
true
+
+ true
+ 100
+
diff --git a/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/.suo b/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/.suo
index 65b7bb8..c6f98bf 100644
Binary files a/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/.suo and b/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/.suo differ
diff --git a/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/DocumentLayout.json b/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/DocumentLayout.json
index 64e47af..da7dd85 100644
--- a/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/DocumentLayout.json
+++ b/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/DocumentLayout.json
@@ -3,19 +3,15 @@
"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\\pawnsarrivalmode\\pawnsarrivalmodeworker_wormholeportal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:pawnsarrivalmode\\pawnsarrivalmodeworker_wormholeportal.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\\buildings\\wormhole\\travelingwormhole.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
+ "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:buildings\\wormhole\\travelingwormhole.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\\building_comps\\ara_wormholeportal\\comp_wormholeportal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:building_comps\\ara_wormholeportal\\comp_wormholeportal.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\\buildings\\wormhole\\complaunchablewormhole.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
+ "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:buildings\\wormhole\\complaunchablewormhole.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\\building_comps\\ara_wormholeportal\\compproperties_wormholeportal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:building_comps\\ara_wormholeportal\\compproperties_wormholeportal.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\\pawn_comps\\ara_uniquepawn\\uniquepawnmanager.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\\pawn_comps\\ara_uniquepawn\\uniquepawnmanager.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:pawn_comps\\ara_uniquepawn\\uniquepawnmanager.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
@@ -123,45 +119,32 @@
{
"$type": "Document",
"DocumentIndex": 0,
- "Title": "PawnsArrivalModeWorker_WormholePortal.cs",
- "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\PawnsArrivalMode\\PawnsArrivalModeWorker_WormholePortal.cs",
- "RelativeDocumentMoniker": "PawnsArrivalMode\\PawnsArrivalModeWorker_WormholePortal.cs",
- "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\PawnsArrivalMode\\PawnsArrivalModeWorker_WormholePortal.cs",
- "RelativeToolTip": "PawnsArrivalMode\\PawnsArrivalModeWorker_WormholePortal.cs",
- "ViewState": "AgIAADEBAAAAAAAAAAAkwEABAABSAAAAAAAAAA==",
+ "Title": "TravelingWormhole.cs",
+ "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Buildings\\Wormhole\\TravelingWormhole.cs",
+ "RelativeDocumentMoniker": "Buildings\\Wormhole\\TravelingWormhole.cs",
+ "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Buildings\\Wormhole\\TravelingWormhole.cs",
+ "RelativeToolTip": "Buildings\\Wormhole\\TravelingWormhole.cs",
+ "ViewState": "AgIAADsAAAAAAAAAAAAuwEAAAAANAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2026-02-06T09:04:02.296Z",
- "EditorCaption": ""
- },
- {
- "$type": "Document",
- "DocumentIndex": 2,
- "Title": "CompProperties_WormholePortal.cs",
- "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Building_Comps\\ARA_WormholePortal\\CompProperties_WormholePortal.cs",
- "RelativeDocumentMoniker": "Building_Comps\\ARA_WormholePortal\\CompProperties_WormholePortal.cs",
- "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Building_Comps\\ARA_WormholePortal\\CompProperties_WormholePortal.cs",
- "RelativeToolTip": "Building_Comps\\ARA_WormholePortal\\CompProperties_WormholePortal.cs",
- "ViewState": "AgIAAAMAAAAAAAAAAAAuwBoAAAAIAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2026-02-06T09:03:50.674Z",
+ "WhenOpened": "2026-02-07T03:22:07.586Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
- "Title": "Comp_WormholePortal.cs",
- "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Building_Comps\\ARA_WormholePortal\\Comp_WormholePortal.cs",
- "RelativeDocumentMoniker": "Building_Comps\\ARA_WormholePortal\\Comp_WormholePortal.cs",
- "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Building_Comps\\ARA_WormholePortal\\Comp_WormholePortal.cs",
- "RelativeToolTip": "Building_Comps\\ARA_WormholePortal\\Comp_WormholePortal.cs",
- "ViewState": "AgIAABQBAAAAAAAAAAAowCcBAAAJAAAAAAAAAA==",
+ "Title": "CompLaunchableWormhole.cs",
+ "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Buildings\\Wormhole\\CompLaunchableWormhole.cs",
+ "RelativeDocumentMoniker": "Buildings\\Wormhole\\CompLaunchableWormhole.cs",
+ "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Buildings\\Wormhole\\CompLaunchableWormhole.cs",
+ "RelativeToolTip": "Buildings\\Wormhole\\CompLaunchableWormhole.cs",
+ "ViewState": "AgIAACEAAAAAAAAAAAAAACEAAABrAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2026-02-06T09:01:19.98Z",
+ "WhenOpened": "2026-02-07T03:22:06.34Z",
"EditorCaption": ""
},
{
"$type": "Document",
- "DocumentIndex": 3,
+ "DocumentIndex": 2,
"Title": "UniquePawnManager.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Pawn_Comps\\ARA_UniquePawn\\UniquePawnManager.cs",
"RelativeDocumentMoniker": "Pawn_Comps\\ARA_UniquePawn\\UniquePawnManager.cs",
@@ -169,12 +152,11 @@
"RelativeToolTip": "Pawn_Comps\\ARA_UniquePawn\\UniquePawnManager.cs",
"ViewState": "AgIAAHQAAAAAAAAAAAAiwJEAAAAJAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2026-02-05T03:36:35.207Z",
- "EditorCaption": ""
+ "WhenOpened": "2026-02-05T03:36:35.207Z"
},
{
"$type": "Document",
- "DocumentIndex": 4,
+ "DocumentIndex": 3,
"Title": "CompUniquePawn.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Pawn_Comps\\ARA_UniquePawn\\CompUniquePawn.cs",
"RelativeDocumentMoniker": "Pawn_Comps\\ARA_UniquePawn\\CompUniquePawn.cs",
@@ -186,7 +168,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 6,
+ "DocumentIndex": 5,
"Title": "JobDriver_ExtractHoney.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Jobs\\JobDriver_ExtractHoney\\JobDriver_ExtractHoney.cs",
"RelativeDocumentMoniker": "Jobs\\JobDriver_ExtractHoney\\JobDriver_ExtractHoney.cs",
@@ -198,7 +180,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 5,
+ "DocumentIndex": 4,
"Title": "Need_HoneyProduction.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Needs\\Need_HoneyProduction.cs",
"RelativeDocumentMoniker": "Needs\\Need_HoneyProduction.cs",
@@ -210,7 +192,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 7,
+ "DocumentIndex": 6,
"Title": "Need_ChitinArmor.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Needs\\Need_ChitinArmor.cs",
"RelativeDocumentMoniker": "Needs\\Need_ChitinArmor.cs",
@@ -222,7 +204,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 9,
+ "DocumentIndex": 8,
"Title": "CompProperties_AbilityPsychicLoadDump.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_PsychicLoadDump\\CompProperties_AbilityPsychicLoadDump.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_PsychicLoadDump\\CompProperties_AbilityPsychicLoadDump.cs",
@@ -234,7 +216,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 8,
+ "DocumentIndex": 7,
"Title": "CompAbilityEffect_PsychicLoadDump.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_PsychicLoadDump\\CompAbilityEffect_PsychicLoadDump.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_PsychicLoadDump\\CompAbilityEffect_PsychicLoadDump.cs",
@@ -246,7 +228,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 13,
+ "DocumentIndex": 12,
"Title": "CompAbilityEffect_PsychicResearchHarvest.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_PsychicResearchHarvest\\CompAbilityEffect_PsychicResearchHarvest.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_PsychicResearchHarvest\\CompAbilityEffect_PsychicResearchHarvest.cs",
@@ -258,7 +240,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 17,
+ "DocumentIndex": 16,
"Title": "CompProperties_AbilityPsychicLoadCost.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_PsychicLoadCost\\CompProperties_AbilityPsychicLoadCost.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_PsychicLoadCost\\CompProperties_AbilityPsychicLoadCost.cs",
@@ -270,7 +252,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 16,
+ "DocumentIndex": 15,
"Title": "SwarmSpellUtility.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Pawn_Comps\\ARA_SwarmSpellHolder\\SwarmSpellUtility.cs",
"RelativeDocumentMoniker": "Pawn_Comps\\ARA_SwarmSpellHolder\\SwarmSpellUtility.cs",
@@ -282,7 +264,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 12,
+ "DocumentIndex": 11,
"Title": "CompAbilityEffect_PsychicLoadCost.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_PsychicLoadCost\\CompAbilityEffect_PsychicLoadCost.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_PsychicLoadCost\\CompAbilityEffect_PsychicLoadCost.cs",
@@ -294,7 +276,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 10,
+ "DocumentIndex": 9,
"Title": "Comp_SwarmSpellHolder.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Pawn_Comps\\ARA_SwarmSpellHolder\\Comp_SwarmSpellHolder.cs",
"RelativeDocumentMoniker": "Pawn_Comps\\ARA_SwarmSpellHolder\\Comp_SwarmSpellHolder.cs",
@@ -306,7 +288,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 11,
+ "DocumentIndex": 10,
"Title": "Gizmo_SwarmSpellStatus.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Pawn_Comps\\ARA_SwarmSpellHolder\\Gizmo_SwarmSpellStatus.cs",
"RelativeDocumentMoniker": "Pawn_Comps\\ARA_SwarmSpellHolder\\Gizmo_SwarmSpellStatus.cs",
@@ -318,7 +300,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 18,
+ "DocumentIndex": 17,
"Title": "CompAbilityEffect_HediffGacha.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_HediffGacha\\CompAbilityEffect_HediffGacha.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_HediffGacha\\CompAbilityEffect_HediffGacha.cs",
@@ -330,7 +312,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 15,
+ "DocumentIndex": 14,
"Title": "CompFighterInvisible.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Pawn_Comps\\ARA_Fighter_Invisible\\CompFighterInvisible.cs",
"RelativeDocumentMoniker": "Pawn_Comps\\ARA_Fighter_Invisible\\CompFighterInvisible.cs",
@@ -342,7 +324,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 14,
+ "DocumentIndex": 13,
"Title": "CompProperties_AbilityPsychicResearchHarvest.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_PsychicResearchHarvest\\CompProperties_AbilityPsychicResearchHarvest.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_PsychicResearchHarvest\\CompProperties_AbilityPsychicResearchHarvest.cs",
@@ -354,7 +336,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 19,
+ "DocumentIndex": 18,
"Title": "CompAbilityEffect_HediffRestriction.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_HediffRestriction\\CompAbilityEffect_HediffRestriction.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_HediffRestriction\\CompAbilityEffect_HediffRestriction.cs",
@@ -366,7 +348,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 20,
+ "DocumentIndex": 19,
"Title": "Window_HediffSelection.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_HediffGacha\\Window_HediffSelection.cs",
"RelativeDocumentMoniker": "Abilities\\ARA_HediffGacha\\Window_HediffSelection.cs",
@@ -378,7 +360,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 21,
+ "DocumentIndex": 20,
"Title": "ARA_PowerArmor.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\PowerArmor\\ARA_PowerArmor.cs",
"RelativeDocumentMoniker": "PowerArmor\\ARA_PowerArmor.cs",
@@ -390,7 +372,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 22,
+ "DocumentIndex": 21,
"Title": "PawnCapacityWorker_PsychicStange.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\PawnCapacityWorker\\PawnCapacityWorker_PsychicStange.cs",
"RelativeDocumentMoniker": "PawnCapacityWorker\\PawnCapacityWorker_PsychicStange.cs",
@@ -402,7 +384,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 24,
+ "DocumentIndex": 23,
"Title": "CompAbilityEffect_PsychicBrainburn.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\PsychicBrainburn\\CompAbilityEffect_PsychicBrainburn.cs",
"RelativeDocumentMoniker": "Abilities\\PsychicBrainburn\\CompAbilityEffect_PsychicBrainburn.cs",
@@ -414,7 +396,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 23,
+ "DocumentIndex": 22,
"Title": "ARA_DefOf.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\ARA_DefOf.cs",
"RelativeDocumentMoniker": "ARA_DefOf.cs",
@@ -426,7 +408,7 @@
},
{
"$type": "Document",
- "DocumentIndex": 25,
+ "DocumentIndex": 24,
"Title": "CompAutoMechCarrier.cs",
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Pawn_Comps\\ARA_AutoMechCarrier\\CompAutoMechCarrier.cs",
"RelativeDocumentMoniker": "Pawn_Comps\\ARA_AutoMechCarrier\\CompAutoMechCarrier.cs",
diff --git a/Source/ArachnaeSwarm/ArachnaeSwarm.csproj b/Source/ArachnaeSwarm/ArachnaeSwarm.csproj
index 848f48c..6e56256 100644
--- a/Source/ArachnaeSwarm/ArachnaeSwarm.csproj
+++ b/Source/ArachnaeSwarm/ArachnaeSwarm.csproj
@@ -42,13 +42,9 @@
-
-
-
-
@@ -343,7 +339,6 @@
-
diff --git a/Source/ArachnaeSwarm/Building_Comps/ARA_WormholePortal/CompProperties_WormholePortal.cs b/Source/ArachnaeSwarm/Building_Comps/ARA_WormholePortal/CompProperties_WormholePortal.cs
deleted file mode 100644
index 59beade..0000000
--- a/Source/ArachnaeSwarm/Building_Comps/ARA_WormholePortal/CompProperties_WormholePortal.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-using RimWorld;
-using UnityEngine;
-using Verse;
-
-namespace ArachnaeSwarm
-{
- ///
- /// 虫洞传送门组件属性
- ///
- public class CompProperties_WormholePortal : CompProperties
- {
- #region 时间设置
- ///
- /// 初始延迟(ticks)
- ///
- public int initialDelayTicks = 60; // 1秒
-
- ///
- /// 单位跳出间隔(ticks)
- ///
- public int jumpIntervalTicks = 30; // 0.5秒
-
- ///
- /// 单位跳出时的眩晕时间(ticks)
- ///
- public int stunDurationTicks = 60; // 1秒
-
- #endregion
-
- #region 效果设置
- ///
- /// 激活音效
- ///
- public SoundDef activationSound = null;
-
- ///
- /// 停用音效
- ///
- public SoundDef deactivationSound = null;
-
- ///
- /// 跳出音效
- ///
- public SoundDef jumpSound = null;
-
- ///
- /// 激活效果器
- ///
- public EffecterDef activationEffecter = null;
-
- ///
- /// 停用效果器
- ///
- public EffecterDef deactivationEffecter = null;
-
- ///
- /// 每次跳出效果器
- ///
- public EffecterDef perJumpEffecter = null;
-
- ///
- /// 单位跳出效果器
- ///
- public EffecterDef jumpEffecter = null;
- #endregion
-
- #region 外观设置
- ///
- /// 活跃时的材质
- ///
- public GraphicData activeGraphicData = null;
-
- ///
- /// 颜色循环
- ///
- public bool useColorCycling = true;
-
- ///
- /// 颜色循环速度
- ///
- public float colorCycleSpeed = 0.5f;
- #endregion
-
- #region 构造函数
- public CompProperties_WormholePortal()
- {
- compClass = typeof(Comp_WormholePortal);
- }
- #endregion
- }
-}
diff --git a/Source/ArachnaeSwarm/Building_Comps/ARA_WormholePortal/Comp_WormholePortal.cs b/Source/ArachnaeSwarm/Building_Comps/ARA_WormholePortal/Comp_WormholePortal.cs
deleted file mode 100644
index c19b67b..0000000
--- a/Source/ArachnaeSwarm/Building_Comps/ARA_WormholePortal/Comp_WormholePortal.cs
+++ /dev/null
@@ -1,336 +0,0 @@
-using RimWorld;
-using System.Collections.Generic;
-using System.Linq;
-using Verse;
-using Verse.Sound;
-
-namespace ArachnaeSwarm
-{
- ///
- /// 虫洞传送门组件
- /// 处理从虫洞中跳出单位
- ///
- public class Comp_WormholePortal : ThingComp
- {
- #region 字段
- private List emergingPawns = new List();
- private int currentPawnIndex = 0;
- private int ticksUntilNextJump = 0;
- private bool isActive = false;
- private int activateTick = -1;
- #endregion
-
- #region 属性
- public CompProperties_WormholePortal Props => (CompProperties_WormholePortal)props;
-
- ///
- /// 还有多少单位等待跳出
- ///
- public int RemainingPawns => emergingPawns.Count - currentPawnIndex;
-
- ///
- /// 虫洞是否活跃
- ///
- public bool IsActive => isActive;
-
- ///
- /// 激活后经过的时间
- ///
- public int TicksSinceActivation
- {
- get
- {
- if (!isActive || activateTick < 0)
- return 0;
- return Find.TickManager.TicksGame - activateTick;
- }
- }
- #endregion
-
- #region 生命周期
- public override void PostSpawnSetup(bool respawningAfterLoad)
- {
- base.PostSpawnSetup(respawningAfterLoad);
-
- if (respawningAfterLoad)
- return;
-
- // 非加载生成时,准备激活
- PrepareForActivation();
- }
-
- public override void CompTick()
- {
- base.CompTick();
-
- if (!isActive || emergingPawns.NullOrEmpty() || currentPawnIndex >= emergingPawns.Count)
- return;
-
- // 计时下一个单位跳出
- if (ticksUntilNextJump > 0)
- {
- ticksUntilNextJump--;
- return;
- }
-
- // 跳出当前单位
- JumpNextPawn();
-
- // 设置下一个单位的跳出间隔
- if (currentPawnIndex < emergingPawns.Count)
- {
- ticksUntilNextJump = Props.jumpIntervalTicks;
- }
- }
-
- public void PostDeSpawn(Map map)
- {
- // 虫洞消失时,销毁剩余未跳出的单位
- DestroyRemainingPawns();
- }
-
- public override void PostDestroy(DestroyMode mode, Map previousMap)
- {
- base.PostDestroy(mode, previousMap);
-
- // 虫洞被摧毁时,销毁剩余未跳出的单位
- DestroyRemainingPawns();
- }
- #endregion
-
- #region 公共方法
- ///
- /// 设置要跳出的单位
- ///
- public void SetEmergingPawns(List pawns)
- {
- emergingPawns = pawns ?? new List();
- currentPawnIndex = 0;
- }
-
- ///
- /// 激活虫洞
- ///
- public void Activate()
- {
- if (isActive)
- return;
-
- isActive = true;
- activateTick = Find.TickManager.TicksGame;
-
- // 设置第一个单位的跳出计时
- if (emergingPawns.Count > 0)
- {
- ticksUntilNextJump = Props.initialDelayTicks;
- }
-
- // 播放激活效果
- PlayActivationEffects();
- }
-
- ///
- /// 获取虫洞状态描述
- ///
- public string GetStatusDescription()
- {
- if (!isActive)
- return "休眠中";
-
- if (RemainingPawns <= 0)
- return "已完成";
-
- return $"跳出中: {RemainingPawns} 个单位剩余";
- }
- #endregion
-
- #region 私有方法
- ///
- /// 准备激活
- ///
- private void PrepareForActivation()
- {
- // 可以在这里添加预热效果
- // 例如:粒子效果、声音等
- }
-
- ///
- /// 跳出下一个单位
- ///
- private void JumpNextPawn()
- {
- if (currentPawnIndex >= emergingPawns.Count)
- return;
-
- Pawn pawn = emergingPawns[currentPawnIndex];
- currentPawnIndex++;
-
- // 确保单位存在且有效
- if (pawn == null || pawn.Destroyed)
- {
- Log.Warning("[虫洞传送门] 尝试跳出无效单位");
- return;
- }
-
- // 生成单位
- TrySpawnPawn(pawn);
-
- // 播放跳出效果
- PlayJumpEffects();
-
- // 如果所有单位都已跳出,关闭虫洞
- if (currentPawnIndex >= emergingPawns.Count)
- {
- StartDeactivation();
- }
- }
-
- ///
- /// 尝试生成单位
- ///
- private void TrySpawnPawn(Pawn pawn)
- {
- try
- {
- Map map = parent.Map;
- if (map == null)
- return;
-
- // 找到虫洞周围的可行走位置
- if (CellFinder.TryFindRandomCellNear(parent.Position, map, 2,
- c => c.Walkable(map) && c.InBounds(map) && !c.Fogged(map), out IntVec3 spawnCell))
- {
- // 生成单位
- GenSpawn.Spawn(pawn, spawnCell, map);
-
- // 应用跳出效果
- ApplyJumpEffectsToPawn(pawn, spawnCell);
- }
- else
- {
- // 如果找不到位置,在虫洞位置生成
- GenSpawn.Spawn(pawn, parent.Position, map);
- Log.Warning($"[虫洞传送门] 无法找到合适位置,在虫洞位置生成 {pawn.Label}");
- }
- }
- catch (System.Exception ex)
- {
- Log.Error($"[虫洞传送门] 跳出单位失败: {ex.Message}");
- }
- }
-
- ///
- /// 应用跳出效果给单位
- ///
- private void ApplyJumpEffectsToPawn(Pawn pawn, IntVec3 spawnCell)
- {
- // 短暂眩晕效果
- if (Props.stunDurationTicks > 0)
- {
- pawn.stances.stunner.StunFor(Props.stunDurationTicks, parent);
- }
-
- // 播放音效
- if (Props.jumpSound != null)
- {
- Props.jumpSound.PlayOneShot(new TargetInfo(spawnCell, parent.Map));
- }
-
- // 显示效果
- if (Props.jumpEffecter != null)
- {
- Effecter effecter = Props.jumpEffecter.Spawn();
- effecter.Trigger(new TargetInfo(spawnCell, parent.Map), new TargetInfo(spawnCell, parent.Map));
- effecter.Cleanup();
- }
- }
-
- ///
- /// 播放激活效果
- ///
- private void PlayActivationEffects()
- {
- if (Props.activationSound != null)
- {
- Props.activationSound.PlayOneShot(new TargetInfo(parent.Position, parent.Map));
- }
-
- if (Props.activationEffecter != null)
- {
- Effecter effecter = Props.activationEffecter.Spawn();
- effecter.Trigger(new TargetInfo(parent.Position, parent.Map), new TargetInfo(parent.Position, parent.Map));
- effecter.Cleanup();
- }
- }
-
- ///
- /// 播放跳出效果
- ///
- private void PlayJumpEffects()
- {
- if (Props.perJumpEffecter != null)
- {
- Effecter effecter = Props.perJumpEffecter.Spawn();
- effecter.Trigger(new TargetInfo(parent.Position, parent.Map), new TargetInfo(parent.Position, parent.Map));
- effecter.Cleanup();
- }
- }
-
- ///
- /// 开始停用虫洞
- ///
- private void StartDeactivation()
- {
- // 播放停用效果
- if (Props.deactivationSound != null)
- {
- Props.deactivationSound.PlayOneShot(new TargetInfo(parent.Position, parent.Map));
- }
-
- if (Props.deactivationEffecter != null)
- {
- Effecter effecter = Props.deactivationEffecter.Spawn();
- effecter.Trigger(new TargetInfo(parent.Position, parent.Map), new TargetInfo(parent.Position, parent.Map));
- effecter.Cleanup();
- }
- }
-
- ///
- /// 销毁剩余未跳出的单位
- ///
- private void DestroyRemainingPawns()
- {
- if (emergingPawns.NullOrEmpty())
- return;
-
- for (int i = currentPawnIndex; i < emergingPawns.Count; i++)
- {
- Pawn pawn = emergingPawns[i];
- if (pawn != null && !pawn.Destroyed)
- {
- pawn.Destroy();
- }
- }
- }
- #endregion
-
- #region 序列化
- public override void PostExposeData()
- {
- base.PostExposeData();
-
- Scribe_Collections.Look(ref emergingPawns, "emergingPawns", LookMode.Reference);
- Scribe_Values.Look(ref currentPawnIndex, "currentPawnIndex", 0);
- Scribe_Values.Look(ref ticksUntilNextJump, "ticksUntilNextJump", 0);
- Scribe_Values.Look(ref isActive, "isActive", false);
- Scribe_Values.Look(ref activateTick, "activateTick", -1);
-
- if (Scribe.mode == LoadSaveMode.PostLoadInit)
- {
- // 清理空引用
- emergingPawns?.RemoveAll(p => p == null);
- }
- }
- #endregion
- }
-}
diff --git a/Source/ArachnaeSwarm/Building_Comps/ARA_WormholePortal/WormholePortalSpawnerExtension.cs b/Source/ArachnaeSwarm/Building_Comps/ARA_WormholePortal/WormholePortalSpawnerExtension.cs
deleted file mode 100644
index 976d078..0000000
--- a/Source/ArachnaeSwarm/Building_Comps/ARA_WormholePortal/WormholePortalSpawnerExtension.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using Verse;
-
-namespace ArachnaeSwarm
-{
- ///
- /// 虫洞传送门生成器扩展
- ///
- public class WormholePortalSpawnerExtension : DefModExtension
- {
- ///
- /// 最小跳出延迟(ticks)
- ///
- public int minEmergeDelayTicks = 180; // 3秒
-
- ///
- /// 最大跳出延迟(ticks)
- ///
- public int maxEmergeDelayTicks = 300; // 5秒
-
- ///
- /// 是否需要露天
- ///
- public bool requiresOpenSky = true;
-
- ///
- /// 最小空间半径
- ///
- public int minSpaceRadius = 3;
-
- ///
- /// 是否破坏地形
- ///
- public bool destroyTerrain = true;
-
- ///
- /// 是否破坏建筑
- ///
- public bool destroyBuildings = false;
- }
-}
diff --git a/Source/ArachnaeSwarm/Buildings/BuildingGroundSpawner_WormholePortal.cs b/Source/ArachnaeSwarm/Buildings/BuildingGroundSpawner_WormholePortal.cs
deleted file mode 100644
index fabd41b..0000000
--- a/Source/ArachnaeSwarm/Buildings/BuildingGroundSpawner_WormholePortal.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using RimWorld;
-using System.Collections.Generic;
-using Verse;
-
-namespace ArachnaeSwarm
-{
- ///
- /// 自定义虫洞传送门生成器
- ///
- public class BuildingGroundSpawner_WormholePortal : BuildingGroundSpawner
- {
- // 存储要传递的Pawn列表
- public List emergingPawns = new List();
-
- // 延迟参数
- public IntRange? customEmergeDelay = null;
-
- protected override void PostMakeInt()
- {
- base.PostMakeInt();
-
- // 创建虫洞传送门
- ThingDef portalDef = DefDatabase.GetNamed("ARA_WormholePortal");
- if (portalDef != null)
- {
- thingToSpawn = ThingMaker.MakeThing(portalDef);
-
- // 设置Pawn列表
- Comp_WormholePortal comp = thingToSpawn.TryGetComp();
- if (comp != null && emergingPawns != null)
- {
- comp.SetEmergingPawns(emergingPawns);
- }
- }
- }
-
- protected override IntRange ResultSpawnDelay
- {
- get
- {
- if (customEmergeDelay.HasValue)
- return customEmergeDelay.Value;
- return base.ResultSpawnDelay;
- }
- }
-
- public override void ExposeData()
- {
- base.ExposeData();
- Scribe_Collections.Look(ref emergingPawns, "emergingPawns", LookMode.Reference);
- Scribe_Values.Look(ref customEmergeDelay, "customEmergeDelay");
- }
- }
-}
diff --git a/Source/ArachnaeSwarm/PawnsArrivalMode/PawnsArrivalModeWorker_WormholePortal.cs b/Source/ArachnaeSwarm/PawnsArrivalMode/PawnsArrivalModeWorker_WormholePortal.cs
deleted file mode 100644
index 8aa5ece..0000000
--- a/Source/ArachnaeSwarm/PawnsArrivalMode/PawnsArrivalModeWorker_WormholePortal.cs
+++ /dev/null
@@ -1,387 +0,0 @@
-using RimWorld;
-using System.Collections.Generic;
-using System.Linq;
-using Verse;
-
-namespace ArachnaeSwarm
-{
- ///
- /// 虫洞传送门到达模式
- /// 在地图边缘生成虫洞传送门生成器,预热后生成虫洞传送门,单位从虫洞中跳出
- ///
- public class PawnsArrivalModeWorker_WormholePortal : PawnsArrivalModeWorker
- {
- #region 常量
- private const float MIN_EDGE_DISTANCE = 5f; // 最小边缘距离
- private const float MAX_EDGE_DISTANCE = 20f; // 最大边缘距离
- private const int MIN_SPACE_RADIUS = 3; // 需要的最小空间半径
- private const int MAX_SPAWNERS_PER_GROUP = 3; // 每组最大生成器数量
- private const int DEFAULT_EMERGE_DELAY_TICKS = 60; // 默认跳出延迟(1秒)
- #endregion
-
- #region 公共方法
- ///
- /// 单位到达
- ///
- public override void Arrive(List pawns, IncidentParms parms)
- {
- Map map = parms.target as Map;
- if (map == null || pawns.NullOrEmpty())
- return;
-
- if (!TryResolveRaidSpawnCenter(parms))
- return;
-
- // 将Pawn分组,每组由一个传送门生成器处理
- List> pawnGroups = SplitPawnsIntoGroups(pawns, parms);
-
- // 为每组生成一个虫洞传送门生成器
- int spawnedCount = 0;
- foreach (var group in pawnGroups)
- {
- if (TrySpawnWormholePortalGroup(group, parms))
- {
- spawnedCount++;
- }
-
- // 限制每组数量
- if (spawnedCount >= MAX_SPAWNERS_PER_GROUP)
- break;
- }
- }
-
- ///
- /// 旅行运输器到达
- ///
- public override void TravellingTransportersArrived(List transporters, Map map)
- {
- // 虫洞传送门不支持运输器到达
- Log.Warning("[虫洞传送门] 不支持运输器到达模式");
- base.TravellingTransportersArrived(transporters, map);
- }
-
- ///
- /// 尝试解析袭击生成中心
- ///
- public override bool TryResolveRaidSpawnCenter(IncidentParms parms)
- {
- Map map = parms.target as Map;
- if (map == null)
- return false;
-
- // 如果没有指定生成中心,找到地图边缘的位置
- if (!parms.spawnCenter.IsValid)
- {
- if (!TryFindEdgeSpawnCenter(map, out IntVec3 spawnCenter))
- {
- // 如果找不到边缘位置,使用默认的掉落中心
- spawnCenter = DropCellFinder.FindRaidDropCenterDistant(map);
- }
- parms.spawnCenter = spawnCenter;
- }
-
- parms.spawnRotation = Rot4.Random;
- return true;
- }
-
- ///
- /// 判断是否可以在指定地图使用
- ///
- public override bool CanUseOnMap(Map map)
- {
- // 检查地图是否允许此到达模式
- if (map == null)
- return false;
-
- // 检查是否有足够的空间生成虫洞
- return HasEnoughSpaceForWormhole(map);
- }
- #endregion
-
- #region 私有方法
- ///
- /// 将Pawn分成组
- ///
- private List> SplitPawnsIntoGroups(List pawns, IncidentParms parms)
- {
- List> groups = new List>();
-
- if (pawns.NullOrEmpty())
- return groups;
-
- // 根据点数计算每组大小
- int groupSize = CalculateGroupSize(parms);
-
- // 如果组大小为1或更小,每个Pawn单独一组
- if (groupSize <= 1)
- {
- foreach (var pawn in pawns)
- {
- groups.Add(new List { pawn });
- }
- return groups;
- }
-
- // 分组
- List currentGroup = new List();
- foreach (var pawn in pawns)
- {
- currentGroup.Add(pawn);
-
- if (currentGroup.Count >= groupSize)
- {
- groups.Add(currentGroup);
- currentGroup = new List();
- }
- }
-
- // 添加剩余的Pawn
- if (currentGroup.Count > 0)
- {
- groups.Add(currentGroup);
- }
-
- return groups;
- }
-
- ///
- /// 计算每组大小
- ///
- private int CalculateGroupSize(IncidentParms parms)
- {
- // 根据点数动态调整组大小
- float points = parms.points;
-
- if (points <= 500f)
- return 1;
- else if (points <= 1000f)
- return 2;
- else if (points <= 2000f)
- return 3;
- else
- return 4;
- }
-
- ///
- /// 尝试生成虫洞传送门组
- ///
- private bool TrySpawnWormholePortalGroup(List pawns, IncidentParms parms)
- {
- Map map = parms.target as Map;
- if (map == null || pawns.NullOrEmpty())
- return false;
-
- // 找到合适的生成位置(靠近边缘,有足够空间)
- if (!TryFindWormholeSpawnPosition(map, out IntVec3 spawnPosition))
- return false;
-
- // 创建虫洞传送门生成器
- return SpawnWormholePortalSpawner(map, spawnPosition, pawns, parms);
- }
-
- ///
- /// 尝试找到虫洞生成位置
- ///
- private bool TryFindWormholeSpawnPosition(Map map, out IntVec3 spawnPosition)
- {
- spawnPosition = IntVec3.Invalid;
-
- // 尝试在地图边缘区域查找
- // 使用CellRect.WholeMap而不是CellsInMapRandomOrder
- CellRect mapRect = CellRect.WholeMap(map);
-
- // 定义边缘区域(地图边界向内一定距离)
- int edgeWidth = 5;
- CellRect edgeRect = new CellRect(
- edgeWidth,
- edgeWidth,
- map.Size.x - edgeWidth * 2,
- map.Size.z - edgeWidth * 2);
-
- // 在地图边界但不是边缘区域内部查找
- for (int attempts = 0; attempts < 30; attempts++)
- {
- IntVec3 candidate;
-
- // 随机选择边界
- if (Rand.Value < 0.25f) // 北边界
- {
- candidate = new IntVec3(Rand.Range(0, map.Size.x), 0, map.Size.z - 1);
- }
- else if (Rand.Value < 0.5f) // 南边界
- {
- candidate = new IntVec3(Rand.Range(0, map.Size.x), 0, 0);
- }
- else if (Rand.Value < 0.75f) // 东边界
- {
- candidate = new IntVec3(map.Size.x - 1, 0, Rand.Range(0, map.Size.z));
- }
- else // 西边界
- {
- candidate = new IntVec3(0, 0, Rand.Range(0, map.Size.z));
- }
-
- // 检查位置是否有效
- if (IsValidWormholePosition(candidate, map))
- {
- spawnPosition = candidate;
- return true;
- }
- }
-
- // 如果找不到边界位置,尝试在地图任意位置查找
- for (int attempts = 0; attempts < 20; attempts++)
- {
- IntVec3 candidate = CellFinder.RandomCell(map);
- if (IsValidWormholePosition(candidate, map))
- {
- spawnPosition = candidate;
- return true;
- }
- }
-
- return false;
- }
-
- ///
- /// 检查是否为有效的虫洞位置
- ///
- private bool IsValidWormholePosition(IntVec3 position, Map map)
- {
- if (!position.InBounds(map))
- return false;
-
- if (!position.Standable(map))
- return false;
-
- if (position.Fogged(map))
- return false;
-
- // 检查是否有足够的空间(3x3区域)
- CellRect requiredRect = new CellRect(position.x - 1, position.z - 1, 3, 3);
-
- // 修复:检查矩形是否完全包含在地图内
- if (!requiredRect.InBounds(map))
- return false;
-
- // 检查区域内所有单元格是否都可行走
- foreach (IntVec3 cell in requiredRect)
- {
- if (!cell.InBounds(map) || !cell.Walkable(map))
- return false;
-
- // 检查是否有其他建筑阻挡
- if (cell.GetEdifice(map) != null)
- return false;
-
- // 检查是否有屋顶(虫洞需要露天)
- if (cell.Roofed(map))
- return false;
- }
-
- return true;
- }
-
- ///
- /// 生成虫洞传送门生成器
- ///
- private bool SpawnWormholePortalSpawner(Map map, IntVec3 position, List pawns, IncidentParms parms)
- {
- try
- {
- ThingDef spawnerDef = DefDatabase.GetNamedSilentFail("ARA_WormholePortal_Spawner");
- if (spawnerDef == null)
- {
- Log.Error("[虫洞传送门] 未找到ARA_WormholePortal_Spawner定义");
- return false;
- }
-
- // 创建自定义生成器
- BuildingGroundSpawner_WormholePortal spawner = (BuildingGroundSpawner_WormholePortal)ThingMaker.MakeThing(spawnerDef);
-
- // 设置参数
- spawner.emergingPawns = pawns;
-
- // 设置延迟
- WormholePortalSpawnerExtension spawnerExt = spawnerDef.GetModExtension();
- if (spawnerExt != null)
- {
- spawner.customEmergeDelay = new IntRange(
- spawnerExt.minEmergeDelayTicks,
- spawnerExt.maxEmergeDelayTicks);
- }
-
- // 生成到地图
- GenSpawn.Spawn(spawner, position, map);
-
- return true;
- }
- catch (System.Exception ex)
- {
- Log.Error($"[虫洞传送门] 生成虫洞传送门生成器失败: {ex.Message}\n{ex.StackTrace}");
- return false;
- }
- }
-
- ///
- /// 尝试找到边缘生成中心
- ///
- private bool TryFindEdgeSpawnCenter(Map map, out IntVec3 spawnCenter)
- {
- spawnCenter = IntVec3.Invalid;
-
- // 尝试在地图四个边缘区域查找
- List edgeCells = new List();
-
- // 北边缘
- for (int x = 0; x < map.Size.x; x += 5)
- {
- IntVec3 cell = new IntVec3(x, 0, map.Size.z - 1);
- if (cell.InBounds(map) && cell.Walkable(map) && !cell.Fogged(map))
- edgeCells.Add(cell);
- }
-
- // 南边缘
- for (int x = 0; x < map.Size.x; x += 5)
- {
- IntVec3 cell = new IntVec3(x, 0, 0);
- if (cell.InBounds(map) && cell.Walkable(map) && !cell.Fogged(map))
- edgeCells.Add(cell);
- }
-
- // 东边缘
- for (int z = 0; z < map.Size.z; z += 5)
- {
- IntVec3 cell = new IntVec3(map.Size.x - 1, 0, z);
- if (cell.InBounds(map) && cell.Walkable(map) && !cell.Fogged(map))
- edgeCells.Add(cell);
- }
-
- // 西边缘
- for (int z = 0; z < map.Size.z; z += 5)
- {
- IntVec3 cell = new IntVec3(0, 0, z);
- if (cell.InBounds(map) && cell.Walkable(map) && !cell.Fogged(map))
- edgeCells.Add(cell);
- }
-
- if (edgeCells.Count > 0)
- {
- spawnCenter = edgeCells.RandomElement();
- return true;
- }
-
- return false;
- }
-
- ///
- /// 检查地图是否有足够的空间生成虫洞
- ///
- private bool HasEnoughSpaceForWormhole(Map map)
- {
- // 简单检查:地图是否至少有一定大小
- return map.Size.x >= 50 && map.Size.z >= 50;
- }
- #endregion
- }
-}