Give Abilities at Severities - KonradHeinser/EBSGFramework GitHub Wiki
This is a more advanced version of Rimworld's HediffCompProperties_GiveAbility. Instead of constantly having the active abilities, you can set up a hediff that grants abilities based on the hediff's severity:
Generic example
<comps>
<li Class="EBSGFramework.HediffCompProperties_GiveAbilityAtSeverity">
<abilitiesAtSeverities>
<li>
</li>
</abilitiesAtSeverities>
</li>
</comps>
These are the options available in each li within abilitiesAtSeverities:
- abilityDef : A singular AbilityDef to be given
- abilityDefs : A list of AbilityDefs to be given
- validSeverity : Default (0~99999) : Causes the ability to only be granted if the parent hediff has a severity in this range. If a single value is entered, then any severity above that number will be considered valid
- If you plan on leaving this at the default, it is strongly recommended you use the vanilla HediffCompProperties_GiveAbility instead
Note that the abilities this hediff applies shouldn't be obtainable from other sources as they will likely end up disappearing due to this hediff. This was to avoid some weird situations from popping up.
Adapted example of the Hemoshifter from Superhero Genes. The hediff severity was set by a series of abilities that used Rimworld's CompProperties_AbilityGiveHediff, and never changed beyond what those abilities did.
<comps>
<li Class="EBSGFramework.HediffCompProperties_GiveAbilityAtSeverity">
<abilitiesAtSeverities>
<li>
<abilityDef>SHG_Hemomancer_ShiftNormal</abilityDef>
<maxSeverity>99</maxSeverity> <!--Always active-->
</li>
<li>
<abilityDef>SHG_Hemomancer_ShiftSnakeBolt</abilityDef>
<minSeverity>4.0</minSeverity>
<maxSeverity>4.9</maxSeverity>
<!--If using a hediff that gradually gains/loses severity, the Snake's max should be same as Starfish's min to avoid having a gap-->
</li>
<li>
<abilityDef>SHG_Hemomancer_ShiftStarfishStartSplitting</abilityDef>
<minSeverity>5.0</minSeverity>
<maxSeverity>5.9</maxSeverity>
</li>
<li>
<abilityDef>SHG_Hemomancer_ShiftBearHibernation</abilityDef>
<minSeverity>6.0</minSeverity>
<maxSeverity>6.9</maxSeverity>
</li>
<li>
<abilityDef>SHG_Hemomancer_ShiftChameleonInvisibility</abilityDef>
<minSeverity>7.0</minSeverity>
<maxSeverity>7.9</maxSeverity>
</li>
</abilitiesAtSeverities>
</li>
</comps>