Remove or Damage Parts - KonradHeinser/EBSGFramework GitHub Wiki

I made this comp after learning the hard way that Rimworld really, really hates it when body parts are removed before the pawn is spawned. My solution for this was making a hediff comp that removes the part after 60 ticks. Important note, due to some weird part in Rimworld's code that I haven't been able to place, certain parts (i.e. eyes) will cause the pawn to start bleeding when removed. This bleeding can safely be stopped forever with any amount of tending regardless of doctor skill and lack of medicine

The basic comp looks like this:

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

Within the comp you have these options:

  • bodyPartsToRemove : A list of BodyPartDefs to completely remove
  • bodyPartsToDamage : A special list of items intended to damage body parts
    • bodyPart : The BodyPartDef that should be damaged
    • damageAmount : A static amount of damage to take from the part. Cannot be used with damagePercentage
    • damagePercentage : A percentage of the part's maximum health to take. Cannot be used with damageAmount

Example of both removing one part and damaging another:

    <HediffDef>
        <defName>EBSG_MissingAndDamagedKidney</defName>
        <label>removing kidney and damaging kidney</label>
        <description>There was a description here.</description>
        <defaultLabelColor>(0.7, 0.7, 0.7)</defaultLabelColor>
	<hediffClass>HediffWithComps</hediffClass>
	<scenarioCanAdd>true</scenarioCanAdd>
	<maxSeverity>1.0</maxSeverity>
	<isBad>false</isBad>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_DamageBodyParts">
                <bodyPartsToRemove>
                    <li>Kidney</li>
                </bodyPartsToRemove>
                <bodyPartsToDamage>
                    <li>
                        <bodyPart>Kidney</bodyPart>
                        <damagePercentage>0.5</damagePercentage>
                    </li>
                </bodyPartsToDamage>
            </li>
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️