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>
These are the options available:
- hediffsToGive : A special list of items that handles hediff adding, with these as the options in each li:
- hediffDef : Each desired hediff will require its own list item
- chance : Default (1) : The chance of the hediffDef actually applying
- 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 a range of values is given instead of a singular value, then a random number in that range is used for the severity. If this number is less than or equal to 0, the li is skipped unless replaceExisting is true, in which case the hediffDef is removed
- endOn : Default (End) : Determines at what point hediffs are done being added. The options are End (end of the list), Success (any hediffs are marked as added), Fail (chance failed or the hediffs were psychic but couldn't be added due to psychic sensitivity being 0), FailIgnorePsychic (chance failed)
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>