PDA

View Full Version : Adding a check for sideview



Majora
10-15-2012, 09:59 PM
I'm pretty sure Joe123 wrote this one but he died a long time ago. If someone could add a check-for-sideview to this that would be great. Because currently, it breaks sideview. Link falls down the pit and everything except when he "respawns", he ignores sideview gravity for some reason.


const int linkfalling = 10; // set here the first tile of your 5 tile Link Falling animationconst int linklava = 30; // set here the first tile of your 5 tile Link Drowning animation
const int fallingsfx = 81; // set here the SFX that plays when Link falls
const int lavasfx = 82; // 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->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, -1, 0, 0, 0, 0, true, 128);
else Screen->DrawTile(2, x, y, tile+Floor(i/8), 1, 1, 6, -1, 1, 0, 0, 0, 0, true, 128);
}
Link->X = warpx; Link->Y = warpy;
Link->Action = 0;
Link->HP -= 8;
Game->PlaySound(19);
}
}
}
}