Allows Link's bombs and script created bombs (via a provided FFC script or you can make your own script) to follow conveyor belts. You can also allow these bombs to blow up when they collide with solid objects and/or traps.
Script Update: (06/04/2015)
1. Added three new constants that allow you to make the game play a sound when a bomb spawner spawns a new bomb, and chose whether or not bombs blow up when they run into the end of a conveyor belt.
2. Changed the BombSpawner script so that setting D4 to a value of 2 or 3 will cause it to create bombs that can trigger secrets when they explode on a bombable combo.
3. Added a counter argument to the BombConveyor function so that bombs should now travel at the same speed as Link does on a conveyor belt.
4. Made it so that bombs on a conveyor belt can now round corners without getting hung or blowing up on the corner.
Script Update: (05/27/2015)
1: The BOMB_EXPLODE constant has been split into two constants, EBOMB_EXPLODE and LBOMB_EXPLODE, these constants do the same thing as the old one, except that they only affect enemy bombs and Link bombs, respectively.
2: Two new constants have been added, ECONVEYOR_AUTO_EXPLODE and LCONVEYOR_AUTO_EXPLODE. Setting these constants to 1 will cause enemy and Link bombs (respectively) to blow up when they ride to the end of a conveyor belt. Handy for bombs with unlimited fuses that need to run into an unsolid space.
3: A bug in the ffc BombSpawner script has been fixed that caused the script to place bombs at the wrong spot when placing them in the rightward direction.
Setup is included in the script file, the following is a copy paste from the setup instructions in the script file. Note for scripters, to create your own enemy bombs that obey conveyor belts you will need to create a eweapon of type EW_CONVEYORBOMB and the set eweapon->Misc[CONVEYORBOMB_MISC_ID] equal to 1.
//Setup
//First, please set the below constants to the correct values, then, place BombConveyor(counter) in your global script, inside of the main loop and an if(Link->Action != LA_SCROLLING){ statement, and before Waitdraw() and Waitframe().
//Also, make sure you declare a variable, increase it by 1 every frame, and have an if statement that stops it from going past 214748
//If you do not already
//have a global script you can just use BombConveyorGlobalExample in your active global slot, otherwise, you can just use it as an example of how to set the script up
//Constants
const int SPRITE_BOMB = 76; //The sprite id to use for enemy bombs that can ride conveyors. Refer to quest->Graphics->Sprites->Weapons/Misc to find values for this
const int SPRITE_SBOMB = 77; //The sprite id to use for enemy super bombs that can ride conveyors. Refer to quest->Graphics->Sprites->Weapons/Misc to find values for this
const int SPRITE_4WAY = 1; //If you would like the sprite to be fliped and rotated according to it's position, set this to 1. Otherwise, set it to 0. Note that if you set it to 1, the script assumes that the sprites tiles (Both Link's AND enemy bomb sprites) are in the pointing 'UP' position
const int SFX_BOMBSPAWNER = 21; //Sound to play when the BombSpawner ffc script creates a bomb. 21 is the sound of Link placing a bomb
const int EBOMB_EXPLODE = 3; //This value determines whether or not to explode an enemy conveyor bomb if it makes contact with a solid object or enemy
const int LBOMB_EXPLODE = 2; //This value determines whether or not to explode a bomb placed by Link if it makes contact with a solid object or enemy - Note: Be careful setting this value so that Link bombs explode on contact with solid objects if you have the quest rule checked to make Link bombs do damage to Link, as you may land up going to blow up a bombable wall only to blow Link up instead!
// Set BOMB_EXPLODE to 1 for it to explode ONLY on solid objects
// Set BOMB_EXPLODE to 2 for it to explode ONLY on traps (note, this does NOT include damage combos)
// Set BOMB_EXPLODE to 3 for it to explode on traps AND solid objects
// Set BOMB_EXPLODE to 0 for it to not explode on either of the above.
// Note: Regardless of what BOMB_EXPLODE is set too, once the bombs fuse duration is up, it will explode, period.
const int ECONVEYOR_AUTO_EXPLODE = 1; //Setting this value to 1 will cause enemy bombs to automatically explode if they ride off of a conveyor belt. Set to 0 if you do not wish this behavior
const int LCONVEYOR_AUTO_EXPLODE = 0; //Setting this value to 1 will cause Link bombs to automatically explode if they ride off of a conveyor belt. Set to 0 if you do not wish this behavior
const int BOMB_HITBOX_SHIRNK = 4; //The conveyor bomb's default hitbox is 16 by 16 pixels (see figure A at the bottum of this script). This const will shrink the hitbox on all four sides by the amount indicated. For instance, a value of four would create a hitbox of the size 8 by 8 pixels (see figure B)
//Set the below values up so that they don't conflict with other scripts that may modify enemy weapons
const int EW_CONVEYORBOMB = 31; //The weapon ID to use for enemy bombs. Please use a value that is in the range of 31 to 40 (the EW_SCRIPT values). As other values are liable to result in bugs
const int CONVEYORBOMB_MISC_ID = 14; //Which part of the weapon->Misc[] array to access. This will be where the script stores the info that this weapon is a conveyor bomb
const int CONVEYORBOMB_MISC_FUSE = 0; //Which part of the eweapon->Misc[] array to access. This will be where the script stores the duration of the fuse and how much longer until the bomb will blow up
//the ffc script BombSpawner is used to create enemy bombs that will move on conveyors. They do not move unless they are on a conveyor
//D0 = the direction in which to place the bomb. 0 = UP, 1 = DOWN, 2 = LEFT, 3 = RIGHT. For instance, if you set this value to 0, the bombs will be placed slightly above the ffc. Use -1 if you wish the bombs to be spawned directly on top of the ffc
//D1 = the amount of damage for the bomb to do, measured in quarter hearts.
//D2 = the number of frames (60 frames in a second) before the bomb blows up. Set to -1 for it to never blow up (aside from colliding with Link and stuff determined by BOMB_EXPLODE)
//D3, the ffc will spawn a bomb every D3 frames. So a value of 60 would mean 1 bomb per second
//D4 = whether or not to create a super bomb.
// Set to 0 to create a regular bomb,
// set to 1 to create a superbomb,
// set to 2 to create a regular bomb whose explosion effects will line up exactly with the effects of one of Links bombs (secret trigger, damage to enemies, damage to Link based on quest rule, etc)
// set to 3 to create a superbomb whose explosion effects will line up exactly with the effects of one of Links bombs (secret trigger, damage to enemies, damage to Link based on quest rule, etc)
//D5 = An offset to the counter used for determining when to place bombs. Useful when you have say 2 bomb spawners that spawn at the same rate, but that you don't want spawning at the exact same time.
// 'X' represents 1 pixel of hitbox. '-' represents space the hitbox does not cover. Each box is 16 by 16 pixels. Figure A hitbox is 16 by 16. Figure B hitbox is 8 by 8
// Figure A Figure B (Note that PureZC ruins these figures >.<, but oh well, its cool)
// X X X X X X X X X X X X X X X X - - - - - - - - - - - - - - - -
// X X X X X X X X X X X X X X X X - - - - - - - - - - - - - - - -
// X X X X X X X X X X X X X X X X - - - - - - - - - - - - - - - -
// X X X X X X X X X X X X X X X X - - - - - - - - - - - - - - - -
// X X X X X X X X X X X X X X X X - - - - X X X X X X X X - - - -
// X X X X X X X X X X X X X X X X - - - - X X X X X X X X - - - -
// X X X X X X X X X X X X X X X X - - - - X X X X X X X X - - - -
// X X X X X X X X X X X X X X X X - - - - X X X X X X X X - - - -
// X X X X X X X X X X X X X X X X - - - - X X X X X X X X - - - -
// X X X X X X X X X X X X X X X X - - - - X X X X X X X X - - - -
// X X X X X X X X X X X X X X X X - - - - X X X X X X X X - - - -
// X X X X X X X X X X X X X X X X - - - - X X X X X X X X - - - -
// X X X X X X X X X X X X X X X X - - - - - - - - - - - - - - - -
// X X X X X X X X X X X X X X X X - - - - - - - - - - - - - - - -
// X X X X X X X X X X X X X X X X - - - - - - - - - - - - - - - -
// X X X X X X X X X X X X X X X X - - - - - - - - - - - - - - - -