Severity by Season - KonradHeinser/EBSGFramework GitHub Wiki

This hediff comp sets the hediff's severity based on the season and optionally the day of the quadrum as well:

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

These are the options available:

  • defaultSeverity : Default (0.5) : The severity to apply if the current season isn't listed in seasonEffects or the game fails to figure out what season to use
  • seasonEffects : A special list of items that determines what severity to apply during specific seasons
    • seasons : A list of seasons that cause the severity to be used. The options are Spring, Summer, Fall, Winter, PermanentSummer, and PermanentWinter
      • It is important to note that if the current season is permanent summer, then both Summer and PermanentSummer will activate it. However, if you include PermanentSummer but not Summer, then only permanent summers will cause the severity to be used, with normal summers using a different list item or defaultSeverity
    • severity : Default (1) : The severity to set the hediff to
    • dayToSeverity : A curve that sets the severity of the hediff based on the day of the quadrum, with the points using the left number for day and the right number for severity. The day does not include progress through the day, so if you use 7.5 to indicate halfway through the quadrum, the severity listed with it will get close to, but never reach, that value

This example gives the pawn a large melee damage boost during the summer, permanent or seasonal, and a move speed penalty if they are in a location with permanent winter, with no effects during normal winters:

    <HediffDef>
        <defName>EBSG_SummerWrath</defName>
        <label>summer's wrath</label>
        <description>Punch things harder because sweating makes you angry.</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <stages>
            <li />
            <li>
                <minSeverity>1</minSeverity>
                <statFactors>
                    <MeleeDamageFactor>2</MeleeDamageFactor>
                </statFactors>
            </li>
            <li>
                <minSeverity>2</minSeverity>
                <label>lethargy</label>
                <statFactors>
                    <MoveSpeed>0.75</MoveSpeed>
                </statFactors>
            </li>
        </stages>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_SeverityBySeason">
                <seasonEffects>
                    <li>
                        <seasons>
                            <li>Summer</li>
                        </seasons>
                    </li>
                    <li>
                        <seasons><li>PermanentWinter</li></seasons>
                        <severity>2</severity>
                    </li>
                </seasonEffects>
            </li>
        </comps>
    </HediffDef>

This example does a similar thing to the comp above, but implements the curve to cause days 7 and 8 to have the highest bonuses and days 1 and 15 to have the lowest bonuses:

    <HediffDef>
        <defName>EBSG_SummerWrath</defName>
        <label>summer's wrath</label>
        <description>Punch things harder because sweating makes you angry.</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <stages>
            <li />
            <li>
                <minSeverity>1</minSeverity>
                <statFactors>
                    <MeleeDamageFactor>2</MeleeDamageFactor>
                </statFactors>
                <multiplyStatChangesBySeverity>True</multiplyStatChangesBySeverity>
            </li>
            <li>
                <minSeverity>2</minSeverity>
                <label>lethargy</label>
                <statFactors>
                    <MoveSpeed>0.75</MoveSpeed>
                </statFactors>
            </li>
        </stages>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_SeverityBySeason">
                <defaultSeverity>0.5</defaultSeverity>
                <seasonEffects>
                    <li>
                        <seasons>
                            <li>Summer</li>
                        </seasons>
                        <dayToSeverity>
                            <points>
                                <li>(1, 1)</li>
                                <li>(7.5, 2)</li>
                                <li>(15, 1)</li>
                            </points>
                        </dayToSeverity>
                    </li>
                    <li>
                        <seasons><li>PermanentWinter</li></seasons>
                        <severity>2</severity>
                    </li>
                </seasonEffects>
            </li>
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️