Give Multiple Hediffs - KonradHeinser/EBSGFramework GitHub Wiki
This acts like Vanilla's GiveHediff, but allows for a lot more options. Each individual hediff can be assigned the same nodes as what GiveHediff would give, so for example, you can make it apply buff A to both target and caster, buff B to only target, and buff C to only caster, all in one ability comp. The hediff comp accepts one input, a list of hediffsToGive. The hediff to give nodes are:
<comps>
<li Class="EBSGFramework.CompProperties_AbilityGiveMultipleHediffs">
<hediffsToGive>
<li>
</li>
</hediffsToGive>
</li>
</comps>
Each li can have the following nodes:
- hediffDef : Each desired hediff will require its own list item
- onlyBrain : Default (false) : Instead of applying to the entire body, it applies the hediff to the brain
- bodyParts : A list of body parts to apply the hediff to. Overrides onlyBrain
- applyToSelf : Default (false) : Applies this hediff to the caster, regardless of the selected target
- applyToTarget : Default (true) : Applies this hediff to the target. Usually no reason to set this to false due to the below node
- onlyApplyToSelf : Default (false) : Equivalent to setting applyToTarget to false, and applyToSelf to true, just does both in a single node
- skipExisting : Default (False) : If true and the pawn already has the hediff on all of the parts, then this hediff is skipped. If the hediff is only on some parts, the comp will still add the hediff to those parts
- replaceExisting : Default (False) : If true and the pawn already has the 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 and skipExisting are false. If the severity is set to 0 and replaceExisting is set to True, then this will instead remove the hediff(s)
Example of comp in an ability that adds those generic buffs mentioned earlier.
<comps>
<li Class="EBSGFramework.CompProperties_AbilityGiveMultipleHediffs">
<hediffsToGive> <!--List includes most mundane injuries, excluding lost parts-->
<li> <!--Imaginary BuffA gives bonuses to both pawns, and starts with a severity of 10.-->
<hediffDef>BuffA</hediffDef>
<applyToSelf>true</applyToSelf>
<replaceExisting>true</replaceExisting>
<severity>10</severity>
</li>
<li> <!--Imaginary BuffB doesn't have anything special going on, just applies to the target at 1 severity-->
<hediffDef>BuffB</hediffDef>
</li>
<li> <!--Imaginary BuffC acts similar to B, but is only applied to the caster-->
<hediffDef>BuffC</hediffDef>
<onlyApplyToSelf>true</onlyApplyToSelf>
</li>
</hediffsToGive>
</li>
</comps>