lweapon script bombarrow
{
void run()
{
//quit if bombs not in a slot
itemdata bomb; bool found; bool super;
bomb = Game->LoadItemData(Link->ItemA);
if ( bomb->Family == IC_BOMB ) found = true;
if ( bomb->Family == IC_SBOMB ) { found = true; super = true; }
if ( !found )
{
bomb = Game->LoadItemData(Link->ItemB);
if ( bomb->Family == IC_BOMB ) { found = true;
if ( bomb->Family == IC_SBOMB ) { found = true; super = true; }
}
if ( !found ) Quit();
else
{
pow = bomb->Damage;
if ( super )
{
if ( !Game->Counter[CR_SBOMBS] ) Quit();
else --Game->Counter[CR_SBOMBS];
}
else
{
if ( !Game->Counter[CR_BOMBS] ) Quit();
else --Game->Counter[CR_BOMBS];
}
}
//quit if not enough bombs
int x; int y; int pow;
while(this->isValid()) { x = this->X; y = this->Y; Waitframe(); }
lweapon boom = Screen->CreateLWeapon( (( super ) ? LW_SBOMBBLAST : LW_BOMBBLAST ));
boom->Damage = pow;
boom->X = x;
boom->Y = y;
}
}
Comments