And now Mark 2:
Code:
const int linkfalling = 0; // set here the first tile of your 5 tile Link Falling animation
const int linklava = 0; // set here the first tile of your 5 tile Link Drowning animation
const int fallingsfx = 0; // set here the SFX that plays when Link falls
const int lavasfx = 0; // set here the SFX that plays when Link drowns in lava
ffc script hole{
void run(int lava, int warpx, int warpy, int combotype, int tile){
int sfx = fallingsfx;
if(warpx == 0 && warpy == 0){Waitframes(5); warpx = Link->X; warpy = Link->Y;}
if(tile == 0){tile = linkfalling;}
if(combotype == 0){combotype = 35;}
if(lava != 0){if(tile == linkfalling){tile = linklava;}sfx = lavasfx;}
int i; int x; int y; bool falling;
while(true){
falling = false;
while(Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] != combotype || Link->Z > 0 || Link->Action == LA_FROZEN) Waitframe();
i = 0;
while(Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] == combotype && Link->Z == 0 && Link->Action != LA_FROZEN && i < 5){
i++;
if(i==5) falling = true;
Waitframe();
}
if(falling){
Screen->ClearSprites(3);
Game->PlaySound(sfx);
x = Link->X; y = Link->Y;
for(i=0;i<40;i++){
Waitframe();
Link->Action = LA_DROWNING;
if(lava == 0) Screen->DrawTile(2, x, y, tile+Floor(i/8), 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
else Screen->DrawTile(2, x, y, tile+Floor(i/8), 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
}
Link->X = warpx; Link->Y = warpy;
Link->Action = 0;
Link->HP -= 8;
Game->PlaySound(19);
}
}
}
}
No need for silly Link Tile Modifiers anymore!
All other set up is the same though.