Hediffs at Age - KonradHeinser/EBSGFramework GitHub Wiki

This gene class applies hediffs to the pawn based on their age. While it can give implants and can apply hediffs to parts, it is recommended to only use hediffs that don't come from any other source as the gene will remove the hediff even if said hediff actually came from a different source.

All gene classes in this framework can use this by default, though it's recommended to use the hediff adder if you aren't using any other as that is the most advanced gene class that can be used without any errors related to missing tags:

        <geneClass>EBSGFramework.HediffAdder</geneClass>

        <modExtensions>
	    <li Class="EBSGFramework.EBSGExtension">
                <hediffsToApplyAtAges>
                    <li>
                        <hediff>InsertHediffDefNameHere</hediff>
                    </li>
                </hediffsToApplyAtAges>
	    </li>
	</modExtensions>

Each hediff you want added will require an additional li. These are the tags available within it:

  • hediff : The hediff to apply
  • bodyParts : A list of body parts to apply the hediff to. If not added, then the hediff is applied to the whole body
  • onlyIfNew : Default (False) : If true, then it will replace an existing hediff when applicable, and if false it'll increase the severity if there is already a hediff there
  • severity : Default (0.5) : The severity to use/add
  • validAges : Default (0~9999) : The age range the pawn needs to be in for the hediff to apply

This example gene just displays a hediff based on whether the pawn is under or over 20 years old

    <GeneDef>
        <defName>YounglingOrNot</defName>
        <label>youngling or not</label>
        <description>.</description>
        <iconPath>UI/Icons/Genes/Gene_HairColor</iconPath> <!--Using a generic icon that's I know will be there-->
        <displayCategory>Miscellaneous</displayCategory>
        <geneClass>EBSGFramework.HediffAdder</geneClass>
        <modExtensions>
            <li Class="EBSGFramework.EBSGExtension">
                <hediffsToApplyAtAges>
                    <li>
                        <maxAge>20</maxAge>
                        <hediff>Youngling</hediff>
                        <severity>1</severity>
                    </li>
                    <li>
                        <minAge>20</minAge>
                        <hediff>LessYoungling</hediff>
                        <severity>1</severity>
                    </li>
                </hediffsToApplyAtAges>
            </li>
        </modExtensions>
    </GeneDef>

    <HediffDef>
        <defName>Youngling</defName>
        <label>youngling</label>
        <description>.</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <stages />
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
    </HediffDef>

    <HediffDef>
        <defName>LessYoungling</defName>
        <label>less youngling</label>
        <description>.</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <stages />
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️