Various Explosion Hediff Comps - KonradHeinser/EBSGFramework GitHub Wiki
These comps allow you to create explosions in various situations. These are all turned into their own comp to allow you to combine multiple into the same hediff. All of these have the same options available to them:
- EBSGFramework.HediffCompProperties_ExplodeOnDeath : Creates an explosion centered on the pawn when they die
- EBSGFramework.HediffCompProperties_ExplodeOnRemoval : Creates an explosion centered on the pawn when the hediff is removed
- EBSGFramework.HediffCompProperties_ExplodeWhenDamaged : Creates an explosion centered on the pawn when they receive any amount of damage
- EBSGFramework.HediffCompProperties_ExplosiveRetaliation : Creates an explosion centered on the attacker when the pawn receives any amount of damage
- EBSGFramework.HediffCompProperties_ExplodingAttacks : Create's an explosion centered on the pawn's target when they hit them with any attack
- EBSGFramework.HediffCompProperties_ExplodingMeleeAttacks : Create's an explosion centered on the pawn's target when they hit them with a melee attack
- EBSGFramework.HediffCompProperties_ExplodingRangedAttacks : Create's an explosion centered on the pawn's target when they hit them with a ranged attack
Much like Burst Attacks, these comps allow you to customize every aspect of the explosion that was available. For the main effects of the explosions, you have these options in all of the comps:
-
radius : Default (0) : How wide the explosion should be. Mutually exclusive with statRadius
-
statRadius : The StatDef to use to determine the explosion size
-
multiplyRadiusBySeverity : Default (False) : Multiplies the radius whatever the current severity is. Works with both radius and statRadius
-
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
-
multiplyDamageBySeverity : Default (False) : Multiplies the damage amount by the severity. If True, then damageAmount must be filled in to avoid errors, even if the amount you put in is a copy paste of the DamageDef's default
-
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
-
validSeverities : Default (0~9999) : The range of seventies that the hediff needs to be in for the explosion to occur. If a single number is input instead of a range, then the severity must be above that number
These aesthetic tags will allow you to customize the appearance, sound, 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
HediffCompProperties_ExplodeOnRemoval has one additional option that the others do not have:
- allowDead : Default (True) : If the hediff is removed on death and you don't want the comp to activate in that situation, set this to False
Example of a hediff with 3 separate explosion types, a large explosion on death, a much smaller explosion when injured, and single target explosion that occurs with any attack:
<HediffDef>
<defName>Exploder</defName>
<label>exploder</label>
<description>This is a test hediff</description>
<everCurableByItem>false</everCurableByItem>
<initialSeverity>0.001</initialSeverity>
<stages />
<hediffClass>HediffWithComps</hediffClass>
<scenarioCanAdd>false</scenarioCanAdd>
<comps>
<li Class="EBSGFramework.HediffCompProperties_ExplodeOnDeath">
<radius>10</radius>
<damageDef>Burn</damageDef>
<exclusions>Self</exclusions>
<extraGasType>None</extraGasType>
<explosionSound>Foam_Impact</explosionSound>
<preExplosionThing>Filth_Fuel</preExplosionThing>
<preExplosionThingChance>1</preExplosionThingChance>
<chanceToStartFire>0.50</chanceToStartFire>
<damageAmount>40</damageAmount>
</li>
<li Class="EBSGFramework.HediffCompProperties_ExplodeWhenDamaged">
<radius>3</radius>
<damageDef>Burn</damageDef>
<exclusions>Self</exclusions>
<extraGasType>None</extraGasType>
<explosionSound>Foam_Impact</explosionSound>
<preExplosionThing>Filth_Fuel</preExplosionThing>
<preExplosionThingChance>1</preExplosionThingChance>
<chanceToStartFire>0.75</chanceToStartFire>
<damageAmount>10</damageAmount>
</li>
<li Class="EBSGFramework.HediffCompProperties_ExplodingAttacks">
<radius>0.5</radius>
<damageDef>Burn</damageDef>
<exclusions>Self</exclusions>
<extraGasType>None</extraGasType>
<explosionSound>Foam_Impact</explosionSound>
<preExplosionThing>Filth_Fuel</preExplosionThing>
<preExplosionThingChance>1</preExplosionThingChance>
<chanceToStartFire>1</chanceToStartFire>
<damageAmount>10</damageAmount>
</li>
</comps>
</HediffDef>