I couldn't find any good documentation on how to use this effect in your own modded weapons.
Here's a tutorial on how to use this effect, from everything in your code to your graphics.
Step 1: The Weapon Code (blueprints file)
There are two types of boost that FTL uses: cooldown and damage.
Cooldown
Code: Select all
<boost>
<type>cooldown</type>
<amount>(x)</amount>
<count>(y)</count>
</boost>
In this case, the weapon cooldown will be reduced by (x) every time the weapon fires, until the weapon fires (y) times. This is the boost cap.
Negative amounts don't have any effect.
Damage
Code: Select all
<boost>
<type>damage</type>
<amount>(z)</amount>
<count>(w)</count>
</boost>
Once it fires (w) times, the boost cap will be reached and the boost will no longer be applied.
As you can see, both scenarios are identical aside from the effect.
Step 2: The Animation Code (animations file)
Let's take a look at the chain laser weapon animation:
Code: Select all
<animSheet name="chainlaser" w="275" h="49" fw="25" fh="49">weapons/chainlaser_1_strip11.png</animSheet>
<weaponAnim name="chainlaser">
<sheet>chainlaser</sheet>
<desc length="11" x="0" y="0"/>
<chargedFrame>4</chargedFrame>
<fireFrame>6</fireFrame>
<firePoint x="16" y="16"/>
<mountPoint x="4" y="37"/>
<boost>chainlaser_1_charge</boost>
</weaponAnim>
Notice the <boost> tag. It is referring to a second animation sheet. It looks like this:
Code: Select all
<animSheet name="chainlaser_1_charge" w="75" h="49" fw="25" fh="49">weapons/chainlaser_1_chargeglow_strip3.png</animSheet>
<anim name="chainlaser_1_charge">
<sheet>chainlaser_1_charge</sheet>
<desc length="3" x="0" y="0"/>
<time>1.0</time>
</anim>
This is the boost animation code for the chain laser. Notice how h (height), fw (frame width) and fh (frame height) match the original animation. As you will see later, it would be silly if this wasn't the case. The only thing that differs is the width.
Since the chain laser has 3 boost stages, the boost animation is 3 frames long. Make sure the <time> is 1.0 for all boost animations.
Step 3: The Graphics
Building off of the chain laser example, here are its specified graphics:
chainlaser_1_strip11.png

Just a normal weapon animation here.
chainlaser_1_chargeglow_strip3.png

As you can see, there are three overlay frames for each boost stage.
In case your boost animation is slightly misplaced in-game, you can fiddle with the image to move it around.
Now you know how easy it is to make a custom weapon with a boost effect!