Resource Using Abilities - KonradHeinser/EBSGFramework GitHub Wiki

These act the same as hemogen cost abilities, they just use a different class and need to be told the main gene's defName.

        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityResourceCost">
                <resourceCost>0.10</resourceCost> <!--Consumes 10 resource-->
                <mainResourceGene>InsertResourceDefNameHere</mainResourceGene>
                <costFactorStat>InsertStatDefNameHere</costFactorStat>
                <checkMaximum>True</checkMaximum> <!--Default (True) Checks the resource maximum to see if the ability can be used. If set to false, then the user will still be able to use abilities that pass the limit, and that excess will be stored to offset future resource losses-->
            </li>
        </comps>

If you want to convert your resource into a non-DRG resource, you'll need to use as system like this:

        <comps>
            <li Class="CompProperties_AbilityHemogenCost">
                <hemogenCost>-0.05</hemogenCost> <!--Gains 5 Hemogen-->
            </li>
            <li Class="EBSGFramework.CompProperties_AbilityResourceCost">
                <resourceCost>0.10</resourceCost> <!--Consumes 10 resource-->
                <mainResourceGene>InsertResourceDefNameHere</mainResourceGene>
            </li>
        </comps>

Extra example of the Radiation resource in Superhero Genes gaining a resource burner and generator:

    <AbilityDef>
        <defName>RadiationBurner</defName>
        <label>radiation burner</label>
        <description>This just burns some radiation to provide an example.</description>
        <iconPath>UI/Abilities/Longjump</iconPath>
        <category>Sanguophage</category>
        <targetRequired>False</targetRequired>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>3.9</range>
            <warmupTime>0.5</warmupTime>
            <soundCast>PiercingSpine_Launch</soundCast>
            <requireLineOfSight>False</requireLineOfSight>
            <targetParams>
                <canTargetSelf>True</canTargetSelf>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityResourceCost">
                <resourceCost>0.10</resourceCost>
                <mainResourceGene>SHG_Archetypes_Radiomancer</mainResourceGene>
            </li>
        </comps>
    </AbilityDef>

    <AbilityDef>
        <defName>RadiationGenerator</defName>
        <label>radiation generator</label>
        <description>This just gives some radiation to provide an example.</description>
        <iconPath>UI/Abilities/Longjump</iconPath>
        <category>Sanguophage</category>
        <targetRequired>False</targetRequired>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>3.9</range>
            <warmupTime>0.5</warmupTime>
            <soundCast>PiercingSpine_Launch</soundCast>
            <requireLineOfSight>False</requireLineOfSight>
            <targetParams>
                <canTargetSelf>True</canTargetSelf>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityResourceCost">
                <resourceCost>-0.10</resourceCost>
                <mainResourceGene>SHG_Archetypes_Radiomancer</mainResourceGene>
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️