Super simple script translation (vx ace to rmxp)

I have a scriptlet that allows to add and subtract time from an active timer. It works, but it's for vx ace and now i need it for rmxp. It's only 33 lines, so i hope someone wants to take a look at it. Would help me so much!

  1. #==============================================================================
  2. # ** Game_Timer
  3. #------------------------------------------------------------------------------
  4. #  Some more methods
  5. #==============================================================================
  6.  
  7. class Game_Timer
  8.  
  9.   alias timer_plus_update update
  10.   def update
  11.     if !@pause
  12.       timer_plus_update
  13.     end
  14.   end
  15.  
  16.   # add more time, in seconds
  17.   def add_time(count)
  18.     @count += count * Graphics.frame_rate
  19.   end
  20.  
  21.   # subtract time, in seconds
  22.   def lose_time(count)
  23.     @count = [@count - (count * Graphics.frame_rate), 0].max
  24.   end
  25.  
  26.   def pause
  27.     @pause = true
  28.   end
  29.  
  30.   def resume
  31.     @pause = false
  32.   end
  33. end
Expand to see the code.


There are the script calls:

  1. $game_timer.add_time(20)  #add 20 seconds
  2. $game_timer.lose_time(15) #lose 15 seconds
  3. $game_timer.pause         #pause countdown
  4. $game_timer.resume        #resume countdown
Expand to see the code.
After some more trying, i finally got it myself:

  1.    #==============================================================================
  2.     # ** Game_Timer
  3.     #------------------------------------------------------------------------------
  4.     #  Some more methods
  5.     #==============================================================================
  6.  
  7. class Game_System
  8.  
  9.   alias timer_plus_update update
  10.   def update
  11.     if !@pause
  12.       timer_plus_update
  13.     end
  14.   end
  15.  
  16.   # add more time, in seconds
  17.   def add_time(count)
  18.     @timer += count * Graphics.frame_rate
  19.   end
  20.  
  21.   # subtract time, in seconds
  22.   def lose_time(count)
  23.     @timer = [@timer - (count * Graphics.frame_rate), 0].max
  24.   end
  25.  
  26.   def pause
  27.     @pause = true
  28.   end
  29.  
  30.   def resume
  31.     @pause = false
  32.   end
  33. end
Expand to see the code.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=78455