A bobomb style enemy, that starts flashing when hit, then soon explodes.
After compiling, and assigning npc script bobomb to a slot:
Select any standard walking enemy in the enemy editor.
Set its action script to 'bobomb'.
Set all of the weapon defences for the npc to 'Stun'; set anything that you wish the npc to ignore to 'Ignore'.
The countdown begins automatically when this npc is stunned, so you can pick and choose defences, including allowing some weapons to do normal damage.
The script defaults to a set of values that will be typical for most users. If the default values work for you, then your set-up is complete.
If you want or need custom values, the script args are:
D0: The Misc[] Index used by the3 npc for its countdown clock. The default is 14.
D1: The Misc[] index used to store the original CSet of the enemy. The default is 13.
D2: The FLASH CSET used by the enemy when flashing. The default is 8.
D3: The duration (in frames) before it explodes. The default is 120.
Optional
You may also wish to set the constant 'ID' to the enemy editor value of the bobomb npc. This value is not used by this script, but it allows you to access the ID of the enemy that you are using with this script, from another script via bobomb.ID. Note that this is only useful if one enemy uses the script.