Advertisement
FlipelyFlip

Switch & Variable Modifier

Feb 8th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.62 KB | None | 0 0
  1. module Flip
  2.   def self.switchname(sn)
  3.     switchiname = $data_system.switches[sn]
  4.     if switchiname[/^s\:/]
  5.       $game_switches[sn] = eval($~.post_match)
  6.     end
  7.   end
  8.   def self.varname(vn)
  9.     variname = $data_system.variables[vn]
  10.     if variname[/^s\:/]
  11.       $game_variables[vn] = eval($~.post_match)
  12.     end
  13.   end
  14. end
  15.  
  16. class Scene_Map < Scene_Base
  17.   alias flip_method_update_sv update
  18.   def update
  19.     for sn in 1..($data_system.switches.size - 1)
  20.       Flip.switchname(sn)
  21.     end
  22.     for vn in 1..($data_system.variables.size - 1)
  23.       Flip.varname(vn)
  24.     end
  25.     flip_method_update_sv
  26.   end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement