Blast Attacks - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp allows you to create an explosion at a target location/pawn with as much customization as possible. Every single option for explosions that could logically be added to a blast ability has been included here as a tag. Before getting into the various customization options, the basic blast will have a comp that starts like this:

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

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 (None) : 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


Mutated example from SHG - Only the Hemomancer. The original ability would 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. This version just changes it to be cast on a target that doesn't need to be the caster, though still could as the caster is immune:

    <AbilityDef>
        <defName>SHG_Hemomancer_BloodBoil</defName>
        <label>blood boil</label>
        <description>Release invisible balls of hemogen all around you that cause everyone around you to suddenly suffer sever burns as some of their blood evaporates.\n\nThis will return some hemogen based on how many people are hit, and create a cloud around the Reaper that makes it harder for people to shoot.\n\nThis will not raise hemogen to be above 80%.</description>
        <iconPath>UI/Icons/Genes/Gene_Bloodfeeder</iconPath>
        <jobDef>CastAbilityOnThingWithoutWeapon</jobDef>
        <canUseAoeToGetTargets>True</canUseAoeToGetTargets>
        <ai_SearchAOEForTargets>true</ai_SearchAOEForTargets>
        <showCastingProgressBar>true</showCastingProgressBar>
        <aiCanUse>True</aiCanUse>
        <category>Sanguophage</category>
        <cooldownTicksRange>2500</cooldownTicksRange>
        <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_EBSGBlast">
                <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** ⚠️