class Game_Event < Game_Character
attr_writer :hp
#--------------------------------------------------------------------------
# ● 对象初始化
#--------------------------------------------------------------------------
alias rb_initialize_160525 initialize
def initialize(*arg)
rb_initialize_160525(*arg)
@hp = 0
end
#--------------------------------------------------------------------------
# ● 取得名字
#--------------------------------------------------------------------------
def get_name
return @event.name
end
def hp
return @hp || 0
end
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# ● 设置事件
#--------------------------------------------------------------------------
alias rb_setup_events_160525 setup_events
def setup_events
rb_setup_events_160525
for i in @map.events.keys
@events[i].hp = $1.to_i if @events[i].get_name =~ /<HP\s*=\s*(\d+)\s*>/
end
end
end