I had the code up in the editor but I hadn't saved it and I closed it by accident. I'll write one up quick-sharp.
EDIT:
Alright! 24 minutes. Not too bad, but I think I could've done better.
CODE
const int CMB_BLANK = 0; //ID of a transparent, non-zero combo with no combotype
const int SFX_WARPING = 0; //Sound effect to play when spinning in warp
const int CMB_AUTOWARPA = 0; //ID of a transparent Autowarp A type combo
const int LI_MINIBOSS = 0x20;
ffc script B_MiniBossRoom
{
void run(int bossMIDI, int portal)
{
int orig = this->Data;
this->Data = CMB_BLANK;
Waitframes(4);
if(Screen->NumNPCs() != 0)
MiniBossPause(bossMIDI);
Portal(this, orig);
}
void MiniBossPause(int bossMIDI)
{
if(GetLevelItem(Game->GetCurLevel(), LI_MINIBOSS))
{
npc n;
for(int i = Screen->NumNPCs(); i > 0; i--)
{
n = Screen->LoadNPC(i);
n->HP = 0; n->X = 512;
}
return;
}
int MIDI = Game->GetMIDI();
if(bossMIDI > 0)
Game->PlayMIDI(bossMIDI);
while(Screen->NumNPCs() > 0)
Waitframe();
if(bossMIDI > 0)
{
Game->PlaySound(SFX_SECRET);
Game->PlayMIDI(MIDI);
}
SetLevelItem(Game->GetCurLevel(), LI_MINIBOSS, true);
}
void Portal(ffc portal, int orig)
{
if(!GetLevelItem(Game->GetCurLevel(), LI_MINIBOSS))
return;
while(LinkCollision(portal))
Waitframe();
portal->Data = orig;
while(!LinkCollision(portal))
Waitframe();
Game->PlaySound(SFX_WARPING);
Link->Dir = DIR_DOWN;
for(int i = 6; i > 0; i--)
{
for(int j = 3; j >= 0; j--)
{
Link->Dir = SpinDir(j);
WaitNoAction(i);
}
}
portal->Data = CMB_AUTOWARPA;
}
}
const int SFX_WARPING = 0; //Sound effect to play when spinning in warp
const int CMB_AUTOWARPA = 0; //ID of a transparent Autowarp A type combo
const int LI_MINIBOSS = 0x20;
ffc script B_MiniBossRoom
{
void run(int bossMIDI, int portal)
{
int orig = this->Data;
this->Data = CMB_BLANK;
Waitframes(4);
if(Screen->NumNPCs() != 0)
MiniBossPause(bossMIDI);
Portal(this, orig);
}
void MiniBossPause(int bossMIDI)
{
if(GetLevelItem(Game->GetCurLevel(), LI_MINIBOSS))
{
npc n;
for(int i = Screen->NumNPCs(); i > 0; i--)
{
n = Screen->LoadNPC(i);
n->HP = 0; n->X = 512;
}
return;
}
int MIDI = Game->GetMIDI();
if(bossMIDI > 0)
Game->PlayMIDI(bossMIDI);
while(Screen->NumNPCs() > 0)
Waitframe();
if(bossMIDI > 0)
{
Game->PlaySound(SFX_SECRET);
Game->PlayMIDI(MIDI);
}
SetLevelItem(Game->GetCurLevel(), LI_MINIBOSS, true);
}
void Portal(ffc portal, int orig)
{
if(!GetLevelItem(Game->GetCurLevel(), LI_MINIBOSS))
return;
while(LinkCollision(portal))
Waitframe();
portal->Data = orig;
while(!LinkCollision(portal))
Waitframe();
Game->PlaySound(SFX_WARPING);
Link->Dir = DIR_DOWN;
for(int i = 6; i > 0; i--)
{
for(int j = 3; j >= 0; j--)
{
Link->Dir = SpinDir(j);
WaitNoAction(i);
}
}
portal->Data = CMB_AUTOWARPA;
}
}
OK!
So what you do is...
Set the three constants at the top of the screen.
Then you put the script on the screen with the miniboss, and on the first screen of the dungeon. You can't have any enemies on the first dungeon screen. Give the ffc with the script the graphic of the portal, put it where you want the portal to appear and give it the 'Run Script at Screen Init.' flag. Set the sidewarp A to be where the portal should warp you (so between the two screens). If you want the screen midi in the miniboss room to change to a 'fight' midi, put the midi's ID as D0 for the script.
And that's it!
Edited by Joe123, 26 July 2010 - 05:01 AM.