实现【如果玩家位置上事件名含“door” 则仅禁止向下通行】的功能
class Game_Event attr_reader :event end class Game_Player alias cld99_aliased_passable? passable? def passable?(x, y, d) has_door = $game_map.events_xy(x, y).find { |e| e.event.name.include?('door') } return false if d == 2 && has_door cld99_aliased_passable?(x, y, d) end end
class Game_Event
attr_reader :event
end
class Game_Player
alias cld99_aliased_passable? passable?
def passable?(x, y, d)
has_door = $game_map.events_xy(x, y).find { |e| e.event.name.include?('door') }
return false if d == 2 && has_door
cld99_aliased_passable?(x, y, d)
end
end
|