Burst Attacks - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp allows you to create an explosion around the caster with as much customization as possible. Every single option for explosions that could logically be added to a burst ability has been included here as a node. Before getting into the various customization options, the basic burst will include something like this in the AbilityDef:

    <AbilityDef>
        <jobDef>CastAbilityOnThingWithoutWeapon</jobDef>
        <canUseAoeToGetTargets>True</canUseAoeToGetTargets>
        <ai_SearchAOEForTargets>true</ai_SearchAOEForTargets>
        <targetRequired>false</targetRequired>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <targetParams>
                <canTargetSelf>True</canTargetSelf>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_EBSGBurst">
                <explosion>
                </explosion>
            </li>
        </comps>
    </AbilityDef>

This comp can use successChance, which is a special item that dictates the chance of successfully starting the explosion. If you don't add this to the comp, then it will always work. Due to the nature of explosions, successChance can't have a target.

To minimize the risk of me missing a page whenever I update the explosion options, the information on what can go in explosion has its own page


Slightly altered example from SHG - Only the Hemomancer. This ability create a burst around the caster with a radius of 10 that combined this comp with the Blood Drain ability comp to create an "evaporating blood" effect:

    <AbilityDef>
        <defName>SHG_Hemomancer_BloodBoil</defName>
        <label>blood boil</label>
        <description>There was a description here.</description>
        <iconPath>UI/Icons/Genes/Gene_Bloodfeeder</iconPath>
        <jobDef>CastAbilityOnThingWithoutWeapon</jobDef>
        <canUseAoeToGetTargets>True</canUseAoeToGetTargets>
        <targetRequired>false</targetRequired>
        <ai_SearchAOEForTargets>true</ai_SearchAOEForTargets>
        <showCastingProgressBar>true</showCastingProgressBar>
        <aiCanUse>True</aiCanUse>
        <category>Sanguophage</category>
        <cooldownTicksRange>2500</cooldownTicksRange>
        <statBases>
            <Ability_EffectRadius>10</Ability_EffectRadius>
        </statBases>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>10</range>
            <drawAimPie>false</drawAimPie>
            <warmupTime>1</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
            <targetParams>
                <canTargetPawns>True</canTargetPawns>
                <canTargetSelf>True</canTargetSelf>
                <canTargetBuildings>False</canTargetBuildings>
                <canTargetLocations>False</canTargetLocations>
                <canTargetMechs>False</canTargetMechs>
                <canTargetPlants>False</canTargetPlants>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_EBSGBurst">
                <explosion>
                    <radius>10</radius>
                    <damageDef>Burn</damageDef>
                    <explosionSound>Foam_Impact</explosionSound>
                    <postExplosionThing>SHG_BloodMist</postExplosionThing>
                    <postExplosionThingChance>100</postExplosionThingChance>
                    <damageAmount>40</damageAmount>
                </explosion>
            </li>
            <li Class="EBSGFramework.CompProperties_AbilityBloodDrain">
                <hemogenGain>0.1</hemogenGain>
                <bloodFilthToSpawnRange>2</bloodFilthToSpawnRange>
                <resistanceGain>1</resistanceGain>
                <targetBloodLoss>0.3</targetBloodLoss>
            </li>
            <li Class="CompProperties_AbilityHemogenCost">
                <hemogenCost>0.2</hemogenCost>
            </li>
        </comps>
    </AbilityDef>

    <ThingDef>
        <defName>SHG_BloodMist</defName>
        <label>blood mist</label>
	<thingClass>Gas</thingClass>
	<category>Gas</category>
	<altitudeLayer>Gas</altitudeLayer>
	<useHitPoints>false</useHitPoints>
	<tickerType>Normal</tickerType>
	<graphicData>
	    <graphicClass>Graphic_Gas</graphicClass>
	    <shaderType>Transparent</shaderType>
            <texPath>Things/Gas/Puff</texPath>
            <drawSize>2.2</drawSize>
            <color>(0.8,0.2,0.2)</color>
	</graphicData>
        <gas>
            <rotationSpeed>10</rotationSpeed>
            <expireSeconds>
                <min>1</min>
                <max>1</max>
            </expireSeconds>
        </gas>
    </ThingDef>
⚠️ **GitHub.com Fallback** ⚠️