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

Project1

 找回密码
 注册会员
搜索
查看: 5395|回复: 9

[RMVX发布] VX图块扩充 简易方法

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
44 小时
注册时间
2013-5-25
帖子
91
发表于 2013-6-21 23:14:39 | 显示全部楼层 |阅读模式

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

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

x
真正有效的脚本内容很短呢。
由于脚本内已经够啰嗦了,这里也没什么好说的了……。
看脚本吧。上图。

M1.png
  1. #==================================================================
  2. #  ● VX图块扩充 -BY 长奁
  3. #------------------------------------------------------------------
  4. #
  5. #  ○ 前言/ 介绍:
  6. #
  7. #  是否觉得VX的图块太吝啬,在风格多变的大工程中根本不够用呢?
  8. #  可以通过此脚本,在不同的地图使用不同的素材哦。
  9. #  再怎么丰富的内容,一张地图,一组图块素材,也该够用了。
  10. #
  11. #------------------------------------------------------------------
  12. #
  13. #  本是基于自己需求所写,不过好VX图块少这一点被大家广为诟病,
  14. #  就发上来同大家分享了。有些粗糙,而且可能不够精简,请见谅。
  15. #
  16. #==================================================================
  17. #
  18. #  ● 使用方法:
  19. #
  20. #      - 素材:在图块名称内加入"Mx",其中x代表其组别编号。放在System文件夹下。
  21. #      - 地图:在地图名字中加入"Mx",其中x代表使用第几组图块。
  22. #
  23. #              P.S.地图名字中无此标识时,使用默认图块(RTP原名称)。
  24. #
  25. #  ○ 其他说明:
  26. #
  27. #  由于"Mx"无论放在什么位置,脚本都可生效,
  28. #  故使用显示地图名脚本的朋友可以在地图名后加入长串空格,再打上标识,
  29. #  这样标识可以不被显示出来。
  30. #
  31. #------------------------------------------------------------------
  32. #  
  33. #  ● 设定部分:
  34. #
  35. #  在下方的设置之中可以设定共有几组图块素材。
  36. #
  37. #==================================================================

  38. module Map_Amount
  39.   MAP_AMOUNT = 3   # 设定共有几组图块。
  40. end

  41. #==================================================================

  42. class Game_Map
  43.   attr_reader   :map_id  
  44.   def mapname
  45.     $mapname = load_data("Data/MapInfos.rvdata")
  46.     $mapname[@map_id].name
  47.   end
  48. end
  49. class Spriteset_Map
  50.   def create_tilemap
  51.     @tilemap = Tilemap.new(@viewport1)
  52.     @tilemap.bitmaps[0] = Cache.system("TileA1")
  53.     @tilemap.bitmaps[1] = Cache.system("TileA2")
  54.     @tilemap.bitmaps[2] = Cache.system("TileA3")
  55.     @tilemap.bitmaps[3] = Cache.system("TileA4")
  56.     @tilemap.bitmaps[4] = Cache.system("TileA5")
  57.     @tilemap.bitmaps[5] = Cache.system("TileB")
  58.     @tilemap.bitmaps[6] = Cache.system("TileC")
  59.     @tilemap.bitmaps[7] = Cache.system("TileD")
  60.     @tilemap.bitmaps[8] = Cache.system("TileE")
  61.     for i in 0..(Map_Amount::MAP_AMOUNT - 1)
  62.       if $game_map.mapname.to_s.include? "M#{i+1}"
  63.         @tilemap.bitmaps[0] = Cache.system("M#{i+1}TileA1")
  64.         @tilemap.bitmaps[1] = Cache.system("M#{i+1}TileA2")
  65.         @tilemap.bitmaps[2] = Cache.system("M#{i+1}TileA3")
  66.         @tilemap.bitmaps[3] = Cache.system("M#{i+1}TileA4")
  67.         @tilemap.bitmaps[4] = Cache.system("M#{i+1}TileA5")
  68.         @tilemap.bitmaps[5] = Cache.system("M#{i+1}TileB")
  69.         @tilemap.bitmaps[6] = Cache.system("M#{i+1}TileC")
  70.         @tilemap.bitmaps[7] = Cache.system("M#{i+1}TileD")
  71.         @tilemap.bitmaps[8] = Cache.system("M#{i+1}TileE")
  72.       end
  73.     end
  74.     @tilemap.map_data = $game_map.data
  75.     @tilemap.passages = $game_map.passages
  76.   end
  77. end
复制代码
就先不做范例了。
可能有表述不清的地方…不懂可以问我。
请各位前辈多指教。

评分

参与人数 2星屑 +19 收起 理由
我爱吴悦淇 + 7 我很赞同
yangjunyin2002 + 12 认可答案

查看全部评分

Lv1.梦旅人

梦石
0
星屑
50
在线时间
38 小时
注册时间
2013-4-11
帖子
5
发表于 2013-6-22 20:53:30 | 显示全部楼层
挺实用的……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
4 小时
注册时间
2013-6-22
帖子
18
发表于 2013-6-22 22:06:01 | 显示全部楼层
{:2_282:}  不错
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
256 小时
注册时间
2013-5-27
帖子
196
发表于 2013-6-26 03:03:01 | 显示全部楼层
请问,通行度问题怎么解决。

点评

QAQ果然忘记考虑了什么东西…感谢您提出问题!考完试一有空就改改。应当不困难。  发表于 2013-6-26 21:33
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
185
在线时间
834 小时
注册时间
2012-9-16
帖子
1810
发表于 2013-6-29 14:08:46 | 显示全部楼层
纳尼?!通行度的问题如何解决?

——旧坑欢迎戳
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
185
在线时间
834 小时
注册时间
2012-9-16
帖子
1810
发表于 2013-6-30 15:14:54 | 显示全部楼层
本帖最后由 yangjunyin2002 于 2013-6-30 15:54 编辑

@长奁 加个好友吧~另外我建议通行问题这样:
就是让你在system文件夹中加个txt文件,文件名就单纯的MX(X就是对应的图块组号),然后里面按TileA1到TileE的顺序(一行一行左到右的顺序)写。(1代表X,2代表O,3代表☆)
这样子写好数字保存。



