Give Hediff to Killer - KonradHeinser/EBSGFramework GitHub Wiki

This comp will make it so when the pawn dies, it will attempt to add a hediff to the killer. In the event that the pawn dies of less direct causes (i.e. disease, toxicity, bloodloss, infection, etc), there usually won't be a killer available to point to, so the comp will do nothing in those situations:

        <comps>
            <li Class="EBSGFramework.HediffCompProperties_GiveHediffToKiller">
            </li>
        </comps>
  • hediff : The HediffDef to add
  • initialSeverity : Default (1) : The severity to give the hediff if the killer does not already have it
  • addedSeverity : Default (1) : The severity to add to an existing version of the hediff if the killer already has it
  • causes : A list of HediffDefs to check for to see if the hediff can be applied. The hediff that the game views as the "culprit" of the death is the one this list looks at, and this is mostly only useful for a list of hediffs related to DamageDefs, like Crack, Crush, ChemicalBurn, Cut, Bite, etc.
  • causeCheck : Default (Required) : The
  • targetParams : Optional targeting parameters with all the same options as what verbs use. Regardless of what is put in here, only pawns can be targeted by the comp, but this can be used to narrow down the types of pawns that can be targeted
  • successChance : A special item that dictates the chance of success. If you don't add this to the comp, then it will always work

This example makes the killer lose blood when they kill the pawn, either 30% if they have no blood loss or 10% if they already have some blood loss:

    <HediffDef>
        <defName>BloodForTheBloodGod</defName>
        <label>blood for the blood god</label>
        <description>On death, try to take blood from the killer</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <stages />
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_GiveHediffToKiller">
                <hediff>BloodLoss</hediff>
                <initialSeverity>0.3</initialSeverity>
                <addedSeverity>0.1</addedSeverity>
                <targetParams>
                    <canTargetMechs>False</canTargetMechs>
                </targetParams>
            </li>
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️