Severity by Colony Genes - KonradHeinser/EBSGFramework GitHub Wiki

This hediff comp sets the severity of the hediff based on the genes of other pawns within their faction that are on the same map, or in the same caravan. If, for whatever reason, the pawn isn't on a map or in a caravan, then the hediff will only check the individual with the hediff. This comp will add 1 to the severity for every match it finds (i.e. 1 viable pawn means a severity of 1, 3 means severity 3). The comp itself looks like this:

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

The comp has the following options related to it:

  • gene : The gene pawns are checked for
  • genes : A list of geneDefs the pawns are checked for
  • mustHaveAllGenes : Default (False) : If you are using genes and this is true, then pawns must have all of the genes on that list to be counted into the total
  • removeWhenNoGenes : Default (False) : If true, it sets the severity to 0 when no matches are found. When false, it sets the severity to 0.1 when no matches are found

This example just checks the map/caravan for pawns with the Bloodfeeder gene. Because there is no stage with a minseverity at or below 0.1, the hediff doesn't have a special display or effect when there aren't any bloodfeeders found:

    <HediffDef ParentName="EBSG_TestHediffBase">
        <defName>BloodfeederCount</defName>
        <label>bloodfeeder count</label>
        <stages>
            <li>
                <minSeverity>1</minSeverity>
                <label>lonely bloodfeeder</label>
            </li>
            <li>
                <minSeverity>2</minSeverity>
                <label>bloodfeeder duo</label>
            </li>
            <li>
                <minSeverity>3</minSeverity>
                <label>bloodfeeder trio</label>
            </li>
            <li>
                <minSeverity>4</minSeverity>
                <label>too many bloodfeeders</label>
            </li>
        </stages>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_SeverityByColonyGenes">
                <gene>Bloodfeeder</gene>
            </li>
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️