DRG Battery Recharge - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp gives charges batteries based on the amount resource used, with various ways of limiting how much of the resource will actually be consumed. This only accepts buildings which the ability can recognize are batteries, and can be influenced by things like battery efficiency. The basic comp looks like this:

        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityResourceToBattery">
                <mainResourceGene>InsertResourceDefNameHere</mainResourceGene>
            </li>
        </comps>

These are the nodes available to the comp:

  • maxConverted : Default (1) : Static limit on the amount that can be converted. 1 is equal to 100 of the resource in-game
  • maxPercent : Default (1) : Maximum percentage of the current resource amount that can be used
  • maxPercentOfMax : Default (1) : Maximum percentage of the resource limit. Can result in all stored resource being consumed even when this is below 1
  • conversionEfficiency : Default (1) : How much electricity is made from the conversion. With a 1, 0.1 resource (10 resource in game) lost becomes 10 energy. If set to 100, then that 0.1 would give 1,000 electricity
  • efficiencyFactorStat : Stat that multiplies the electricity created

It is important to note that the lowest of all the calculated limits is used, so you don't need to specify all of them if you set the maxConverted, as an example


Example from SHG - Just the Radiomancer. This ability would consume up to half the amount of resource the pawn currently had into 100 electricity per point. The parent just told the ability it was an ability

    <AbilityDef ParentName="SHG_JtR_PowerAbilitiesBase">
        <defName>SHG_Radiomancer_InstantRecharge</defName>
        <label>instant recharge</label>
        <description>There was a description here.</description>
        <iconPath>Radiomancer/Emission/Gene_Radiomancer_InstantRecharge</iconPath>
        <displayGizmoWhileUndrafted>True</displayGizmoWhileUndrafted>
        <disableGizmoWhileUndrafted>False</disableGizmoWhileUndrafted>
        <verbProperties>
            <range>10</range>
            <targetParams>
                <canTargetPawns>False</canTargetPawns>
                <canTargetSelf>False</canTargetSelf>
                <canTargetBuildings>True</canTargetBuildings>
                <canTargetLocations>False</canTargetLocations>
                <canTargetMechs>False</canTargetMechs>
                <canTargetPlants>False</canTargetPlants>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityResourceToBattery">
                <mainResourceGene>SHG_Archetypes_Radiomancer</mainResourceGene>
                <maxPercent>0.5</maxPercent>
                <conversionEfficiency>100</conversionEfficiency>
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️