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

Project1

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

[已经过期] 请人帮我修改战斗背景脚本. 附上变量开关.以及即时刷新

[复制链接]

Lv2.观梦者

永无止境的旅程

梦石
0
星屑
503
在线时间
1552 小时
注册时间
2012-6-19
帖子
1226

开拓者贵宾

跳转到指定楼层
1
发表于 2012-8-20 12:31:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 丿梁丶小柒 于 2012-8-20 12:32 编辑

这个脚本本是使用地图ID取得战斗样式背景的
我要求的就是  加上取得指定的变量ID  取得样式战斗背景  意思就是  不是取得地图ID  是变量ID
是加上此功能.原本的取得地图ID的功能也要保留  不过当某开关打开的时候是取得变量ID的  不是地图ID

第二就是 想在战斗中 更换背景  就是即时刷新更换战斗背景  当我的变量更换之后 战斗背景也跟着变化


此脚本原帖
http://rpg.blue/forum.php?mod=viewthread&tid=163949
  1. #==============================================================================
  2. #    华丽战斗背景
  3. #    原作BY: modern algbera
  4. #    提供BY:企鹅达达
  5. #    翻译BY:仲秋启明
  6. #==============================================================================
  7. #==============================================================================
  8. # ● 设定
  9. #==============================================================================
  10. module ModernAlgebra
  11. #==============================================================================
  12. # ● 设定
  13. #  map_id => [scape_1_id, scape_2_id, ..., scape_n_id]     地图ID=> [背景图ID]
  14. #   when scape_id                                    背景图ID
  15. #     parallax_name = ""                         背景图名
  16. #     z = 0                                         决定显示位置Z轴
  17. #     scroll_x = 0                                   X轴滚动
  18. #     scroll_y = 0                                       Y轴滚动
  19. #     zoom_x = 100                                X轴缩放
  20. #     zoom_y = 100                                   Y轴缩放
  21. #     opacity = 255                            透明度
  22. #     blend_type = 0                            混合方式:0:普通,1:加法,2: 减法
  23. #     color = [r, g, b, a] #(default: [0, 0, 0, 0])     颜色[红,绿,蓝,通道]
  24. #     tone = [r, g, b]     #(default: [0, 0, 0])                        
  25. #==============================================================================
  26.   MAP_BATTLE_SCAPES = {
  27.     1 => [1]
  28.   }
  29.   MAP_BATTLE_SCAPES.default = []
  30.   AREA_BATTLE_SCAPES = {
  31.     1 => [1, 2],
  32.     2 => [4, 5]
  33.   }
  34.   AREA_BATTLE_SCAPES.default = []
  35.   BattleScape = Struct.new (:parallax_name, :z, :scroll_x, :scroll_y,
  36.                 :zoom_x, :zoom_y, :blend_type, :color, :tone, :opacity)
  37.   def self.battle_scape (scape_id)
  38.     @battle_scapes = [] if @battle_scapes.nil?
  39.     return @battle_scapes[scape_id] if @battle_scapes[scape_id] != nil
  40.     parallax_name, blend_type, color, tone = "", 0, [0, 0, 0, 0], [0, 0, 0]
  41.     z, scroll_x, scroll_y, zoom_x, zoom_y, opacity = 0, 0, 0, 100, 100, 255
  42.     case scape_id
  43.     when 1
  44.       parallax_name = "BlueSky"
  45.       z = 50
  46.       scroll_x = -10
  47.       scroll_y = 5
  48.       
  49.     when 2
  50.       parallax_name = "CloudySky"
  51.       scroll_x = -5
  52.     when 3
  53.       parallax_name = "Fog"
  54.       z = 150
  55.       scroll_x = -10
  56.       scroll_y = 5
  57.       blend_type = 2
  58.       opacity = 100
  59.     when 4
  60.       parallax_name = "Bridge"
  61.       z = 50
  62.       zoom_x = 85
  63.       zoom_y = 130
  64.     when 5
  65.       parallax_name = "BlueSky"
  66.       scroll_x = 2
  67.     end
  68.     @battle_scapes[scape_id] = BattleScape.new (parallax_name, z, scroll_x,
  69.       scroll_y, (zoom_x / 100.0), (zoom_y / 100.0), blend_type, color, tone, opacity)
  70.     return @battle_scapes[scape_id]
  71.   end
  72.   def self.map_battle_scapes (map_id)
  73.     scapes = []
  74.     MAP_BATTLE_SCAPES[map_id].each { |scape_id| scapes.push (self.battle_scape (scape_id)) }
  75.     return scapes
  76.   end
  77.   def self.area_battle_scapes (area_id)
  78.     scapes = []
  79.     AREA_BATTLE_SCAPES[area_id].each { |scape_id| scapes.push (self.battle_scape (scape_id)) }
  80.     return scapes
  81.   end
  82. end
  83. class Game_Map
  84.   def battle_scapes
  85.     $data_areas.values.each { |area|
  86.       if $game_player.in_area? (area) && !ModernAlgebra.area_battle_scapes (area.id).empty?
  87.         return ModernAlgebra.area_battle_scapes (area.id)
  88.       end
  89.     }
  90.     return ModernAlgebra.map_battle_scapes (@map_id)
  91.   end
  92. end
  93. class Spriteset_Battle
  94.   alias modernalgbr_terraintypes_crtbttlebck_63b5 create_battleback
  95.   def create_battleback (*args)
  96.     if $BTEST
  97.       modernalgbr_terraintypes_crtbttlebck_63b5 (*args)
  98.       return
  99.     end
  100.     @battle_scapes = $game_map.battle_scapes
  101.     @battle_planes = []
  102.     @battle_planes_xy = []
  103.     @battle_scapes.each { |battle_scape|
  104.       plane = Plane.new (@viewport1)
  105.       plane.z = battle_scape.z
  106.       plane.bitmap = Cache.parallax (battle_scape.parallax_name)
  107.       plane.zoom_x, plane.zoom_y = battle_scape.zoom_x, battle_scape.zoom_y
  108.       plane.blend_type = battle_scape.blend_type
  109.       plane.color = Color.new (*battle_scape.color)
  110.       plane.tone = Tone.new (*battle_scape.tone)
  111.       plane.opacity = battle_scape.opacity
  112.       @battle_planes.push (plane)
  113.       @battle_planes_xy.push ([0,0])
  114.     }  
  115.     if @battle_planes.empty?
  116.       modernalgbr_terraintypes_crtbttlebck_63b5 (*args)
  117.     else
  118.       Graphics.frame_reset
  119.     end
  120.   end
  121.   alias modrnalgbra_terratas_dspsebkbmp_74bt dispose_battleback_bitmap
  122.   def dispose_battleback_bitmap (*args)
  123.     modrnalgbra_terratas_dspsebkbmp_74bt (*args) unless @battleback_sprite.nil?
  124.     @battle_planes.each { |plane| plane.bitmap.dispose unless plane.bitmap.disposed? }
  125.   end
  126.   alias modrenalbr_dspsbb_terrintypes_09b6 dispose_battleback
  127.   def dispose_battleback (*args)
  128.     modrenalbr_dspsbb_terrintypes_09b6 (*args) unless @battleback_sprite.nil?
  129.     @battle_planes.each { |plane| plane.dispose }
  130.   end
  131.   alias modalg_bbckupd_trrantypes_52n5 update_battleback
  132.   def update_battleback (*args)
  133.     if @battleback_sprite.nil?
  134.       @battle_planes.each_index { |i|
  135.         x_y = @battle_planes_xy[i]
  136.         plane = @battle_planes[i]
  137.         scape = @battle_scapes[i]
  138.         x_y[0] += (scape.scroll_x * 2)
  139.         x_y[1] += (scape.scroll_y * 2)
  140.         plane.ox, plane.oy = (x_y[0] / 16), (x_y[1] / 16)
  141.       }
  142.     else
  143.       modalg_bbckupd_trrantypes_52n5 (*args)
  144.     end
  145.   end
  146. end
复制代码
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-9-29 16:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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