• I am still able to place a whole lot of bombs on the screen at a time, which I'd like to fix (the default is one bomb onscreen at a time).
The only way I know to limit the number of bombs on screen is to do something like the following...
const int BOMB_DAMAGE = 2;//How much damage the Lweapon does.
//Lweapon bombs. Spawns a bomb in front of Link with a different sound effect than normal.
//D0- Sound to make.
item script SpawnLWeaponBomb{
void run(int sound){
//You have more than one bomb and there are no bombs on screen.
if(Game->Counter[CR_BOMBS] >0 && NumLWeaponsOf(LW_BOMB)==0{
Game->PlaySound(sound);//Play the sound.
//Spawn the bomb in front of Link and set the damage.
lweapon bomb = Screen->CreateLWeapon(LW_BOMB);
bomb->X = Link->X+ InFrontX(Link->Dir,0);
bomb->Y = Link->Y+ InFrontY(Link->Dir,0);
bomb->Damage = BOMB_DAMAGE;
//Reduce in-game counter.
Game->Counter[CR_BOMBS]--;
}
}
}
This isn't tested, but it should work.
Edit: Changed custom function to one included in StdFunctions.zh, part of std.zh. Because there's no need to reinvent the wheel...
• The custom bombs are now damaging enemies, which is excellent, but they are dealing twice as much damage to Link as they should. Is there a way to correct that?
You probably have the constant at too high a value. Try a setting of 2 as in the revised script.
Edited by ywkls, 04 April 2016 - 12:20 AM.