Advertisement
ZoriaRPG

shield.blobkbomb() for Lut

May 29th, 2019
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.88 KB | None | 0 0
  1. const int I_SHIELD4 = 134;
  2.      
  3. ffc script shields //Dummy script, used for namespace purposes. No need to assign to a slot.
  4. {
  5.         void run(){}
  6.      
  7.         void blockbomb()
  8.         {
  9.             if ( Link->Action != LA_WALKING && Link->Action != LA_NONE ) return; //Abort
  10.             if ( Link->Item[I_SHIELD4] )
  11.             {
  12.                
  13.                 for ( int q = Screen->NumEWeapons(); q > 0; --q )
  14.                 {
  15.                     eweapon e = Screen->LoadEWeapon(q);
  16.                     if ( e->ID == EW_BOMBBLAST || e->ID == EW_SBOMBBLAST )
  17.                     {
  18.                         if ( Link->Dir == DIR_UP )
  19.                         {
  20.                             if ( e->Y < Link->Y+8 ) e->HitYOffset = -32768;
  21.                         }
  22.                         else if ( Link->Dir == DIR_DOWN )
  23.                         {
  24.                             if ( e->Y > Link->Y+8 ) e->HitYOffset = -32768;
  25.                         }
  26.                         else if ( Link->Dir == DIR_LEFT )
  27.                         {
  28.                             if ( e->X < Link->X+8 ) e->HitYOffset = -32768;
  29.                         }
  30.                         else if ( Link->Dir == DIR_RIGHT )
  31.                         {
  32.                             if ( e->X > Link->X+8 ) e->HitYOffset = -32768;
  33.                         }
  34.                     }
  35.                 }
  36.                 for ( int q = Screen->NumLWeapons(); q > 0; --q )
  37.                 {
  38.                     lweapon e = Screen->LoadLWeapon(q);
  39.                     if ( e->ID == LW_BOMBBLAST || e->ID == LW_SBOMBBLAST )
  40.                     {
  41.                         if ( Link->Dir == DIR_UP )
  42.                         {
  43.                             if ( e->Y < Link->Y+8 ) e->HitYOffset = -32768;
  44.                         }
  45.                         else if ( Link->Dir == DIR_DOWN )
  46.                         {
  47.                             if ( e->Y > Link->Y+8 ) e->HitYOffset = -32768;
  48.                         }
  49.                         else if ( Link->Dir == DIR_LEFT )
  50.                         {
  51.                             if ( e->X < Link->X+8 ) e->HitYOffset = -32768;
  52.                         }
  53.                         else if ( Link->Dir == DIR_RIGHT )
  54.                         {
  55.                             if ( e->X > Link->X+8 ) e->HitYOffset = -32768;
  56.                         }
  57.                     }
  58.                 }
  59.             }
  60.         }
  61.     }
  62.      
  63.     global script test
  64.     {
  65.     void run()
  66.         {
  67.             while(1)
  68.             {
  69.                 shields.blockbomb();
  70.                 Waitframe();
  71.             }
  72.         }
  73.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement