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

Project1

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

[已经解决] 还是大地图问题

[复制链接]

Lv5.捕梦者

梦石
0
星屑
30555
在线时间
606 小时
注册时间
2014-7-18
帖子
729

开拓者

跳转到指定楼层
1
发表于 2014-7-28 20:58:26 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 VIPArcher 于 2014-7-28 21:11 编辑

我下了“WOR-MAPS V1.4.5 鼠标用户测试”来参考设置大地图,但把脚本复制到我的游戏上时,缺不能显示主角当前位置,这是为什么?以下是我改的脚本:
RUBY 代码复制
  1. #————————————————————————————————————————
  2. # ●Wormaps By.Lyaci
  3. #   *世界地图界面
  4. #   *使用说明
  5. #   -呼出界面 SceneManager.call(WMAPSET::Scene_WMAP)
  6. #    界面快捷键默认 A 键
  7. #   -每个地图对应在世界地图的坐标在“地图备注名称”里设置
  8. #    格式 MAP001<MX100,100> 即该地图在MX这个图上显示的坐标 x100 y100
  9. #   -更多请参考范例内容
  10. #   -Ver:1.0 Date:2014.6.25
  11. #   *地图传送
  12. #   -选中后按确认键传送,可以设置总体开关和独立地图的开关
  13. #    总体开关为偷懒用,即打开了 未设置独立开关的地图都可以传送
  14. #    和显示说明一样,在地图备注内设置
  15. #    格式<MOV:X,Y,D,WID> XY对应坐标,D对应朝向(2,4,6,8)->>(下,左,右,上)
  16. #    WID对应独立传送的开关ID
  17. #   -Ver:1.1 Date:2014.6.25PM
  18. #   *重新定义全局传送开关概念
  19. #    修正行走图错位问题
  20. #   -Ver:1.2 Date:2014.6.26
  21. #   *增加自动偏量范围与调试模式
  22. #   -参考坐标变为锁标中心点(CX,CY)
  23. #   -Ver:1.3 Date:2014.6.27
  24. #   *修正参考坐标出现负数问题 & 数据接口优化
  25. #   -Ver:1.3.1 & Ver:1.3.2 Date:2014.6.28
  26. #   *1.4更新
  27. #   -结构优化,文件夹统一化,主、偏量独立范围,增加蒙版响应图(可选)
  28. #    -主量格式追加为:MAP001<MX,X,Y,F> MX=地图文件 XY=显示坐标 F=范围(响应区)
  29. #    *蒙版可以为复杂的地方提供响应,F设置为0就可以不进行默认的范围描绘
  30. #     -蒙版需要在OFLOCK_COLOR设置对应地图ID的范围色
  31. #     -蒙版的文件名为 地图文件名 + _OF 找不到文件即不启用 *更多参考范例里“椰子”
  32. #   -Ver:1.4 Date:2014.7.12
  33. #   *实现无缝连接像素级分辨区域
  34. #   -Ver:1.4.5 Date:2014.7.14
  35. #————————————————————————————————————————
  36. module WMAPSET
  37.   #————————————————————————————————————————
  38.   #●设置
  39.   #————————————————————————————————————————
  40.   MAP_KEY  = :C       #快捷键设置
  41.   MAP_WSET = 1        #禁止/允许打开世界地图开关ID
  42.   MAP_VSET = 100      #设置新的世界地图文件名的变量ID
  43.   MAP_FILE = "世界地图"     #初始的地图文件名
  44.   #————————————————————————————————————————
  45.   ICON_FILE = "micon" #锁标的文件名
  46.   ICON_XY_WIN = true  #辅助坐标窗口是否生成
  47.   LOCKDIS = 5         #锁标每帧移动距离
  48.   CAP_SPEED = 40      #队长行走图更新帧周期
  49.   #Ver1.1—————————————————————————————————————
  50.   MAP_WMOVSET = 100                           #公用地图传送开关ID
  51.   MAP_AMOVSET = 99                            #全局传送开关ID(优先公用与独立开关)
  52.   LOCK_RES = true                             #是否开启呼吸效果
  53.   LOCK_FLASH = true                           #是否开启闪烁效果
  54.   LOCK_FLASH_C1 = Color.new(100,200,255,168)  #闪烁色1
  55.   LOCK_FLASH_C2 = Color.new(255,200,100,168)  #闪烁色2
  56.   LOCK_FLASH_SPEED = 48                       #闪烁周期
  57.   #Ver1.3—————————————————————————————————————
  58.   OFLOCK = 80        #默认主、偏量范围(未手动设置范围即使用该值)
  59.   DEBUG = true        #调试模式(蒙版、主量、偏量范围显示/关闭 F5按键取色)
  60.   LOCKMOV_SOUND_SPEED = 6 #锁标移动声音间隔帧
  61.   #Ver1.4—————————————————————————————————————
  62.   WMAPS_FOLDER = "Graphics/WMAP/" #存放所有资源的文件夹
  63.   #————————————————————————————————————————
  64.   #锁定偏量增加 [地图文件名,X,Y,偏量范围] => 地图ID
  65.   #偏量用于增加响应范围,按范围影响度自行调整
  66.   OFLOCK_XY = {
  67.   #第一张世界地图偏量(只是这个范例的)
  68.   ["世界地图",170,80,20] => 19, #百元镇偏量
  69.   ["世界地图",170,80,20] => 3, #百元大楼偏量
  70.   ["世界地图",170,80,20] => 4, #百元镇偏量
  71.   ["世界地图",170,80,20] => 5, #百元镇偏量
  72.   ["世界地图",170,80,20] => 6, #百元镇偏量
  73.   ["世界地图",170,80,20] => 7, #百元镇偏量
  74.   ["世界地图",170,80,20] => 8, #百元镇偏量
  75.   ["世界地图",170,80,20] => 9, #百元镇偏量
  76.   ["世界地图",170,80,20] => 10, #百元镇偏量
  77.   ["世界地图",170,80,20] => 17, #百元镇偏量
  78.   ["世界地图",170,80,20] => 18, #百元镇偏量
  79.   ["世界地图",170,110,20] => 20, #1号街道偏量
  80.   ["世界地图",380,330] => 3, #神奇洞穴偏量
  81.   ["世界地图",400,350] => 3, #神奇洞穴偏量
  82.   }
  83.   #Ver1.4.5————————————————————————————————————
  84.   #自定义地图对应的范围色 地图ID => 颜色
  85.   #*蒙版用到的范围颜色也在这添加,否则蒙版会不响应
  86.   #*为了方便设置蒙版色,调试模式开启时F5键可以取得当前锁标中心范围色
  87.   OFLOCK_COLOR = {
  88.   19 => Color.new(255,0,0,84),  #百元镇的范围为红色
  89.   }
  90. #————————————————————————————————————————
  91. # ●Scene_WMAP
  92. #   *界面生成
  93. #————————————————————————————————————————
  94. class Scene_WMAP
  95.   #———————————————————————————————————————
  96.   #数据内容
  97.   #———————————————————————————————————————
  98.   def data
  99.     #———————————————————————————————————————
  100.     #常量
  101.     @graphics_w = Graphics.width
  102.     @graphics_h = Graphics.height
  103.     #———————————————————————————————————————
  104.     #生成背景
  105.     map_back
  106.     #———————————————————————————————————————
  107.     #生成地图
  108.     spr_map_ini
  109.     #———————————————————————————————————————
  110.     #生成锁标
  111.     spr_lock_ini
  112.     #———————————————————————————————————————
  113.     #锁标地址数据
  114.     LOCKCOM.com(@map)
  115.     @comx,@comy,@comf,@comi = LOCKCOM.comdata(@map)
  116.     @comofc = LOCKCOM.comofc(@map)
  117.     @comide = LOCKCOM.comide(@map)
  118.     #———————————————————————————————————————
  119.     #生成范围
  120.     spr_of_ini
  121.     #———————————————————————————————————————
  122.     #锁标初始坐标
  123.     lock_xy_ini
  124.     #———————————————————————————————————————
  125.     #生成锁标坐标显示窗口
  126.     win_lockxy_ini
  127.     #生成地图信息显示窗口
  128.     win_mapint_ini
  129.     #———————————————————————————————————————
  130.     #生成队长
  131.     spr_cap_ini
  132.     #———————————————————————————————————————
  133.     update_map_int_yof
  134.   end
  135.   #———————————————————————————————————————
  136.   #主循环
  137.   #———————————————————————————————————————
  138.   def main
  139.     #准备数据
  140.     data
  141.     #执行过渡
  142.     Graphics.transition
  143.     #进行更新
  144.     update until SceneManager.scene != self
  145.     #准备过渡
  146.     Graphics.freeze
  147.     #释放全部
  148.     dispose
  149.   end
  150.   #———————————————————————————————————————
  151.   #主更新
  152.   #———————————————————————————————————————
  153.   def update
  154.     update_GI
  155.     update_input
  156.     update_lock_flash if LOCK_FLASH
  157.     update_lock_zoom if LOCK_RES
  158.   end
  159.   #———————————————————————————————————————
  160.   #画面、输入更新
  161.   #———————————————————————————————————————
  162.   def update_GI
  163.     Graphics.update
  164.     Input.update
  165.     update_cap
  166.   end
  167.   #———————————————————————————————————————
  168.   #数据更新
  169.   #———————————————————————————————————————
  170.   def update_data
  171.     update_lms
  172.     update_oflock
  173.     update_map_int_yof
  174.     refresh_window_lock_xy
  175.   end
  176.   #———————————————————————————————————————
  177.   #按键更新
  178.   #———————————————————————————————————————
  179.   def update_input
  180.     if Input.press?(:DOWN)
  181.       @lock_dy += LOCKDIS ; if @lock_dy <= @graphics_h-@lock_h
  182.       @spr_lock.y += LOCKDIS
  183.       @lock_dy = @lock_y = @spr_lock.y ; lock_mov = true ; end
  184.     end
  185.     if Input.press?(:UP)
  186.       @lock_dy -= LOCKDIS ; if @lock_dy >= 0
  187.       @spr_lock.y -= LOCKDIS
  188.       @lock_dy = @lock_y = @spr_lock.y ; lock_mov = true ; end
  189.     end
  190.     if Input.press?(:LEFT)
  191.       @lock_dx -= LOCKDIS ; if @lock_dx >= 0
  192.       @spr_lock.x -= LOCKDIS
  193.       @lock_dx = @lock_x = @spr_lock.x ; lock_mov = true ; end
  194.     end
  195.     if Input.press?(:RIGHT)
  196.       @lock_dx += LOCKDIS ; if @lock_dx <= @graphics_w-@lock_w
  197.       @spr_lock.x += LOCKDIS
  198.       @lock_dx = @lock_x = @spr_lock.x ; lock_mov = true ; end
  199.     end
  200.     if Input.trigger?(:C)
  201.       map_mov(lock_map_id)
  202.     end
  203.     if Input.trigger?(:B) or Input.trigger?(MAP_KEY)
  204.       SceneManager.return
  205.     end
  206.     if Input.trigger?(:F5) && DEBUG
  207.       p @bit_mapof.get_pixel(@lock_cx,@lock_cy)
  208.     end
  209.     if lock_mov
  210.       update_data
  211.       lock_mov = false
  212.     end
  213.   end
  214.   #———————————————————————————————————————
  215.   #范围更新
  216.   #———————————————————————————————————————
  217.   def update_oflock ; new_cxy
  218.     if @bit_mapof.get_pixel(@lock_cx,@lock_cy).alpha != 0
  219.       @new_map_id = lock_map_id
  220.       if @new_map_id != @now_map_id
  221.         @now_map_id = @new_map_id
  222.         update_lock_xy(@now_map_id)
  223.       end
  224.     else
  225.       @now_map_id = nil ; update_lock_xy(nil)
  226.     end
  227.   end
  228.   #———————————————————————————————————————
  229.   #更新锁标移动声音
  230.   #———————————————————————————————————————
  231.   def update_lms
  232.     @lock_mov_dsc += 1
  233.     if @lock_mov_dsc == LOCKMOV_SOUND_SPEED
  234.     @lock_mov_dsc = 0 ; Sound.play_cursor ; end
  235.   end
  236.   #———————————————————————————————————————
  237.   #锁标地址更新
  238.   #———————————————————————————————————————
  239.   def update_lock_xy(map_id)
  240.     if map_id
  241.       refresh_window_map_int(map_id)
  242.       @wint_clear = false
  243.     else
  244.       unless @wint_clear
  245.         @window_map_int.contents.clear
  246.         @wint_clear = true
  247.       end
  248.     end
  249.   end
  250.   #———————————————————————————————————————
  251.   #地图信息窗口坐标更新
  252.   #———————————————————————————————————————
  253.   def update_map_int_yof
  254.     if @spr_lock.y >= @graphics_h - @lock_h - 96
  255.     @window_map_int.y = 0 ; win_lock_y_set(100) ; else
  256.     @window_map_int.y = @graphics_h - 96 ; win_lock_y_set(240) ; end
  257.   end
  258.   #———————————————————————————————————————
  259.   #更新队长动作
  260.   #———————————————————————————————————————
  261.   def update_cap
  262.     @cap_dsc += 1
  263.     if @cap_dsc == CAP_SPEED ; @cap_index += 1 ; @cap_dsc = 0
  264.     @cap_index = 0 if @cap_index >= 3
  265.     @spr_cap.src_rect.x = @zx+@cw*@cap_index ; end
  266.   end
  267.   #———————————————————————————————————————
  268.   #更新锁标“呼吸”
  269.   #———————————————————————————————————————
  270.   def update_lock_zoom
  271.     if @lock_zoom_mr
  272.       @spr_lock.zoom_x += 0.01 ; @spr_lock.zoom_y += 0.01
  273.       @lock_zoom_mr = false if @spr_lock.zoom_x >= 1.1 ; else
  274.       @spr_lock.zoom_x -= 0.01 ; @spr_lock.zoom_y -= 0.01
  275.       @lock_zoom_mr = true if @spr_lock.zoom_x <= 0.9
  276.     end
  277.   end
  278.   #———————————————————————————————————————
  279.   #更新锁标闪烁
  280.   #———————————————————————————————————————
  281.   def update_lock_flash
  282.     @spr_lock.update ; @lock_flash_dsc += 1
  283.     if @lock_flash_dsc == LOCK_FLASH_SPEED
  284.       @lock_flash_dsc = 0 ; @lock_flash_wb = !@lock_flash_wb
  285.       color = @lock_flash_wb ? LOCK_FLASH_C1 : LOCK_FLASH_C2
  286.       @spr_lock.flash(color,LOCK_FLASH_SPEED)
  287.     end
  288.   end
  289.   #———————————————————————————————————————
  290.   #地图精灵
  291.   #———————————————————————————————————————
  292.   def spr_map_ini
  293.     @spr_map = Sprite.new
  294.     @map = $game_variables[MAP_VSET] == 0 ? MAP_FILE :
  295.     $game_variables[MAP_VSET]
  296.     @map_id = $game_map.instance_variable_get(:@map_id)
  297.     @spr_map.bitmap = Bitmap.new(WMAPS_FOLDER+@map)
  298.   end
  299.   #———————————————————————————————————————
  300.   #锁标精灵
  301.   #———————————————————————————————————————
  302.   def spr_lock_ini
  303.     @spr_lock = Sprite.new
  304.     @spr_lock.bitmap = Bitmap.new(WMAPS_FOLDER+ICON_FILE)
  305.     #锁标变量
  306.     @lock_x = 0 ; @lock_y = 0 ; @lock_dx = 0 ; @lock_dy = 0
  307.     @near_min = [] ; @lock_mov_dsc = 0
  308.     @lock_w = @spr_lock.bitmap.width ; @lock_h = @spr_lock.bitmap.height
  309.     @lock_mw = @lock_w*0.5 ; @lock_mh = @lock_h*0.5
  310.     @lock_flash_dsc = 0 ; @lock_flash_wb = false ; @lock_zoom_mr = true
  311.   end
  312.   #———————————————————————————————————————
  313.   #锁标初始坐标
  314.   #———————————————————————————————————————
  315.   def lock_xy_ini
  316.     lock_xy = LOCKCOM.commxy(@map,@map_id)
  317.     @near_x = lock_xy[0].to_i ; @near_y = lock_xy[1].to_i
  318.     @spr_lock.x = @lock_x = @lock_dx = @near_x - @lock_mw
  319.     @spr_lock.y = @lock_y = @lock_dy = @near_y - @lock_mh ; new_cxy
  320.   end
  321.   #———————————————————————————————————————
  322.   #队长精灵
  323.   #———————————————————————————————————————
  324.   def spr_cap_ini
  325.     #生成队长
  326.     @spr_cap = Sprite.new
  327.     cap = $game_party.members[0]
  328.     cap_name =  cap ? cap.character_name : "雷鸣"
  329.     cap_index = cap ? cap.character_index : 0
  330.     @spr_cap.bitmap = Bitmap.new("Graphics/Characters/"+cap_name)
  331.     cenx = @lock_x + @lock_w*0.16
  332.     ceny = @lock_y + @lock_h*0.16
  333.     @spr_cap.x,@spr_cap.y = cenx,ceny
  334.     #捕捉位置
  335.     @cw = @spr_cap.bitmap.width / 12 ; @ch = @spr_cap.bitmap.height / 8
  336.     @zx = (cap_index%4*3)*@cw ; @zy = (cap_index/4*4)*@ch
  337.     #位图矩形
  338.     @spr_cap.src_rect = Rect.new(@zx, @zy, @cw, @ch)
  339.     #更新数据
  340.     @cap_dsc = 0 ; @cap_index = 0
  341.   end
  342.   #———————————————————————————————————————
  343.   #锁标坐标窗口
  344.   #———————————————————————————————————————
  345.   def win_lockxy_ini
  346.     return unless ICON_XY_WIN
  347.     @window_lock_xy_false = Window_Base.new(0,240,260,78)
  348.     @window_lock_xy_false.opacity = 0
  349.     c1 = Color.new(255,255,255,128)
  350.     c2 = Color.new(255,255,255,0)
  351.     @window_lock_xy_false.contents.gradient_fill_rect(0, 0, 260, 24, c1, c2)
  352.     @window_lock_xy_false.contents.gradient_fill_rect(0, 26, 260, 24, c1, c2)
  353.     @window_lock_xy = Window_Base.new(0,240,260,78)
  354.     @window_lock_xy.opacity = 0
  355.     refresh_window_lock_xy
  356.   end
  357.   #———————————————————————————————————————
  358.   #地图信息窗口
  359.   #———————————————————————————————————————
  360.   def win_mapint_ini
  361.     @window_map_int = Window_Base.new(0,0,@graphics_w,96)
  362.     #更新地图信息
  363.     map_id = lock_map_id
  364.     if map_id
  365.       refresh_window_map_int(map_id)
  366.       @now_map_id = map_id
  367.     else
  368.       @now_map_id = nil
  369.     end
  370.   end
  371.   #———————————————————————————————————————
  372.   #绘制地图信息
  373.   #———————————————————————————————————————
  374.   def refresh_window_map_int(map_id)
  375.     note = LOCKCOM.comnote(map_id)
  376.     /<INF:(.*?)>/ =~ note.gsub(/\n/){"\\n"}
  377.     return unless $1
  378.     Sound.play_recovery
  379.     note = $1.gsub(/\\n/){"\n"}
  380.     @window_map_int.contents.clear
  381.     @window_map_int.draw_text_ex(4,0,note)
  382.   end
  383.   #———————————————————————————————————————
  384.   #绘制锁标地址
  385.   #———————————————————————————————————————
  386.   def refresh_window_lock_xy
  387.     return unless ICON_XY_WIN
  388.     x,y = @lock_x,@lock_y ; cx = @lock_cx ; cy = @lock_cy
  389.     @window_lock_xy.contents.clear
  390.     @window_lock_xy.contents.draw_text(2,0,220,24,"X:#{x} Y:#{y}")
  391.     @window_lock_xy.contents.draw_text(2,24,220,24,"CX:#{cx} CY:#{cy}")
  392.   end
  393.   #———————————————————————————————————————
  394.   #设置坐标位置(Y)
  395.   #———————————————————————————————————————
  396.   def win_lock_y_set(y)
  397.     return unless ICON_XY_WIN
  398.     @window_lock_xy.y = y
  399.     @window_lock_xy_false.y = y
  400.   end
  401.   #———————————————————————————————————————
  402.   #生成背景
  403.   #———————————————————————————————————————
  404.   def map_back
  405.     @map_back = Sprite.new
  406.     @map_back.bitmap = SceneManager.background_bitmap
  407.     @map_back.color.set(16, 16, 16, 128)
  408.   end
  409.   #———————————————————————————————————————
  410.   #处理场景移动
  411.   #———————————————————————————————————————
  412.   def map_mov(map_id)
  413.     return unless map_id
  414.     mov_data = []
  415.     note = LOCKCOM.comnote(map_id)
  416.     /<MOV:(.*?)>/ =~ note
  417.     return Sound.play_buzzer unless $1
  418.     $1.scan(/\d+/) {|xy| mov_data << xy.to_i}
  419.     x,y,d,swi = *mov_data
  420.     swi = swi ? $game_switches[swi] : $game_switches[MAP_WMOVSET]
  421.     if swi && $game_switches[MAP_AMOVSET]
  422.     $game_player.reserve_transfer(map_id, x, y, d)
  423.     $game_player.perform_transfer
  424.     Sound.play_use_skill ; SceneManager.return ; else
  425.     Sound.play_buzzer ; end
  426.   end
  427.   #———————————————————————————————————————
  428.   #获取当前锁定的地图ID
  429.   #———————————————————————————————————————
  430.   def lock_map_id
  431.     @comide[@bit_mapof.get_pixel(@lock_cx,@lock_cy).to_s]
  432.   end
  433.   #———————————————————————————————————————
  434.   #更新锁标中心位置
  435.   #———————————————————————————————————————
  436.   def new_cxy
  437.     @lock_cx = @lock_x + @lock_mw
  438.     @lock_cy = @lock_y + @lock_mh
  439.   end
  440.   #———————————————————————————————————————
  441.   #生成范围
  442.   #———————————————————————————————————————
  443.   def spr_of_ini
  444.     @spr_mapof = Sprite.new
  445.     @spr_mapof.bitmap = Bitmap.new(@graphics_w,@graphics_h)
  446.     @bit_mapof = @spr_mapof.bitmap
  447.     debug(DEBUG)
  448.     of_file = WMAPS_FOLDER+@map+"_OF.png"
  449.     if FileTest.file?(of_file)
  450.       of_bitmap = Bitmap.new(of_file)
  451.       @bit_mapof.blt(0,0,of_bitmap,Rect.new(0,0,@graphics_w,@graphics_h))
  452.       of_bitmap.dispose
  453.     end
  454.     @comx.each_with_index {|x,i|
  455.     f = @comf[i] ; y = @comy[i] ; id = @comi[i]
  456.     color = @comofc[id]
  457.     @bit_mapof.fill_rect(x-f/2,y-f/2,f,f,color)
  458.     if DEBUG
  459.       color = Color.new(color.red,color.green,color.blue)
  460.       @spr_debug.bitmap.fill_rect(x-f/2,y,f,1,color)
  461.       @spr_debug.bitmap.fill_rect(x,y-f/2,1,f,color)
  462.     end }
  463.   end
  464.   #———————————————————————————————————————
  465.   #调试模式
  466.   #———————————————————————————————————————
  467.   def debug(tf)
  468.     if tf
  469.     @spr_debug = Sprite.new
  470.     @spr_debug.bitmap = Bitmap.new(@graphics_w,@graphics_h)
  471.     @spr_lock.bitmap.fill_rect(@lock_mw,@lock_mh,1,1,Color.new(0,0,0,255))
  472.     else ; @spr_mapof.visible = false ; end
  473.   end
  474.   #———————————————————————————————————————
  475.   #释放全部
  476.   #———————————————————————————————————————
  477.   def dispose
  478.     @map_back.bitmap.dispose
  479.     @spr_map.bitmap.dispose
  480.     @spr_lock.bitmap.dispose
  481.     @spr_cap.bitmap.dispose
  482.     @spr_map.dispose ; @spr_lock.dispose
  483.     @spr_cap.dispose ; @map_back.dispose
  484.     @window_map_int.dispose
  485.     @window_lock_xy.dispose if ICON_XY_WIN
  486.     @window_lock_xy_false.dispose if ICON_XY_WIN
  487.     @spr_debug.bitmap.dispose if DEBUG
  488.     @spr_debug.dispose if DEBUG
  489.     @spr_mapof.bitmap.dispose
  490.     @spr_mapof.dispose
  491.   end
  492. end ; end
  493. #———————————————————————————————————————
  494. #●LOCKCOM
  495. #  *处理全部地图锁标的模块
  496. #———————————————————————————————————————
  497. module LOCKCOM
  498.   #———————————————————————————————————————
  499.   #载入偏量地址源
  500.   def self.com_set
  501.     @com = {} ; @rof = {}
  502.     WMAPSET::OFLOCK_XY.each {|key,id|
  503.     com=key[0,3] ; f = key[3] ; rof = f.nil? ? WMAPSET::OFLOCK : f
  504.     @com[com] = id ; @rof[com] = rof } ; @com
  505.   end
  506.   #读取全部主、偏量地址源
  507.   def self.com(map)
  508.     @com ||= LOCKCOM.com_set
  509.     @map ||= Array.new
  510.     unless @map.include?(map) ; @map << map
  511.     $data_mapinfos.each {|id,v|
  512.     /<#{map}(.*?)>/ =~ v.name ; if $1
  513.     cof=[map] ; $1.scan(/\d+/) {|xy| cof << xy.to_i }
  514.     com=cof[0,3] ; f = cof[3] ; rof = f.nil? ? WMAPSET::OFLOCK : f
  515.     @com[com] = id ; @rof[com] = rof ; end } ; end
  516.   end
  517.   #———————————————————————————————————————
  518.   #分析地址源为标准数据
  519.   def self.comdata(map)
  520.     @comxy ||= {}
  521.     @comofc ||= {}
  522.     @comide ||= {}
  523.     unless @comxy.has_key?(map)
  524.     x,y,f,i=[],[],[],[]
  525.     @comofc[map] = {}
  526.     @comide[map] = {}
  527.     oc = WMAPSET::OFLOCK_COLOR
  528.     @com.each {|key,map_id|
  529.     if key[0] == map
  530.       unless @comofc[map][map_id]
  531.         if oc[map_id] ; LOCKCOM.comio_set(map,map_id,oc[map_id])
  532.         else ; LOCKCOM.comio_rc(map,map_id) ; end
  533.       end
  534.       x<<key[1];y<<key[-1];f<<@rof[key];i<<map_id
  535.     end }
  536.     @comxy[map] = [x,y,f,i] ; end ; return *@comxy[map]
  537.   end
  538.   def self.comio_rc(map,map_id)
  539.     loop { color = LOCKCOM.color
  540.     unless @comofc[map].has_value?(color)
  541.     LOCKCOM.comio_set(map,map_id,color) ; break ; end }
  542.   end
  543.   def self.comio_set(map,map_id,color)
  544.     @comide[map][color.to_s] = map_id
  545.     @comofc[map][map_id] = color
  546.   end
  547.   #———————————————————————————————————————
  548.   #读取指定地图主量坐标
  549.   def self.commxy(map,map_id)
  550.     map_id = map_id ; until $1
  551.     /<#{map}(.*?)>/ =~ $data_mapinfos[map_id].name
  552.     map_id = $data_mapinfos[map_id].parent_id unless $1
  553.     break if map_id == 0 ; end ; $1 ? $1.split(",") : 0
  554.   end
  555.   #———————————————————————————————————————
  556.   #读取指定地图的备注
  557.   def self.comnote(map_id)
  558.     @comnote ||= {}
  559.     unless @comnote.has_key?(map_id)
  560.     note = load_data(sprintf("Data/Map%03d.rvdata2", map_id)).note
  561.     @comnote[map_id] = note ; end ; @comnote[map_id]
  562.   end
  563.   #———————————————————————————————————————
  564.   #取得范围色、范围色识别串
  565.   def self.comofc(map)
  566.     @comofc[map]
  567.   end
  568.   def self.comide(map)
  569.     @comide[map]
  570.   end
  571.   def self.color
  572.     Color.new(rand(255),rand(255),rand(255),84)
  573.   end
  574. end
  575. #———————————————————————————————————————
  576. #●Scene_Map
  577. #———————————————————————————————————————
  578. class Scene_Map < Scene_Base
  579.   alias :n_update :update
  580.   def update
  581.     n_update
  582.     if Input.trigger?(WMAPSET::MAP_KEY) ; if $game_switches[WMAPSET::MAP_WSET]
  583.       Sound.play_ok ; SceneManager.call(WMAPSET::Scene_WMAP)
  584.       else ; Sound.play_buzzer ; end
  585.     end
  586.   end
  587. end

