Stage Setter - KonradHeinser/EBSGFramework GitHub Wiki

This hediff comp allows you to make hediffs that players can change the stage of with a gizmo drop down menu. The basic comp looks like this:

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

These are the options available within the comp:

  • label : The gizmo's label. If left blank, it will use the hediff's label
  • description : The gizmo's description (seen when hovering over it). If left blank, it will use the hediff's description
  • iconPath : The path for the gizmo's icon
  • usableDuringCooldowns : Default (False) : When false, the gizmo will be disabled if the pawn is in a cooldown stance for any reason
  • sets : A special list of items that specializes how each stage is handled. If left empty, then the stages may be switched between freely. The position on this list corresponds with the stages in the hediff itself. These are the options each li may contain:
    • label : The label for this option in the dropdown. If left blank, it will try to use the stage's overrideLabel, label, or hediff label, in that order
    • iconPath : If the related stage is the current one, then this icon is used instead of the normal one
    • ticks : Default (0) : Makes the pawn enter a cooldown stance (just stands still) for this many ticks after switching
    • prerequisites : A special item that limits whether the pawn can switch to the stage
      • hasAnyOfHediffs : List of HediffDefs that the pawn must have any one of

      • hasAllOfHediffs : List of HediffDefs that the pawn must have all of

      • hasNoneOfHediffs : List of HediffDefs that the pawn must have none of

      • samePartPrerequisites : Default (False) : Causes the hediff checks to only try to look at the same part that the modular hediff is on

      • hasAnyOfGenes : List of GeneDefs that the pawn must have any one of

      • hasAllOfGenes : List of GeneDefs that the pawn must have all of

      • hasNoneOfGenes : List of GeneDefs that the pawn must have none of

      • isAnyOfXenotype : List of XenotypeDefs that the pawn must be one of

      • isNoneOfXenotype : List of XenotypeDefs that the pawn must not be one of


This simplistic example has 6 stages that the player can switch through. Stages 1, 2, 5, and 6 don't have anything special about them, and can be switched to freely. Stage 3 is labeled as potato in the drop down, changes the icon to a potato, and stuns the pawn for 10 seconds. Stage 4 can only be switched to if the pawn is not suffering from any blood loss:

    <HediffDef>
        <defName>StageSetter</defName>
        <label>stage setter</label>
        <description>This is an example.</description>
        <hediffClass>HediffWithComps</hediffClass>
        <stages>
            <li>
                <minSeverity>0.0001</minSeverity>
                <label>Stage 1</label>
            </li>
            <li>
                <minSeverity>1</minSeverity>
                <label>Stage 2</label>
            </li>
            <li>
                <minSeverity>2</minSeverity>
                <label>Stage 3</label>
            </li>
            <li>
                <minSeverity>3</minSeverity>
                <label>Stage 4</label>
            </li>
            <li>
                <minSeverity>4</minSeverity>
                <label>Stage 5</label>
            </li>
            <li>
                <minSeverity>5</minSeverity>
                <label>Stage 6</label>
            </li>
        </stages>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_StageSetter">
                <iconPath>UI/Icons/Genes/Gene_HairColor</iconPath> <!--Using a generic icon that's I know will be there-->
                <sets>
                    <li />
                    <li />
                    <li>
                        <label>Potato</label>
                        <iconPath>Things/Item/Resource/PlantFoodRaw/Potatoes</iconPath>
                        <ticks>600</ticks>
                    </li>
                    <li>
                        <prerequisites>
                            <hasNoneOfHediffs>
                                <li>BloodLoss</li>
                            </hasNoneOfHediffs>
                        </prerequisites>
                    </li>
                </sets>
            </li>
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️