Gene Randomizer - KonradHeinser/EBSGFramework GitHub Wiki
This hediff comp allows you to create hediffs that alter a pawn's genes, usually randomly:
<comps>
<li Class="EBSGFramework.HediffCompProperties_GainRandomGeneSet">
</li>
</comps>
These are all the tags that can be added to the comp:
- removeGenesFromOtherLists : Default (true) : While true, when a random set is selected it will remove the genes from all the other sets that are on the pawn. Individual sets can choose to ignore this
- inheritable : Default (true) : Dictates if the genes created are inherited. Individual sets can override this
- delayTicks : Default (10) : If this is just something you want the pawn to use when spawned, the default is good. Otherwise, you can create a delay for activation. The minimum is 10 to avoid some weird issues
- validSeverity : Default (0~99999) : Causes the delay to only tick down when in this range. If a single value is entered, then any severity above that number will tick down the hediff
- alwaysAddedGenes : Regardless of chosen set, genes on this list are always added. This is the first step of the gene changing process
- alwaysRemovedGenes : List of genes to always remove. Removing these genes is the last step
- removeHediffAfterwards : Default (True) : If you can't apply multiple hediffs for some reason and need this hediff to do more, set this to false
- geneSets : Special list of items that determines the random options available
- weightOfGeneSet : Default (1) : Alters how likely it is that this item will be chosen using a weighted average
- reverseInheritence : Default (false) : This set does the reverse of what the inheritable tag says
- alwaysRemoveGenes : Default (false) : If true, the geneSet will be removed even if removeGenesFromOtherLists is false
- geneSet : The list of GeneDefs to apply
This example gives the pawn a gene that will help them avoid dying more easily. If the pawn has one of the genes already, then that gene set creates a chance for nothing to happen (i.e. a pawn with super fast wound healing will have a 70% chance of having nothing happen):
<HediffDef>
<defName>ResistDeathGene</defName>
<label>resist death hediff</label>
<description>.</description>
<everCurableByItem>false</everCurableByItem>
<initialSeverity>0.001</initialSeverity>
<stages />
<hediffClass>HediffWithComps</hediffClass>
<comps>
<li Class="EBSGFramework.HediffCompProperties_GainRandomGeneSet">
<removeGenesFromOtherLists>False</removeGenesFromOtherLists>
<geneSets>
<li>
<weightOfGeneSet>0.1</weightOfGeneSet>
<geneSet>
<li>Deathless</li>
</geneSet>
</li>
<li>
<weightOfGeneSet>0.2</weightOfGeneSet>
<geneSet>
<li>Superclotting</li>
</geneSet>
</li>
<li>
<weightOfGeneSet>0.7</weightOfGeneSet>
<geneSet>
<li>WoundHealing_SuperFast</li>
</geneSet>
</li>
</geneSets>
</li>
</comps>
</HediffDef>