Abilities From Other Genes - KonradHeinser/EBSGFramework GitHub Wiki

This addition to the EBSG extension allows you to create genes that grant abilities based on the genes that the pawn does or does not have. This requires the gene be using any gene class within this framework. It's recommended to use the Hediff Adder one if the gene won't be using any others because that's the most advanced one that can be used without any side effects or errors:

        <geneClass>EBSGFramework.HediffAdder</geneClass>
        <modExtensions>
            <li Class="EBSGFramework.EBSGExtension">
                <geneAbilities>
                    <li>
                    </li>
                </geneAbilities>
            </li>
        </modExtensions>

In the above extension, you'll find the tag geneAbilities, which is a list of all the various conditions that can provide certain abilities. All you need to add a new set is create more li's. The code will give abilities for every condition the pawn meets, and if there are multiple sets that give the same ability, the ability will only be added once. These are the choices you have for each list item:

  • abilities : List of ability defNames to be added if the conditions are met
  • forbiddenGenes : The pawn cannot have any of these genes
  • requireOneOfGenes : The pawn must have at least on of these genes
  • requiredGenes : The pawn must have all of these genes

All three of the conditions work together, so, for example, you can make an ability that is only given if the pawn has both gene A and B, either C or D, but doesn't have Z:

        <modExtensions>
            <li Class="EBSGFramework.EBSGExtension">
                <geneAbilities>
                    <li>
                        <forbiddenGenes>
                            <li>GeneZ</li>
                        </forbiddenGenes>
                        <requiredGenes>
                            <li>GeneA</li>
                            <li>GeneB</li>
                        </requiredGenes>
                        <requireOneOfGenes>
                            <li>GeneC</li>
                            <li>GeneD</li>
                        </requireOneOfGenes>
                        <abilities>
                            <li>Ability</li>
                        </abilities>
                    </li>
                </geneAbilities>
            </li>
        </modExtensions>

This example gives one of the spew/spray abilities based on whether the pawn is hemogenic. If they are, then it gives foam spray, and if not it gives fire spew:

    <GeneDef>
        <defName>EBSG_HemoSpewing</defName>
        <label>hemo spewing</label>
        <description>.</description>
        <iconPath>UI/Icons/Genes/Gene_HairColor</iconPath>
        <displayCategory>Miscellaneous</displayCategory>
        <geneClass>EBSGFramework.HediffAdder</geneClass>
        <modExtensions>
            <li Class="EBSGFramework.EBSGExtension">
                <geneAbilities>
                    <li>
                        <forbiddenGenes>
                            <li>Hemogenic</li>
                        </forbiddenGenes>
                        <abilities>
                            <li>FireSpew</li>
                        </abilities>
                    </li>
                    <li>
                        <requiredGenes>
                            <li>Hemogenic</li>
                        </requiredGenes>
                        <abilities>
                            <li>FoamSpray</li>
                        </abilities>
                    </li>
                </geneAbilities>
            </li>
        </modExtensions>
    </GeneDef>
⚠️ **GitHub.com Fallback** ⚠️