Advertisement
ZoriaRPG

Hit All Triggers (FFC or Screen Script)

Jan 5th, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.78 KB | None | 0 0
  1. ffc script hitAllTriggers
  2. {
  3.     void run()
  4.     {
  5.         int trigger_pos[528]; //176 types, 176 flags 176 inh flags
  6.         int count = 0; //if count is < 0, then we hit all triggers
  7.         int types[]={-1}; //List al/l types here.
  8.         int flags[]={-1}; //list all placed flags here
  9.         int iflags[]={-1}; //list all placed inh. flas here
  10.         int q = 0; int w = 0; //main loop, secondary loop
  11.         //set-up and store all appropriate types and flags
  12.         for ( q = 0; q < 176; +q )
  13.         {
  14.             //q is always position
  15.             for ( w = SizeOfArray(types)-1; w >= 0; --w )
  16.             {
  17.                 if ( Screen->ComboT[q] == types[w] )
  18.                 {
  19.                     trigger_pos[q] = Screen->ComboT[q];
  20.                     ++count;
  21.                 }
  22.             }
  23.             for ( w = SizeOfArray(flags)-1; w >= 0; --w )
  24.             {
  25.                 if ( Screen->ComboF[q] == flags[w] )
  26.                 {
  27.                     trigger_pos[q+176] = Screen->ComboF[q];
  28.                     ++count;
  29.                 }
  30.             }
  31.             for ( w = SizeOfArray(iflags)-1; w >= 0; --w )
  32.             {
  33.                 if ( Screen->ComboI[q] == iflags[w] )
  34.                 {
  35.                     trigger_pos[q+352] = Screen->ComboF[q];
  36.                     ++count;
  37.                 }
  38.             }
  39.         }
  40.         //loop, checking if all triggers have changed
  41.         while(1)
  42.         {
  43.             for ( q = 0; q < 176; ++q )
  44.             {
  45.                 if ( trigger_pos[q] )
  46.                 {
  47.                     if ( Screen->ComboT[q] == trigger_pos[q] ) continue;
  48.                     else
  49.                     {
  50.                         trigger_pos[q] = 0;
  51.                         --count;
  52.                     }
  53.                 }
  54.                 if ( trigger_pos[q+176] )
  55.                 {
  56.                     if ( Screen->ComboF[q+176] == trigger_pos[q] ) continue;
  57.                     else
  58.                     {
  59.                         trigger_pos[q+176] = 0;
  60.                         --count;
  61.                     }
  62.                 }
  63.                 if ( trigger_pos[q+352] )
  64.                 {
  65.                     if ( Screen->ComboF[q+352] == trigger_pos[q] ) continue;
  66.                     else
  67.                     {
  68.                         trigger_pos[q+352] = 0;
  69.                         --count;
  70.                     }
  71.                 }
  72.             }
  73.             if ( count <= 0 ) break;
  74.             Waitframe();
  75.         }
  76.         //EXECUTE whqatever you want to happen when all triggers are cxleared, here.
  77.            
  78.     }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement