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

Project1

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

[已经解决] 请问地图的编号怎么数= =?

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
48
在线时间
678 小时
注册时间
2010-8-11
帖子
1533
跳转到指定楼层
1
发表于 2011-8-12 09:42:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
目前本人懂了在TileB开始的第一个就是0
然后最后一个是255
然后TileC是256
然后最后一个是511
以此类推
但是……TileA1-5的图块编号怎么数?
好像在一个脚本是30左右……(脚步声脚本有,但是我用的不是脚步声脚本)
可是应该是错的……
求指教=v=
小艾工作室开张= =

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1071 小时
注册时间
2011-5-12
帖子
2317

贵宾

2
发表于 2011-8-12 14:11:29 | 只看该作者
在脚本里的game_map里的404行下加入$game_variables[70] = tile_id,
然后走到你要的图块上(卡住的话就穿墙"ctrl")再按F9看看变量70的数字?
未测试……纯思考……

点评

行不通= =  发表于 2011-8-12 14:49
找我请找芙蕾娅
顺带一提,完全看得懂我头像请捡起你自己的节操哟(自重
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
678 小时
注册时间
2010-8-11
帖子
1533
3
 楼主| 发表于 2011-8-12 16:17:16 | 只看该作者
alyxms 发表于 2011-8-12 09:04
地图编号???

我不会脚本……这个简单的

我说的是图块的ID………………
不是地图的编号……地图的编号只要用场所移动看看就行了= =
就是一些用需要修改图块的脚本……需要填上ID
就是这么一回事= =
小艾工作室开张= =
回复

使用道具 举报

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
39860
在线时间
7493 小时
注册时间
2009-7-6
帖子
13485

开拓者贵宾

4
发表于 2011-8-12 17:47:38 | 只看该作者
RPGmaster 发表于 2011-8-12 16:17
我说的是图块的ID………………
不是地图的编号……地图的编号只要用场所移动看看就行了= =
就是一些用需 ...

读mapinfo
RGDirect - DirectX驱动的RGSS,点我了解.
RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

5
发表于 2011-8-12 21:41:04 | 只看该作者
  1. class Game_Map
  2.   def get_tile_id(x, y)
  3.     a = data[x, y, 0]
  4.     return 0 unless a
  5.     a-=2000
  6.     map_tile_id_0 = (a >= 0) ? a/48 : (a+593)
  7.     map_tile_id_1 = (data[x, y, 1]-2000) / 48
  8.     map_tile_id_2 = (data[x, y, 2])
  9.          
  10.     map_tile_id_0 = 0 if map_tile_id_0 == -42 # A
  11.     map_tile_id_1 = 0 if map_tile_id_1 == -42 # I
  12.     map_tile_id_2 = 0 if map_tile_id_2 == -42 # B~E
  13.    
  14.     # 图块 ID 矫正
  15.     map_tile_id_0 = map_tile_id_1 if map_tile_id_1 > 0
  16.     unless @events.nil?
  17.       for event in @events.values
  18.         if event.pos?(x, y) and event.tile_id > 0
  19.           # 若是事件使用地图元件,使用该地图元件的ID
  20.           map_tile_id_2 = event.tile_id
  21.         end
  22.       end
  23.     end
  24.     # 返回 [底层ID, 上层ID]
  25.     return [map_tile_id_0, map_tile_id_2]
  26.   end
  27. end
  28. class Scene_Map < Scene_Base
  29.   alias get_map_id_update update
  30.   def update
  31.     get_map_id_update
  32.     if Input.trigger?(Input::Z)
  33.       p $game_map.get_tile_id($game_player.x, $game_player.y)
  34.     end
  35.   end
  36. end
复制代码
进入地图後按 Z 按键 (默认为键盘的D键)後会挑出对话框
内容为 [17, 0] 之类的数字为主角当前位置的图块ID
第一个数字是底层图块ID,第二个数字是上层图块ID
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
678 小时
注册时间
2010-8-11
帖子
1533
6
 楼主| 发表于 2011-8-13 05:39:31 | 只看该作者
本帖最后由 RPGmaster 于 2011-8-12 22:50 编辑
雪流星 发表于 2011-8-12 14:41
进入地图後按 Z 按键 (默认为键盘的D键)後会挑出对话框
内容为 [17, 0] 之类的数字为主角当前位置的图块I ...


抱歉,我没表达清楚,我的意思是:
  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 = [3, 6]
  38.   # 段差マップを使用するマップのID
  39.   
  40.   BACK_TILE_DEEP = false
  41.   # 壁の深さを増すなら = true に。戻すなら = false に。
  42.   
  43.   BACK_SEEING = false
  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 = [17, 18, 20, 22]

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

复制代码
  1. #==============================================================================
  2. # □ オートタイル情報 ※変更はしないでください。
  3. #==============================================================================

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

  18. end

  19. #==============================================================================
  20. # ■ RPG::Area
  21. #==============================================================================

  22. class RPG::Area
  23.   #--------------------------------------------------------------------------
  24.   # ○ 公開インスタンス変数
  25.   #--------------------------------------------------------------------------
  26.   attr_accessor :ship_pass
  27.   attr_accessor :disregard_processing
  28. end

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

  35. class Game_Map
  36.   #--------------------------------------------------------------------------
  37.   # ○ 公開インスタンス変数
  38.   #--------------------------------------------------------------------------
  39.   attr_reader   :map
  40.   attr_reader   :ex_data
  41.   attr_reader   :under_bridge_passages    # 橋の下の通行判定
  42.   attr_reader   :back_tiles_position      # 裏回りする座標
  43.   attr_reader   :keep_back_position       # 裏回りを維持する座標
  44.   attr_reader   :prohibited_get_off       # 接岸禁止座標
  45.   attr_reader   :ex_data                  # 拡張レイヤー用タイルデータ
  46.   #--------------------------------------------------------------------------
  47.   # ◎ セットアップ
  48.   #     map_id : マップ ID
  49.   #--------------------------------------------------------------------------
  50.   alias tig_ew_setup setup
  51.   def setup(map_id)
  52.     tig_ew_setup(map_id)
  53.     create_ex_passages
  54.     pick_up_back_tiles
  55.     setup_back_tiles
  56.     $game_player.set_on_tile
  57.     for event in $game_map.events.values
  58.       event.update_turn_back
  59.     end
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ○ 指定座標のタイルIDの取得
  63.   #--------------------------------------------------------------------------
  64.   def point_tile_id(x, y)
  65.     return [data[x, y, 0], data[x, y, 1], data[x, y, 2]]
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ○ オートタイルIDの取得(オートタイル郡の中で順番にIDをつけた独自のIDです)
  69.   #--------------------------------------------------------------------------
  70.   def auto_(tile_id)
  71.     return 0 unless (1904...8192).include?(tile_id)
  72.     return (tile_id - 1904) % 48
  73.   end
  74.   #--------------------------------------------------------------------------
  75.   # ○ トップタイルIDの取得(オートタイル郡の最初のID)
  76.   #--------------------------------------------------------------------------
  77.   def top_(tile_id)
  78.     return 0 if tile_id == nil
  79.     return (tile_id - auto_(tile_id))
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # ○ スクリプト機能を使用する屋根・天井・壁タイルか?
  83.   #--------------------------------------------------------------------------
  84.   def ceiling?(tile_id)
  85.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  86.     return true if wall?(tile_id)
  87.     return true if (2000...2048).include?(tile_id)
  88.     return true if (4352...4736).include?(tile_id)
  89.     return true if (5120...5504).include?(tile_id)
  90.     return true if (5888...6272).include?(tile_id)
  91.     return true if (6656...7040).include?(tile_id)
  92.     return (7424...7808).include?(tile_id)
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ○ スクリプト機能を使用する壁タイルか?
  96.   #--------------------------------------------------------------------------
  97.   def wall?(tile_id)
  98.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  99.     return true if (1904...2000).include?(tile_id)
  100.     return true if (4736...5120).include?(tile_id)
  101.     return true if (5504...5888).include?(tile_id)
  102.     return true if (6272...6656).include?(tile_id)
  103.     return true if (7040...7424).include?(tile_id)
  104.     return (7808...8192).include?(tile_id)
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ○ スクリプト機能を使用する地形タイルか?
  108.   #--------------------------------------------------------------------------
  109.   def cliff?(tile_id)
  110.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  111.     return [2816, 3200, 3584, 2960, 3344, 3728, 4112].include?(top_(tile_id))
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   # ○ 指定の向きにオートタイルチップの境目があるか?
  115.   #--------------------------------------------------------------------------
  116.   def verge?(tile_id, direction)
  117.     auto_tile_id = auto_(tile_id)
  118.    
  119.     return false if auto_tile_id == 0
  120.     return false unless ceiling?(tile_id) or cliff?(tile_id)
  121.            
  122.     if (1904...2000).include?(tile_id) or
  123.        (4352...5888).include?(tile_id) or
  124.        (6272...6656).include?(tile_id) or
  125.        (7040...7424).include?(tile_id) or
  126.        (7808...8192).include?(tile_id)           # オートタイルの線画タイプ判別
  127.       case direction # 壁タイプの場合 方向ごとに振り分け
  128.       when 2 ; return true if Data_Auto_Tile::VERGE_DOWN_B.include?(auto_tile_id)
  129.       when 4 ; return true if Data_Auto_Tile::VERGE_LEFT_B.include?(auto_tile_id)
  130.       when 6 ; return true if Data_Auto_Tile::VERGE_RIGHT_B.include?(auto_tile_id)
  131.       when 8 ; return true if Data_Auto_Tile::VERGE_UP_B.include?(auto_tile_id)
  132.       end
  133.     else
  134.       case direction # 床タイプの場合 方向ごとに振り分け
  135.       when 2 ; return true if Data_Auto_Tile::VERGE_DOWN_A.include?(auto_tile_id)
  136.       when 4 ; return true if Data_Auto_Tile::VERGE_LEFT_A.include?(auto_tile_id)
  137.       when 6 ; return true if Data_Auto_Tile::VERGE_RIGHT_A.include?(auto_tile_id)
  138.       when 8 ; return true if Data_Auto_Tile::VERGE_UP_A.include?(auto_tile_id)
  139.       end
  140.     end
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ○ 指定の向きに有効な境目があるか?
  144.   #--------------------------------------------------------------------------
  145.   def rip?(direction, x, y, floating = false)
  146.     #- 位置情報の準備
  147.     tile_id = point_tile_id(x, y)
  148.     front_x = x_with_direction(x, direction)
  149.     front_y = y_with_direction(y, direction)
  150.     front_tile_id = point_tile_id(front_x, front_y)
  151.    
  152.     #- ステップタイルがあれば無効
  153.     return false if Data_Tile::STEP.include?(front_tile_id[0])
  154.     return false if Data_Tile::STEP.include?(front_tile_id[2])
  155.     return false if Data_Tile::STEP.include?(tile_id[0])
  156.     return false if Data_Tile::STEP.include?(tile_id[2])
  157.    
  158.     #- 橋タイルの処理
  159.     if floating
  160.       if Data_Tile::BRIDRE_LENGTH.include?(tile_id[2]) or
  161.          Data_Tile::BRIDGE_BREADTH.include?(tile_id[2])
  162.         return false if @under_bridge_passages[[x, y]] == -1
  163.       elsif Data_Tile::BRIDRE_LENGTH.include?(front_tile_id[2]) or
  164.             Data_Tile::BRIDGE_BREADTH.include?(front_tile_id[2])
  165.         return false if @under_bridge_passages[[front_x, front_y]] == -1  
  166.       end
  167.     end

  168.     if bridge?(front_tile_id[2], direction)
  169.       return false
  170.     elsif Data_Tile::BRIDRE_LENGTH.include?(tile_id[2]) and back_tile?(x, y)
  171.       return true if direction == 4 or direction == 6
  172.       return false if direction == 2 or direction == 8
  173.     elsif Data_Tile::BRIDGE_BREADTH.include?(tile_id[2]) and back_tile?(x, y)
  174.       return true if direction == 2 or direction == 8
  175.       return false if direction == 4 or direction == 6
  176.     end
  177.    
  178.     #- 地形タイルの処理
  179.     if cliff?(tile_id[0])
  180.       if Expansion_Passable::CLIFF_MAP.include?($game_map.map_id)
  181.         return false unless ceiling?(front_tile_id[0]) or cliff?(front_tile_id[0])
  182.         if cliff?(front_tile_id[0]) and verge?(front_tile_id[0], 10 - direction)
  183.           return false
  184.         end
  185.       else
  186.         return false
  187.       end
  188.     end

  189.     #- タイルに境目があるか?
  190.     return verge?(tile_id[0], direction)
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ○ 指定の向きに準じた橋タイルか?(渡ることの出来る向きか)
  194.   #--------------------------------------------------------------------------
  195.   def bridge?(tile_id, direction)
  196.     if direction == 2 or direction == 8
  197.       return true if Data_Tile::BRIDRE_LENGTH.include?(tile_id)
  198.     elsif direction == 4 or direction == 6
  199.       return true if Data_Tile::BRIDGE_BREADTH.include?(tile_id)
  200.     end
  201.     return false
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ○ 上層に移すタイルか?
  205.   #--------------------------------------------------------------------------
  206.   def upper_layer?(tile_id)
  207.     return false if @back_tiles_a == nil
  208.     if Expansion_Passable::CLIFF_MAP.include?(@map_id)
  209.       return true if @back_tiles_b.include?(tile_id)
  210.     else
  211.       unless cliff?(tile_id)
  212.         return true if @back_tiles_a.include?(tile_id)
  213.       end
  214.     end
  215.   end
  216.   #--------------------------------------------------------------------------
  217.   # ○ <船の橋下通過>処理をするエリアか?
  218.   #--------------------------------------------------------------------------
  219.   def ship_pass_area?(x, y)
  220.     result = false
  221.     for area in $data_areas.values
  222.       next if area == nil
  223.       next unless area.ship_pass
  224.       next if $game_map.map_id != area.map_id
  225.       next if x < area.rect.x
  226.       next if y < area.rect.y
  227.       next if x >= area.rect.x + area.rect.width
  228.       next if y >= area.rect.y + area.rect.height
  229.       result = true
  230.     end
  231.     return result
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ○ 処理の無視をするエリアか?
  235.   #--------------------------------------------------------------------------
  236.   def disregard_processing_area?(x, y, map_id)
  237.     result = false
  238.     for area in $data_areas.values
  239.       next if area == nil
  240.       next unless area.disregard_processing
  241.       next if map_id != area.map_id
  242.       next if x < area.rect.x
  243.       next if y < area.rect.y
  244.       next if x >= area.rect.x + area.rect.width
  245.       next if y >= area.rect.y + area.rect.height
  246.       result = true
  247.     end
  248.     return result
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # ○ 段差マップか?
  252.   #--------------------------------------------------------------------------
  253.   def cliff_map?
  254.     return Expansion_Passable::CLIFF_MAP.include?(@map_id)
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # ○ 特殊通行判定の作成
  258.   #--------------------------------------------------------------------------
  259.   def create_ex_passages
  260.     @ex_passages = $data_system.passages
  261.    
  262.     #- 壁・屋根・天井タイルの通行判定を○に変える
  263.     for i in 1904...2048
  264.       @ex_passages[i] = 0x06 if ceiling?(i)
  265.     end
  266.     for i in 4352...8192
  267.       @ex_passages[i] = 0x06 if ceiling?(i)
  268.     end

  269.     #- 橋タイルの通行判定を○に
  270.     for i in (Data_Tile::BRIDRE_LENGTH + Data_Tile::BRIDGE_BREADTH)
  271.       @ex_passages[i] = 0x00
  272.     end
  273.    
  274.     @passages = @ex_passages
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # ○ 接岸禁止タイル登録
  278.   #     map_id : マップ ID
  279.   #--------------------------------------------------------------------------
  280.   def prohibited_get_off_set(x, y)
  281.     @map.data[x, y, 2] = 0
  282.     @prohibited_get_off.push([x, y])
  283.   end
  284.   #--------------------------------------------------------------------------
  285.   # ○ 影消しタイル処理
  286.   #--------------------------------------------------------------------------
  287.   def shadow_eraser(x, y)
  288.     r_x = round_x(x - 1) ; r_y = round_y(y - 1)
  289.     tile_id = @map.data[r_x, y, 0]

  290.     # 壁(線画・壁タイプ)
  291.     if (4736...5120).include?(tile_id) or
  292.        (5504...5888).include?(tile_id) or
  293.        (6272...6656).include?(tile_id) or
  294.        (7040...7424).include?(tile_id) or
  295.        (7808...8192).include?(tile_id)
  296.       dummy_tile_id = 1904 + auto_(tile_id)
  297.     # 屋根(線画・壁タイプ)
  298.     elsif (4352...4736).include?(tile_id) or
  299.           (5120...5504).include?(tile_id)
  300.       dummy_tile_id = 1952 + auto_(tile_id)
  301.     # 天井(線画・床タイプ)
  302.     elsif (5888...6272).include?(tile_id) or
  303.           (6656...7040).include?(tile_id) or
  304.           (7424...7808).include?(tile_id)
  305.       dummy_tile_id = 2000 + auto_(tile_id)
  306.     else
  307.       return
  308.     end
  309.    
  310.     @map.data[r_x, r_y, 1] = @map.data[r_x, r_y, 0]
  311.     @map.data[r_x, r_y, 0] = dummy_tile_id
  312.   end
  313.   #--------------------------------------------------------------------------
  314.   # ○ 裏回り消去タイル処理
  315.   #--------------------------------------------------------------------------
  316.   def back_tiles_position_delete(x, y)
  317.     return if Expansion_Passable::DELETE_BACK_TILE_ID == nil
  318.     y = round_y(y+1) if Expansion_Passable::BACK_TILE_DEEP
  319.     if @map.data[x, y, 2] == Expansion_Passable::DELETE_BACK_TILE_ID or
  320.        @ex_data[x, y, 2] == Expansion_Passable::DELETE_BACK_TILE_ID
  321.       @back_tiles_position.delete([x, y])
  322.       @map.data[x, y, 2] = 0
  323.       @ex_data[x, y, 2] = 0
  324.     end
  325.   end
  326.   #--------------------------------------------------------------------------
  327.   # ○ 裏回り用タイル種類ピックアップ
  328.   #--------------------------------------------------------------------------  
  329.   def pick_up_back_tiles
  330.     return if @back_tiles_a != nil
  331.    
  332.     @back_tiles_a = []
  333.     @back_tiles_b = []
  334.     for i in 1904...8192
  335.       next unless ceiling?(i) or cliff?(i)
  336.       if wall?(i)
  337.         next if verge?(i, 2)
  338.         if verge?(i, 4) or verge?(i, 6)
  339.           @back_tiles_a.push(i) unless cliff?(i)
  340.         end
  341.       else
  342.         @back_tiles_a.push(i) unless cliff?(i)
  343.         @back_tiles_b.push(i) if verge?(i, 8)
  344.       end
  345.     end
  346.   end
  347.   #--------------------------------------------------------------------------
  348.   # ○ 通行判定初期化と裏回り用タイル座標ピックアップ
  349.   #--------------------------------------------------------------------------
  350.   def setup_back_tiles
  351.     if $game_player.game_map_data.include?(@map_id)
  352.       @map = $game_player.game_map_data[@map_id].map
  353.       @ex_data = $game_player.game_map_data[@map_id].ex_data
  354.       @under_bridge_passages = $game_player.game_map_data[@map_id].under_bridge_passages
  355.       @back_tiles_position = $game_player.game_map_data[@map_id].back_tiles_position
  356.       @keep_back_position = $game_player.game_map_data[@map_id].keep_back_position
  357.       @prohibited_get_off = $game_player.game_map_data[@map_id].prohibited_get_off
  358.       return
  359.     end
  360.    
  361.     @ex_data = Table.new(width, height, 3)
  362.     @under_bridge_passages = {}
  363.     @back_tiles_position = []
  364.     @keep_back_position = []
  365.     @prohibited_get_off = []
  366.    
  367.     return if Expansion_Passable::ESCAPE_MAP.include?(@map_id)
  368.    
  369.     #- 座標毎処理
  370.     for x in 0...width
  371.       for reverse_y in 1..height
  372.         y = height - reverse_y   # Y座標を逆順にする為の処理
  373.         next if disregard_processing_area?(x, y, @map_id)
  374.         
  375.         tile_id = point_tile_id(x, y)

  376.         #- 橋タイル処理
  377.         if (Data_Tile::BRIDRE_LENGTH + Data_Tile::BRIDGE_BREADTH).include?(tile_id[2])
  378.           if (2048...2815).include?(tile_id[0])
  379.             if ship_pass_area?(x, y)
  380.               @under_bridge_passages[[x, y]] = 1
  381.               @back_tiles_position.push([x, y])
  382.               @ex_data[x, y, 2] = @map.data[x, y, 2]
  383.             else
  384.               @back_tiles_position.push([x, y])
  385.               @under_bridge_passages[[x, y]] = -1
  386.             end
  387.           elsif @passages[tile_id[0]] != 0x06 or $game_map.wall?(tile_id[0])
  388.             @under_bridge_passages[[x, y]] = -1
  389.             @back_tiles_position.push([x, y])
  390.             @ex_data[x, y, 2] = @map.data[x, y, 2]
  391.           else
  392.             @under_bridge_passages[[x, y]] = 0
  393.             @back_tiles_position.push([x, y])
  394.             @ex_data[x, y, 2] = @map.data[x, y, 2]
  395.           end
  396.           if Data_Tile::BRIDGE_BREADTH.include?(tile_id[2])
  397.             @keep_back_position.push([x, round_y(y+1)])
  398.           end
  399.          
  400.         #- 通行判定☆タイルを上層に移動
  401.         elsif tile_id[2] != 0 and @passages[tile_id[2]] & 0x10 == 0x10
  402.           if @back_tiles_position.include?([x, round_y(y+1)])
  403.             @keep_back_position.push([x, y])
  404.           else
  405.             @ex_data[x, y, 2] = @map.data[x, y, 2]
  406.           end
  407.         end
  408.         
  409.         #- 影消しタイルの処理
  410.         if @map.data[x, y, 2] == Expansion_Passable::SHADOW_ERASER_TILE_ID
  411.           shadow_eraser(x, y)
  412.           @map.data[x, y, 2] = 0
  413.         #- 接岸禁止タイルの処理
  414.         elsif @map.data[x, y, 2] == Expansion_Passable::PROHIBITED_GET_OFF_TILE_ID
  415.           prohibited_get_off_set(x, y)
  416.         end
  417.         
  418.         #- 壁・天井タイル処理
  419.         if ceiling?(tile_id[0]) or (cliff?(tile_id[0]) and cliff_map?)
  420.          
  421.           #- 基本となる裏回りタイルの場合、裏回り位置に登録
  422.           if not wall?(tile_id[0]) and verge?(tile_id[0], 8)
  423.             @back_tiles_position.push([x, y])
  424.           end
  425.          
  426.           #- 裏回り位置にするタイルの場合、上層に移動
  427.           back_tiles = cliff_map? ? @back_tiles_b : @back_tiles_a
  428.           if back_tiles.include?(tile_id[0])
  429.             @ex_data[x, y, 0] = @map.data[x, y, 0]
  430.             @ex_data[x, y, 1] = @map.data[x, y, 1]
  431.             #- 裏回り位置追加タイルの誤用時には、タイルを消去する
  432.             if tile_id[2] != Expansion_Passable::ADDITION_BACK_TILE_ID
  433.               @ex_data[x, y, 2] = @map.data[x, y, 2]
  434.             end
  435.             @map.data[x, y, 1] = 0
  436.             @map.data[x, y, 2] = 0
  437.           end
  438.          
  439.           #- 深く裏回りする設定の際の処理(裏回り位置の下をさらに上層に)
  440.           if Expansion_Passable::BACK_TILE_DEEP
  441.             unless @back_tiles_position.include?([x, round_y(y+1)])
  442.               if not wall?(tile_id[0]) and verge?(tile_id[0], 8)
  443.                 unless wall?(data[x, round_y(y+1), 0]) and verge?(data[x, round_y(y+1), 0], 2)
  444.                   @back_tiles_position.push([x, round_y(y+1)])
  445.                   @ex_data[x, round_y(y+1), 0] = @map.data[x, round_y(y+1), 0]
  446.                   @ex_data[x, round_y(y+1), 1] = @map.data[x, round_y(y+1), 1]
  447.                   @ex_data[x, round_y(y+1), 2] = @map.data[x, round_y(y+1), 2]
  448.                   @map.data[x, round_y(y+1), 1] = 0
  449.                   @map.data[x, round_y(y+1), 2] = 0
  450.                 end
  451.               end
  452.             end
  453.           end
  454.             
  455.           #- 裏回り追加タイルの処理
  456.           if Expansion_Passable::ADDITION_BACK_TILE_ID != nil and
  457.              tile_id[2] == Expansion_Passable::ADDITION_BACK_TILE_ID
  458.             @back_tiles_position.push([x, y])
  459.             @ex_data[x, y, 0] = @map.data[x, y, 0]
  460.             @ex_data[x, y, 1] = @map.data[x, y, 1]
  461.             @map.data[x, y, 2] = 0
  462.             if (2816...8192).include?(@map.data[x, round_y(y-1), 0])
  463.               @ex_data[x, round_y(y-1), 0] = @map.data[x, round_y(y-1), 0]
  464.               @ex_data[x, round_y(y-1), 1] = @map.data[x, round_y(y-1), 1]
  465.             end
  466.           end
  467.         end
  468.         
  469.         #- 裏回り部分除去タイルの処理
  470.         back_tiles_position_delete(x, y)
  471.       end
  472.     end
  473.   end
  474.   #--------------------------------------------------------------------------
  475.   # ○ 裏回り用タイルの存在する座標か?
  476.   #--------------------------------------------------------------------------
  477.   def back_tile?(x, y)
  478.     return false if @back_tiles_position == nil
  479.     return @back_tiles_position.include?([x, y])
  480.   end
  481. end

  482. #==============================================================================
  483. # ■ Game_Character
  484. #------------------------------------------------------------------------------
  485. #  キャラクターを扱うクラスです。このクラスは Game_Player クラスと Game_Event
  486. # クラスのスーパークラスとして使用されます。
  487. #==============================================================================

  488. class Game_Character
  489.   #--------------------------------------------------------------------------
  490.   # ○ 公開インスタンス変数
  491.   #--------------------------------------------------------------------------
  492.   attr_reader   :on_tile
  493.   attr_reader   :turn_back
  494.   attr_accessor :no_turn_back
  495.   attr_reader   :back_seeing
  496.   attr_reader   :not_back_seeing
  497.   #--------------------------------------------------------------------------
  498.   # ◎ オブジェクト初期化
  499.   #--------------------------------------------------------------------------
  500.   alias tig_ew_initialize initialize
  501.   def initialize
  502.     tig_ew_initialize
  503.     @vehicle_type = -1
  504.     @turn_back = false
  505.     @no_turn_back = false
  506.     @on_tile = true
  507.     @back_seeing = false
  508.     @not_back_seeing = false
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ◎ フレーム更新
  512.   #--------------------------------------------------------------------------
  513.   alias tig_ew_update update
  514.   def update
  515.     if @first_update == nil
  516.       update_turn_back
  517.       @first_update = true
  518.     end
  519.     tig_ew_update
  520.   end
  521.   #--------------------------------------------------------------------------
  522.   # ◎ 指定位置に移動
  523.   #     x : X 座標
  524.   #     y : Y 座標
  525.   #--------------------------------------------------------------------------
  526.   alias tig_ew_moveto moveto
  527.   def moveto(x, y)
  528.     tig_ew_moveto(x, y)
  529.     update_turn_back
  530.   end
  531.   #--------------------------------------------------------------------------
  532.   # ◎ ジャンプ時の更新
  533.   #--------------------------------------------------------------------------
  534.   alias tig_ew_update_jump update_jump
  535.   def update_jump
  536.     tig_ew_update_jump
  537.     update_turn_back
  538.   end
  539.   #--------------------------------------------------------------------------
  540.   # ◎ 移動時の更新
  541.   #--------------------------------------------------------------------------
  542.   alias tig_ew_update_move update_move
  543.   def update_move
  544.     tig_ew_update_move
  545.     update_turn_back unless moving?
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # ◎ 歩数増加
  549.   #--------------------------------------------------------------------------
  550.   alias tig_ew_increase_steps increase_steps
  551.   def increase_steps
  552.     tig_ew_increase_steps
  553.     update_turn_back
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ○ 2座標の位置関係を向きで取得
  557.   #--------------------------------------------------------------------------
  558.   def search_direction(start_x, start_y, arriv_x, arriv_y)
  559.     if start_x == arriv_x
  560.       if start_y == arriv_y
  561.         return 5
  562.       elsif start_y < arriv_y
  563.         return 2
  564.       elsif start_y > arriv_y
  565.         return 8
  566.       end
  567.     elsif start_x < arriv_x
  568.       if start_y == arriv_y
  569.         return 6
  570.       elsif start_y < arriv_y
  571.         return 3
  572.       elsif start_y > arriv_y
  573.         return 9
  574.       end
  575.     elsif start_x > arriv_x
  576.       if start_y == arriv_y
  577.         return 4
  578.       elsif start_y < arriv_y
  579.         return 1
  580.       elsif start_y > arriv_y
  581.         return 7
  582.       end
  583.     end
  584.   end
  585.   #--------------------------------------------------------------------------
  586.   # ○ 裏回りセット
  587.   #--------------------------------------------------------------------------
  588.   def set_turn_back
  589.     @turn_back = true
  590.     @on_tile = false
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ○ 天井載せセット
  594.   #--------------------------------------------------------------------------
  595.   def set_on_tile
  596.     @turn_back = false
  597.     @on_tile = true
  598.   end
  599.   #--------------------------------------------------------------------------
  600.   # ○ 裏回り状態更新
  601.   #--------------------------------------------------------------------------
  602.   def update_turn_back
  603.     tile_id = $game_map.point_tile_id(@x, @y)
  604.     direction = search_direction(@real_x, @real_y, @x * 256, @y * 256)
  605.     if self.is_a?(Game_Player) and [2, 4].include?(@vehicle_type)
  606.       @turn_back = false
  607.       @no_turn_back = false
  608.       @on_tile = true
  609.       return
  610.     end
  611.     #- 段差マップの場合
  612.     if Expansion_Passable::CLIFF_MAP.include?($game_map.map_id)
  613.       #- 停止時の更新
  614.       if direction == 5
  615.         @turn_back = false if @no_turn_back
  616.         unless $game_map.back_tile?(@x, @y)
  617.           @turn_back = false
  618.           @no_turn_back = false
  619.         end
  620.         @on_tile = true unless @turn_back
  621.       #- 移動開始時の更新
  622.       else
  623.         if direction % 2 == 0
  624.           if $game_map.rip?(10 - direction, @x, @y, floating?)
  625.             @turn_back = true unless @no_turn_back
  626.           end
  627.         else
  628.           if diagonal_move_turn_back(direction, @x, @y)
  629.             @turn_back = true unless @no_turn_back
  630.           end
  631.         end
  632.         @on_tile = false if @turn_back
  633.       end
  634.       if not @turn_back or @no_turn_back
  635.         if $game_map.keep_back_position != nil and $game_map.keep_back_position.include?([@x, @y])
  636.           @on_tile = false
  637.           return
  638.         end
  639.       end
  640.     #- 通常マップの場合
  641.     else
  642.       #- 停止時の更新
  643.       if direction == 5
  644.         unless $game_map.back_tile?(@x, @y)
  645.           @turn_back = false
  646.           @no_turn_back = false
  647.         end
  648.         if $game_map.upper_layer?(tile_id[0])
  649.           @on_tile = true
  650.         else
  651.           @on_tile = false
  652.         end
  653.       #- 移動開始時の更新
  654.       else
  655.         if direction % 2 == 0
  656.           if $game_map.rip?(10 - direction, @x, @y, floating?)
  657.             @turn_back = true unless @no_turn_back
  658.           end
  659.         else
  660.           if diagonal_move_turn_back(direction, @x, @y)
  661.             @turn_back = true unless @no_turn_back
  662.           end
  663.         end
  664.       end
  665.       if $game_map.back_tile?(@x, @y)
  666.         if @turn_back
  667.           @on_tile = false
  668.         else
  669.           @on_tile = true
  670.         end
  671.       elsif Data_Tile::STEP.include?(tile_id[0]) or Data_Tile::STEP.include?(tile_id[2])
  672.         @on_tile = true
  673.       end
  674.     end
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # ○ 斜め移動時の裏回り状態判別
  678.   #--------------------------------------------------------------------------
  679.   def diagonal_move_turn_back(direction, x, y)
  680.     turn_back = false
  681.     case direction
  682.     when 1
  683.       turn_back = true if $game_map.rip?(8, x+1, y, floating?)
  684.       turn_back = true if $game_map.rip?(6, x, y, floating?)
  685.       turn_back = true if $game_map.rip?(6, x, y-1, floating?)
  686.       turn_back = true if $game_map.rip?(8, x, y, floating?)
  687.     when 3
  688.       turn_back = true if $game_map.rip?(8, x-1, y, floating?)
  689.       turn_back = true if $game_map.rip?(4, x, y, floating?)
  690.       turn_back = true if $game_map.rip?(4, x, y-1, floating?)
  691.       turn_back = true if $game_map.rip?(8, x, y, floating?)
  692.     when 7
  693.       turn_back = true if $game_map.rip?(6, x, y+1, floating?)
  694.       turn_back = true if $game_map.rip?(2, x, y, floating?)
  695.       turn_back = true if $game_map.rip?(2, x+1, y, floating?)
  696.       turn_back = true if $game_map.rip?(6, x, y, floating?)
  697.     when 9
  698.       turn_back = true if $game_map.rip?(4, x, y+1, floating?)
  699.       turn_back = true if $game_map.rip?(2, x, y, floating?)
  700.       turn_back = true if $game_map.rip?(2, x-1, y, floating?)
  701.       turn_back = true if $game_map.rip?(4, x, y, floating?)
  702.     end
  703.     return turn_back
  704.   end
  705.   #--------------------------------------------------------------------------
  706.   # ○ この場が裏か判定
  707.   #--------------------------------------------------------------------------
  708.   def back_tile?(pos)
  709.     return $game_map.back_tile?(pos[0], pos[1])
  710.   end
  711.   #--------------------------------------------------------------------------
  712.   # ○ 橋の下の通行判定
  713.   #--------------------------------------------------------------------------  
  714.   def under_bridge_passages(pos)
  715.     return true unless $game_map.under_bridge_passages.key?(pos)
  716.     case @vehicle_type
  717.     when -1
  718.       return $game_map.under_bridge_passages[pos] == 0
  719.     when 0..1
  720.       return $game_map.under_bridge_passages[pos] > 0
  721.     when 5
  722.       return $game_map.under_bridge_passages[pos] >= 0
  723.     else
  724.       return false
  725.     end
  726.   end
  727.   #--------------------------------------------------------------------------
  728.   # ○ 浮かんでいるか?(乗り物拡張用・魔法の絨毯搭乗時)
  729.   #--------------------------------------------------------------------------  
  730.   def floating?
  731.     return false
  732.   end
  733.   #--------------------------------------------------------------------------
  734.   # ○ 壁タイル拡張通行判定
  735.   #--------------------------------------------------------------------------
  736.   #  x , y を省略すると…
  737.   #    プレイヤーの現在位置(始点)からdirection方向へ通過出来るかどうかを判定。
  738.   #  x , y を代入すると…
  739.   #    その座標(終点)へdirection方向から進入できるかどうかを判定。
  740.   #--------------------------------------------------------------------------
  741.   def ex_passable(direction, x = nil, y = nil, turn_back = nil)
  742.     return true if debug_through?        # デバッグ動作中なら通行可
  743.     return true if @through              # すり抜け中なら通行可
  744.       
  745.     #- 位置情報の準備
  746.     if x == nil
  747.       start_pos = [@x, @y]
  748.       arriv_pos = [$game_map.x_with_direction(@x, direction), $game_map.y_with_direction(@y, direction)]  
  749.     else
  750.       start_pos = [$game_map.x_with_direction(x, 10 - direction), $game_map.y_with_direction(y, 10 - direction)]
  751.       arriv_pos = [x, y]
  752.     end
  753.     start_tile = $game_map.point_tile_id(start_pos[0], start_pos[1])
  754.     arriv_tile = $game_map.point_tile_id(arriv_pos[0], arriv_pos[1])
  755.     start_side_rip = $game_map.rip?(direction, start_pos[0], start_pos[1], floating?)
  756.     arriv_side_rip = $game_map.rip?(10 - direction, arriv_pos[0], arriv_pos[1], floating?)
  757.    
  758.     turn_back = @turn_back if turn_back == nil
  759.    
  760.     #- 階段タイルなら通行可
  761.     unless back_tile?(start_pos) and turn_back
  762.       return true if Data_Tile::STEP.include?(arriv_tile[0])
  763.       return true if Data_Tile::STEP.include?(arriv_tile[2])
  764.       unless $game_map.wall?(arriv_tile[0])
  765.         return true if Data_Tile::STEP.include?(start_tile[0])
  766.         return true if Data_Tile::STEP.include?(start_tile[2])
  767.       end
  768.     end
  769.    
  770.     #- 境目&橋の下の通行判定
  771.     if back_tile?(start_pos) and turn_back               # 始点が裏かつ裏回り中
  772.       return false unless under_bridge_passages(arriv_pos)  # 橋の下の通行判定
  773.       unless back_tile?(arriv_pos)                         # 終点が裏でない
  774.         if start_side_rip                                   # 始点側に境目がある
  775.           if arriv_side_rip                                  # 終点側に境目がある
  776.             return false
  777.           else
  778.             return false if $game_map.wall?(arriv_tile[0])
  779.           end
  780.         else                                              # 始点側に境目がない
  781.           return false
  782.         end
  783.       end
  784.     else                                                  # 始点は裏でない
  785.       unless $game_map.bridge?(arriv_tile[2], direction) or # 橋がなければ
  786.              $game_map.bridge?(start_tile[2], direction)
  787.         if start_side_rip                                  # 始点側に境目がある
  788.           return false
  789.         else                                               # 始点側に境目がない
  790.           if arriv_side_rip                                 # 終点側に境目がある
  791.             if back_tile?(arriv_pos)                         # 終点が裏
  792.               unless $game_map.bridge?(start_tile[2], direction)   # この場が橋でなければ
  793.                 return false unless under_bridge_passages(arriv_pos)  # 橋の下の通行判定
  794.                 turn_back = true
  795.               end
  796.             else                                             # 終点が裏でない
  797.               unless $game_map.bridge?(start_tile[2], direction) # この場が橋でなければ
  798.                 return false
  799.               end
  800.             end
  801.           else                                              # 終点側に境目がない
  802.             return false if $game_map.wall?(arriv_tile[0])
  803.           end
  804.         end
  805.       end
  806.     end
  807.    
  808.     #- 上層の通行判定
  809.     if $game_map.upper_layer?(arriv_tile[0]) and not turn_back
  810.       for i in [2, 1, 0]                        # レイヤーの上から順に調べる
  811.         tile_id = $game_map.ex_data[arriv_pos[0], arriv_pos[1], i] # タイル ID を取得
  812.         unless tile_id == nil
  813.           pass = $game_map.passages[tile_id]    # 通行属性を取得
  814.           next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
  815.           next if pass & 0x01 == 0x00           # [○] : 通行可
  816.           if pass & 0x01 == 0x01                # [×] : 通行不可
  817.             return false
  818.           end
  819.         end
  820.       end
  821.     end  

  822.     return true
  823.   end
  824.   #--------------------------------------------------------------------------
  825.   # ◎ 下に移動
  826.   #     turn_ok : その場での向き変更を許可
  827.   #--------------------------------------------------------------------------
  828.   alias tig_ew_move_down move_down
  829.   def move_down(turn_ok = true)
  830.     unless ex_passable(2)
  831.       turn_down if turn_ok
  832.       @move_failed = true
  833.       check_event_trigger_touch(@x, @y+1)   # 接触イベントの起動判定
  834.       return
  835.     end
  836.     tig_ew_move_down(turn_ok)
  837.   end
  838.   #--------------------------------------------------------------------------
  839.   # ◎ 左に移動
  840.   #     turn_ok : その場での向き変更を許可
  841.   #--------------------------------------------------------------------------
  842.   alias tig_ew_move_left move_left
  843.   def move_left(turn_ok = true)
  844.     unless ex_passable(4)
  845.       turn_left if turn_ok
  846.       @move_failed = true
  847.       check_event_trigger_touch(@x-1, @y)   # 接触イベントの起動判定
  848.       return
  849.     end
  850.     tig_ew_move_left(turn_ok)
  851.   end
  852.   #--------------------------------------------------------------------------
  853.   # ◎ 右に移動
  854.   #     turn_ok : その場での向き変更を許可
  855.   #--------------------------------------------------------------------------
  856.   alias tig_ew_move_right move_right
  857.   def move_right(turn_ok = true)
  858.     unless ex_passable(6)
  859.       turn_right if turn_ok
  860.       check_event_trigger_touch(@x+1, @y)   # 接触イベントの起動判定
  861.       @move_failed = true
  862.       return
  863.     end
  864.     tig_ew_move_right(turn_ok)
  865.   end
  866.   #--------------------------------------------------------------------------
  867.   # ◎ 上に移動
  868.   #     turn_ok : その場での向き変更を許可
  869.   #--------------------------------------------------------------------------
  870.   alias tig_ew_move_up move_up
  871.   def move_up(turn_ok = true)
  872.     unless ex_passable(8)
  873.       turn_up if turn_ok
  874.       check_event_trigger_touch(@x, @y-1)   # 接触イベントの起動判定
  875.       @move_failed = true
  876.       return
  877.     end
  878.     tig_ew_move_up(turn_ok)
  879.   end
  880.   #--------------------------------------------------------------------------
  881.   # ◎ 左下に移動
  882.   #--------------------------------------------------------------------------
  883.   alias tig_ew_move_lower_left move_lower_left
  884.   def move_lower_left
  885.     turn_back1 = $game_map.rip?(8, @x, @y+1) ? true : @turn_back
  886.     turn_back2 = $game_map.rip?(6, @x-1, @y) ? true : @turn_back
  887.     unless passable?(@x, @y+1) and passable?(@x-1, @y) and passable?(@x-1, @y+1) and
  888.            ex_passable(2) and ex_passable(4, @x-1, @y+1, turn_back1) and
  889.            ex_passable(4) and ex_passable(2, @x-1, @y+1, turn_back2)
  890.       if @direction == 2
  891.         if passable?(@x-1, @y) and ex_passable(4)
  892.           move_left
  893.         else
  894.           move_down
  895.         end
  896.       elsif @direction == 4
  897.         if passable?(@x, @y+1) and ex_passable(2)
  898.           move_down
  899.         else
  900.           move_left
  901.         end
  902.       end
  903.       return
  904.     end
  905.     tig_ew_move_lower_left
  906.   end
  907.   #--------------------------------------------------------------------------
  908.   # ◎ 右下に移動
  909.   #--------------------------------------------------------------------------
  910.   alias tig_ew_move_lower_right move_lower_right
  911.   def move_lower_right
  912.     turn_back1 = $game_map.rip?(8, @x, @y+1) ? true : @turn_back
  913.     turn_back2 = $game_map.rip?(4, @x+1, @y) ? true : @turn_back
  914.     unless passable?(@x, @y+1) and passable?(@x+1, @y) and passable?(@x+1, @y+1) and
  915.            ex_passable(2) and ex_passable(6, @x+1, @y+1, turn_back1) and
  916.            ex_passable(6) and ex_passable(2, @x+1, @y+1, turn_back2)
  917.       if @direction == 2
  918.         if passable?(@x-1, @y) and ex_passable(6)
  919.           move_right
  920.         else
  921.           move_down
  922.         end
  923.       elsif @direction == 6
  924.         if passable?(@x, @y+1) and ex_passable(2)
  925.           move_down
  926.         else
  927.           move_right
  928.         end
  929.       end
  930.       return
  931.     end
  932.     tig_ew_move_lower_right
  933.   end
  934.   #--------------------------------------------------------------------------
  935.   # ◎ 左上に移動
  936.   #--------------------------------------------------------------------------
  937.   alias tig_ew_move_upper_left move_upper_left
  938.   def move_upper_left
  939.     turn_back1 = $game_map.rip?(2, @x, @y-1) ? true : @turn_back
  940.     turn_back2 = $game_map.rip?(6, @x-1, @y) ? true : @turn_back
  941.     unless passable?(@x, @y-1) and passable?(@x-1, @y) and passable?(@x-1, @y-1) and
  942.            ex_passable(8) and ex_passable(4, @x-1, @y-1, turn_back1) and
  943.            ex_passable(4) and ex_passable(8, @x-1, @y-1, turn_back2)
  944.       if @direction == 8
  945.         if passable?(@x-1, @y) and ex_passable(4)
  946.           move_left
  947.         else
  948.           move_up
  949.         end
  950.       elsif @direction == 4
  951.         if passable?(@x, @y+1) and ex_passable(8)
  952.           move_up
  953.         else
  954.           move_left
  955.         end
  956.       end
  957.       return
  958.     end
  959.     tig_ew_move_upper_left
  960.   end
  961.   #--------------------------------------------------------------------------
  962.   # ◎ 右上に移動
  963.   #--------------------------------------------------------------------------
  964.   alias tig_ew_move_upper_right move_upper_right
  965.   def move_upper_right
  966.     turn_back1 = $game_map.rip?(2, @x, @y-1) ? true : @turn_back
  967.     turn_back2 = $game_map.rip?(4, @x+1, @y) ? true : @turn_back
  968.     unless passable?(@x, @y-1) and passable?(@x+1, @y) and passable?(@x+1, @y-1) and
  969.            ex_passable(8) and ex_passable(6, @x+1, @y-1, turn_back1) and
  970.            ex_passable(6) and ex_passable(8, @x+1, @y-1, turn_back2)
  971.       if @direction == 8
  972.         if passable?(@x+1, @y) and ex_passable(6)
  973.           move_right
  974.         else
  975.           move_up
  976.         end
  977.       elsif @direction == 6
  978.         if passable?(@x, @y-1) and ex_passable(8)
  979.           move_up
  980.         else
  981.           move_right
  982.         end
  983.       end
  984.       return
  985.     end
  986.     tig_ew_move_upper_right
  987.   end
  988.   #--------------------------------------------------------------------------
  989.   # ● キャラクター衝突判定
  990.   #     x : X 座標
  991.   #     y : Y 座標
  992.   #    プレイヤーと乗り物を含め、通常キャラの衝突を検出する。
  993.   #--------------------------------------------------------------------------
  994.   def collide_with_characters?(x, y)
  995.     for event in $game_map.events_xy(x, y)          # イベントの座標と一致
  996.       next unless parallel?(event)                  ##### 追加部分 (この行) #####
  997.       unless event.through                          # すり抜け OFF?
  998.         return true if self.is_a?(Game_Event)       # 自分がイベント
  999.         return true if event.priority_type == 1     # 相手が通常キャラ
  1000.       end
  1001.     end
  1002.     if @priority_type == 1                          # 自分が通常キャラ
  1003.       if parallel?($game_player)                   ##### 追加部分 (この行) #####
  1004.         return true if $game_player.pos_nt?(x, y)  # プレイヤーの座標と一致
  1005.       end                                          ##### 追加部分 (この行) #####
  1006.       return true if $game_map.boat.pos_nt?(x, y)   # 小型船の座標と一致
  1007.       return true if $game_map.ship.pos_nt?(x, y)   # 大型船の座標と一致
  1008.     end
  1009.     return false
  1010.   end
  1011.   #--------------------------------------------------------------------------
  1012.   # ○ キャラクターの同軸存在判定
  1013.   #--------------------------------------------------------------------------
  1014.   def parallel?(character)
  1015.     direction = search_direction(@x, @y, character.x, character.y)
  1016.     turn_back = @turn_back
  1017.     character_turn_back = character.turn_back
  1018.     if direction != 5
  1019.       if direction % 2 == 0
  1020.         if $game_map.rip?(10 - direction, character.x, character.y)
  1021.           turn_back = true
  1022.         end
  1023.       else
  1024.         if diagonal_move_turn_back(direction, character.x, character.y)
  1025.           turn_back = true
  1026.         end
  1027.       end
  1028.       if direction % 2 == 0
  1029.         if $game_map.rip?(direction, @x, @y)
  1030.           character_turn_back = true
  1031.         end
  1032.       else
  1033.         if diagonal_move_turn_back(10 - direction, @x, @y)
  1034.           character_turn_back = true
  1035.         end
  1036.       end
  1037.       tile_id = $game_map.data[character.x, character.y, 0]
  1038.       if $game_map.wall?(tile_id)
  1039.         return true unless ex_passable(direction)
  1040.       end
  1041.     end
  1042.    
  1043.     return turn_back == character_turn_back
  1044.   end
  1045. end

复制代码
  1. #==============================================================================
  2. # ■ Game_Event
  3. #------------------------------------------------------------------------------
  4. #  イベントを扱うクラスです。条件判定によるイベントページ切り替えや、並列処理
  5. # イベント実行などの機能を持っており、Game_Map クラスの内部で使用されます。
  6. #==============================================================================

  7. class Game_Event < Game_Character
  8.   #--------------------------------------------------------------------------
  9.   # ◎ オブジェクト初期化
  10.   #     map_id : マップ ID
  11.   #     event  : イベント (RPG::Event)
  12.   #--------------------------------------------------------------------------
  13.   alias tig_ew_event_initialize initialize
  14.   def initialize(map_id, event)
  15.     tig_ew_event_initialize(map_id, event)
  16.     set_turn_back_setting
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ○ イベントの初期配置位置取得(裏配置)
  20.   #--------------------------------------------------------------------------  
  21.   def set_turn_back_setting
  22.     @event.name = @event.name.sub(/[\<<]裏配置[\>>]/, "")
  23.     @turn_back = $& != nil
  24.     @on_tile = $& == nil
  25.     @event.name = @event.name.sub(/[\<<]裏透過禁止[\>>]/, "")
  26.     @not_back_seeing = $& != nil
  27.   end
  28.   #--------------------------------------------------------------------------
  29.   # ● 接触イベントの起動判定
  30.   #--------------------------------------------------------------------------
  31.   def check_event_trigger_touch(x, y)
  32.     return if $game_map.interpreter.running?
  33.     if @trigger == 2 and $game_player.pos?(x, y)
  34.       if @character_name != ""                     #### 追加部分 (ここから) ####
  35.         return unless $game_player.parallel?(self)              
  36.       end                                          #### 追加部分 (ここまで) ####
  37.       start if not jumping? and @priority_type == 1
  38.     end
  39.   end
  40. end

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

  47. class Game_Vehicle < Game_Character
  48.   #--------------------------------------------------------------------------
  49.   # ○ タイル表示(on_tile)状態取得
  50.   #--------------------------------------------------------------------------
  51.   def on_tile
  52.     if @driving or @altitude > 0
  53.       return $game_player.on_tile
  54.     else
  55.       return false
  56.     end
  57.   end
  58.   #--------------------------------------------------------------------------
  59.   # ◎ プレイヤーとの同期
  60.   #--------------------------------------------------------------------------
  61.   alias tig_ew_sync_with_player sync_with_player
  62.   def sync_with_player
  63.     tig_ew_sync_with_player
  64.     update_turn_back
  65.   end  
  66. end

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

  73. class Game_Player < Game_Character
  74.   #--------------------------------------------------------------------------
  75.   # ○ 公開インスタンス変数
  76.   #--------------------------------------------------------------------------
  77.   attr_accessor :game_map_data
  78.   attr_accessor :reserve_load_map_id
  79.   #--------------------------------------------------------------------------
  80.   # ◎ オブジェクト初期化
  81.   #     map_id : マップ ID
  82.   #     event  : イベント (RPG::Event)
  83.   #--------------------------------------------------------------------------
  84.   alias tig_ew_pl_initialize initialize
  85.   def initialize
  86.     tig_ew_pl_initialize
  87.     @reserve_load_map_id = []
  88.     @game_map_data = {}
  89.   end
  90.   #--------------------------------------------------------------------------
  91.   # ○ マップデータの先読み
  92.   #--------------------------------------------------------------------------
  93.   def beforehand_load(map_id = @reserve_load_map_id)
  94.     for i in map_id
  95.       next if @game_map_data.key?(i)
  96.       map_data = Game_Map.new
  97.       map_data.setup(i)
  98.       @game_map_data[i] = map_data
  99.     end
  100.     for i in @game_map_data.keys.clone
  101.       unless map_id.include?(i)
  102.         @game_map_data.delete(i)
  103.       end
  104.     end
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ◎ 場所移動の実行
  108.   #--------------------------------------------------------------------------
  109.   alias tig_ew_perform_transfer perform_transfer
  110.   def perform_transfer
  111.     return unless @transferring
  112.     unless $game_player.reserve_load_map_id.empty?
  113.       $game_player.beforehand_load
  114.     end
  115.     tig_ew_perform_transfer
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # ○ 浮かんでいるか?(乗り物拡張用・魔法の絨毯搭乗時)
  119.   #--------------------------------------------------------------------------  
  120.   def floating?
  121.     return @vehicle_type == 5
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● 同位置のイベント起動判定
  125.   #     triggers : トリガーの配列
  126.   #--------------------------------------------------------------------------
  127.   def check_event_trigger_here(triggers)
  128.     return false if $game_map.interpreter.running?
  129.     result = false
  130.     for event in $game_map.events_xy(@x, @y)
  131.       next unless parallel?(event)                 ##### 追加部分 (この行) #####
  132.       if triggers.include?(event.trigger) and event.priority_type != 1
  133.         event.start
  134.         result = true if event.starting
  135.       end
  136.     end
  137.     return result
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ● 正面のイベント起動判定
  141.   #     triggers : トリガーの配列
  142.   #--------------------------------------------------------------------------
  143.   def check_event_trigger_there(triggers)
  144.     return false if $game_map.interpreter.running?
  145.     result = false
  146.     front_x = $game_map.x_with_direction(@x, @direction)
  147.     front_y = $game_map.y_with_direction(@y, @direction)
  148.     for event in $game_map.events_xy(front_x, front_y)
  149.       next unless parallel?(event)                 ##### 追加部分 (この行) #####
  150.       if triggers.include?(event.trigger) and event.priority_type == 1
  151.         event.start
  152.         result = true
  153.       end
  154.     end
  155.     if result == false and $game_map.counter?(front_x, front_y)
  156.       front_x = $game_map.x_with_direction(front_x, @direction)
  157.       front_y = $game_map.y_with_direction(front_y, @direction)
  158.       for event in $game_map.events_xy(front_x, front_y)
  159.         next unless parallel?(event)               ##### 追加部分 (この行) #####
  160.         if triggers.include?(event.trigger) and event.priority_type == 1
  161.           event.start
  162.           result = true
  163.         end
  164.       end
  165.     end
  166.     return result
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ● 接触イベントの起動判定
  170.   #     x : X 座標
  171.   #     y : Y 座標
  172.   #--------------------------------------------------------------------------
  173.   def check_event_trigger_touch(x, y)
  174.     return false if $game_map.interpreter.running?
  175.     result = false
  176.     for event in $game_map.events_xy(x, y)
  177.       if event.character_name != ""                #### 追加部分 (ここから) ####
  178.         next unless parallel?(event)              
  179.       end                                          #### 追加部分 (ここまで) ####
  180.       if [1,2].include?(event.trigger) and event.priority_type == 1
  181.         event.start
  182.         result = true
  183.       end
  184.     end
  185.     return result
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # ◎ 乗り物から降りる
  189.   #    現在乗り物に乗っていることが前提。
  190.   #--------------------------------------------------------------------------
  191.   alias tig_ew_get_off_vehicle get_off_vehicle
  192.   def get_off_vehicle
  193.     return if $game_map.back_tile?(@x, @y)
  194.     if @vehicle_type == 0 or @vehicle_type == 1
  195.       front_x = $game_map.x_with_direction(@x, @direction)
  196.       front_y = $game_map.y_with_direction(@y, @direction)
  197.       return if $game_map.wall?($game_map.point_tile_id(front_x, front_y)[0])
  198.       return if $game_map.under_bridge_passages[[front_x, front_y]] == 1
  199.       return if $game_map.prohibited_get_off.include?([front_x, front_y])
  200.       @no_turn_back = true
  201.     end
  202.     tig_ew_get_off_vehicle
  203.   end
  204. end

  205. #==============================================================================
  206. # ■ Spriteset_Map
  207. #------------------------------------------------------------------------------
  208. #  マップ画面のスプライトやタイルマップなどをまとめたクラスです。このクラスは
  209. # Scene_Map クラスの内部で使用されます。
  210. #==============================================================================

  211. class Spriteset_Map
  212.   #--------------------------------------------------------------------------
  213.   # ◎ ビューポートの作成
  214.   #--------------------------------------------------------------------------
  215.   alias tig_ew_create_viewports create_viewports
  216.   def create_viewports
  217.     tig_ew_create_viewports
  218.     @viewport4 = Viewport.new(0, 0, 544, 416) # 追加レイヤー用ビューポート
  219.     if Expansion_Passable::BACK_SEEING
  220.       @viewport5 = Viewport.new(0, 0, 544, 416) # 裏回りキャラ透過用ビューポート
  221.     end
  222.     if @viewport6 == nil
  223.       @viewport6 = Viewport.new(0, 0, 544, 416) # 色調変更用ビューポート
  224.       @viewport6.z = 25
  225.     end
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # ◎ タイルマップの作成
  229.   #--------------------------------------------------------------------------
  230.   alias tig_ew_create_tilemap create_tilemap
  231.   def create_tilemap
  232.     tig_ew_create_tilemap
  233.     setup_shadow_eraser_tilemap
  234.     @ex_tilemap = Tilemap.new(@viewport4)
  235.     @ex_tilemap.bitmaps[0] = Cache.system("TileA1")
  236.     @ex_tilemap.bitmaps[1] = Cache.system("TileA2")
  237.     @ex_tilemap.bitmaps[2] = Cache.system("TileA3")
  238.     @ex_tilemap.bitmaps[3] = Cache.system("TileA4")
  239.     @ex_tilemap.bitmaps[4] = Cache.system("TileA5")
  240.     @ex_tilemap.bitmaps[5] = Cache.system("TileB")
  241.     @ex_tilemap.bitmaps[6] = Cache.system("TileC")
  242.     @ex_tilemap.bitmaps[7] = Cache.system("TileD")
  243.     @ex_tilemap.bitmaps[8] = Cache.system("TileE")
  244.     @ex_tilemap.map_data = $game_map.ex_data
  245.     @ex_tilemap.passages = $game_map.passages
  246.   end
  247.   #--------------------------------------------------------------------------
  248.   # ○ 影消し処理用タイルの準備
  249.   #--------------------------------------------------------------------------
  250.   def setup_shadow_eraser_tilemap
  251.     for i in 1952...2048
  252.       @tilemap.passages[i] = 0x00
  253.     end
  254.   end
  255.   #--------------------------------------------------------------------------
  256.   # ◎ 飛行船の影スプライトの作成
  257.   #--------------------------------------------------------------------------
  258.   alias tig_ew_create_shadow create_shadow
  259.   def create_shadow
  260.     tig_ew_create_shadow
  261.     @shadow_sprite.viewport = @viewport4
  262.   end
  263.   #--------------------------------------------------------------------------
  264.   # ◎ タイルマップの解放
  265.   #--------------------------------------------------------------------------
  266.   alias tig_ew_dispose_tilemap dispose_tilemap
  267.   def dispose_tilemap
  268.     tig_ew_dispose_tilemap
  269.     @ex_tilemap.dispose
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # ◎ ビューポートの解放
  273.   #--------------------------------------------------------------------------
  274.   alias tig_ew_dispose_viewports dispose_viewports
  275.   def dispose_viewports
  276.     tig_ew_dispose_viewports
  277.     @viewport4.dispose
  278.     @viewport5.dispose if Expansion_Passable::BACK_SEEING
  279.     @viewport6.dispose if @viewport6 != nil
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ◎ タイルマップの更新
  283.   #--------------------------------------------------------------------------
  284.   alias tig_ew_update_tilemap update_tilemap
  285.   def update_tilemap
  286.     tig_ew_update_tilemap
  287.     @ex_tilemap.ox = $game_map.display_x / 8
  288.     @ex_tilemap.oy = $game_map.display_y / 8
  289.     @ex_tilemap.update
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ◎ キャラクタースプライトの更新
  293.   #--------------------------------------------------------------------------
  294.   alias tig_ew_update_characters update_characters
  295.   def update_characters
  296.     back_seeing_characters = []
  297.     for sprite in @character_sprites
  298.       if sprite.character.on_tile or sprite.character.priority_type == 2
  299.         sprite.viewport = @viewport4
  300.       else
  301.         sprite.viewport = @viewport1
  302.       end
  303.       next if sprite.character.not_back_seeing
  304.       if $game_player.turn_back and Expansion_Passable::BACK_SEEING
  305.         x = $game_player.x ; y = $game_player.y
  306.         if ($game_map.round_x(x-2)..$game_map.round_x(x+2)).include?(sprite.character.x) and
  307.           ($game_map.round_y(y-2)..$game_map.round_y(y+2)).include?(sprite.character.y)
  308.           back_seeing_characters.push(sprite.character)
  309.         end
  310.       end
  311.     end
  312.     back_seeing(back_seeing_characters)
  313.    
  314.     tig_ew_update_characters
  315.   end
  316.   #--------------------------------------------------------------------------
  317.   # ○ 裏回りキャラ透過
  318.   #--------------------------------------------------------------------------  
  319.   def back_seeing(characters)
  320.     return unless Expansion_Passable::BACK_SEEING
  321.     @back_seeing_sprites = [] if @back_seeing_sprites == nil
  322.     @characters = [] if @characters == nil
  323.     now_character = []
  324.     for character in characters
  325.       now_character.push(character)
  326.       unless @characters.include?(character)
  327.         new_sprite = Sprite_Character.new(@viewport5, character)
  328.         new_sprite.back_seeing = true
  329.         @back_seeing_sprites.push(new_sprite)
  330.         @characters.push(new_sprite.character)
  331.       end
  332.     end
  333.    
  334.     for sprite in @back_seeing_sprites
  335.       if now_character.include?(sprite.character)
  336.         sprite.update
  337.       else
  338.         @characters.delete(sprite.character)
  339.         sprite.dispose
  340.         @back_seeing_sprites.delete(sprite)
  341.       end
  342.     end
  343.   end
  344.   #--------------------------------------------------------------------------
  345.   # ◎ フレーム更新
  346.   #--------------------------------------------------------------------------
  347.   alias tig_ew_update update
  348.   def update
  349.     tig_ew_update
  350.     update_ew_ex_viewports
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● ビューポートの更新
  354.   #--------------------------------------------------------------------------
  355.   def update_viewports
  356.     @viewport6.tone = $game_map.screen.tone        ##### 修正部分 (この行) #####
  357.    
  358.     @viewport1.ox = $game_map.screen.shake
  359.     @viewport2.color = $game_map.screen.flash_color
  360.     @viewport3.color.set(0, 0, 0, 255 - $game_map.screen.brightness)
  361.     @viewport1.update
  362.     @viewport2.update
  363.     @viewport3.update
  364.    
  365.     @viewport6.update                              ##### 追加部分 (この行) #####
  366.   end
  367.   #--------------------------------------------------------------------------
  368.   # ○ 拡張ビューポートの更新
  369.   #--------------------------------------------------------------------------
  370.   def update_ew_ex_viewports
  371.     @viewport4.ox = $game_map.screen.shake
  372.     @viewport4.update
  373.     if Expansion_Passable::BACK_SEEING
  374.       @viewport5.rect.set($game_player.screen_x - 48, $game_player.screen_y - 64, 96, 96)
  375.       @viewport5.ox = $game_map.screen.shake
  376.       @viewport5.update
  377.     end      
  378.   end
  379. end

  380. #==============================================================================
  381. # ■ Sprite_Character
  382. #------------------------------------------------------------------------------
  383. #  キャラクター表示用のスプライトです。Game_Character クラスのインスタンスを
  384. # 監視し、スプライトの状態を自動的に変化させます。
  385. #==============================================================================

  386. class Sprite_Character < Sprite_Base
  387.   #--------------------------------------------------------------------------
  388.   # ○ 公開インスタンス変数
  389.   #--------------------------------------------------------------------------
  390.   attr_accessor :back_seeing
  391.   #--------------------------------------------------------------------------
  392.   # ◎ オブジェクト初期化
  393.   #     viewport  : ビューポート
  394.   #     character : キャラクター (Game_Character)
  395.   #--------------------------------------------------------------------------
  396.   alias tig_ew_initialize initialize
  397.   def initialize(viewport, character = nil)
  398.     tig_ew_initialize(viewport, character)
  399.     @back_seeing = false
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ◎ フレーム更新
  403.   #--------------------------------------------------------------------------
  404.   alias tig_ew_update update
  405.   def update
  406.     tig_ew_update
  407.     if @back_seeing
  408.       self.opacity = 100 if self.opacity > 100
  409.       self.x -= $game_player.screen_x - 48
  410.       self.y -= $game_player.screen_y - 64
  411.     end
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ◎ フキダシアイコン表示の開始
  415.   #--------------------------------------------------------------------------
  416.   alias tig_ew_start_balloon start_balloon
  417.   def start_balloon
  418.     tig_ew_start_balloon
  419.     @balloon_sprite.viewport = @viewport4
  420.   end
  421. end

  422. #==============================================================================
  423. # ■ Scene_Title
  424. #------------------------------------------------------------------------------
  425. #  タイトル画面の処理を行うクラスです。
  426. #==============================================================================

  427. class Scene_Title < Scene_Base
  428.   #--------------------------------------------------------------------------
  429.   # ◎ 開始処理
  430.   #--------------------------------------------------------------------------
  431.   alias tig_ew_start start
  432.   def start
  433.     tig_ew_start
  434.     $game_map.create_ex_passages
  435.   end
  436.   #--------------------------------------------------------------------------
  437.   # ◎ データベースのロード
  438.   #    name から<船の橋下通過>の設定を得ます。
  439.   #--------------------------------------------------------------------------
  440.   alias tig_ew_load_database load_database
  441.   def load_database
  442.     tig_ew_load_database
  443.     for area in $data_areas.values
  444.       area.name = area.name.sub(/[\<<]架け橋[\>>]/, "") # 名前の修正と
  445.       area.ship_pass = $& != nil                    # 船の橋下通過エリアの設定
  446.       area.name = area.name.sub(/[\<<]処理無視[\>>]/, "") # 名前の修正と
  447.       area.disregard_processing = $& != nil         # 処理無視エリアの設定
  448.     end
  449.   end
  450. end
复制代码
这个脚本里嘛,不是要填图块的嘛,所以说…………
因为我用的不是默认的图块,
所以怎么数= =
怎么有些4位数……3位数……2位数……具体都是怎么数的= =
PS:不够的话我再加经验,VIP也行= =

点评

而且要复制也困难的多= =!,刚才要测试发现出错,结果是少复制到一段...  发表于 2011-8-13 12:24
请注意不要直接贴出来(因为脚本里明确写有“※二次配布禁止!配布元には利用規約があります。必ずそちらを見てください。”)转载是禁止的  发表于 2011-8-13 10:41
小艾工作室开张= =
回复

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

7
发表于 2011-8-13 06:36:58 | 只看该作者
在那個腳本裡面就有獲取圖塊ID的方法
使用方法與我之前貼的腳本一樣
  1. class Scene_Map < Scene_Base
  2.   alias get_map_id_update update
  3.   def update
  4.     get_map_id_update
  5.     if Input.trigger?(Input::Z)
  6.       p $game_map.point_tile_id($game_player.x, $game_player.y)
  7.     end
  8.   end
  9. end
复制代码

点评

我想知道的是那个4位数怎么回事= = 这个只有1-256啊= = 要不直接告诉我这个脚本怎么用也行= =  发表于 2011-8-13 07:15
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复

使用道具 举报

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1697
在线时间
3038 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

8
发表于 2011-8-13 10:43:53 | 只看该作者
最近我也在找VX的tile_id的获取方法(因为我在做小地图)
回复

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

9
发表于 2011-8-13 12:23:03 | 只看该作者
本帖最后由 雪流星 于 2011-8-13 08:00 编辑

那些四位数的ID是包含了自动元件所会产生的各种样式。
普通的自动元件包含了48种样式,会动的(如河流、海洋)则包含48*3祯=144种样式
每一种样式对应一个ID,所以会有4位数的ID


雪流星于2011-8-13 07:50补充以下内容:
你不用数阿,你先在工程里面插入上面那个脚本,然後新建一个地图,在地图上画出你要算的图块,把主角设定出现在那张地图中,进入游戏,把主角移动到那个图块上,再按下A键,就会自动帮你算出来了。
你以为脚本作者也是一个一个算的吗?

点评

这样数起来不是很麻烦吗= =||  发表于 2011-8-13 18:36
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-12 11:09

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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