Ok, so I'm gonna see if I can re-edit this script to work with Super Bombs.
The original:
const int BOMB_DAMAGE = 4;//Damage to Enemies from Scripted Bombs
const int LW_MISC_MARKED = 0;//Index used for Scripted Bombs
const int BOMB_DAMAGE_TO_LINK = 8;//Quarter Heart Damage to Link from Scripted Bombs
BombBlastFake();
void BombBlastFake()
{
lweapon w;
eweapon ew;
for (int i = Screen->NumLWeapons(); i > 0; i--)
{
w = Screen->LoadLWeapon(i);
if (w->ID == LW_BOMBBLAST && w->Misc[LW_MISC_MARKED] != 1)
{
w->Misc[LW_MISC_MARKED] = 1;
ew = Screen->CreateEWeapon(EW_BOMBBLAST);
ew->X = w->X;
ew->Y = w->Y;
ew->Damage = BOMB_DAMAGE_TO_LINK;
}
}
}
//D0: SFX to play when Link places a Bomb
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 || Link->Item[I_BOMBBAG4]) && 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.
if (!Link->Item[I_BOMBBAG4])
Game->Counter[CR_BOMBS]--;
}
}
}
My edit:
const int SBOMB_DAMAGE = 16;//Damage to Enemies from Scripted Bombs
const int LW_MISC_MARKED = 0;//Index used for Scripted Bombs
const int SBOMB_DAMAGE_TO_LINK = 8;//Quarter Heart Damage to Link from Scripted Bombs
SBombBlastFake();
void SBombBlastFake()
{
lweapon w;
eweapon ew;
for (int i = Screen->NumLWeapons(); i > 0; i--)
{
w = Screen->LoadLWeapon(i);
if (w->ID == LW_SBOMBBLAST && w->Misc[LW_MISC_MARKED] != 1)
{
w->Misc[LW_MISC_MARKED] = 1;
ew = Screen->CreateEWeapon(EW_SBOMBBLAST);
ew->X = w->X;
ew->Y = w->Y;
ew->Damage = SBOMB_DAMAGE_TO_LINK;
}
}
}
//D0: SFX to play when Link places a Bomb
item script SpawnSuperLWeaponBomb{
void run(int sound){
//You have more than one bomb and there are no bombs on screen.
if((Game->Counter[CR_SBOMBS] >0 || Link->Item[I_BOMBBAG4]) && NumLWeaponsOf(LW_SBOMB)==0){
Game->PlaySound(sound);//Play the sound.
//Spawn the bomb in front of Link and set the damage.
lweapon bomb = Screen->CreateLWeapon(LW_SBOMB);
bomb->X = Link->X+ InFrontX(Link->Dir,0);
bomb->Y = Link->Y+ InFrontY(Link->Dir,0);
bomb->Damage = SBOMB_DAMAGE;
//Reduce in-game counter.
if (!Link->Item[I_BOMBBAG4])
Game->Counter[CR_SBOMBS]--;
}
}
}
I... think that should do it. I didn't change line 2 "const int LW_MISC_MARKED = 0;//Index used for Scripted Bombs" because I don't understand what that does.
EDIT: Aaand the line I didn't change is causing a compiling error, saying there is already a constant defined
Edited by Cukeman, 11 July 2016 - 09:41 PM.