Advertisement
ZoriaRPG

FFC_Whistle_Secret_v0.2.zs

Jul 2nd, 2018
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.93 KB | None | 0 0
  1. //////////////////////////////
  2. /// Simple Whistle Trigger ///
  3. /// v0.3 - 3rd July, 2018  ///
  4. /// By: ZoriaRPG           ///
  5. //////////////////////////////
  6.  
  7. const int CF_CUSTOM_WHISTLE = 0; // If non-zero, the script will affect combos
  8.                  // with this flag. Otherwise, it will use CF_SCRIPT5.
  9.  
  10. //D0: The number of times the whistle must be used to trigger.
  11. //D1: Special combo flag. If this is <= 0, then the script will try
  12. //  to use 'CF_CUSTOM_WHISTLE'. If that is also <= 0, then the script defaults to CF_SCRIPT5.
  13. //D2: The secret sound to play. If set to 0, the script defaults to SFX_SECRET.
  14.  
  15. ffc script whistlesecret
  16. {
  17.     void run(int count, int cf, int sfx)
  18.     {
  19.         lweapon w;
  20.         while(count > 0)
  21.         {
  22.             for ( int q = Screen->NumLWeapons(); q > 0; --q )
  23.             {
  24.                 w = Screen->LoadLWeapon(q);
  25.                 if ( w->ID == LW_WHISTLE )
  26.                 {
  27.                     if ( w->HitXOffset > -32768 )
  28.                     {
  29.                         --count; Game->PlaySound(Cond(sfx > 0, sfx, SFX_SECRET));
  30.                     }
  31.                     else
  32.                     {
  33.                         w->HitXOffset = -32768;
  34.                         Remove(w);
  35.                     }
  36.                 }
  37.             }
  38.             Waitframe();
  39.         }
  40.         //Run secret here
  41.         //e.g.
  42.         for ( int q = 0; q < 176; ++q )
  43.         {
  44.             if ( Screen->ComboF[q] == Cond(cf > 0, cf, Cond(CF_CUSTOM_WHISTLE > 0, CF_CUSTOM_WHISTLE, CF_SCRIPT5)) )
  45.             {
  46.                 ++Screen->ComboD[q];
  47.                 Screen->ComboF[q] = 0;
  48.             }
  49.             else if ( Screen->ComboI[q] == Cond(cf > 0, cf, Cond(CF_CUSTOM_WHISTLE > 0, CF_CUSTOM_WHISTLE, CF_SCRIPT5)) )
  50.             {
  51.                 ++Screen->ComboD[q];
  52.             }
  53.         }
  54.                
  55.     }
  56. }//////////////////////////////
  57. /// Simple Whistle Trigger ///
  58. /// v0.2 - 2nd July, 2018  ///
  59. /// By: ZoriaRPG           ///
  60. //////////////////////////////
  61.  
  62. const int CF_CUSTOM_WHISTLE = 0; // If non-zero, the script will affect combos
  63.                  // with this flag. Otherwise, it will use CF_SCRIPT5.
  64.  
  65. //D0: The number of times the whistle must be used to trigger.
  66. //D1: Special combo flag. If this is <= 0, then the script will try
  67. //  to use 'CF_CUSTOM_WHISTLE'. If that is also <= 0, then the script defaults to CF_SCRIPT5.
  68. //D2: The secret sound to play. If set to 0, the script defaults to SFX_SECRET.
  69.  
  70. ffc script whistlesecret
  71. {
  72.     void run(int count, int cf, int sfx)
  73.     {
  74.         lweapon w;
  75.         while(count > 0)
  76.         {
  77.             for ( int q = Screen->NumLWeapons(); q > 0; --q )
  78.             {
  79.                 w = Screen->LoadLWeapon(q);
  80.                 if ( w->ID == LW_WHISTLE )
  81.                 {
  82.                     if ( w->HitXOffset > -32768 )
  83.                     {
  84.                         --count; Game->PlaySound(Cond(sfx > 0, sfx, SFX_SECRET));
  85.                     }
  86.                     else
  87.                     {
  88.                         w->HitXOffset = -32768;
  89.                         Remove(w);
  90.                     }
  91.                 }
  92.             }
  93.             Waitframe();
  94.         }
  95.         //Run secret here
  96.         //e.g.
  97.         for ( int q = 0; q < 176; ++q )
  98.         {
  99.             if ( Screen->ComboF[q] == Cond(cf > 0, cf, Cond(CF_CUSTOM_WHISTLE > 0, CF_CUSTOM_WHISTLE, CF_SCRIPT5)) )
  100.             {
  101.                 ++Screen->ComboD[q];
  102.                 Screen->ComboF[q] = 0;
  103.             }
  104.             else if ( Screen->ComboI[q] == Cond(cf > 0, cf, Cond(CF_CUSTOM_WHISTLE > 0, CF_CUSTOM_WHISTLE, CF_SCRIPT5)) )
  105.             {
  106.                 ++Screen->ComboD[q];
  107.             }
  108.         }
  109.                
  110.     }
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement