查看: 1027|回复: 2

[已经过期] 有没有挖墙这样的脚本?

[复制链接]
梦石
0
星屑
2029
在线时间
658 小时
注册时间
2014-2-15
回帖
60
发表于 2017-12-16 20:17:01 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 资深萝莉控 于 2017-12-17 11:58 编辑

[pre lang="ruby"]#==============================================================================
# ■ DungeonRect
#==============================================================================
class DungeonRect
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :room                     # 部屋
  attr_accessor :lx                       # 矩形の左上x座標
  attr_accessor :ly                       # 矩形の左上y座標
  attr_accessor :hx                       # 矩形の右上x座標
  attr_accessor :hy                       # 矩形の右上y座標
  attr_accessor :done_split_h             # 横分割完了フラグ
  attr_accessor :done_split_v             # 縦分割完了フラグ
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(lx, ly, hx, hy)   
    @lx = lx
    @ly = ly
    @hx = hx
    @hy = hy
    @done_split_h = false
    @done_split_v = false
  end
  #--------------------------------------------------------------------------
  # ● 部屋の作成
  #--------------------------------------------------------------------------
  def add_room(lx, ly, hx, hy)
    @room = DungeonRoom.new(lx, ly, hx, hy)
  end
end

#==============================================================================
# ■ DungeonRoom
#==============================================================================
class DungeonRoom
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :lx                       # 部屋の左上x座標
  attr_accessor :ly                       # 部屋の左上y座標
  attr_accessor :hx                       # 部屋の右上x座標
  attr_accessor :hy                       # 部屋の右上y座標
  attr_accessor :discover                 # 部屋に入ったことがあるかどうか
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(lx, ly, hx, hy)
    @lx = lx
    @ly = ly
    @hx = hx
    @hy = hy
    @discover = false
  end
end

