All pastes #1655822 Raw Edit

無題

public ruby v1 · immutable
#1655822 ·published 2009-11-04 01:20 UTC
rendered paste body
class Scene_Title  alias _load_database load_database  def change_database_by_note(data_list, table)    data_list.each do |obj|      next unless obj      table.each do |key, var|        if obj.note =~ /#{key}[^0-9]+([0-9]+)/          obj.send("#{var}=", $1.to_i)          p obj, key, $1        end      end    end  end  def load_database    _load_database    skill_table = {      "基本" => :base_damage, "分散" => :variance,      "打撃" => :atk_f, "精神" => :spi_f, "速度" => :speed, "MP" => :mp_cost    }    equip_table = {      "攻撃" => :atk, "防御" => :def, "精神" => :spi, "敏捷" => :agi    }    change_database_by_note($data_skills, skill_table)    change_database_by_note($data_weapons, equip_table)    change_database_by_note($data_armors, equip_table)  endend