#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
# Terrain that events can walk on, but not player
TERRAIN = 4
# Alias method
alias :broken_through_gamecharacter_passable? :passable?
#--------------------------------------------------------------------------
# * Determine if Passable
# x : x-coordinate
# y : y-coordinate
# d : direction (0,2,4,6,8)
# * 0 = Determines if all directions are impassable (for jumping)
#--------------------------------------------------------------------------
def passable?(x, y, d)
# Get new coordinates
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
# If next tile's terrain tag equals set terrain and character is not the player
if $game_map.terrain_tag(new_x, new_y) == TERRAIN and self != $game_player
return true
end
# If current tile's terrain tag equals set terrain and character is not the player
if $game_map.terrain_tag(x, y) == TERRAIN and self != $game_player
return true
end
# Calls the original passable? method
broken_through_gamecharacter_passable?(x, y, d)
end
end