#==============================================================================
# ■ Game_Dungeon
#==============================================================================
class Game_Dungeon
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :rects                    # 区画情報
  attr_reader   :room_table               # 部屋&踏破情報テーブル
  attr_reader   :curse_rate               # 装備以外の道具が呪われている確率
  attr_reader   :sleep_rate               # モンスターが眠っている確率
  attr_reader   :drop_rate                # モンスターの共通アイテムドロップ率
  attr_reader   :floor_w                  # 余白を含まないフロアの幅
  attr_reader   :floor_h                  # 余白を含まないフロアの高さ
  attr_reader   :floor_bgm                # フロアのBGM
  attr_reader   :floor_bgs                # フロアのBGS
  attr_reader   :floor_house_bgm          # フロアのモンスターハウスBGM
  attr_reader   :floor_shop_bgm           # フロアのお店BGM
  attr_reader   :floor_thief_bgm          # フロアの泥棒BGM
  attr_reader   :floor_shop               # お店の部屋ID
  attr_reader   :floor_house              # モンスターハウスの部屋ID
  attr_reader   :floor_shop_guard         # 番犬ID
  #--------------------------------------------------------------------------
  # ○ ランダムダンジョンの生成
  #--------------------------------------------------------------------------
  def create_dungeon
    set_dungeon_params(@floor_id)
    @map = RPG::Map.new(@floor_w + 16, @floor_h + 12)
    if @many_room   # 部屋数最大フロアなら部屋サイズを計算
      n = @floor_w / @rect_min
      @many_rect_w = @rect_min + (@floor_w % @rect_min) / n
      n = @floor_h / @rect_min
      @many_rect_h = @rect_min + (@floor_h % @rect_min) / n
    end
    for x in 0...@map.width
      for y in 0...@map.height
        @map.data[x, y, 0] = @tile[2]
      end
    end
    @rects = []
    @couples = []
    @grounds = []
    @room_table = Table.new(@map.width, @map.height, 2)  # 部屋判定テーブルの作成
    @rects.push(DungeonRect.new(8, 6, @map.width - 9, @map.height - 7))
    split_rect(@rects[0])
    i = 0
    for rect in @rects        # 部屋の生成
      if @many_room           # 部屋数が最大になるようにする
        w = @many_rect_w - @room_margin * 2 - 1
        h = @many_rect_h - @room_margin * 2 - 1
        x = rect.lx + @room_margin
        y = rect.ly + @room_margin
      else
        if rand(100) < @max_room_rate or @rects.size == 1 # 最高サイズ
          w = rect.hx - rect.lx - @room_margin * 2
          h = rect.hy - rect.ly - @room_margin * 2
        else                                              # ランダム
          w = rand((rect.hx - rect.lx - @room_margin * 2 + 1) - @room_min) + @room_min
          h = rand((rect.hy - rect.ly - @room_margin * 2 + 1) - @room_min) + @room_min
        end
        x = rand(rect.hx - rect.lx - w - @room_margin * 2 + 1) + (rect.lx + @room_margin)
        y = rand(rect.hy - rect.ly - h - @room_margin * 2 + 1) + (rect.ly + @room_margin)
      end
      rect.add_room(x, y, x + w, y + h)
      set_ground(x, y, x + w, y + h)
    end
    couple_more     # 分割線を増やす
    for couple in @couples    # 通路の生成
      if couple[0] == 0     # 横分割の場合
        x1 = couple[1].hx
        y1 = rand(couple[1].room.hy - (couple[1].room.ly + 1)) + (couple[1].room.ly + 1)
        x2 = couple[2].lx
        y2 = rand(couple[2].room.hy - (couple[2].room.ly + 1)) + (couple[2].room.ly + 1)
        next if @map.data[x1 - 1, y1 - 1, 0] == @tile[0]
        next if @map.data[x1 - 1, y1 + 1, 0] == @tile[0]
        next if @map.data[x2 + 1, y2 - 1, 0] == @tile[0]
        next if @map.data[x2 + 1, y2 + 1, 0] == @tile[0]
        set_ground(x1, y1, x2, y2)
        set_ground(couple[1].room.hx, y1, x1, y1)
        set_ground(couple[2].room.lx, y2, x2, y2)
      else                  # 縦分割の場合
        x1 = rand(couple[1].room.hx - (couple[1].room.lx + 1)) + (couple[1].room.lx + 1)
        y1 = couple[1].hy
        x2 = rand(couple[2].room.hx - (couple[2].room.lx + 1)) + (couple[2].room.lx + 1)
        y2 = couple[2].ly
        next if @map.data[x1 - 1, y1 - 1, 0] == @tile[0]
        next if @map.data[x1 + 1, y1 - 1, 0] == @tile[0]
        next if @map.data[x2 - 1, y2 + 1, 0] == @tile[0]
        next if @map.data[x2 + 1, y2 + 1, 0] == @tile[0]
        set_ground(x1, y1, x2, y2)
        set_ground(x1, couple[1].room.hy, x1, y1)
        set_ground(x2, couple[2].room.ly, x2, y2)
      end
    end
    set_wall    # 壁のセット
    for rect in @rects
      for x in rect.room.lx..rect.room.hx
        for y in rect.room.ly..rect.room.hy
          @room_table[x, y, 0] = @room_table[x, y, 0] | 2 # 部屋フラグをセット
          @map.data[x, y, 0] = @tile[1] if rand(32) == 0  # 別タイルを混ぜる
        end
      end
    end
    for i in 0...@rects.size
      rect = @rects
      for x in rect.room.lx - 1..rect.room.hx + 1
        for y in rect.room.ly - 1..rect.room.hy + 1
          @room_table[x, y, 1] = i + 1    # 部屋IDをセット
        end
      end
    end
    set_shop    # お店の作成
    set_house   # モンスターハウスの作成
  end
  #--------------------------------------------------------------------------
  # ○ ダンジョンパラメータのセット
  #--------------------------------------------------------------------------
  def set_dungeon_params(floor_id)
    set_dungeon_params(DUNG::DG_BASE[floor_id]) if DUNG::DG_BASE[floor_id] != nil
    if DUNG::DG_SIZE[floor_id] != nil
      @floor_w = DUNG::DG_SIZE[floor_id][0]
      @floor_h = DUNG::DG_SIZE[floor_id][1]
    end
    @room_min = DUNG::DG_ROOM_MIN[floor_id] if DUNG::DG_ROOM_MIN[floor_id] != nil
    @room_margin = [DUNG::DG_ROOM_MARGIN[floor_id], 2].max if DUNG::DG_ROOM_MARGIN[floor_id] != nil
    @rect_min = @room_min + @room_margin * 2
    @nosplit_rate = DUNG::DG_NOSPLIT_RATE[floor_id] if DUNG::DG_NOSPLIT_RATE[floor_id] != nil
    @add_couple_rate = DUNG::DG_ADD_COUPLE_RATE[floor_id] if DUNG::DG_ADD_COUPLE_RATE[floor_id] != nil
    @many_room = (rand(100) < DUNG::DG_MANY_ROOM_RATE[floor_id]) if DUNG::DG_MANY_ROOM_RATE[floor_id] != nil
    @max_room_rate = DUNG::DG_MAX_ROOM_RATE[floor_id] if DUNG::DG_MAX_ROOM_RATE[floor_id] != nil
    if DUNG::DG_TILE[floor_id] != nil
      @tile = [ DUNG::DG_TILE[floor_id][0],
                DUNG::DG_TILE[floor_id][0] + 64 - (DUNG::DG_TILE[floor_id][0] - 1552) / 16 * 8,
                DUNG::DG_TILE[floor_id][1], DUNG::DG_TILE[floor_id][1] + 394,
                DUNG::DG_TILE[floor_id][2], DUNG::DG_TILE[floor_id][3] ]
    end
    @curse_rate = DUNG::DG_CURSE_RATE[floor_id] if DUNG::DG_CURSE_RATE[floor_id] != nil
    @sleep_rate = DUNG::DG_SLEEP_RATE[floor_id] if DUNG::DG_SLEEP_RATE[floor_id] != nil
    @drop_rate = DUNG::DG_DROP_RATE[floor_id] if DUNG::DG_DROP_RATE[floor_id] != nil
    @floor_bgm = DUNG::DG_BGM[floor_id] if DUNG::DG_BGM[floor_id] != nil
   
   # p "bbb"
   
    @floor_bgs = DUNG::DG_BGS[floor_id] if DUNG::DG_BGS[floor_id] != nil
    @floor_house_bgm = DUNG::DG_HOUSE_BGM[floor_id] if DUNG::DG_HOUSE_BGM[floor_id] != nil
    @floor_shop_bgm = DUNG::DG_SHOP_BGM[floor_id] if DUNG::DG_SHOP_BGM[floor_id] != nil
    @floor_thief_bgm = DUNG::DG_THIEF_BGM[floor_id] if DUNG::DG_THIEF_BGM[floor_id] != nil
    @floor_weather = DUNG::DG_WEATHER[floor_id] if DUNG::DG_WEATHER[floor_id] != nil
    @floor_monster_num = DUNG::DG_MONSTER_NUM[floor_id] if DUNG::DG_MONSTER_NUM[floor_id] != nil
    @floor_monster_max = DUNG::DG_MONSTER_MAX[floor_id] if DUNG::DG_MONSTER_MAX[floor_id] != nil

   
   # p floor_id
   
    @floor_monster_table = DUNG::DG_MONSTER_TABLE[floor_id] if DUNG::DG_MONSTER_TABLE[floor_id] != nil
    @floor_item_max = DUNG::DG_ITEM_MAX[floor_id] if DUNG::DG_ITEM_MAX[floor_id] != nil
    @floor_item_table = DUNG::DG_ITEM_TABLE[floor_id] if DUNG::DG_ITEM_TABLE[floor_id] != nil
    @floor_gold_rate = DUNG::DG_GOLD_RATE[floor_id] if DUNG::DG_GOLD_RATE[floor_id] != nil
    @floor_trap_max = DUNG::DG_TRAP_MAX[floor_id] if DUNG::DG_TRAP_MAX[floor_id] != nil
    @floor_trap_num = DUNG::DG_TRAP_NUM[floor_id] if DUNG::DG_TRAP_NUM[floor_id] != nil
    @floor_trap_table = DUNG::DG_TRAP_TABLE[floor_id] if DUNG::DG_TRAP_TABLE[floor_id] != nil
    @floor_repop_turn = DUNG::DG_REPOP_TURN[floor_id] if DUNG::DG_REPOP_TURN[floor_id] != nil
    @floor_repop_rate = DUNG::DG_REPOP_RATE[floor_id] if DUNG::DG_REPOP_RATE[floor_id] != nil
    @floor_shop_rate = DUNG::DG_SHOP_RATE[floor_id] if DUNG::DG_SHOP_RATE[floor_id] != nil
    @floor_shop_keeper = DUNG::DG_SHOP_KEEPER[floor_id] if DUNG::DG_SHOP_KEEPER[floor_id] != nil
    @floor_shop_guard = DUNG::DG_SHOP_GUARD[floor_id] if DUNG::DG_SHOP_GUARD[floor_id] != nil
    @floor_house_rate = DUNG::DG_HOUSE_RATE[floor_id] if DUNG::DG_HOUSE_RATE[floor_id] != nil
    @floor_house_monster_num = DUNG::DG_HOUSE_MONSTER_NUM[floor_id] if DUNG::DG_HOUSE_MONSTER_NUM[floor_id] != nil
    @floor_house_item_num = DUNG::DG_HOUSE_ITEM_NUM[floor_id] if DUNG::DG_HOUSE_ITEM_NUM[floor_id] != nil
    @floor_house_trap_num = DUNG::DG_HOUSE_TRAP_NUM[floor_id] if DUNG::DG_HOUSE_TRAP_NUM[floor_id] != nil
  end
  #--------------------------------------------------------------------------
  # ○ ダンジョンの区分け
  #--------------------------------------------------------------------------
  def split_rect(parent_rect)
    if rand(100) < @nosplit_rate and not @many_room
      parent_rect.done_split_h = true
      parent_rect.done_split_v = true
    end
    if parent_rect.hx - parent_rect.lx <= @rect_min * 2
      parent_rect.done_split_h = true
    end
    if parent_rect.hy - parent_rect.ly <= @rect_min * 2
      parent_rect.done_split_v = true
    end
    return if parent_rect.done_split_h and parent_rect.done_split_v
    @rects.push(DungeonRect.new(parent_rect.lx, parent_rect.ly,
    parent_rect.hx, parent_rect.hy))
    if !parent_rect.done_split_h        # 横に分割
      if @many_room                     # 部屋数が最大になるように分割する
        split_x = parent_rect.lx + @many_rect_w
      else                              # ランダム分割
        split_x = rand((parent_rect.hx - @rect_min + 1) - (parent_rect.lx + @rect_min)) +
        (parent_rect.lx + @rect_min)
      end
      parent_rect.hx = split_x
      @rects[@rects.size - 1].lx = split_x
      parent_rect.done_split_h = true
      @couples.push([0, parent_rect, @rects[@rects.size - 1]])
    elsif !parent_rect.done_split_v     # 縦に分割
      if @many_room                     # 部屋数が最大になるように分割する
        split_y = parent_rect.ly + @many_rect_h
      else                              # ランダム分割
        split_y = rand((parent_rect.hy - @rect_min + 1) - (parent_rect.ly + @rect_min)) +
        (parent_rect.ly + @rect_min)
      end
      parent_rect.hy = split_y
      @rects[@rects.size - 1].ly = split_y
      parent_rect.done_split_v = true
      @couples.push([1, parent_rect, @rects[@rects.size - 1]])
    end
    i = @rects.size - 1
    split_rect(parent_rect)
    split_rect(@rects)
  end
  #--------------------------------------------------------------------------
  # ○ 指定した矩形範囲を床にする
  #--------------------------------------------------------------------------
  def set_ground(lx, ly, hx, hy)
    if lx > hx
      x1 = hx
      x2 = lx
    else
      x1 = lx
      x2 = hx
    end
    if ly > hy
      y1 = hy
      y2 = ly
    else
      y1 = ly
      y2 = hy
    end
    for x in x1..x2
      for y in y1..y2
        @map.data[x, y, 0] = @tile[0]
        @room_table[x, y, 0] = @room_table[x, y, 0] | 9 # 通行可能&斜めフラグをセット
      end
    end
    @grounds.push(DungeonRoom.new(x1, y1, x2, y2))  # 床を記録する
  end
  #--------------------------------------------------------------------------
  # ○ 壁のセット
  #--------------------------------------------------------------------------
  def set_wall
    for rect in @grounds
      y = rect.ly - 1
      for x in rect.lx - 1..rect.hx + 1
        set_special_wall(x, y)
      end
    end
    for rect in @grounds       # 壁グラフィックのセット
      for x in rect.lx - 1..rect.hx + 1
        set_wall_graph(x, rect.ly - 1)
        set_wall_graph(x, rect.ly - 2)
        set_wall_graph(x, rect.hy + 1)
      end
      for y in rect.ly - 1..rect.hy + 1
        set_wall_graph(rect.lx - 1, y)
        set_wall_graph(rect.hx + 1, y)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ 特殊壁のセット
  #--------------------------------------------------------------------------
  def set_special_wall(x, y)
    return if @room_table[x, y, 0] & 1 != 0
    return if @room_table[x, y + 1, 0] & 1 == 0   # 下が通行不可能なら次へ
    if same_tile?(x, y - 1, @tile[2])
      @map.data[x, y, 0] = @tile[3]
    else
      @map.data[x, y, 0] = @tile[0]
      @map.data[x, y, 2] = @tile[4]
    end
  end
  #--------------------------------------------------------------------------
  # ○ 壁グラフィックのセット
  #--------------------------------------------------------------------------
  def set_wall_graph(x, y)
    if @map.data[x, y, 0] == @tile[2]   # 床タイプのオートタイル
      n = 0
      n += 1 unless same_tile?(x - 1, y, @tile[2])   # 左がない
      n += 1 unless same_tile?(x + 1, y, @tile[2])   # 右がない
      n += 1 unless same_tile?(x, y - 1, @tile[2])   # 上がない
      n += 1 unless same_tile?(x, y + 1, @tile[2])   # 下がない
      if n == 0
        n += 1 unless same_tile?(x - 1, y - 1, @tile[2])
        n += 2 unless same_tile?(x + 1, y - 1, @tile[2])
        n += 4 unless same_tile?(x + 1, y + 1, @tile[2])
        n += 8 unless same_tile?(x - 1, y + 1, @tile[2])
      elsif n == 1
        if !same_tile?(x - 1, y, @tile[2])      # 左がない
          n = 16
          n += 1 unless same_tile?(x + 1, y - 1, @tile[2])   # 右上がない
          n += 2 unless same_tile?(x + 1, y + 1, @tile[2])   # 右下がない
        elsif !same_tile?(x, y - 1, @tile[2])   # 上がない
          n = 20
          n += 1 unless same_tile?(x + 1, y + 1, @tile[2])   # 右下がない
          n += 2 unless same_tile?(x - 1, y + 1, @tile[2])   # 左下がない
        elsif !same_tile?(x + 1, y, @tile[2])   # 右がない
          n = 24
          n += 1 unless same_tile?(x - 1, y + 1, @tile[2])   # 左下がない
          n += 2 unless same_tile?(x - 1, y - 1, @tile[2])   # 左上がない
        else                                    # 下がない
          n = 28
          n += 1 unless same_tile?(x - 1, y - 1, @tile[2])   # 左上がない
          n += 2 unless same_tile?(x + 1, y - 1, @tile[2])   # 右上がない
        end
      elsif n == 2
        if !same_tile?(x - 1, y, @tile[2])
          n = !same_tile?(x + 1, y, @tile[2]) ? 32 :
              same_tile?(x, y - 1, @tile[2]) ? 40 : 34
        else
          n = same_tile?(x + 1, y, @tile[2]) ? 33 :
              same_tile?(x, y - 1, @tile[2]) ? 38 : 36
        end
      elsif n == 3
        n = same_tile?(x, y + 1, @tile[2]) ? 42 :
            same_tile?(x + 1, y, @tile[2]) ? 43 :
            same_tile?(x, y - 1, @tile[2]) ? 44 : 45
      else
        n = 46
      end
      @map.data[x, y, 0] += n
    elsif @map.data[x, y, 0] == @tile[3]    # 壁タイプのオートタイル
      if @map.data[x - 1, y, 0] == @tile[0] or
         @map.data[x - 1, y, 0] == @tile[1]
        @map.data[x, y, 0] += 1
      end
      if @map.data[x + 1, y, 0] == @tile[0] or
         @map.data[x + 1, y, 0] == @tile[1]
        @map.data[x, y, 0] += 4
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ 指定座標にあるのが同じオートタイルかどうかを返す
  #--------------------------------------------------------------------------
  def same_tile?(x, y, id)
    return true if y < 0      # 画面外なら同じタイルがあるとする
    n = @map.data[x, y, 0]
    return (n >= id and n < id + 48)
  end
  #--------------------------------------------------------------------------
  # ○ 分割線を増やす
  #--------------------------------------------------------------------------
  def couple_more
    rect_map = {}
    for rect in @rects
      for x in rect.lx...rect.hx
        for y in rect.ly...rect.hy
          rect_map[[x, y]] = rect if rect_map[[x, y]] == nil
        end
      end
    end
    for x in 8...@map.width - 10
      for y in 6...@map.height - 8
        if rect_map[[x, y]] != rect_map[[x + 1, y]]
          if rand(100) < @add_couple_rate
            @couples.push([0, rect_map[[x, y]], rect_map[[x + 1, y]]])
          end
        end
        if rect_map[[x, y]] != rect_map[[x, y + 1]]
          if rand(100) < @add_couple_rate
            @couples.push([1, rect_map[[x, y]], rect_map[[x, y + 1]]])
          end
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ 指定した矩形の壁を壊す
  #--------------------------------------------------------------------------
  def delete_wall(lx, ly, hx, hy)
    for x in lx..hx
      for y in ly..hy
        next unless valid?(x, y)                # 有効範囲外なら次へ
        next if @room_table[x, y, 0] & 1 != 0   # 壁でなければ次へ
        @map.data[x, y, 0] = @tile[0]
        @map.data[x, y, 2] = 0
        @room_table[x, y, 0] = @room_table[x, y, 0] | 9
      end
      set_special_wall(x, ly - 1)
      set_special_wall(x, hy + 1)
    end
    for x in lx - 1..hx + 1
      set_wall_graph(x, ly - 1)
      set_wall_graph(x, ly - 2)
      set_wall_graph(x, hy + 1)
    end
    for y in ly..hy
      set_wall_graph(lx - 1, y)
      set_wall_graph(hx + 1, y)
    end
  end
  #--------------------------------------------------------------------------
  # ○ すべての壁を壊す(大部屋)
  #--------------------------------------------------------------------------
  def delete_wall_all
    @rects = []
    @couples = []
    @grounds = []
    @rects.push(DungeonRect.new(8, 6, @map.width - 9, @map.height - 7))
    @rects[0].add_room(8, 6, @map.width - 9, @map.height - 7)
    set_ground(8, 6, @map.width - 9, @map.height - 7)
    rect = @rects[0]
    for x in rect.room.lx - 1..rect.room.hx + 1
      for y in rect.room.ly - 1..rect.room.hy + 1
        @room_table[x, y, 0] = @room_table[x, y, 0] | 2 # 部屋フラグを立てる
        @room_table[x, y, 1] = 1            # 部屋IDをセット
        @map.data[x, y, 2] = 0              # 特殊壁を削除
      end
    end
    set_wall
    if @floor_house >= 0      # モンスターハウス
      @floor_house = 0
      start_house unless house?
    end
    if @floor_shop >= 0       # お店
      @floor_shop = 0
      start_shop unless shop? or house?
    end
  end
  #--------------------------------------------------------------------------
  # ○ お店の作成
  #--------------------------------------------------------------------------
  def set_shop
    @floor_shop = -1
    return if rand(100) >= @floor_shop_rate
    return if @rects.size <= 2                 # 部屋数によって制限
    for i in 0...@rects.size
      room = @rects.room
      next if room.hx - room.lx < 4 or room.hy - room.ly < 4  # 部屋サイズ制限
      n = 0
      for x in room.lx..room.hx
        n += 1 if @room_table[x, room.ly - 1, 0] & 1 != 0
        n += 1 if @room_table[x, room.hy + 1, 0] & 1 != 0
      end
      for y in room.ly..room.hy
        n += 1 if @room_table[room.lx - 1, y, 0] & 1 != 0
        n += 1 if @room_table[room.hx + 1, y, 0] & 1 != 0
      end
      next if n >= 2        # 通路が2本以上あればお店を作らない
      @floor_shop = i       # お店の部屋ID
      return
    end
  end
  #--------------------------------------------------------------------------
  # ○ モンスターハウスの作成
  #--------------------------------------------------------------------------
  def set_house
    @floor_house = -1
    return if rand(100) >= @floor_house_rate
    if @rects.size == 1
      i = 0
    else
      i = rand(@rects.size)
      i = (i + 1) % @rects.size if i == @floor_shop       # お店は除外する
    end
    @floor_house = i
  end
end

[/pre][pre lang="ruby"]#==============================================================================
# ■ Scene_Dungeon
#==============================================================================
class Scene_Dungeon < Scene_Base
  
  #--------------------------------------------------------------------------
  # ● アイテムの効果
  #--------------------------------------------------------------------------
  def effect_item(ditem, target, user = nil)
    note = ditem.item.note
    user = target if user == nil
   
   
  #  p ditem
