Files
ArachnaeSwarm/Source/ArachnaeSwarm/Hediff_Frozen.cs
2025-10-15 13:37:16 +08:00

46 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using RimWorld;
using Verse;
using UnityEngine;
namespace ArachnaeSwarm
{
public class Hediff_Frozen : Hediff_Injury
{
// 我们需要覆盖这个方法来改变在健康面板上显示的标签
public override string LabelInBrackets
{
get
{
// 如果严重性达到了部位的满生命值,就显示“完全冷冻”
if (Severity >= Part.def.GetMaxHealth(pawn))
{
return "Fully Frozen";
}
return base.LabelInBrackets;
}
}
// 当部位的疼痛感,可以根据严重性调整
public override float PainOffset
{
get
{
// 冷冻不造成额外疼痛
return 0f;
}
}
// 当一个部位的伤害被治疗(在这里就是冷冻值减少)时调用
public override void Heal(float amount)
{
// 减少严重性但不让它低于0
Severity -= amount;
if (Severity < 0)
{
Severity = 0;
}
}
// 伤害拦截逻辑将通过 Harmony 补丁实现,不在 Hediff 内部处理
}
}