Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ffc script WarpCustomReturn //start Warp
- {
- //Dirs: -1 = Tile, 0 = Up, 1 = Down, 2 = Left, 3 = Right
- //If d2 is set, and the warp is a sidewarp, it will use the FFC's x/y to split into 2 sidewarps
- //d1 / d2 = 'dmap.screen', i.e. dm1scr1 = 1.0001
- void run(int d1, int x, int y, int side, int wtype, int d2, int x2, int y2)
- {
- int dm = Floor(d1), scr = (d1 % 1) / 1L;
- int dm2 = Floor(d2), scr2 = (d2 % 1) / 1L;
- switch(side)
- {
- case DIR_UP:
- {
- while(true)
- {
- if(Hero->Y <= 1.5 && Hero->InputUp)
- {
- if(d2 && Hero->X >= this->X)
- Hero->WarpEx({wtype, dm2, scr2, x2, y2, 0, 0, 0});
- else Hero->WarpEx({wtype, dm, scr, x, y, 0, 0, 0});
- }
- Waitframe();
- }
- }
- case DIR_DOWN:
- {
- while(true)
- {
- if(Hero->Y >= 158.5 && Hero->InputDown)
- {
- if(d2 && Hero->X >= this->X)
- Hero->WarpEx({wtype, dm2, scr2, x2, y2, 0, 0, 0});
- else Hero->WarpEx({wtype, dm, scr, x, y, 0, 0, 0});
- }
- Waitframe();
- }
- }
- case DIR_LEFT:
- {
- while(true)
- {
- if(Hero->X <= 1.5 && Hero->InputLeft)
- {
- if(d2 && Hero->Y >= this->Y)
- Hero->WarpEx({wtype, dm2, scr2, x2, y2, 0, 0, 0});
- else Hero->WarpEx({wtype, dm, scr, x, y, 0, 0, 0});
- }
- Waitframe();
- }
- }
- case DIR_RIGHT:
- {
- while(true)
- {
- if(Hero->X >= 238.5 && Hero->InputRight)
- {
- if(d2 && Hero->Y >= this->Y)
- Hero->WarpEx({wtype, dm2, scr2, x2, y2, 0, 0, 0});
- else Hero->WarpEx({wtype, dm, scr, x, y, 0, 0, 0});
- }
- Waitframe();
- }
- }
- default: //Tile warp, at the FFC's location.
- {
- while(true)
- {
- if(Abs(Hero->X-this->X) <= 14 && Abs(Hero->Y-this->Y) <= 14)
- Hero->WarpEx({wtype, dm, scr, x, y, 0, 0, 0});
- Waitframe();
- }
- }
- }
- }
- }
- //end FFC warp
Add Comment
Please, Sign In to add comment