#~         # 帰還★追加
#~     if note =~ /<帰還>/i
#~       p"帰還ー"
#~       $scene = Scene_Map.new
#~       $game_temp.map_bgm.play
#~       $game_temp.map_bgs.play
#~     end   
   
    # HP回復
    if ditem.item.hp_recovery > 0
      n = ditem.item.hp_recovery
      target.battler.hp += n
      $game_temp.heap_message.push(sprintf(Vocab::DgHpRecover, target.name, n))
    end
   
    # ダメージ
    if ditem.item.base_damage > 0
      target.animation_id = DUNG::ANIME_DAMAGE    # ダメージアニメーション
      wait_for_animation
      target.battler.make_obj_damage_value(user.battler, ditem.item)
      target.battler.execute_damage(user.battler)
      if target.battler.hp_damage == 0
        text = "\\C[6]%s\\C[0]はダメージを受けない。"
        $game_temp.heap_message.push(sprintf(text, target.name))
      else
        text = Vocab::DgHpDamage
        $game_temp.heap_message.push(sprintf(text,
        target.name, target.battler.hp_damage))
        target.dead(user) if target.battler.dead?     # 死亡処理
      end
      damage_player(user) if target.is_a?(Game_DungeonPlayer)
    end

    # 満腹度回復
    if ditem.item.mp_recovery != 0
      if target.is_a?(Game_DungeonPlayer)
        $game_party.gain_energy(ditem.item.mp_recovery * 20)
        if ditem.category == 80     # 食料の場合のメッセージ表示
          if $game_party.energy_max?
            $game_temp.heap_message.push(sprintf(Vocab::DgFoodMax, target.name))
          else
            $game_temp.heap_message.push(sprintf(Vocab::DgFood, target.name))
          end
        end
      end
    end
   
    # 最大HPの変化
    if note =~ /<最大HP([\+\-\=])(\d+)>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        maxhp = target.battler.maxhp
        case $1
        when '+'; target.battler.maxhp += $2.to_i
        when '-'; target.battler.maxhp -= $2.to_i
        when '='; target.battler.maxhp = $2.to_i
        end
        n = (target.battler.maxhp - maxhp).abs  # 最大HP変化量の絶対値
        if target.battler.maxhp > maxhp       # 最大HPが上がった
          $game_temp.heap_message.push(sprintf(
          "\\C[6]%s\\C[0]の最大HPが\\C[4]%d\\C[0]上がった!", target.name, n))
        elsif target.battler.maxhp < maxhp    # 最大HPが下がった
          $game_temp.heap_message.push(sprintf(
          "\\C[6]%s\\C[0]の最大HPが\\C[4]%d\\C[0]下がった。", target.name, n))
        end
      end
    end

    # レベルの変化
    if note =~ /<レベル([\+\-\=])(\d+)>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤーの場合
        level = target.battler.level
        case $1
        when '+'
          target.battler.change_level(level + $2.to_i, false)
        when '-'
          n = [$2.to_i, level - 1].max        # 下げられるレベルを取得
          target.battler.change_level(level - $2.to_i, false) if n > 0
        when '='
          target.battler.change_level($2.to_i, false)
        end
        if target.battler.level > level       # レベルが上がった
          Sound.play_levelup
          $game_temp.heap_message.push(sprintf(
          Vocab::DgLevelup, target.name, target.battler.level))
        elsif target.battler.level < level    # レベルが下がった
          Sound.play_leveldown
          n = level - target.battler.level
          $game_temp.heap_message.push(sprintf(
          Vocab::DgLeveldown, target.name, n))
        end
      else                                    # モンスターの場合
        case $1
        when '+'; target.levelup($2.to_i)
        when '-'; target.leveldown($2.to_i)
        end
      end
    end

    # 最大満腹度の変化
    if note =~ /<最大満腹度([\+\-\=])(\d+)>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        maxenergy = $game_party.energy_max
        case $1
        when '+'; $game_party.gain_energy_max($2.to_i * 20)
        when '-'; $game_party.gain_energy_max($2.to_i * -20)
        when '='; $game_party.energy_max = $2.to_i * 20
        end
        n = (($game_party.energy_max - maxenergy) / 20).abs # 最大満腹度変化量の絶対値
        if $game_party.energy_max > maxenergy       # 最大満腹度が上がった
          $game_temp.heap_message.push(sprintf(
          "\\C[6]%s\\C[0]の最大満腹度が\\C[4]%d\\C[0]上がった!", target.name, n))
        elsif $game_party.energy_max < maxenergy    # 最大満腹度が下がった
          $game_temp.heap_message.push(sprintf(
          "\\C[6]%s\\C[0]の最大満腹度が\\C[4]%d\\C[0]%%下がった。", target.name, n))
        end
      end
    end

    # ちからの変化
    if note =~ /<ちから([\+\-\=])(\d+)>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        case $1
        when '+'
          $game_party.gain_power($2.to_i)
          $game_temp.heap_message.push(sprintf(
          "\\C[6]%s\\C[0]のちからが回復した。", target.name))
        when '-'
          $game_party.gain_power(-$2.to_i)
          $game_temp.heap_message.push(sprintf(
          "\\C[6]%s\\C[0]のちからが下がった。", target.name))
        when '='
          $game_party.power = $2.to_i
          $game_temp.heap_message.push(sprintf(
          "\\C[6]%s\\C[0]のちからが\\C[4]%d\\C[0]になった。", target.name, $2.to_i))
        end
      end
    end

    # 最大ちからの変化
    if note =~ /<最大ちから([\+\-\=])(\d+)>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        maxpower = $game_party.power_max
        case $1
        when '+'; $game_party.gain_power_max($2.to_i)
        when '-'; $game_party.gain_power_max(-$2.to_i)
        when '='; $game_party.power_max = $2.to_i
        end
        n = ($game_party.power_max - maxpower).abs  # 最大ちから変化量の絶対値
        if $game_party.power_max > maxpower       # 最大ちからが上がった
          $game_temp.heap_message.push(sprintf(
          "\\C[6]%s\\C[0]の最大ちからが\\C[4]%d\\C[0]上がった!", target.name, n))
        elsif $game_party.power_max < maxpower    # 最大ちからが下がった
          $game_temp.heap_message.push(sprintf(
          "\\C[6]%s\\C[0]の最大ちからが\\C[4]%d\\C[0]下がった。", target.name, n))
        end
      end
    end

    # めぐすり
    if ditem.item.plus_state_set.include?(DUNG::STATE_GODSIGHT)
      target.battler.add_state(DUNG::STATE_GODSIGHT)
      if target.is_a?(Game_DungeonPlayer)     # 全ワナ発見(プレイヤー限定
        for trap in $game_dungeon.traps do trap.discover end
        $game_temp.heap_message.push(sprintf(
        "\\C[6]%s\\C[0]はものがよく見えるようになった。", target.name))
      end
    end

    # 鈍足、狂戦士、無敵、混乱、深い眠り、倍速、くちなし、パワーアップ、かなしばり
    for id in [DUNG::STATE_SLOW, DUNG::STATE_BERSERK, DUNG::STATE_UNDEAD,
               DUNG::STATE_CONFUSE, DUNG::STATE_DSLEEP, DUNG::STATE_FAST,
               DUNG::STATE_SILENT, DUNG::STATE_POWERUP, DUNG::STATE_STOP]
      if ditem.item.plus_state_set.include?(id)
        target.battler.add_state(id)
        state = $data_states[id]
        $game_temp.heap_message.push(sprintf(state.message1, target.name))
      end
    end
   
    # 爆睡
    if ditem.item.plus_state_set.include?(DUNG::STATE_HDSLEEP)
      target.battler.add_state(DUNG::STATE_HDSLEEP)
      target.battler.add_state(DUNG::STATE_FAST)
      $game_temp.heap_message.push(sprintf(
      "\\C[6]%s\\C[0]は深い眠りについた。", target.name))
    end

    # 迷子
    if note =~ /<迷子>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        $game_dungeon.reset_map
        @map_window.refresh_ground
        $game_temp.refresh_map = true
        @map_window.update
        $game_temp.heap_message.push(sprintf(
        "\\C[6]%s\\C[0]はマップを忘れてしまった。", target.name))
      end
    end

    # 松明
    if note =~ /<松明>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        $game_dungeon.change_floor_state(8, true) # フロアの松明効果をオン
        $game_dungeon.complete_map            # 地図を完成させる
        @map_window.refresh_ground
        $game_temp.refresh_map = true
        $game_temp.heap_message.push("フロア全体が明るくなった。")
      end
    end

    # 拾えず
    if note =~ /<拾えず>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        $game_dungeon.change_floor_state(16, true) # フロアの拾えず効果をオン
        $game_temp.heap_message.push(sprintf(
        "\\C[6]%s\\C[0]はアイテムが拾えなくなった。", target.name))
      end
    end

    # 大部屋
    if note =~ /<大部屋>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        $game_dungeon.delete_wall_all
        $game_dungeon.draw_map($game_dplayer.x, $game_dplayer.y)
        @map_window.refresh_ground
        $game_temp.refresh_map = true
        $game_temp.refresh_light = true
        $game_temp.heap_message.push("フロアの壁がすべて崩れた。")
      end
    end

    # 大爆発 or 爆発
    if note =~ /<大爆発>/i or note =~ /<爆発>/i
      $game_dungeon.delete_wall(target.x - 1, target.y - 1,   # 周囲の壁破壊
      target.x + 1, target.y + 1)
      for monster in $game_dplayer.beside_characters(false)
        monster.dead unless monster.is_a?(Game_DungeonPlayer) # 隣接キャラ消滅
      end
      for x in target.x - 1..target.x + 1
        for y in target.y - 1..target.y + 1
          item = $game_dungeon.item_xy(x, y)
          item.erase if item != nil                 # 隣接アイテムを消滅させる
        end
      end
      if target.is_a?(Game_DungeonPlayer)                     # プレイヤー限定
        $game_dungeon.draw_map($game_dplayer.x, $game_dplayer.y)
        $game_temp.refresh_map = true
        if note =~ /<大爆発>/i
          target.battler.hp = 1                               # HPを1にする
        else
          target.battler.hp /= 2                              # HPを半分にする
        end
      else
        target.dead
      end
    end

    # 盾強化
    if note =~ /<盾強化>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        armor = $game_party.darmor
        if armor == nil
          $game_temp.heap_message.push("防具を装備していなかった。")
        else
          if rand(100) < 10       # 低確率で+3
            $game_temp.heap_message.push(sprintf(
            "ラッキー! %sが大幅に強化された。", armor.name))
            armor.gain_plus(3)
          else
            $game_temp.heap_message.push(sprintf(
            "%sが強化された。", armor.name))
            armor.gain_plus(1)
          end
        end
      end
      
  #━━━━━盾 表示更新━━━━━━━━━━━━━━━━━━━━
$win2 = nil #盾
GC.start

$soubi_kousin = true
#━━━━━━━━━━━━━━━━━━━━━━━━━        
      
      
      
      
      
    end

    # 剣強化
    if note =~ /<剣強化>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        weapon = $game_party.dweapon
        if weapon == nil
          $game_temp.heap_message.push("武器を装備していなかった。")
        else
          if rand(100) < 10       # 低確率で+3
            $game_temp.heap_message.push(sprintf(
            "ラッキー! %sが大幅に強化された。", weapon.name))
            weapon.gain_plus(3)
          else
            $game_temp.heap_message.push(sprintf(
            "%sが強化された。", weapon.name))
            weapon.gain_plus(1)
          end
        end
      end
      
#━━━━━武器 表示更新━━━━━━━━━━━━━━━━━━━━
    $win = nil
    GC.start
$soubi_kousin = true
#━━━━━━━━━━━━━━━━━━━━━━━━━      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
    end

    # ワナ増殖
    if note =~ /<ワナ増殖>/i
      for i in 0...10
        x, y = $game_dungeon.random_pos(1)
        $game_dungeon.add_trap(x, y, $game_dungeon.random_trap)
      end
      $game_temp.heap_message.push("フロアのワナが増えた。")
    end

    # 全滅
    if note =~ /<全滅>/i
      for monster in $game_dungeon.monsters
        next if monster.battler.dead?
        next if monster.battler.state?(DUNG::STATE_SHOP_KEEPER)
        monster.battler.hp = 0
        monster.dead($game_dplayer)
      end
    end

    # 一時しのぎ
    if note =~ /<一時しのぎ>/i
      x, y = target.drop_pos($game_dungeon.stairs.x, $game_dungeon.stairs.y)
      target.moveto(x, y) if x != nil
      target.battler.add_state(DUNG::STATE_STOP)
    end

    # 入れ替え
    if note =~ /<入れ替え>/i
      x = $game_dplayer.x
      y = $game_dplayer.y
      $game_dplayer.moveto(target.x, target.y)
      target.moveto(x, y)
    end

    # 装備はずし
    if note =~ /<装備はずし>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        if $game_party.equips.empty?
          $game_temp.heap_message.push("しかしたいしたことはなかった。")
        else
          for item in $game_party.equips do item.change_equip(false) end
          $game_temp.heap_message.push("装備がはずれてしまった。")
        end
      end
    end
   
    # サビ
    if note =~ /<サビ>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        result = false
        weapon = $game_party.dweapon
        if weapon != nil and not weapon.coated?
          weapon.gain_plus(-1)
          result = true
        end
        armor = $game_party.darmor
        if armor != nil and not armor.coated?
          armor.gain_plus(-1)
          result = true
        end
        if result
          $game_temp.heap_message.push("装備が錆びてしまった。")
        else
          $game_temp.heap_message.push("しかしたいしたことはなかった。")
        end
      end
    end

    # デロデロ
    if note =~ /<デロデロ>/i
      if target.is_a?(Game_DungeonPlayer)     # プレイヤー限定
        if $game_party.spoil_ditem
          $game_temp.heap_message.push("食料が腐ってしまった。")
        else
          $game_temp.heap_message.push("しかしたいしたことはなかった。")
        end
      end
    end
   
    # 警報
    if note =~ /<警報>/i
      for monster in $game_dungeon.monsters
        monster.battler.remove_state(DUNG::STATE_SLEEP)   # 浅い眠りを解除
        monster.battler.remove_state(DUNG::STATE_DSLEEP)  # 深い眠りを解除
        monster.battler.remove_state(DUNG::STATE_HDSLEEP) # 爆睡状態を解除
        monster.battler.remove_state(DUNG::STATE_STOP)    # かなしばりを解除
      end
      $game_temp.heap_message.push("眠っていたモンスターが目を覚ました。")
    end
   
    # 召喚
    if note =~ /<召喚>/i
      for x in target.x - 1..target.x + 1
        for y in target.y - 1..target.y + 1
          if target.passable?(x, y)
            $game_dungeon.add_monster(x, y, $game_dungeon.random_monster, false)
          end
        end
      end
    end
   
    # ワープ
    if note =~ /<ワープ>/i
      x, y = $game_dungeon.random_pos(2)
      target.moveto(x, y)
    end
   
