diff --git a/1.6/1.6/Assemblies/ArachnaeSwarm.dll b/1.6/1.6/Assemblies/ArachnaeSwarm.dll
index 0795224..a0f17fb 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/Ability_Morph.xml b/1.6/1.6/Defs/AbilityDefs/Ability_Morph.xml
new file mode 100644
index 0000000..4e70f5e
--- /dev/null
+++ b/1.6/1.6/Defs/AbilityDefs/Ability_Morph.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+ ARA_Ability_Morph
+ 变形
+ 将自己转换为一个坚固的静态建筑形态,或从建筑形态恢复。
+ UI/Commands/Attack
+ 600
+
+ Verb_CastAbility
+ 1.5
+ 0
+
+ true
+
+
+
+
+ ARA_MorphableResearchBench
+
+
+
+
+
+ ARA_MorphableResearchBench
+ 阿拉克涅织域织座
+ 一个供阿拉克涅虫族进行研究的活体结构,可以让虫群尽情地探索变异和进化方向。
+ ArachnaeSwarm.Building_Morphable
+ (3,3)
+
+ 0
+
+
+
+ 50
+
+
+ ArachnaeSwarm/Building/ARA_ResearchBench
+ Graphic_Multi
+ CutoutComplex
+ (3,4.5)
+
+ false
+ 0
+ Building
+ PassThroughOnly
+ ARA_Creep
+ 50
+
+ 250
+ 2800
+ 1.0
+
+
+ PlaceWorker_PreventInteractionSpotOverlap
+
+ 0.8
+ (0,0,-1)
+ true
+ 2600
+ Item
+
+ Laboratory
+ 0.8
+
+
+
+ ResearchSpeedFactor
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.6/1.6/Defs/BackstoryDefs/ARA_BackstoryDef.xml b/1.6/1.6/Defs/BackstoryDefs/ARA_BackstoryDef.xml
index 836eec3..d690378 100644
--- a/1.6/1.6/Defs/BackstoryDefs/ARA_BackstoryDef.xml
+++ b/1.6/1.6/Defs/BackstoryDefs/ARA_BackstoryDef.xml
@@ -275,4 +275,32 @@
ArachnaeNode_spawnCategories_Facehugger
+
+
+ Arachnae_Node_BS_Adult_NeuroSwarm
+ 阿拉克涅织域种
+ 织域种
+ [PAWN_nameDef]是一只阿拉克涅织域种督虫。织域种虽然受到女皇种监管,但仍然具有强大的高级智慧和自我意志,织域种之间能够构建一种高度互联的神经网络从而进行复杂的研究和计算工作,织域种进行计算工作时无法感知外界环境,因此她们是虫群的重要保护对象。
+ Adulthood
+
+ Cleaning
+
+ Mining
+ PlantWork
+ Animals
+ Hunting
+
+ Cooking
+ Constructing
+ Caring
+
+
+
+ 10
+
+
+
+ ArachnaeNode_spawnCategories_NeuroSwarm
+
+
\ No newline at end of file
diff --git a/1.6/1.6/Defs/PawnKindDef/ARA_PawnKinds.xml b/1.6/1.6/Defs/PawnKindDef/ARA_PawnKinds.xml
index 813c53a..d26725e 100644
--- a/1.6/1.6/Defs/PawnKindDef/ARA_PawnKinds.xml
+++ b/1.6/1.6/Defs/PawnKindDef/ARA_PawnKinds.xml
@@ -251,12 +251,32 @@
ARA_BaseRace_Skyhive_Launcher
ARA_Skyraider_jump
+
+
+ 0
+
+
+ ArachnaeNode_Race_NeuroSwarm
+ 阿拉克涅织域种
+ ArachnaeNode_Race_NeuroSwarm
+ PlayerColony
+ 0
+
+
+
+ ArachnaeNode_spawnCategoriesA
+ ArachnaeNode_spawnCategories_NeuroSwarm
+
+
+
+ ARA_Ability_Morph
0
+
PlayerColony
diff --git a/1.6/1.6/Defs/ThingDef_Races/ARA_RaceNodeSwarm.xml b/1.6/1.6/Defs/ThingDef_Races/ARA_RaceNodeSwarm.xml
index 062bc02..5c9deab 100644
--- a/1.6/1.6/Defs/ThingDef_Races/ARA_RaceNodeSwarm.xml
+++ b/1.6/1.6/Defs/ThingDef_Races/ARA_RaceNodeSwarm.xml
@@ -1289,4 +1289,73 @@
5
+
+
+ ArachnaeNode_Race_NeuroSwarm
+ 阿拉克涅织域种
+ 阿拉克涅督虫之一,是阿拉克涅虫群中最为特殊的虫族,织域种虽然受到女皇种监管,但仍然具有强大的高级智慧和自我意志,织域种之间能够构建一种高度互联的神经网络从而进行复杂的研究和计算工作,织域种进行计算工作时无法感知外界环境,因此她们是虫群的重要保护对象。
+
+
+
+
+
+
+
+ ArachnaeSwarm/Things/ARA_HiveNode/Addons/ArachnaeNode_Race_Addons_WeaponSmith
+ false
+ true
+
+
+ -0.275
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+ 3.5
+
+
+
+
+ 2
+
+ 100
+ 40
+ 10
+
+ 0.75
+
+
+
+
+
+
+
+
+ 0.1
+ 0.1
+ 0.05
+
+ 1.26
+
+
+
+
+ ArachnaeWeaponSmith_Body
+ 0.8
+ 0.75
+ 5
+
+
\ No newline at end of file
diff --git a/1.6/1.6/Defs/Thing_building/ARA_Building.xml b/1.6/1.6/Defs/Thing_building/ARA_Building.xml
index c489104..c7d6ad0 100644
--- a/1.6/1.6/Defs/Thing_building/ARA_Building.xml
+++ b/1.6/1.6/Defs/Thing_building/ARA_Building.xml
@@ -327,7 +327,7 @@
ARA_ResearchBench
阿拉克涅研究台
- 一个供阿拉克涅女皇种和智囊种进行研究的活体结构,可以让虫群尽情地探索变异和进化方向。
+ 一个供阿拉克涅虫族进行研究的活体结构,可以让虫群尽情地探索变异和进化方向。
Building_ResearchBench
(3,3)
diff --git a/Source/ArachnaeSwarm/Morphable/Building_Morphable.cs b/Source/ArachnaeSwarm/Morphable/Building_Morphable.cs
index b18c04e..3330862 100644
--- a/Source/ArachnaeSwarm/Morphable/Building_Morphable.cs
+++ b/Source/ArachnaeSwarm/Morphable/Building_Morphable.cs
@@ -5,23 +5,99 @@ namespace ArachnaeSwarm
{
public class Building_Morphable : Building
{
- public override void Destroy(DestroyMode mode)
+ private CompMorphable compMorphable;
+
+ public override void SpawnSetup(Map map, bool respawningAfterLoad)
{
- var comp = this.GetComp();
- if (comp != null && comp.StoredPawn != null)
+ base.SpawnSetup(map, respawningAfterLoad);
+ this.compMorphable = GetComp();
+ }
+
+ public override string Label
+ {
+ get
{
- Pawn pawn = comp.StoredPawn;
+ if (compMorphable?.StoredPawn != null)
+ {
+ return $"{base.Label} ({compMorphable.StoredPawn.LabelShort})";
+ }
+ return base.Label;
+ }
+ }
+
+ public override string GetInspectString()
+ {
+ string text = base.GetInspectString();
+ if (compMorphable?.StoredPawn != null)
+ {
+ if (!text.NullOrEmpty())
+ {
+ text += "\n";
+ }
+ text += "StoredPawn".Translate() + ": " + compMorphable.StoredPawn.LabelShort;
+ }
+ return text;
+ }
+
+ public override void PreApplyDamage(ref DamageInfo dinfo, out bool absorbed)
+ {
+ // 先让基类处理,我们不打断正常流程
+ base.PreApplyDamage(ref dinfo, out absorbed);
+ if (absorbed)
+ {
+ return;
+ }
+
+ // 如果建筑即将被摧毁,则由Destroy方法处理,避免重复逻辑
+ if (this.HitPoints - dinfo.Amount <= 0)
+ {
+ return;
+ }
+
+ if (compMorphable?.StoredPawn != null)
+ {
+ Pawn pawn = compMorphable.StoredPawn;
+ float damageProportion = dinfo.Amount / this.def.statBases.GetStatValueFromList(StatDefOf.MaxHitPoints, 500f);
+
+ // --- 立即强制解除变形 ---
Map map = this.Map;
IntVec3 position = this.Position;
- // 在建筑消失前,先把Pawn生成出来
+ // 1. 将Pawn放回地图
GenSpawn.Spawn(pawn, position, map, WipeMode.Vanish);
PawnComponentsUtility.AddComponentsForSpawn(pawn);
- // 如果是被武力摧毁,给玩家一个提示
- if (mode == DestroyMode.KillFinalize)
+ // 2. 对Pawn施加等比例伤害
+ float pawnDamage = pawn.MaxHitPoints * damageProportion;
+ DamageInfo pawnDinfo = new DamageInfo(dinfo.Def, pawnDamage, dinfo.ArmorPenetrationInt, dinfo.Angle, dinfo.Instigator, null, dinfo.Weapon, dinfo.Category, dinfo.IntendedTarget);
+ pawn.TakeDamage(pawnDinfo);
+
+ Messages.Message("PawnTransformer_ForcedRevert".Translate(pawn.Named("PAWN")), pawn, MessageTypeDefOf.NegativeEvent);
+
+ // 3. 移除建筑
+ // 注意:这里不调用base.Destroy(),以避免循环和重复的恢复逻辑
+ this.Destroy(DestroyMode.Vanish);
+ }
+ }
+
+ public override void Destroy(DestroyMode mode)
+ {
+ // 只有在建筑还存在于地图上时,才执行恢复逻辑
+ if (this.Spawned)
+ {
+ if (compMorphable != null && compMorphable.StoredPawn != null)
{
- Messages.Message("PawnTransformer_BuildingDestroyed".Translate(pawn.Named("PAWN"), this.Named("BUILDING")), pawn, MessageTypeDefOf.NegativeEvent);
+ Pawn pawn = compMorphable.StoredPawn;
+ Map map = this.Map;
+ IntVec3 position = this.Position;
+
+ GenSpawn.Spawn(pawn, position, map, WipeMode.Vanish);
+ PawnComponentsUtility.AddComponentsForSpawn(pawn);
+
+ if (mode == DestroyMode.KillFinalize)
+ {
+ Messages.Message("PawnTransformer_BuildingDestroyed".Translate(pawn.Named("PAWN"), this.Named("BUILDING")), pawn, MessageTypeDefOf.NegativeEvent);
+ }
}
}
base.Destroy(mode);
diff --git a/Source/ArachnaeSwarm/Morphable/CompAbilityEffect_Transform.cs b/Source/ArachnaeSwarm/Morphable/CompAbilityEffect_Transform.cs
index 270d783..a5614f5 100644
--- a/Source/ArachnaeSwarm/Morphable/CompAbilityEffect_Transform.cs
+++ b/Source/ArachnaeSwarm/Morphable/CompAbilityEffect_Transform.cs
@@ -33,17 +33,6 @@ namespace ArachnaeSwarm
Building building = (Building)GenSpawn.Spawn(Props.buildingDef, position, map, WipeMode.Vanish);
building.SetFaction(pawn.Faction);
- if (pawn.Name != null)
- {
- building.TryGetComp()?.TryAssignPawn(pawn);
- }
-
- var container = building.GetComp();
- if (container != null)
- {
- container.GetDirectlyHeldThings().TryAdd(pawn);
- }
-
var newMorphComp = building.GetComp();
if (newMorphComp != null)
{