Severity Per Day by Genes - KonradHeinser/EBSGFramework GitHub Wiki

This hediff comp increases the severity of the hediff based on the genes of the pawn. The effects individual genes have can be changed, and the effects can be multiplied by stats as desired. First, you're going to want a hediff comp similar to below, with additional li's for every gene you want to add to the list:

        <comps>
            <li Class="EBSGFramework.HediffCompProperties_SeverityPerDayByGenes">
                <geneEffects>
                    <li>
                    </li>
                </geneEffects>
            </li>
        </comps>

These are all the tags that can be attached to the comp. The first ones are put in the comp itself, while ones after geneEffects in the list are put in each individual li:

  • baseSeverity : Default (1) : Severity used before anything else is done. If set to 0, then the hediff will not change its severity for any pawn that does not have any of the genes
  • baseSeverityStatFactor : Stat that multiplies the base severity
  • geneEffectStatFactor : Stat that multiplies all of the gene effects. Acts as a second multiplier if geneEffect has a statFactor
  • globalStatFactor : Stat that multiplies the final total
  • geneEffects : The list of all the gene effect combinations. The gene lists can stack with each other
    • gene : Gene that is checked for to be valid
    • anyOfGene : A list of genes that are check for to be valid. Pawn must have any one of the genes
    • allOfGene : A list of genes that are check for to be valid. Pawn must have all of the genes
    • effect : Amount that is added to the base if the gene requirements are met
    • statFactor : Multiplier of the effect. Stacks with geneEffectStatFactor if applicable

This hediff has its severity increased by 0.5 every day over the span of said day if the pawn is not hemogenic, and if they are the hediff is increased by the pawn's InjuryHealingFactor + 0.5 because the effect of the hemogenic gene was never changed from its default value of 1:

    <HediffDef ParentName="EBSG_TestHediffBase">
        <defName>HemogenAcceleration</defName>
        <label>hemogenic acceleration</label>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_SeverityPerDayByGenes">
                <baseSeverity>0.5</baseSeverity>
                <geneEffects>
                    <li>
                        <gene>Hemogenic</gene>
                        <statFactor>InjuryHealingFactor</statFactor>
                    </li>
                </geneEffects>
            </li>
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️