#~         # 帰還★追加
#~     if note =~ /<帰還>/i
#~       p"帰還ー"
#~       $scene = Scene_Map.new
#~       $game_temp.map_bgm.play
#~       $game_temp.map_bgs.play
#~     end

    if note =~ /<帰還>/i
   #   p"帰還ー"

    #  $game_temp.heap_message.push("脱出の巻物を使った! スタート地点に戻れる!")

      $scene = Scene_Map.new
  #    $game_temp.map_bgm.play
   #   $game_temp.map_bgs.play
      $game_temp.common_event_id = 7
      
      
    end   
   
  end
  #--------------------------------------------------------------------------
  # ● アイテムに使うアイテムの効果
  #--------------------------------------------------------------------------
  def effect_item_for_item(ditem, target_index)
    note = ditem.item.note
    target_ditem = @item_window.ditem_index(target_index)
   
#p"帰還の巻物はなぜかこっちにくるので、ここに設定する いや、アイテムを「使用者」にしたらいけた"   


        # 帰還★追加
#~     if note =~ /<帰還>/i
#~    #   p"帰還ー"
#~  
#~       $game_temp.heap_message.push("脱出の巻物を使った! スタート地点に戻れる!")

#~       $scene = Scene_Map.new
#~   #    $game_temp.map_bgm.play
#~    #   $game_temp.map_bgs.play
#~       $game_temp.common_event_id = 7
#~      
#~      
#~     end   

    # 識別
    if note =~ /<識別>/i
      if rand(100) < 15
        for item in $game_party.ditems
          item.change_judge(true)
          $game_dungeon.judge_item(item)
        end
        $game_temp.heap_message.push("ラッキー! すべてのアイテムを識別できた。")
      else
        target_ditem.change_judge(true)
        judge_item(target_ditem)
      end
    end

    # 解呪
    if note =~ /<解呪>/i
      if rand(100) < 15
        for item in $game_party.ditems
          item.change_curse(false)
        end
        $game_temp.heap_message.push("ラッキー! すべてのアイテムを解呪できた。")
      else
        if target_ditem.cursed?
          target_ditem.change_curse(false)
          $game_temp.heap_message.push(sprintf(
          "%sの呪いが解けた。", target_ditem.name))
        else
          $game_temp.heap_message.push(sprintf(
          "%sは呪われていなかった。", target_ditem.name))
        end
      end
    end

    # 壷強化
    if note =~ /<壷強化>/i
      if target_ditem.category == 55
        if target_ditem.plus == DUNG::POT_MAX
          $game_temp.heap_message.push(sprintf(
          "%sはこれ以上大きくできない。", target_ditem.name))
        else
          $game_temp.heap_message.push(sprintf(
          "%sの容量が\\C[4]1\\C[0]増えた。", target_ditem.name))
          target_ditem.gain_plus(1)
        end
      else
        $game_temp.heap_message.push("しかし何も起こらなかった。")
      end
    end

    # メッキ
    if note =~ /<メッキ>/i
      if target_ditem.category >= 95    # 剣か盾のみ
        $game_temp.heap_message.push(sprintf(
        "%sは錆びに強くなった。", target_ditem.name))
        target_ditem.change_coat(true)
      else
        $game_temp.heap_message.push("しかし何も起こらなかった。")
      end
    end

    # 吸引
    if note =~ /<吸引>/i
      if target_ditem.category == 55 and      # 中身の入った壷のみ
         target_ditem.in_items.size > 0
        while(target_ditem.in_items.size > 0)
          in_item = target_ditem.in_items.pop
          id = $game_dungeon.add_item($game_dplayer.x, $game_dplayer.y, in_item)
          $game_dungeon.items[id].drop($game_dplayer.x, $game_dplayer.y)
        end
        $game_temp.heap_message.push("壷の中身を吸い出した。")
      else
        $game_temp.heap_message.push("しかし何も起こらなかった。")
      end
    end

  end
  #--------------------------------------------------------------------------
  # ● 壷に入れたときのアイテムの効果
  #--------------------------------------------------------------------------
  def effect_item_storage(ditem)
    note = ditem.item.note
   
    # 底抜け
    if note =~ /<底抜け>/i
      ditem.in_items.pop    # 入れたアイテムを削除
    end

    # 識別
    if note =~ /<識別>/i
      $game_dungeon.judge_item(ditem.in_items[ditem.in_items.size - 1])
    end

    # 変化
    if note =~ /<変化>/i
      ditem.in_items.pop    # 入れたアイテムを削除
      ditem.in_items.push($game_dungeon.random_item)  # ランダムアイテムを入れる
    end
   
    # 分裂
    if note =~ /<分裂>/i
      if ditem.plus > 0     # 容量が残っていれば入れたアイテムをもうひとつ入れる
        ditem.in_items.push(ditem.in_items[ditem.in_items.size - 1].clone)
        ditem.gain_plus(-1)
      end
    end

    # 合成
    if note =~ /<合成>/i
      new_ditem = ditem.in_items[ditem.in_items.size - 1]   # 入れたアイテム
      if ditem.in_items[ditem.in_items.size - 1].category == new_ditem.category
        if new_ditem.category >= 95
        end
      end
      ditem.in_items.pop    # 入れたアイテムを削除
    end

  end
  
  #--------------------------------------------------------------------------
  # ● 武器の効果
  #     hit_flag  : 攻撃がモンスターに当たったかどうか
  #--------------------------------------------------------------------------
  def effect_weapon(hit_flag)
    weapon = $game_party.dweapon
    return if weapon == nil       # 素手なら終了
    extends = weapon.extends + weapon.item.extends
    for id in extends.uniq
      next if id < 128
      case id
      when 128    # 掘る
        x, y = $game_dplayer.pos_direction
        if $game_dungeon.room_table[x, y, 0] & 1 == 0
          $game_dungeon.delete_wall(x, y, x, y)
        end
      when 129    # 壊れる
      when 135    # 使うたびに弱くなる
      end
    end
  end
   
end

