设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1168|回复: 2
打印 上一主题 下一主题

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
140 小时
注册时间
2011-10-9
帖子
12
跳转到指定楼层
1
发表于 2012-6-9 09:02:35 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
就是像这样子的:




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


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


那位大大有的请发一下,谢谢咯~
[

Lv1.梦旅人

梦石
0
星屑
50
在线时间
242 小时
注册时间
2011-12-10
帖子
238
2
发表于 2012-6-9 09:50:44 | 只看该作者
你想知道?我们不告诉你,可怜的人呐,慢慢研究吧~

点评

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

评分

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

查看全部评分

回复

使用道具 举报

Lv1.梦旅人

54酱是大笨蛋!

梦石
0
星屑
66
在线时间
1389 小时
注册时间
2011-2-23
帖子
5014
3
发表于 2012-6-9 10:30:35 | 只看该作者
RUBY 代码复制
  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.  ○ 壁・天井・屋根タイル・橋タイルの裏(下)へキャラが回り込む
  31.  
  32.  ※ 詳しい説明はマニュアルをご覧ください。
  33.  
  34. =end
  35. #------------------------------------------------------------------------------
  36.  
  37.  
  38. #==============================================================================
  39. # □ カスタマイズ項目
  40. #==============================================================================
  41.  
  42. module Expansion_Passable
  43.  
  44.   CLIFF_MAP = [4, 5]
  45.   # 段差マップを使用するマップのID
  46.  
  47.   BACK_TILE_DEEP = false
  48.   # 壁の深さを増すなら = true に。戻すなら = false に。
  49.  
  50.   BACK_SEEING = true
  51.   # 裏回りした際、キャラを透過するなら = true に。しないなら = false に。
  52.  
  53.   SHADOW_ERASER_TILE_ID = 768
  54.   # 「影消しタイル」にするタイルのIDをここで指定します。
  55.   # このタイルが不要な際は = nil としてください。
  56.  
  57.   PROHIBITED_GET_OFF_TILE_ID = 769
  58.   # 「接岸禁止」地点を示す為に使うタイルのIDをここで指定します。
  59.   # このタイルが不要な際は = nil としてください。
  60.  
  61.   ADDITION_BACK_TILE_ID = 770
  62.   # 「追加裏回り部分」を示す為に使うタイルのIDをここで指定します。
  63.   # このタイルが不要な際は = nil としてください。
  64.  
  65.   DELETE_BACK_TILE_ID = 771
  66.   # 「裏回り部分消去」を示す為に使うタイルのIDをここで指定します。
  67.   # このタイルが不要な際は = nil としてください。
  68.  
  69.   ESCAPE_MAP = [99]
  70.   # 裏回り処理自体をまったく行わないマップのID
  71.   # 広いフィールドマップなどを、その読み込みを早める為に登録してください。
  72.  
  73. end
  74.  
  75. #==============================================================================
  76. # □ タイル情報 ※カスタマイズ可能(上級者向け)
  77. #==============================================================================
  78.  
  79. module Data_Tile
  80.  
  81.   # 擬似段差機能を使用する屋根・天井・地形タイル
  82.   FUNCTION_TILE = [
  83.    2816, 2960,                                     # 草原(フィールド用, 屋外用)
  84.    3200, 3344,                                     # 乾燥地帯(フィールド用, 屋外用)
  85.    3584, 3728,                                     # 砂漠(フィールド用, 屋外用)
  86.    3968, 4112,                                     # 雪原(フィールド用, 屋外用)
  87.    4352, 4400, 4448, 4496, 4544, 4592, 4640, 4688, # 屋根    (1列目)
  88.    4736, 4784, 4832, 4880, 4928, 4976, 5024, 5072, # 建物の壁(1列目)
  89.    5120, 5168, 5216, 5264, 5312, 5360, 5408, 5456, # 屋根    (2列目)
  90.    5504, 5552, 5600, 5648, 5696, 5744, 5792, 5840, # 建物の壁(2列目)
  91.    5888, 5936, 5984, 6032, 6080, 6128, 6176, 6224, # 洞窟の天井(1列目)
  92.    6272, 6320, 6368, 6416, 6464, 6512, 6560, 6608, # 洞窟の壁  (1列目)
  93.    6656, 6704, 6752, 6800, 6848, 6896, 6944, 6992, # 洞窟の天井(2列目)
  94.    7040, 7088, 7136, 7184, 7232, 7280, 7328, 7376, # 洞窟の壁  (2列目)
  95.    7424, 7472, 7520, 7568, 7616, 7664, 7712, 7760, # 洞窟の天井(3列目)
  96.    7808, 7856, 7904, 7952, 8000, 8048, 8096, 8144, # 洞窟の壁  (3列目)
  97.    1904, 1952, 2000]                               # ダミータイルID(消さないこと)
  98.   # ※ 機能を使いたくないタイルがあればここから削ってください。
  99.   #   (削り専用、付け加えても効果はありません)
  100.  
  101.   # 縦の橋としてあつかうタイルID
  102.   BRIDRE_LENGTH = [5]
  103.  
  104.   # 横の橋としてあつかうタイルID
  105.   BRIDGE_BREADTH = [18]
  106.  
  107.  
  108.   # 階段・梯子・洞窟の入り口としてあつかうタイルID(ステップタイル)
  109.   STEP = [67, 68, 69, 70, 71, 172, 173, 174, 175,
  110.           260, 261, 262, 263, 268, 269, 270,
  111.           271, 278, 279, 284, 285, 286, 287,
  112.           612, 613, 616, 617, 618, 619,
  113.           1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607,
  114.           1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615]
  115.   # ※ これらのタイルが隣接している時に、境目の通行不可判定を無視させます。
  116.  
  117.  
  118.   # 橋の下の通行判定処理用 タイルID
  119.   UNDER_BRIDGE = 1664
  120.   # ※ デフォルトのID_1664はゲームでは使用されない、画像のないタイルです。
  121.   #    必要がなければ変更しないで結構です。
  122.  
  123. end
  124.  
  125. #==============================================================================
  126. # □ オートタイル情報 ※変更はしないでください。
  127. #==============================================================================
  128.  
  129. module Data_Auto_Tile
  130.  
  131.   # 境目があるチップを方向ごとに配列化したもの↓(オートタイル内でのID)
  132.   # 床タイプ
  133.   VERGE_DOWN_A = [28, 29, 30, 31, 33, 38, 39, 40, 41, 43, 44, 45, 46]
  134.   VERGE_LEFT_A = [16, 17, 18, 19, 32, 34, 35, 40, 41, 42, 43, 44, 46]
  135.   VERGE_RIGHT_A = [24, 25, 26, 27, 32, 36, 37, 38, 39, 42, 44, 45, 46]
  136.   VERGE_UP_A = [20, 21, 22, 23, 33, 34, 35, 36, 37, 42, 43, 45, 46]
  137.  
  138.   # 壁タイプ
  139.   VERGE_DOWN_B = [8, 9, 10, 11, 12, 13, 14, 15]
  140.   VERGE_LEFT_B = [1, 3, 5, 7, 9, 11, 13, 15]
  141.   VERGE_RIGHT_B = [4, 5, 6, 7, 12, 13, 14, 15]
  142.   VERGE_UP_B = [2, 3, 6, 7, 10, 11, 14, 15]
  143.  
  144. end
  145.  
  146. #==============================================================================
  147. # ■ RPG::Area
  148. #==============================================================================
  149.  
  150. class RPG::Area
  151.   #--------------------------------------------------------------------------
  152.   # ○ 公開インスタンス変数
  153.   #--------------------------------------------------------------------------
  154.   attr_accessor :ship_pass
  155.   attr_accessor :disregard_processing
  156. end
  157.  
  158. #==============================================================================
  159. # ■ Game_Map
  160. #------------------------------------------------------------------------------
  161. #  マップを扱うクラスです。スクロールや通行可能判定などの機能を持っています。
  162. # このクラスのインスタンスは $game_map で参照されます。
  163. #==============================================================================
  164.  
  165. class Game_Map
  166.   #--------------------------------------------------------------------------
  167.   # ○ 公開インスタンス変数
  168.   #--------------------------------------------------------------------------
  169.   attr_reader   :map
  170.   attr_reader   :ex_data
  171.   attr_reader   :under_bridge_passages    # 橋の下の通行判定
  172.   attr_reader   :back_tiles_position      # 裏回りする座標
  173.   attr_reader   :keep_back_position       # 裏回りを維持する座標
  174.   attr_reader   :prohibited_get_off       # 接岸禁止座標
  175.   attr_reader   :ex_data                  # 拡張レイヤー用タイルデータ
  176.   #--------------------------------------------------------------------------
  177.   # ◎ セットアップ
  178.   #     map_id : マップ ID
  179.   #--------------------------------------------------------------------------
  180.   alias tig_ew_setup setup
  181.   def setup(map_id)
  182.     tig_ew_setup(map_id)
  183.     create_ex_passages
  184.     pick_up_back_tiles
  185.     setup_back_tiles
  186.     $game_player.set_on_tile
  187.     for event in $game_map.events.values
  188.       event.update_turn_back
  189.     end
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ○ 指定座標のタイルIDの取得
  193.   #--------------------------------------------------------------------------
  194.   def point_tile_id(x, y)
  195.     return [data[x, y, 0], data[x, y, 1], data[x, y, 2]]
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ○ オートタイルIDの取得(オートタイル郡の中で順番にIDをつけた独自のIDです)
  199.   #--------------------------------------------------------------------------
  200.   def auto_(tile_id)
  201.     return 0 unless (1904...8192).include?(tile_id)
  202.     return (tile_id - 1904) % 48
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ○ トップタイルIDの取得(オートタイル郡の最初のID)
  206.   #--------------------------------------------------------------------------
  207.   def top_(tile_id)
  208.     return 0 if tile_id == nil
  209.     return (tile_id - auto_(tile_id))
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # ○ スクリプト機能を使用する屋根・天井・壁タイルか?
  213.   #--------------------------------------------------------------------------
  214.   def ceiling?(tile_id)
  215.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  216.     return true if wall?(tile_id)
  217.     return true if (2000...2048).include?(tile_id)
  218.     return true if (4352...4736).include?(tile_id)
  219.     return true if (5120...5504).include?(tile_id)
  220.     return true if (5888...6272).include?(tile_id)
  221.     return true if (6656...7040).include?(tile_id)
  222.     return (7424...7808).include?(tile_id)
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ○ スクリプト機能を使用する壁タイルか?
  226.   #--------------------------------------------------------------------------
  227.   def wall?(tile_id)
  228.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  229.     return true if (1904...2000).include?(tile_id)
  230.     return true if (4736...5120).include?(tile_id)
  231.     return true if (5504...5888).include?(tile_id)
  232.     return true if (6272...6656).include?(tile_id)
  233.     return true if (7040...7424).include?(tile_id)
  234.     return (7808...8192).include?(tile_id)
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ○ スクリプト機能を使用する地形タイルか?
  238.   #--------------------------------------------------------------------------
  239.   def cliff?(tile_id)
  240.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  241.     return [2816, 3200, 3584, 2960, 3344, 3728, 4112].include?(top_(tile_id))
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # ○ 指定の向きにオートタイルチップの境目があるか?
  245.   #--------------------------------------------------------------------------
  246.   def verge?(tile_id, direction)
  247.     auto_tile_id = auto_(tile_id)
  248.  
  249.     return false if auto_tile_id == 0
  250.     return false unless ceiling?(tile_id) or cliff?(tile_id)
  251.  
  252.     if (1904...2000).include?(tile_id) or
  253.        (4352...5888).include?(tile_id) or
  254.        (6272...6656).include?(tile_id) or
  255.        (7040...7424).include?(tile_id) or
  256.        (7808...8192).include?(tile_id)           # オートタイルの線画タイプ判別
  257.       case direction # 壁タイプの場合 方向ごとに振り分け
  258.       when 2 ; return true if Data_Auto_Tile::VERGE_DOWN_B.include?(auto_tile_id)
  259.       when 4 ; return true if Data_Auto_Tile::VERGE_LEFT_B.include?(auto_tile_id)
  260.       when 6 ; return true if Data_Auto_Tile::VERGE_RIGHT_B.include?(auto_tile_id)
  261.       when 8 ; return true if Data_Auto_Tile::VERGE_UP_B.include?(auto_tile_id)
  262.       end
  263.     else
  264.       case direction # 床タイプの場合 方向ごとに振り分け
  265.       when 2 ; return true if Data_Auto_Tile::VERGE_DOWN_A.include?(auto_tile_id)
  266.       when 4 ; return true if Data_Auto_Tile::VERGE_LEFT_A.include?(auto_tile_id)
  267.       when 6 ; return true if Data_Auto_Tile::VERGE_RIGHT_A.include?(auto_tile_id)
  268.       when 8 ; return true if Data_Auto_Tile::VERGE_UP_A.include?(auto_tile_id)
  269.       end
  270.     end
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # ○ 指定の向きに有効な境目があるか?
  274.   #--------------------------------------------------------------------------
  275.   def rip?(direction, x, y, floating = false)
  276.     #- 位置情報の準備
  277.     tile_id = point_tile_id(x, y)
  278.     front_x = x_with_direction(x, direction)
  279.     front_y = y_with_direction(y, direction)
  280.     front_tile_id = point_tile_id(front_x, front_y)
  281.  
  282.     #- ステップタイルがあれば無効
  283.     return false if Data_Tile::STEP.include?(front_tile_id[0])
  284.     return false if Data_Tile::STEP.include?(front_tile_id[2])
  285.     return false if Data_Tile::STEP.include?(tile_id[0])
  286.     return false if Data_Tile::STEP.include?(tile_id[2])
  287.  
  288.     #- 橋タイルの処理
  289.     if floating
  290.       if Data_Tile::BRIDRE_LENGTH.include?(tile_id[2]) or
  291.          Data_Tile::BRIDGE_BREADTH.include?(tile_id[2])
  292.         return false if @under_bridge_passages[[x, y]] == -1
  293.       elsif Data_Tile::BRIDRE_LENGTH.include?(front_tile_id[2]) or
  294.             Data_Tile::BRIDGE_BREADTH.include?(front_tile_id[2])
  295.         return false if @under_bridge_passages[[front_x, front_y]] == -1  
  296.       end
  297.     end
  298.  
  299.     if bridge?(front_tile_id[2], direction)
  300.       return false
  301.     elsif Data_Tile::BRIDRE_LENGTH.include?(tile_id[2]) and back_tile?(x, y)
  302.       return true if direction == 4 or direction == 6
  303.       return false if direction == 2 or direction == 8
  304.     elsif Data_Tile::BRIDGE_BREADTH.include?(tile_id[2]) and back_tile?(x, y)
  305.       return true if direction == 2 or direction == 8
  306.       return false if direction == 4 or direction == 6
  307.     end
  308.  
  309.     #- 地形タイルの処理
  310.     if cliff?(tile_id[0])
  311.       if Expansion_Passable::CLIFF_MAP.include?($game_map.map_id)
  312.         return false unless ceiling?(front_tile_id[0]) or cliff?(front_tile_id[0])
  313.         if cliff?(front_tile_id[0]) and verge?(front_tile_id[0], 10 - direction)
  314.           return false
  315.         end
  316.       else
  317.         return false
  318.       end
  319.     end
  320.  
  321.     #- タイルに境目があるか?
  322.     return verge?(tile_id[0], direction)
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # ○ 指定の向きに準じた橋タイルか?(渡ることの出来る向きか)
  326.   #--------------------------------------------------------------------------
  327.   def bridge?(tile_id, direction)
  328.     if direction == 2 or direction == 8
  329.       return true if Data_Tile::BRIDRE_LENGTH.include?(tile_id)
  330.     elsif direction == 4 or direction == 6
  331.       return true if Data_Tile::BRIDGE_BREADTH.include?(tile_id)
  332.     end
  333.     return false
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ○ 上層に移すタイルか?
  337.   #--------------------------------------------------------------------------
  338.   def upper_layer?(tile_id)
  339.     return false if @back_tiles_a == nil
  340.     if Expansion_Passable::CLIFF_MAP.include?(@map_id)
  341.       return true if @back_tiles_b.include?(tile_id)
  342.     else
  343.       unless cliff?(tile_id)
  344.         return true if @back_tiles_a.include?(tile_id)
  345.       end
  346.     end
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ○ <船の橋下通過>処理をするエリアか?
  350.   #--------------------------------------------------------------------------
  351.   def ship_pass_area?(x, y)
  352.     result = false
  353.     for area in $data_areas.values
  354.       next if area == nil
  355.       next unless area.ship_pass
  356.       next if $game_map.map_id != area.map_id
  357.       next if x < area.rect.x
  358.       next if y < area.rect.y
  359.       next if x >= area.rect.x + area.rect.width
  360.       next if y >= area.rect.y + area.rect.height
  361.       result = true
  362.     end
  363.     return result
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # ○ 処理の無視をするエリアか?
  367.   #--------------------------------------------------------------------------
  368.   def disregard_processing_area?(x, y, map_id)
  369.     result = false
  370.     for area in $data_areas.values
  371.       next if area == nil
  372.       next unless area.disregard_processing
  373.       next if map_id != area.map_id
  374.       next if x < area.rect.x
  375.       next if y < area.rect.y
  376.       next if x >= area.rect.x + area.rect.width
  377.       next if y >= area.rect.y + area.rect.height
  378.       result = true
  379.     end
  380.     return result
  381.   end
  382.   #--------------------------------------------------------------------------
  383.   # ○ 段差マップか?
  384.   #--------------------------------------------------------------------------
  385.   def cliff_map?
  386.     return Expansion_Passable::CLIFF_MAP.include?(@map_id)
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # ○ 特殊通行判定の作成
  390.   #--------------------------------------------------------------------------
  391.   def create_ex_passages
  392.     @ex_passages = $data_system.passages
  393.  
  394.     #- 壁・屋根・天井タイルの通行判定を○に変える
  395.     for i in 1904...2048
  396.       @ex_passages[i] = 0x06 if ceiling?(i)
  397.     end
  398.     for i in 4352...8192
  399.       @ex_passages[i] = 0x06 if ceiling?(i)
  400.     end
  401.  
  402.     #- 橋タイルの通行判定を○に
  403.     for i in (Data_Tile::BRIDRE_LENGTH + Data_Tile::BRIDGE_BREADTH)
  404.       @ex_passages[i] = 0x00
  405.     end
  406.  
  407.     @passages = @ex_passages
  408.   end
  409.   #--------------------------------------------------------------------------
  410.   # ○ 接岸禁止タイル登録
  411.   #     map_id : マップ ID
  412.   #--------------------------------------------------------------------------
  413.   def prohibited_get_off_set(x, y)
  414.     @map.data[x, y, 2] = 0
  415.     @prohibited_get_off.push([x, y])
  416.   end
  417.   #--------------------------------------------------------------------------
  418.   # ○ 影消しタイル処理
  419.   #--------------------------------------------------------------------------
  420.   def shadow_eraser(x, y)
  421.     r_x = round_x(x - 1) ; r_y = round_y(y - 1)
  422.     tile_id = @map.data[r_x, y, 0]
  423.  
  424.     # 壁(線画・壁タイプ)
  425.     if (4736...5120).include?(tile_id) or
  426.        (5504...5888).include?(tile_id) or
  427.        (6272...6656).include?(tile_id) or
  428.        (7040...7424).include?(tile_id) or
  429.        (7808...8192).include?(tile_id)
  430.       dummy_tile_id = 1904 + auto_(tile_id)
  431.     # 屋根(線画・壁タイプ)
  432.     elsif (4352...4736).include?(tile_id) or
  433.           (5120...5504).include?(tile_id)
  434.       dummy_tile_id = 1952 + auto_(tile_id)
  435.     # 天井(線画・床タイプ)
  436.     elsif (5888...6272).include?(tile_id) or
  437.           (6656...7040).include?(tile_id) or
  438.           (7424...7808).include?(tile_id)
  439.       dummy_tile_id = 2000 + auto_(tile_id)
  440.     else
  441.       return
  442.     end
  443.  
  444.     @map.data[r_x, r_y, 1] = @map.data[r_x, r_y, 0]
  445.     @map.data[r_x, r_y, 0] = dummy_tile_id
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # ○ 裏回り消去タイル処理
  449.   #--------------------------------------------------------------------------
  450.   def back_tiles_position_delete(x, y)
  451.     return if Expansion_Passable::DELETE_BACK_TILE_ID == nil
  452.     y = round_y(y+1) if Expansion_Passable::BACK_TILE_DEEP
  453.     if @map.data[x, y, 2] == Expansion_Passable::DELETE_BACK_TILE_ID or
  454.        @ex_data[x, y, 2] == Expansion_Passable::DELETE_BACK_TILE_ID
  455.       @back_tiles_position.delete([x, y])
  456.       @map.data[x, y, 2] = 0
  457.       @ex_data[x, y, 2] = 0
  458.     end
  459.   end
  460.   #--------------------------------------------------------------------------
  461.   # ○ 裏回り用タイル種類ピックアップ
  462.   #--------------------------------------------------------------------------  
  463.   def pick_up_back_tiles
  464.     return if @back_tiles_a != nil
  465.  
  466.     @back_tiles_a = []
  467.     @back_tiles_b = []
  468.     for i in 1904...8192
  469.       next unless ceiling?(i) or cliff?(i)
  470.       if wall?(i)
  471.         next if verge?(i, 2)
  472.         if verge?(i, 4) or verge?(i, 6)
  473.           @back_tiles_a.push(i) unless cliff?(i)
  474.         end
  475.       else
  476.         @back_tiles_a.push(i) unless cliff?(i)
  477.         @back_tiles_b.push(i) if verge?(i, 8)
  478.       end
  479.     end
  480.   end
  481.   #--------------------------------------------------------------------------
  482.   # ○ 通行判定初期化と裏回り用タイル座標ピックアップ
  483.   #--------------------------------------------------------------------------
  484.   def setup_back_tiles
  485.     if $game_player.game_map_data.include?(@map_id)
  486.       @map = $game_player.game_map_data[@map_id].map
  487.       @ex_data = $game_player.game_map_data[@map_id].ex_data
  488.       @under_bridge_passages = $game_player.game_map_data[@map_id].under_bridge_passages
  489.       @back_tiles_position = $game_player.game_map_data[@map_id].back_tiles_position
  490.       @keep_back_position = $game_player.game_map_data[@map_id].keep_back_position
  491.       @prohibited_get_off = $game_player.game_map_data[@map_id].prohibited_get_off
  492.       return
  493.     end
  494.  
  495.     @ex_data = Table.new(width, height, 3)
  496.     @under_bridge_passages = {}
  497.     @back_tiles_position = []
  498.     @keep_back_position = []
  499.     @prohibited_get_off = []
  500.  
  501.     return if Expansion_Passable::ESCAPE_MAP.include?(@map_id)
  502.  
  503.     #- 座標毎処理
  504.     for x in 0...width
  505.       for reverse_y in 1..height
  506.         y = height - reverse_y   # Y座標を逆順にする為の処理
  507.         next if disregard_processing_area?(x, y, @map_id)
  508.  
  509.         tile_id = point_tile_id(x, y)
  510.  
  511.         #- 橋タイル処理
  512.         if (Data_Tile::BRIDRE_LENGTH + Data_Tile::BRIDGE_BREADTH).include?(tile_id[2])
  513.           if (2048...2815).include?(tile_id[0])
  514.             if ship_pass_area?(x, y)
  515.               @under_bridge_passages[[x, y]] = 1
  516.               @back_tiles_position.push([x, y])
  517.               @ex_data[x, y, 2] = @map.data[x, y, 2]
  518.             else
  519.               @back_tiles_position.push([x, y])
  520.               @under_bridge_passages[[x, y]] = -1
  521.             end
  522.           elsif @passages[tile_id[0]] != 0x06 or $game_map.wall?(tile_id[0])
  523.             @under_bridge_passages[[x, y]] = -1
  524.             @back_tiles_position.push([x, y])
  525.             @ex_data[x, y, 2] = @map.data[x, y, 2]
  526.           else
  527.             @under_bridge_passages[[x, y]] = 0
  528.             @back_tiles_position.push([x, y])
  529.             @ex_data[x, y, 2] = @map.data[x, y, 2]
  530.           end
  531.           if Data_Tile::BRIDGE_BREADTH.include?(tile_id[2])
  532.             @keep_back_position.push([x, round_y(y+1)])
  533.           end
  534.  
  535.         #- 通行判定☆タイルを上層に移動
  536.         elsif tile_id[2] != 0 and @passages[tile_id[2]] & 0x10 == 0x10
  537.           if @back_tiles_position.include?([x, round_y(y+1)])
  538.             @keep_back_position.push([x, y])
  539.           else
  540.             @ex_data[x, y, 2] = @map.data[x, y, 2]
  541.           end
  542.         end
  543.  
  544.         #- 影消しタイルの処理
  545.         if @map.data[x, y, 2] == Expansion_Passable::SHADOW_ERASER_TILE_ID
  546.           shadow_eraser(x, y)
  547.           @map.data[x, y, 2] = 0
  548.         #- 接岸禁止タイルの処理
  549.         elsif @map.data[x, y, 2] == Expansion_Passable::PROHIBITED_GET_OFF_TILE_ID
  550.           prohibited_get_off_set(x, y)
  551.         end
  552.  
  553.         #- 壁・天井タイル処理
  554.         if ceiling?(tile_id[0]) or (cliff?(tile_id[0]) and cliff_map?)
  555.  
  556.           #- 基本となる裏回りタイルの場合、裏回り位置に登録
  557.           if not wall?(tile_id[0]) and verge?(tile_id[0], 8)
  558.             @back_tiles_position.push([x, y])
  559.           end
  560.  
  561.           #- 裏回り位置にするタイルの場合、上層に移動
  562.           back_tiles = cliff_map? ? @back_tiles_b : @back_tiles_a
  563.           if back_tiles.include?(tile_id[0])
  564.             @ex_data[x, y, 0] = @map.data[x, y, 0]
  565.             @ex_data[x, y, 1] = @map.data[x, y, 1]
  566.             #- 裏回り位置追加タイルの誤用時には、タイルを消去する
  567.             if tile_id[2] != Expansion_Passable::ADDITION_BACK_TILE_ID
  568.               @ex_data[x, y, 2] = @map.data[x, y, 2]
  569.             end
  570.             @map.data[x, y, 1] = 0
  571.             @map.data[x, y, 2] = 0
  572.           end
  573.  
  574.           #- 深く裏回りする設定の際の処理(裏回り位置の下をさらに上層に)
  575.           if Expansion_Passable::BACK_TILE_DEEP
  576.             unless @back_tiles_position.include?([x, round_y(y+1)])
  577.               if not wall?(tile_id[0]) and verge?(tile_id[0], 8)
  578.                 unless wall?(data[x, round_y(y+1), 0]) and verge?(data[x, round_y(y+1), 0], 2)
  579.                   @back_tiles_position.push([x, round_y(y+1)])
  580.                   @ex_data[x, round_y(y+1), 0] = @map.data[x, round_y(y+1), 0]
  581.                   @ex_data[x, round_y(y+1), 1] = @map.data[x, round_y(y+1), 1]
  582.                   @ex_data[x, round_y(y+1), 2] = @map.data[x, round_y(y+1), 2]
  583.                   @map.data[x, round_y(y+1), 1] = 0
  584.                   @map.data[x, round_y(y+1), 2] = 0
  585.                 end
  586.               end
  587.             end
  588.           end
  589.  
  590.           #- 裏回り追加タイルの処理
  591.           if Expansion_Passable::ADDITION_BACK_TILE_ID != nil and
  592.              tile_id[2] == Expansion_Passable::ADDITION_BACK_TILE_ID
  593.             @back_tiles_position.push([x, y])
  594.             @ex_data[x, y, 0] = @map.data[x, y, 0]
  595.             @ex_data[x, y, 1] = @map.data[x, y, 1]
  596.             @map.data[x, y, 2] = 0
  597.             if (2816...8192).include?(@map.data[x, round_y(y-1), 0])
  598.               @ex_data[x, round_y(y-1), 0] = @map.data[x, round_y(y-1), 0]
  599.               @ex_data[x, round_y(y-1), 1] = @map.data[x, round_y(y-1), 1]
  600.             end
  601.           end
  602.         end
  603.  
  604.         #- 裏回り部分除去タイルの処理
  605.         back_tiles_position_delete(x, y)
  606.       end
  607.     end
  608.   end
  609.   #--------------------------------------------------------------------------
  610.   # ○ 裏回り用タイルの存在する座標か?
  611.   #--------------------------------------------------------------------------
  612.   def back_tile?(x, y)
  613.     return false if @back_tiles_position == nil
  614.     return @back_tiles_position.include?([x, y])
  615.   end
  616. end
  617.  
  618. #==============================================================================
  619. # ■ Game_Character
  620. #------------------------------------------------------------------------------
  621. #  キャラクターを扱うクラスです。このクラスは Game_Player クラスと Game_Event
  622. # クラスのスーパークラスとして使用されます。
  623. #==============================================================================
  624.  
  625. class Game_Character
  626.   #--------------------------------------------------------------------------
  627.   # ○ 公開インスタンス変数
  628.   #--------------------------------------------------------------------------
  629.   attr_reader   :on_tile
  630.   attr_reader   :turn_back
  631.   attr_accessor :no_turn_back
  632.   attr_reader   :back_seeing
  633.   attr_reader   :not_back_seeing
  634.   #--------------------------------------------------------------------------
  635.   # ◎ オブジェクト初期化
  636.   #--------------------------------------------------------------------------
  637.   alias tig_ew_initialize initialize
  638.   def initialize
  639.     tig_ew_initialize
  640.     @vehicle_type = -1
  641.     @turn_back = false
  642.     @no_turn_back = false
  643.     @on_tile = true
  644.     @back_seeing = false
  645.     @not_back_seeing = false
  646.   end
  647.   #--------------------------------------------------------------------------
  648.   # ◎ フレーム更新
  649.   #--------------------------------------------------------------------------
  650.   alias tig_ew_update update
  651.   def update
  652.     if @first_update == nil
  653.       update_turn_back
  654.       @first_update = true
  655.     end
  656.     tig_ew_update
  657.   end
  658.   #--------------------------------------------------------------------------
  659.   # ◎ 指定位置に移動
  660.   #     x : X 座標
  661.   #     y : Y 座標
  662.   #--------------------------------------------------------------------------
  663.   alias tig_ew_moveto moveto
  664.   def moveto(x, y)
  665.     tig_ew_moveto(x, y)
  666.     update_turn_back
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # ◎ ジャンプ時の更新
  670.   #--------------------------------------------------------------------------
  671.   alias tig_ew_update_jump update_jump
  672.   def update_jump
  673.     tig_ew_update_jump
  674.     update_turn_back
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # ◎ 移動時の更新
  678.   #--------------------------------------------------------------------------
  679.   alias tig_ew_update_move update_move
  680.   def update_move
  681.     tig_ew_update_move
  682.     update_turn_back unless moving?
  683.   end
  684.   #--------------------------------------------------------------------------
  685.   # ◎ 歩数増加
  686.   #--------------------------------------------------------------------------
  687.   alias tig_ew_increase_steps increase_steps
  688.   def increase_steps
  689.     tig_ew_increase_steps
  690.     update_turn_back
  691.   end
  692.   #--------------------------------------------------------------------------
  693.   # ○ 2座標の位置関係を向きで取得
  694.   #--------------------------------------------------------------------------
  695.   def search_direction(start_x, start_y, arriv_x, arriv_y)
  696.     if start_x == arriv_x
  697.       if start_y == arriv_y
  698.         return 5
  699.       elsif start_y < arriv_y
  700.         return 2
  701.       elsif start_y > arriv_y
  702.         return 8
  703.       end
  704.     elsif start_x < arriv_x
  705.       if start_y == arriv_y
  706.         return 6
  707.       elsif start_y < arriv_y
  708.         return 3
  709.       elsif start_y > arriv_y
  710.         return 9
  711.       end
  712.     elsif start_x > arriv_x
  713.       if start_y == arriv_y
  714.         return 4
  715.       elsif start_y < arriv_y
  716.         return 1
  717.       elsif start_y > arriv_y
  718.         return 7
  719.       end
  720.     end
  721.   end
  722.   #--------------------------------------------------------------------------
  723.   # ○ 裏回りセット
  724.   #--------------------------------------------------------------------------
  725.   def set_turn_back
  726.     @turn_back = true
  727.     @on_tile = false
  728.   end
  729.   #--------------------------------------------------------------------------
  730.   # ○ 天井載せセット
  731.   #--------------------------------------------------------------------------
  732.   def set_on_tile
  733.     @turn_back = false
  734.     @on_tile = true
  735.   end
  736.   #--------------------------------------------------------------------------
  737.   # ○ 裏回り状態更新
  738.   #--------------------------------------------------------------------------
  739.   def update_turn_back
  740.     tile_id = $game_map.point_tile_id(@x, @y)
  741.     direction = search_direction(@real_x, @real_y, @x * 256, @y * 256)
  742.     if self.is_a?(Game_Player) and [2, 4].include?(@vehicle_type)
  743.       @turn_back = false
  744.       @no_turn_back = false
  745.       @on_tile = true
  746.       return
  747.     end
  748.     #- 段差マップの場合
  749.     if Expansion_Passable::CLIFF_MAP.include?($game_map.map_id)
  750.       #- 停止時の更新
  751.       if direction == 5
  752.         @turn_back = false if @no_turn_back
  753.         unless $game_map.back_tile?(@x, @y)
  754.           @turn_back = false
  755.           @no_turn_back = false
  756.         end
  757.         @on_tile = true unless @turn_back
  758.       #- 移動開始時の更新
  759.       else
  760.         if direction % 2 == 0
  761.           if $game_map.rip?(10 - direction, @x, @y, floating?)
  762.             @turn_back = true unless @no_turn_back
  763.           end
  764.         else
  765.           if diagonal_move_turn_back(direction, @x, @y)
  766.             @turn_back = true unless @no_turn_back
  767.           end
  768.         end
  769.         @on_tile = false if @turn_back
  770.       end
  771.       if not @turn_back or @no_turn_back
  772.         if $game_map.keep_back_position != nil and $game_map.keep_back_position.include?([@x, @y])
  773.           @on_tile = false
  774.           return
  775.         end
  776.       end
  777.     #- 通常マップの場合
  778.     else
  779.       #- 停止時の更新
  780.       if direction == 5
  781.         unless $game_map.back_tile?(@x, @y)
  782.           @turn_back = false
  783.           @no_turn_back = false
  784.         end
  785.         if $game_map.upper_layer?(tile_id[0])
  786.           @on_tile = true
  787.         else
  788.           @on_tile = false
  789.         end
  790.       #- 移動開始時の更新
  791.       else
  792.         if direction % 2 == 0
  793.           if $game_map.rip?(10 - direction, @x, @y, floating?)
  794.             @turn_back = true unless @no_turn_back
  795.           end
  796.         else
  797.           if diagonal_move_turn_back(direction, @x, @y)
  798.             @turn_back = true unless @no_turn_back
  799.           end
  800.         end
  801.       end
  802.       if $game_map.back_tile?(@x, @y)
  803.         if @turn_back
  804.           @on_tile = false
  805.         else
  806.           @on_tile = true
  807.         end
  808.       elsif Data_Tile::STEP.include?(tile_id[0]) or Data_Tile::STEP.include?(tile_id[2])
  809.         @on_tile = true
  810.       end
  811.     end
  812.   end
  813.   #--------------------------------------------------------------------------
  814.   # ○ 斜め移動時の裏回り状態判別
  815.   #--------------------------------------------------------------------------
  816.   def diagonal_move_turn_back(direction, x, y)
  817.     turn_back = false
  818.     case direction
  819.     when 1
  820.       turn_back = true if $game_map.rip?(8, x+1, y, floating?)
  821.       turn_back = true if $game_map.rip?(6, x, y, floating?)
  822.       turn_back = true if $game_map.rip?(6, x, y-1, floating?)
  823.       turn_back = true if $game_map.rip?(8, x, y, floating?)
  824.     when 3
  825.       turn_back = true if $game_map.rip?(8, x-1, y, floating?)
  826.       turn_back = true if $game_map.rip?(4, x, y, floating?)
  827.       turn_back = true if $game_map.rip?(4, x, y-1, floating?)
  828.       turn_back = true if $game_map.rip?(8, x, y, floating?)
  829.     when 7
  830.       turn_back = true if $game_map.rip?(6, x, y+1, floating?)
  831.       turn_back = true if $game_map.rip?(2, x, y, floating?)
  832.       turn_back = true if $game_map.rip?(2, x+1, y, floating?)
  833.       turn_back = true if $game_map.rip?(6, x, y, floating?)
  834.     when 9
  835.       turn_back = true if $game_map.rip?(4, x, y+1, floating?)
  836.       turn_back = true if $game_map.rip?(2, x, y, floating?)
  837.       turn_back = true if $game_map.rip?(2, x-1, y, floating?)
  838.       turn_back = true if $game_map.rip?(4, x, y, floating?)
  839.     end
  840.     return turn_back
  841.   end
  842.   #--------------------------------------------------------------------------
  843.   # ○ この場が裏か判定
  844.   #--------------------------------------------------------------------------
  845.   def back_tile?(pos)
  846.     return $game_map.back_tile?(pos[0], pos[1])
  847.   end
  848.   #--------------------------------------------------------------------------
  849.   # ○ 橋の下の通行判定
  850.   #--------------------------------------------------------------------------  
  851.   def under_bridge_passages(pos)
  852.     return true unless $game_map.under_bridge_passages.key?(pos)
  853.     case @vehicle_type
  854.     when -1
  855.       return $game_map.under_bridge_passages[pos] == 0
  856.     when 0..1
  857.       return $game_map.under_bridge_passages[pos] > 0
  858.     when 5
  859.       return $game_map.under_bridge_passages[pos] >= 0
  860.     else
  861.       return false
  862.     end
  863.   end
  864.   #--------------------------------------------------------------------------
  865.   # ○ 浮かんでいるか?(乗り物拡張用・魔法の絨毯搭乗時)
  866.   #--------------------------------------------------------------------------  
  867.   def floating?
  868.     return false
  869.   end
  870.   #--------------------------------------------------------------------------
  871.   # ○ 壁タイル拡張通行判定
  872.   #--------------------------------------------------------------------------
  873.   #  x , y を省略すると…
  874.   #    プレイヤーの現在位置(始点)からdirection方向へ通過出来るかどうかを判定。
  875.   #  x , y を代入すると…
  876.   #    その座標(終点)へdirection方向から進入できるかどうかを判定。
  877.   #--------------------------------------------------------------------------
  878.   def ex_passable(direction, x = nil, y = nil, turn_back = nil)
  879.     return true if debug_through?        # デバッグ動作中なら通行可
  880.     return true if @through              # すり抜け中なら通行可
  881.  
  882.     #- 位置情報の準備
  883.     if x == nil
  884.       start_pos = [@x, @y]
  885.       arriv_pos = [$game_map.x_with_direction(@x, direction), $game_map.y_with_direction(@y, direction)]  
  886.     else
  887.       start_pos = [$game_map.x_with_direction(x, 10 - direction), $game_map.y_with_direction(y, 10 - direction)]
  888.       arriv_pos = [x, y]
  889.     end
  890.     start_tile = $game_map.point_tile_id(start_pos[0], start_pos[1])
  891.     arriv_tile = $game_map.point_tile_id(arriv_pos[0], arriv_pos[1])
  892.     start_side_rip = $game_map.rip?(direction, start_pos[0], start_pos[1], floating?)
  893.     arriv_side_rip = $game_map.rip?(10 - direction, arriv_pos[0], arriv_pos[1], floating?)
  894.  
  895.     turn_back = @turn_back if turn_back == nil
  896.  
  897.     #- 階段タイルなら通行可
  898.     unless back_tile?(start_pos) and turn_back
  899.       return true if Data_Tile::STEP.include?(arriv_tile[0])
  900.       return true if Data_Tile::STEP.include?(arriv_tile[2])
  901.       unless $game_map.wall?(arriv_tile[0])
  902.         return true if Data_Tile::STEP.include?(start_tile[0])
  903.         return true if Data_Tile::STEP.include?(start_tile[2])
  904.       end
  905.     end
  906.  
  907.     #- 境目&橋の下の通行判定
  908.     if back_tile?(start_pos) and turn_back               # 始点が裏かつ裏回り中
  909.       return false unless under_bridge_passages(arriv_pos)  # 橋の下の通行判定
  910.       unless back_tile?(arriv_pos)                         # 終点が裏でない
  911.         if start_side_rip                                   # 始点側に境目がある
  912.           if arriv_side_rip                                  # 終点側に境目がある
  913.             return false
  914.           else
  915.             return false if $game_map.wall?(arriv_tile[0])
  916.           end
  917.         else                                              # 始点側に境目がない
  918.           return false
  919.         end
  920.       end
  921.     else                                                  # 始点は裏でない
  922.       unless $game_map.bridge?(arriv_tile[2], direction) or # 橋がなければ
  923.              $game_map.bridge?(start_tile[2], direction)
  924.         if start_side_rip                                  # 始点側に境目がある
  925.           return false
  926.         else                                               # 始点側に境目がない
  927.           if arriv_side_rip                                 # 終点側に境目がある
  928.             if back_tile?(arriv_pos)                         # 終点が裏
  929.               unless $game_map.bridge?(start_tile[2], direction)   # この場が橋でなければ
  930.                 return false unless under_bridge_passages(arriv_pos)  # 橋の下の通行判定
  931.                 turn_back = true
  932.               end
  933.             else                                             # 終点が裏でない
  934.               unless $game_map.bridge?(start_tile[2], direction) # この場が橋でなければ
  935.                 return false
  936.               end
  937.             end
  938.           else                                              # 終点側に境目がない
  939.             return false if $game_map.wall?(arriv_tile[0])
  940.           end
  941.         end
  942.       end
  943.     end
  944.  
  945.     #- 上層の通行判定
  946.     if $game_map.upper_layer?(arriv_tile[0]) and not turn_back
  947.       for i in [2, 1, 0]                        # レイヤーの上から順に調べる
  948.         tile_id = $game_map.ex_data[arriv_pos[0], arriv_pos[1], i] # タイル ID を取得
  949.         unless tile_id == nil
  950.           pass = $game_map.passages[tile_id]    # 通行属性を取得
  951.           next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
  952.           next if pass & 0x01 == 0x00           # [○] : 通行可
  953.           if pass & 0x01 == 0x01                # [×] : 通行不可
  954.             return false
  955.           end
  956.         end
  957.       end
  958.     end  
  959.  
  960.     return true
  961.   end
  962.   #--------------------------------------------------------------------------
  963.   # ◎ 下に移動
  964.   #     turn_ok : その場での向き変更を許可
  965.   #--------------------------------------------------------------------------
  966.   alias tig_ew_move_down move_down
  967.   def move_down(turn_ok = true)
  968.     unless ex_passable(2)
  969.       turn_down if turn_ok
  970.       @move_failed = true
  971.       check_event_trigger_touch(@x, @y+1)   # 接触イベントの起動判定
  972.       return
  973.     end
  974.     tig_ew_move_down(turn_ok)
  975.   end
  976.   #--------------------------------------------------------------------------
  977.   # ◎ 左に移動
  978.   #     turn_ok : その場での向き変更を許可
  979.   #--------------------------------------------------------------------------
  980.   alias tig_ew_move_left move_left
  981.   def move_left(turn_ok = true)
  982.     unless ex_passable(4)
  983.       turn_left if turn_ok
  984.       @move_failed = true
  985.       check_event_trigger_touch(@x-1, @y)   # 接触イベントの起動判定
  986.       return
  987.     end
  988.     tig_ew_move_left(turn_ok)
  989.   end
  990.   #--------------------------------------------------------------------------
  991.   # ◎ 右に移動
  992.   #     turn_ok : その場での向き変更を許可
  993.   #--------------------------------------------------------------------------
  994.   alias tig_ew_move_right move_right
  995.   def move_right(turn_ok = true)
  996.     unless ex_passable(6)
  997.       turn_right if turn_ok
  998.       check_event_trigger_touch(@x+1, @y)   # 接触イベントの起動判定
  999.       @move_failed = true
  1000.       return
  1001.     end
  1002.     tig_ew_move_right(turn_ok)
  1003.   end
  1004.   #--------------------------------------------------------------------------
  1005.   # ◎ 上に移動
  1006.   #     turn_ok : その場での向き変更を許可
  1007.   #--------------------------------------------------------------------------
  1008.   alias tig_ew_move_up move_up
  1009.   def move_up(turn_ok = true)
  1010.     unless ex_passable(8)
  1011.       turn_up if turn_ok
  1012.       check_event_trigger_touch(@x, @y-1)   # 接触イベントの起動判定
  1013.       @move_failed = true
  1014.       return
  1015.     end
  1016.     tig_ew_move_up(turn_ok)
  1017.   end
  1018.   #--------------------------------------------------------------------------
  1019.   # ◎ 左下に移動
  1020.   #--------------------------------------------------------------------------
  1021.   alias tig_ew_move_lower_left move_lower_left
  1022.   def move_lower_left
  1023.     turn_back1 = $game_map.rip?(8, @x, @y+1) ? true : @turn_back
  1024.     turn_back2 = $game_map.rip?(6, @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(4, @x-1, @y+1, turn_back1) and
  1027.            ex_passable(4) and ex_passable(2, @x-1, @y+1, turn_back2)
  1028.       if @direction == 2
  1029.         if passable?(@x-1, @y) and ex_passable(4)
  1030.           move_left
  1031.         else
  1032.           move_down
  1033.         end
  1034.       elsif @direction == 4
  1035.         if passable?(@x, @y+1) and ex_passable(2)
  1036.           move_down
  1037.         else
  1038.           move_left
  1039.         end
  1040.       end
  1041.       return
  1042.     end
  1043.     tig_ew_move_lower_left
  1044.   end
  1045.   #--------------------------------------------------------------------------
  1046.   # ◎ 右下に移動
  1047.   #--------------------------------------------------------------------------
  1048.   alias tig_ew_move_lower_right move_lower_right
  1049.   def move_lower_right
  1050.     turn_back1 = $game_map.rip?(8, @x, @y+1) ? true : @turn_back
  1051.     turn_back2 = $game_map.rip?(4, @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(2) and ex_passable(6, @x+1, @y+1, turn_back1) and
  1054.            ex_passable(6) and ex_passable(2, @x+1, @y+1, turn_back2)
  1055.       if @direction == 2
  1056.         if passable?(@x-1, @y) and ex_passable(6)
  1057.           move_right
  1058.         else
  1059.           move_down
  1060.         end
  1061.       elsif @direction == 6
  1062.         if passable?(@x, @y+1) and ex_passable(2)
  1063.           move_down
  1064.         else
  1065.           move_right
  1066.         end
  1067.       end
  1068.       return
  1069.     end
  1070.     tig_ew_move_lower_right
  1071.   end
  1072.   #--------------------------------------------------------------------------
  1073.   # ◎ 左上に移動
  1074.   #--------------------------------------------------------------------------
  1075.   alias tig_ew_move_upper_left move_upper_left
  1076.   def move_upper_left
  1077.     turn_back1 = $game_map.rip?(2, @x, @y-1) ? true : @turn_back
  1078.     turn_back2 = $game_map.rip?(6, @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(4, @x-1, @y-1, turn_back1) and
  1081.            ex_passable(4) and ex_passable(8, @x-1, @y-1, turn_back2)
  1082.       if @direction == 8
  1083.         if passable?(@x-1, @y) and ex_passable(4)
  1084.           move_left
  1085.         else
  1086.           move_up
  1087.         end
  1088.       elsif @direction == 4
  1089.         if passable?(@x, @y+1) and ex_passable(8)
  1090.           move_up
  1091.         else
  1092.           move_left
  1093.         end
  1094.       end
  1095.       return
  1096.     end
  1097.     tig_ew_move_upper_left
  1098.   end
  1099.   #--------------------------------------------------------------------------
  1100.   # ◎ 右上に移動
  1101.   #--------------------------------------------------------------------------
  1102.   alias tig_ew_move_upper_right move_upper_right
  1103.   def move_upper_right
  1104.     turn_back1 = $game_map.rip?(2, @x, @y-1) ? true : @turn_back
  1105.     turn_back2 = $game_map.rip?(4, @x+1, @y) ? true : @turn_back
  1106.     unless passable?(@x, @y-1) and passable?(@x+1, @y) and passable?(@x+1, @y-1) and
  1107.            ex_passable(8) and ex_passable(6, @x+1, @y-1, turn_back1) and
  1108.            ex_passable(6) and ex_passable(8, @x+1, @y-1, turn_back2)
  1109.       if @direction == 8
  1110.         if passable?(@x+1, @y) and ex_passable(6)
  1111.           move_right
  1112.         else
  1113.           move_up
  1114.         end
  1115.       elsif @direction == 6
  1116.         if passable?(@x, @y-1) and ex_passable(8)
  1117.           move_up
  1118.         else
  1119.           move_right
  1120.         end
  1121.       end
  1122.       return
  1123.     end
  1124.     tig_ew_move_upper_right
  1125.   end
  1126.   #--------------------------------------------------------------------------
  1127.   # ● キャラクター衝突判定
  1128.   #     x : X 座標
  1129.   #     y : Y 座標
  1130.   #    プレイヤーと乗り物を含め、通常キャラの衝突を検出する。
  1131.   #--------------------------------------------------------------------------
  1132.   def collide_with_characters?(x, y)
  1133.     for event in $game_map.events_xy(x, y)          # イベントの座標と一致
  1134.       next unless parallel?(event)                  ##### 追加部分 (この行) #####
  1135.       unless event.through                          # すり抜け OFF?
  1136.         return true if self.is_a?(Game_Event)       # 自分がイベント
  1137.         return true if event.priority_type == 1     # 相手が通常キャラ
  1138.       end
  1139.     end
  1140.     if @priority_type == 1                          # 自分が通常キャラ
  1141.       if parallel?($game_player)                   ##### 追加部分 (この行) #####
  1142.         return true if $game_player.pos_nt?(x, y)  # プレイヤーの座標と一致
  1143.       end                                          ##### 追加部分 (この行) #####
  1144.       return true if $game_map.boat.pos_nt?(x, y)   # 小型船の座標と一致
  1145.       return true if $game_map.ship.pos_nt?(x, y)   # 大型船の座標と一致
  1146.     end
  1147.     return false
  1148.   end
  1149.   #--------------------------------------------------------------------------
  1150.   # ○ キャラクターの同軸存在判定
  1151.   #--------------------------------------------------------------------------
  1152.   def parallel?(character)
  1153.     direction = search_direction(@x, @y, character.x, character.y)
  1154.     turn_back = @turn_back
  1155.     character_turn_back = character.turn_back
  1156.     if direction != 5
  1157.       if direction % 2 == 0
  1158.         if $game_map.rip?(10 - direction, character.x, character.y)
  1159.           turn_back = true
  1160.         end
  1161.       else
  1162.         if diagonal_move_turn_back(direction, character.x, character.y)
  1163.           turn_back = true
  1164.         end
  1165.       end
  1166.       if direction % 2 == 0
  1167.         if $game_map.rip?(direction, @x, @y)
  1168.           character_turn_back = true
  1169.         end
  1170.       else
  1171.         if diagonal_move_turn_back(10 - direction, @x, @y)
  1172.           character_turn_back = true
  1173.         end
  1174.       end
  1175.       tile_id = $game_map.data[character.x, character.y, 0]
  1176.       if $game_map.wall?(tile_id)
  1177.         return true unless ex_passable(direction)
  1178.       end
  1179.     end
  1180.  
  1181.     return turn_back == character_turn_back
  1182.   end
  1183. end
  1184.  
  1185. #==============================================================================
  1186. # ■ Game_Event
  1187. #------------------------------------------------------------------------------
  1188. #  イベントを扱うクラスです。条件判定によるイベントページ切り替えや、並列処理
  1189. # イベント実行などの機能を持っており、Game_Map クラスの内部で使用されます。
  1190. #==============================================================================
  1191.  
  1192. class Game_Event < Game_Character
  1193.   #--------------------------------------------------------------------------
  1194.   # ◎ オブジェクト初期化
  1195.   #     map_id : マップ ID
  1196.   #     event  : イベント (RPG::Event)
  1197.   #--------------------------------------------------------------------------
  1198.   alias tig_ew_event_initialize initialize
  1199.   def initialize(map_id, event)
  1200.     tig_ew_event_initialize(map_id, event)
  1201.     set_turn_back_setting
  1202.   end
  1203.   #--------------------------------------------------------------------------
  1204.   # ○ イベントの初期配置位置取得(裏配置)
  1205.   #--------------------------------------------------------------------------  
  1206.   def set_turn_back_setting
  1207.     @event.name = @event.name.sub(/[\<<]裏配置[\>>]/, "")
  1208.     @turn_back = $& != nil
  1209.     @on_tile = $& == nil
  1210.     @event.name = @event.name.sub(/[\<<]裏透過禁止[\>>]/, "")
  1211.     @not_back_seeing = $& != nil
  1212.   end
  1213.   #--------------------------------------------------------------------------
  1214.   # ● 接触イベントの起動判定
  1215.   #--------------------------------------------------------------------------
  1216.   def check_event_trigger_touch(x, y)
  1217.     return if $game_map.interpreter.running?
  1218.     if @trigger == 2 and $game_player.pos?(x, y)
  1219.       if @character_name != ""                     #### 追加部分 (ここから) ####
  1220.         return unless $game_player.parallel?(self)              
  1221.       end                                          #### 追加部分 (ここまで) ####
  1222.       start if not jumping? and @priority_type == 1
  1223.     end
  1224.   end
  1225. end
  1226.  
  1227. #==============================================================================
  1228. # ■ Game_Vehicle
  1229. #------------------------------------------------------------------------------
  1230. #  乗り物を扱うクラスです。このクラスは Game_Map クラスの内部で使用されます。
  1231. # 現在のマップに乗り物がないときは、マップ座標 (-1,-1) に設定されます。
  1232. #==============================================================================
  1233.  
  1234. class Game_Vehicle < Game_Character
  1235.   #--------------------------------------------------------------------------
  1236.   # ○ タイル表示(on_tile)状態取得
  1237.   #--------------------------------------------------------------------------
  1238.   def on_tile
  1239.     if @driving or @altitude > 0
  1240.       return $game_player.on_tile
  1241.     else
  1242.       return false
  1243.     end
  1244.   end
  1245.   #--------------------------------------------------------------------------
  1246.   # ◎ プレイヤーとの同期
  1247.   #--------------------------------------------------------------------------
  1248.   alias tig_ew_sync_with_player sync_with_player
  1249.   def sync_with_player
  1250.     tig_ew_sync_with_player
  1251.     update_turn_back
  1252.   end  
  1253. end
  1254.  
  1255. #==============================================================================
  1256. # ■ Game_Player
  1257. #------------------------------------------------------------------------------
  1258. #  プレイヤーを扱うクラスです。イベントの起動判定や、マップのスクロールなどの
  1259. # 機能を持っています。このクラスのインスタンスは $game_player で参照されます。
  1260. #==============================================================================
  1261.  
  1262. class Game_Player < Game_Character
  1263.   #--------------------------------------------------------------------------
  1264.   # ○ 公開インスタンス変数
  1265.   #--------------------------------------------------------------------------
  1266.   attr_accessor :game_map_data
  1267.   attr_accessor :reserve_load_map_id
  1268.   #--------------------------------------------------------------------------
  1269.   # ◎ オブジェクト初期化
  1270.   #     map_id : マップ ID
  1271.   #     event  : イベント (RPG::Event)
  1272.   #--------------------------------------------------------------------------
  1273.   alias tig_ew_pl_initialize initialize
  1274.   def initialize
  1275.     tig_ew_pl_initialize
  1276.     @reserve_load_map_id = []
  1277.     @game_map_data = {}
  1278.   end
  1279.   #--------------------------------------------------------------------------
  1280.   # ○ マップデータの先読み
  1281.   #--------------------------------------------------------------------------
  1282.   def beforehand_load(map_id = @reserve_load_map_id)
  1283.     for i in map_id
  1284.       next if @game_map_data.key?(i)
  1285.       map_data = Game_Map.new
  1286.       map_data.setup(i)
  1287.       @game_map_data[i] = map_data
  1288.     end
  1289.     for i in @game_map_data.keys.clone
  1290.       unless map_id.include?(i)
  1291.         @game_map_data.delete(i)
  1292.       end
  1293.     end
  1294.   end
  1295.   #--------------------------------------------------------------------------
  1296.   # ◎ 場所移動の実行
  1297.   #--------------------------------------------------------------------------
  1298.   alias tig_ew_perform_transfer perform_transfer
  1299.   def perform_transfer
  1300.     return unless @transferring
  1301.     unless $game_player.reserve_load_map_id.empty?
  1302.       $game_player.beforehand_load
  1303.     end
  1304.     tig_ew_perform_transfer
  1305.   end
  1306.   #--------------------------------------------------------------------------
  1307.   # ○ 浮かんでいるか?(乗り物拡張用・魔法の絨毯搭乗時)
  1308.   #--------------------------------------------------------------------------  
  1309.   def floating?
  1310.     return @vehicle_type == 5
  1311.   end
  1312.   #--------------------------------------------------------------------------
  1313.   # ● 同位置のイベント起動判定
  1314.   #     triggers : トリガーの配列
  1315.   #--------------------------------------------------------------------------
  1316.   def check_event_trigger_here(triggers)
  1317.     return false if $game_map.interpreter.running?
  1318.     result = false
  1319.     for event in $game_map.events_xy(@x, @y)
  1320.       next unless parallel?(event)                 ##### 追加部分 (この行) #####
  1321.       if triggers.include?(event.trigger) and event.priority_type != 1
  1322.         event.start
  1323.         result = true if event.starting
  1324.       end
  1325.     end
  1326.     return result
  1327.   end
  1328.   #--------------------------------------------------------------------------
  1329.   # ● 正面のイベント起動判定
  1330.   #     triggers : トリガーの配列
  1331.   #--------------------------------------------------------------------------
  1332.   def check_event_trigger_there(triggers)
  1333.     return false if $game_map.interpreter.running?
  1334.     result = false
  1335.     front_x = $game_map.x_with_direction(@x, @direction)
  1336.     front_y = $game_map.y_with_direction(@y, @direction)
  1337.     for event in $game_map.events_xy(front_x, front_y)
  1338.       next unless parallel?(event)                 ##### 追加部分 (この行) #####
  1339.       if triggers.include?(event.trigger) and event.priority_type == 1
  1340.         event.start
  1341.         result = true
  1342.       end
  1343.     end
  1344.     if result == false and $game_map.counter?(front_x, front_y)
  1345.       front_x = $game_map.x_with_direction(front_x, @direction)
  1346.       front_y = $game_map.y_with_direction(front_y, @direction)
  1347.       for event in $game_map.events_xy(front_x, front_y)
  1348.         next unless parallel?(event)               ##### 追加部分 (この行) #####
  1349.         if triggers.include?(event.trigger) and event.priority_type == 1
  1350.           event.start
  1351.           result = true
  1352.         end
  1353.       end
  1354.     end
  1355.     return result
  1356.   end
  1357.   #--------------------------------------------------------------------------
  1358.   # ● 接触イベントの起動判定
  1359.   #     x : X 座標
  1360.   #     y : Y 座標
  1361.   #--------------------------------------------------------------------------
  1362.   def check_event_trigger_touch(x, y)
  1363.     return false if $game_map.interpreter.running?
  1364.     result = false
  1365.     for event in $game_map.events_xy(x, y)
  1366.       if event.character_name != ""                #### 追加部分 (ここから) ####
  1367.         next unless parallel?(event)              
  1368.       end                                          #### 追加部分 (ここまで) ####
  1369.       if [1,2].include?(event.trigger) and event.priority_type == 1
  1370.         event.start
  1371.         result = true
  1372.       end
  1373.     end
  1374.     return result
  1375.   end
  1376.   #--------------------------------------------------------------------------
  1377.   # ◎ 乗り物から降りる
  1378.   #    現在乗り物に乗っていることが前提。
  1379.   #--------------------------------------------------------------------------
  1380.   alias tig_ew_get_off_vehicle get_off_vehicle
  1381.   def get_off_vehicle
  1382.     return if $game_map.back_tile?(@x, @y)
  1383.     if @vehicle_type == 0 or @vehicle_type == 1
  1384.       front_x = $game_map.x_with_direction(@x, @direction)
  1385.       front_y = $game_map.y_with_direction(@y, @direction)
  1386.       return if $game_map.wall?($game_map.point_tile_id(front_x, front_y)[0])
  1387.       return if $game_map.under_bridge_passages[[front_x, front_y]] == 1
  1388.       return if $game_map.prohibited_get_off.include?([front_x, front_y])
  1389.       @no_turn_back = true
  1390.     end
  1391.     tig_ew_get_off_vehicle
  1392.   end
  1393. end
  1394.  
  1395. #==============================================================================
  1396. # ■ Spriteset_Map
  1397. #------------------------------------------------------------------------------
  1398. #  マップ画面のスプライトやタイルマップなどをまとめたクラスです。このクラスは
  1399. # Scene_Map クラスの内部で使用されます。
  1400. #==============================================================================
  1401.  
  1402. class Spriteset_Map
  1403.   #--------------------------------------------------------------------------
  1404.   # ◎ ビューポートの作成
  1405.   #--------------------------------------------------------------------------
  1406.   alias tig_ew_create_viewports create_viewports
  1407.   def create_viewports
  1408.     tig_ew_create_viewports
  1409.     @viewport4 = Viewport.new(0, 0, 640, 480) # 追加レイヤー用ビューポート
  1410.     if Expansion_Passable::BACK_SEEING
  1411.       @viewport5 = Viewport.new(0, 0, 640, 480) # 裏回りキャラ透過用ビューポート
  1412.     end
  1413.     if @viewport6 == nil
  1414.       @viewport6 = Viewport.new(0, 0, 640, 480) # 色調変更用ビューポート
  1415.       @viewport6.z = 25
  1416.     end
  1417.   end
  1418.   #--------------------------------------------------------------------------
  1419.   # ◎ タイルマップの作成
  1420.   #--------------------------------------------------------------------------
  1421.   alias tig_ew_create_tilemap create_tilemap
  1422.   def create_tilemap
  1423.     tig_ew_create_tilemap
  1424.     setup_shadow_eraser_tilemap
  1425.     @ex_tilemap = Tilemap.new(@viewport4)
  1426.     @ex_tilemap.bitmaps[0] = Cache.system("TileA1")
  1427.     @ex_tilemap.bitmaps[1] = Cache.system("TileA2")
  1428.     @ex_tilemap.bitmaps[2] = Cache.system("TileA3")
  1429.     @ex_tilemap.bitmaps[3] = Cache.system("TileA4")
  1430.     @ex_tilemap.bitmaps[4] = Cache.system("TileA5")
  1431.     @ex_tilemap.bitmaps[5] = Cache.system("TileB")
  1432.     @ex_tilemap.bitmaps[6] = Cache.system("TileC")
  1433.     @ex_tilemap.bitmaps[7] = Cache.system("TileD")
  1434.     @ex_tilemap.bitmaps[8] = Cache.system("TileE")
  1435.     @ex_tilemap.map_data = $game_map.ex_data
  1436.     @ex_tilemap.passages = $game_map.passages
  1437.   end
  1438.   #--------------------------------------------------------------------------
  1439.   # ○ 影消し処理用タイルの準備
  1440.   #--------------------------------------------------------------------------
  1441.   def setup_shadow_eraser_tilemap
  1442.     for i in 1952...2048
  1443.       @tilemap.passages[i] = 0x00
  1444.     end
  1445.   end
  1446.   #--------------------------------------------------------------------------
  1447.   # ◎ 飛行船の影スプライトの作成
  1448.   #--------------------------------------------------------------------------
  1449.   alias tig_ew_create_shadow create_shadow
  1450.   def create_shadow
  1451.     tig_ew_create_shadow
  1452.     @shadow_sprite.viewport = @viewport4
  1453.   end
  1454.   #--------------------------------------------------------------------------
  1455.   # ◎ タイルマップの解放
  1456.   #--------------------------------------------------------------------------
  1457.   alias tig_ew_dispose_tilemap dispose_tilemap
  1458.   def dispose_tilemap
  1459.     tig_ew_dispose_tilemap
  1460.     @ex_tilemap.dispose
  1461.   end
  1462.   #--------------------------------------------------------------------------
  1463.   # ◎ ビューポートの解放
  1464.   #--------------------------------------------------------------------------
  1465.   alias tig_ew_dispose_viewports dispose_viewports
  1466.   def dispose_viewports
  1467.     tig_ew_dispose_viewports
  1468.     @viewport4.dispose
  1469.     @viewport5.dispose if Expansion_Passable::BACK_SEEING
  1470.     @viewport6.dispose if @viewport6 != nil
  1471.   end
  1472.   #--------------------------------------------------------------------------
  1473.   # ◎ タイルマップの更新
  1474.   #--------------------------------------------------------------------------
  1475.   alias tig_ew_update_tilemap update_tilemap
  1476.   def update_tilemap
  1477.     tig_ew_update_tilemap
  1478.     @ex_tilemap.ox = $game_map.display_x / 8
  1479.     @ex_tilemap.oy = $game_map.display_y / 8
  1480.     @ex_tilemap.update
  1481.   end
  1482.   #--------------------------------------------------------------------------
  1483.   # ◎ キャラクタースプライトの更新
  1484.   #--------------------------------------------------------------------------
  1485.   alias tig_ew_update_characters update_characters
  1486.   def update_characters
  1487.     back_seeing_characters = []
  1488.     for sprite in @character_sprites
  1489.       if sprite.character.on_tile or sprite.character.priority_type == 2
  1490.         sprite.viewport = @viewport4
  1491.       else
  1492.         sprite.viewport = @viewport1
  1493.       end
  1494.       next if sprite.character.not_back_seeing
  1495.       if $game_player.turn_back and Expansion_Passable::BACK_SEEING
  1496.         x = $game_player.x ; y = $game_player.y
  1497.         if ($game_map.round_x(x-2)..$game_map.round_x(x+2)).include?(sprite.character.x) and
  1498.           ($game_map.round_y(y-2)..$game_map.round_y(y+2)).include?(sprite.character.y)
  1499.           back_seeing_characters.push(sprite.character)
  1500.         end
  1501.       end
  1502.     end
  1503.     back_seeing(back_seeing_characters)
  1504.  
  1505.     tig_ew_update_characters
  1506.   end
  1507.   #--------------------------------------------------------------------------
  1508.   # ○ 裏回りキャラ透過
  1509.   #--------------------------------------------------------------------------  
  1510.   def back_seeing(characters)
  1511.     return unless Expansion_Passable::BACK_SEEING
  1512.     @back_seeing_sprites = [] if @back_seeing_sprites == nil
  1513.     @characters = [] if @characters == nil
  1514.     now_character = []
  1515.     for character in characters
  1516.       now_character.push(character)
  1517.       unless @characters.include?(character)
  1518.         new_sprite = Sprite_Character.new(@viewport5, character)
  1519.         new_sprite.back_seeing = true
  1520.         @back_seeing_sprites.push(new_sprite)
  1521.         @characters.push(new_sprite.character)
  1522.       end
  1523.     end
  1524.  
  1525.     for sprite in @back_seeing_sprites
  1526.       if now_character.include?(sprite.character)
  1527.         sprite.update
  1528.       else
  1529.         @characters.delete(sprite.character)
  1530.         sprite.dispose
  1531.         @back_seeing_sprites.delete(sprite)
  1532.       end
  1533.     end
  1534.   end
  1535.   #--------------------------------------------------------------------------
  1536.   # ◎ フレーム更新
  1537.   #--------------------------------------------------------------------------
  1538.   alias tig_ew_update update
  1539.   def update
  1540.     tig_ew_update
  1541.     update_ew_ex_viewports
  1542.   end
  1543.   #--------------------------------------------------------------------------
  1544.   # ● ビューポートの更新
  1545.   #--------------------------------------------------------------------------
  1546.   def update_viewports
  1547.     @viewport6.tone = $game_map.screen.tone        ##### 修正部分 (この行) #####
  1548.  
  1549.     @viewport1.ox = $game_map.screen.shake
  1550.     @viewport2.color = $game_map.screen.flash_color
  1551.     @viewport3.color.set(0, 0, 0, 255 - $game_map.screen.brightness)
  1552.     @viewport1.update
  1553.     @viewport2.update
  1554.     @viewport3.update
  1555.  
  1556.     @viewport6.update                              ##### 追加部分 (この行) #####
  1557.   end
  1558.   #--------------------------------------------------------------------------
  1559.   # ○ 拡張ビューポートの更新
  1560.   #--------------------------------------------------------------------------
  1561.   def update_ew_ex_viewports
  1562.     @viewport4.ox = $game_map.screen.shake
  1563.     @viewport4.update
  1564.     if Expansion_Passable::BACK_SEEING
  1565.       @viewport5.rect.set($game_player.screen_x - 48, $game_player.screen_y - 64, 96, 96)
  1566.       @viewport5.ox = $game_map.screen.shake
  1567.       @viewport5.update
  1568.     end      
  1569.   end
  1570. end
  1571.  
  1572. #==============================================================================
  1573. # ■ Sprite_Character
  1574. #------------------------------------------------------------------------------
  1575. #  キャラクター表示用のスプライトです。Game_Character クラスのインスタンスを
  1576. # 監視し、スプライトの状態を自動的に変化させます。
  1577. #==============================================================================
  1578.  
  1579. class Sprite_Character < Sprite_Base
  1580.   #--------------------------------------------------------------------------
  1581.   # ○ 公開インスタンス変数
  1582.   #--------------------------------------------------------------------------
  1583.   attr_accessor :back_seeing
  1584.   #--------------------------------------------------------------------------
  1585.   # ◎ オブジェクト初期化
  1586.   #     viewport  : ビューポート
  1587.   #     character : キャラクター (Game_Character)
  1588.   #--------------------------------------------------------------------------
  1589.   alias tig_ew_initialize initialize
  1590.   def initialize(viewport, character = nil)
  1591.     tig_ew_initialize(viewport, character)
  1592.     @back_seeing = false
  1593.   end
  1594.   #--------------------------------------------------------------------------
  1595.   # ◎ フレーム更新
  1596.   #--------------------------------------------------------------------------
  1597.   alias tig_ew_update update
  1598.   def update
  1599.     tig_ew_update
  1600.     if @back_seeing
  1601.       self.opacity = 100 if self.opacity > 100
  1602.       self.x -= $game_player.screen_x - 48
  1603.       self.y -= $game_player.screen_y - 64
  1604.     end
  1605.   end
  1606.   #--------------------------------------------------------------------------
  1607.   # ◎ フキダシアイコン表示の開始
  1608.   #--------------------------------------------------------------------------
  1609.   alias tig_ew_start_balloon start_balloon
  1610.   def start_balloon
  1611.     tig_ew_start_balloon
  1612.     @balloon_sprite.viewport = @viewport4
  1613.   end
  1614. end
  1615.  
  1616. #==============================================================================
  1617. # ■ Scene_Title
  1618. #------------------------------------------------------------------------------
  1619. #  タイトル画面の処理を行うクラスです。
  1620. #==============================================================================
  1621.  
  1622. class Scene_Title < Scene_Base
  1623.   #--------------------------------------------------------------------------
  1624.   # ◎ 開始処理
  1625.   #--------------------------------------------------------------------------
  1626.   alias tig_ew_start start
  1627.   def start
  1628.     tig_ew_start
  1629.     $game_map.create_ex_passages
  1630.   end
  1631.   #--------------------------------------------------------------------------
  1632.   # ◎ データベースのロード
  1633.   #    name から<船の橋下通過>の設定を得ます。
  1634.   #--------------------------------------------------------------------------
  1635.   alias tig_ew_load_database load_database
  1636.   def load_database
  1637.     tig_ew_load_database
  1638.     for area in $data_areas.values
  1639.       area.name = area.name.sub(/[\<<]架け橋[\>>]/, "") # 名前の修正と
  1640.       area.ship_pass = $& != nil                    # 船の橋下通過エリアの設定
  1641.       area.name = area.name.sub(/[\<<]処理無視[\>>]/, "") # 名前の修正と
  1642.       area.disregard_processing = $& != nil         # 処理無視エリアの設定
  1643.     end
  1644.   end
  1645. end



RUBY 代码复制
  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.   
  37.   詳しい活用例はサンプルプロジェクトも参考にしてみてください。
  38.   サンプルプロジェクトには各特殊タイルに使用する為のEタイル画像も入っています。
  39.   そちらを流用してもかまいません。加工などして、お使いください。
  40.  
  41. #------------------------------------------------------------------------------
  42.  
  43. ・基本機能
  44.   スクリプトを導入することで、以下の機能が働きます。
  45.  
  46.  ○ 天井や屋根を歩くことが出来るようになる。
  47.  
  48.   ・壁タイルの天井部分や屋根タイルが通行可能になり、
  49.    その変わりにその境目は越えることが出来なくなる。
  50.  
  51.   という通行判定ルールが追加されます。
  52.  
  53.   天井や屋根には境目が通行不能の為に普通は進入できませんが、
  54.   ハシゴや階段タイルを配置することでそこから侵入できるような
  55.   仕組みになっています。
  56.  
  57.  
  58.  ○ 壁・天井・屋根タイル・橋タイルの裏(下)へキャラが回り込む
  59.  
  60.   まるで建物や壁の向こう側を通っているような表現にすることができます。
  61.   RPGツクールXPにあったような機能です。
  62.  
  63.   また、吊り橋に見立てた橋の上を渡ったり、下をくぐったり、という表現を
  64.   同じマップで行えます。
  65.  
  66.  ※ このスクリプトは、タイルの境目の配置などの情報を元に、
  67.    状況を判断して裏にまわったり、上にのせたりすることで
  68.    「擬似的に」裏側を再現するものです。
  69.  
  70.    配置によっては、ありえない動きをしますが、
  71.    現状の動作は“仕様”と捉えていただき、
  72.    このスクリプトでの出来る範囲での演出でお楽しみください。
  73.  
  74. #------------------------------------------------------------------------------
  75.  
  76. ・カスタマイズ
  77.  
  78.  ● 段差のあるマップ表現
  79.  
  80.    このスクリプトでは、天井タイルの上にさらに壁タイルを配置することで作る
  81.    擬似的な「階段状の立体マップ」を表現する際の、通行判定の補助も行えます。
  82.    
  83.    その際には、
  84.    草原といった地形タイルにも、境目に通行判定を持たせて
  85.    天井タイルを使うように段差表現に利用することもできます。
  86.  
  87.    この機能を反映させると、
  88.    通行判定や表現に、いくつか制約が出来てしまう為、
  89.    マップ毎に「段差マップにするか」を設定する形式にしてあります。
  90.  
  91.    カスタマイズ項目の
  92.  
  93.    CLIFF_MAP = []
  94.  
  95.    の[]内に、地形タイルの段差表現を使用したいマップのIDを記入してください。
  96.    例えばマップID004、ID005で地形タイルの段差表現を使用したい場合は、
  97.    CLIFF_MAP = [4, 5]
  98.    となります。半角の , で区切り、頭のゼロは省いてください。
  99.  
  100.    表現上の制約
  101.    横幅32ピクセルを超えるキャラクターが裏回りすると、
  102.    おかしな位置からはみ出してしまうことがあります。
  103.    また、キャラクター同士の上下の重なりでも不具合があります。
  104.    このマップでは(裏回りする可能性のある)キャラクターは
  105.    縦幅、横幅共に32ピクセル以下のサイズで構成する必要があります。
  106.    (デフォルトのチビキャラのサイズです)
  107.  
  108.    地形タイルについて
  109.    地形タイルにより、段差となる境目が出来るのは
  110.    隣り合ったタイルの一方のみに境目がある場合です。
  111.    (通常は配置すると自動で隣り合ったタイル両方に境目が出来ます)
  112.    SHIFTキーを使ったタイルのコピー・ペーストのテクニックが必須になります。
  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.    壁の裏へ2タイル分、潜り込むようにも出来ます。(通常は1タイル分)
  144.    
  145.    カスタマイズ項目の
  146.  
  147.     BACK_TILE_DEEP = false
  148.  
  149.    を = true に書き換えてください。
  150.  
  151.  
  152.  ● 裏回り時の透過機能
  153.  
  154.    プレイヤーが裏へ回った際、プレイヤーと
  155.    周囲のキャラクター(イベント)を透過、すなわち透けてみせる機能です。
  156.    
  157.    カスタマイズ項目の
  158.  
  159.     BACK_SEEING = false
  160.  
  161.    を = true に書き換えてください。
  162.  
  163.   ※この機能は乗り物拡張との併用に未対応です。
  164.  
  165.  
  166.  ● 裏回り時に透過しないイベントを設定
  167.  
  168.    イベントの名前に
  169.  
  170.     <裏透過禁止>
  171.  
  172.    と記入してください。
  173.    半透明の装飾用タイル替わりのイベントなど、
  174.    透過表現にふさわしくないイベントがあった際、設定してみてください。
  175.  
  176.  
  177.  ● 自動生成された影を消す
  178.  
  179.    配置すると、配置した場所に自動生成された影をゲーム中では消去できる
  180.    「影消しタイル」を使用できます。
  181.  
  182.    カスタマイズ項目の SHADOW_ERASER_TILE_ID にて、ID指定してください。
  183.    このタイルの画像は、ゲーム中には表示されません。
  184.  
  185.    ※ この機能の詳細に関しましては
  186.     月紳士配布の「影消しタイル」スクリプトもご参照ください。
  187.  
  188.  
  189.  ● 船から降りれない場所を設定する
  190.  
  191.    配置することで、大型船・小型船からその場所に降りることが出来なくなる
  192.    「接岸禁止タイル」を使用できます。
  193.  
  194.    カスタマイズ項目の PROHIBITED_GET_OFF_TILE_ID にて、ID指定してください。
  195.    このタイルの画像は、ゲーム中には表示されません。
  196.  
  197.    ※ この機能の詳細に関しましては
  198.     月紳士配布の「接岸禁止タイル」スクリプトもご参照ください。
  199.  
  200.    
  201.  ● 裏回り部分を追加するタイル
  202.  
  203.      主に、抜け道などを作る為に使います。
  204.    カスタマイズ項目の ADDITION_BACK_TILE_ID で設定したIDのタイルを
  205.    元々裏回りしない場所の壁や天井、屋根にのせてください。
  206.    (元々裏回りする場所に配置すると誤動作するかもしれません)
  207.  
  208.  
  209.  ● 裏回り部分を削除するタイル
  210.  
  211.      裏回り部分は、天井の上端を基準にして自動的に配置されますが、
  212.    その自動配置された裏回り部分を削除するタイルを設定できます。
  213.    カスタマイズ項目の DELETE_BACK_TILE_ID で設定したIDのタイルを
  214.    裏回りする場所の壁や天井、屋根にのせてください。
  215.    (配置により効果的でない場合があるかもしれません)
  216.  
  217. #------------------------------------------------------------------------------
  218.  
  219. ・軽量化処理
  220.  
  221.  このスクリプトは、マップが大きくなればなるほど、
  222.  初期のデータ準備にどうしても時間がかかってしまいます。
  223.  
  224.  その対策の為に用意した、処理軽量化の方法を説明します。
  225.  
  226.  ● 処理を無視するマップ
  227.  
  228.    カスタマイズ項目の、下記の項目で設定します。
  229.  
  230.       ESCAPE_MAP = [1, 2]
  231.     
  232.      このマップでは、裏回りを行いません。
  233.      処理の準備をしない為、読み込みも速くなります。
  234.      
  235.  
  236.  ● 処理を無視するエリア
  237.  
  238.    通常ですと、裏回り用のタイルを準備する必要があるか?
  239.    マップの隅々までチェックを行います。
  240.    その為、広いマップほど準備処理に時間がかかります。
  241.  
  242.    マップの中に、下記の名前を含んだエリアを作ると、
  243.    そのエリアの段差マップ用データの準備処理を飛ばします。
  244.    いくらか、準備処理を早めることができます。
  245.  
  246.    マップ内の、裏回り処理の必要のない位置に
  247.  
  248.    <処理無視>
  249.  
  250.    と書いたエリアを用意してください。
  251.    マップ内に、同名の複数のエリアを作っても良いです。
  252.  
  253.  ● マップデータの先読み
  254.  
  255.    通常、データ準備はマップ移動時に行われます。
  256.    これを、別のタイミングでおこなったり、
  257.    ひとつのマップの読み込み時に複数のマップのデータを準備しておき
  258.    以後のマップ移動時の処理を軽くしたり出来ます。
  259.  
  260.   ・別タイミングでの先読み
  261.  
  262.     イベントコマンド・スクリプトにて
  263.  
  264.         $game_player.beforehand_load([1, 2])
  265.     
  266.     と記述して実行してください。
  267.     ([ ]) 内がマップのIDです。
  268.     上記ですと、マップID 001 と 002 のマップデータを先読みします。
  269.     複数のID指定は、半角ピリオドで区切ります。
  270.  
  271.     ※準備中は、画面がフリーズします。
  272.  
  273.   ・マップ移動時に先読み
  274.  
  275.     マップ移動よりも前に、次の記述を
  276.     イベントコマンド・スクリプトにて実行してください。
  277.  
  278.         $game_player.reserve_load_map_id = [1, 2]
  279.       
  280.        = [ ] 内がマップのIDです。
  281.        このコマンドが実行された後のマップ移動の暗転中に、データを準備します。
  282.        (暗転の時間が長くなりますが、処理は自然に見えると思います)
  283.       
  284.      どちらのコマンドも、最後に指定されたデータがのみが準備され、
  285.      それ以前のコマンドによるデータは破棄されます。
  286.       
  287. #------------------------------------------------------------------------------
  288. =end

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-10 07:09

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表