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 tag. 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">
            </li>
        </comps>
    </AbilityDef>

These are the options you have for the main functions of the explosion:

  • radius : Default (0) : How wide the explosion should be. Mutually exclusive with statRadius

  • statRadius : The StatDef to use to determine the explosion size

  • damageDef : The DamageDef to use. This is required

  • damageAmount : The amount of damage to deal. Will try to use the DamageDef's default damage if not filled in

  • armorPenetration : How well it pierces through armor. Defaults to the DamageDef's if not filled in

  • damageFalloff : Default (False) : When true, the damage amount decreases the further they are from the center

  • extraGasType : Default (Smoke) : An extra gas type to create when the explosion occurs. The Options are Smoke, None, Tox, and Rot

  • chanceToStartFire : Default (0) : Chance to try to catch flammable things on fire

  • excludeRadius : Default (0) : Usually better to just have exclusions set to Self

  • exclusions : Default (Self) : Determines what gets excluded from the explosion damage. The options are None, Self, Allies, and NonHostiles

These are the more aesthetic options of the explosion, like sounds and thing creation:

  • explosionSound - The sound the explosion makes

  • postExplosionThingWater : Creates thing over water when the explosion overlaps with water

  • screenShakeFactor : Default (0) : Shake that screen

  • postExplosionThing : The ThingDef that is generated after explosion

  • postExplosionThingChance : Default (0) : The chances of the thing being created, with 1 being 100%

  • postExplosionSpawnThingCount : Default (1) : Number of things created

  • preExplosionThing : The ThingDef that is generated before the explosion

  • preExplosionThingChance : Default (0) : The chances of the thing being created, with 1 being 100%

  • preExplosionSpawnThingCount : Default (1) : Number of things created

  • effecter : The EffecterDef created at the start of the explosion

  • effecterTicks : If given a value above 0, the map will maintain the effecter for a number of ticks equal to this value. If it isn't added, then it's handled by the EffecterDef itself


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">
                <radius>10</radius>
                <damageDef>Burn</damageDef>
                <injureSelf>false</injureSelf>
                <explosionSound>Foam_Impact</explosionSound>
                <postExplosionThing>SHG_BloodMist</postExplosionThing>
                <postExplosionThingChance>100</postExplosionThingChance>
                <damageAmount>40</damageAmount>
            </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 Name="SHG_BaseGas" Abstract="True">
	<thingClass>Gas</thingClass>
	<label>gas</label>
	<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>
	</graphicData>
        <gas>
            <rotationSpeed>10</rotationSpeed>
        </gas>
    </ThingDef>

    <ThingDef ParentName="SHG_BaseGas">
        <defName>SHG_BloodMist</defName>
        <label>blood mist</label>
        <graphicData>
            <color>(0.8,0.2,0.2)</color>
        </graphicData>
        <gas>
            <expireSeconds>
                <min>1</min>
                <max>1</max>
            </expireSeconds>
        </gas>
    </ThingDef>
⚠️ **GitHub.com Fallback** ⚠️