[/pre][pre lang="ruby"]#==============================================================================
# ■ 設定項目
#
# フロア全体サイズの補足
#   地図の仕様上、縦サイズを横の75%程度に設定するといい感じになります。
#   全体サイズの大きいフロアは作成に時間がかかります。
#
# 使用するタイルの補足
#   [床, 壁, 1セル壁用特殊タイル, 階段]
#   以上4つのタイルIDを設定してください。1セル壁用特殊タイルは上下を
#   通行可能タイルにはさまれた壁で使用するもので、上層タイルを設定します。
#   床(1552~1559, 1568~1575, 1584~1591)
#   壁(5888,5936,5984~6220, 6656,6704~6692, 7424,7472~7760)48刻み
#   特殊壁(536~543)
#   階段(256~259, 264~267)
#
# モンスターハウス設定の補足
#   狭い部屋がモンスターハウスになる場合、モンスター数は部屋面積の80%、
#   ワナとアイテムは40%をそれぞれ上限とします。
#==============================================================================
module DUNG

  DIR_INPUT_DELAY   = 4       # 移動入力の遅延(大きいと斜め移動しやすくなる)
  B_INPUT_DELAY     = 8       # Bボタンでのメニュー入力受付時間
  USE_ROTATE        = true    # 演出にスプライトの回転を使う(falseで使わない)
  MAP_HIDE          = true    # 向き変更時に地図を非表示にする(falseで常に表示)
  AUTO_TURN         = true    # 攻撃してきた敵の方を向く機能(falseで使わない)
  START_EFFECT_COUNT = 120    # ダンジョン開始演出の時間

  POWER_MAX         = 99      # 最大ちからの上限
  ENERGY_MAX        = 250     # 最大満腹度の上限
  AUTO_RECOVER_RATE = 100     # 最大HPをこの値で割った分が1ターンの回復量
  HUNGRY_DAMAGE     = 5       # 空腹時にこの値ずつHPが減っていく
  POT_MAX           = 9       # 壷の最大容量
  THROW_DISTANCE    = 15      # 物を投げたときの飛距離
  MAGIC_DISTANCE    = 15      # 魔法弾の飛距離
  THROW_HIT_RATE    = 80      # 投げたものの命中率
  TRAP_EXE_RATE     = 90      # 未発見ワナの起動確率
  TRAP_EXE_RATE_DC  = 60      # 発見済みワナの起動確率
  
  # 特殊状態として利用するステートのIDを設定
  STATE_SLEEP       = 17      # 浅い眠り
  STATE_GODSIGHT    = 18      # よく見え
  STATE_SLOW        = 19      # 鈍足状態
  STATE_BERSERK     = 20      # 狂戦士
  STATE_UNDEAD      = 21      # 無敵
  STATE_CONFUSE     = 22      # 混乱
  STATE_DSLEEP      = 23      # 深い眠り
  STATE_FAST        = 24      # 倍速
  STATE_HDSLEEP     = 25      # 爆睡
  STATE_POWERUP     = 26      # パワーアップ
  STATE_SHARE       = 27      # 痛み分け
  STATE_STOP        = 28      # かなしばり
  STATE_SILENT      = 29      # くちなし
  STATE_FAKE        = 30      # 身代わり
  STATE_SHOP_KEEPER = 31      # 店主
  STATE_WAIT        = 32      # 待ち伏せ
  STATE_RANDOM_MOVE = 33      # ふらふら移動
  STATE_UNVISIBLE   = 34      # 不可視
  STATE_REFLECT     = 35      # 魔法弾反射
  STATE_FLAME       = 36      # 投擲無効
  STATE_HEALER      = 37      # 魔物狙い
  STATE_PASS_WALL   = 38      # 壁抜け
  STATE_RUNAWAY     = 39      # 逃走
  STATE_NOMOVE      = 40      # 移動しない

  GOLD_ICON         = 194     # お金のアイコンインデックス
  CURSE_ICON        = 157     # 呪われたアイテムのアイコンインデックス
  MAGIC_ICON        = 110     # 魔法弾のアイコンインデックス
  HP_GAUGE_RATE     = 4       # HPゲージの1ドット当たりのHP量
  HP_GAUGE_MIN      = 15      # HPゲージの長さの下限値
  
  ANIME_ATTACK      = 1       # 素手(or未設定)攻撃のアニメーションID
  ANIME_DAMAGE      = 81      # 被ダメージアニメーションID
  ANIME_EAT         = 82      # 食料を食べるアニメーションID
  ANIME_DRINK       = 82      # 草を飲むアニメーションID
  ANIME_READ        = 83      # 巻物を読むアニメーションID
  
  NOJUDGE_NAME_HERB = [
    "あかい草", "みどり色の草", "あおい草", "き色の草", "もも色の草",
    "みず色の草", "しろい草", "くろい草", "むらさき色の草", "べに色の草",
    "しゅ色の草", "そら色の草", "こん色の草", "はい色の草", "ちゃ色の草",
    "にじ色の草", "しろくろの草", "こうはくの草", "かっ色の草", "きみどりの草",
    "はだ色の草", "色のない草"
  ]
  NOJUDGE_NAME_SCROLL = [
    "イヌの巻物", "ネコの巻物", "サルの巻物", "キジの巻物", "ネズミの巻物",
    "ゴリラの巻物", "パンダの巻物", "ラクダの巻物", "ウシの巻物", "トラの巻物",
    "ウサギの巻物", "リュウの巻物", "ヘビの巻物", "ウマの巻物", "ヒツジの巻物",
    "ニワトリの巻物", "イヌの巻物", "イノシシの巻物", "シカの巻物", "サイの巻物",
    "キリンの巻物", "トカゲの巻物", "ライオンの巻物", "クマの巻物", "スズメの巻物",
    "ツルの巻物", "ウグイスの巻物", "カエルの巻物", "カメの巻物", "オオカミの巻物",
    "アルパカの巻物", "クジラの巻物"
  ]
  NOJUDGE_NAME_WAND = [
    "ヒノキの杖", "カシの杖", "サクラの杖", "ウメの杖", "モミジの杖",
    "マツの杖", "タケの杖", "イシの杖", "ヤナギの杖", "クリの杖",
    "ホネの杖", "キバの杖", "スギの杖", "キリの杖", "セイドウの杖"
  ]
  NOJUDGE_NAME_POT = [
    "ほそい壷", "ふとい壷", "まるい壷", "しかくい壷", "ひし型の壷",
    "みかづき形の壷", "さんかくの壷", "たまご型の壷", "ほし型の壷", "はんげつ形の壷",
    "だるま型の壷", "ひょうたん型の壷", "あさい壷", "ふかい壷", "くびれた壷",
    "ゆがんだ壷", "でこぼこの壷", "かたむいた壷"
  ]
  NOJUDGE_NAME_RING = [
    "ダイヤの指輪", "サファイアの指輪", "ルビーの指輪", "アメジストの指輪",
    "エメラルドの指輪", "オパールの指輪", "トルコ石の指輪", "サンゴの指輪",
    "ヒスイの指輪", "コハクの指輪", "メノウの指輪", "パールの指輪",
    "ジルコニアの指輪", "トパーズの指輪", "ザクロ石の指輪", "ラピスラズリの指輪"
  ]
  
  DG_BASE = {}                # 設定省略時に使う親フロア
  DG_SIZE = {}                # フロア全体のサイズ
  DG_ROOM_MIN = {}            # 部屋の最小サイズ
  DG_ROOM_MARGIN = {}         # 部屋の周りの余白(部屋と区画の間隔です、下限2)
  DG_NOSPLIT_RATE = {}        # 数値が大きいほど部屋数が少なくなりやすい(%)
  DG_ADD_COUPLE_RATE = {}     # 数値が大きいほど通路が複雑になりやすい(%)
  DG_MANY_ROOM_RATE = {}      # 部屋数が最大になるようにフロア作る確率(%)
  DG_MAX_ROOM_RATE = {}       # 区画内での最高サイズの部屋を強制的に作る確率(%)
  DG_TILE = {}                # 使用するタイル
  DG_MONSTER_NUM = {}         # モンスターの初期配置数
  DG_MONSTER_MAX = {}         # モンスターの最大数
  DG_MONSTER_TABLE = {}       # 出現モンスター(エネミーIDと出現率の配列)
  DG_ITEM_MAX = {}            # アイテム初期配置数の最大
  DG_ITEM_TABLE = {}          # 出現アイテム(アイテムタイプ,ID,出現率の配列)
  DG_GOLD_RATE = {}           # お金出現率(%)
  DG_DROP_RATE = {}           # モンスターの共通アイテムドロップ率(1/n)
  DG_TRAP_MAX = {}            # トラップの最大数
  DG_TRAP_NUM = {}            # トラップの初期配置数
  DG_TRAP_TABLE = {}          # 出現トラップ(ID,出現率の配列)
  DG_CURSE_RATE = {}          # 剣と盾以外のものが呪われている確率
  DG_SLEEP_RATE = {}          # 出現モンスターが眠っている確率
  DG_REPOP_TURN = {}          # モンスター再出現間隔(経過するまで再出現判定なし)
  DG_REPOP_RATE = {}          # モンスター再出現確率
  DG_BGM = {}                 # フロアのBGM
  DG_BGS = {}                 # フロアのBGS
  DG_HOUSE_BGM = {}           # フロアのモンスターハウスBGM
  DG_SHOP_BGM = {}            # フロアのお店BGM
  DG_THIEF_BGM = {}           # フロアの泥棒BGM
  DG_WEATHER = {}             # フロアの天候
  DG_SHOP_RATE = {}           # お店の出現率
  DG_SHOP_KEEPER = {}         # 店主のモンスターID
  DG_SHOP_GUARD = {}          # 番犬のモンスターID
  DG_HOUSE_RATE = {}          # モンスターハウス出現率
  DG_HOUSE_MONSTER_NUM = {}   # モンスターハウスにいるモンスターの数
  DG_HOUSE_ITEM_NUM = {}      # モンスターハウスにあるアイテムの数
  DG_HOUSE_TRAP_NUM = {}      # モンスターハウスにあるワナの数

  DG_NAME = {}                # ダンジョンの名前
  DG_FLOOR = {}               # ダンジョンのフロア構成
  DG_JUDGE_ITEM = {}          # ダンジョンの識別済みアイテムカテゴリー

  #--------------------------------------------------------------------------
  # ○ フロアパターン1の設定
  #--------------------------------------------------------------------------
  DG_BASE[1]            = nil # 設定省略時に使う親フロア
  DG_SIZE[1]            = [50, 37]  # フロア全体のサイズ
  DG_ROOM_MIN[1]        = 5   # 部屋の最小サイズ
  DG_ROOM_MARGIN[1]     = 2   # 部屋の周りの余白(部屋と区画の間隔です、下限2)
  DG_NOSPLIT_RATE[1]    = 10  # 数値が大きいほど部屋数が少なくなりやすい(%)
  DG_ADD_COUPLE_RATE[1] = 4   # 数値が大きいほど通路が複雑になりやすい(%)
  DG_MANY_ROOM_RATE[1]  = 10  # 部屋数が最大になるようにフロア作る確率(%)
  DG_MAX_ROOM_RATE[1]   = 20  # 区画内での最高サイズの部屋を強制的に作る確率(%)
  DG_TILE[1] = [1552, 5888, 536, 265] # 使用するタイルパターン
  DG_MONSTER_NUM[1]     = 8   # モンスターの初期配置数
  DG_MONSTER_MAX[1]     = 20#32  # モンスターの最大数
  DG_MONSTER_TABLE[1] = [     # 出現モンスター
#   [3, 10], [4, 8]
[1, 10], [2, 10], [3, 10], [4, 10]
  ]
  DG_ITEM_MAX[1]        = 10  # アイテム初期配置数の最大
  DG_ITEM_TABLE[1] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
  for i in 1..18    do DG_ITEM_TABLE[1].push([0, i, 5]) end    # 草
  for i in 31..52   do DG_ITEM_TABLE[1].push([0, i, 5]) end    # 巻物
  for i in 61..68   do DG_ITEM_TABLE[1].push([0, i, 5]) end    # 杖
  for i in 81..85   do DG_ITEM_TABLE[1].push([0, i, 5]) end    # 壷
  for i in 101..104 do DG_ITEM_TABLE[1].push([0, i, 5]) end    # 食料
  for i in 111..113 do DG_ITEM_TABLE[1].push([0, i, 5]) end    # 矢
   
  for i in 1..9     do DG_ITEM_TABLE[1].push([1, i, 5]) end    # 武器 1..8
  for i in 1..5     do DG_ITEM_TABLE[1].push([2, i, 5]) end    # 防具 1..5
  for i in 21..26   do DG_ITEM_TABLE[1].push([2, i, 5]) end    # 指輪
  DG_GOLD_RATE[1]       = 11  # お金出現率(%)
  DG_DROP_RATE[1]       = 16  # モンスターの共通アイテムドロップ率(1/n)
  DG_TRAP_MAX[1]        = 30  # トラップの最大数
  DG_TRAP_NUM[1]        = 5  # トラップの初期配置数
  DG_TRAP_TABLE[1] = []       # 出現ワナ
  for i in 121..137 do DG_TRAP_TABLE[1].push([i, 5]) end
  DG_CURSE_RATE[1]      = 5#8   # 剣と盾以外のものが呪われている確率
  DG_SLEEP_RATE[1]      = 80  # 出現モンスターが眠っている確率
  DG_REPOP_TURN[1]      = 20  # モンスター再出現間隔(経過するまで再出現判定なし)
  DG_REPOP_RATE[1]      = 10  # モンスター再出現確率
  DG_BGM[1]             = ["Audio/BGM/Dungeon1.mid", 100, 100]
  DG_BGS[1]             = ["Audio/BGS/Drips.ogg", 80, 100]
  DG_HOUSE_BGM[1]       = ["Audio/BGM/Battle1.mid", 100, 100]
  DG_SHOP_BGM[1]        = ["Audio/BGM/Scene4.mid", 100, 100]
  DG_THIEF_BGM[1]       = ["Audio/BGM/Battle5.mid", 100, 100]
  DG_WEATHER[1]         = [0, 0]  # フロアの天候
  DG_SHOP_RATE[1]       = 10#30  # お店の出現率
  DG_SHOP_KEEPER[1]     = 55   # 店主のモンスターID
  DG_SHOP_GUARD[1]      = 55   # 番犬のモンスターID
  DG_HOUSE_RATE[1]      = 15  # モンスターハウス出現率
  DG_HOUSE_MONSTER_NUM[1] = 10#20  # モンスターハウスにいるモンスターの数
  DG_HOUSE_ITEM_NUM[1]  = 20  # モンスターハウスにあるアイテムの数
  DG_HOUSE_TRAP_NUM[1]  = 20  # モンスターハウスにあるワナの数
  
  #--------------------------------------------------------------------------
  # ○ フロアパターン2の設定
  #--------------------------------------------------------------------------
  DG_BASE[2] = 1              # 設定省略時に使う親フロア
  DG_MONSTER_TABLE[2] = [     # 出現モンスター
[1, 10], [2, 10], [3, 10], [4, 10], [5, 5], [6, 5]
  ]
  DG_TILE[2] = [1570, 6752, 77, 267] #[1591, 7760, 543, 267] # 使用するタイルパターン

  #--------------------------------------------------------------------------
  # ○ フロアパターン3の設定
  #--------------------------------------------------------------------------
  DG_BASE[3] = 1              # 設定省略時に使う親フロア
  
  DG_MONSTER_TABLE[3] = [     # 出現モンスター
[1, 10], [2, 10], [3, 10], [4, 10], [5, 5], [6, 5]
  ]
#  DG_TILE[3] = [1591, 7760, 543, 267] # 使用するタイルパターン  
  DG_TILE[3] = [1588, 7616, 540, 264]#[1570, 6752, 77, 267] # 使用するタイルパターン
  
  
#~   DG_REPOP_RATE[3]      = 0  # モンスター再出現確率
#~   DG_MONSTER_NUM[3]     = 5   # モンスターの初期配置数
#~   DG_MONSTER_MAX[3]     = 5  # モンスターの最大数
#~   
  
  
#~   DG_MONSTER_TABLE[3] = [     # 出現モンスター
#~       [1, 10]


#~   ]
  
  
  
#~   DG_ITEM_MAX[3]        = 50  # アイテム初期配置数の最大
#~   DG_ITEM_TABLE[3] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
#~   for i in 1..8     do DG_ITEM_TABLE[3].push([1, i, 5]) end    # 武器
#~   for i in 1..5     do DG_ITEM_TABLE[3].push([2, i, 5]) end    # 防具
#~   for i in 21..26   do DG_ITEM_TABLE[3].push([2, i, 5]) end    # 指輪  
#~   
  
  
  
#~   
#~   
#~   DG_TILE[3] = [1570, 6752, 77, 267] # 使用するタイルパターン
#~   
#~ #▼テスト用設定  
#~   DG_TRAP_MAX[3]        = 0  # トラップの最大数
#~   DG_TRAP_NUM[3]        = 0  # トラップの初期配置数

  

  #--------------------------------------------------------------------------
  # ○ フロアパターン4の設定
  #--------------------------------------------------------------------------
  DG_BASE[4] = 1              # 設定省略時に使う親フロア
  DG_MONSTER_TABLE[4] = [     # 出現モンスター
[2, 3], [3, 3], [4, 3], [5, 10], [6, 10], [7, 5], [8, 5], [9, 5]

  ]
  DG_TILE[4] = [1586, 7520, 538, 267]#[1586, 7520, 538, 267] # 使用するタイルパターン

  #--------------------------------------------------------------------------
  # ○ フロアパターン5の設定 ★BOSS
  #--------------------------------------------------------------------------
  DG_BASE[5] = 1             # 設定省略時に使う親フロア
  DG_MONSTER_TABLE[5] = [     # 出現モンスター
   # [7, 8], [17, 8], [24, 10], [27, 10]
   
   [41, 10]#[20, 10]# [41, 10]
  ]
  DG_TILE[5] = [1591, 7760, 543, 267]#[1588, 7616, 540, 264] # 使用するタイルパターン
  
  
  DG_MONSTER_NUM[5]     = 1#20#1   # モンスターの初期配置数
  DG_MONSTER_MAX[5]     = 1#20#1#32  # モンスターの最大数
  DG_SHOP_RATE[5]       = 0#30  # お店の出現率
  DG_HOUSE_RATE[5]      = 0  # モンスターハウス出現率
  DG_REPOP_RATE[5]      = 0  # モンスター再出現確率


  
  #--------------------------------------------------------------------------
  # ○ フロアパターン10まで
  #--------------------------------------------------------------------------
#~  DG_TILE[6] = [1552, 5888, 536, 265] # 使用するタイルパターン
#~   DG_TILE[7] = [1570, 6752, 77, 267] #[1591, 7760, 543, 267] # 使用するタイルパターン
#~   DG_TILE[8] = [1588, 7616, 540, 264]#[1570, 6752, 77, 267] # 使用するタイルパターン
#~   DG_TILE[9] = [1586, 7520, 538, 267]#[1586, 7520, 538, 267] # 使用するタイルパターン
#~   DG_TILE[10] = [1591, 7760, 543, 267]#[1588, 7616, 540, 264] # 使用するタイルパターン
  
