TheoAllen

Theo - Auto-Toggle Switches (ENG)

Oct 4th, 2013
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Auto-Toggle Switches
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (English Documentation)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_AutoSwitch] = true
  8. # =============================================================================
  9. # CHANGE LOGS:
  10. # -----------------------------------------------------------------------------
  11. # 2013.08.22 - Finished script
  12. # =============================================================================
  13. =begin
  14.  
  15. Introduction :
  16. This script make the game switches will be switched automatically depends on
  17. script condition eval
  18.  
  19. How to use :
  20. Put this script below material but above main
  21. Edit the configuration
  22.  
  23. Terms of use :
  24. Credit me, TheoAllen. You are free to edit this script by your own. As long
  25. as you don't claim it yours. For commercial purpose, don't forget to give me
  26. a free copy of the game.
  27.  
  28. =end
  29. # =============================================================================
  30. # Configuration :
  31. # =============================================================================
  32. module THEO
  33. module Switch
  34.  
  35. List = {
  36. # ID => "Script Eval"
  37. 5 => "$game_system.playtime > 10",
  38. }
  39.  
  40. end
  41. end
  42. # =============================================================================
  43. # End of configuration
  44. # =============================================================================
  45. class Game_Switches
  46.  
  47. def update
  48. THEO::Switch::List.each do |id,script|
  49. cond = eval(script)
  50. self[id] = cond if self[id] != cond
  51. end
  52. end
  53.  
  54. end
  55.  
  56. class Scene_Base
  57.  
  58. alias theo_auto_toggle_switches_update update
  59. def update
  60. theo_auto_toggle_switches_update
  61. $game_switches.update
  62. end
  63.  
  64. end
Advertisement
Add Comment
Please, Sign In to add comment