Create Other Hediffs - KonradHeinser/EBSGFramework GitHub Wiki
This comp creates other hediffs when thresholds are passed, and if they exist it will change their severity based on the set's severityPerDay. The first part to set up is the list of hediffSets.
<comps>
<li Class="EBSGFramework.HediffCompProperties_CreateOtherHediffs">
<hediffSets>
<li> <!--Depending on the number of sets, you may need a lot more of these-->
</li>
</hediffSets>
</li>
</comps>
The options you can add to each set are:
- hediffDefs : A list of hediff defs
- hediffDef : A specific hediff def
- bodyPart : A chosen part to target. If null, it will apply to whole body
- initialSeverity : Default (1) : If the hediff doesn't exist already and this is above 0, it is given to the pawn at this severity. Can be given a range to get a random value and create a failure chance if part of the range is zero or lower
- severityPerDay : Default (0) : If the hediff does exist already, change it's value based on this. Can be given a range instead to introduce randomness
- severityCondition : Default (None) : Restricts when severityPerDay is considered valid. The options are Positive and Negative, and in the event that an invalid number is picked (i.e. -0.5 when severityCondition is Positive), the hediff severity will not change. If severityPerDay is a single number instead of a range, there is no reason to set this
- validSeverity : Default (0~99999) : Causes the effect to only activate when in this range. If a single value is entered, then any severity above that number will be considered valid
Example from SHG - Just the Radiomancer. This hediff would increase in severity while the pawn was at maximum resource level (Explanation of the DRG comp here](https://github.com/KonradHeinser/EBSGFramework/wiki/Craving-and-Overcharge-Hediffs), but if they were at maximum resource for too long then another hediff was added to the pawn
<HediffDef>
<defName>SHG_Radiomancer_InfusedMuscles</defName>
<label>infused muscles</label>
<description>There was a description here.</description>
<isBad>False</isBad>
<everCurableByItem>False</everCurableByItem>
<hediffClass>HediffWithComps</hediffClass>
<scenarioCanAdd>False</scenarioCanAdd>
<minSeverity>0.001</minSeverity>
<initialSeverity>0.001</initialSeverity>
<stages>
<li>
<becomeVisible>false</becomeVisible>
</li>
<li>
<minSeverity>0.5</minSeverity>
<statFactors>
<MeleeDamageFactor>1.1</MeleeDamageFactor>
<CarryingCapacity>1.1</CarryingCapacity>
<CarryBulk MayRequire="ceteam.combatextended">1.1</CarryBulk>
</statFactors>
</li>
<li>
<minSeverity>1</minSeverity>
<statFactors>
<MeleeDamageFactor>1.2</MeleeDamageFactor>
<CarryingCapacity>1.2</CarryingCapacity>
<CarryBulk MayRequire="ceteam.combatextended">1.2</CarryBulk>
</statFactors>
</li>
<li>
<minSeverity>1.5</minSeverity>
<statFactors>
<MeleeDamageFactor>1.3</MeleeDamageFactor>
<CarryingCapacity>1.3</CarryingCapacity>
<CarryBulk MayRequire="ceteam.combatextended">1.3</CarryBulk>
</statFactors>
</li>
<li>
<minSeverity>2</minSeverity>
<statFactors>
<MeleeDamageFactor>1.4</MeleeDamageFactor>
<CarryingCapacity>1.4</CarryingCapacity>
<CarryBulk MayRequire="ceteam.combatextended">1.4</CarryBulk>
</statFactors>
</li>
<li>
<minSeverity>2.5</minSeverity>
<statFactors>
<MeleeDamageFactor>1.5</MeleeDamageFactor>
<CarryingCapacity>1.5</CarryingCapacity>
<CarryBulk MayRequire="ceteam.combatextended">1.5</CarryBulk>
</statFactors>
</li>
<li>
<minSeverity>3</minSeverity>
<statFactors>
<MeleeDamageFactor>1.6</MeleeDamageFactor>
<CarryingCapacity>1.6</CarryingCapacity>
<CarryBulk MayRequire="ceteam.combatextended">1.6</CarryBulk>
</statFactors>
</li>
<li>
<minSeverity>3.5</minSeverity>
<statFactors>
<MeleeDamageFactor>1.7</MeleeDamageFactor>
<CarryingCapacity>1.7</CarryingCapacity>
<CarryBulk MayRequire="ceteam.combatextended">1.7</CarryBulk>
</statFactors>
</li>
<li>
<minSeverity>4</minSeverity>
<statFactors>
<MeleeDamageFactor>1.8</MeleeDamageFactor>
<CarryingCapacity>1.8</CarryingCapacity>
<CarryBulk MayRequire="ceteam.combatextended">1.8</CarryBulk>
</statFactors>
</li>
<li>
<minSeverity>4.5</minSeverity>
<statFactors>
<MeleeDamageFactor>1.9</MeleeDamageFactor>
<CarryingCapacity>1.9</CarryingCapacity>
<CarryBulk MayRequire="ceteam.combatextended">1.9</CarryBulk>
</statFactors>
</li>
<li>
<minSeverity>5</minSeverity>
<label>max</label>
<statFactors>
<MeleeDamageFactor>2</MeleeDamageFactor>
<CarryingCapacity>2</CarryingCapacity>
<CarryBulk MayRequire="ceteam.combatextended">2</CarryBulk>
</statFactors>
</li>
</stages>
<comps>
<li Class="EBSGFramework.HediffCompProperties_CreateOtherHediffs">
<hediffSets>
<li>
<hediffDef>SHG_Radiomancer_InfusedMusclesOvercharge</hediffDef>
<validSeverity>5.5</validSeverity>
<severityPerDay>1</severityPerDay>
<initialSeverity>0.1</initialSeverity>
</li>
</hediffSets>
</li>
<li Class="EBSGFramework.HediffCompProperties_SeverityFromResource">
<severityPerHourFull>0.05</severityPerHourFull>
<severityPerHourResource>-0.1</severityPerHourResource>
<mainResourceGene>SHG_Archetypes_Radiomancer</mainResourceGene>
</li>
<li Class="EBSGFramework.HediffCompProperties_DisplaySeverity">
<prependString>Charge : </prependString>
<appendString>%</appendString>
<postFactor>20</postFactor>
<roundDigits>1</roundDigits>
</li>
</comps>
</HediffDef>