点评

代码框使用失败,已编辑。VIPArcher留  发表于 2014-7-28 21:12

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

2
发表于 2014-7-29 07:52:03 | 只看该作者
你是否使用了其他脚本?这种情况要么是少复制了东西,要么是脚本冲突导致的
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
30555
在线时间
606 小时
注册时间
2014-7-18
帖子
729

开拓者

3
 楼主| 发表于 2014-7-29 15:13:23 | 只看该作者
taroxd 发表于 2014-7-29 07:52
你是否使用了其他脚本?这种情况要么是少复制了东西,要么是脚本冲突导致的 ...

绝对没有少复制,如果是脚本冲突的话,我只是弄了一个脸谱战斗的脚本,其它都是原样复制的,脸图战斗脚本如下:
RUBY 代码复制
  1. $脸图战斗 = true
  2. $imported = {} if $imported.nil?
  3. module YEA
  4.   module BATTLE
  5.     SKIP_PARTY_COMMAND = true
  6.     BATTLESTATUS_NAME_FONT_SIZE = 20
  7.     BATTLESTATUS_TEXT_FONT_SIZE = 16
  8.     BATTLESTATUS_NO_ACTION_ICON = 185
  9.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11
  10.     BATTLESTATUS_CENTER_FACES   = false
  11.     HELP_TEXT_ALL_FOES        = "全体敌人"
  12.     HELP_TEXT_ONE_RANDOM_FOE  = "单个敌人"
  13.     HELP_TEXT_MANY_RANDOM_FOE = "%d个随机敌人"
  14.     HELP_TEXT_ALL_ALLIES      = "全体队友"
  15.     HELP_TEXT_ALL_DEAD_ALLIES = "全体死亡队友"
  16.     HELP_TEXT_ONE_RANDOM_ALLY = "单个随机队友"
  17.     HELP_TEXT_RANDOM_ALLIES   = "%d个随机队友"
  18.   end
  19. end
  20. class Game_Battler
  21.   def can_collapse?
  22.     return false unless dead?
  23.     unless actor?
  24.       return false unless sprite.battler_visible
  25.       array = [:collapse, :boss_collapse, :instant_collapse]
  26.       return false if array.include?(sprite.effect_type)
  27.     end
  28.     return true
  29.   end
  30.   def draw_mp?
  31.     return true
  32.   end
  33.   def draw_tp?
  34.     return $data_system.opt_display_tp
  35.   end
  36. end
  37. module Icon
  38.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  39. end
  40. class Game_Temp
  41.   attr_accessor :battle_aid
  42.   attr_accessor :evaluating
  43. end
  44. class Game_Action
  45.   alias evaluate_item_with_target_abe evaluate_item_with_target
  46.   def evaluate_item_with_target(target)
  47.     $game_temp.evaluating = true
  48.     result = evaluate_item_with_target_abe(target)
  49.     $game_temp.evaluating = false
  50.     return result
  51.   end
  52. end
  53. class Game_Actor < Game_Battler
  54.   def draw_mp?
  55.     return true unless draw_tp?
  56.     for skill in skills
  57.       next unless added_skill_types.include?(skill.stype_id)
  58.       return true if skill.mp_cost > 0
  59.     end
  60.     return false
  61.   end
  62.   def draw_tp?
  63.     return false unless $data_system.opt_display_tp
  64.     for skill in skills
  65.       next unless added_skill_types.include?(skill.stype_id)
  66.       return true if skill.tp_cost > 0
  67.     end
  68.     return false
  69.   end
  70. end
  71. class Window_BattleStatus < Window_Selectable
  72.   def initialize
  73.     super(0, 0, window_width, window_height)
  74.     self.openness = 0
  75.     @party = $game_party.battle_members.clone
  76.   end
  77.   def col_max; return $game_party.max_battle_members; end
  78.   def battle_members; return $game_party.battle_members; end
  79.   def actor; return battle_members[@index]; end
  80.   def update
  81.     super
  82.     return if @party == $game_party.battle_members
  83.     @party = $game_party.battle_members.clone
  84.     refresh
  85.   end
  86.   def draw_item(index)
  87.     return if index.nil?
  88.     clear_item(index)
  89.     actor = battle_members[index]
  90.     rect = item_rect(index)
  91.     return if actor.nil?
  92.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  93.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  94.     draw_actor_action(actor, rect.x, rect.y)
  95.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  96.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  97.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  98.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  99.     if draw_tp?(actor) && draw_mp?(actor)
  100.       dw = rect.width/2-2
  101.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  102.       draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  103.       dw = rect.width - rect.width/2 - 2
  104.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  105.     elsif draw_tp?(actor) && !draw_mp?(actor)
  106.       draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  107.     else
  108.       draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  109.     end
  110.   end
  111.   def item_rect(index)
  112.     rect = Rect.new
  113.     rect.width = contents.width / $game_party.max_battle_members
  114.     rect.height = contents.height
  115.     rect.x = index * rect.width
  116.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  117.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  118.     end
  119.     rect.y = 0
  120.     return rect
  121.   end
  122.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  123.     bitmap = Cache.face(face_name)
  124.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  125.     fy = face_index / 4 * 96 + 2
  126.     fw = [item_rect(0).width - 4, 92].min
  127.     rect = Rect.new(fx, fy, fw, 92)
  128.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  129.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  130.     bitmap.dispose
  131.   end
  132.   def draw_actor_name(actor, dx, dy, dw = 112)
  133.     reset_font_settings
  134.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  135.     change_color(hp_color(actor))
  136.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  137.   end
  138.   def draw_actor_action(actor, dx, dy)
  139.     draw_icon(action_icon(actor), dx, dy)
  140.   end
  141.   def action_icon(actor)
  142.     return Icon.no_action if actor.current_action.nil?
  143.     return Icon.no_action if actor.current_action.item.nil?
  144.     return actor.current_action.item.icon_index
  145.   end
  146.   def draw_tp?(actor)
  147.     return actor.draw_tp?
  148.   end
  149.   def draw_mp?(actor)
  150.     return actor.draw_mp?
  151.   end
  152.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  153.     change_color(color1)
  154.     draw_text(dx, dy, dw, line_height, current.to_s, 2)
  155.   end
  156.   def draw_actor_hp(actor, dx, dy, width = 124)
  157.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  158.     change_color(system_color)
  159.     cy = (Font.default_size - contents.font.size) / 2 + 1
  160.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  161.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  162.       hp_color(actor), normal_color)
  163.     end
  164.   def draw_actor_mp(actor, dx, dy, width = 124)
  165.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  166.     change_color(system_color)
  167.     cy = (Font.default_size - contents.font.size) / 2 + 1
  168.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  169.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  170.       mp_color(actor), normal_color)
  171.     end
  172.   def draw_actor_tp(actor, dx, dy, width = 124)
  173.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  174.     change_color(system_color)
  175.     cy = (Font.default_size - contents.font.size) / 2 + 1
  176.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  177.     change_color(tp_color(actor))
  178.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  179.   end
  180. end
  181. class Window_BattleActor < Window_BattleStatus
  182.   def show
  183.     create_flags
  184.     super
  185.   end
  186.   def create_flags
  187.     set_select_flag(:any)
  188.     select(0)
  189.     return if $game_temp.battle_aid.nil?
  190.     if $game_temp.battle_aid.need_selection?
  191.       select(0)
  192.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  193.     elsif $game_temp.battle_aid.for_user?
  194.       battler = BattleManager.actor
  195.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  196.       select(id)
  197.       set_select_flag(:user)
  198.     elsif $game_temp.battle_aid.for_all?
  199.       select(0)
  200.       set_select_flag(:all)
  201.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  202.     elsif $game_temp.battle_aid.for_random?
  203.       select(0)
  204.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  205.     end
  206.   end
  207.   def set_select_flag(flag)
  208.     @select_flag = flag
  209.     case @select_flag
  210.     when :all, :all_dead, :random
  211.       @cursor_all = true
  212.     else
  213.       @cursor_all = false
  214.     end
  215.   end
  216.   def update_cursor
  217.     if @cursor_all
  218.       cursor_rect.set(0, 0, contents.width, contents.height)
  219.       self.top_row = 0
  220.     elsif @index < 0
  221.       cursor_rect.empty
  222.     else
  223.       ensure_cursor_visible
  224.       cursor_rect.set(item_rect(@index))
  225.     end
  226.   end
  227.   def cursor_movable?
  228.     return false if @select_flag == :user
  229.     return super
  230.   end
  231.   def current_item_enabled?
  232.     return true if $game_temp.battle_aid.nil?
  233.     if $game_temp.battle_aid.need_selection?
  234.       member = $game_party.battle_members[@index]
  235.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  236.     elsif $game_temp.battle_aid.for_dead_friend?
  237.       for member in $game_party.battle_members
  238.         return true if member.dead?
  239.       end
  240.       return false
  241.     end
  242.     return true
  243.   end
  244. end
  245. class Window_BattleStatusAid < Window_BattleStatus
  246.   attr_accessor :status_window
  247.   def initialize
  248.     super
  249.     self.visible = false
  250.     self.openness = 255
  251.   end
  252.   def window_width; return 128; end
  253.   def show
  254.     super
  255.     refresh
  256.   end
  257.   def refresh
  258.     contents.clear
  259.     return if @status_window.nil?
  260.     draw_item(@status_window.index)
  261.   end
  262.   def item_rect(index)
  263.     return Rect.new(0, 0, contents.width, contents.height)
  264.   end
  265. end
  266. class Window_BattleEnemy < Window_Selectable
  267.   def initialize(info_viewport)
  268.     super(0, Graphics.height, window_width, fitting_height(1))
  269.     refresh
  270.     self.visible = false
  271.     @info_viewport = info_viewport
  272.   end
  273.   def col_max; return item_max; end
  274.   def show
  275.     create_flags
  276.     super
  277.   end
  278.   def create_flags
  279.     set_select_flag(:any)
  280.     select(0)
  281.     return if $game_temp.battle_aid.nil?
  282.     if $game_temp.battle_aid.need_selection?
  283.       select(0)
  284.     elsif $game_temp.battle_aid.for_all?
  285.       select(0)
  286.       set_select_flag(:all)
  287.     elsif $game_temp.battle_aid.for_random?
  288.       select(0)
  289.       set_select_flag(:random)
  290.     end
  291.   end
  292.   def set_select_flag(flag)
  293.     @select_flag = flag
  294.     case @select_flag
  295.     when :all, :random
  296.       @cursor_all = true
  297.     else
  298.       @cursor_all = false
  299.     end
  300.   end
  301.   def select_all?
  302.     return true if @select_flag == :all
  303.     return true if @select_flag == :random
  304.     return false
  305.   end
  306.   def update_cursor
  307.     if @cursor_all
  308.       cursor_rect.set(0, 0, contents.width, contents.height)
  309.       self.top_row = 0
  310.     elsif @index < 0
  311.       cursor_rect.empty
  312.     else
  313.       ensure_cursor_visible
  314.       cursor_rect.set(item_rect(@index))
  315.     end
  316.   end
  317.   def cursor_movable?
  318.     return false if @select_flag == :user
  319.     return super
  320.   end
  321.   def current_item_enabled?
  322.     return true if $game_temp.battle_aid.nil?
  323.     if $game_temp.battle_aid.need_selection?
  324.       member = $game_party.battle_members[@index]
  325.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  326.     elsif $game_temp.battle_aid.for_dead_friend?
  327.       for member in $game_party.battle_members
  328.         return true if member.dead?
  329.       end
  330.       return false
  331.     end
  332.     return true
  333.   end
  334.   def enemy; @data[index]; end
  335.   def refresh
  336.     make_item_list
  337.     create_contents
  338.     draw_all_items
  339.   end
  340.   def make_item_list
  341.     @data = $game_troop.alive_members
  342.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  343.   end
  344.   def draw_item(index); return; end
  345.   def update
  346.     super
  347.     return unless active
  348.     enemy.sprite_effect_type = :whiten
  349.     return unless select_all?
  350.     for enemy in $game_troop.alive_members
  351.       enemy.sprite_effect_type = :whiten
  352.     end
  353.   end
  354. end
  355. class Window_BattleHelp < Window_Help
  356.   attr_accessor :actor_window
  357.   attr_accessor :enemy_window
  358.   def update
  359.     super
  360.     if !self.visible and @text != ""
  361.       @text = ""
  362.       return refresh
  363.     end
  364.     update_battler_name
  365.   end
  366.   def update_battler_name
  367.     return unless @actor_window.active || @enemy_window.active
  368.     if @actor_window.active
  369.       battler = $game_party.battle_members[@actor_window.index]
  370.     elsif @enemy_window.active
  371.       battler = @enemy_window.enemy
  372.     end
  373.     if special_display?
  374.       refresh_special_case(battler)
  375.     else
  376.       refresh_battler_name(battler) if battler_name(battler) != @text
  377.     end
  378.   end
  379.   def battler_name(battler)
  380.     text = battler.name.clone
  381.     return text
  382.   end
  383.   def refresh_battler_name(battler)
  384.     contents.clear
  385.     reset_font_settings
  386.     change_color(normal_color)
  387.     @text = battler_name(battler)
  388.     icons = battler.state_icons + battler.buff_icons
  389.     dy = icons.size <= 0 ? line_height / 2 : 0
  390.     draw_text(0, dy, contents.width, line_height, @text, 1)
  391.     dx = (contents.width - (icons.size * 24)) / 2
  392.     draw_actor_icons(battler, dx, line_height, contents.width)
  393.   end
  394.   def special_display?
  395.     return false if $game_temp.battle_aid.nil?
  396.     return false if $game_temp.battle_aid.for_user?
  397.     return !$game_temp.battle_aid.need_selection?
  398.   end
  399.   def refresh_special_case(battler)
  400.     if $game_temp.battle_aid.for_opponent?
  401.       if $game_temp.battle_aid.for_all?
  402.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  403.       else
  404.         case $game_temp.battle_aid.number_of_targets
  405.         when 1
  406.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  407.         else
  408.           number = $game_temp.battle_aid.number_of_targets
  409.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  410.         end
  411.       end
  412.     else
  413.       if $game_temp.battle_aid.for_dead_friend?
  414.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  415.       elsif $game_temp.battle_aid.for_random?
  416.         case $game_temp.battle_aid.number_of_targets
  417.         when 1
  418.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  419.         else
  420.           number = $game_temp.battle_aid.number_of_targets
  421.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  422.         end
  423.       else
  424.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  425.       end
  426.     end
  427.     return if text == @text
  428.     @text = text
  429.     contents.clear
  430.     reset_font_settings
  431.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  432.   end
  433. end
  434. class Window_SkillList < Window_Selectable
  435.   def spacing
  436.     return 8 if $game_party.in_battle
  437.     return super
  438.   end
  439. end
  440. class Window_ItemList < Window_Selectable
  441.   def spacing
  442.     return 8 if $game_party.in_battle
  443.     return super
  444.   end
  445. end
  446. class Scene_Battle < Scene_Base
  447.   attr_accessor :enemy_window
  448.   attr_accessor :info_viewport
  449.   attr_accessor :spriteset
  450.   attr_accessor :status_window
  451.   attr_accessor :status_aid_window
  452.   attr_accessor :subject
  453.   alias scene_battle_create_all_windows_abe create_all_windows
  454.   def create_all_windows
  455.     scene_battle_create_all_windows_abe
  456.     create_battle_status_aid_window
  457.     set_help_window
  458.   end
  459.   alias scene_battle_create_info_viewport_abe create_info_viewport
  460.   def create_info_viewport
  461.     scene_battle_create_info_viewport_abe
  462.     @status_window.refresh
  463.   end
  464.   def create_battle_status_aid_window
  465.     @status_aid_window = Window_BattleStatusAid.new
  466.     @status_aid_window.status_window = @status_window
  467.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  468.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  469.   end
  470.   def create_help_window
  471.     @help_window = Window_BattleHelp.new
  472.     @help_window.hide
  473.   end
  474.   def set_help_window
  475.     @help_window.actor_window = @actor_window
  476.     @help_window.enemy_window = @enemy_window
  477.   end
  478.   alias scene_battle_create_skill_window_abe create_skill_window
  479.   def create_skill_window
  480.     scene_battle_create_skill_window_abe
  481.     @skill_window.height = @info_viewport.rect.height
  482.     @skill_window.width = Graphics.width - @actor_command_window.width
  483.     @skill_window.y = Graphics.height - @skill_window.height
  484.   end
  485.   alias scene_battle_create_item_window_abe create_item_window
  486.   def create_item_window
  487.     scene_battle_create_item_window_abe
  488.     @item_window.height = @skill_window.height
  489.     @item_window.width = @skill_window.width
  490.     @item_window.y = Graphics.height - @item_window.height
  491.   end
  492.   alias scene_battle_next_command_abe next_command
  493.   def next_command
  494.     @status_window.show
  495.     redraw_current_status
  496.     @actor_command_window.show
  497.     @status_aid_window.hide
  498.     scene_battle_next_command_abe
  499.   end
  500.   alias scene_battle_prior_command_abe prior_command
  501.   def prior_command
  502.     redraw_current_status
  503.     scene_battle_prior_command_abe
  504.   end
  505.   def redraw_current_status
  506.     return if @status_window.index < 0
  507.     @status_window.draw_item(@status_window.index)
  508.   end
  509.   alias scene_battle_command_attack_abe command_attack
  510.   def command_attack
  511.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  512.     scene_battle_command_attack_abe
  513.   end
  514.   alias scene_battle_command_skill_abe command_skill
  515.   def command_skill
  516.     scene_battle_command_skill_abe
  517.     @status_window.hide
  518.     @actor_command_window.hide
  519.     @status_aid_window.show
  520.   end
  521.   alias scene_battle_command_item_abe command_item
  522.   def command_item
  523.     scene_battle_command_item_abe
  524.     @status_window.hide
  525.     @actor_command_window.hide
  526.     @status_aid_window.show
  527.   end
  528.   def on_skill_ok
  529.     [url=home.php?mod=space&uid=260100]@skill[/url] = @skill_window.item
  530.     $game_temp.battle_aid = @skill
  531.     BattleManager.actor.input.set_skill(@skill.id)
  532.     BattleManager.actor.last_skill.object = @skill
  533.     if @skill.for_opponent?
  534.       select_enemy_selection
  535.     elsif @skill.for_friend?
  536.       select_actor_selection
  537.     else
  538.       @skill_window.hide
  539.       next_command
  540.       $game_temp.battle_aid = nil
  541.     end
  542.   end
  543.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  544.   def on_skill_cancel
  545.     scene_battle_on_skill_cancel_abe
  546.     @status_window.show
  547.     @actor_command_window.show
  548.     @status_aid_window.hide
  549.   end
  550.   def on_item_ok
  551.     @item = @item_window.item
  552.     $game_temp.battle_aid = @item
  553.     BattleManager.actor.input.set_item(@item.id)
  554.     if @item.for_opponent?
  555.       select_enemy_selection
  556.     elsif @item.for_friend?
  557.       select_actor_selection
  558.     else
  559.       @item_window.hide
  560.       next_command
  561.       $game_temp.battle_aid = nil
  562.     end
  563.     $game_party.last_item.object = @item
  564.   end
  565.   alias scene_battle_on_item_cancel_abe on_item_cancel
  566.   def on_item_cancel
  567.     scene_battle_on_item_cancel_abe
  568.     @status_window.show
  569.     @actor_command_window.show
  570.     @status_aid_window.hide
  571.   end
  572.   alias scene_battle_select_actor_selection_abe select_actor_selection
  573.   def select_actor_selection
  574.     @status_aid_window.refresh
  575.     scene_battle_select_actor_selection_abe
  576.     @status_window.hide
  577.     @skill_window.hide
  578.     @item_window.hide
  579.     @help_window.show
  580.   end
  581.   alias scene_battle_on_actor_ok_abe on_actor_ok
  582.   def on_actor_ok
  583.     $game_temp.battle_aid = nil
  584.     scene_battle_on_actor_ok_abe
  585.     @status_window.show
  586.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  587.       @actor_command_window.visible = !@confirm_command_window.visible
  588.     else
  589.       @actor_command_window.show
  590.     end
  591.     @status_aid_window.hide
  592.   end
  593.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  594.   def on_actor_cancel
  595.     BattleManager.actor.input.clear
  596.     @status_aid_window.refresh
  597.     $game_temp.battle_aid = nil
  598.     scene_battle_on_actor_cancel_abe
  599.     case @actor_command_window.current_symbol
  600.     when :skill
  601.       @skill_window.show
  602.     when :item
  603.       @item_window.show
  604.     end
  605.   end
  606.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  607.   def select_enemy_selection
  608.     @status_aid_window.refresh
  609.     scene_battle_select_enemy_selection_abe
  610.     @help_window.show
  611.   end
  612.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  613.   def on_enemy_ok
  614.     $game_temp.battle_aid = nil
  615.     scene_battle_on_enemy_ok_abe
  616.   end
  617.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  618.   def on_enemy_cancel
  619.     BattleManager.actor.input.clear
  620.     @status_aid_window.refresh
  621.     $game_temp.battle_aid = nil
  622.     scene_battle_on_enemy_cancel_abe
  623.     if @skill_window.visible || @item_window.visible
  624.       @help_window.show
  625.     else
  626.       @help_window.hide
  627.     end
  628.   end
  629.   def end_battle_conditions?
  630.     return true if $game_party.members.empty?
  631.     return true if $game_party.all_dead?
  632.     return true if $game_troop.all_dead?
  633.     return true if BattleManager.aborting?
  634.     return false
  635.   end
  636.   def refresh_status
  637.     #如果你是程序员,请顺手帮忙优化下这里,谢谢。
  638.     @status_window.refresh
  639.     for i in $game_party.battle_members
  640.       @status_window.draw_item($game_party.battle_members.index(i))
  641.     end
  642.   end
  643. end
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

