暂存
This commit is contained in:
Binary file not shown.
@@ -15,9 +15,6 @@
|
|||||||
<Shooting>2</Shooting>
|
<Shooting>2</Shooting>
|
||||||
<Melee>2</Melee>
|
<Melee>2</Melee>
|
||||||
</skillGains>
|
</skillGains>
|
||||||
<forcedHediffs>
|
|
||||||
<li>ARA_HiveMindMaster</li>
|
|
||||||
</forcedHediffs>
|
|
||||||
|
|
||||||
<spawnCategories>
|
<spawnCategories>
|
||||||
<li>ArachnaeQueen_spawnCategoriesA</li>
|
<li>ArachnaeQueen_spawnCategoriesA</li>
|
||||||
@@ -56,10 +53,6 @@
|
|||||||
<li>ArachnaeNode_spawnCategoriesA</li>
|
<li>ArachnaeNode_spawnCategoriesA</li>
|
||||||
</spawnCategories>
|
</spawnCategories>
|
||||||
|
|
||||||
<forcedHediffs>
|
|
||||||
<li>ARA_HiveMindDrone</li>
|
|
||||||
</forcedHediffs>
|
|
||||||
|
|
||||||
<requiresSpawnCategory>true</requiresSpawnCategory>
|
<requiresSpawnCategory>true</requiresSpawnCategory>
|
||||||
</AlienRace.AlienBackstoryDef>
|
</AlienRace.AlienBackstoryDef>
|
||||||
<AlienRace.AlienBackstoryDef ParentName="ARA_BaseBackStory">
|
<AlienRace.AlienBackstoryDef ParentName="ARA_BaseBackStory">
|
||||||
|
|||||||
48
1.6/1.6/Defs/HediffDefs/ARA_Hediffs_Temperature.xml
Normal file
48
1.6/1.6/Defs/HediffDefs/ARA_Hediffs_Temperature.xml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Defs>
|
||||||
|
|
||||||
|
<HediffDef>
|
||||||
|
<defName>ARA_TemperatureRegulation</defName>
|
||||||
|
<label>环境温度适应</label>
|
||||||
|
<description>根据环境温度调整生理状态。阿拉克涅虫族对环境温度比其他生物更加敏感,温度不适宜时将会影响意识。最低适应16°,最高适应26°环境温度。</description>
|
||||||
|
<hediffClass>HediffWithComps</hediffClass>
|
||||||
|
<defaultLabelColor>(0.6, 0.8, 0.9)</defaultLabelColor>
|
||||||
|
<maxSeverity>1.0</maxSeverity>
|
||||||
|
<initialSeverity>0.5</initialSeverity>
|
||||||
|
<comps>
|
||||||
|
<li Class="ArachnaeSwarm.HediffCompProperties_Temperature">
|
||||||
|
<minComfortableTemperature>16</minComfortableTemperature>
|
||||||
|
<maxComfortableTemperature>26</maxComfortableTemperature>
|
||||||
|
<severityChangeIn>0.01</severityChangeIn>
|
||||||
|
<severityChangeOut>-0.01</severityChangeOut>
|
||||||
|
</li>
|
||||||
|
</comps>
|
||||||
|
<stages>
|
||||||
|
<li>
|
||||||
|
<minSeverity>0</minSeverity>
|
||||||
|
<label>不适应</label>
|
||||||
|
<capMods>
|
||||||
|
<li>
|
||||||
|
<capacity>Consciousness</capacity>
|
||||||
|
<offset>-0.2</offset>
|
||||||
|
</li>
|
||||||
|
</capMods>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<minSeverity>0.4</minSeverity>
|
||||||
|
<label>适应</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<minSeverity>0.8</minSeverity>
|
||||||
|
<label>舒适</label>
|
||||||
|
<capMods>
|
||||||
|
<li>
|
||||||
|
<capacity>Consciousness</capacity>
|
||||||
|
<offset>0.1</offset>
|
||||||
|
</li>
|
||||||
|
</capMods>
|
||||||
|
</li>
|
||||||
|
</stages>
|
||||||
|
</HediffDef>
|
||||||
|
|
||||||
|
</Defs>
|
||||||
@@ -62,6 +62,13 @@
|
|||||||
</deathAction> -->
|
</deathAction> -->
|
||||||
</race>
|
</race>
|
||||||
<comps>
|
<comps>
|
||||||
|
<li Class="ArachnaeSwarm.CompProperties_HediffGiver">
|
||||||
|
<hediffs>
|
||||||
|
<li>ARA_TemperatureRegulation</li>
|
||||||
|
</hediffs>
|
||||||
|
<addChance>1.0</addChance>
|
||||||
|
<allowDuplicates>false</allowDuplicates>
|
||||||
|
</li>
|
||||||
<li Class="ArachnaeSwarm.CompProperties_HediffGiver">
|
<li Class="ArachnaeSwarm.CompProperties_HediffGiver">
|
||||||
<hediffs>
|
<hediffs>
|
||||||
<li>ARA_HiveMindWorker</li>
|
<li>ARA_HiveMindWorker</li>
|
||||||
|
|||||||
@@ -574,6 +574,13 @@
|
|||||||
<li MayRequire="Nals.FacialAnimation">
|
<li MayRequire="Nals.FacialAnimation">
|
||||||
<compClass>FacialAnimation.FacialAnimationControllerComp</compClass>
|
<compClass>FacialAnimation.FacialAnimationControllerComp</compClass>
|
||||||
</li>
|
</li>
|
||||||
|
<li Class="ArachnaeSwarm.CompProperties_HediffGiver">
|
||||||
|
<hediffs>
|
||||||
|
<li>ARA_HiveMindDrone</li>
|
||||||
|
</hediffs>
|
||||||
|
<addChance>1.0</addChance>
|
||||||
|
<allowDuplicates>false</allowDuplicates>
|
||||||
|
</li>
|
||||||
<!--<li>
|
<!--<li>
|
||||||
<compClass>FacialAnimation.EmotionControllerComp</compClass>
|
<compClass>FacialAnimation.EmotionControllerComp</compClass>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -217,6 +217,13 @@
|
|||||||
<minMonolithLevelForStudy>1</minMonolithLevelForStudy>
|
<minMonolithLevelForStudy>1</minMonolithLevelForStudy>
|
||||||
<requiresImprisonment>true</requiresImprisonment>
|
<requiresImprisonment>true</requiresImprisonment>
|
||||||
</li>
|
</li>
|
||||||
|
<li Class="ArachnaeSwarm.CompProperties_HediffGiver">
|
||||||
|
<hediffs>
|
||||||
|
<li>ARA_TemperatureRegulation</li>
|
||||||
|
</hediffs>
|
||||||
|
<addChance>1.0</addChance>
|
||||||
|
<allowDuplicates>false</allowDuplicates>
|
||||||
|
</li>
|
||||||
</comps>
|
</comps>
|
||||||
</ThingDef>
|
</ThingDef>
|
||||||
<AlienRace.ThingDef_AlienRace Name="ARA_QueenBase" ParentName="ARA_PawnBase">
|
<AlienRace.ThingDef_AlienRace Name="ARA_QueenBase" ParentName="ARA_PawnBase">
|
||||||
@@ -742,7 +749,13 @@
|
|||||||
</recipes>
|
</recipes>
|
||||||
|
|
||||||
<comps>
|
<comps>
|
||||||
|
<li Class="ArachnaeSwarm.CompProperties_HediffGiver">
|
||||||
|
<hediffs>
|
||||||
|
<li>ARA_HiveMindMaster</li>
|
||||||
|
</hediffs>
|
||||||
|
<addChance>1.0</addChance>
|
||||||
|
<allowDuplicates>false</allowDuplicates>
|
||||||
|
</li>
|
||||||
</comps>
|
</comps>
|
||||||
</AlienRace.ThingDef_AlienRace>
|
</AlienRace.ThingDef_AlienRace>
|
||||||
</Defs>
|
</Defs>
|
||||||
@@ -65,7 +65,8 @@ namespace ArachnaeSwarm
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. 准备抱脸虫和Hediff
|
// 3. 准备抱脸虫和Hediff
|
||||||
Pawn originalCaster = caster.SplitOff(1) as Pawn;
|
Pawn originalCaster = PawnGenerator.GeneratePawn(caster.kindDef, caster.Faction);
|
||||||
|
PawnDataUtility.TransferSoul(caster, originalCaster); // 确保克隆体有完全一致的数据
|
||||||
Hediff_Possession hediff = (Hediff_Possession)HediffMaker.MakeHediff(HediffDef.Named("ARA_Possession"), targetPawn);
|
Hediff_Possession hediff = (Hediff_Possession)HediffMaker.MakeHediff(HediffDef.Named("ARA_Possession"), targetPawn);
|
||||||
hediff.originalHostData = originalHostData; // 将宿主数据存入Hediff
|
hediff.originalHostData = originalHostData; // 将宿主数据存入Hediff
|
||||||
|
|
||||||
@@ -77,6 +78,12 @@ namespace ArachnaeSwarm
|
|||||||
// 5. 灵魂转移,此时 targetPawn 的技能被 caster 的技能覆盖
|
// 5. 灵魂转移,此时 targetPawn 的技能被 caster 的技能覆盖
|
||||||
PawnDataUtility.TransferSoul(caster, targetPawn);
|
PawnDataUtility.TransferSoul(caster, targetPawn);
|
||||||
|
|
||||||
|
// 夺舍成功后,原始的抱脸虫应该消失
|
||||||
|
if (!caster.Destroyed)
|
||||||
|
{
|
||||||
|
caster.Destroy(DestroyMode.Vanish);
|
||||||
|
}
|
||||||
|
|
||||||
// 6. 技能合并:在灵魂转移后,直接在最终的身体 (targetPawn) 上进行合并
|
// 6. 技能合并:在灵魂转移后,直接在最终的身体 (targetPawn) 上进行合并
|
||||||
if (targetPawn.skills != null)
|
if (targetPawn.skills != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -129,6 +129,9 @@
|
|||||||
<Compile Include="ARA_TrainingWork\JobClean\ThinkNode_ConditionalAnimalShouldDoCleaningWork.cs" />
|
<Compile Include="ARA_TrainingWork\JobClean\ThinkNode_ConditionalAnimalShouldDoCleaningWork.cs" />
|
||||||
<Compile Include="ARA_TrainingWork\JobClean\WorkGiver_ArachnaeClean.cs" />
|
<Compile Include="ARA_TrainingWork\JobClean\WorkGiver_ArachnaeClean.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="HediffComp_Temperature.cs" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- 自定义清理任务,删除obj文件夹中的临时文件 -->
|
<!-- 自定义清理任务,删除obj文件夹中的临时文件 -->
|
||||||
<Target Name="CleanDebugFiles" AfterTargets="Build">
|
<Target Name="CleanDebugFiles" AfterTargets="Build">
|
||||||
|
|||||||
53
Source/ArachnaeSwarm/HediffComp_Temperature.cs
Normal file
53
Source/ArachnaeSwarm/HediffComp_Temperature.cs
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
using RimWorld;
|
||||||
|
using UnityEngine;
|
||||||
|
using Verse;
|
||||||
|
|
||||||
|
namespace ArachnaeSwarm
|
||||||
|
{
|
||||||
|
public class HediffComp_Temperature : HediffComp
|
||||||
|
{
|
||||||
|
public HediffCompProperties_Temperature Props => (HediffCompProperties_Temperature)props;
|
||||||
|
|
||||||
|
public override void CompPostTick(ref float severityAdjustment)
|
||||||
|
{
|
||||||
|
if (!parent.pawn.IsHashIntervalTick(360)) // 每 60 ticks 检查一次
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
float ambientTemperature = parent.pawn.AmbientTemperature;
|
||||||
|
float minComfortable = Props.minComfortableTemperature;
|
||||||
|
float maxComfortable = Props.maxComfortableTemperature;
|
||||||
|
|
||||||
|
if (ambientTemperature >= minComfortable && ambientTemperature <= maxComfortable)
|
||||||
|
{
|
||||||
|
// 在舒适温度范围内
|
||||||
|
if (Props.severityChangeIn != 0f)
|
||||||
|
{
|
||||||
|
severityAdjustment += Props.severityChangeIn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 在舒适温度范围外
|
||||||
|
if (Props.severityChangeOut != 0f)
|
||||||
|
{
|
||||||
|
severityAdjustment += Props.severityChangeOut;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class HediffCompProperties_Temperature : HediffCompProperties
|
||||||
|
{
|
||||||
|
public float minComfortableTemperature = 16f;
|
||||||
|
public float maxComfortableTemperature = 26f;
|
||||||
|
public float severityChangeIn = 0f;
|
||||||
|
public float severityChangeOut = 0f;
|
||||||
|
|
||||||
|
public HediffCompProperties_Temperature()
|
||||||
|
{
|
||||||
|
compClass = typeof(HediffComp_Temperature);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user