Hediffs on Removal - KonradHeinser/EBSGFramework GitHub Wiki
This hediff comp creates other hediffs when the attached hediff is removed. The basic comp looks like this:
<comps>
<li Class="EBSGFramework.HediffCompProperties_HediffsOnRemoval">
<hediffsToGive>
<li>
</li>
</hediffsToGive>
</li>
</comps>
Each hediffToGive represents a new hediff or list of hediffs to apply with different conditions than others. This is the full list of tags available for each li:
- hediffDef : The hediff to apply
- hediffDefs : A list of hediffs to apply
- bodyParts : A list of body parts to apply to. If empty, it applies to the whole body
- replaceExisting : Default (False) : If true and the pawn already has the next hediff, that hediff is removed (can trigger this comp on that hediff), and a new version of it is added
- severity : Default (1) : The severity to give, or add to the existing one if replaceExisting is false. If the severity is set to 0 and replaceExisting is set to True, then this will instead remove the hediff(s) on removal
You can also add a tag outside of the hediffsToGive that changes when the comp is allowed to activate
- validSeverity : Can be either a single value or a range (i.e. 0~1.5). If a single value, then the severity must be at or above that value for the comp to activate. If using a range, then the hediff's severity must be in that range for the comp to activate
This example creates a cycle of hediffs that are added as the one before it is removed. Every time the cycle goes through ABC, it increases the D hediff by 1, allowing for a method of creating an ever increasing effect achieved by cycling through the other ones (this example can only remove hediffs with dev mode, but could be changed to be more automatic, triggered by items, or triggered by abilities)
<HediffDef ParentName="EBSG_TestHediffBase">
<defName>A</defName>
<label>a</label>
<description>Start of the cycle</description>
<comps>
<li Class="EBSGFramework.HediffCompProperties_HediffsOnRemoval">
<hediffsToGive>
<li>
<hediffDef>B</hediffDef>
</li>
</hediffsToGive>
</li>
</comps>
</HediffDef>
<HediffDef ParentName="EBSG_TestHediffBase">
<defName>B</defName>
<label>b</label>
<description>A middle step</description>
<comps>
<li Class="EBSGFramework.HediffCompProperties_HediffsOnRemoval">
<hediffsToGive>
<li>
<hediffDef>C</hediffDef>
</li>
</hediffsToGive>
</li>
</comps>
</HediffDef>
<HediffDef ParentName="EBSG_TestHediffBase">
<defName>C</defName>
<label>c</label>
<description>Adds the last hediff and starts the next cycle</description>
<comps>
<li Class="EBSGFramework.HediffCompProperties_HediffsOnRemoval">
<hediffsToGive>
<li>
<hediffDefs>
<li>D</li>
<li>A</li>
</hediffDefs>
</li>
</hediffsToGive>
</li>
</comps>
</HediffDef>
<HediffDef ParentName="EBSG_TestHediffBase">
<defName>D</defName>
<label>d</label>
<description>End of the line</description>
</HediffDef>