DG_BASE[6] = 1  
DG_MONSTER_TABLE[6] = [
[2, 3], [3, 3], [4, 3], [5, 10], [6, 10], [7, 5], [8, 5], [9, 5], [10, 5], [33, 5]]

DG_BASE[7] = 2
DG_MONSTER_TABLE[7] = [
[2, 3], [3, 3], [4, 3], [5, 10], [6, 10], [7, 5], [8, 5], [9, 5], [10, 5], [33, 5]]

DG_BASE[8] = 3
DG_MONSTER_TABLE[8] = [
[5, 3], [6, 3], [7, 5], [8, 5], [9, 10], [10, 10],[11, 5],[12, 3], [33, 5]]

DG_BASE[9] = 4   
DG_MONSTER_TABLE[9] = [
[6, 3], [7, 3], [8, 5], [9, 5], [10, 10],[11, 10],[12, 5],[13, 3], [33, 5]]

DG_BASE[10] = 5
DG_MONSTER_TABLE[10] = [[42, 10]]
  
  #--------------------------------------------------------------------------
  # ○ フロアパターン15まで
  #--------------------------------------------------------------------------
DG_BASE[11] = 1  
DG_MONSTER_TABLE[11] = [
[6, 3], [7, 3], [8, 5], [9, 5], [10, 10],[11, 10],[12, 5],[13, 3], [33, 5]]

DG_BASE[12] = 2
DG_MONSTER_TABLE[12] = [
[8, 2], [9, 3], [10, 4],[11, 5],[12, 6],[13, 8],[14, 10], [15, 8],[16, 3], [17, 3]]

DG_BASE[13] = 3
DG_MONSTER_TABLE[13] = [
[8, 1], [9, 2], [10, 3],[11, 3],[12, 5],[13, 8],[14, 10], [15, 10],[16, 5], [17, 3]]

DG_BASE[14] = 4   
DG_MONSTER_TABLE[14] = [
[8, 1], [9, 2], [10, 3],[11, 3],[12, 5],[13, 8],[14, 10], [15, 10],[16, 10], [17, 10]]

DG_BASE[15] = 5
DG_MONSTER_TABLE[15] = [[43, 10]]  

  #--------------------------------------------------------------------------
  # ○ フロアパターン20まで
  #--------------------------------------------------------------------------
DG_BASE[16] = 1  
DG_MONSTER_TABLE[16] = [
[11, 3],[12, 3],[13, 3],[14, 5],[15, 5],[16, 7], [17, 7], [18, 8], [19, 3], [20, 3]]

DG_BASE[17] = 2
DG_MONSTER_TABLE[17] = [
[11, 2],[12, 2],[13, 2],[14, 3],[15, 5],[16, 8], [17, 10], [18, 10], [19, 3], [20, 3]]

DG_BASE[18] = 3
DG_MONSTER_TABLE[18] = [
[11, 1],[12, 1],[13, 1],[14, 3],[15, 5],[16, 5], [17, 8], [18, 10], [19, 7], [20, 5]]

DG_BASE[19] = 4   
DG_MONSTER_TABLE[19] = [
[12, 1],[14, 3],[15, 5],[16, 5], [17, 8], [18, 8], [19, 10], [20, 10],[21, 5],[22, 3],[23, 3]]

DG_BASE[20] = 5
DG_MONSTER_TABLE[20] = [[44, 10]]  


  #--------------------------------------------------------------------------
  # ○ フロアパターン21~60まで エクセルで作成
  #--------------------------------------------------------------------------
  
DG_BASE[21] = 1
DG_BASE[22] = 2
DG_BASE[23] = 3
DG_BASE[24] = 4
DG_BASE[25] = 5

DG_BASE[26] = 1
DG_BASE[27] = 2
DG_BASE[28] = 3
DG_BASE[29] = 4
DG_BASE[30] = 5

DG_BASE[31] = 1
DG_BASE[32] = 2
DG_BASE[33] = 3
DG_BASE[34] = 4
DG_BASE[35] = 5

DG_BASE[36] = 1
DG_BASE[37] = 2
DG_BASE[38] = 3
DG_BASE[39] = 4
DG_BASE[40] = 5

DG_BASE[41] = 1
DG_BASE[42] = 2
DG_BASE[43] = 3
DG_BASE[44] = 4
DG_BASE[45] = 5

DG_BASE[46] = 1
DG_BASE[47] = 2
DG_BASE[48] = 3
DG_BASE[49] = 4
DG_BASE[50] = 5

DG_BASE[51] = 1
DG_BASE[52] = 2
DG_BASE[53] = 3
DG_BASE[54] = 4
DG_BASE[55] = 5

DG_BASE[56] = 1
DG_BASE[57] = 2
DG_BASE[58] = 3
DG_BASE[59] = 4
DG_BASE[60] = 5

DG_MONSTER_TABLE[21] = [[12,3],[14,4],[15,7],[16,8],[17,10],[18,10],[19,7],[20,5],[21,3],[22,3],[23,3]]
DG_MONSTER_TABLE[22] = [[12,3],[14,4],[15,7],[16,8],[17,10],[18,10],[19,7],[20,5],[21,3],[22,3],[23,3]]
DG_MONSTER_TABLE[23] = [[16,3],[17,4],[18,7],[19,8],[20,10],[21,10],[22,7],[23,5],[24,3],[25,3]]
DG_MONSTER_TABLE[24] = [[16,3],[17,4],[18,7],[19,8],[20,10],[21,10],[22,7],[23,5],[24,3],[25,3],[26,3]]
DG_MONSTER_TABLE[25] = [[45,3]]
DG_MONSTER_TABLE[26] = [[17,3],[18,4],[19,7],[20,8],[21,10],[22,10],[23,7],[24,5],[25,3],[26,3],[27,3]]
DG_MONSTER_TABLE[27] = [[17,3],[20,4],[21,7],[22,8],[23,10],[24,10],[25,7],[26,5],[27,3],[28,3],[29,3]]
DG_MONSTER_TABLE[28] = [[17,3],[20,4],[21,7],[22,8],[23,10],[24,10],[25,7],[26,5],[27,3],[28,3],[29,3],[30,10]]
DG_MONSTER_TABLE[29] = [[17,3],[20,4],[21,7],[22,8],[23,10],[24,10],[25,7],[26,5],[27,3],[28,3],[29,3],[30,10],[31,10]]
DG_MONSTER_TABLE[30] = [[46,3]]
DG_MONSTER_TABLE[31] = [[17,3],[20,4],[22,7],[23,8],[24,10],[25,10],[26,7],[27,5],[28,3],[29,3],[30,3],[31,10],[32,10]]
DG_MONSTER_TABLE[32] = [[17,3],[20,4],[23,7],[24,8],[25,10],[26,10],[27,7],[28,5],[29,3],[30,3],[31,3],[32,10]]
DG_MONSTER_TABLE[33] = [[17,3],[20,4],[24,7],[25,8],[26,10],[27,10],[28,7],[29,5],[30,3],[31,3],[32,3]]
DG_MONSTER_TABLE[34] = [[17,3],[27,4],[29,7],[30,10],[31,3],[32,3]]
DG_MONSTER_TABLE[35] = [[47,3]]
DG_MONSTER_TABLE[36] = [[17,3],[27,4],[29,7],[30,8],[31,3],[32,3]]
DG_MONSTER_TABLE[37] = [[17,3],[30,4],[31,7],[32,3]]
DG_MONSTER_TABLE[38] = [[17,3],[30,4],[31,7],[32,3]]
DG_MONSTER_TABLE[39] = [[17,3],[23,4],[27,7],[29,8],[30,10],[31,3],[32,3]]
DG_MONSTER_TABLE[40] = [[48,3]]
DG_MONSTER_TABLE[40] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[41] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[42] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[43] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[44] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[45] = [[49,3]]
DG_MONSTER_TABLE[46] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[47] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[48] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[49] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[50] = [[50,3]]
DG_MONSTER_TABLE[51] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[52] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[53] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[54] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[55] = [[51,3]]
DG_MONSTER_TABLE[56] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[57] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,10],[31,5],[32,3]]
DG_MONSTER_TABLE[58] = [[17,1],[21,1],[24,1],[26,8],[27,10],[29,10],[30,7],[31,10],[32,3]]
DG_MONSTER_TABLE[59] = [[17,1],[21,1],[24,1],[26,1],[27,1],[29,2],[30,2],[31,2],[32,10]]
DG_MONSTER_TABLE[60] = [[52,3]]


  
  
  #--------------------------------------------------------------------------
  # ○ フロアパターン99の設定 未使用
  #--------------------------------------------------------------------------
  DG_BASE[99] = 1             # 設定省略時に使う親フロア
#~   DG_CURSE_RATE[99] = 100     # 剣と盾以外のものが呪われている確率
  DG_WEATHER[99] = [3, 8]     # フロアの天候
  DG_ITEM_TABLE[99] = []      # 出現アイテム
  DG_ITEM_TABLE[99].push([0, 32, 5])
#~   DG_ITEM_TABLE[99].push([2, 65, 5])
#~   DG_ITEM_TABLE[99].push([0, 56, 5])
#~   DG_ITEM_TABLE[99].push([5, 0, 1000])  # お金
  DG_MONSTER_TABLE[99] = [    # 出現モンスター
    [1, 10]
  ]
  DG_TRAP_TABLE[99] = [       # 出現ワナ
    [121, 5]
  ]
  DG_SHOP_RATE[99] = 100      # お店の出現率

  #--------------------------------------------------------------------------
  # ○ フロアパターン101の設定 イージー
  #--------------------------------------------------------------------------
  DG_BASE[101]            = nil # 設定省略時に使う親フロア
  DG_SIZE[101]            = [50, 37]  # フロア全体のサイズ
  DG_ROOM_MIN[101]        = 5   # 部屋の最小サイズ
  DG_ROOM_MARGIN[101]     = 2   # 部屋の周りの余白(部屋と区画の間隔です、下限2)
  DG_NOSPLIT_RATE[101]    = 10  # 数値が大きいほど部屋数が少なくなりやすい(%)
  DG_ADD_COUPLE_RATE[101] = 4   # 数値が大きいほど通路が複雑になりやすい(%)
  DG_MANY_ROOM_RATE[101]  = 10  # 部屋数が最大になるようにフロア作る確率(%)
  DG_MAX_ROOM_RATE[101]   = 20  # 区画内での最高サイズの部屋を強制的に作る確率(%)
  DG_TILE[101] = [1552, 5888, 536, 265] # 使用するタイルパターン
  DG_MONSTER_NUM[101]     = 8   # モンスターの初期配置数
  DG_MONSTER_MAX[101]     = 20#32  # モンスターの最大数
  DG_MONSTER_TABLE[101] = [     # 出現モンスター
#   [3, 10], [4, 8]
[1, 10], [2, 10], [3, 10], [4, 10]
  ]
  DG_ITEM_MAX[101]        = 10  # アイテム初期配置数の最大
  DG_ITEM_TABLE[101] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
  for i in 1..18    do DG_ITEM_TABLE[101].push([0, i, 5]) end    # 草
  for i in 31..52   do DG_ITEM_TABLE[101].push([0, i, 5]) end    # 巻物
  for i in 61..68   do DG_ITEM_TABLE[101].push([0, i, 5]) end    # 杖
  for i in 81..85   do DG_ITEM_TABLE[101].push([0, i, 5]) end    # 壷
  for i in 101..104 do DG_ITEM_TABLE[101].push([0, i, 5]) end    # 食料
  for i in 111..113 do DG_ITEM_TABLE[101].push([0, i, 5]) end    # 矢
   
  for i in 1..9     do DG_ITEM_TABLE[101].push([1, i, 5]) end    # 武器 1..8
  for i in 1..5     do DG_ITEM_TABLE[101].push([2, i, 5]) end    # 防具 1..5
  for i in 21..26   do DG_ITEM_TABLE[101].push([2, i, 5]) end    # 指輪
  DG_GOLD_RATE[101]       = 11  # お金出現率(%)
  DG_DROP_RATE[101]       = 16  # モンスターの共通アイテムドロップ率(1/n)
  DG_TRAP_MAX[101]        = 5  # トラップの最大数
  DG_TRAP_NUM[101]        = 2  # トラップの初期配置数
  DG_TRAP_TABLE[101] = []       # 出現ワナ #ここでエラーでる
  for i in 121..137 do DG_TRAP_TABLE[101].push([i, 5]) end
  DG_CURSE_RATE[101]      = 0#0#8   # 剣と盾以外のものが呪われている確率
  DG_SLEEP_RATE[101]      = 80  # 出現モンスターが眠っている確率
  DG_REPOP_TURN[101]      = 20  # モンスター再出現間隔(経過するまで再出現判定なし)
  DG_REPOP_RATE[101]      = 10  # モンスター再出現確率
  DG_BGM[101]             = ["Audio/BGM/Dungeon1.mid", 100, 100]
  DG_BGS[101]             = ["Audio/BGS/Drips.ogg", 80, 100]
  DG_HOUSE_BGM[101]       = ["Audio/BGM/Battle1.mid", 100, 100]
  DG_SHOP_BGM[101]        = ["Audio/BGM/Scene4.mid", 100, 100]
  DG_THIEF_BGM[101]       = ["Audio/BGM/Battle5.mid", 100, 100]
  DG_WEATHER[101]         = [0, 0]  # フロアの天候
  DG_SHOP_RATE[101]       = 10#30  # お店の出現率
  DG_SHOP_KEEPER[101]     = 55   # 店主のモンスターID
  DG_SHOP_GUARD[101]      = 55   # 番犬のモンスターID
  DG_HOUSE_RATE[101]      = 5  # モンスターハウス出現率
  DG_HOUSE_MONSTER_NUM[101] = 10#20  # モンスターハウスにいるモンスターの数
  DG_HOUSE_ITEM_NUM[101]  = 20  # モンスターハウスにあるアイテムの数
  DG_HOUSE_TRAP_NUM[101]  = 5  # モンスターハウスにあるワナの数

  #--------------------------------------------------------------------------
  # ○ フロアパターン102の設定
  #--------------------------------------------------------------------------
  DG_BASE[102] = 101              # 設定省略時に使う親フロア
  DG_MONSTER_TABLE[102] = [     # 出現モンスター
[1, 10], [2, 10], [3, 10], [4, 10], [5, 5], [6, 5]
  ]
  DG_TILE[102] = [1570, 6752, 77, 267] #[1591, 7760, 543, 267] # 使用するタイルパターン
  #--------------------------------------------------------------------------
  # ○ フロアパターン103の設定
  #--------------------------------------------------------------------------
  DG_BASE[103] = 101            # 設定省略時に使う親フロア
  DG_MONSTER_TABLE[103] = [     # 出現モンスター
[1, 10], [2, 10], [3, 10], [4, 10], [5, 5], [6, 5]
  ]
  DG_TILE[103] = [1588, 7616, 540, 264]#[1570, 6752, 77, 267] # 使用するタイルパターン
  #--------------------------------------------------------------------------
  # ○ フロアパターン104の設定
  #--------------------------------------------------------------------------
  DG_BASE[104] = 101              # 設定省略時に使う親フロア
  DG_MONSTER_TABLE[104] = [     # 出現モンスター
[2, 3], [3, 3], [4, 3], [5, 10], [6, 10], [7, 5], [8, 5], [9, 5]
  ]
  DG_TILE[104] = [1586, 7520, 538, 267]#[1586, 7520, 538, 267] # 使用するタイルパターン
  #--------------------------------------------------------------------------
  # ○ フロアパターン105の設定 ★BOSS
  #--------------------------------------------------------------------------
  DG_BASE[105] = 101             # 設定省略時に使う親フロア
  DG_MONSTER_TABLE[105] = [     # 出現モンスター
   [41, 10]#[20, 10]# [41, 10]
  ]
  DG_TILE[105] = [1591, 7760, 543, 267]#[1588, 7616, 540, 264] # 使用するタイルパターン
  DG_MONSTER_NUM[105]     = 1#20#1   # モンスターの初期配置数
  DG_MONSTER_MAX[105]     = 1#20#1#32  # モンスターの最大数
  DG_SHOP_RATE[105]       = 0#30  # お店の出現率
  DG_HOUSE_RATE[105]      = 0  # モンスターハウス出現率
  DG_REPOP_RATE[105]      = 0  # モンスター再出現確率
  
  #--------------------------------------------------------------------------
  # ○ フロアパターン110まで
  #--------------------------------------------------------------------------
