Temporary Genes - KonradHeinser/EBSGFramework GitHub Wiki
This hediff comp gives the pawn specific genes based on the severity of the hediff it's attached to. While this was originally designed to be used with a severity setter, but any method for adding hediffs and changing their severity should make this work without issue:
<comps>
<li Class="EBSGFramework.HediffCompProperties_TemporaryGenes">
<genesAtSeverities>
<li>
</li>
</genesAtSeverities>
</li>
</comps>
Each li in genesAtSeverities has the following options
- genes : The list of GeneDefs to add
- 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
- xenogenes : Default (True) : Determines if the temporary genes should be xenogenes or not
It is important to note that only the first match will be used, so if you have a set that goes from severity 0 to 2, and another that goes from 1 to 3, only the first one is used until the hediff's severity passes it's maximum, which is 2 in this case. This means that if you have genes that are supposed to be applied in multiple severity ranges, they need to be listed in each one individually.
Example of a hediff that uses Severity by Mental State to give the pawn certain genes depending on if they are in a violent mental state, drafted, or undrafted:
<HediffDef>
<defName>Rampager</defName>
<label>rampager</label>
<description>RAAAMMMPPPPPAAAAAAGGGGGEEEEEE!</description>
<everCurableByItem>false</everCurableByItem>
<initialSeverity>0.001</initialSeverity>
<stages />
<hediffClass>HediffWithComps</hediffClass>
<scenarioCanAdd>false</scenarioCanAdd>
<comps>
<li Class="EBSGFramework.HediffCompProperties_SeverityByMentalState">
<mentalStateEffects>
<li>
<mentalStates>
<li>Berserk</li>
<li>Slaughterer</li>
<li>MurderousRage</li>
<li>Tantrum</li>
<li>TargetedTantrum</li>
<li>BedroomTantrum</li>
<li>SadisticRage</li>
<li>SocialFighting</li>
</mentalStates>
</li>
<li MayRequire="Ludeon.Rimworld.Ideology">
<mentalState>BerserkTrance</mentalState>
</li>
<li MayRequire="Ludeon.Rimworld.Ideology">
<mentalState>Rebellion</mentalState>
</li>
</mentalStateEffects>
</li>
<li Class="EBSGFramework.HediffCompProperties_TemporaryGenes">
<genesAtSeverities>
<li>
<genes>
<li>AptitudeRemarkable_Intellectual</li>
<li>AptitudeRemarkable_Social</li>
<li>AptitudeTerrible_Melee</li>
<li>AptitudeTerrible_Shooting</li>
<li>MeleeDamage_Weak</li>
</genes>
<validSeverity>0~1</validSeverity>
</li>
<li>
<genes>
<li>AptitudeTerrible_Intellectual</li>
<li>AptitudeTerrible_Social</li>
<li>AptitudeRemarkable_Melee</li>
<li>AptitudeRemarkable_Shooting</li>
<li>Skin_Green</li>
<li>Beauty_VeryUgly</li>
</genes>
<validSeverity>1~2</validSeverity>
</li>
<li>
<genes>
<li>AptitudeTerrible_Intellectual</li>
<li>AptitudeTerrible_Social</li>
<li>AptitudeRemarkable_Melee</li>
<li>MeleeDamage_Strong</li>
<li>Skin_Green</li>
<li>Beauty_VeryUgly</li>
</genes>
<validSeverity>2</validSeverity>
</li>
</genesAtSeverities>
</li>
</comps>
</HediffDef>