Charge Battery - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp charges or drains a battery based on whether the change is positive or negative. If the ability drains battery, then it won't be usable unless the battery has enough energy to drain (battery efficiency is a factor). The basic comp looks like this:

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

There are only 3 tags available for this comp:

  • batteryChangeAmount : Default (0) : The amount to change the battery by
  • efficiencyFactorStat : Optional stat factor to use on batteryChangeAmount
  • allowOvercharge : Default (True) : If false and the change amount is positive, the ability will be unusable if the added energy would pass the battery maximum

This example ability charges a battery based on how much psychic sensitivity the pawn has

    <AbilityDef>
        <defName>PsychicBatteryRecharge</defName>
        <label>psychic battery recharge</label>
        <description>Descriptive description.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <category>Psychic</category>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <statBases>
            <Ability_EntropyGain>65</Ability_EntropyGain>
            <Ability_PsyfocusCost>0.06</Ability_PsyfocusCost>
        </statBases>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>30</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
            <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_AbilityChargeBattery">
                <batteryChangeAmount>1000</batteryChangeAmount>
                <efficiencyFactorStat>PsychicSensitivity</efficiencyFactorStat>
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️