DG_BASE[106] = 101
DG_MONSTER_TABLE[106] = [
[2, 3], [3, 3], [4, 3], [5, 10], [6, 10], [7, 5], [8, 5], [9, 5], [10, 5], [33, 5]]

DG_BASE[107] = 102
DG_MONSTER_TABLE[107] = [
[2, 3], [3, 3], [4, 3], [5, 10], [6, 10], [7, 5], [8, 5], [9, 5], [10, 5], [33, 5]]

DG_BASE[108] = 103
DG_MONSTER_TABLE[108] = [
[5, 3], [6, 3], [7, 5], [8, 5], [9, 10], [10, 10],[11, 5],[12, 3], [33, 5]]

DG_BASE[109] = 104   
DG_MONSTER_TABLE[109] = [
[6, 3], [7, 3], [8, 5], [9, 5], [10, 10],[11, 10],[12, 5],[13, 3], [33, 5]]

DG_BASE[110] = 105
DG_MONSTER_TABLE[110] = [[42, 10]]
  
  #--------------------------------------------------------------------------
  # ○ フロアパターン115まで
  #--------------------------------------------------------------------------
DG_BASE[111] = 101  
DG_MONSTER_TABLE[111] = [
[6, 3], [7, 3], [8, 5], [9, 5], [10, 10],[11, 10],[12, 5],[13, 3], [33, 5]]

DG_BASE[112] = 102
DG_MONSTER_TABLE[112] = [
[8, 2], [9, 3], [10, 4],[11, 5],[12, 6],[13, 8],[14, 10], [15, 8],[16, 3], [17, 3]]

DG_BASE[113] = 103
DG_MONSTER_TABLE[113] = [
[8, 1], [9, 2], [10, 3],[11, 3],[12, 5],[13, 8],[14, 10], [15, 10],[16, 5], [17, 3]]

DG_BASE[114] = 104   
DG_MONSTER_TABLE[114] = [
[8, 1], [9, 2], [10, 3],[11, 3],[12, 5],[13, 8],[14, 10], [15, 10],[16, 10], [17, 10]]

DG_BASE[115] = 105
DG_MONSTER_TABLE[115] = [[43, 10]]  

  #--------------------------------------------------------------------------
  # ○ フロアパターン120まで
  #--------------------------------------------------------------------------
DG_BASE[116] = 101  
DG_MONSTER_TABLE[116] = [
[11, 3],[12, 3],[13, 3],[14, 5],[15, 5],[16, 7], [17, 7], [18, 8], [19, 3], [20, 3]]

DG_BASE[117] = 102
DG_MONSTER_TABLE[117] = [
[11, 2],[12, 2],[13, 2],[14, 3],[15, 5],[16, 8], [17, 10], [18, 10], [19, 3], [20, 3]]

DG_BASE[118] = 103
DG_MONSTER_TABLE[118] = [
[11, 1],[12, 1],[13, 1],[14, 3],[15, 5],[16, 5], [17, 8], [18, 10], [19, 7], [20, 5]]

DG_BASE[119] = 104   
DG_MONSTER_TABLE[119] = [
[12, 1],[14, 3],[15, 5],[16, 5], [17, 8], [18, 8], [19, 10], [20, 10],[21, 5],[22, 3],[23, 3]]

DG_BASE[120] = 105
DG_MONSTER_TABLE[120] = [[44, 10]]
  
  #--------------------------------------------------------------------------
  # ○ フロアパターン121~160まで エクセルで作成
  #--------------------------------------------------------------------------
DG_BASE[121] = 101
DG_BASE[122] = 102
DG_BASE[123] = 103
DG_BASE[124] = 104
DG_BASE[125] = 105

DG_BASE[126] = 101
DG_BASE[127] = 102
DG_BASE[128] = 103
DG_BASE[129] = 104
DG_BASE[130] = 105

DG_BASE[131] = 101
DG_BASE[132] = 102
DG_BASE[133] = 103
DG_BASE[134] = 104
DG_BASE[135] = 105

DG_BASE[136] = 101
DG_BASE[137] = 102
DG_BASE[138] = 103
DG_BASE[139] = 104
DG_BASE[140] = 105

DG_BASE[141] = 101
DG_BASE[142] = 102
DG_BASE[143] = 103
DG_BASE[144] = 104
DG_BASE[145] = 105

DG_BASE[146] = 101
DG_BASE[147] = 102
DG_BASE[148] = 103
DG_BASE[149] = 104
DG_BASE[150] = 105

DG_BASE[151] = 101
DG_BASE[152] = 102
DG_BASE[153] = 103
DG_BASE[154] = 104
DG_BASE[155] = 105

DG_BASE[156] = 101
DG_BASE[157] = 102
DG_BASE[158] = 103
DG_BASE[159] = 104
DG_BASE[160] = 105  
  
  
DG_MONSTER_TABLE[121] = [[12,3],[14,4],[15,7],[16,8],[17,10],[18,10],[19,7],[20,5],[21,3],[22,3],[23,3]]
DG_MONSTER_TABLE[122] = [[12,3],[14,4],[15,7],[16,8],[17,10],[18,10],[19,7],[20,5],[21,3],[22,3],[23,3]]
DG_MONSTER_TABLE[123] = [[16,3],[17,4],[18,7],[19,8],[20,10],[21,10],[22,7],[23,5],[24,3],[25,3]]
DG_MONSTER_TABLE[124] = [[16,3],[17,4],[18,7],[19,8],[20,10],[21,10],[22,7],[23,5],[24,3],[25,3],[26,3]]
DG_MONSTER_TABLE[125] = [[45,3]]
DG_MONSTER_TABLE[126] = [[17,3],[18,4],[19,7],[20,8],[21,10],[22,10],[23,7],[24,5],[25,3],[26,3],[27,3]]
DG_MONSTER_TABLE[127] = [[17,3],[20,4],[21,7],[22,8],[23,10],[24,10],[25,7],[26,5],[27,3],[28,3],[29,3]]
DG_MONSTER_TABLE[128] = [[17,3],[20,4],[21,7],[22,8],[23,10],[24,10],[25,7],[26,5],[27,3],[28,3],[29,3],[30,10]]
DG_MONSTER_TABLE[129] = [[17,3],[20,4],[21,7],[22,8],[23,10],[24,10],[25,7],[26,5],[27,3],[28,3],[29,3],[30,10],[31,10]]
DG_MONSTER_TABLE[130] = [[46,3]]
DG_MONSTER_TABLE[131] = [[17,3],[20,4],[22,7],[23,8],[24,10],[25,10],[26,7],[27,5],[28,3],[29,3],[30,3],[31,10],[32,10]]
DG_MONSTER_TABLE[132] = [[17,3],[20,4],[23,7],[24,8],[25,10],[26,10],[27,7],[28,5],[29,3],[30,3],[31,3],[32,10]]
DG_MONSTER_TABLE[133] = [[17,3],[20,4],[24,7],[25,8],[26,10],[27,10],[28,7],[29,5],[30,3],[31,3],[32,3]]
DG_MONSTER_TABLE[134] = [[17,3],[27,4],[29,7],[30,10],[31,3],[32,3]]
DG_MONSTER_TABLE[135] = [[47,3]]
DG_MONSTER_TABLE[136] = [[17,3],[27,4],[29,7],[30,8],[31,3],[32,3]]
DG_MONSTER_TABLE[137] = [[17,3],[30,4],[31,7],[32,3]]
DG_MONSTER_TABLE[138] = [[17,3],[30,4],[31,7],[32,3]]
DG_MONSTER_TABLE[139] = [[17,3],[23,4],[27,7],[29,8],[30,10],[31,3],[32,3]]
DG_MONSTER_TABLE[140] = [[48,3]]

#DG_MONSTER_TABLE[140] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]

DG_MONSTER_TABLE[141] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[142] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[143] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[144] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
DG_MONSTER_TABLE[145] = [[49,3]]



#~ DG_MONSTER_TABLE[146] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
#~ DG_MONSTER_TABLE[147] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
#~ DG_MONSTER_TABLE[148] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
#~ DG_MONSTER_TABLE[149] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
#~ DG_MONSTER_TABLE[150] = [[50,3]]
#~ DG_MONSTER_TABLE[151] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
#~ DG_MONSTER_TABLE[152] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
#~ DG_MONSTER_TABLE[153] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
#~ DG_MONSTER_TABLE[154] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
#~ DG_MONSTER_TABLE[155] = [[51,3]]
#~ DG_MONSTER_TABLE[156] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,7],[31,5],[32,3]]
#~ DG_MONSTER_TABLE[157] = [[17,3],[21,4],[24,7],[26,8],[27,10],[29,10],[30,10],[31,5],[32,3]]
#~ DG_MONSTER_TABLE[158] = [[17,1],[21,1],[24,1],[26,8],[27,10],[29,10],[30,7],[31,10],[32,3]]
#~ DG_MONSTER_TABLE[159] = [[17,1],[21,1],[24,1],[26,1],[27,1],[29,2],[30,2],[31,2],[32,10]]
#~ DG_MONSTER_TABLE[160] = [[52,3]]

#--------------------------------------------------------------------------
#アイテム設定
#--------------------------------------------------------------------------
#ハード 20-29F
for f in 20..29
DG_ITEM_TABLE[f] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
  for i in 1..18    do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 草
  for i in 31..52   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 巻物
  for i in 61..68   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 杖
  for i in 81..85   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 壷
  for i in 101..104 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 食料
  for i in 111..113 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 矢
   
  for i in 1..10     do DG_ITEM_TABLE[f].push([1, i, 5]) end    # 武器 雷神の剣ついか
  for i in 1..6     do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 防具 1..5
  for i in 21..26   do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 指輪
