Invisible at Stage - KonradHeinser/EBSGFramework GitHub Wiki

This hediff comp allows you to force hediffs to become invisible again for certain stages. The vanilla hediff behaviour is that once a hediff becomes visible, it cannot become invisible again unless a hediff comp like this overrides it:

        <comps>
            <li Class="EBSGFramework.HediffCompProperties_InvisibleAtStage">
                <invisibleStages>
                    <li>1</li>
                </invisibleStages>
            </li>
        </comps>

invisibleStages lists the stage number that becomes invisible. This list is 1 based, meaning the first hediff stage is 1, the second is 2, etc.


This example just makes a hediff that keeps increasing in severity, and for a brief window it becomes invisible:

    <HediffDef>
        <defName>TurnInvisibleAtStage</defName>
        <label>turn invisible</label>
        <description>When the stage is reached.</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <stages>
            <li>
                <label>visible</label>
            </li>
            <li>
                <minSeverity>0.5</minSeverity>
                <label>invisible</label>
            </li>
            <li>
                <minSeverity>1</minSeverity>
                <label>visible again</label>
            </li>
        </stages>
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <comps>
            <li Class="HediffCompProperties_SeverityPerDay">
                <severityPerDay>2</severityPerDay>
            </li>
            <li Class="EBSGFramework.HediffCompProperties_InvisibleAtStage">
                <invisibleStages>
                    <li>2</li>
                </invisibleStages>
            </li>
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️