rjw-genes/1.6/Source/Genes/Fluid/HediffComps/HediffComp_MatchSeverityOfHediff.cs
Telanda-DDS dde1c98b18 - Incremented version to 2.5.1
- Removed DDS Files
- Added Initial Support for Rimworld 1.6
- Added Additional mod requirement to PatchBSShared.xml to prevent premature loading.
- Refactored Cumpilation integration to make it optional rather then a Required Mod.
- Disabled succubus tail interactions pending rewrite for RJW's new interactions system.
- Disabled Quirks pending rewrite RJW separating them into their own mod.
2025-07-17 21:07:51 +10:00

26 lines
835 B
C#

using Verse;
namespace RJW_Genes
{
public class HediffComp_MatchSeverityOfHediff : HediffComp
{
public HediffCompProperties_MatchSeverityOfHediff Props => (HediffCompProperties_MatchSeverityOfHediff)this.props;
public override void CompPostTick(ref float severityAdjustment)
{
base.CompPostTick(ref severityAdjustment);
bool hasMatchingHediff = parent.pawn.health.hediffSet.HasHediff(Props.hediffToMatch);
if (!hasMatchingHediff) {
parent.Severity = 0.0f;
}
else
{
Hediff match = parent.pawn.health.hediffSet.GetFirstHediffOfDef(Props.hediffToMatch);
if (match == null) parent.Severity = 0.0f;
parent.Severity = match.Severity;
}
}
}
}