Hediff on Kill - KonradHeinser/EBSGFramework GitHub Wiki

This hediff comp allows you to create other or change hediffs whenever the pawn kills something else. This can be used to cause the pawn to gain various effects the more they kill, with the other hediff only disappearing if one of its comps does so. All versions of this comp must have something similar to below to function:

        <comps>
            <li Class="EBSGFramework.HediffCompProperties_HediffOnKill">
                <hediff>InsertHediffDefNameHere</hediff>
            </li>
        </comps>

These are the additional options available for this comp:

  • severityForFirstKill : Default (1) : If the pawn doesn't already have the hediff, then this is the initial severity used for the hediff. If set to 0, then the hediff is never added, and if another source provides the hediff, then this may not be used

  • severityPerExtraKill : Default (1) : Severity added to the hediff if the pawn already has it from any source

  • allowHumanoids : Default (True) : Killing humanoids triggers this hediff

  • allowMechanoids : Default (True) : Killing mechanoids triggers this hediff

  • allowDryads : Default (True) : Killing dryads triggers this hediff. This is separate from animals

  • allowInsects : Default (True) : Killing insects triggers this hediff. This is separate from animals

  • allowAnimals : Default (True) : Killing animals triggers this hediff

  • allowEntities : Default (True) : Killing entities triggers this hediff

  • onlyMaleVictims : Default (False) : Only triggers the effects if the killed target is male. Things with no gender will be automatically excluded

  • onlyFemaleVictims : Default (False) : Only triggers the effects if the killed target is female. Things with no gender will be automatically excluded


Example of a generic hediff that creates and increments another hediff called HumanKiller when a human is killed:

    <HediffDef ParentName="EBSG_TestHediffBase">
        <defName>HediffOnKill</defName>
        <label>hediff on kill</label>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_HediffOnKill">
                <hediff>HumanKiller</hediff>
                <allowMechanoids>False</allowMechanoids>
                <allowAnimals>False</allowAnimals>
                <allowDryads>False</allowDryads>
                <allowInsects>False</allowInsects>
            </li>
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️