What does this script do? :3
Hey all!
I stumbled upon project which contained a script I made who knows how long ago.
I admit I had completely forgotten about it.
So who can guess what it does? It's obviously for XP since it does something with terrain tags, but what?
I may update this post with the answer some time later :3
*hugs*
class Game_Character attr_accessor :terrain_tag alias_method(:zeriab_terrain_tag_passable, :passable?) def passable?(x, y, d) new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0) new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0) if terrain_tag if (terrain_tag > 0 && $game_map.terrain_tag(new_x,new_y) != terrain_tag) || (terrain_tag < 0 && $game_map.terrain_tag(new_x,new_y) == -terrain_tag) return false end end return zeriab_terrain_tag_passable(x, y, d) end end class Game_Event < Game_Character alias_method(:zeriab_terrain_tag_init, :initialize) def initialize(map_id, event) zeriab_terrain_tag_init(map_id, event) if event.name.include?('<t>') self.terrain_tag = $game_map.terrain_tag(x, y) elsif /<t=(\d+)>/ =~ event.name self.terrain_tag = $1.to_i elsif /<t=-(\d+)>/ =~ event.name self.terrain_tag = -($1.to_i) end end end
Sign in to follow this
Followers
0
2 Comments
Recommended Comments
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now