end
for f in 30..39
DG_ITEM_TABLE[f] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
  for i in 1..18    do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 草
  for i in 31..52   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 巻物
  for i in 61..68   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 杖
  for i in 81..85   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 壷
  for i in 101..104 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 食料
  for i in 111..113 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 矢
   
  for i in 1..11     do DG_ITEM_TABLE[f].push([1, i, 5]) end    # 武器 剣ついか
  for i in 1..7     do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 防具 1..5
  for i in 21..26   do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 指輪
end
for f in 40..49
DG_ITEM_TABLE[f] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
  for i in 1..18    do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 草
  for i in 31..52   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 巻物
  for i in 61..68   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 杖
  for i in 81..85   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 壷
  for i in 101..104 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 食料
  for i in 111..113 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 矢
   
  for i in 1..12     do DG_ITEM_TABLE[f].push([1, i, 5]) end    # 武器 剣ついか
  for i in 1..8     do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 防具 1..5
  for i in 21..26   do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 指輪
end
for f in 50..60
DG_ITEM_TABLE[f] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
  for i in 1..18    do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 草
  for i in 31..52   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 巻物
  for i in 61..68   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 杖
  for i in 81..85   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 壷
  for i in 101..104 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 食料
  for i in 111..113 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 矢
   
  for i in 1..13     do DG_ITEM_TABLE[f].push([1, i, 5]) end    # 武器 剣ついか
  for i in 1..9     do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 防具 1..5
  for i in 21..26   do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 指輪
end
#イージー
for f in 120..129
DG_ITEM_TABLE[f] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
  for i in 1..18    do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 草
  for i in 31..52   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 巻物
  for i in 61..68   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 杖
  for i in 81..85   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 壷
  for i in 101..104 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 食料
  for i in 111..113 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 矢
   
  for i in 1..10     do DG_ITEM_TABLE[f].push([1, i, 5]) end    # 武器 雷神の剣ついか
  for i in 1..6     do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 防具 1..5
  for i in 21..26   do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 指輪
end
for f in 130..139
DG_ITEM_TABLE[f] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
  for i in 1..18    do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 草
  for i in 31..52   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 巻物
  for i in 61..68   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 杖
  for i in 81..85   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 壷
  for i in 101..104 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 食料
  for i in 111..113 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 矢
   
  for i in 1..11     do DG_ITEM_TABLE[f].push([1, i, 5]) end    # 武器 剣ついか
  for i in 1..7     do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 防具 1..5
  for i in 21..26   do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 指輪
end
for f in 140..145
DG_ITEM_TABLE[f] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
  for i in 1..18    do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 草
  for i in 31..52   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 巻物
  for i in 61..68   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 杖
  for i in 81..85   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 壷
  for i in 101..104 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 食料
  for i in 111..113 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 矢
   
  for i in 1..12     do DG_ITEM_TABLE[f].push([1, i, 5]) end    # 武器 剣ついか
  for i in 1..8     do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 防具 1..5
  for i in 21..26   do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 指輪
end
#~ for f in 150..160
#~  DG_ITEM_TABLE[f] = []       # 出現アイテム ★たくさん代入するほど出やすいっぽい
#~   for i in 1..18    do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 草
#~   for i in 31..52   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 巻物
#~   for i in 61..68   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 杖
#~   for i in 81..85   do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 壷
#~   for i in 101..104 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 食料
#~   for i in 111..113 do DG_ITEM_TABLE[f].push([0, i, 5]) end    # 矢
#~     
#~   for i in 1..13     do DG_ITEM_TABLE[f].push([1, i, 5]) end    # 武器 剣ついか
#~   for i in 1..9     do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 防具 1..5
#~   for i in 21..26   do DG_ITEM_TABLE[f].push([2, i, 5]) end    # 指輪
#~ end


  
  #--------------------------------------------------------------------------
  # ○ ダンジョン1の設定 ★ハード
  #--------------------------------------------------------------------------
  DG_NAME[1] = "もっと不気味なダンジョン"      # ダンジョン名
  DG_FLOOR[1] = [                          # 使用するフロアパターン
   # nil, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, nil
        nil,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,nil

  ]
  DG_JUDGE_ITEM[1] = []#[55, 60, 65, 70, 90, 95, 100]#[55, 60, 65, 70, 90]#[55, 60, 65, 70, 75,80,85,90,95,100]#[55, 60, 65, 70, 90]#これだと剣は未鑑定                    # 識別済みのアイテム種別
  
  #--------------------------------------------------------------------------
  # ○ ダンジョン2の設定
  #--------------------------------------------------------------------------
  DG_NAME[2] = "ボステストダンジョン"
  DG_FLOOR[2] = [
    nil, 5, nil
#    nil, 99, nil
   
  ]
  DG_JUDGE_ITEM[2] = [
    55, 60, 65, 70, 90
  ]

  #--------------------------------------------------------------------------
  # ○ ダンジョン3の設定 ★イージー
  #--------------------------------------------------------------------------
  DG_NAME[3] = "不気味なダンジョン"    # ダンジョン名
  DG_FLOOR[3] = [                          # 使用するフロアパターン
        nil,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,nil#146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,nil
#        nil,101,nil

        ]
  DG_JUDGE_ITEM[3] = [                     # 識別済みのアイテム種別
    55, 60, 65, 70, 90
  ]
  
end

# ダンジョンメッセージには以下の制御文字が使えます
#     \\C[n]    文字色変更
#     \\I[n]    アイテムアイコン描画
#     \\.       ウェイト15フレーム
module Vocab
  DgCurse =     "%sは呪われている!"
  DgGather =    "%sを拾った。"
  DgSwing =     "\\C[6]%s\\C[0]は%sを振った!"
  DgThrow =     "\\C[6]%s\\C[0]は%sを投げた!"
  DgShot =      "\\C[6]%s\\C[0]は%sを投げた"#撃った!"
  DgRide =      "%sの上に乗った。"
  DgDrop =      "%sを地面に置いた。"
  DgEquip =     "%sを装備した。"
  DgEvasion =   "\\C[6]%s\\C[0]の攻撃はあたらなかった。"
  DgEat =       "\\C[6]%s\\C[0]は%sを食べた!"
  DgDrink =     "\\C[6]%s\\C[0]は%sを飲んだ!"
  DgRead =      "\\C[6]%s\\C[0]は%sを読んだ!"
  DgJudge =     "なんと!%sは%sだった!"
  DgHpRecover = "\\C[6]%s\\C[0]のHPが\\C[4]%d\\C[0]回復した!"
  DgHpDamage =  "\\C[6]%s\\C[0]は\\C[4]%d\\C[0]のダメージを受けた!"
  DgHungry = [
    "お腹が減ってきた…",
    "お腹が減りすぎて目が回ってきた。",
    "だめだ! もう倒れそうだ!",
    "早く…何か食べないと…",
    "飢え死にしてしまう!"
  ]
  DgFood =      "\\C[6]%s\\C[0]のお腹がふくれた。"
  DgFoodMax =   "\\C[6]%s\\C[0]は満腹になった。"
  DgDead =      "\\C[6]%s\\C[0]はたおれた。\\."
  DgExp =       "\\C[6]%s\\C[0]は\\C[4]%d\\C[0]の経験値を得た。\\."
  DgLevelup =   "\\C[6]%s\\C[0]はレベル\\C[4]%d\\C[0]になった!"
  DgLeveldown = "\\C[6]%s\\C[0]のレベルが\\C[4]%d\\C[0]下がった。"
  DgOnTrap =    "%sをふんだ。"
  DgMissTrap =  "しかし作動しなかった。"
  DgSilent =    "\\C[6]%s\\C[0]は口が使えない。"
  DgShopIn =    "いらっしゃいませ。"
  DgShopOut =   "ありがとうございました。"
  DgShopSell =  "お客様が店に置いた商品を\\C[4]%d\\C[0]Gで買い取ります。"
  DgShopBuy =   "代金\\C[4]%d\\C[0]Gいただきます。"
  DgShopFailed = "お金が足りません。"
  DgThief =     "ドロボー!"
  DgHouse =     "モンスターハウスだ!"
end

module Sound
  def self.play_curse         # 呪いME
    Audio.me_play("Audio/ME/Shock.mid", 80, 100)
  end
  def self.play_levelup       # レベルアップSE
    Audio.me_play("Audio/SE/Applause.ogg", 80, 100)
  end
  def self.play_leveldown     # レベルダウンSE
    Audio.me_play("Audio/SE/Down.ogg", 80, 50)
  end
  def self.play_gather        # 拾うSE
    Audio.se_play("Audio/SE/Open1.ogg", 80, 150)
  end
  def self.play_remove        # はずすSE
    Audio.se_play("Audio/SE/Open3.ogg", 80, 150)
  end
  def self.play_throw         # 投げるSE
    Audio.se_play("Audio/SE/Wind10.ogg", 80, 150)
  end
  def self.play_sort          # 整頓SE
    Audio.se_play("Audio/SE/Chime2.ogg", 80, 150)
  end
  def self.play_move          # すすむSE
    Audio.se_play("Audio/SE/Move.ogg", 80, 100)
  end
  def self.play_trap          # 踏むSE
    Audio.se_play("Audio/SE/Switch2.ogg", 80, 100)
  end
  def self.play_pot_break     # 壷が割れるSE
    Audio.se_play("Audio/SE/Crash.ogg", 80, 80)
  end
  def self.play_shot          # 矢を撃つSE
    Audio.se_play("Audio/SE/Bow1.ogg", 80, 100)
  end
end

#==============================================================================
# ■ 設定はここまで
#==============================================================================

module DUNG::Commands
  module_function
  #--------------------------------------------------------------------------
  # ○ ダンジョンの開始
  #--------------------------------------------------------------------------
  def dungeon_start(dungeon_id)
    $game_temp.map_bgm = RPG::BGM.last
    $game_temp.map_bgs = RPG::BGS.last
    RPG::BGM.stop
    RPG::BGS.stop
    Sound.play_move
    $game_dungeon.new_game(dungeon_id)
    $scene = Scene_Dungeon.new
  end
  #--------------------------------------------------------------------------
  # ○ ダンジョン用パラメータの初期化
  #--------------------------------------------------------------------------
  def reset_dparam
    $game_party.reset_dparam
  end
  #--------------------------------------------------------------------------
  # ○ ダンジョン用アイテムの初期化
  #--------------------------------------------------------------------------
  def reset_ditem
   # p"アイテム初期化"
    $game_party.reset_ditem
  end
  #--------------------------------------------------------------------------
  # ○ ダンジョン用アイテムの追加
  #--------------------------------------------------------------------------
  def gain_ditem(type, id, plus = nil, option = nil, extends = [])
    ditem = Game_DItem.new(type, id, plus, option, extends)
    $game_party.gain_ditem(ditem)
  end
  #--------------------------------------------------------------------------
  # ○ ダンジョン用お金の初期化
  #--------------------------------------------------------------------------
  def reset_dgold
    $game_party.reset_dgold
  end
  #--------------------------------------------------------------------------
  # ○ 満腹度の初期化
  #--------------------------------------------------------------------------
  def reset_energy
    $game_party.reset_energy
  end
  #--------------------------------------------------------------------------
  # ○ ちからの初期化
  #--------------------------------------------------------------------------
  def reset_power
    $game_party.reset_power
  end
end
class Game_Interpreter
  include DUNG::Commands
end


module RPG
  class Item < UsableItem
    def category
      return 85 if @note =~ /<矢>/i
      return 80 if @note =~ /<食料>/i
      return 75 if @note =~ /<肉>/i
      return 70 if @note =~ /<草>/i
      return 65 if @note =~ /<巻物>/i
      return 60 if @note =~ /<杖>/i
      return 55 if @note =~ /<壷>/i
      return 50 if @note =~ /<お金>/i
      return 10 if @note =~ /<ワナ>/i
    end
  end
  class Weapon < BaseItem
    def category
      return 100
    end
    def extends
      result = []
      result.push(128) if note =~ /<掘>/i
      result.push(129) if note =~ /<壊>/i
      return result
    end
    def speed
      return agi
    end
  end
  class Armor < BaseItem
    def category
      return (kind == 0 ? 95 : 90)
    end
    def speed
      return agi
    end
  end
end

[/pre]就是像elona里面那样可以把墙破坏一样,我记得vx有看见过类似的脚本,只不过他是在迷宫里面可以实现。在迷宫里面可以挖墙就好。上面的是vx不知道可不可以转va
梦石
0
星屑
9292
在线时间
2504 小时
注册时间
2011-5-20
回帖
14521

开拓者

发表于 2017-12-17 17:45:09 | 显示全部楼层
首先直接拉进去看看能不能用,不能再做修改
有的脚本可能是可以通用的
xp里有直接改指定位置图块id再刷新地图的破坏墙壁的方式

如果只是单个迷宫地图要这样做的话用事件也可以,对墙壁事件使用某个道具,然后把事件变空白

点评

那个这个脚本不通用,事件的话我用是随机迷宫生产的那个脚本,根本不知道哪里是墙怎么做事件。  发表于 2017-12-17 18:08
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部