发现问题!此脚本和Wall Tile Extension脚本( http://anonymouscreations.we.bs )不兼容?!

——旧坑欢迎戳
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
550
在线时间
1286 小时
注册时间
2011-6-14
帖子
4086
发表于 2013-6-30 15:45:14 | 显示全部楼层
打空格后Mx不显示出来是不对的,这样只能控制编辑器内不显示,而实际游戏中由于draw_text会把超出的文本压缩显示,因此仍然会显示出来,有必要考虑获取地名时不给出Mx。

点评

乳此肾好!  发表于 2013-7-5 21:10
我那个地名显示脚本正好如果你在地图名后面加个#(可以设置成其他符号),#后面的东西都不会显示。  发表于 2013-6-30 18:32
咦我在说什么!QAQ……这是VX脚本………不好意思今天我脑抽了……考试综合症…………Orz,期末考完一定把这脚本给完善了。  发表于 2013-6-30 18:12
咦……VA居然没有这个功能嘛…不好意思我用惯VX了…Orz。VX描绘文字倒是可以选择是超出的继续描绘或者压缩呢…………Orz,多谢提出,有时间改改。  发表于 2013-6-30 18:11
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
44 小时
注册时间
2013-5-25
帖子
91
 楼主| 发表于 2013-6-30 18:14:22 | 显示全部楼层
yangjunyin2002 发表于 2013-6-30 15:14
@长奁 加个好友吧~另外我建议通行问题这样:
就是让你在system文件夹中加个txt文件,文件名就单纯的MX(X就 ...

谢谢您的提议,有时间我一定看看。可惜现在快考试了。关于通行度我个人的看法是新建工程,在新工程里用新图块,然后设定通行度,在data文件夹里,然后可以把它复制过来名字加MX。
这样的话地图也可以直接在新工程里绘制了,还直观方便,到时候直接把整张地图复制过来就好了。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
185
在线时间
834 小时
注册时间
2012-9-16
帖子
1810
发表于 2013-6-30 18:25:39 | 显示全部楼层
本帖最后由 yangjunyin2002 于 2013-6-30 18:28 编辑
长奁 发表于 2013-6-30 18:14
谢谢您的提议,有时间我一定看看。可惜现在快考试了。关于通行度我个人的看法是新建工程,在新工程里用新 ...


恩,不过通行度有DATA文件的吗?顺便加我QQ吧:1337253857
另外,话说我后天也要期末考了。。。
@长奁 对了,你那个脚本和下面这个特殊通行脚本冲突。
360软件小助手截图20130630182804.jpg
  1. #============================================================================
  2. #
  3. # ** Wall Tile Extension * Ver1.00 
  4. # * Creator: 月紳士 (Moon Man)     ( http://tsukishinshi.blog73.fc2.com )
  5. #
  6. # * RPG Maker VX RGSS2 Script
  7. #
  8. # * Translation by: Mr. Anonymous ( http://anonymouscreations.we.bs )
  9. #
  10. #============================================================================
  11. =begin

  12. This script chiefly enhances the movement judgment and enables the following
  13. expressions for the wall tiles.

  14. .Basic Features
  15.   The following functions work by using this script:

  16.  * Enables movement behind walls and atop roofs.

  17.  * Reproduction of the XP ceiling conceal, which makes designated tiles conceal
  18.   characters like they did in XP.
  19.   
  20. * Creates "invisible passage" so you can make secret passages or movement under
  21.   fake bridges.

  22.  * Added passability options.

  23.  * A function to create ladders/stairs which penetrate normally impassible tiles.

  24.  * Bridges automatically act as such, having you walk on and under them, at the
  25.   same time if events do it, with no events to control it.

  26. #------------------------------------------------------------------------------

  27. * Tags

  28.  * Bridge Passage Area
  29.     When you need to create a bridge in which the player can move under when in
  30.     a vehicle, first create a new area that contains said bridge, and name the
  31.     area:
  32.             <bridge>

  33.  * Event Behind Roof/Ceiling/Wall/Cliff
  34.     When you need to create an event that rests behind a roof, cieling, wall,
  35.     cliff, etc, (if BACK_SEEING = true, when the player is 1 tile away from this
  36.     event it will also be shown as semi-transparent) create an event and include
  37.     the follow tag in its name:

  38.             <behind>

  39.  * Event Behind Roof/Ceiling/Wall/Cliff (when BACK_SEEING = true)
  40.     When you need to create an event that rests behind a roof, cieling, wall,
  41.     cliff, etc, and is NOT shown as semi-transparent while near it, create an
  42.     event and include the follow tag in its name:

  43.             <hidebehind>

  44. =end

  45. #==============================================================================
  46. # * Customization
  47. #==============================================================================

  48. module Expansion_Passable
  49.   # * Cliff Type Maps
  50.   # In the following array, you may define what maps determined as "Cliff" maps.
  51.   # These allow for recognition of certain tiles to function differently. This
  52.   # is used to create a slope-like effect (different grass tile elevations)
  53.   # for some tiles without making it global across all maps. It's best to test
  54.   # this function out for yourself by testing it in the demo, then remove the
  55.   # 5 (by default) from the array and try it again.
  56.   # Note that since this is an array, it can contain multiple map IDs as such:
  57.   # CLIFF_MAP = [5, 6, 7, 12, 30]
  58.   CLIFF_MAP = [18]
  59.   
  60.   # * True wall depth
  61.   # This allows you to specify whether the player can move down the full depth
  62.   # of the wall or only the first tile. For example, if set as true, and a wall
  63.   # is 3 tiles high + 1 tile for ceiling/roofing, then the player will be able
  64.   # to move all the way down to the base of the wall (down three tiles).
  65.   # It's easier just to test it both ways to understand.
  66.   # true  : Wall depth and player moveability range is increased to wall scale.
  67.   # false : Wall depth and player moveability is fixed at 1 tile.
  68.   BACK_TILE_DEEP = false
  69.   
  70.   # * Display of character behind cieling tiles
  71.   # This allows you to adjust whether the character is visible (semi-transparent)
  72.   # or not displayed at all when the character is behind a roof/ceiling tile.
  73.   # true  : Characters are draw semi-transparent
  74.   # false : Characters are hidden
  75.   BACK_SEEING = true
  76.   
  77.   # * Remove Shadow Tiles ID
  78.   # The "No Shadow" tile indicates a tile that removes and autoshadow tile that
  79.   # would normally be displayed on it. It is used for removing any awkward look
  80.   # that would normally  be produced by creating special hills or cliffs.
  81.   # When not using this feature, set the value as nil.
  82.   SHADOW_ERASER_TILE_ID = 768
  83.   
  84.   # * Prohibit Docking Tile ID
  85.   # The "No Docking" tile indicates a tile that does not allow for a vehicle to
  86.   # 'dock' at. It is used to determine features such as cliffs that the player
  87.   # should not be allowed to dock on, given it would have raised elevation.
  88.   # When not using this feature, set the value as nil.
  89.   PROHIBITED_GET_OFF_TILE_ID = 769

  90.   # * Walk Through Wall Tile ID
  91.   # The "Walk Through" tile indicates a tile that allows the player to walk
  92.   # through it, used specifically for segements where you allow the player to
  93.   # walk through a given wall.
  94.   # When not using this feature, set the value as nil.
  95.   ADDITION_BACK_TILE_ID = 770

  96.   # * Delete Background Tile ID
  97.   # The "No Background" tile indicates a tile that deletes the tile behind it.
  98.   # It is primarily used for determining roof/cieling tiles with the player
  99.   # cannot walk behind.
  100.   # When not using this feature, set the value as nil.
  101.   DELETE_BACK_TILE_ID = 771
  102.   REMOVE_TILE_MARKER = 783
  103.   
  104. end

  105. #==============================================================================
  106. # * Tile customization options (very advanced users only!)
  107. #==============================================================================

  108. module Data_Tile
  109.   # Ceiling, roof, & terrain tile feature setup
  110.   FUNCTION_TILE = [
  111.    2816, 2960,                                     # Plains (field and outdoor)
  112.    3200, 3344,                                     # Dry    (field and outdoor)
  113.    3584, 3728,                                     # Desert (field and outdoor)
  114.    3968, 4016,                                     # Snow   (field and outdoor)
  115.    4352, 4400, 4448, 4496, 4544, 4592, 4640, 4688, # Roof         (1st Column)
  116.    4736, 4784, 4832, 4880, 4928, 4976, 5024, 5072, # Wall         (1st Column)               
  117.    5120, 5168, 5216, 5264, 5312, 5360, 5408, 5456, # Roof         (2nd Column)
  118.    5504, 5552, 5600, 5648, 5696, 5744, 5792, 5840, # Wall         (2nd Column)     
  119.    5888, 5936, 5984, 6032, 6080, 6128, 6176, 6224, # Cave Ceiling (1st Column)
  120.    6272, 6320, 6368, 6416, 6464, 6512, 6560, 6608, # Cave Wall    (1st Column)
  121.    6656, 6704, 6752, 6800, 6848, 6896, 6944, 6992, # Cave Ceiling (2nd Column)
  122.    7040, 7088, 7136, 7184, 7232, 7280, 7328, 7376, # Cave Wall    (2nd Column)
  123.    7424, 7472, 7520, 7568, 7616, 7664, 7712, 7760, # Cave Ceiling (3rd Column)
  124.    7808, 7856, 7904, 7952, 8000, 8048, 8096, 8144, # Cave Wall    (3rd Column)
  125.    1952, 2000]                                     # Dummy TileIDs                  
  126.    
  127.   # * Horizontal bridge TileIDs
  128.   BRIDRE_LENGTH = [17, 808, 810, 812]

  129.   # * Vertical bridge TileIDs
  130.   BRIDGE_BREADTH = [18, 19, 21, 23, 809, 811, 813]
  131.   
  132.   # * TileIDs treated as entrances for stairs, ladders, and caves
  133.   # When the player is on one of these tiles, the passage settings are altered
  134.   # so that the player is constrainted within the tile's ideal passage.
  135.   STEP = [67, 68, 69, 70, 71, 172, 173, 174, 175,
  136.           260, 261, 262, 263, 268, 269, 270,
  137.           271, 278, 279, 284, 285, 286, 287,
  138.           612, 613, 616, 617, 618, 619,
  139.           1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607,
  140.           1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615]      
  141.   
  142.   
  143.   # * TileID for passability determination under bridges
  144.   # The default of TileID 1664 is not visible within the editor and has no in-
  145.   # game image. If not necessary, please do not change this value.
  146.   UNDER_BRIDGE = 1664
  147.   
  148. end

  149. #==============================================================================
  150. # * Please do not change autotile setup
  151. #==============================================================================

  152. module Data_Auto_Tile
  153.   # Array for each direction in which the tiles have an edge (AutotileID)
  154.   # Floor type
  155.   VERGE_DOWN_A  = [28, 29, 30, 31, 33, 38, 39, 40, 41, 43, 44, 45, 46]
  156.   VERGE_LEFT_A  = [16, 17, 18, 19, 32, 34, 35, 40, 41, 42, 43, 44, 46]
  157.   VERGE_RIGHT_A = [24, 25, 26, 27, 32, 36, 37, 38, 39, 42, 44, 45, 46]
  158.   VERGE_UP_A    = [20, 21, 22, 23, 33, 34, 35, 36, 37, 42, 43, 45, 46]
  159.   
  160.   # Wall Type
  161.   VERGE_DOWN_B  = [ 8,  9, 10, 11, 12, 13, 14, 15]
  162.   VERGE_LEFT_B  = [ 1,  3,  5,  7,  9, 11, 13, 15]
  163.   VERGE_RIGHT_B = [ 4,  5,  6,  7, 12, 13, 14, 15]
  164.   VERGE_UP_B    = [ 2,  3,  6,  7, 10, 11, 14, 15]

  165. end

  166. #==============================================================================
  167. # ■ RPG::Area
  168. #==============================================================================

  169. class RPG::Area
  170.   #--------------------------------------------------------------------------
  171.   # ○ 公開インスタンス変数
  172.   #--------------------------------------------------------------------------
  173.   attr_accessor :ship_pass
  174. end

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

  181. class Game_Map
  182.   #--------------------------------------------------------------------------
  183.   # ○ 公開インスタンス変数
  184.   #--------------------------------------------------------------------------
  185.   attr_reader   :under_bridge_passages
  186.   attr_reader   :back_tiles_position
  187.   attr_reader   :keep_back_position
  188.   attr_reader   :ex_data
  189.   attr_reader   :prohibited_get_off
  190.   #--------------------------------------------------------------------------
  191.   # ◎ セットアップ
  192.   #     map_id : マップ ID
  193.   #--------------------------------------------------------------------------
  194.   alias tig_ep_setup setup
  195.   def setup(map_id)
  196.     tig_ep_setup(map_id)
  197.     @ex_data = Table.new(width, height, 3)
  198.     @under_bridge_passages = {}
  199.     @back_tiles_position = []
  200.     @keep_back_position = []
  201.     prohibited_get_off_setup
  202.     setup_back_tiles
  203.     shadow_eraser_tile_setup
  204.   end
  205.   #--------------------------------------------------------------------------
  206.   # ○ 接岸禁止タイルのセットアップ
  207.   #     map_id : マップ ID
  208.   #--------------------------------------------------------------------------
  209.   def prohibited_get_off_setup
  210.     @prohibited_get_off = []
  211.     return if Expansion_Passable::PROHIBITED_GET_OFF_TILE_ID == nil
  212.     for x in 0...width
  213.       for y in 0...height
  214.         if @map.data[x, y, 2] == Expansion_Passable::PROHIBITED_GET_OFF_TILE_ID
  215.           @map.data[x, y, 2] = 0
  216.           @prohibited_get_off.push([x, y])
  217.         end
  218.       end
  219.     end
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # ○ 影消しタイルのセットアップ
  223.   #--------------------------------------------------------------------------
  224.   def shadow_eraser_tile_setup
  225.     return if Expansion_Passable::SHADOW_ERASER_TILE_ID == nil
  226.     for x in 0...width
  227.       for y in 0...height
  228.         if @map.data[x, y, 2] == Expansion_Passable::SHADOW_ERASER_TILE_ID
  229.           r_x = round_x(x - 1)
  230.           tile_id = @map.data[r_x, y, 0]

  231.           if (4352...5888).include?(tile_id) or
  232.              (6272...6656).include?(tile_id) or
  233.              (7040...7424).include?(tile_id) or
  234.              (7808...8192).include?(tile_id)
  235.             dummy_tile_id = 2000 + auto_(tile_id)
  236.           else
  237.             dummy_tile_id = 1952 + auto_(tile_id)
  238.           end
  239.          
  240.           @map.data[x, y, 2] = 0
  241.           @map.data[r_x, y, 1] = @map.data[r_x, y, 0]
  242.           @map.data[r_x, y, 0] = dummy_tile_id
  243.         end
  244.       end
  245.     end
  246.   end
  247.   #--------------------------------------------------------------------------
  248.   # ○ 指定座標のタイルIDの取得
  249.   #--------------------------------------------------------------------------
  250.   def point_tile_id(x, y)
  251.     return [data[x, y, 0], data[x, y, 1], data[x, y, 2]]
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ○ オートタイルIDの取得(オートタイル郡の中で順番にIDをつけた独自のIDです)
  255.   #--------------------------------------------------------------------------
  256.   def auto_(tile_id)
  257.     return 0 unless (1952...8192).include?(tile_id)
  258.     return (tile_id - 1952) % 48
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # ○ トップタイルIDの取得(オートタイル郡の最初のID)
  262.   #--------------------------------------------------------------------------
  263.   def top_(tile_id)
  264.     return 0 if tile_id == nil
  265.     return (tile_id - auto_(tile_id))
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ○ スクリプト機能を使用する屋根・天井・壁タイルか?
  269.   #--------------------------------------------------------------------------
  270.   def ceiling?(tile_id)
  271.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  272.     return true if wall?(tile_id)
  273.     return true if (1952...2048).include?(tile_id)
  274.     return true if (4352...4736).include?(tile_id)
  275.     return true if (5120...5504).include?(tile_id)
  276.     return true if (5888...6272).include?(tile_id)
  277.     return true if (6656...7040).include?(tile_id)
  278.     return (7424...7808).include?(tile_id)
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ○ スクリプト機能を使用する壁タイルか?
  282.   #--------------------------------------------------------------------------
  283.   def wall?(tile_id)
  284.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  285.     return true if (4736...5120).include?(tile_id)
  286.     return true if (5504...5888).include?(tile_id)
  287.     return true if (6272...6656).include?(tile_id)
  288.     return true if (7040...7424).include?(tile_id)
  289.     return (7808...8192).include?(tile_id)
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ○ スクリプト機能を使用する地形タイルか?
  293.   #--------------------------------------------------------------------------
  294.   def cliff?(tile_id)
  295.     return false unless Data_Tile::FUNCTION_TILE.include?(top_(tile_id))
  296.     return [2816, 3200, 3584, 2960, 3344, 3728, 4112].include?(top_(tile_id))
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ○ 指定の向きにオートタイルチップの境目があるか?
  300.   #--------------------------------------------------------------------------
  301.   def verge?(tile_id, direction)
  302.     auto_tile_id = auto_(tile_id)
  303.    
  304.     return false if auto_tile_id == 0
  305.     return false unless ceiling?(tile_id) or cliff?(tile_id)
  306.     if (2000...2048).include?(tile_id) or
  307.        (4352...5888).include?(tile_id) or
  308.        (6272...6656).include?(tile_id) or
  309.        (7040...7424).include?(tile_id) or
  310.        (7808...8192).include?(tile_id)           # オートタイルの線画タイプ判別
  311.       case direction # 壁タイプの場合 方向ごとに振り分け
  312.       when 2 ; return true if Data_Auto_Tile::VERGE_DOWN_B.include?(auto_tile_id)
  313.       when 4 ; return true if Data_Auto_Tile::VERGE_LEFT_B.include?(auto_tile_id)
  314.       when 6 ; return true if Data_Auto_Tile::VERGE_RIGHT_B.include?(auto_tile_id)
  315.       when 8 ; return true if Data_Auto_Tile::VERGE_UP_B.include?(auto_tile_id)
  316.       end
  317.     else
  318.       case direction # 床タイプの場合 方向ごとに振り分け
  319.       when 2 ; return true if Data_Auto_Tile::VERGE_DOWN_A.include?(auto_tile_id)
  320.       when 4 ; return true if Data_Auto_Tile::VERGE_LEFT_A.include?(auto_tile_id)
  321.       when 6 ; return true if Data_Auto_Tile::VERGE_RIGHT_A.include?(auto_tile_id)
  322.       when 8 ; return true if Data_Auto_Tile::VERGE_UP_A.include?(auto_tile_id)
  323.       end
  324.     end
  325.   end
  326.   #--------------------------------------------------------------------------
  327.   # ○ 指定の向きに通行不可の境目があるか?
  328.   #--------------------------------------------------------------------------
  329.   def rip?(tile_id, front_tile_id, direction)
  330.     if Data_Tile::BRIDRE_LENGTH.include?(tile_id[2])
  331.       return true if direction == 4 or direction == 6
  332.     elsif Data_Tile::BRIDGE_BREADTH.include?(tile_id[2])
  333.       return true if direction == 2 or direction == 8
  334.     end
  335.     if cliff?(tile_id[0])
  336.       return false unless ceiling?(front_tile_id[0]) or cliff?(front_tile_id[0])
  337.       if cliff?(front_tile_id[0]) and verge?(front_tile_id[0], 10 - direction)
  338.         return false
  339.       end
  340.     end
  341.    
  342.     return verge?(tile_id[0], direction)
  343.   end
  344.   #--------------------------------------------------------------------------
  345.   # ○ 指定の向きに準じた橋タイルか?(渡ることの出来る向きか)
  346.   #--------------------------------------------------------------------------
  347.   def bridge?(tile_id, direction)
  348.     if direction == 2 or direction == 8
  349.       return true if Data_Tile::BRIDRE_LENGTH.include?(tile_id)
  350.     elsif direction == 4 or direction == 6
  351.       return true if Data_Tile::BRIDGE_BREADTH.include?(tile_id)
  352.     end
  353.     return false
  354.   end
  355.   #--------------------------------------------------------------------------
  356.   # ○ <船の橋下通過>処理をするエリアか?
  357.   #--------------------------------------------------------------------------
  358.   def ship_pass_area?(x, y)
  359.     result = false
  360.     for area in $data_areas.values
  361.       next if area == nil
  362.       next unless area.ship_pass
  363.       next if $game_map.map_id != area.map_id
  364.       next if x < area.rect.x
  365.       next if y < area.rect.y
  366.       next if x >= area.rect.x + area.rect.width
  367.       next if y >= area.rect.y + area.rect.height
  368.       result = true
  369.     end
  370.     return result
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ○ 裏回り用タイル存在座標ピックアップと通行判定初期化
  374.   #--------------------------------------------------------------------------
  375.   def setup_back_tiles
  376.    
  377.     for i in 4352...8192
  378.       @passages[i] = 0x00 if ceiling?(i)         # 天井タイルの通行判定を○に
  379.     end

  380.     back_tiles = []                              # 裏回りタイル郡の生成
  381.     for i in 2816...8192
  382.       next unless ceiling?(i) or cliff?(i)
  383.       next if wall?(i)
  384.       next unless verge?(i, 8)
  385.       if cliff?(i)
  386.         next unless Expansion_Passable::CLIFF_MAP.include?(@map_id)
  387.       end
  388.       back_tiles.push(i)
  389.     end

  390.     for i in (Data_Tile::BRIDRE_LENGTH + Data_Tile::BRIDGE_BREADTH)
  391.       @passages[i] = 0x10                       # 橋タイル通行判定を☆に
  392.     end   
  393.     @passages[Data_Tile::UNDER_BRIDGE] = 0x00    # 橋下用タイルの通行判定を○に
  394.    
  395.     for x in 0...width
  396.       for reverse_y in 1..height
  397.         y = height - reverse_y
  398.         tile_id = point_tile_id(x, y)
  399.          if (Data_Tile::BRIDRE_LENGTH + Data_Tile::BRIDGE_BREADTH).include?(tile_id[2])
  400.           @back_tiles_position.push([x, y])
  401.           if (2048...2815).include?(tile_id[0])
  402.             @map.data[x, y, 1] = Data_Tile::UNDER_BRIDGE
  403.             if ship_pass_area?(x, y)
  404.               @under_bridge_passages[[x, y]] = 1
  405.             else
  406.               @under_bridge_passages[[x, y]] = 0
  407.             end
  408.           elsif @passages[tile_id[0]] != 0x06
  409.             @map.data[x, y, 1] = Data_Tile::UNDER_BRIDGE
  410.             @under_bridge_passages[[x, y]] = -1
  411.           end
  412.           if @under_bridge_passages[[x, y]] != 0 and Data_Tile::BRIDGE_BREADTH.include?(tile_id[2])
  413.             @keep_back_position.push([x, round_y(y+1)])
  414.           end
  415.         elsif tile_id[2] != 0 and @passages[tile_id[2]] & 0x10 == 0x10
  416.           if @back_tiles_position.include?([x, round_y(y+1)])
  417.             @keep_back_position.push([x, y])
  418.           else
  419.             @ex_data[x, y, 2] = @map.data[x, y, 2]
  420.           end
  421.         end
  422.         if (2816...8192).include?(tile_id[0])
  423.           if back_tiles.include?(tile_id[0])
  424.             @back_tiles_position.push([x, y])
  425.             @ex_data[x, y, 0] = @map.data[x, y, 0]
  426.             @ex_data[x, y, 1] = @map.data[x, y, 1]
  427.             if tile_id[2] != Expansion_Passable::ADDITION_BACK_TILE_ID
  428.               @ex_data[x, y, 2] = @map.data[x, y, 2]
  429.             end
  430.             @map.data[x, y, 1] = 0
  431.             @map.data[x, y, 2] = 0
  432.             if Expansion_Passable::BACK_TILE_DEEP
  433.               unless @back_tiles_position.include?([x, round_y(y+1)])
  434.                 unless wall?(data[x, round_y(y+1), 0]) and
  435.                        verge?(data[x, round_y(y+1), 0], 2)
  436.                   @back_tiles_position.push([x, round_y(y+1)])
  437.                   @ex_data[x, round_y(y+1), 0] = @map.data[x, round_y(y+1), 0]
  438.                   @ex_data[x, round_y(y+1), 1] = @map.data[x, round_y(y+1), 1]
  439.                   @ex_data[x, round_y(y+1), 2] = @map.data[x, round_y(y+1), 2]
  440.                   @map.data[x, round_y(y+1), 1] = 0
  441.                   @map.data[x, round_y(y+1), 2] = 0
  442.                 end
  443.               end
  444.             end
  445.           elsif Expansion_Passable::ADDITION_BACK_TILE_ID != nil and
  446.                 tile_id[2] == Expansion_Passable::ADDITION_BACK_TILE_ID
  447.             @back_tiles_position.push([x, y])
  448.             @ex_data[x, y, 0] = @map.data[x, y, 0]
  449.             @ex_data[x, y, 1] = @map.data[x, y, 1]
  450.             @map.data[x, y, 1] = 0
  451.             @map.data[x, y, 2] = 0
  452.             if (2816...8192).include?(@map.data[x, round_y(y-1), 0])
  453.               @ex_data[x, round_y(y-1), 0] = @map.data[x, round_y(y-1), 0]
  454.               @ex_data[x, round_y(y-1), 1] = @map.data[x, round_y(y-1), 1]
  455.             end
  456.           end
  457.         end
  458.       end
  459.     end
  460.    
  461.     if Expansion_Passable::DELETE_BACK_TILE_ID != nil
  462.       for x in 0...width
  463.         for y in 0...height
  464.           if @ex_data[x, y, 2] == Expansion_Passable::DELETE_BACK_TILE_ID
  465.             @back_tiles_position.delete([x, y])
  466.             @ex_data[x, y, 2] = 0
  467.           elsif @map.data[x, y, 2] == Expansion_Passable::DELETE_BACK_TILE_ID
  468.             @map.data[x, y, 2] = 0
  469.           end
  470.         end
  471.       end
  472.     end
  473.    
  474.   end
  475.   #--------------------------------------------------------------------------
  476.   # ○ 裏回り用タイルの存在する座標か?
  477.   #--------------------------------------------------------------------------
  478.   def back_tile?(x, y)
  479.     return false if @back_tiles_position == nil
  480.     return @back_tiles_position.include?([x, y])
  481.   end
  482. end

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

  489. class Game_Character
  490.   #--------------------------------------------------------------------------
  491.   # ○ 公開インスタンス変数
  492.   #--------------------------------------------------------------------------
  493.   attr_reader   :on_tile
  494.   attr_reader   :turn_back
  495.   attr_accessor :no_turn_back
  496.   attr_reader   :not_back_seeing
  497.   #--------------------------------------------------------------------------
  498.   # ◎ オブジェクト初期化
  499.   #--------------------------------------------------------------------------
  500.   alias tig_ep_initialize initialize
  501.   def initialize
  502.     tig_ep_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_ep_update update
  514.   def update
  515.     if @first_update == nil
  516.       update_turn_back
  517.       @first_update = true
  518.     end
  519.     tig_ep_update
  520.   end
  521.   #--------------------------------------------------------------------------
  522.   # ◎ 茂み深さの更新
  523.   #--------------------------------------------------------------------------
  524.   alias tig_ep_update_bush_depth update_bush_depth
  525.   def update_bush_depth
  526.     update_turn_back
  527.     tig_ep_update_bush_depth
  528.   end
  529.   #--------------------------------------------------------------------------
  530.   # ○ 裏回り状態更新
  531.   #--------------------------------------------------------------------------
  532.   def update_turn_back
  533.     unless @real_x == @x * 256 and @real_y == @y * 256
  534.       @back_seeing = false
  535.       @on_tile = false if @turn_back
  536.     else
  537.       @turn_back = false if @no_turn_back
  538.       unless $game_map.back_tile?(@x, @y)
  539.         @turn_back = false
  540.         @no_turn_back = false
  541.       end
  542.       @on_tile = true unless @turn_back
  543.     end
  544.     if not @turn_back or @no_turn_back
  545.       if $game_map.keep_back_position != nil and $game_map.keep_back_position.include?([@x, @y])
  546.         @on_tile = false
  547.         return
  548.       end
  549.     end
  550.   end
  551.   #--------------------------------------------------------------------------
  552.   # ○ 段差マップ用・拡張通過判定
  553.   #--------------------------------------------------------------------------
  554.   def ex_passable(direction, test = false)
  555.     front_x = $game_map.x_with_direction(@x, direction)
  556.     front_y = $game_map.y_with_direction(@y, direction)   
  557.     tile_id = $game_map.point_tile_id(@x, @y)
  558.     front_tile_id = $game_map.point_tile_id(front_x, front_y)
  559.    
  560.     if Data_Tile::STEP.include?(front_tile_id[0]) or
  561.        Data_Tile::STEP.include?(front_tile_id[2])
  562.       return true
  563.     else
  564.       unless $game_map.wall?(front_tile_id[0])
  565.         return true if Data_Tile::STEP.include?(tile_id[0])
  566.         return true if Data_Tile::STEP.include?(tile_id[2])
  567.       end
  568.     end
  569.    
  570.     if $game_map.back_tiles_position.include?([@x, @y]) and @turn_back # この場が裏
  571.       if $game_map.under_bridge_passages.key?([front_x, front_y])
  572.         if (@vehicle_type == -1 and $game_map.under_bridge_passages[[front_x, front_y]] == 1) or
  573.            $game_map.under_bridge_passages[[front_x, front_y]] <= 0
  574.           return false unless debug_through? or @through
  575.         end
  576.       end
  577.       if $game_map.back_tiles_position.include?([front_x, front_y]) # 目の前が裏
  578.         return true
  579.       else                                                 # 目の前が裏でない
  580.         if $game_map.rip?(tile_id, front_tile_id, direction)        # この場に境目がある
  581.           if $game_map.rip?(front_tile_id, tile_id, 10 - direction) # 目の前に境目がある
  582.             return false unless debug_through? or @through # 通行不可
  583.           else
  584.             return true
  585.           end
  586.         else                                               # この場に境目がない
  587.           return false unless debug_through? or @through   # 通行不可
  588.         end
  589.       end
  590.     else                                                   # この場は裏でない
  591.       unless $game_map.bridge?(front_tile_id[2], direction) or # 橋がなければ
  592.              $game_map.bridge?(tile_id[2], direction)   
  593.         if $game_map.rip?(tile_id, front_tile_id, direction) # この場に境目がある
  594.           return false unless debug_through? or @through # 通行不可
  595.         else                                               # この場に境目がない
  596.           if $game_map.rip?(front_tile_id, tile_id, 10 - direction) # 目の前に境目がある
  597.             if $game_map.back_tiles_position.include?([front_x, front_y]) # 目の前が裏タイル
  598.               unless $game_map.bridge?(tile_id[2], direction)   # この場が橋でなければ
  599.                 if $game_map.under_bridge_passages.key?([front_x, front_y])
  600.                   if (@vehicle_type == -1 and $game_map.under_bridge_passages[[front_x, front_y]] == 1) or
  601.                      $game_map.under_bridge_passages[[front_x, front_y]] <= 0
  602.                     return false unless debug_through? or @through
  603.                   end
  604.                 end
  605.                 unless @no_turn_back
  606.                   @turn_back = true unless test            # 裏回り開始
  607.                   @back_seeing = true
  608.                 end
  609.               end
  610.             else                                           # 目の前が裏タイルでない
  611.               unless $game_map.bridge?(tile_id[2], direction) # この場が橋でなければ
  612.                 return false unless debug_through? or @through # 通行不可
  613.               end
  614.             end
  615.           else                                             # 目の前に境目がない
  616.             if $game_map.wall?(front_tile_id[0])
  617.               return false unless debug_through? or @through # 通行不可
  618.             end
  619.           end
  620.         end
  621.       end
  622.     end
  623.    
  624.     if $game_map.back_tile?(front_x, front_y) and not @turn_back
  625.       for i in [2, 1, 0]                        # レイヤーの上から順に調べる
  626.         tile_id = $game_map.ex_data[front_x, front_y, i] # タイル ID を取得
  627.         unless tile_id == nil
  628.           pass = $game_map.passages[tile_id]    # 通行属性を取得
  629.           next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
  630.           next if pass & 0x01 == 0x00           # [○] : 通行可
  631.           if pass & 0x01 == 0x01                # [×] : 通行不可
  632.             return false unless debug_through? or @through
  633.           end
  634.         end
  635.       end
  636.     end  

  637.     return true
  638.   end
  639.   #--------------------------------------------------------------------------
  640.   # ◎ 下に移動
  641.   #     turn_ok : その場での向き変更を許可
  642.   #--------------------------------------------------------------------------
  643.   alias tig_ep_move_down move_down
  644.   def move_down(turn_ok = true)
  645.     last_turn_back = @turn_back
  646.     unless ex_passable(2)
  647.       turn_down if turn_ok
  648.       @move_failed = true
  649.       check_event_trigger_touch(@x, @y+1)   # 接触イベントの起動判定
  650.       return
  651.     end
  652.     tig_ep_move_down(turn_ok)
  653.     if @move_failed and @turn_back and not last_turn_back
  654.       @turn_back = false
  655.     end
  656.   end
  657.   #--------------------------------------------------------------------------
  658.   # ◎ 左に移動
  659.   #     turn_ok : その場での向き変更を許可
  660.   #--------------------------------------------------------------------------
  661.   alias tig_ep_move_left move_left
  662.   def move_left(turn_ok = true)
  663.     last_turn_back = @turn_back
  664.     unless ex_passable(4)
  665.       turn_left if turn_ok
  666.       @move_failed = true
  667.       check_event_trigger_touch(@x-1, @y)   # 接触イベントの起動判定
  668.       return
  669.     end
  670.     tig_ep_move_left(turn_ok)
  671.     if @move_failed and @turn_back and not last_turn_back
  672.       @turn_back = false
  673.     end
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # ◎ 右に移動
  677.   #     turn_ok : その場での向き変更を許可
  678.   #--------------------------------------------------------------------------
  679.   alias tig_ep_move_right move_right
  680.   def move_right(turn_ok = true)
  681.     last_turn_back = @turn_back
  682.     unless ex_passable(6)
  683.       turn_right if turn_ok
  684.       check_event_trigger_touch(@x+1, @y)   # 接触イベントの起動判定
  685.       @move_failed = true
  686.       return
  687.     end
  688.     tig_ep_move_right(turn_ok)
  689.     if @move_failed and @turn_back and not last_turn_back
  690.       @turn_back = false
  691.     end
  692.   end
  693.   #--------------------------------------------------------------------------
  694.   # ◎ 上に移動
  695.   #     turn_ok : その場での向き変更を許可
  696.   #--------------------------------------------------------------------------
  697.   alias tig_ep_move_up move_up
  698.   def move_up(turn_ok = true)
  699.     last_turn_back = @turn_back
  700.     unless ex_passable(8)
  701.       turn_up if turn_ok
  702.       check_event_trigger_touch(@x, @y-1)   # 接触イベントの起動判定
  703.       @move_failed = true
  704.       return
  705.     end
  706.     tig_ep_move_up(turn_ok)
  707.     if @move_failed and @turn_back and not last_turn_back
  708.       @turn_back = false
  709.     end
  710.   end
  711.   #--------------------------------------------------------------------------
  712.   # ● キャラクター衝突判定
  713.   #     x : X 座標
  714.   #     y : Y 座標
  715.   #    プレイヤーと乗り物を含め、通常キャラの衝突を検出する。
  716.   #--------------------------------------------------------------------------
  717.   def collide_with_characters?(x, y)
  718.     for event in $game_map.events_xy(x, y)          # イベントの座標と一致
  719.       next unless parallel?(event)                  ##### 追加部分 (この行) #####
  720.       unless event.through                          # すり抜け OFF?
  721.         return true if self.is_a?(Game_Event)       # 自分がイベント
  722.         return true if event.priority_type == 1     # 相手が通常キャラ
  723.       end
  724.     end
  725.     if @priority_type == 1                          # 自分が通常キャラ
  726.       return true if $game_player.pos_nt?(x, y)     # プレイヤーの座標と一致
  727.       return true if $game_map.boat.pos_nt?(x, y)   # 小型船の座標と一致
  728.       return true if $game_map.ship.pos_nt?(x, y)   # 大型船の座標と一致
  729.     end
  730.     return false
  731.   end
  732.   #--------------------------------------------------------------------------
  733.   # ○ キャラクターの同軸存在判定
  734.   #--------------------------------------------------------------------------
  735.   def parallel?(event)
  736.    
  737.     if @x == event.x
  738.       if @y < event.y
  739.         direction = 2
  740.       elsif @y > event.y
  741.         direction = 8
  742.       end
  743.     elsif  @y = event.y
  744.       if @x < event.x
  745.         direction = 6
  746.       elsif @x > event.x
  747.         direction = 4
  748.       end
  749.     end
  750.    
  751.     return @turn_back == event.turn_back if direction == nil
  752.     last_turn_back = @turn_back
  753.     passable = ex_passable(direction)
  754.     tile_id = $game_map.data[event.x, event.y, 0]
  755.     unless $game_map.wall?(tile_id)
  756.       return false unless passable
  757.     end
  758.    
  759.     if last_turn_back != @turn_back
  760.       @turn_back = last_turn_back
  761.       return @turn_back != event.turn_back
  762.     else
  763.       return true unless $game_map.back_tile?(event.x, event.y)
  764.       return @turn_back == event.turn_back
  765.     end
  766.    
  767.   end
  768. end

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

  775. class Game_Event < Game_Character
  776.   #--------------------------------------------------------------------------
  777.   # ◎ オブジェクト初期化
  778.   #     map_id : マップ ID
  779.   #     event  : イベント (RPG::Event)
  780.   #--------------------------------------------------------------------------
  781.   alias tig_ep_event_initialize initialize
  782.   def initialize(map_id, event)
  783.     tig_ep_event_initialize(map_id, event)
  784.     set_turn_back_setting
  785.   end
  786.   #--------------------------------------------------------------------------
  787.   # ○ Get Initial Arrangement Position (Place behind)
  788.   #--------------------------------------------------------------------------  
  789.   def set_turn_back_setting
  790.     @event.name = @event.name.sub(/[\<<]behind[\>>]/, "")
  791.     @turn_back = $& != nil
  792.     @on_tile = $& == nil
  793.     @event.name = @event.name.sub(/[\<<]hidebehind[\>>]/, "")
  794.     @not_back_seeing = $& != nil
  795.   end
  796. end

  797. #==============================================================================
  798. # ** Game_Vehicle
  799. #------------------------------------------------------------------------------
  800. #  乗り物を扱うクラスです。このクラスは Game_Map クラスの内部で使用されます。
  801. # 現在のマップに乗り物がないときは、マップ座標 (-1,-1) に設定されます。
  802. #==============================================================================

  803. class Game_Vehicle < Game_Character  
  804.   def on_tile
  805.     if @driving
  806.       return $game_player.on_tile
  807.     else
  808.       return @on_tile
  809.     end
  810.   end
  811. end

  812. #==============================================================================
  813. # ** Game_Player
  814. #------------------------------------------------------------------------------
  815. #  プレイヤーを扱うクラスです。イベントの起動判定や、マップのスクロールなどの
  816. # 機能を持っています。このクラスのインスタンスは $game_player で参照されます。
  817. #==============================================================================

  818. class Game_Player < Game_Character
  819.   #--------------------------------------------------------------------------
  820.   # ○ 裏配置イベント透過状態か?
  821.   #--------------------------------------------------------------------------   
  822.   def back_seeing?
  823.     return true if @turn_back or @back_seeing
  824.     return false
  825.   end
  826.   #--------------------------------------------------------------------------
  827.   # ● 同位置のイベント起動判定
  828.   #     triggers : トリガーの配列
  829.   #--------------------------------------------------------------------------
  830.   def check_event_trigger_here(triggers)
  831.     return false if $game_map.interpreter.running?
  832.     result = false
  833.     for event in $game_map.events_xy(@x, @y)
  834.       next unless parallel?(event)                 ##### 追加部分 (この行) #####
  835.       if triggers.include?(event.trigger) and event.priority_type != 1
  836.         event.start
  837.         result = true if event.starting
  838.       end
  839.     end
  840.     return result
  841.   end
  842.   #--------------------------------------------------------------------------
  843.   # ● 正面のイベント起動判定
  844.   #     triggers : トリガーの配列
  845.   #--------------------------------------------------------------------------
  846.   def check_event_trigger_there(triggers)
  847.     return false if $game_map.interpreter.running?
  848.     result = false
  849.     front_x = $game_map.x_with_direction(@x, @direction)
  850.     front_y = $game_map.y_with_direction(@y, @direction)
  851.     for event in $game_map.events_xy(front_x, front_y)
  852.       next unless parallel?(event)                 ##### 追加部分 (この行) #####
  853.       if triggers.include?(event.trigger) and event.priority_type == 1
  854.         event.start
  855.         result = true
  856.       end
  857.     end
  858.     if result == false and $game_map.counter?(front_x, front_y)
  859.       front_x = $game_map.x_with_direction(front_x, @direction)
  860.       front_y = $game_map.y_with_direction(front_y, @direction)
  861.       for event in $game_map.events_xy(front_x, front_y)
  862.         next unless parallel?(event)               ##### 追加部分 (この行) #####
  863.         if triggers.include?(event.trigger) and event.priority_type == 1
  864.           event.start
  865.           result = true
  866.         end
  867.       end
  868.     end
  869.     return result
  870.   end
  871.   #--------------------------------------------------------------------------
  872.   # ◎ 乗り物から降りる
  873.   #    現在乗り物に乗っていることが前提。
  874.   #--------------------------------------------------------------------------
  875.   alias tig_ep_get_off_vehicle get_off_vehicle
  876.   def get_off_vehicle
  877.     return if $game_map.back_tile?(@x, @y)
  878.     if @vehicle_type == 0 or @vehicle_type == 1
  879.       front_x = $game_map.x_with_direction(@x, @direction)
  880.       front_y = $game_map.y_with_direction(@y, @direction)
  881.       return if $game_map.under_bridge_passages[[front_x, front_y]] == 1
  882.       return if $game_map.prohibited_get_off.include?([front_x, front_y])
  883.       @no_turn_back = true
  884.     end
  885.     tig_ep_get_off_vehicle
  886.   end
  887. end

  888. #==============================================================================
  889. # ** Spriteset_Map
  890. #------------------------------------------------------------------------------
  891. #  マップ画面のスプライトやタイルマップなどをまとめたクラスです。このクラスは
  892. # Scene_Map クラスの内部で使用されます。
  893. #==============================================================================

  894. class Spriteset_Map
  895.   #--------------------------------------------------------------------------
  896.   # ◎ ビューポートの作成
  897.   #--------------------------------------------------------------------------
  898.   alias tig_ep_create_viewports create_viewports
  899. def create_viewports
  900.     tig_ep_create_viewports
  901.     @viewport4 = Viewport.new(0, 0, 544, 416) # 追加レイヤー�"��"ューポート
  902.     if Expansion_Passable::BACK_SEEING
  903.       @viewport5 = Viewport.new(0, 0, 544, 416) # 裏回りキャラ透過�"��"ューポート
  904.     end
  905.     @viewport6 = Viewport.new(0, 0, 544, 416) # 色調変更�"��"ューポート
  906.   end
  907.   #--------------------------------------------------------------------------
  908.   # ◎ タイルマップの作成
  909.   #--------------------------------------------------------------------------
  910.   alias tig_ep_create_tilemap create_tilemap
  911.   def create_tilemap
  912.     tig_ep_create_tilemap
  913.     setup_shadow_eraser_tilemap
  914.     @ex_tilemap = Tilemap.new(@viewport4)
  915.     @ex_tilemap.bitmaps[0] = Cache.system("TileA1")
  916.     @ex_tilemap.bitmaps[1] = Cache.system("TileA2")
  917.     @ex_tilemap.bitmaps[2] = Cache.system("TileA3")
  918.     @ex_tilemap.bitmaps[3] = Cache.system("TileA4")
  919.     @ex_tilemap.bitmaps[4] = Cache.system("TileA5")
  920.     @ex_tilemap.bitmaps[5] = Cache.system("TileB")
  921.     @ex_tilemap.bitmaps[6] = Cache.system("TileC")
  922.     @ex_tilemap.bitmaps[7] = Cache.system("TileD")
  923.     @ex_tilemap.bitmaps[8] = Cache.system("TileE")
  924.     @ex_tilemap.map_data = $game_map.ex_data
  925.     @ex_tilemap.passages = $game_map.passages
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ○ 影消し処理用タイルの準備
  929.   #--------------------------------------------------------------------------
  930.   def setup_shadow_eraser_tilemap
  931.     for i in 1952...2048
  932.       @tilemap.passages[i] = 0x00
  933.     end
  934.   end
  935.   #--------------------------------------------------------------------------
  936.   # ◎ 飛行船の影スプライトの作成
  937.   #--------------------------------------------------------------------------
  938.   alias tig_ep_create_shadow create_shadow
  939.   def create_shadow
  940.     tig_ep_create_shadow
  941.     @shadow_sprite.viewport = @viewport4
  942.   end
  943.   #--------------------------------------------------------------------------
  944.   # ◎ タイルマップの解放
  945.   #--------------------------------------------------------------------------
  946.   alias tig_ep_dispose_tilemap dispose_tilemap
  947.   def dispose_tilemap
  948.     tig_ep_dispose_tilemap
  949.     @ex_tilemap.dispose
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ◎ ビューポートの解放
  953.   #--------------------------------------------------------------------------
  954.   alias tig_ep_dispose_viewports dispose_viewports
  955.   def dispose_viewports
  956.     tig_ep_dispose_viewports
  957.     @viewport4.dispose
  958.     @viewport5.dispose if Expansion_Passable::BACK_SEEING
  959.     @viewport6.dispose
  960.   end
  961.   #--------------------------------------------------------------------------
  962.   # ◎ タイルマップの更新
  963.   #--------------------------------------------------------------------------
  964.   alias tig_ep_update_tilemap update_tilemap
  965.   def update_tilemap
  966.     tig_ep_update_tilemap
  967.     @ex_tilemap.ox = $game_map.display_x / 8
  968.     @ex_tilemap.oy = $game_map.display_y / 8
  969.     @ex_tilemap.update
  970.   end
  971.   #--------------------------------------------------------------------------
  972.   # ◎ キャラクタースプライトの更新
  973.   #--------------------------------------------------------------------------
  974.   alias tig_ep_update_characters update_characters
  975.   def update_characters
  976.     back_seeing_characters = []
  977.     for sprite in @character_sprites
  978.       next if sprite.character.not_back_seeing
  979.       if $game_player.back_seeing? and Expansion_Passable::BACK_SEEING
  980.         x = $game_player.x ; y = $game_player.y
  981.         if ($game_map.round_x(x-2)..$game_map.round_x(x+2)).include?(sprite.character.x) and
  982.            ($game_map.round_y(y-2)..$game_map.round_y(y+2)).include?(sprite.character.y)
  983.           back_seeing_characters.push(sprite.character)
  984.         end
  985.       end
  986.       if sprite.character.on_tile
  987.         sprite.viewport = @viewport4
  988.       else
  989.         sprite.viewport = @viewport1
  990.       end
  991.     end
  992.     back_seeing(back_seeing_characters)
  993.    
  994.     tig_ep_update_characters
  995.   end
  996.   #--------------------------------------------------------------------------
  997.   # ○ 裏回りキャラ透過
  998.   #--------------------------------------------------------------------------  
  999.   def back_seeing(characters)
  1000.     return unless Expansion_Passable::BACK_SEEING
  1001.     @back_seeing_sprites = [] if @back_seeing_sprites == nil
  1002.     @characters = [] if @characters == nil
  1003.     now_character = []
  1004.     for character in characters
  1005.       now_character.push(character)
  1006.       unless @characters.include?(character)
  1007.         new_sprite = Sprite_Character.new(@viewport5, character)
  1008.         new_sprite.back_seeing = true
  1009.         @back_seeing_sprites.push(new_sprite)
  1010.         @characters.push(new_sprite.character)
  1011.       end
  1012.     end
  1013.    
  1014.     for sprite in @back_seeing_sprites
  1015.       if now_character.include?(sprite.character)
  1016.         sprite.update
  1017.       else
  1018.         @characters.delete(sprite.character)
  1019.         sprite.dispose
  1020.         @back_seeing_sprites.delete(sprite)
  1021.       end
  1022.     end
  1023.   end
  1024.   #--------------------------------------------------------------------------
  1025.   # ● ビューポートの更新
  1026.   #--------------------------------------------------------------------------
  1027.   def update_viewports
  1028.     @viewport6.tone = $game_map.screen.tone        ##### 修正部分 (この行) #####
  1029.     @viewport1.ox = $game_map.screen.shake
  1030.    
  1031.     @viewport4.ox = $game_map.screen.shake         ### 追加部分 (この行から) ###
  1032.     if Expansion_Passable::BACK_SEEING
  1033.       @viewport5.rect.set($game_player.screen_x - 48, $game_player.screen_y - 64, 96, 96)
  1034.       @viewport5.ox = $game_map.screen.shake
  1035.     end                                            ### 追加部分 (ここ行まで) ###
  1036.    
  1037.     @viewport2.color = $game_map.screen.flash_color
  1038.     @viewport3.color.set(0, 0, 0, 255 - $game_map.screen.brightness)
  1039.     @viewport1.update
  1040.     @viewport2.update
  1041.     @viewport3.update
  1042.    
  1043.     @viewport4.update                              ### 追加部分 (この行から) ###
  1044.     @viewport5.update if Expansion_Passable::BACK_SEEING
  1045.     @viewport6.update                              ### 追加部分 (ここ行まで) ###
  1046.   end
  1047. end

  1048. #==============================================================================
  1049. # ** Sprite_Character
  1050. #------------------------------------------------------------------------------
  1051. #  キャラクター表示用のスプライトです。Game_Character クラスのインスタンスを
  1052. # 監視し、スプライトの状態を自動的に変化させます。
  1053. #==============================================================================

  1054. class Sprite_Character < Sprite_Base
  1055.   #--------------------------------------------------------------------------
  1056.   # ○ 公開インスタンス変数
  1057.   #--------------------------------------------------------------------------
  1058.   attr_accessor :back_seeing
  1059.   #--------------------------------------------------------------------------
  1060.   # ◎ オブジェクト初期化
  1061.   #     viewport  : ビューポート
  1062.   #     character : キャラクター (Game_Character)
  1063.   #--------------------------------------------------------------------------
  1064.   alias tig_ep_initialize initialize
  1065.   def initialize(viewport, character = nil)
  1066.     tig_ep_initialize(viewport, character)
  1067.     @back_seeing = false
  1068.   end
  1069.   #--------------------------------------------------------------------------
  1070.   # ◎ フレーム更新
  1071.   #--------------------------------------------------------------------------
  1072.   alias tig_ep_update update
  1073.   def update
  1074.     tig_ep_update
  1075.     if @back_seeing
  1076.       self.opacity = 40 if self.opacity > 100
  1077.       self.x -= $game_player.screen_x - 48
  1078.       self.y -= $game_player.screen_y - 64
  1079.     end
  1080.   end
  1081. end

  1082. #==============================================================================
  1083. # ** Scene_Title
  1084. #------------------------------------------------------------------------------
  1085. #  タイトル画面の処理を行うクラスです。
  1086. #==============================================================================

  1087. class Scene_Title < Scene_Base
  1088.   #--------------------------------------------------------------------------
  1089.   # ◎ データベースのロード
  1090.   #    name から<船の橋下通過>の設定を得ます。
  1091.   #--------------------------------------------------------------------------
  1092.   alias tig_ep_load_database load_database
  1093.   def load_database
  1094.     tig_ep_load_database
  1095.     for area in $data_areas.values
  1096.       area.name = area.name.sub(/[\<<]bridge[\>>]/, "") # adjust area name
  1097.       area.ship_pass = $& != nil                         # set ship passability
  1098.     end
  1099.   end
  1100. end
复制代码

点评

好的,祝考试顺利。一起努力吧。嘿嘿我也是三天后。另外通行度的DATA文件叫做“MapInfos”。  发表于 2013-6-30 21:42

——旧坑欢迎戳
回复 支持 反对

使用道具 举报

Lv1.梦旅人

矿工

梦石
0
星屑
134
在线时间
898 小时
注册时间
2012-10-5
帖子
1535
发表于 2013-6-30 18:58:50 | 显示全部楼层
顶一个,但是我总是觉得栏杆变成的草地不能通行,草地变成的栏杆可以通行……

点评

嗯,通行度的问题等楼主放暑假了就马上来姐姐。谢谢~:D  发表于 2013-6-30 21:42
呃,发糖贴好冷清呀!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 00:55

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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