Tiered Regeneration - KonradHeinser/EBSGFramework GitHub Wiki
This comp heals the pawn's injuries and regrows lost parts based on the regenSets you set. Parts regrow instantly when the timer runs out, but if they are interrupted, then the progress is lost:
<comps>
<li Class="EBSGFramework.HediffCompProperties_TieredRegeneration">
</li>
</comps>
These are the options available in the comp:
- healWhileRegrowing : Default (False) : When True, regen sets that contain both a regrowth and a healing effect will do both simultaneously
- prioritizeHeal : Default (False) : When True, any regen set which both heals injuries and regrows parts will prioritize healing over regrowth. Not applicable if using healWhileRegrowing
- regenSets : A special list of items that dictates how the hediff comp will actually heal the pawn
- validSeverity : Default (0~99999) : Causes the set to be active when in this range. If a single value is entered, then any severity above that number will be considered valid. Only the first valid set will be considered active at any one time
- ticksToRegrowParts : Number of ticks it takes to restore lost parts. The restoration happens in one lump, so there won't be any indication it's regrowing a part until the end. The time it takes to regrow a part is generally dictated by whatever regen set initially started the process rather than the current one
- regrowTicksPerTick : Default (1) : How quickly the ticksToRegrowParts progresses. If you want to make the remaining regrowth duration to change when the regen set changes, keep ticksToRegrowParts the same between all sets and increase this instead
- ticksToHealInterval : Default (100) : The number of ticks between healing. If set to 0, then basic regeneration is disabled for the set
- healAmount : Default (0.1) : The amount of severity to remove from an injury hediff
- repeatHealCount : Default (1) : How many times to do the heal each time the interval ends
- healTicksPerTick : Default (1) : Similar to regrowth, if a heal is in progress when the regen set changes, the remaining time on the current heal will not update to reflect the new interval. If you want it to change more fluidly between sets, keep ticksToHealInterval the same between all sets, and change this value instead
Important Notes: Only the first matching set is used, so set overlap won't cause double-healing or something similar. When entering a new set, regrowth and healing are only interrupted if the new regeneration set does not allow for regrowth/healing. Also, the process will still have the same time remaining unless the TicksPerTicks values are different.
Adapted code of the Superhero Genes ability, Regenesis. This ability applied a hediff that kept gaining severity over time, increasing healing as it goes. These are the hediff comps it used:
<comps>
<li Class="EBSGFramework.HediffCompProperties_TieredRegeneration">
<regenSets>
<li>
<repeatHealCount>1</repeatHealCount>
<healAmount>0.1</healAmount>
<maxSeverity>1</maxSeverity>
</li>
<li>
<repeatHealCount>10</repeatHealCount>
<healAmount>0.1</healAmount>
<minSeverity>1.001</minSeverity>
<maxSeverity>2</maxSeverity>
</li>
<li>
<ticksToRegrowPart>300000</ticksToRegrowPart>
<repeatHealCount>10</repeatHealCount>
<healAmount>0.1</healAmount>
<minSeverity>2.001</minSeverity>
<maxSeverity>3</maxSeverity>
</li>
<li>
<ticksToRegrowPart>120000</ticksToRegrowPart>
<repeatHealCount>10</repeatHealCount>
<healAmount>0.3</healAmount>
<minSeverity>3.001</minSeverity>
</li>
</regenSets>
</li>
<li Class="HediffCompProperties_SeverityPerDay">
<severityPerDay>0.2</severityPerDay>
</li>
</comps>