4
发表于 2014-7-29 15:18:23 | 只看该作者
xjzsq 发表于 2014-7-29 15:13
绝对没有少复制,如果是脚本冲突的话,我只是弄了一个脸谱战斗的脚本,其它都是原样复制的,脸图战斗脚本 ...

那么把脸图战斗的脚本去掉,还有这个问题吗?
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
30555
在线时间
606 小时
注册时间
2014-7-18
帖子
729

开拓者

5
 楼主| 发表于 2014-7-29 20:17:10 | 只看该作者
仍然如此,是不是我改的大地图脚本不完全(有的地方漏下了没改导致的)希望您帮忙改过来,如果这样没法改,我可以把工程发给你。十分感谢!求求您了,大神啊!!!

点评

那我就不知道了= = 范例能用的话你就从范例上改吧= =  发表于 2014-7-29 20:23
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
30555
在线时间
606 小时
注册时间
2014-7-18
帖子
729

开拓者

6
 楼主| 发表于 2014-7-29 20:53:48 | 只看该作者
我把我的游戏发给你,你帮忙看看脚本上有木有漏改的地方?谢谢,求求taroxd这位大神了!!!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
186 小时
注册时间
2014-6-14
帖子
213
7
发表于 2014-7-31 11:04:36 | 只看该作者
范例吗?
也许是对原始脚本进行改动的吧……
用一下范例吧……反正也可以显示主角现在位置。
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
30555
在线时间
606 小时
注册时间
2014-7-18
帖子
729

开拓者

8
 楼主| 发表于 2014-7-31 15:10:07 | 只看该作者
本帖最后由 xjzsq 于 2014-7-31 15:18 编辑
qq19750508 发表于 2014-7-31 11:04
范例吗?
也许是对原始脚本进行改动的吧……
用一下范例吧……反正也可以显示主角现在位置。 ...


我已经发现问题了。
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
30555
在线时间
606 小时
注册时间
2014-7-18
帖子
729

开拓者

9
 楼主| 发表于 2014-7-31 15:21:34 | 只看该作者
对不起,各位大神们,因为我没有把范例研究清楚,只设置了一半,so...太对不起了!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-23 06:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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