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 tags 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 tags are:

        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityGiveMultipleHediffs">
                <hediffsToGive>
                    <li>
                    </li>
                </hediffsToGive>
            </li>
        </comps>

Each li can have the following tags:

  • 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 tag
  • onlyApplyToSelf : Default (false) : Equivalent to setting applyToTarget to false, and applyToSelf to true, just does both in a single tag
  • replaceExisting : Default (false) : If true, removes the old hediff and adds a new one with the designated severity. If false, adds severity to the old one if it exists, or adds a new one
  • severity : Default (1) : Starting severity or, if replaceExisting is false, added severity

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>
⚠️ **GitHub.com Fallback** ⚠️