伤害响应,乌拉受到的每点伤害增加维护需求严重性
This commit is contained in:
Binary file not shown.
@@ -1003,7 +1003,7 @@
|
||||
<ThingDef ParentName="MechSerumBase">
|
||||
<defName>WULA_MechRepairKit</defName>
|
||||
<label>机械乌拉修理套件</label>
|
||||
<description>一种一次性使用的堕落乌拉帝国修理套件,专门用来完全修复机械乌拉。</description>
|
||||
<description>一种一次性使用的堕落乌拉帝国修理套件,专门用来紧急修复机械乌拉,这种不依赖专用维护舱的临时修复无法完全修复机械乌拉。</description>
|
||||
<descriptionHyperlinks><RecipeDef>AdministerWULA_MechRepairKit</RecipeDef></descriptionHyperlinks>
|
||||
<graphicData>
|
||||
<texPath>Wula/Item/WULA_MechRepairKit</texPath>
|
||||
|
||||
@@ -4,18 +4,23 @@
|
||||
<defName>WULA_Maintenance_Neglect</defName>
|
||||
<label>维护</label>
|
||||
<description>如果缺乏定期维护,身体机能将会出现衰退迹象。需要进入维护舱进行修复。</description>
|
||||
<hediffClass>HediffWithComps</hediffClass>
|
||||
<hediffClass>Hediff_High</hediffClass>
|
||||
<defaultLabelColor>(0.8, 0.35, 0.35)</defaultLabelColor>
|
||||
<isBad>false</isBad>
|
||||
<initialSeverity>0</initialSeverity>
|
||||
<minSeverity>0</minSeverity>
|
||||
<maxSeverity>1</maxSeverity>
|
||||
<maxSeverity>2.0</maxSeverity>
|
||||
<!--<lethalSeverity>2</lethalSeverity>-->
|
||||
<comps>
|
||||
<li Class="WulaFallenEmpire.HediffCompProperties_MaintenanceNeed">
|
||||
<thresholdDays>60</thresholdDays>
|
||||
<severityPerDayBeforeThreshold>0.004</severityPerDayBeforeThreshold>
|
||||
<severityPerDayAfterThreshold>0.02</severityPerDayAfterThreshold>
|
||||
<thresholdDays>80</thresholdDays>
|
||||
<!-- 80天内严重性达到1.0 (1.0 / 80 = 0.0125) -->
|
||||
<severityPerDayBeforeThreshold>0.0125</severityPerDayBeforeThreshold>
|
||||
<!-- 达到阈值后,在30天内从1.0增长到2.0 (1.0 / 30 ≈ 0.03333) -->
|
||||
<severityPerDayAfterThreshold>0.03333</severityPerDayAfterThreshold>
|
||||
</li>
|
||||
<li Class="WulaFallenEmpire.HediffCompProperties_DamageResponse">
|
||||
<severityIncreasePerDamage>0.01</severityIncreasePerDamage>
|
||||
</li>
|
||||
</comps>
|
||||
<stages>
|
||||
@@ -52,6 +57,16 @@
|
||||
<li>
|
||||
<label>损坏</label>
|
||||
<minSeverity>1.0</minSeverity>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
<setMax>0.5</setMax>
|
||||
</li>
|
||||
</capMods>
|
||||
</li>
|
||||
<li>
|
||||
<label>崩坏</label>
|
||||
<minSeverity>2.0</minSeverity>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
|
||||
@@ -1070,3 +1070,20 @@ requests.exceptions.SSLError: HTTPSConnectionPool(host='dashscope.aliyuncs.com',
|
||||
2025-08-14 10:16:32,934 - INFO - 文件名精确匹配: C:\Steam\steamapps\common\RimWorld\Data\dll1.6\Verse\DebugSettings.txt
|
||||
2025-08-14 10:16:32,934 - WARNING - 候选文件过多 (206),仅处理前 25 个。
|
||||
2025-08-14 10:16:40,201 - INFO - 向量搜索完成。找到了 2 个匹配项并成功提取了代码。
|
||||
2025-08-14 10:32:12,811 - INFO - Processing request of type CallToolRequest
|
||||
2025-08-14 10:32:12,812 - INFO - 收到问题: class Hediff_High
|
||||
2025-08-14 10:32:12,812 - INFO - 找到的潜在关键词: ['Hediff_High']
|
||||
2025-08-14 10:32:12,812 - INFO - 提取到关键词: ['Hediff_High']
|
||||
2025-08-14 10:32:12,812 - INFO - 缓存未命中,开始实时搜索: Hediff_High
|
||||
2025-08-14 10:32:14,336 - INFO - 找到 13 个候选文件,开始向量化处理...
|
||||
2025-08-14 10:32:14,336 - INFO - 文件名精确匹配: C:\Steam\steamapps\common\RimWorld\Data\dll1.6\RimWorld\Hediff_High.txt
|
||||
2025-08-14 10:32:18,943 - INFO - 向量搜索完成。找到了 5 个匹配项并成功提取了代码。
|
||||
2025-08-14 10:32:46,080 - INFO - Processing request of type CallToolRequest
|
||||
2025-08-14 10:32:46,080 - INFO - 收到问题: class HediffWithComps
|
||||
2025-08-14 10:32:46,080 - INFO - 找到的潜在关键词: ['HediffWithComps']
|
||||
2025-08-14 10:32:46,080 - INFO - 提取到关键词: ['HediffWithComps']
|
||||
2025-08-14 10:32:46,080 - INFO - 缓存未命中,开始实时搜索: HediffWithComps
|
||||
2025-08-14 10:32:47,587 - INFO - 找到 52 个候选文件,开始向量化处理...
|
||||
2025-08-14 10:32:47,587 - INFO - 文件名精确匹配: C:\Steam\steamapps\common\RimWorld\Data\dll1.6\Verse\HediffWithComps.txt
|
||||
2025-08-14 10:32:47,588 - WARNING - 候选文件过多 (51),仅处理前 25 个。
|
||||
2025-08-14 10:32:54,580 - INFO - 向量搜索完成。找到了 5 个匹配项并成功提取了代码。
|
||||
|
||||
37
Source/WulaFallenEmpire/HediffComp_DamageResponse.cs
Normal file
37
Source/WulaFallenEmpire/HediffComp_DamageResponse.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Verse;
|
||||
|
||||
namespace WulaFallenEmpire
|
||||
{
|
||||
// 定义了在XML中可以设置的属性
|
||||
public class HediffCompProperties_DamageResponse : HediffCompProperties
|
||||
{
|
||||
// 每点伤害值所转化的严重性数值
|
||||
public float severityIncreasePerDamage = 0f;
|
||||
|
||||
public HediffCompProperties_DamageResponse()
|
||||
{
|
||||
this.compClass = typeof(HediffComp_DamageResponse);
|
||||
}
|
||||
}
|
||||
|
||||
// 组件的实际逻辑
|
||||
public class HediffComp_DamageResponse : HediffComp
|
||||
{
|
||||
// 一个方便获取上面属性的捷径
|
||||
private HediffCompProperties_DamageResponse Props => (HediffCompProperties_DamageResponse)this.props;
|
||||
|
||||
// 当Hediff的持有者(Pawn)受到伤害后,这个方法会被游戏调用
|
||||
public override void Notify_PawnPostApplyDamage(DamageInfo dinfo, float totalDamageDealt)
|
||||
{
|
||||
base.Notify_PawnPostApplyDamage(dinfo, totalDamageDealt);
|
||||
|
||||
// 如果伤害值大于0,并且我们在XML中设置了转化率
|
||||
if (totalDamageDealt > 0 && Props.severityIncreasePerDamage > 0f)
|
||||
{
|
||||
// 增加父Hediff的严重性
|
||||
// this.parent 指向这个组件所属的Hediff实例
|
||||
this.parent.Severity += totalDamageDealt * Props.severityIncreasePerDamage;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@
|
||||
<Compile Include="Verb\Trackingbullet.cs" />
|
||||
<Compile Include="Verb\Verb_ShootBeamExplosive.cs" />
|
||||
<Compile Include="Verb\VerbPropertiesExplosiveBeam.cs" />
|
||||
<Compile Include="Verb\Verb_MeleeAttack_Cleave.cs" />
|
||||
<Compile Include="Verb\Verb_MeleeAttack_Cleave.cs" />
|
||||
<Compile Include="WorkGiver_FeedWulaPatient.cs" />
|
||||
<Compile Include="WorkGiver_Warden_DeliverEnergy.cs" />
|
||||
<Compile Include="WorkGiver_Warden_FeedWula.cs" />
|
||||
@@ -146,7 +146,8 @@
|
||||
<Compile Include="WulaStatDefOf.cs" />
|
||||
<Compile Include="Building_MaintenancePod.cs" />
|
||||
<Compile Include="HediffComp_MaintenanceNeed.cs" />
|
||||
<Compile Include="JobDefOf_WULA.cs" />
|
||||
<Compile Include="HediffComp_DamageResponse.cs" />
|
||||
<Compile Include="JobDefOf_WULA.cs" />
|
||||
<Compile Include="ThingDefOf_WULA.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
Reference in New Issue
Block a user