# By Lanza Schneider
# 2020.09.04
# 在你想要穿过的事件中添加一条 crushable 注释即可
class Game_Event
def crushable?
@crushable
end
alias :setup_page_2020090400 :setup_page
def setup_page(*args)
setup_page_2020090400 *args
@crushable = false
@page.list.each do |command|
if command.code == 108 && command.parameters[0] == 'crushable'
@crushable = true
break
end
end
end
end
class Game_Player
alias :update_2020090400 :update
def update *args
@crushed = false
update_2020090400 *args
@crush_count = @crushed ? @crush_count + 1 : 0
end
def collide_with_events?(x, y)
$game_map.events_xy_nt(x, y).any? do |event|
result = event.normal_priority? || self.is_a?(Game_Event)
if result && event.crushable?
@crushed = true
result = false if @crush_count > 30
end
result
end
end
end