ZoriaRPG

Spike Room FFC for NewJourneysFire

May 16th, 2017
119
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// Custom item Trigger for Spike Rooms
  2. /// By: ZoriaRPG
  3. /// Requested by NJF
  4. /// 16th May, 2017
  5. /// v0.2
  6.  
  7. //D0: The lweapon type to use to trigger. Use the lweapon constants in std.zh for this value.
  8. //D1: The flag to use. 100 is Script_5.
  9. //D2: The combo to change all flagged tiles into. If set to '0' , all flagged combos will advance by one,
  10. //  as combo->Next combos.
  11. //D3: The duration of your combo animation in cycle, for the changed combos.
  12. //  If they do not revert on a timer, set this to 0.
  13. //D4: if this is set to 1, the combos will also be changed when the timer expires, not merely the flags.
  14. //D5: Sound to play when triggered.`
  15.  
  16. ffc script changetiles{
  17.     void run(int item_trigger, int flag, int change_into, int revert_time, int change_combos, int sfx) {
  18.         lweapon l; int q[2]; bool triggered; int locs[176]; int cmbs[176];
  19.         while(true){
  20.             if ( !triggered ) {
  21.                 q[0] = Screen->NumLWeapons();
  22.                 for ( ; q[0] > 0; q[0]-- ) {
  23.                     l = Screen->LoadLWeapon(q[0]);
  24.                     if ( l->ID == item_trigger ) {
  25.                         if ( Collision(l,this) ) {
  26.                             if ( sfx > 0 ) Gsame->PlaySound(sfx);
  27.                             for ( q[1] = 0; q[1] < 176; q[1]++ ) {
  28.                                 if ( change_combos ) { cmbs[q[1]] = Screen->ComboD[q[1]]; }
  29.                                 if ( Screen->ComboF[q[1]] == flag ) {
  30.                                     if ( change_into > 0 ) Screen->ComboD[q[1]] = change_into;
  31.                                     else Screen->ComboD[q[1]]++;
  32.                                    
  33.                                     locs[q[1]] = Screen->ComboF[q[1]]; //Save the flag.
  34.                                     Screen->ComboF[q[1]] = 0;
  35.                                    
  36.                                 }
  37.                             }
  38.                             triggered = true;
  39.                         }
  40.                     }
  41.                 }
  42.             }
  43.             if ( revert_time > 0 ) {
  44.                 if ( triggered ) {
  45.                     int time_revert = revert_time;
  46.                     while(time_revert--) {
  47.                         Waitframe();
  48.                     }
  49.                     //Revert the flags
  50.                     for ( q[1] = 0; q[1] < 176; q[1]++ ) {
  51.                         if ( locs[q[1]] > 0 ) {
  52.                             Screen->ComboF[q[1]] = locs[q[1]];
  53.                             locs[q[1]] = 0;
  54.                         }
  55.                         if ( change_combos ) { Screen->ComboD[q[1]] = cmbs[q[1]]; }
  56.                     }
  57.                     triggered = false;
  58.                    
  59.                 }
  60.             }
  61.             Waitframe();
  62.         }
  63.     }
  64. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×