Destroy Corpse - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp destroys a corpse and has some options for making the destruction fancier and/or more useful for the player:

        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityDestroyCorpse">
            </li>
        </comps>

These are the options available in the comp:

  • explosionSound : Sound played on destruction. Named as such because I assume it's going to be an explosion of some sort

  • makeFilth : Default (True) : When set to false, no blood or other filth will be made

  • bloodFilthToSpawnRange : Default (0~0) : The amount of blood produced from the destruction. Picks a random number in the range, or just the number itself if not using a range. The blood produced is based off of the race blood def when possible

  • multiplyBloodByBodySize : Default (True) : Multiplies the bloodFilthToSpawnRange by the body size so larger pawns create more blood

  • multiplyBloodByRemainingBlood : Default (False) : Multiplies the bloodFilthToSpawnRange by the remaining blood (i.e. blood loss of 11% multiplies the result by 0.89)

  • filthReplacement : A ThingDef to replace the blood with

  • thingToMake : A ThingDef to make at the location

  • bodySizeFactor : Default (1) : A multiplier on body size that determines the stack count of the thingToMake. For example, if this is set to 10, then a pawn with a body size of 1 will create 10 of the ThingDef, while a body size of 4 will create 40

  • count : A static amount of the thingToMake to create. If the thing isn't something that comes in stacks, this should be set to 1. If a specific number should always be made, this should be set to that number. This overrides bodySizeFactor

  • stuff : A ThingDef to use as stuffing for the thingToMake. If this is left empty and a stuffing is expected, it will first try to use the target's leatherDef if the thingToMake can be leathery, otherwise it will try to use the defaultStuff

These options give stuff to the caster:

  • hemogenGain : Default (0) : Due to how hemogen is coded, these values should be 1% what you desire. For example, if you want to gain 10 hemogen, put 0.1

  • mustBeHemogenic : Default (False) : Requires the pawn be hemogenic to cast the ability. If this is left as False then hemogenGain will be ignored even if it's not 0

  • useHemogenGainFactor : Default (True) : Makes the hemogenGain get multiplied by the gain factor stat

  • multiplyHemogenByBodySize : Default (True) : Multiplies the hemogenGain by the body size so larger pawns create more blood

  • multiplyHemogenByRemainingBlood : Default (True) : Multiplies the hemogenGain by the remaining blood in the corpse (i.e. blood loss of 11% multiplies the result by 0.89)

  • nutritionGain : Default (0) : Offsets nutrition by this amount. If made negative, will probably lower nutrition

  • multiplyNutritionByBodySize : Default (True) : Multiplies the nutritionGain by the body size so larger pawns create more food

  • multiplyNutritionByRemainingBlood : Default (False) : Multiplies the nutritionGain by the remaining blood in the corpse (i.e. blood loss of 11% multiplies the result by 0.89)

  • resourceMainGene : The Dynamic Resource Gene to increase the levels of. If gain is 0, this ignored, and if this is empty despite gain not being 0 you'll confuse everyone

  • resourceGain : Default (0) : Due to how resource genes are coded, these values should be 1% what you desire. For example, if you want to gain 10, put 0.1

  • mustHaveResourceGene : Default (False) : Requires the pawn have the resourceMainGene to cast the ability. If this is left as False then resourceGain will be ignored even if it's not 0

  • useResourceGainFactor : Default (True) : Makes the resourceGain get multiplied by the gain factor stat

  • multiplyResourceByBodySize : Default (True) : Multiplies the resourceGain by the body size so larger pawns create more of the resource

  • multiplyResourceByRemainingBlood : Default (False) : Multiplies the resourceGain by the remaining blood in the corpse (i.e. blood loss of 11% multiplies the result by 0.89)


This example "consumes" the corpse, granting nutrition to the caster. If they are hemogenic, it will also grant 30 * Body Size hemogen regardless of the amount of blood loss the target suffered before death:

    <AbilityDef>
        <defName>OmNomNom</defName>
        <label>om nom nom</label>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <category>Psychic</category>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>30</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
            <soundCast>PiercingSpine_Launch</soundCast>
            <targetParams>
                <canTargetSelf>false</canTargetSelf>
                <canTargetMechs>false</canTargetMechs>
                <canTargetBuildings>false</canTargetBuildings>
                <canTargetCorpses>true</canTargetCorpses>
                <onlyTargetCorpses>true</onlyTargetCorpses>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityDestroyCorpse">
                <bloodFilthToSpawnRange>20</bloodFilthToSpawnRange>
                <hemogenGain>0.3</hemogenGain>
                <multiplyHemogenByRemainingBlood>False</multiplyHemogenByRemainingBlood>
                <nutritionGain>0.3</nutritionGain>
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️