ZoriaRPG

A Terrible Hack to wtSCROLL

Sep 22nd, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.30 KB | None | 0 0
  1. case wtSCROLL:                                          // scrolling warp
  2.     {
  3.         int c = DMaps[currdmap].color;
  4.         currmap = DMaps[wdmap].map;
  5.     update_subscreens(wdmap);
  6.    
  7.     dlevel = DMaps[wdmap].level;
  8.         //check if Link has the map for the new location before updating the subscreen. ? -Z
  9.         //This works only in one direction, if Link had a map, to not having one.
  10.         //If Link does not have a map, and warps somewhere where he does, then the map still briefly shows.
  11.     update_subscreens(wdmap);
  12.        
  13.     if ( has_item(itype_map, dlevel) )
  14.     {
  15.         //Blank the map during an intra-dmap scrolling warp.
  16.         dlevel = -1; //a hack for the minimap. This works!! -Z
  17.     }
  18.        
  19.         // fix the scrolling direction, if it was a tile or instant warp
  20.         if(type==0 || type>=3)
  21.         {
  22.             sdir = dir;
  23.         }
  24.        
  25.         scrollscr(sdir, wscr+DMaps[wdmap].xoff, wdmap);
  26.     dlevel = DMaps[wdmap].level; //Fix dlevel and draw the map (end hack). -Z
  27.    
  28.         reset_hookshot();
  29.        
  30.         if(!intradmap)
  31.         {
  32.             currdmap = wdmap;
  33.             dlevel = DMaps[currdmap].level;
  34.             homescr = currscr = wscr + DMaps[wdmap].xoff;
  35.             init_dmap();
  36.            
  37.             int wrx,wry;
  38.            
  39.             if(get_bit(quest_rules,qr_NOARRIVALPOINT))
  40.             {
  41.                 wrx=tmpscr->warpreturnx[0];
  42.                 wry=tmpscr->warpreturny[0];
  43.             }
  44.             else
  45.             {
  46.                 wrx=tmpscr->warparrivalx;
  47.                 wry=tmpscr->warparrivaly;
  48.             }
  49.            
  50.             if(((wrx>0||wry>0)||(get_bit(quest_rules,qr_WARPSIGNOREARRIVALPOINT)))&&(!get_bit(quest_rules,qr_NOSCROLLCONTINUE))&&(!(tmpscr->flags6&fNOCONTINUEHERE)))
  51.             {
  52.                 if(dlevel)
  53.                 {
  54.                     lastentrance = currscr;
  55.                 }
  56.                 else
  57.                 {
  58.                     lastentrance = DMaps[currdmap].cont + DMaps[currdmap].xoff;
  59.                 }
  60.                
  61.                 lastentrance_dmap = wdmap;
  62.             }
  63.         }
  64.        
  65.         if(DMaps[currdmap].color != c)
  66.         {
  67.             lighting(false, true);
  68.         }
  69.        
  70.         playLevelMusic();
  71.         currcset=DMaps[currdmap].color;
  72.         dointro();
  73.     }
  74.     break;
Add Comment
Please, Sign In to add comment