Advertisement
ZoriaRPG

Refill Item (Potion for Any Counter) for 2.55

Jan 13th, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. item script AnyCounterPotion
  2. {
  3.     void run(int ctr, int increment, int delay)
  4.     {
  5.         int clk = 0;
  6.         while ( Game->Counter[ctr] < Game->MCounter[ctr] )
  7.         {
  8.             if ( clk <= 0 )
  9.             {
  10.                 Audio->PlaySound(this->UseSound);
  11.                 Game->Counter[ctr] += Min(increment, (Game->MCounter[ctr]-Game->Counter[ctr]));
  12.                 clk = delay;
  13.             }
  14.             else { --clk; }
  15.             Waitframe();
  16.         }
  17.         Quit();
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement