查看: 1466|回复: 2

[已经解决] VX A土块遮挡脚本

[复制链接]
梦石
0
星屑
50
在线时间
140 小时
注册时间
2011-10-9
回帖
7
发表于 2012-6-9 09:02:35 | 显示全部楼层 |阅读模式

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

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

×
就是像这样子的:

未命名.jpg


魂之轮回的那个神马地图加强脚本。
就是人物走在图块下或图块旁边的时候,
自动透明化+穿透。


可是!!!
我这个傻逼竟然找不到这个脚本啊啊啊啊啊!!!(在范例里)


那位大大有的请发一下,谢谢咯~
[
梦石
0
星屑
50
在线时间
242 小时
注册时间
2011-12-10
回帖
223
发表于 2012-6-9 09:50:44 | 显示全部楼层
你想知道?我们不告诉你,可怜的人呐,慢慢研究吧~

点评

居所这样子回帖会被版主当作水帖封杀的...  发表于 2012-6-9 10:11
话说自己找出来比较容易理解~  发表于 2012-6-9 09:51

评分

参与人数 1星屑 -40 收起 理由
Luciffer -40 小警告下。。。

查看全部评分

回复

使用道具 举报

54酱是大笨蛋!

梦石
0
星屑
66
在线时间
1389 小时
注册时间
2011-2-23
回帖
4940
发表于 2012-6-9 10:30:35 | 显示全部楼层
  1. #============================================================================
  2. #
  3. # ■壁タイル拡張 □Ver.4.21 □製作者:月紳士
  4. # ・RPGツクールVX用 RGSS2スクリプト
  5. #
  6. #    ●…書き換えメソッド(競合注意) ◎…メソッドのエイリアス ○…新規メソッド
  7. #
  8. #  ※二次配布禁止!配布元には利用規約があります。必ずそちらを見てください。
  9. #------------------------------------------------------------------------------
  10. # ※ このスクリプトは「段差マップ 通行判定拡張」をリネームしたものです。
  11. #------------------------------------------------------------------------------
  12. # 更新履歴
  13. #   Ver.4.21  FUNCTION_TILEのIDに説明との誤りがあった為、修正。
  14. #   Ver.4.20  イベント側からの接触判定に段違い処理を導入。
  15. #   Ver.4.13  前回の修正より、エリア系処理が機能しなくなっていた不具合の修正。
  16. #   Ver.4.12  ゲームロード時に特殊通行判定が無効になっていた不具合の修正。
  17. #   Ver.4.11  影消しタイルの不具合修正。
  18. #   Ver.4.10  マップデータの先読み機能、処理無視エリア設定の追加。
  19. #   Ver.4.00  マップ移動時の処理軽量化と様々な不具合修正。
  20. #
  21. #   ※これ以前の更新履歴はマニュアルを参考にしてください。
  22. #============================================================================
  23. =begin

  24.  このスクリプトは壁タイルの、主に通行判定を拡張し、
  25.  次のような表現を可能にします。

  26.  ○ 天井や屋根を歩くことが出来るようになる。
  27.  
  28.  ○ 壁・天井・屋根タイル・橋タイルの裏(下)へキャラが回り込む

  29.  ※ 詳しい説明はマニュアルをご覧ください。

  30. =end
  31. #------------------------------------------------------------------------------


  32. #==============================================================================
  33. # □ カスタマイズ項目
  34. #==============================================================================

  35. module Expansion_Passable
  36.   
  37.   CLIFF_MAP = [4, 5]
  38.   # 段差マップを使用するマップのID
  39.   
  40.   BACK_TILE_DEEP = false
  41.   # 壁の深さを増すなら = true に。戻すなら = false に。
  42.   
  43.   BACK_SEEING = true
  44.   # 裏回りした際、キャラを透過するなら = true に。しないなら = false に。

  45.   SHADOW_ERASER_TILE_ID = 768
  46.   # 「影消しタイル」にするタイルのIDをここで指定します。
  47.   # このタイルが不要な際は = nil としてください。
  48.   
  49.   PROHIBITED_GET_OFF_TILE_ID = 769
  50.   # 「接岸禁止」地点を示す為に使うタイルのIDをここで指定します。
  51.   # このタイルが不要な際は = nil としてください。
  52.   
  53.   ADDITION_BACK_TILE_ID = 770
  54.   # 「追加裏回り部分」を示す為に使うタイルのIDをここで指定します。
  55.   # このタイルが不要な際は = nil としてください。
  56.   
  57.   DELETE_BACK_TILE_ID = 771
  58.   # 「裏回り部分消去」を示す為に使うタイルのIDをここで指定します。
  59.   # このタイルが不要な際は = nil としてください。

  60.   ESCAPE_MAP = [99]
  61.   # 裏回り処理自体をまったく行わないマップのID
  62.   # 広いフィールドマップなどを、その読み込みを早める為に登録してください。
  63.   
  64. end

  65. #==============================================================================
  66. # □ タイル情報 ※カスタマイズ可能(上級者向け)
  67. #==============================================================================

  68. module Data_Tile
  69.   
  70.   # 擬似段差機能を使用する屋根・天井・地形タイル
  71.   FUNCTION_TILE = [
  72.    2816, 2960,                                     # 草原(フィールド用, 屋外用)
  73.    3200, 3344,                                     # 乾燥地帯(フィールド用, 屋外用)
  74.    3584, 3728,                                     # 砂漠(フィールド用, 屋外用)
  75.    3968, 4112,                                     # 雪原(フィールド用, 屋外用)
  76.    4352, 4400, 4448, 4496, 4544, 4592, 4640, 4688, # 屋根    (1列目)
  77.    4736, 4784, 4832, 4880, 4928, 4976, 5024, 5072, # 建物の壁(1列目)
  78.    5120, 5168, 5216, 5264, 5312, 5360, 5408, 5456, # 屋根    (2列目)
  79.    5504, 5552, 5600, 5648, 5696, 5744, 5792, 5840, # 建物の壁(2列目)
  80.    5888, 5936, 5984, 6032, 6080, 6128, 6176, 6224, # 洞窟の天井(1列目)
  81.    6272, 6320, 6368, 6416, 6464, 6512, 6560, 6608, # 洞窟の壁  (1列目)
  82.    6656, 6704, 6752, 6800, 6848, 6896, 6944, 6992, # 洞窟の天井(2列目)
  83.    7040, 7088, 7136, 7184, 7232, 7280, 7328, 7376, # 洞窟の壁  (2列目)
  84.    7424, 7472, 7520, 7568, 7616, 7664, 7712, 7760, # 洞窟の天井(3列目)
  85.    7808, 7856, 7904, 7952, 8000, 8048, 8096, 8144, # 洞窟の壁  (3列目)
  86.    1904, 1952, 2000]                               # ダミータイルID(消さないこと)
  87.   # ※ 機能を使いたくないタイルがあればここから削ってください。
  88.   #   (削り専用、付け加えても効果はありません)
  89.    
  90.   # 縦の橋としてあつかうタイルID
  91.   BRIDRE_LENGTH = [5]

  92.   # 横の橋としてあつかうタイルID
  93.   BRIDGE_BREADTH = [18]
  94.   
  95.   
  96.   # 階段・梯子・洞窟の入り口としてあつかうタイルID(ステップタイル)
  97.   STEP = [67, 68, 69, 70, 71, 172, 173, 174, 175,
  98.           260, 261, 262, 263, 268, 269, 270,
  99.           271, 278, 279, 284, 285, 286, 287,
  100.           612, 613, 616, 617, 618, 619,
  101.           1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607,
  102.           1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615]
  103.   # ※ これらのタイルが隣接している時に、境目の通行不可判定を無視させます。
  104.   
  105.   
  106.   # 橋の下の通行判定処理用 タイルID
  107.   UNDER_BRIDGE = 1664
  108.   # ※ デフォルトのID_1664はゲームでは使用されない、画像のないタイルです。
  109.   #    必要がなければ変更しないで結構です。
  110.   
  111. end

  112. #==============================================================================
  113. # □ オートタイル情報 ※変更はしないでください。
  114. #==============================================================================

  115. module Data_Auto_Tile
  116.   
  117.   # 境目があるチップを方向ごとに配列化したもの↓(オートタイル内でのID)
  118.   # 床タイプ
  119.   VERGE_DOWN_A = [28, 29, 30, 31, 33, 38, 39, 40, 41, 43, 44, 45, 46]
  120.   VERGE_LEFT_A = [16, 17, 18, 19, 32, 34, 35, 40, 41, 42, 43, 44, 46]
  121.   VERGE_RIGHT_A = [24, 25, 26, 27, 32, 36, 37, 38, 39, 42, 44, 45, 46]
  122.   VERGE_UP_A = [20, 21, 22, 23, 33, 34, 35, 36, 37, 42, 43, 45, 46]
  123.   
  124.   # 壁タイプ
  125.   VERGE_DOWN_B = [8, 9, 10, 11, 12, 13, 14, 15]
  126.   VERGE_LEFT_B = [1, 3, 5, 7, 9, 11, 13, 15]
  127.   VERGE_RIGHT_B = [4, 5, 6, 7, 12, 13, 14, 15]
  128.   VERGE_UP_B = [2, 3, 6, 7, 10, 11, 14, 15]

  129. end

  130. #==============================================================================
  131. # ■ RPG::Area
  132. #==============================================================================

  133. class RPG::Area
  134.   #--------------------------------------------------------------------------
  135.   # ○ 公開インスタンス変数
  136.   #--------------------------------------------------------------------------
  137.   attr_accessor :ship_pass
  138.   attr_accessor :disregard_processing
  139. end

  140. #==============================================================================
  141. # ■ Game_Map
  142. #------------------------------------------------------------------------------
  143. #  マップを扱うクラスです。スクロールや通行可能判定などの機能を持っています。
  144. # このクラスのインスタンスは $game_map で参照されます。
  145. #==============================================================================

  146. class Game_Map
  147.   #--------------------------------------------------------------------------
  148.   # ○ 公開インスタンス変数
  149.   #--------------------------------------------------------------------------
  150.   attr_reader   :map
  151.   attr_reader   :ex_data
  152.   attr_reader   :under_bridge_passages    # 橋の下の通行判定
  153.   attr_reader   :back_tiles_position      # 裏回りする座標
  154.   attr_reader   :keep_back_position       # 裏回りを維持する座標
  155.   attr_reader   :prohibited_get_off       # 接岸禁止座標
  156.   attr_reader   :ex_data                  # 拡張レイヤー用タイルデータ
  157.   #--------------------------------------------------------------------------
  158.   # ◎ セットアップ
  159.   #     map_id : マップ ID
  160.   #--------------------------------------------------------------------------
  161.   alias tig_ew_setup setup
  162.   def setup(map_id)
  163.     tig_ew_setup(map_id)
  164.     create_ex_passages
  165.     pick_up_back_tiles
  166.     setup_back_tiles
  167.     $game_player.set_on_tile
  168.     for event in $game_map.events.values
  169.       event.update_turn_back
  170.     end
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ○ 指定座標のタイルIDの取得
  174.   #--------------------------------------------------------------------------
  175.   def point_tile_id(x, y)
  176.     return [data[x, y, 0], data[x, y, 1], data[x, y, 2]]
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ○ オートタイルIDの取得(オートタイル郡の中で順番にIDをつけた独自のIDです)
  180.   #--------------------------------------------------------------------------
  181.   def auto_(tile_id)
  182.     return 0 unless (1904...8192).include?(tile_id)
  183.     return (tile_id - 1904) % 48
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # ○ トップタイルIDの取得(オートタイル郡の最初のID)
  187.   #--------------------------------------------------------------------------
  188.   def top_(tile_id)
  189.     return 0 if tile_id == nil
  190.     return (tile_id - auto_(tile_id))
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ○ スクリプト機能を使用する屋根・天井・壁タイルか?
  194.   #--------------------------------------------------------------------------
  195.   def ceiling?(tile_id)
  196.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  197.     return true if wall?(tile_id)
  198.     return true if (2000...2048).include?(tile_id)
  199.     return true if (4352...4736).include?(tile_id)
  200.     return true if (5120...5504).include?(tile_id)
  201.     return true if (5888...6272).include?(tile_id)
  202.     return true if (6656...7040).include?(tile_id)
  203.     return (7424...7808).include?(tile_id)
  204.   end
  205.   #--------------------------------------------------------------------------
  206.   # ○ スクリプト機能を使用する壁タイルか?
  207.   #--------------------------------------------------------------------------
  208.   def wall?(tile_id)
  209.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  210.     return true if (1904...2000).include?(tile_id)
  211.     return true if (4736...5120).include?(tile_id)
  212.     return true if (5504...5888).include?(tile_id)
  213.     return true if (6272...6656).include?(tile_id)
  214.     return true if (7040...7424).include?(tile_id)
  215.     return (7808...8192).include?(tile_id)
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # ○ スクリプト機能を使用する地形タイルか?
  219.   #--------------------------------------------------------------------------
  220.   def cliff?(tile_id)
  221.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  222.     return [2816, 3200, 3584, 2960, 3344, 3728, 4112].include?(top_(tile_id))
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ○ 指定の向きにオートタイルチップの境目があるか?
  226.   #--------------------------------------------------------------------------
  227.   def verge?(tile_id, direction)
  228.     auto_tile_id = auto_(tile_id)
  229.    
  230.     return false if auto_tile_id == 0
  231.     return false unless ceiling?(tile_id) or cliff?(tile_id)
  232.            
  233.     if (1904...2000).include?(tile_id) or
  234.        (4352...5888).include?(tile_id) or
  235.        (6272...6656).include?(tile_id) or
  236.        (7040...7424).include?(tile_id) or
  237.        (7808...8192).include?(tile_id)           # オートタイルの線画タイプ判別
  238.       case direction # 壁タイプの場合 方向ごとに振り分け
  239.       when 2 ; return true if Data_Auto_Tile::VERGE_DOWN_B.include?(auto_tile_id)
  240.       when 4 ; return true if Data_Auto_Tile::VERGE_LEFT_B.include?(auto_tile_id)
  241.       when 6 ; return true if Data_Auto_Tile::VERGE_RIGHT_B.include?(auto_tile_id)
  242.       when 8 ; return true if Data_Auto_Tile::VERGE_UP_B.include?(auto_tile_id)
  243.       end
  244.     else
  245.       case direction # 床タイプの場合 方向ごとに振り分け
  246.       when 2 ; return true if Data_Auto_Tile::VERGE_DOWN_A.include?(auto_tile_id)
  247.       when 4 ; return true if Data_Auto_Tile::VERGE_LEFT_A.include?(auto_tile_id)
  248.       when 6 ; return true if Data_Auto_Tile::VERGE_RIGHT_A.include?(auto_tile_id)
  249.       when 8 ; return true if Data_Auto_Tile::VERGE_UP_A.include?(auto_tile_id)
  250.       end
  251.     end
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ○ 指定の向きに有効な境目があるか?
  255.   #--------------------------------------------------------------------------
  256.   def rip?(direction, x, y, floating = false)
  257.     #- 位置情報の準備
  258.     tile_id = point_tile_id(x, y)
  259.     front_x = x_with_direction(x, direction)
  260.     front_y = y_with_direction(y, direction)
  261.     front_tile_id = point_tile_id(front_x, front_y)
  262.    
  263.     #- ステップタイルがあれば無効
  264.     return false if Data_Tile::STEP.include?(front_tile_id[0])
  265.     return false if Data_Tile::STEP.include?(front_tile_id[2])
  266.     return false if Data_Tile::STEP.include?(tile_id[0])
  267.     return false if Data_Tile::STEP.include?(tile_id[2])
  268.    
  269.     #- 橋タイルの処理
  270.     if floating
  271.       if Data_Tile::BRIDRE_LENGTH.include?(tile_id[2]) or
  272.          Data_Tile::BRIDGE_BREADTH.include?(tile_id[2])
  273.         return false if @under_bridge_passages[[x, y]] == -1
  274.       elsif Data_Tile::BRIDRE_LENGTH.include?(front_tile_id[2]) or
  275.             Data_Tile::BRIDGE_BREADTH.include?(front_tile_id[2])
  276.         return false if @under_bridge_passages[[front_x, front_y]] == -1  
  277.       end
  278.     end

  279.     if bridge?(front_tile_id[2], direction)
  280.       return false
  281.     elsif Data_Tile::BRIDRE_LENGTH.include?(tile_id[2]) and back_tile?(x, y)
  282.       return true if direction == 4 or direction == 6
  283.       return false if direction == 2 or direction == 8
  284.     elsif Data_Tile::BRIDGE_BREADTH.include?(tile_id[2]) and back_tile?(x, y)
  285.       return true if direction == 2 or direction == 8
  286.       return false if direction == 4 or direction == 6
  287.     end
  288.    
  289.     #- 地形タイルの処理
  290.     if cliff?(tile_id[0])
  291.       if Expansion_Passable::CLIFF_MAP.include?($game_map.map_id)
  292.         return false unless ceiling?(front_tile_id[0]) or cliff?(front_tile_id[0])
  293.         if cliff?(front_tile_id[0]) and verge?(front_tile_id[0], 10 - direction)
  294.           return false
  295.         end
  296.       else
  297.         return false
  298.       end
  299.     end

  300.     #- タイルに境目があるか?
  301.     return verge?(tile_id[0], direction)
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ○ 指定の向きに準じた橋タイルか?(渡ることの出来る向きか)
  305.   #--------------------------------------------------------------------------
  306.   def bridge?(tile_id, direction)
  307.     if direction == 2 or direction == 8
  308.       return true if Data_Tile::BRIDRE_LENGTH.include?(tile_id)
  309.     elsif direction == 4 or direction == 6
  310.       return true if Data_Tile::BRIDGE_BREADTH.include?(tile_id)
  311.     end
  312.     return false
  313.   end
  314.   #--------------------------------------------------------------------------
  315.   # ○ 上層に移すタイルか?
  316.   #--------------------------------------------------------------------------
  317.   def upper_layer?(tile_id)
  318.     return false if @back_tiles_a == nil
  319.     if Expansion_Passable::CLIFF_MAP.include?(@map_id)
  320.       return true if @back_tiles_b.include?(tile_id)
  321.     else
  322.       unless cliff?(tile_id)
  323.         return true if @back_tiles_a.include?(tile_id)
  324.       end
  325.     end
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ○ <船の橋下通過>処理をするエリアか?
  329.   #--------------------------------------------------------------------------
  330.   def ship_pass_area?(x, y)
  331.     result = false
  332.     for area in $data_areas.values
  333.       next if area == nil
  334.       next unless area.ship_pass
  335.       next if $game_map.map_id != area.map_id
  336.       next if x < area.rect.x
  337.       next if y < area.rect.y
  338.       next if x >= area.rect.x + area.rect.width
  339.       next if y >= area.rect.y + area.rect.height
  340.       result = true
  341.     end
  342.     return result
  343.   end
  344.   #--------------------------------------------------------------------------
  345.   # ○ 処理の無視をするエリアか?
  346.   #--------------------------------------------------------------------------
  347.   def disregard_processing_area?(x, y, map_id)
  348.     result = false
  349.     for area in $data_areas.values
  350.       next if area == nil
  351.       next unless area.disregard_processing
  352.       next if map_id != area.map_id
  353.       next if x < area.rect.x
  354.       next if y < area.rect.y
  355.       next if x >= area.rect.x + area.rect.width
  356.       next if y >= area.rect.y + area.rect.height
  357.       result = true
  358.     end
  359.     return result
  360.   end
  361.   #--------------------------------------------------------------------------
  362.   # ○ 段差マップか?
  363.   #--------------------------------------------------------------------------
  364.   def cliff_map?
  365.     return Expansion_Passable::CLIFF_MAP.include?(@map_id)
  366.   end
  367.   #--------------------------------------------------------------------------
  368.   # ○ 特殊通行判定の作成
  369.   #--------------------------------------------------------------------------
  370.   def create_ex_passages
  371.     @ex_passages = $data_system.passages
  372.    
  373.     #- 壁・屋根・天井タイルの通行判定を○に変える
  374.     for i in 1904...2048
  375.       @ex_passages[i] = 0x06 if ceiling?(i)
  376.     end
  377.     for i in 4352...8192
  378.       @ex_passages[i] = 0x06 if ceiling?(i)
  379.     end

  380.     #- 橋タイルの通行判定を○に
  381.     for i in (Data_Tile::BRIDRE_LENGTH + Data_Tile::BRIDGE_BREADTH)
  382.       @ex_passages[i] = 0x00
  383.     end
  384.    
  385.     @passages = @ex_passages
  386.   end
  387.   #--------------------------------------------------------------------------
  388.   # ○ 接岸禁止タイル登録
  389.   #     map_id : マップ ID
  390.   #--------------------------------------------------------------------------
  391.   def prohibited_get_off_set(x, y)
  392.     @map.data[x, y, 2] = 0
  393.     @prohibited_get_off.push([x, y])
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # ○ 影消しタイル処理
  397.   #--------------------------------------------------------------------------
  398.   def shadow_eraser(x, y)
  399.     r_x = round_x(x - 1) ; r_y = round_y(y - 1)
  400.     tile_id = @map.data[r_x, y, 0]

  401.     # 壁(線画・壁タイプ)
  402.     if (4736...5120).include?(tile_id) or
  403.        (5504...5888).include?(tile_id) or
  404.        (6272...6656).include?(tile_id) or
  405.        (7040...7424).include?(tile_id) or
  406.        (7808...8192).include?(tile_id)
  407.       dummy_tile_id = 1904 + auto_(tile_id)
  408.     # 屋根(線画・壁タイプ)
  409.     elsif (4352...4736).include?(tile_id) or
  410.           (5120...5504).include?(tile_id)
  411.       dummy_tile_id = 1952 + auto_(tile_id)
  412.     # 天井(線画・床タイプ)
  413.     elsif (5888...6272).include?(tile_id) or
  414.           (6656...7040).include?(tile_id) or
  415.           (7424...7808).include?(tile_id)
  416.       dummy_tile_id = 2000 + auto_(tile_id)
  417.     else
  418.       return
  419.     end
  420.    
  421.     @map.data[r_x, r_y, 1] = @map.data[r_x, r_y, 0]
  422.     @map.data[r_x, r_y, 0] = dummy_tile_id
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ○ 裏回り消去タイル処理
  426.   #--------------------------------------------------------------------------
  427.   def back_tiles_position_delete(x, y)
  428.     return if Expansion_Passable::DELETE_BACK_TILE_ID == nil
  429.     y = round_y(y+1) if Expansion_Passable::BACK_TILE_DEEP
  430.     if @map.data[x, y, 2] == Expansion_Passable::DELETE_BACK_TILE_ID or
  431.        @ex_data[x, y, 2] == Expansion_Passable::DELETE_BACK_TILE_ID
  432.       @back_tiles_position.delete([x, y])
  433.       @map.data[x, y, 2] = 0
  434.       @ex_data[x, y, 2] = 0
  435.     end
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ○ 裏回り用タイル種類ピックアップ
  439.   #--------------------------------------------------------------------------  
  440.   def pick_up_back_tiles
  441.     return if @back_tiles_a != nil
  442.    
  443.     @back_tiles_a = []
  444.     @back_tiles_b = []
  445.     for i in 1904...8192
  446.       next unless ceiling?(i) or cliff?(i)
  447.       if wall?(i)
  448.         next if verge?(i, 2)
  449.         if verge?(i, 4) or verge?(i, 6)
  450.           @back_tiles_a.push(i) unless cliff?(i)
  451.         end
  452.       else
  453.         @back_tiles_a.push(i) unless cliff?(i)
  454.         @back_tiles_b.push(i) if verge?(i, 8)
  455.       end
  456.     end
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # ○ 通行判定初期化と裏回り用タイル座標ピックアップ
  460.   #--------------------------------------------------------------------------
  461.   def setup_back_tiles
  462.     if $game_player.game_map_data.include?(@map_id)
  463.       @map = $game_player.game_map_data[@map_id].map
  464.       @ex_data = $game_player.game_map_data[@map_id].ex_data
  465.       @under_bridge_passages = $game_player.game_map_data[@map_id].under_bridge_passages
  466.       @back_tiles_position = $game_player.game_map_data[@map_id].back_tiles_position
  467.       @keep_back_position = $game_player.game_map_data[@map_id].keep_back_position
  468.       @prohibited_get_off = $game_player.game_map_data[@map_id].prohibited_get_off
  469.       return
  470.     end
  471.    
  472.     @ex_data = Table.new(width, height, 3)
  473.     @under_bridge_passages = {}
  474.     @back_tiles_position = []
  475.     @keep_back_position = []
  476.     @prohibited_get_off = []
  477.    
  478.     return if Expansion_Passable::ESCAPE_MAP.include?(@map_id)
  479.    
  480.     #- 座標毎処理
  481.     for x in 0...width
  482.       for reverse_y in 1..height
  483.         y = height - reverse_y   # Y座標を逆順にする為の処理
  484.         next if disregard_processing_area?(x, y, @map_id)
  485.         
  486.         tile_id = point_tile_id(x, y)

  487.         #- 橋タイル処理
  488.         if (Data_Tile::BRIDRE_LENGTH + Data_Tile::BRIDGE_BREADTH).include?(tile_id[2])
  489.           if (2048...2815).include?(tile_id[0])
  490.             if ship_pass_area?(x, y)
  491.               @under_bridge_passages[[x, y]] = 1
  492.               @back_tiles_position.push([x, y])
  493.               @ex_data[x, y, 2] = @map.data[x, y, 2]
  494.             else
  495.               @back_tiles_position.push([x, y])
  496.               @under_bridge_passages[[x, y]] = -1
  497.             end
  498.           elsif @passages[tile_id[0]] != 0x06 or $game_map.wall?(tile_id[0])
  499.             @under_bridge_passages[[x, y]] = -1
  500.             @back_tiles_position.push([x, y])
  501.             @ex_data[x, y, 2] = @map.data[x, y, 2]
  502.           else
  503.             @under_bridge_passages[[x, y]] = 0
  504.             @back_tiles_position.push([x, y])
  505.             @ex_data[x, y, 2] = @map.data[x, y, 2]
  506.           end
  507.           if Data_Tile::BRIDGE_BREADTH.include?(tile_id[2])
  508.             @keep_back_position.push([x, round_y(y+1)])
  509.           end
  510.          
  511.         #- 通行判定☆タイルを上層に移動
  512.         elsif tile_id[2] != 0 and @passages[tile_id[2]] & 0x10 == 0x10
  513.           if @back_tiles_position.include?([x, round_y(y+1)])
  514.             @keep_back_position.push([x, y])
  515.           else
  516.             @ex_data[x, y, 2] = @map.data[x, y, 2]
  517.           end
  518.         end
  519.         
  520.         #- 影消しタイルの処理
  521.         if @map.data[x, y, 2] == Expansion_Passable::SHADOW_ERASER_TILE_ID
  522.           shadow_eraser(x, y)
  523.           @map.data[x, y, 2] = 0
  524.         #- 接岸禁止タイルの処理
  525.         elsif @map.data[x, y, 2] == Expansion_Passable::PROHIBITED_GET_OFF_TILE_ID
  526.           prohibited_get_off_set(x, y)
  527.         end
  528.         
  529.         #- 壁・天井タイル処理
  530.         if ceiling?(tile_id[0]) or (cliff?(tile_id[0]) and cliff_map?)
  531.          
  532.           #- 基本となる裏回りタイルの場合、裏回り位置に登録
  533.           if not wall?(tile_id[0]) and verge?(tile_id[0], 8)
  534.             @back_tiles_position.push([x, y])
  535.           end
  536.          
  537.           #- 裏回り位置にするタイルの場合、上層に移動
  538.           back_tiles = cliff_map? ? @back_tiles_b : @back_tiles_a
  539.           if back_tiles.include?(tile_id[0])
  540.             @ex_data[x, y, 0] = @map.data[x, y, 0]
  541.             @ex_data[x, y, 1] = @map.data[x, y, 1]
  542.             #- 裏回り位置追加タイルの誤用時には、タイルを消去する
  543.             if tile_id[2] != Expansion_Passable::ADDITION_BACK_TILE_ID
  544.               @ex_data[x, y, 2] = @map.data[x, y, 2]
  545.             end
  546.             @map.data[x, y, 1] = 0
  547.             @map.data[x, y, 2] = 0
  548.           end
  549.          
  550.           #- 深く裏回りする設定の際の処理(裏回り位置の下をさらに上層に)
  551.           if Expansion_Passable::BACK_TILE_DEEP
  552.             unless @back_tiles_position.include?([x, round_y(y+1)])
  553.               if not wall?(tile_id[0]) and verge?(tile_id[0], 8)
  554.                 unless wall?(data[x, round_y(y+1), 0]) and verge?(data[x, round_y(y+1), 0], 2)
  555.                   @back_tiles_position.push([x, round_y(y+1)])
  556.                   @ex_data[x, round_y(y+1), 0] = @map.data[x, round_y(y+1), 0]
  557.                   @ex_data[x, round_y(y+1), 1] = @map.data[x, round_y(y+1), 1]
  558.                   @ex_data[x, round_y(y+1), 2] = @map.data[x, round_y(y+1), 2]
  559.                   @map.data[x, round_y(y+1), 1] = 0
  560.                   @map.data[x, round_y(y+1), 2] = 0
  561.                 end
  562.               end
  563.             end
  564.           end
  565.             
  566.           #- 裏回り追加タイルの処理
  567.           if Expansion_Passable::ADDITION_BACK_TILE_ID != nil and
  568.              tile_id[2] == Expansion_Passable::ADDITION_BACK_TILE_ID
  569.             @back_tiles_position.push([x, y])
  570.             @ex_data[x, y, 0] = @map.data[x, y, 0]
  571.             @ex_data[x, y, 1] = @map.data[x, y, 1]
  572.             @map.data[x, y, 2] = 0
  573.             if (2816...8192).include?(@map.data[x, round_y(y-1), 0])
  574.               @ex_data[x, round_y(y-1), 0] = @map.data[x, round_y(y-1), 0]
  575.               @ex_data[x, round_y(y-1), 1] = @map.data[x, round_y(y-1), 1]
  576.             end
  577.           end
  578.         end
  579.         
  580.         #- 裏回り部分除去タイルの処理
  581.         back_tiles_position_delete(x, y)
  582.       end
  583.     end
  584.   end
  585.   #--------------------------------------------------------------------------
  586.   # ○ 裏回り用タイルの存在する座標か?
  587.   #--------------------------------------------------------------------------
  588.   def back_tile?(x, y)
  589.     return false if @back_tiles_position == nil
  590.     return @back_tiles_position.include?([x, y])
  591.   end
  592. end

  593. #==============================================================================
  594. # ■ Game_Character
  595. #------------------------------------------------------------------------------
  596. #  キャラクターを扱うクラスです。このクラスは Game_Player クラスと Game_Event
  597. # クラスのスーパークラスとして使用されます。
  598. #==============================================================================

  599. class Game_Character
  600.   #--------------------------------------------------------------------------
  601.   # ○ 公開インスタンス変数
  602.   #--------------------------------------------------------------------------
  603.   attr_reader   :on_tile
  604.   attr_reader   :turn_back
  605.   attr_accessor :no_turn_back
  606.   attr_reader   :back_seeing
  607.   attr_reader   :not_back_seeing
  608.   #--------------------------------------------------------------------------
  609.   # ◎ オブジェクト初期化
  610.   #--------------------------------------------------------------------------
  611.   alias tig_ew_initialize initialize
  612.   def initialize
  613.     tig_ew_initialize
  614.     @vehicle_type = -1
  615.     @turn_back = false
  616.     @no_turn_back = false
  617.     @on_tile = true
  618.     @back_seeing = false
  619.     @not_back_seeing = false
  620.   end
  621.   #--------------------------------------------------------------------------
  622.   # ◎ フレーム更新
  623.   #--------------------------------------------------------------------------
  624.   alias tig_ew_update update
  625.   def update
  626.     if @first_update == nil
  627.       update_turn_back
  628.       @first_update = true
  629.     end
  630.     tig_ew_update
  631.   end
  632.   #--------------------------------------------------------------------------
  633.   # ◎ 指定位置に移動
  634.   #     x : X 座標
  635.   #     y : Y 座標
  636.   #--------------------------------------------------------------------------
  637.   alias tig_ew_moveto moveto
  638.   def moveto(x, y)
  639.     tig_ew_moveto(x, y)
  640.     update_turn_back
  641.   end
  642.   #--------------------------------------------------------------------------
  643.   # ◎ ジャンプ時の更新
  644.   #--------------------------------------------------------------------------
  645.   alias tig_ew_update_jump update_jump
  646.   def update_jump
  647.     tig_ew_update_jump
  648.     update_turn_back
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # ◎ 移動時の更新
  652.   #--------------------------------------------------------------------------
  653.   alias tig_ew_update_move update_move
  654.   def update_move
  655.     tig_ew_update_move
  656.     update_turn_back unless moving?
  657.   end
  658.   #--------------------------------------------------------------------------
  659.   # ◎ 歩数増加
  660.   #--------------------------------------------------------------------------
  661.   alias tig_ew_increase_steps increase_steps
  662.   def increase_steps
  663.     tig_ew_increase_steps
  664.     update_turn_back
  665.   end
  666.   #--------------------------------------------------------------------------
  667.   # ○ 2座標の位置関係を向きで取得
  668.   #--------------------------------------------------------------------------
  669.   def search_direction(start_x, start_y, arriv_x, arriv_y)
  670.     if start_x == arriv_x
  671.       if start_y == arriv_y
  672.         return 5
  673.       elsif start_y < arriv_y
  674.         return 2
  675.       elsif start_y > arriv_y
  676.         return 8
  677.       end
  678.     elsif start_x < arriv_x
  679.       if start_y == arriv_y
  680.         return 6
  681.       elsif start_y < arriv_y
  682.         return 3
  683.       elsif start_y > arriv_y
  684.         return 9
  685.       end
  686.     elsif start_x > arriv_x
  687.       if start_y == arriv_y
  688.         return 4
  689.       elsif start_y < arriv_y
  690.         return 1
  691.       elsif start_y > arriv_y
  692.         return 7
  693.       end
  694.     end
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # ○ 裏回りセット
  698.   #--------------------------------------------------------------------------
  699.   def set_turn_back
  700.     @turn_back = true
  701.     @on_tile = false
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # ○ 天井載せセット
  705.   #--------------------------------------------------------------------------
  706.   def set_on_tile
  707.     @turn_back = false
  708.     @on_tile = true
  709.   end
  710.   #--------------------------------------------------------------------------
  711.   # ○ 裏回り状態更新
  712.   #--------------------------------------------------------------------------
  713.   def update_turn_back
  714.     tile_id = $game_map.point_tile_id(@x, @y)
  715.     direction = search_direction(@real_x, @real_y, @x * 256, @y * 256)
  716.     if self.is_a?(Game_Player) and [2, 4].include?(@vehicle_type)
  717.       @turn_back = false
  718.       @no_turn_back = false
  719.       @on_tile = true
  720.       return
  721.     end
  722.     #- 段差マップの場合
  723.     if Expansion_Passable::CLIFF_MAP.include?($game_map.map_id)
  724.       #- 停止時の更新
  725.       if direction == 5
  726.         @turn_back = false if @no_turn_back
  727.         unless $game_map.back_tile?(@x, @y)
  728.           @turn_back = false
  729.           @no_turn_back = false
  730.         end
  731.         @on_tile = true unless @turn_back
  732.       #- 移動開始時の更新
  733.       else
  734.         if direction % 2 == 0
  735.           if $game_map.rip?(10 - direction, @x, @y, floating?)
  736.             @turn_back = true unless @no_turn_back
  737.           end
  738.         else
  739.           if diagonal_move_turn_back(direction, @x, @y)
  740.             @turn_back = true unless @no_turn_back
  741.           end
  742.         end
  743.         @on_tile = false if @turn_back
  744.       end
  745.       if not @turn_back or @no_turn_back
  746.         if $game_map.keep_back_position != nil and $game_map.keep_back_position.include?([@x, @y])
  747.           @on_tile = false
  748.           return
  749.         end
  750.       end
  751.     #- 通常マップの場合
  752.     else
  753.       #- 停止時の更新
  754.       if direction == 5
  755.         unless $game_map.back_tile?(@x, @y)
  756.           @turn_back = false
  757.           @no_turn_back = false
  758.         end
  759.         if $game_map.upper_layer?(tile_id[0])
  760.           @on_tile = true
  761.         else
  762.           @on_tile = false
  763.         end
  764.       #- 移動開始時の更新
  765.       else
  766.         if direction % 2 == 0
  767.           if $game_map.rip?(10 - direction, @x, @y, floating?)
  768.             @turn_back = true unless @no_turn_back
  769.           end
  770.         else
  771.           if diagonal_move_turn_back(direction, @x, @y)
  772.             @turn_back = true unless @no_turn_back
  773.           end
  774.         end
  775.       end
  776.       if $game_map.back_tile?(@x, @y)
  777.         if @turn_back
  778.           @on_tile = false
  779.         else
  780.           @on_tile = true
  781.         end
  782.       elsif Data_Tile::STEP.include?(tile_id[0]) or Data_Tile::STEP.include?(tile_id[2])
  783.         @on_tile = true
  784.       end
  785.     end
  786.   end
  787.   #--------------------------------------------------------------------------
  788.   # ○ 斜め移動時の裏回り状態判別
  789.   #--------------------------------------------------------------------------
  790.   def diagonal_move_turn_back(direction, x, y)
  791.     turn_back = false
  792.     case direction
  793.     when 1
  794.       turn_back = true if $game_map.rip?(8, x+1, y, floating?)
  795.       turn_back = true if $game_map.rip?(6, x, y, floating?)
  796.       turn_back = true if $game_map.rip?(6, x, y-1, floating?)
  797.       turn_back = true if $game_map.rip?(8, x, y, floating?)
  798.     when 3
  799.       turn_back = true if $game_map.rip?(8, x-1, y, floating?)
  800.       turn_back = true if $game_map.rip?(4, x, y, floating?)
  801.       turn_back = true if $game_map.rip?(4, x, y-1, floating?)
  802.       turn_back = true if $game_map.rip?(8, x, y, floating?)
  803.     when 7
  804.       turn_back = true if $game_map.rip?(6, x, y+1, floating?)
  805.       turn_back = true if $game_map.rip?(2, x, y, floating?)
  806.       turn_back = true if $game_map.rip?(2, x+1, y, floating?)
  807.       turn_back = true if $game_map.rip?(6, x, y, floating?)
  808.     when 9
  809.       turn_back = true if $game_map.rip?(4, x, y+1, floating?)
  810.       turn_back = true if $game_map.rip?(2, x, y, floating?)
  811.       turn_back = true if $game_map.rip?(2, x-1, y, floating?)
  812.       turn_back = true if $game_map.rip?(4, x, y, floating?)
  813.     end
  814.     return turn_back
  815.   end
  816.   #--------------------------------------------------------------------------
  817.   # ○ この場が裏か判定
  818.   #--------------------------------------------------------------------------
  819.   def back_tile?(pos)
  820.     return $game_map.back_tile?(pos[0], pos[1])
  821.   end
  822.   #--------------------------------------------------------------------------
  823.   # ○ 橋の下の通行判定
  824.   #--------------------------------------------------------------------------  
  825.   def under_bridge_passages(pos)
  826.     return true unless $game_map.under_bridge_passages.key?(pos)
  827.     case @vehicle_type
  828.     when -1
  829.       return $game_map.under_bridge_passages[pos] == 0
  830.     when 0..1
  831.       return $game_map.under_bridge_passages[pos] > 0
  832.     when 5
  833.       return $game_map.under_bridge_passages[pos] >= 0
  834.     else
  835.       return false
  836.     end
  837.   end
  838.   #--------------------------------------------------------------------------
  839.   # ○ 浮かんでいるか?(乗り物拡張用・魔法の絨毯搭乗時)
  840.   #--------------------------------------------------------------------------  
  841.   def floating?
  842.     return false
  843.   end
  844.   #--------------------------------------------------------------------------
  845.   # ○ 壁タイル拡張通行判定
  846.   #--------------------------------------------------------------------------
  847.   #  x , y を省略すると…
  848.   #    プレイヤーの現在位置(始点)からdirection方向へ通過出来るかどうかを判定。
  849.   #  x , y を代入すると…
  850.   #    その座標(終点)へdirection方向から進入できるかどうかを判定。
  851.   #--------------------------------------------------------------------------
  852.   def ex_passable(direction, x = nil, y = nil, turn_back = nil)
  853.     return true if debug_through?        # デバッグ動作中なら通行可
  854.     return true if @through              # すり抜け中なら通行可
  855.       
  856.     #- 位置情報の準備
  857.     if x == nil
  858.       start_pos = [@x, @y]
  859.       arriv_pos = [$game_map.x_with_direction(@x, direction), $game_map.y_with_direction(@y, direction)]  
  860.     else
  861.       start_pos = [$game_map.x_with_direction(x, 10 - direction), $game_map.y_with_direction(y, 10 - direction)]
  862.       arriv_pos = [x, y]
  863.     end
  864.     start_tile = $game_map.point_tile_id(start_pos[0], start_pos[1])
  865.     arriv_tile = $game_map.point_tile_id(arriv_pos[0], arriv_pos[1])
  866.     start_side_rip = $game_map.rip?(direction, start_pos[0], start_pos[1], floating?)
  867.     arriv_side_rip = $game_map.rip?(10 - direction, arriv_pos[0], arriv_pos[1], floating?)
  868.    
  869.     turn_back = @turn_back if turn_back == nil
  870.    
  871.     #- 階段タイルなら通行可
  872.     unless back_tile?(start_pos) and turn_back
  873.       return true if Data_Tile::STEP.include?(arriv_tile[0])
  874.       return true if Data_Tile::STEP.include?(arriv_tile[2])
  875.       unless $game_map.wall?(arriv_tile[0])
  876.         return true if Data_Tile::STEP.include?(start_tile[0])
  877.         return true if Data_Tile::STEP.include?(start_tile[2])
  878.       end
  879.     end
  880.    
  881.     #- 境目&橋の下の通行判定
  882.     if back_tile?(start_pos) and turn_back               # 始点が裏かつ裏回り中
  883.       return false unless under_bridge_passages(arriv_pos)  # 橋の下の通行判定
  884.       unless back_tile?(arriv_pos)                         # 終点が裏でない
  885.         if start_side_rip                                   # 始点側に境目がある
  886.           if arriv_side_rip                                  # 終点側に境目がある
  887.             return false
  888.           else
  889.             return false if $game_map.wall?(arriv_tile[0])
  890.           end
  891.         else                                              # 始点側に境目がない
  892.           return false
  893.         end
  894.       end
  895.     else                                                  # 始点は裏でない
  896.       unless $game_map.bridge?(arriv_tile[2], direction) or # 橋がなければ
  897.              $game_map.bridge?(start_tile[2], direction)
  898.         if start_side_rip                                  # 始点側に境目がある
  899.           return false
  900.         else                                               # 始点側に境目がない
  901.           if arriv_side_rip                                 # 終点側に境目がある
  902.             if back_tile?(arriv_pos)                         # 終点が裏
  903.               unless $game_map.bridge?(start_tile[2], direction)   # この場が橋でなければ
  904.                 return false unless under_bridge_passages(arriv_pos)  # 橋の下の通行判定
  905.                 turn_back = true
  906.               end
  907.             else                                             # 終点が裏でない
  908.               unless $game_map.bridge?(start_tile[2], direction) # この場が橋でなければ
  909.                 return false
  910.               end
  911.             end
  912.           else                                              # 終点側に境目がない
  913.             return false if $game_map.wall?(arriv_tile[0])
  914.           end
  915.         end
  916.       end
  917.     end
  918.    
  919.     #- 上層の通行判定
  920.     if $game_map.upper_layer?(arriv_tile[0]) and not turn_back
  921.       for i in [2, 1, 0]                        # レイヤーの上から順に調べる
  922.         tile_id = $game_map.ex_data[arriv_pos[0], arriv_pos[1], i] # タイル ID を取得
  923.         unless tile_id == nil
  924.           pass = $game_map.passages[tile_id]    # 通行属性を取得
  925.           next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
  926.           next if pass & 0x01 == 0x00           # [○] : 通行可
  927.           if pass & 0x01 == 0x01                # [×] : 通行不可
  928.             return false
  929.           end
  930.         end
  931.       end
  932.     end  

  933.     return true
  934.   end
  935.   #--------------------------------------------------------------------------
  936.   # ◎ 下に移動
  937.   #     turn_ok : その場での向き変更を許可
  938.   #--------------------------------------------------------------------------
  939.   alias tig_ew_move_down move_down
  940.   def move_down(turn_ok = true)
  941.     unless ex_passable(2)
  942.       turn_down if turn_ok
  943.       @move_failed = true
  944.       check_event_trigger_touch(@x, @y+1)   # 接触イベントの起動判定
  945.       return
  946.     end
  947.     tig_ew_move_down(turn_ok)
  948.   end
  949.   #--------------------------------------------------------------------------
  950.   # ◎ 左に移動
  951.   #     turn_ok : その場での向き変更を許可
  952.   #--------------------------------------------------------------------------
  953.   alias tig_ew_move_left move_left
  954.   def move_left(turn_ok = true)
  955.     unless ex_passable(4)
  956.       turn_left if turn_ok
  957.       @move_failed = true
  958.       check_event_trigger_touch(@x-1, @y)   # 接触イベントの起動判定
  959.       return
  960.     end
  961.     tig_ew_move_left(turn_ok)
  962.   end
  963.   #--------------------------------------------------------------------------
  964.   # ◎ 右に移動
  965.   #     turn_ok : その場での向き変更を許可
  966.   #--------------------------------------------------------------------------
  967.   alias tig_ew_move_right move_right
  968.   def move_right(turn_ok = true)
  969.     unless ex_passable(6)
  970.       turn_right if turn_ok
  971.       check_event_trigger_touch(@x+1, @y)   # 接触イベントの起動判定
  972.       @move_failed = true
  973.       return
  974.     end
  975.     tig_ew_move_right(turn_ok)
  976.   end
  977.   #--------------------------------------------------------------------------
  978.   # ◎ 上に移動
  979.   #     turn_ok : その場での向き変更を許可
  980.   #--------------------------------------------------------------------------
  981.   alias tig_ew_move_up move_up
  982.   def move_up(turn_ok = true)
  983.     unless ex_passable(8)
  984.       turn_up if turn_ok
  985.       check_event_trigger_touch(@x, @y-1)   # 接触イベントの起動判定
  986.       @move_failed = true
  987.       return
  988.     end
  989.     tig_ew_move_up(turn_ok)
  990.   end
  991.   #--------------------------------------------------------------------------
  992.   # ◎ 左下に移動
  993.   #--------------------------------------------------------------------------
  994.   alias tig_ew_move_lower_left move_lower_left
  995.   def move_lower_left
  996.     turn_back1 = $game_map.rip?(8, @x, @y+1) ? true : @turn_back
  997.     turn_back2 = $game_map.rip?(6, @x-1, @y) ? true : @turn_back
  998.     unless passable?(@x, @y+1) and passable?(@x-1, @y) and passable?(@x-1, @y+1) and
  999.            ex_passable(2) and ex_passable(4, @x-1, @y+1, turn_back1) and
  1000.            ex_passable(4) and ex_passable(2, @x-1, @y+1, turn_back2)
  1001.       if @direction == 2
  1002.         if passable?(@x-1, @y) and ex_passable(4)
  1003.           move_left
  1004.         else
  1005.           move_down
  1006.         end
  1007.       elsif @direction == 4
  1008.         if passable?(@x, @y+1) and ex_passable(2)
  1009.           move_down
  1010.         else
  1011.           move_left
  1012.         end
  1013.       end
  1014.       return
  1015.     end
  1016.     tig_ew_move_lower_left
  1017.   end
  1018.   #--------------------------------------------------------------------------
  1019.   # ◎ 右下に移動
  1020.   #--------------------------------------------------------------------------
  1021.   alias tig_ew_move_lower_right move_lower_right
  1022.   def move_lower_right
  1023.     turn_back1 = $game_map.rip?(8, @x, @y+1) ? true : @turn_back
  1024.     turn_back2 = $game_map.rip?(4, @x+1, @y) ? true : @turn_back
  1025.     unless passable?(@x, @y+1) and passable?(@x+1, @y) and passable?(@x+1, @y+1) and
  1026.            ex_passable(2) and ex_passable(6, @x+1, @y+1, turn_back1) and
  1027.            ex_passable(6) and ex_passable(2, @x+1, @y+1, turn_back2)
  1028.       if @direction == 2
  1029.         if passable?(@x-1, @y) and ex_passable(6)
  1030.           move_right
  1031.         else
  1032.           move_down
  1033.         end
  1034.       elsif @direction == 6
  1035.         if passable?(@x, @y+1) and ex_passable(2)
  1036.           move_down
  1037.         else
  1038.           move_right
  1039.         end
  1040.       end
  1041.       return
  1042.     end
  1043.     tig_ew_move_lower_right
  1044.   end
  1045.   #--------------------------------------------------------------------------
  1046.   # ◎ 左上に移動
  1047.   #--------------------------------------------------------------------------
  1048.   alias tig_ew_move_upper_left move_upper_left
  1049.   def move_upper_left
  1050.     turn_back1 = $game_map.rip?(2, @x, @y-1) ? true : @turn_back
  1051.     turn_back2 = $game_map.rip?(6, @x-1, @y) ? true : @turn_back
  1052.     unless passable?(@x, @y-1) and passable?(@x-1, @y) and passable?(@x-1, @y-1) and
  1053.            ex_passable(8) and ex_passable(4, @x-1, @y-1, turn_back1) and
  1054.            ex_passable(4) and ex_passable(8, @x-1, @y-1, turn_back2)
  1055.       if @direction == 8
  1056.         if passable?(@x-1, @y) and ex_passable(4)
  1057.           move_left
  1058.         else
  1059.           move_up
  1060.         end
  1061.       elsif @direction == 4
  1062.         if passable?(@x, @y+1) and ex_passable(8)
  1063.           move_up
  1064.         else
  1065.           move_left
  1066.         end
  1067.       end
  1068.       return
  1069.     end
  1070.     tig_ew_move_upper_left
  1071.   end
  1072.   #--------------------------------------------------------------------------
  1073.   # ◎ 右上に移動
  1074.   #--------------------------------------------------------------------------
  1075.   alias tig_ew_move_upper_right move_upper_right
  1076.   def move_upper_right
  1077.     turn_back1 = $game_map.rip?(2, @x, @y-1) ? true : @turn_back
  1078.     turn_back2 = $game_map.rip?(4, @x+1, @y) ? true : @turn_back
  1079.     unless passable?(@x, @y-1) and passable?(@x+1, @y) and passable?(@x+1, @y-1) and
  1080.            ex_passable(8) and ex_passable(6, @x+1, @y-1, turn_back1) and
  1081.            ex_passable(6) and ex_passable(8, @x+1, @y-1, turn_back2)
  1082.       if @direction == 8
  1083.         if passable?(@x+1, @y) and ex_passable(6)
  1084.           move_right
  1085.         else
  1086.           move_up
  1087.         end
  1088.       elsif @direction == 6
  1089.         if passable?(@x, @y-1) and ex_passable(8)
  1090.           move_up
  1091.         else
  1092.           move_right
  1093.         end
  1094.       end
  1095.       return
  1096.     end
  1097.     tig_ew_move_upper_right
  1098.   end
  1099.   #--------------------------------------------------------------------------
  1100.   # ● キャラクター衝突判定
  1101.   #     x : X 座標
  1102.   #     y : Y 座標
  1103.   #    プレイヤーと乗り物を含め、通常キャラの衝突を検出する。
  1104.   #--------------------------------------------------------------------------
  1105.   def collide_with_characters?(x, y)
  1106.     for event in $game_map.events_xy(x, y)          # イベントの座標と一致
  1107.       next unless parallel?(event)                  ##### 追加部分 (この行) #####
  1108.       unless event.through                          # すり抜け OFF?
  1109.         return true if self.is_a?(Game_Event)       # 自分がイベント
  1110.         return true if event.priority_type == 1     # 相手が通常キャラ
  1111.       end
  1112.     end
  1113.     if @priority_type == 1                          # 自分が通常キャラ
  1114.       if parallel?($game_player)                   ##### 追加部分 (この行) #####
  1115.         return true if $game_player.pos_nt?(x, y)  # プレイヤーの座標と一致
  1116.       end                                          ##### 追加部分 (この行) #####
  1117.       return true if $game_map.boat.pos_nt?(x, y)   # 小型船の座標と一致
  1118.       return true if $game_map.ship.pos_nt?(x, y)   # 大型船の座標と一致
  1119.     end
  1120.     return false
  1121.   end
  1122.   #--------------------------------------------------------------------------
  1123.   # ○ キャラクターの同軸存在判定
  1124.   #--------------------------------------------------------------------------
  1125.   def parallel?(character)
  1126.     direction = search_direction(@x, @y, character.x, character.y)
  1127.     turn_back = @turn_back
  1128.     character_turn_back = character.turn_back
  1129.     if direction != 5
  1130.       if direction % 2 == 0
  1131.         if $game_map.rip?(10 - direction, character.x, character.y)
  1132.           turn_back = true
  1133.         end
  1134.       else
  1135.         if diagonal_move_turn_back(direction, character.x, character.y)
  1136.           turn_back = true
  1137.         end
  1138.       end
  1139.       if direction % 2 == 0
  1140.         if $game_map.rip?(direction, @x, @y)
  1141.           character_turn_back = true
  1142.         end
  1143.       else
  1144.         if diagonal_move_turn_back(10 - direction, @x, @y)
  1145.           character_turn_back = true
  1146.         end
  1147.       end
  1148.       tile_id = $game_map.data[character.x, character.y, 0]
  1149.       if $game_map.wall?(tile_id)
  1150.         return true unless ex_passable(direction)
  1151.       end
  1152.     end
  1153.    
  1154.     return turn_back == character_turn_back
  1155.   end
  1156. end

  1157. #==============================================================================
  1158. # ■ Game_Event
  1159. #------------------------------------------------------------------------------
  1160. #  イベントを扱うクラスです。条件判定によるイベントページ切り替えや、並列処理
  1161. # イベント実行などの機能を持っており、Game_Map クラスの内部で使用されます。
  1162. #==============================================================================

  1163. class Game_Event < Game_Character
  1164.   #--------------------------------------------------------------------------
  1165.   # ◎ オブジェクト初期化
  1166.   #     map_id : マップ ID
  1167.   #     event  : イベント (RPG::Event)
  1168.   #--------------------------------------------------------------------------
  1169.   alias tig_ew_event_initialize initialize
  1170.   def initialize(map_id, event)
  1171.     tig_ew_event_initialize(map_id, event)
  1172.     set_turn_back_setting
  1173.   end
  1174.   #--------------------------------------------------------------------------
  1175.   # ○ イベントの初期配置位置取得(裏配置)
  1176.   #--------------------------------------------------------------------------  
  1177.   def set_turn_back_setting
  1178.     @event.name = @event.name.sub(/[\<<]裏配置[\>>]/, "")
  1179.     @turn_back = $& != nil
  1180.     @on_tile = $& == nil
  1181.     @event.name = @event.name.sub(/[\<<]裏透過禁止[\>>]/, "")
  1182.     @not_back_seeing = $& != nil
  1183.   end
  1184.   #--------------------------------------------------------------------------
  1185.   # ● 接触イベントの起動判定
  1186.   #--------------------------------------------------------------------------
  1187.   def check_event_trigger_touch(x, y)
  1188.     return if $game_map.interpreter.running?
  1189.     if @trigger == 2 and $game_player.pos?(x, y)
  1190.       if @character_name != ""                     #### 追加部分 (ここから) ####
  1191.         return unless $game_player.parallel?(self)              
  1192.       end                                          #### 追加部分 (ここまで) ####
  1193.       start if not jumping? and @priority_type == 1
  1194.     end
  1195.   end
  1196. end

  1197. #==============================================================================
  1198. # ■ Game_Vehicle
  1199. #------------------------------------------------------------------------------
  1200. #  乗り物を扱うクラスです。このクラスは Game_Map クラスの内部で使用されます。
  1201. # 現在のマップに乗り物がないときは、マップ座標 (-1,-1) に設定されます。
  1202. #==============================================================================

  1203. class Game_Vehicle < Game_Character
  1204.   #--------------------------------------------------------------------------
  1205.   # ○ タイル表示(on_tile)状態取得
  1206.   #--------------------------------------------------------------------------
  1207.   def on_tile
  1208.     if @driving or @altitude > 0
  1209.       return $game_player.on_tile
  1210.     else
  1211.       return false
  1212.     end
  1213.   end
  1214.   #--------------------------------------------------------------------------
  1215.   # ◎ プレイヤーとの同期
  1216.   #--------------------------------------------------------------------------
  1217.   alias tig_ew_sync_with_player sync_with_player
  1218.   def sync_with_player
  1219.     tig_ew_sync_with_player
  1220.     update_turn_back
  1221.   end  
  1222. end

  1223. #==============================================================================
  1224. # ■ Game_Player
  1225. #------------------------------------------------------------------------------
  1226. #  プレイヤーを扱うクラスです。イベントの起動判定や、マップのスクロールなどの
  1227. # 機能を持っています。このクラスのインスタンスは $game_player で参照されます。
  1228. #==============================================================================

  1229. class Game_Player < Game_Character
  1230.   #--------------------------------------------------------------------------
  1231.   # ○ 公開インスタンス変数
  1232.   #--------------------------------------------------------------------------
  1233.   attr_accessor :game_map_data
  1234.   attr_accessor :reserve_load_map_id
  1235.   #--------------------------------------------------------------------------
  1236.   # ◎ オブジェクト初期化
  1237.   #     map_id : マップ ID
  1238.   #     event  : イベント (RPG::Event)
  1239.   #--------------------------------------------------------------------------
  1240.   alias tig_ew_pl_initialize initialize
  1241.   def initialize
  1242.     tig_ew_pl_initialize
  1243.     @reserve_load_map_id = []
  1244.     @game_map_data = {}
  1245.   end
  1246.   #--------------------------------------------------------------------------
  1247.   # ○ マップデータの先読み
  1248.   #--------------------------------------------------------------------------
  1249.   def beforehand_load(map_id = @reserve_load_map_id)
  1250.     for i in map_id
  1251.       next if @game_map_data.key?(i)
  1252.       map_data = Game_Map.new
  1253.       map_data.setup(i)
  1254.       @game_map_data[i] = map_data
  1255.     end
  1256.     for i in @game_map_data.keys.clone
  1257.       unless map_id.include?(i)
  1258.         @game_map_data.delete(i)
  1259.       end
  1260.     end
  1261.   end
  1262.   #--------------------------------------------------------------------------
  1263.   # ◎ 場所移動の実行
  1264.   #--------------------------------------------------------------------------
  1265.   alias tig_ew_perform_transfer perform_transfer
  1266.   def perform_transfer
  1267.     return unless @transferring
  1268.     unless $game_player.reserve_load_map_id.empty?
  1269.       $game_player.beforehand_load
  1270.     end
  1271.     tig_ew_perform_transfer
  1272.   end
  1273.   #--------------------------------------------------------------------------
  1274.   # ○ 浮かんでいるか?(乗り物拡張用・魔法の絨毯搭乗時)
  1275.   #--------------------------------------------------------------------------  
  1276.   def floating?
  1277.     return @vehicle_type == 5
  1278.   end
  1279.   #--------------------------------------------------------------------------
  1280.   # ● 同位置のイベント起動判定
  1281.   #     triggers : トリガーの配列
  1282.   #--------------------------------------------------------------------------
  1283.   def check_event_trigger_here(triggers)
  1284.     return false if $game_map.interpreter.running?
  1285.     result = false
  1286.     for event in $game_map.events_xy(@x, @y)
  1287.       next unless parallel?(event)                 ##### 追加部分 (この行) #####
  1288.       if triggers.include?(event.trigger) and event.priority_type != 1
  1289.         event.start
  1290.         result = true if event.starting
  1291.       end
  1292.     end
  1293.     return result
  1294.   end
  1295.   #--------------------------------------------------------------------------
  1296.   # ● 正面のイベント起動判定
  1297.   #     triggers : トリガーの配列
  1298.   #--------------------------------------------------------------------------
  1299.   def check_event_trigger_there(triggers)
  1300.     return false if $game_map.interpreter.running?
  1301.     result = false
  1302.     front_x = $game_map.x_with_direction(@x, @direction)
  1303.     front_y = $game_map.y_with_direction(@y, @direction)
  1304.     for event in $game_map.events_xy(front_x, front_y)
  1305.       next unless parallel?(event)                 ##### 追加部分 (この行) #####
  1306.       if triggers.include?(event.trigger) and event.priority_type == 1
  1307.         event.start
  1308.         result = true
  1309.       end
  1310.     end
  1311.     if result == false and $game_map.counter?(front_x, front_y)
  1312.       front_x = $game_map.x_with_direction(front_x, @direction)
  1313.       front_y = $game_map.y_with_direction(front_y, @direction)
  1314.       for event in $game_map.events_xy(front_x, front_y)
  1315.         next unless parallel?(event)               ##### 追加部分 (この行) #####
  1316.         if triggers.include?(event.trigger) and event.priority_type == 1
  1317.           event.start
  1318.           result = true
  1319.         end
  1320.       end
  1321.     end
  1322.     return result
  1323.   end
  1324.   #--------------------------------------------------------------------------
  1325.   # ● 接触イベントの起動判定
  1326.   #     x : X 座標
  1327.   #     y : Y 座標
  1328.   #--------------------------------------------------------------------------
  1329.   def check_event_trigger_touch(x, y)
  1330.     return false if $game_map.interpreter.running?
  1331.     result = false
  1332.     for event in $game_map.events_xy(x, y)
  1333.       if event.character_name != ""                #### 追加部分 (ここから) ####
  1334.         next unless parallel?(event)              
  1335.       end                                          #### 追加部分 (ここまで) ####
  1336.       if [1,2].include?(event.trigger) and event.priority_type == 1
  1337.         event.start
  1338.         result = true
  1339.       end
  1340.     end
  1341.     return result
  1342.   end
  1343.   #--------------------------------------------------------------------------
  1344.   # ◎ 乗り物から降りる
  1345.   #    現在乗り物に乗っていることが前提。
  1346.   #--------------------------------------------------------------------------
  1347.   alias tig_ew_get_off_vehicle get_off_vehicle
  1348.   def get_off_vehicle
  1349.     return if $game_map.back_tile?(@x, @y)
  1350.     if @vehicle_type == 0 or @vehicle_type == 1
  1351.       front_x = $game_map.x_with_direction(@x, @direction)
  1352.       front_y = $game_map.y_with_direction(@y, @direction)
  1353.       return if $game_map.wall?($game_map.point_tile_id(front_x, front_y)[0])
  1354.       return if $game_map.under_bridge_passages[[front_x, front_y]] == 1
  1355.       return if $game_map.prohibited_get_off.include?([front_x, front_y])
  1356.       @no_turn_back = true
  1357.     end
  1358.     tig_ew_get_off_vehicle
  1359.   end
  1360. end

  1361. #==============================================================================
  1362. # ■ Spriteset_Map
  1363. #------------------------------------------------------------------------------
  1364. #  マップ画面のスプライトやタイルマップなどをまとめたクラスです。このクラスは
  1365. # Scene_Map クラスの内部で使用されます。
  1366. #==============================================================================

  1367. class Spriteset_Map
  1368.   #--------------------------------------------------------------------------
  1369.   # ◎ ビューポートの作成
  1370.   #--------------------------------------------------------------------------
  1371.   alias tig_ew_create_viewports create_viewports
  1372.   def create_viewports
  1373.     tig_ew_create_viewports
  1374.     @viewport4 = Viewport.new(0, 0, 640, 480) # 追加レイヤー用ビューポート
  1375.     if Expansion_Passable::BACK_SEEING
  1376.       @viewport5 = Viewport.new(0, 0, 640, 480) # 裏回りキャラ透過用ビューポート
  1377.     end
  1378.     if @viewport6 == nil
  1379.       @viewport6 = Viewport.new(0, 0, 640, 480) # 色調変更用ビューポート
  1380.       @viewport6.z = 25
  1381.     end
  1382.   end
  1383.   #--------------------------------------------------------------------------
  1384.   # ◎ タイルマップの作成
  1385.   #--------------------------------------------------------------------------
  1386.   alias tig_ew_create_tilemap create_tilemap
  1387.   def create_tilemap
  1388.     tig_ew_create_tilemap
  1389.     setup_shadow_eraser_tilemap
  1390.     @ex_tilemap = Tilemap.new(@viewport4)
  1391.     @ex_tilemap.bitmaps[0] = Cache.system("TileA1")
  1392.     @ex_tilemap.bitmaps[1] = Cache.system("TileA2")
  1393.     @ex_tilemap.bitmaps[2] = Cache.system("TileA3")
  1394.     @ex_tilemap.bitmaps[3] = Cache.system("TileA4")
  1395.     @ex_tilemap.bitmaps[4] = Cache.system("TileA5")
  1396.     @ex_tilemap.bitmaps[5] = Cache.system("TileB")
  1397.     @ex_tilemap.bitmaps[6] = Cache.system("TileC")
  1398.     @ex_tilemap.bitmaps[7] = Cache.system("TileD")
  1399.     @ex_tilemap.bitmaps[8] = Cache.system("TileE")
  1400.     @ex_tilemap.map_data = $game_map.ex_data
  1401.     @ex_tilemap.passages = $game_map.passages
  1402.   end
  1403.   #--------------------------------------------------------------------------
  1404.   # ○ 影消し処理用タイルの準備
  1405.   #--------------------------------------------------------------------------
  1406.   def setup_shadow_eraser_tilemap
  1407.     for i in 1952...2048
  1408.       @tilemap.passages[i] = 0x00
  1409.     end
  1410.   end
  1411.   #--------------------------------------------------------------------------
  1412.   # ◎ 飛行船の影スプライトの作成
  1413.   #--------------------------------------------------------------------------
  1414.   alias tig_ew_create_shadow create_shadow
  1415.   def create_shadow
  1416.     tig_ew_create_shadow
  1417.     @shadow_sprite.viewport = @viewport4
  1418.   end
  1419.   #--------------------------------------------------------------------------
  1420.   # ◎ タイルマップの解放
  1421.   #--------------------------------------------------------------------------
  1422.   alias tig_ew_dispose_tilemap dispose_tilemap
  1423.   def dispose_tilemap
  1424.     tig_ew_dispose_tilemap
  1425.     @ex_tilemap.dispose
  1426.   end
  1427.   #--------------------------------------------------------------------------
  1428.   # ◎ ビューポートの解放
  1429.   #--------------------------------------------------------------------------
  1430.   alias tig_ew_dispose_viewports dispose_viewports
  1431.   def dispose_viewports
  1432.     tig_ew_dispose_viewports
  1433.     @viewport4.dispose
  1434.     @viewport5.dispose if Expansion_Passable::BACK_SEEING
  1435.     @viewport6.dispose if @viewport6 != nil
  1436.   end
  1437.   #--------------------------------------------------------------------------
  1438.   # ◎ タイルマップの更新
  1439.   #--------------------------------------------------------------------------
  1440.   alias tig_ew_update_tilemap update_tilemap
  1441.   def update_tilemap
  1442.     tig_ew_update_tilemap
  1443.     @ex_tilemap.ox = $game_map.display_x / 8
  1444.     @ex_tilemap.oy = $game_map.display_y / 8
  1445.     @ex_tilemap.update
  1446.   end
  1447.   #--------------------------------------------------------------------------
  1448.   # ◎ キャラクタースプライトの更新
  1449.   #--------------------------------------------------------------------------
  1450.   alias tig_ew_update_characters update_characters
  1451.   def update_characters
  1452.     back_seeing_characters = []
  1453.     for sprite in @character_sprites
  1454.       if sprite.character.on_tile or sprite.character.priority_type == 2
  1455.         sprite.viewport = @viewport4
  1456.       else
  1457.         sprite.viewport = @viewport1
  1458.       end
  1459.       next if sprite.character.not_back_seeing
  1460.       if $game_player.turn_back and Expansion_Passable::BACK_SEEING
  1461.         x = $game_player.x ; y = $game_player.y
  1462.         if ($game_map.round_x(x-2)..$game_map.round_x(x+2)).include?(sprite.character.x) and
  1463.           ($game_map.round_y(y-2)..$game_map.round_y(y+2)).include?(sprite.character.y)
  1464.           back_seeing_characters.push(sprite.character)
  1465.         end
  1466.       end
  1467.     end
  1468.     back_seeing(back_seeing_characters)
  1469.    
  1470.     tig_ew_update_characters
  1471.   end
  1472.   #--------------------------------------------------------------------------
  1473.   # ○ 裏回りキャラ透過
  1474.   #--------------------------------------------------------------------------  
  1475.   def back_seeing(characters)
  1476.     return unless Expansion_Passable::BACK_SEEING
  1477.     @back_seeing_sprites = [] if @back_seeing_sprites == nil
  1478.     @characters = [] if @characters == nil
  1479.     now_character = []
  1480.     for character in characters
  1481.       now_character.push(character)
  1482.       unless @characters.include?(character)
  1483.         new_sprite = Sprite_Character.new(@viewport5, character)
  1484.         new_sprite.back_seeing = true
  1485.         @back_seeing_sprites.push(new_sprite)
  1486.         @characters.push(new_sprite.character)
  1487.       end
  1488.     end
  1489.    
  1490.     for sprite in @back_seeing_sprites
  1491.       if now_character.include?(sprite.character)
  1492.         sprite.update
  1493.       else
  1494.         @characters.delete(sprite.character)
  1495.         sprite.dispose
  1496.         @back_seeing_sprites.delete(sprite)
  1497.       end
  1498.     end
  1499.   end
  1500.   #--------------------------------------------------------------------------
  1501.   # ◎ フレーム更新
  1502.   #--------------------------------------------------------------------------
  1503.   alias tig_ew_update update
  1504.   def update
  1505.     tig_ew_update
  1506.     update_ew_ex_viewports
  1507.   end
  1508.   #--------------------------------------------------------------------------
  1509.   # ● ビューポートの更新
  1510.   #--------------------------------------------------------------------------
  1511.   def update_viewports
  1512.     @viewport6.tone = $game_map.screen.tone        ##### 修正部分 (この行) #####
  1513.    
  1514.     @viewport1.ox = $game_map.screen.shake
  1515.     @viewport2.color = $game_map.screen.flash_color
  1516.     @viewport3.color.set(0, 0, 0, 255 - $game_map.screen.brightness)
  1517.     @viewport1.update
  1518.     @viewport2.update
  1519.     @viewport3.update
  1520.    
  1521.     @viewport6.update                              ##### 追加部分 (この行) #####
  1522.   end
  1523.   #--------------------------------------------------------------------------
  1524.   # ○ 拡張ビューポートの更新
  1525.   #--------------------------------------------------------------------------
  1526.   def update_ew_ex_viewports
  1527.     @viewport4.ox = $game_map.screen.shake
  1528.     @viewport4.update
  1529.     if Expansion_Passable::BACK_SEEING
  1530.       @viewport5.rect.set($game_player.screen_x - 48, $game_player.screen_y - 64, 96, 96)
  1531.       @viewport5.ox = $game_map.screen.shake
  1532.       @viewport5.update
  1533.     end      
  1534.   end
  1535. end

  1536. #==============================================================================
  1537. # ■ Sprite_Character
  1538. #------------------------------------------------------------------------------
  1539. #  キャラクター表示用のスプライトです。Game_Character クラスのインスタンスを
  1540. # 監視し、スプライトの状態を自動的に変化させます。
  1541. #==============================================================================

  1542. class Sprite_Character < Sprite_Base
  1543.   #--------------------------------------------------------------------------
  1544.   # ○ 公開インスタンス変数
  1545.   #--------------------------------------------------------------------------
  1546.   attr_accessor :back_seeing
  1547.   #--------------------------------------------------------------------------
  1548.   # ◎ オブジェクト初期化
  1549.   #     viewport  : ビューポート
  1550.   #     character : キャラクター (Game_Character)
  1551.   #--------------------------------------------------------------------------
  1552.   alias tig_ew_initialize initialize
  1553.   def initialize(viewport, character = nil)
  1554.     tig_ew_initialize(viewport, character)
  1555.     @back_seeing = false
  1556.   end
  1557.   #--------------------------------------------------------------------------
  1558.   # ◎ フレーム更新
  1559.   #--------------------------------------------------------------------------
  1560.   alias tig_ew_update update
  1561.   def update
  1562.     tig_ew_update
  1563.     if @back_seeing
  1564.       self.opacity = 100 if self.opacity > 100
  1565.       self.x -= $game_player.screen_x - 48
  1566.       self.y -= $game_player.screen_y - 64
  1567.     end
  1568.   end
  1569.   #--------------------------------------------------------------------------
  1570.   # ◎ フキダシアイコン表示の開始
  1571.   #--------------------------------------------------------------------------
  1572.   alias tig_ew_start_balloon start_balloon
  1573.   def start_balloon
  1574.     tig_ew_start_balloon
  1575.     @balloon_sprite.viewport = @viewport4
  1576.   end
  1577. end

  1578. #==============================================================================
  1579. # ■ Scene_Title
  1580. #------------------------------------------------------------------------------
  1581. #  タイトル画面の処理を行うクラスです。
  1582. #==============================================================================

  1583. class Scene_Title < Scene_Base
  1584.   #--------------------------------------------------------------------------
  1585.   # ◎ 開始処理
  1586.   #--------------------------------------------------------------------------
  1587.   alias tig_ew_start start
  1588.   def start
  1589.     tig_ew_start
  1590.     $game_map.create_ex_passages
  1591.   end
  1592.   #--------------------------------------------------------------------------
  1593.   # ◎ データベースのロード
  1594.   #    name から<船の橋下通過>の設定を得ます。
  1595.   #--------------------------------------------------------------------------
  1596.   alias tig_ew_load_database load_database
  1597.   def load_database
  1598.     tig_ew_load_database
  1599.     for area in $data_areas.values
  1600.       area.name = area.name.sub(/[\<<]架け橋[\>>]/, "") # 名前の修正と
  1601.       area.ship_pass = $& != nil                    # 船の橋下通過エリアの設定
  1602.       area.name = area.name.sub(/[\<<]処理無視[\>>]/, "") # 名前の修正と
  1603.       area.disregard_processing = $& != nil         # 処理無視エリアの設定
  1604.     end
  1605.   end
  1606. end
复制代码



  1. #============================================================================
  2. #
  3. # ■壁タイル拡張 □Ver.4.20 □製作者:月紳士
  4. # ・RPGツクールVX用 RGSS2スクリプト(マニュアル)
  5. #
  6. #    ●…書き換えメソッド(競合注意) ◎…メソッドのエイリアス ○…新規メソッド
  7. #
  8. #  ※二次配布禁止!配布元には利用規約があります。必ずそちらを見てください。
  9. #------------------------------------------------------------------------------
  10. # ※ このスクリプトは「段差マップ 通行判定拡張」をリネームしたものです。
  11. #------------------------------------------------------------------------------
  12. # 更新履歴
  13. #   Ver.4.20  イベント側からの接触判定に段違い処理を導入。
  14. #   Ver.4.13  前回の修正より、エリア系処理が機能しなくなっていた不具合の修正。
  15. #   Ver.4.12  ゲームロード時に特殊通行判定が無効になっていた不具合の修正。
  16. #   Ver.4.11  影消しタイルの不具合修正。
  17. #   Ver.4.10  マップデータの先読み機能、処理無視エリア設定の追加。
  18. #   Ver.4.00  マップ移動時の処理軽量化と様々な不具合修正。
  19. #   Ver.3.10  乗り物拡張併用時の魔法の絨毯の処理に関する修正。
  20. #   Ver.3.01  斜め移動時の処理修正。
  21. #   Ver.3.00  斜め移動処理の追加、それに伴う内部処理大幅変更。
  22. #             壁に扉などを配置した際の重なり順の不具合改善。(通常マップ時)
  23. #             フキダシは裏に隠れないように修正。
  24. #             飛行船搭乗時に裏に隠れないように修正。
  25. #   Ver.2.12 不具合修正。
  26. #   Ver.2.10 月紳士のスクリプト「乗り物拡張」との併用機能の強化。
  27. #   Ver.2.00  月紳士のスクリプト「乗り物拡張」との併用を(一応)可能に。
  28. #   Ver.1.11  接触イベント処理修正。
  29. #   Ver.1.10  月紳士のスクリプト「追加地形タイル」との併用に対応。
  30. #============================================================================
  31. =begin

  32.  ※このマニュアルは素材としてプロジェクト内に貼り付ける事も可能です。

  33.   こちらはマニュアルとなります。スクリプト本体は、別にあります。
  34.   
  35.   詳しい活用例はサンプルプロジェクトも参考にしてみてください。
  36.   サンプルプロジェクトには各特殊タイルに使用する為のEタイル画像も入っています。
  37.   そちらを流用してもかまいません。加工などして、お使いください。

  38. #------------------------------------------------------------------------------

  39. ・基本機能
  40.   スクリプトを導入することで、以下の機能が働きます。

  41.  ○ 天井や屋根を歩くことが出来るようになる。

  42.   ・壁タイルの天井部分や屋根タイルが通行可能になり、
  43.    その変わりにその境目は越えることが出来なくなる。

  44.   という通行判定ルールが追加されます。

  45.   天井や屋根には境目が通行不能の為に普通は進入できませんが、
  46.   ハシゴや階段タイルを配置することでそこから侵入できるような
  47.   仕組みになっています。


  48.  ○ 壁・天井・屋根タイル・橋タイルの裏(下)へキャラが回り込む

  49.   まるで建物や壁の向こう側を通っているような表現にすることができます。
  50.   RPGツクールXPにあったような機能です。

  51.   また、吊り橋に見立てた橋の上を渡ったり、下をくぐったり、という表現を
  52.   同じマップで行えます。

  53.  ※ このスクリプトは、タイルの境目の配置などの情報を元に、
  54.    状況を判断して裏にまわったり、上にのせたりすることで
  55.    「擬似的に」裏側を再現するものです。

  56.    配置によっては、ありえない動きをしますが、
  57.    現状の動作は“仕様”と捉えていただき、
  58.    このスクリプトでの出来る範囲での演出でお楽しみください。

  59. #------------------------------------------------------------------------------

  60. ・カスタマイズ

  61.  ● 段差のあるマップ表現

  62.   このスクリプトでは、天井タイルの上にさらに壁タイルを配置することで作る
  63.   擬似的な「階段状の立体マップ」を表現する際の、通行判定の補助も行えます。
  64.   
  65.   その際には、
  66.    草原といった地形タイルにも、境目に通行判定を持たせて
  67.    天井タイルを使うように段差表現に利用することもできます。

  68.    この機能を反映させると、
  69.   通行判定や表現に、いくつか制約が出来てしまう為、
  70.    マップ毎に「段差マップにするか」を設定する形式にしてあります。

  71.    カスタマイズ項目の

  72.    CLIFF_MAP = []

  73.    の[]内に、地形タイルの段差表現を使用したいマップのIDを記入してください。
  74.    例えばマップID004、ID005で地形タイルの段差表現を使用したい場合は、
  75.    CLIFF_MAP = [4, 5]
  76.    となります。半角の , で区切り、頭のゼロは省いてください。

  77.    表現上の制約
  78.    横幅32ピクセルを超えるキャラクターが裏回りすると、
  79.    おかしな位置からはみ出してしまうことがあります。
  80.    また、キャラクター同士の上下の重なりでも不具合があります。
  81.    このマップでは(裏回りする可能性のある)キャラクターは
  82.    縦幅、横幅共に32ピクセル以下のサイズで構成する必要があります。
  83.    (デフォルトのチビキャラのサイズです)
  84.  
  85.    地形タイルについて
  86.    地形タイルにより、段差となる境目が出来るのは
  87.    隣り合ったタイルの一方のみに境目がある場合です。
  88.    (通常は配置すると自動で隣り合ったタイル両方に境目が出来ます)
  89.    SHIFTキーを使ったタイルのコピー・ペーストのテクニックが必須になります。

  90.    上級者向けです。サンプルマップをご参考に、研究してみてください。


  91.  ● 船に乗った際、橋の下をくぐれるようにしたい場合は…

  92.    エリアの名前に

  93.     <架け橋>

  94.    と記入したエリアで、くぐらせたい橋を指定してください。
  95.    橋の下のタイルが水面の場合に限り、
  96.    船にのった状態でくぐれるようになります。

  97.    通常は、橋は船の通行を妨げます。(船の乗り降りが出来ます)


  98.  ● イベントを裏位置に初期配置したい場合は…

  99.    イベントの名前に

  100.     <裏配置>

  101.    と記入してください。
  102.    壁の裏側にいるキャラクターや、壁の裏に隠れた宝箱を作成できます。
  103.    裏側の通行障害が必要な時などにも活用してください。


  104.  ● 深く裏回りする機能

  105.    壁の裏へ2タイル分、潜り込むようにも出来ます。(通常は1タイル分)
  106.    
  107.    カスタマイズ項目の

  108.     BACK_TILE_DEEP = false

  109.    を = true に書き換えてください。


  110.  ● 裏回り時の透過機能

  111.    プレイヤーが裏へ回った際、プレイヤーと
  112.    周囲のキャラクター(イベント)を透過、すなわち透けてみせる機能です。
  113.    
  114.    カスタマイズ項目の

  115.     BACK_SEEING = false

  116.    を = true に書き換えてください。

  117.   ※この機能は乗り物拡張との併用に未対応です。


  118.  ● 裏回り時に透過しないイベントを設定

  119.    イベントの名前に

  120.     <裏透過禁止>

  121.    と記入してください。
  122.    半透明の装飾用タイル替わりのイベントなど、
  123.    透過表現にふさわしくないイベントがあった際、設定してみてください。


  124.  ● 自動生成された影を消す

  125.    配置すると、配置した場所に自動生成された影をゲーム中では消去できる
  126.    「影消しタイル」を使用できます。

  127.    カスタマイズ項目の SHADOW_ERASER_TILE_ID にて、ID指定してください。
  128.    このタイルの画像は、ゲーム中には表示されません。

  129.    ※ この機能の詳細に関しましては
  130.     月紳士配布の「影消しタイル」スクリプトもご参照ください。


  131.  ● 船から降りれない場所を設定する

  132.    配置することで、大型船・小型船からその場所に降りることが出来なくなる
  133.    「接岸禁止タイル」を使用できます。

  134.    カスタマイズ項目の PROHIBITED_GET_OFF_TILE_ID にて、ID指定してください。
  135.    このタイルの画像は、ゲーム中には表示されません。

  136.    ※ この機能の詳細に関しましては
  137.     月紳士配布の「接岸禁止タイル」スクリプトもご参照ください。

  138.    
  139.  ● 裏回り部分を追加するタイル

  140.      主に、抜け道などを作る為に使います。
  141.    カスタマイズ項目の ADDITION_BACK_TILE_ID で設定したIDのタイルを
  142.    元々裏回りしない場所の壁や天井、屋根にのせてください。
  143.    (元々裏回りする場所に配置すると誤動作するかもしれません)


  144.  ● 裏回り部分を削除するタイル

  145.      裏回り部分は、天井の上端を基準にして自動的に配置されますが、
  146.    その自動配置された裏回り部分を削除するタイルを設定できます。
  147.    カスタマイズ項目の DELETE_BACK_TILE_ID で設定したIDのタイルを
  148.    裏回りする場所の壁や天井、屋根にのせてください。
  149.    (配置により効果的でない場合があるかもしれません)

  150. #------------------------------------------------------------------------------

  151. ・軽量化処理

  152.  このスクリプトは、マップが大きくなればなるほど、
  153.  初期のデータ準備にどうしても時間がかかってしまいます。

  154.  その対策の為に用意した、処理軽量化の方法を説明します。

  155.  ● 処理を無視するマップ

  156.    カスタマイズ項目の、下記の項目で設定します。

  157.       ESCAPE_MAP = [1, 2]
  158.    
  159.      このマップでは、裏回りを行いません。
  160.      処理の準備をしない為、読み込みも速くなります。
  161.      

  162.  ● 処理を無視するエリア

  163.    通常ですと、裏回り用のタイルを準備する必要があるか?
  164.    マップの隅々までチェックを行います。
  165.    その為、広いマップほど準備処理に時間がかかります。

  166.    マップの中に、下記の名前を含んだエリアを作ると、
  167.    そのエリアの段差マップ用データの準備処理を飛ばします。
  168.    いくらか、準備処理を早めることができます。

  169.    マップ内の、裏回り処理の必要のない位置に

  170.    <処理無視>

  171.    と書いたエリアを用意してください。
  172.    マップ内に、同名の複数のエリアを作っても良いです。

  173.  ● マップデータの先読み

  174.    通常、データ準備はマップ移動時に行われます。
  175.    これを、別のタイミングでおこなったり、
  176.    ひとつのマップの読み込み時に複数のマップのデータを準備しておき
  177.    以後のマップ移動時の処理を軽くしたり出来ます。

  178.   ・別タイミングでの先読み

  179.     イベントコマンド・スクリプトにて

  180.         $game_player.beforehand_load([1, 2])
  181.      
  182.     と記述して実行してください。
  183.     ([ ]) 内がマップのIDです。
  184.     上記ですと、マップID 001 と 002 のマップデータを先読みします。
  185.     複数のID指定は、半角ピリオドで区切ります。

  186.     ※準備中は、画面がフリーズします。

  187.   ・マップ移動時に先読み

  188.     マップ移動よりも前に、次の記述を
  189.     イベントコマンド・スクリプトにて実行してください。

  190.         $game_player.reserve_load_map_id = [1, 2]
  191.       
  192.        = [ ] 内がマップのIDです。
  193.        このコマンドが実行された後のマップ移動の暗転中に、データを準備します。
  194.        (暗転の時間が長くなりますが、処理は自然に見えると思います)
  195.       
  196.      どちらのコマンドも、最後に指定されたデータがのみが準備され、
  197.      それ以前のコマンドによるデータは破棄されます。
  198.       
  199. #------------------------------------------------------------------------------
  200. =end
复制代码

去你爹的现充.去你爹的异性恋.
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部