Deal Damage - KonradHeinser/EBSGFramework GitHub Wiki

This simplistic ability comp deals damage to the target. There's no explosion, projectile, tool, etc, so the options are limited:

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

These are the options available:

  • def : The DamageDef to use
  • amount : Default (-1) : The amount of damage to deal. If left at -1, it will use the DamageDef's default
  • armorPenetration : Default (-1) : The armor penetration to give the damage. If left at -1, it will use the DamageDef's default
  • bodyParts : A list of BodyPartDefs to target with the ability. If this is not filled in, the damage worker will usually try to get one for you
  • chance : Default (1) : The base chance of the ability working on the target
  • statEffects : A special item that causes chance to change based on the stats specified, if any
    • parentFactor : The StatDef of the caster that the amount is multiplied by
    • parentFactorReq : Default (Always) : Requirement for when the stat can actually take effect. The options are Always (no requirement), Higher (value must be above the stat's default value), and Lower (value must be below the stat's default value)
    • parentDivisor : The StatDef of the caster that the amount is divided by
    • parentDivisorReq : Default (Higher) : Requirement for when the stat can actually take effect. The options are Always (no requirement), Higher (value must be above the stat's default value), and Lower (value must be below the stat's default value)
    • otherFactor : The StatDef of the target that the amount is multiplied by
    • otherFactorReq : Default (Always) : Requirement for when the stat can actually take effect. The options are Always (no requirement), Higher (value must be above the stat's default value), and Lower (value must be below the stat's default value)
    • otherDivisor : The StatDef of the target that the amount is divided by
    • otherDivisorReq : Default (Higher) : Requirement for when the stat can actually take effect. The options are Always (no requirement), Higher (value must be above the stat's default value), and Lower (value must be below the stat's default value)

This example makes the pawn run up to the target and deal 50 bomb damage (the default):

    <AbilityDef ParentName="AbilityTouchBase">
        <defName>ExplosivePunch</defName>
        <label>explosive punch</label>
        <description>.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
        <cooldownTicksRange>60</cooldownTicksRange>
        <displayGizmoWhileUndrafted>False</displayGizmoWhileUndrafted>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbilityTouch</verbClass>
            <range>-1</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
            <targetParams>
                <canTargetSelf>false</canTargetSelf>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityDealDamage">
                <def>Bomb</def>
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️