Stop Mental Break (No Psychic) - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp allows you to make abilities that can end mental breaks without needing psycast stuff. The basic comp should look like this:

        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityStopMentalNoPsychic">
                <exceptions><li>Jailbreaker</li></exceptions>
            </li>
        </comps>

Options:

  • exceptions : List of MentalStatDefs that are not covered by the ability. It's recommended to always have Jailbreaker on this list if you are not limiting what mental breaks are covered
  • limitedTo : Opposite of exceptions, this requires that the pawn has one of these mental states for the ability to work. Catatonic is checked before this list, so if canFixCatatonic is False, then the ability will ignore this list
  • canFixCatatonic : Default (True) : If the pawn has the CatatonicBreakdown HediffDef, this determines whether the ability can be used on them
  • mustHaveMentalState : Default (True) : While True, the pawn must have a curable mental state or the catatonic hediff (and canFixCatatonic) for the ability to be used on them
  • minorChance : Default (1) : The success chance to fix minor breaks
  • majorChance : Default (0.5) : The success chance to fix major breaks
  • extremeChance : Default (0.25) : The success chance to fix extreme breaks or catatonic. If the target is catatonic, then this is always the one used

This example from Expanded Biotech Style Abilities would "shoot" a needle that would end almost any mental break with a 100% success rate. mustHaveMentalState was set to False for it because it had other benefits that it would provide, which were cut for this example:

    <AbilityDef>
        <defName>EBSA_PacifyingNeedle</defName>
        <label>pacifying needle</label>
        <description>.</description>
        <casterMustBeCapableOfViolence>False</casterMustBeCapableOfViolence>
        <iconPath>EBSA/Gene_FireSpray</iconPath>
        <aiCanUse>False</aiCanUse>
        <hostile>False</hostile>
        <charges>6</charges>
        <cooldownPerCharge>True</cooldownPerCharge>
        <cooldownTicksRange>120000</cooldownTicksRange>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <warmupTime>1</warmupTime>
            <range>19.9</range>
            <targetParams>
                <canTargetSelf>False</canTargetSelf>
                <canTargetMechs>False</canTargetMechs>
            </targetParams>
        </verbProperties>
        <statBases>
            <Ability_Duration>1000</Ability_Duration>
        </statBases>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityStopMentalNoPsychic">
                <exceptions><li>Jailbreaker</li></exceptions>
                <mustHaveMentalState>False</mustHaveMentalState>
                <majorChance>1</majorChance>
                <extremeChance>1</extremeChance>
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️