Remove When Damaged - KonradHeinser/EBSGFramework GitHub Wiki
This hediff comp allows you to make hediffs which are removed when the pawn takes damage:
<comps>
<li Class="EBSGFramework.HediffCompProperties_RemoveWhenDamaged">
</li>
</comps>
If nothing is added to the comp, the hediff will be removed when any amount of any damage is taken. These options allow for some finer control of when the removal occurs:
- damageDefs : A list of DamageDefs to check for to see if it's a valid damage type for causing removal
- checkType : Default (Required) : Determines how the damageDefs check works. The options are Required (the damage taken must be one of the ones listed) and Forbidden (the damage taken must not be one of the ones listed)
- amount : Default (-1) : The total amount of valid damage that must be taken for the hediff to be removed. If left at -1, any amount of valid damage will remove the hediff
- validAmounts : Default (0) : The amount of damage that must be dealt by a single attack for it to be counted. This can be a range or a single value. If a single value is given, any amount at or above that value will be counted as valid
This example removes itself after the pawn takes 10 flame or burn damage:
<HediffDef>
<defName>Burnable</defName>
<label>burnable hediff</label>
<description>This is gone after taking some fire damage.</description>
<everCurableByItem>false</everCurableByItem>
<initialSeverity>0.001</initialSeverity>
<stages />
<hediffClass>HediffWithComps</hediffClass>
<scenarioCanAdd>false</scenarioCanAdd>
<comps>
<li Class="EBSGFramework.HediffCompProperties_RemoveWhenDamaged">
<amount>10</amount>
<damageDefs>
<li>Burn</li>
<li>Flame</li>
</damageDefs>
</li>
</comps>
</HediffDef>