Advertisement
TroyZ

TroyZ - Timer Control Extended

Dec 15th, 2013
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.87 KB | None | 0 0
  1. # ==============================================================================
  2. # ▼▼▼▼▼▼                 TroyZ - Timer Control Extended                   ▼▼▼▼▼▼
  3. # ==============================================================================
  4. # Script by : Agung Prasetyo(TroyZ)
  5. # Contact me by : - Email agung.endisnear.xyz@gmail.com
  6. #                 - Forum RPGMakerID, username TroyZ
  7. #                 - Handphone 085756289121
  8. # Engine : VXAce
  9. # Level : Easy
  10. # Version : 1.0
  11. # ------------------------------------------------------------------------------
  12. # Change Logs :
  13. # 16 December 2013 : Version 1.0 released
  14. # ------------------------------------------------------------------------------
  15. # How this work :
  16. # This script allows you to control the timer inside the game at extended rate.
  17. # ------------------------------------------------------------------------------
  18. # How to use :
  19. # Place it between material and main. While the timer on the game is active,
  20. # you can control the timer with the following script call :
  21. #
  22. # set_timer(seconds)
  23. #   This will set the timer at the seconds that you've defined before. For
  24. #   example, set_timer(60), means that the timer will be set at 60 seconds.
  25. #
  26. # add_timer_sec(seconds)
  27. #   This will add the said seconds at the timer. For example, add_timer_sec(5),
  28. #   means that the total seconds at the timer will be added by 5 seconds.
  29. #
  30. # min_timer_sec(seconds)
  31. #   This will subtract the said seconds at the timer. For example, min_timer_sec(5),
  32. #   means that the total seconds at the timer will be reduced by 5 seconds.
  33. #
  34. # add_var_timer_sec(var)
  35. #   This will add the said variable's value as seconds at the timer.
  36. #   For example, variable 1 has the value of 3, and then you use
  37. #   add_var_timer_sec(1) to get the value at variable 1 and use the value to
  38. #   add the total seconds at the timer. So, the seconds at the timer will be
  39. #   added by 3 seconds.
  40. #
  41. # min__var_timer_sec(var)
  42. #   This will subtract the said variable's value as seconds at the timer.
  43. #   For example, variable 1 has the value of 3, and then you use
  44. #   min_var_timer_sec(1) to get the value at variable 1 and use the value to
  45. #   reduce the total seconds at the timer. So, the seconds at the timer will be
  46. #   reduced by 3 seconds.
  47. # ------------------------------------------------------------------------------
  48. # Compatibility issues :
  49. # None yet. If you found some, let me know, and bug fixes will come out soon.
  50. # ------------------------------------------------------------------------------
  51. # Who to credit :
  52. # - Allah swt. : For the chance of living that he has given to me.
  53. # - Nabi Muhammad saw. : As a leader and messenger and prophet of Muslim.
  54. #                        I'm proud to be your follower. :)
  55. # - Agung Prasetyo(TroyZ) : Thats me, of course, the ones that made this script. :P
  56. # ------------------------------------------------------------------------------
  57. # License :
  58. # - Free Game : Just credit those names above.
  59. # - Commercial Game : Same as free game's license.
  60. # ------------------------------------------------------------------------------
  61. $imported = {} if $imported.nil?
  62. $imported[:TroyZ_TimerControlExtended] = true
  63. # ------------------------------------------------------------------------------
  64. # You shall not pass
  65. # ------------------------------------------------------------------------------
  66. class Game_Timer
  67.   attr_accessor :count
  68. end
  69.  
  70. class Game_Interpreter
  71.   def set_timer(seconds)
  72.     $game_timer.count = seconds * 60
  73.   end
  74.  
  75.   def add_timer_sec(seconds)
  76.     $game_timer.count += (seconds * 60)
  77.   end
  78.  
  79.   def min_timer_sec(seconds)
  80.     $game_timer.count -= (seconds * 60)
  81.   end
  82.  
  83.   def add_var_timer_sec(var)
  84.     $game_timer.count += ($game_variables[var] * 60)
  85.   end
  86.  
  87.   def min_var_timer_sec(var)
  88.     $game_timer.count -= ($game_variables[var] * 60)
  89.   end
  90. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement