Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////
- /// Hit all Triggers Within Desired Time ///
- /// v0.3 ///
- /// 5th January, 2019 ///
- /// By: ZoriaRPG ///
- /// For: ywkls ///
- ////////////////////////////////////////////
- ffc script hitAllTriggersTimed
- {
- void run(int window_opportunity)
- {
- int trigger_pos[528]; //176 types, 176 flags 176 inh flags
- int trigger_pos_clone[528]; //176 types, 176 flags 176 inh flags
- int count = 0; //if count is < 0, then we hit all triggers
- int newcount = 0; //if count is < 0, then we hit all triggers
- int types[]={-1}; //List al/l types here.
- int flags[]={-1}; //list all placed flags here
- int iflags[]={-1}; //list all placed inh. flas here
- int q = 0; int w = 0; //main loop, secondary loop
- //set-up and store all appropriate types and flags
- for ( q = 0; q < 176; +q )
- {
- //q is always position
- for ( w = SizeOfArray(types)-1; w >= 0; --w )
- {
- if ( Screen->ComboT[q] == types[w] )
- {
- trigger_pos[q] = Screen->ComboT[q];
- ++count;
- }
- }
- for ( w = SizeOfArray(flags)-1; w >= 0; --w )
- {
- if ( Screen->ComboF[q] == flags[w] )
- {
- trigger_pos[q+176] = Screen->ComboF[q];
- ++count;
- }
- }
- for ( w = SizeOfArray(iflags)-1; w >= 0; --w )
- {
- if ( Screen->ComboI[q] == iflags[w] )
- {
- trigger_pos[q+352] = Screen->ComboF[q];
- ++count;
- }
- }
- }
- for ( q = 0; q < 528; ++q ) trigger_pos_clone[q] = trigger_pos[q]; //to allow a delay and require ll of them
- newcount = count;
- //loop, checking if all triggers have changed
- while(1)
- {
- for ( q = 0; q < 176; ++q )
- {
- if ( trigger_pos_clone[q] )
- {
- if ( Screen->ComboT[q] == trigger_pos_clone[q] ) continue;
- else
- {
- trigger_pos_clone[q] = 0;
- --newcount;
- }
- }
- if ( trigger_pos_clone[q+176] )
- {
- if ( Screen->ComboF[q] == trigger_pos_clone[q+176] ) continue;
- else
- {
- trigger_pos_clone[q+176] = 0;
- --newcount;
- }
- }
- if ( trigger_pos_clone[q+352] )
- {
- if ( Screen->ComboI[q] == trigger_pos_clone[q+352] ) continue;
- else
- {
- trigger_pos_clone[q+352] = 0;
- --newcount;
- }
- }
- }
- if ( newcount <= 0 ) break;
- else
- {
- if ( window_opportunity <= 0 )
- {
- //Didn't do it within the desired time, so reset the conditions.
- window_opportunity = this->InitD[0];
- for ( q = 0; q < 528; ++q )
- {
- trigger_pos_clone[q] = trigger_pos[q]; //to allow a delay and require ll of them
- if ( q < 176 ) Screen->ComboT[q] = trigger_pos[q]; //reset types
- if ( q < 352 )Screen->ComboF[q-176] = trigger_pos[q]; //reset flags;
- Screen->ComboI[q-352] = trigger_pos[q]; //reset iflags
- }
- newcount = count;
- }
- else if ( Link->Action == LA_SCROLLING ) //Reset as Link leaves the screen--I hope.
- {
- Screen->ComboT[q] = trigger_pos[q]; //reset types
- Screen->ComboF[q] = trigger_pos[q+176]; //reset flags;
- Screen->ComboI[q] = trigger_pos[q+352]; //reset iflags
- }
- else --window_opportunity;
- }
- Waitframe();
- }
- //EXECUTE whqatever you want to happen when all triggers are cxleared, here.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement