PDA

View Full Version : I hate explosions



Tamamo
10-05-2015, 01:28 PM
import "std.zh"

const int WPS_LINK_BOMBBLAST = 88;
const int WPS_LINK_SBOMBBLAST = 89;
const int WPS_ENEMY_BOMBBLAST = 90;
const int WPS_ENEMY_SBOMBBLAST = 91;

//BE SURE TO SET THE DEFAULT EXPLOSION TILES TO BLANK TILES!

global script slot2_CoolExplosions
{
void run()
{
while(true)
{
Waitdraw();
CoolExplosions();
Waitframe();
}
}
}

void CoolExplosions()
{
bool skiplweapons=false;
int sprite;
// lweapon dummy = LoadLWeaponOf(LW_BOMBBLAST);
// if(!dummy->isValid())
// {
// dummy = LoadLWeaponOf(LW_SBOMBBLAST);
// if(!dummy->isValid())
// skiplweapons=true;
// }
for(int i = Screen->NumLWeapons(); i>0 && !skiplweapons; i--)
{
lweapon w=Screen->LoadLWeapon(i);
if(w->ID!=LW_BOMBBLAST && w->ID!=LW_SBOMBBLAST) continue;
if(w->Misc[0]!=0) continue;
w->Misc[0]=1;
lweapon blast=CreateLWeaponAt(LW_SPARKLE,w->X,w->Y);
blast->Extend=3;
blast->CollDetection=false;
blast->DrawXOffset=Cond(w->ID==LW_BOMBBLAST, -8, -16);
blast->DrawYOffset= blast->DrawYOffset;
blast->TileWidth = Cond(w->ID==LW_BOMBBLAST, 2, 3);
blast->TileHeight = blast->TileWidth;
sprite=Cond(w->ID==LW_BOMBBLAST,WPS_LINK_BOMBBLAST, WPS_LINK_SBOMBBLAST);
blast->UseSprite(sprite);
blast->DeadState=blast->NumFrames*blast->ASpeed;
}
// eweapon dummy2 = LoadFirstEWeaponOf(EW_BOMBBLAST);
// if(!dummy->isValid())
// {
// dummy2 = LoadFirstEWeaponOf(EW_SBOMBBLAST);
// if(!dummy->isValid())
// return;
// }
for(int i = Screen->NumEWeapons(); i>0; i--)
{
eweapon w=Screen->LoadEWeapon(i);
if(w->ID!=EW_BOMBBLAST && w->ID!=EW_SBOMBBLAST) continue;
if(w->Misc[0]!=0) continue;
w->Misc[0]=1;
lweapon blast=CreateLWeaponAt(LW_SPARKLE,w->X,w->Y);
blast->Extend=3;
blast->CollDetection=false;
blast->DrawXOffset=Cond(w->ID==EW_BOMBBLAST, -8, -16);
blast->DrawYOffset=blast->DrawXOffset;
blast->TileWidth = Cond(w->ID==EW_BOMBBLAST, 2, 3);
blast->TileHeight = blast->TileWidth;
sprite=Cond(w->ID==EW_BOMBBLAST,WPS_ENEMY_BOMBBLAST, WPS_ENEMY_SBOMBBLAST);
blast->UseSprite(sprite);
blast->DeadState=blast->NumFrames*blast->ASpeed;
}
}


Can't get this to work right. Link to test quest below. It's hard to explain what's going on, but it happens for both bombs and super bombs. A visual is needed hence the test quest.
https://www.dropbox.com/s/t7jlpyidf1br4d7/explosionstest.qst?dl=0
Saffith
Being that the weapon code is a mess, have you though about doing what you did with link's items?

Saffith
10-06-2015, 01:18 PM
Everything needs fixed. Weapons aren't the highest priority, but they'll need to be redone sooner or later.

Tamamo
10-06-2015, 01:44 PM
Everything needs fixed. Weapons aren't the highest priority, but they'll need to be redone sooner or later.

Yes sir, you are correct. Everything needs fixing. Probably going to do it myself eventually.