Alter Genes on Ingest - KonradHeinser/EBSGFramework GitHub Wiki

This ingestion outcome doer allows you to make ingestibles that alter a pawn's genes similar to the Alter Genes Ability. If you are familiar with that comp, all the same options apply:

            <outcomeDoers>
                <li Class="EBSGFramework.IngestionOutcomeDoer_AlterGenes">
                </li>
            </outcomeDoers>

These are the options available in the outcome doer:

  • 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 (True) : 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 makes the pawn hemogenic, and gives 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 partially, and sometimes completely, wasted ingest (i.e. a pawn with super fast wound healing will have a 70% chance of having nothing happen, assuming they already have the hemogenic gene):

    <ThingDef>
        <defName>HyperHemogenPack</defName>
        <label>hyper-hemogen pack</label>
        <description>A special pack of hemogen that tries to permanently change the ingester.</description>
        <category>Item</category>
        <thingClass>ThingWithComps</thingClass>
        <drawerType>MapMeshOnly</drawerType>
        <useHitPoints>true</useHitPoints>
        <healthAffectsPrice>false</healthAffectsPrice>
        <selectable>true</selectable>
        <stackLimit>10</stackLimit>
        <tickerType>Rare</tickerType>
        <possessionCount>5</possessionCount>
        <socialPropernessMatters>true</socialPropernessMatters>
        <alwaysHaulable>true</alwaysHaulable>
        <pathCost>14</pathCost>
        <allowedArchonexusCount>-1</allowedArchonexusCount>
        <resourceReadoutPriority>Last</resourceReadoutPriority>
        <drawGUIOverlay>true</drawGUIOverlay>
        <graphicData>
            <texPath>Things/Item/Resource/HemogenPack</texPath>
            <graphicClass>Graphic_StackCount</graphicClass>
            <drawSize>0.85</drawSize>
        </graphicData>
        <statBases>
            <MaxHitPoints>60</MaxHitPoints>
            <DeteriorationRate>5</DeteriorationRate>
            <Mass>0.50</Mass>
            <Flammability>0.7</Flammability>
            <Nutrition>0.1</Nutrition>
            <Beauty>0</Beauty>
            <MarketValue>5</MarketValue>
        </statBases>
        <thingCategories>
            <li>Foods</li>
        </thingCategories>
        <ingestible>
            <foodType>Fluid</foodType>
            <preferability>DesperateOnly</preferability>
            <canAutoSelectAsFoodForCaravan>false</canAutoSelectAsFoodForCaravan>
            <ingestSound>HemogenPack_Consume</ingestSound>
            <outcomeDoers>
                <li Class="EBSGFramework.IngestionOutcomeDoer_AlterGenes">
                    <alwaysAddedGenes>
                        <li>Hemogenic</li>
                    </alwaysAddedGenes>
                    <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>
            </outcomeDoers>
        </ingestible>
        <comps>
            <li Class="CompProperties_Forbiddable"/>
        </comps>
    </ThingDef>
⚠️ **GitHub.com Fallback** ⚠️