Orbital Strike - KonradHeinser/EBSGFramework GitHub Wiki
This ability comp allows you to create bombardment style abilities with a bunch of options for customization. The only hard requirement for this comp is that it uses a center marker that is using the EBSGFramework.CustomizeableOrbitalStrike thingClass. This framework has a bunch of premade ones that you can take a look at in OrbitalCenters.xml, or if you want to make one with a different color you can copy one of those for your own. Your basic ability comp stuff should look something like this:
<!--This particular centerMarker doesn't create a visual marker at the center-->
<comps>
<li Class="EBSGFramework.CompProperties_OrbitalStrike">
<centerMarker>EBSG_OrbitalCenter_Colorless</centerMarker>
</li>
</comps>
These are the tags you can use to customize how the bombardment functions in general:
- preImpactSound : SoundDef played while falling. The vanilla equivalent of this def would be Bombardment_PreImpact
- count : Default (30) : How many to drop
- interval : Default (18) : The ticks between drops
- warmupTicks : Default (60) : Delay between cast finish and first drop starting
- targetRadius : Default (25) : Area that strikes can land in
- projectileTexPath : Default (Things/Projectile/Bullet_Big) : The appearance of the projectile
- projectileColor : Default (255,255,255) : The color used on the projectile graphic. If set to (1, 1, 1, 0) the graphic shouldn't appear
These tags alter the more direct impacts of the explosions:
- damageDef : Default (Bomb) : The DamageDef to use
- explosionRadius : Default (6~8) : The radius of the explosion
- damageAmount : Default (-1) : Defaults to whatever the DamageDef says to use
- armorPenetration : Default (-1) : Defaults to whatever the DamageDef says to use
- damageFalloff : Default (False) : When true, explosions deal less damage to those further from the center
- fireChance : Default (1) : Chance to set any flammable things that survived the explosion on fire
- extraGasType : An extra gas type to create when the explosion occurs. The Options are BlindSmoke, ToxGas, RotStink, and DeadlifeDust
- gasRadiusOverride : The maximum radius that the gas can be generated in, if one is set. This is still constrained by whatever the game views as the limit for the explosion in general
- postExplosionGasAmount : Default (255) : The amount of gas generated in each cell, with 255 completely filling it
These final tags alter the less direct impacts of the explosions, like sounds and things created:
-
explosionSound : The sound the explosion makes. If left blank or not included, the damageDef determines the explosionSound
-
screenShakeFactor : Default (0) : Shake that screen
-
postExplosionThingWater : Creates thing over water when the explosion overlaps with water
-
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
Note: The orbital strike saves the data when it is started, so if you save mid-bombardment to make a change, you'll need to start a new bombardment to see the changes
These three examples create different types of bombardment type abilities. The first one is a more normal bombardment that drops bombs on the area. The second one drops a bunch of smoke bombs that don't deal damage, but instead create a rapidly expanding cloud of smoke. The third one removes the appearance of a bombardment entirely by using the clear/colorless marker and making the projectiles invisible, and instead starts fires randomly in a small area:
<AbilityDef>
<defName>Bombardment_Normal</defName>
<label>bombardment</label>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>30</range>
<warmupTime>0.5</warmupTime>
<requireLineOfSight>False</requireLineOfSight>
<targetParams>
<canTargetLocations>true</canTargetLocations>
<canTargetSelf>false</canTargetSelf>
<canTargetPawns>true</canTargetPawns>
<canTargetBuildings>true</canTargetBuildings>
<canTargetPlants>true</canTargetPlants>
</targetParams>
</verbProperties>
<comps>
<li Class="EBSGFramework.CompProperties_OrbitalStrike">
<centerMarker>EBSG_OrbitalCenter_Red</centerMarker>
<fireChance>0</fireChance>
<damageFalloff>True</damageFalloff>
</li>
</comps>
<description>.</description>
<iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
<cooldownTicksRange>60</cooldownTicksRange>
</AbilityDef>
<AbilityDef>
<defName>Bombardment_Smoke</defName>
<label>bombardment (smoke)</label>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>30</range>
<warmupTime>0.5</warmupTime>
<requireLineOfSight>False</requireLineOfSight>
<targetParams>
<canTargetLocations>true</canTargetLocations>
<canTargetSelf>false</canTargetSelf>
<canTargetPawns>true</canTargetPawns>
<canTargetBuildings>true</canTargetBuildings>
<canTargetPlants>true</canTargetPlants>
</targetParams>
</verbProperties>
<comps>
<li Class="EBSGFramework.CompProperties_OrbitalStrike">
<centerMarker>EBSG_OrbitalCenter_White</centerMarker>
<projectileTexPath>Things/Projectile/LauncherShot</projectileTexPath>
<extraGasType>BlindSmoke</extraGasType> <!--This creates the smoke-->
<damageDef>Smoke</damageDef> <!--This changes explosion color and prevents damage-->
<fireChance>0</fireChance>
</li>
</comps>
<description>.</description>
<iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
<cooldownTicksRange>60</cooldownTicksRange>
</AbilityDef>
<AbilityDef>
<defName>Bombardment_FireStarter</defName>
<label>bombardment (firestarter)</label>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>30</range>
<warmupTime>0.5</warmupTime>
<requireLineOfSight>False</requireLineOfSight>
<targetParams>
<canTargetLocations>true</canTargetLocations>
<canTargetSelf>false</canTargetSelf>
<canTargetPawns>true</canTargetPawns>
<canTargetBuildings>true</canTargetBuildings>
<canTargetPlants>true</canTargetPlants>
</targetParams>
</verbProperties>
<comps>
<li Class="EBSGFramework.CompProperties_OrbitalStrike">
<centerMarker>EBSG_OrbitalCenter_Clear</centerMarker>
<projectileColor>(1,1,1,0)</projectileColor> <!--Removes the visual portion of the projectile-->
<damageAmount>1</damageAmount>
<fireChance>1</fireChance>
<explosionRadius>3~4</explosionRadius>
</li>
</comps>
<description>.</description>
<iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
<cooldownTicksRange>60</cooldownTicksRange>
</AbilityDef>