| 
 
| 赞 | 274 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 153 |  
| 经验 | 515 |  
| 最后登录 | 2025-10-8 |  
| 在线时间 | 2108 小时 |  
 Lv4.逐梦者 
	梦石1 星屑14293 在线时间2108 小时注册时间2017-9-28帖子663 | 
| 这样?
 
 复制代码=begin
加载区域地图(布置房间)
by Fomar0153
Version 1.0
----------------------
说明
----------------------
可以使用开关将当前地图的某些区域替换为其他地图中相同区域的部分 
----------------------
使用方法
----------------------
请在群文件搜索“加载区域地图使用方法.docx”
----------------------
Known bugs
----------------------
None
=end
class Game_Map
  #--------------------------------------------------------------------------
  # * Aliases Setup
  #--------------------------------------------------------------------------
  alias regionmapsetup setup
  def setup(map_id)
    regionmapsetup(map_id)
    @regionmapdata = nil
  end
  #--------------------------------------------------------------------------
  # * Aliases Refresh
  #--------------------------------------------------------------------------
  alias regionmaprefresh refresh
  def refresh
    regionmaprefresh
    @regionmapdata = nil
  end
  #--------------------------------------------------------------------------
  # * Rewrites tile_id
  #--------------------------------------------------------------------------
  def tile_id(x, y, z)
    self.data[x, y, z] || 0
  end
  #--------------------------------------------------------------------------
  # * Rewrites data
  #--------------------------------------------------------------------------
  def data
    return @regionmapdata if @regionmapdata
    data = @map.data.clone
    if @map.note =~ /<区域地图 (.*)>/i
      regions = $1.split(";")
      for region in regions
        regiondata = region.split(",")
        if $game_switches[regiondata[2].to_i]
          tmpdata = load_data(sprintf("Data/Map%03d.rvdata2", regiondata[1].to_i)).data
          for x in [email protected]
            for y in [email protected]
              if region_id(x,y) == regiondata[0].to_i
                data[x,y,0] = tmpdata[x,y,0]
                data[x,y,1] = tmpdata[x,y,1]
                data[x,y,2] = tmpdata[x,y,2]
                # 阴影和区域存储在同一变量 
                # 如果你无法复制区域,请在下一行结束添加  % 256  
                data[x,y,3] = tmpdata[x,y,3]
              end
            end
          end
        end
      end
    end
    @regionmapdata = data
    return @regionmapdata
  end
end
 | 
 |