Alter Genes - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp will alter the target's genes by adding and/or removing genes directly. The basic comp looks like this:

        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityAlterGenes">
            </li>
        </comps>

These are the options available in 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
  • 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
  • showMessage : Default (False) : If the pawn is in the player's faction, this makes causes a message to be sent on successful alteration
  • 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 a wasted cast (i.e. a pawn with super fast wound healing will have a 70% chance of having nothing happen):

    <AbilityDef>
        <defName>DeathDefier</defName>
        <label>death defier</label>
        <description>Change the target's genes to make them more resistant to death.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>30</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityAlterGenes">
                <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>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️