Advertisement
LiTTleDRAgo

[RGSS] Terrain Tag Changer

Aug 8th, 2012
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.21 KB | None | 0 0
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  2. # Terrain Tag Changer
  3. # Version: 1.00
  4. # Author : LiTTleDRAgo
  5. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  6. #
  7. #  How to Use :
  8. #
  9. #  Use Script Call :
  10. #     change_terrain( A , B )
  11. #   A = terrain tag you want to change
  12. #   B = result terrain tag
  13. #
  14. #==============================================================================
  15. # ** Interpreter
  16. #------------------------------------------------------------------------------
  17. #  This interpreter runs event commands. This class is used within the
  18. #  Game_System class and the Game_Event class.
  19. #==============================================================================
  20. class Interpreter
  21.   def change_terrain(first=0,target=0)
  22.     @parameter = []
  23.     (0...$game_map.width).each {|x|
  24.       (0...$game_map.height).each {|y|
  25.         [2, 1, 0].each {|i|
  26.            id = $game_map.data[x, y, i]
  27.            @parameter << id if $game_map.terrain_tags[id] == first
  28.     }}}
  29.     @parameter.each {|i|  $game_map.terrain_tags[i] = target  }
  30.   end
  31. end
  32. eval ("class Game_Map;  attr_accessor :terrain_tags end")
  33.  
  34. $drg_change_terrain = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement