# 使用方法,添加事件,在事件名里添加 ol
# y相同时,由事件页那里的高度来决定遮挡。
class Game_Event < Game_Character
def check_pos_of_player
if @page
origin_priority = @page.priority_type
else
origin_priority = 1
end
if !@overlay_set
return origin_priority
end
dy = $game_player.real_y - self.real_y
if dy > 0 # 人挡住了事件
return 0
elsif dy < 0 # 事件挡住了人
return 2
end
return origin_priority
end
alias overlay_back_setup_page_settings setup_page_settings
def setup_page_settings
overlay_back_setup_page_settings
if self.instance_variable_get(:@event).name =~ /ol/
#p self.instance_variable_get(:@event).name
@overlay_set = true
else
@overlay_set = false
end
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
alias overlay_back_update update
def update
@priority_type = check_pos_of_player
overlay_back_update
end
end