事件文本的全局替换
# @taroxd metadata 1.0
# @id sub_event_text
# @display 事件文本的全局替换
if false

pattern = {
}

re = Regexp.union(pattern.keys)
change_text = -> text { text.gsub!(re, pattern) }

change_page = lambda do |page|
  return unless page
  page.list.each do |command|
    case command.code
    when 401, 405  # 显示文字 / 滚动文字
      change_text.(command.parameters[0])
    when 102  # 显示选项
      command.parameters[0].each(&change_text)
    end
  end
end

change_event = lambda do |event|
  return unless event
  event.pages.each(&change_page)
end

change_each_in_file = lambda do |filename, proc|
  save_data(load_data(filename).each(&proc), filename)
end

# 替换地图上的事件
load_data('Data/MapInfos.rvdata2').each_key do |map_id|
  filename = sprintf('Data/Map%03d.rvdata2', map_id)
  map = load_data(filename)
  map.events.each_value(&change_event)
  save_data(map, filename)
end

change_each_in_file.('Data/CommonEvents.rvdata2', change_page) # 替换公共事件
change_each_in_file.('Data/Troops.rvdata2', change_event) # 替换敌群中的事件

msgbox '全局替换成功!请重启编辑器以查看效果。'
exit

end # if false
静止行走图
# @taroxd metadata 1.0
# @id static_character
# @display 静止行走图
# @require taroxd_core
# @help 
#    图片文件名以 $$ 开头时,该图片将被视为一个唯一朝向的人物。

# 文件名满足的条件
Taroxd::StaticCharacter = -> name { name.start_with?('$$') }

class Sprite_Character < Sprite_Base

  def static?
    Taroxd::StaticCharacter.call(@character_name)
  end

  def_chain :set_character_bitmap do |old|
    return old.call unless static?
    self.bitmap = Cache.character(@character_name)
    self.ox = bitmap.width / 2
    self.oy = bitmap.height
  end

  def_unless :update_src_rect, :static?
end
跳过标题画面
# @taroxd metadata 1.0
# @display 跳过标题画面
# @help 测试游戏时跳过标题画面
# @id skip_title
module Taroxd
  SkipTitle = $TEST && !$BTEST
end

def SceneManager.first_scene_class
  DataManager.setup_new_game
  $game_map.autoplay
  Scene_Map
end if Taroxd::SkipTitle