CODE
const int ladderflag = 100;
ffc script ladder{
void run(int speed, int combotype , int dummy){
int framedelay;
int lc;
if(combotype == 0){combotype = 11;}
if(speed == 0){speed = 1;}
while(true){
lc = ComboAt(Link->X+8, Link->Y+15);
if(Screen->ComboF[lc] == ladderflag || Screen->ComboI[lc] == ladderflag){
if(Link->Jump < 0) Link->Jump = 0;
if(Link->InputDown && !isSolid(Link->X, Link->Y+16)) Link->Y += 1;
if(Link->InputUp && !isSolid(Link->X, Link->Y - 1)) Link->Y -= 1;
//[[Sets up the antigravity effect]]
if(!Link->Item[130]){ Link->Item[130] = true;}
if(Link->InputLeft && Link->Dir == 2){
if(framedelay == 3){Link->X = Link->X+1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputRight && Link->Dir == 3){
if(framedelay == speed){Link->X = Link->X-1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputUp && Link->Dir == 0){
if(framedelay == speed){Link->Y = Link->Y+1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputDown && Link->Dir == 1){
if(framedelay == speed){Link->Y = Link->Y-1; framedelay = 0;}
else{framedelay++;}
}
Link->InputA = false;
Link->InputB = false;
Link->InputL = false;
Link->InputR = false;
}else{if(Link->Item[130]){ Link->Item[130] = false;}
}
Waitframe();
}
}
}
bool isSolid(int x, int y) {
if(x<0 || x>255 || y<0 || y>175) return false;
int mask=1111b;
if(x%16<8)
mask&=0011b;
else
mask&=1100b;
if(y%16<8)
mask&=0101b;
else
mask&=1010b;
return (!(Screen->ComboS[ComboAt(x, y)]&mask)==0);
}
ffc script ladder{
void run(int speed, int combotype , int dummy){
int framedelay;
int lc;
if(combotype == 0){combotype = 11;}
if(speed == 0){speed = 1;}
while(true){
lc = ComboAt(Link->X+8, Link->Y+15);
if(Screen->ComboF[lc] == ladderflag || Screen->ComboI[lc] == ladderflag){
if(Link->Jump < 0) Link->Jump = 0;
if(Link->InputDown && !isSolid(Link->X, Link->Y+16)) Link->Y += 1;
if(Link->InputUp && !isSolid(Link->X, Link->Y - 1)) Link->Y -= 1;
//[[Sets up the antigravity effect]]
if(!Link->Item[130]){ Link->Item[130] = true;}
if(Link->InputLeft && Link->Dir == 2){
if(framedelay == 3){Link->X = Link->X+1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputRight && Link->Dir == 3){
if(framedelay == speed){Link->X = Link->X-1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputUp && Link->Dir == 0){
if(framedelay == speed){Link->Y = Link->Y+1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputDown && Link->Dir == 1){
if(framedelay == speed){Link->Y = Link->Y-1; framedelay = 0;}
else{framedelay++;}
}
Link->InputA = false;
Link->InputB = false;
Link->InputL = false;
Link->InputR = false;
}else{if(Link->Item[130]){ Link->Item[130] = false;}
}
Waitframe();
}
}
}
bool isSolid(int x, int y) {
if(x<0 || x>255 || y<0 || y>175) return false;
int mask=1111b;
if(x%16<8)
mask&=0011b;
else
mask&=1100b;
if(y%16<8)
mask&=0101b;
else
mask&=1010b;
return (!(Screen->ComboS[ComboAt(x, y)]&mask)==0);
}
I would really appreciate this. ^_^' (Oh, and a bonus request, how about a simple vine-climbing/ladder-climbing script (Again, FFC) for the overworld? (Just making Link face north and using a climbing animation, as well as disabling the A and B buttons))
Thanks for hearing me out.