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

Project1

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

[已经解决] 换人脚本和地图作为战斗背景脚本冲突该怎么办?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
32 小时
注册时间
2014-2-4
帖子
26
跳转到指定楼层
1
发表于 2015-9-29 07:23:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
前些日子用了一个地图作为战斗背景的脚本,本来用着效果很好,但是后来引进换人脚本之后就冲突了,现在只剩下天气还能显示,地图无法作为战斗背景了。该怎么解决?




以下是我的脚本:
换人脚本
RUBY 代码复制
  1. module LimBattlePlug
  2.  
  3. # 队伍最大人数
  4. MaxPartySize = 7
  5.  
  6. # 出战人数
  7. MaxBattlerSize = 1
  8.  
  9. # 换人语句
  10. WordChangeBattler = "更换精灵"
  11.  
  12. # 换人时播放的动画
  13. AnimationChangeBattler = 26
  14.  
  15. end
  16.  
  17. class Game_BattleAction
  18.   attr_accessor :change_to_battler
  19.   # 初始化
  20.   alias lbp_initialize initialize
  21.   def initialize
  22.     lbp_initialize
  23.     @change_to_battler = 0
  24.   end
  25.   # 欲更换角色编号
  26.   def set_change_battler
  27.     @kind = 3
  28.   end
  29.   # 判断行动是否为更换角色
  30.   def is_change_battler?
  31.     return (@kind == 3)
  32.   end
  33. end
  34.  
  35. class Game_Party
  36.   include LimBattlePlug
  37.   attr_reader :actors2
  38.   alias lpb_initialize initialize
  39.   def initialize
  40.     lpb_initialize
  41.     @actors2 = []
  42.   end
  43.   # 角色加入
  44.   def add_actor(actor_id)
  45.     actor = $game_actors[actor_id]
  46.     if @actors.size < MaxPartySize and not @actors.include?(actor)
  47.       @actors.push(actor)
  48.       $game_player.refresh
  49.     end
  50.   end
  51.   # 设置战斗的角色
  52.   def set_actor_to_battle
  53.     @actors2 = []
  54.     @actors.each do |actor|
  55.       @actors2.push(actor)
  56.     end
  57.     @actors = []
  58.     dead_actor = []
  59.     @actors2.each do |actor|
  60.       if !actor.dead?
  61.         @actors.push(actor)
  62.       else
  63.         dead_actor.push(actor)
  64.       end
  65.       break if @actors.size == MaxBattlerSize
  66.     end
  67.     if @actors.size < MaxBattlerSize
  68.       for actor in dead_actor
  69.         @actors.push(actor)
  70.         break if @actors.size == MaxBattlerSize
  71.       end
  72.     end
  73.   end
  74.   # 还原战斗的角色
  75.   def set_actor_to_normal
  76.     @actors = []
  77.     @actors2.each do |actor|
  78.       @actors.push(actor)
  79.     end
  80.   end
  81.   # 获取角色id数组
  82.   def get_actors_id
  83.     id = []
  84.     @actors.each{|actor|id.push(actor.id)}
  85.     return id
  86.   end
  87.   # 获取角色id数组
  88.   def get_actors2_id
  89.     id = []
  90.     @actors2.each{|actor|id.push(actor.id)}
  91.     return id
  92.   end
  93.   # 兑换角色
  94.   def change_actor(index,id)
  95.     @actors[index] = $game_actors[id]
  96.   end
  97.   # 全灭判定
  98.   def all_dead?
  99.     # 同伴人数为 0 的情况下
  100.     if $game_party.actors.size == 0
  101.       return false
  102.     end
  103.     # 同伴中无人 HP 在 0 以上
  104.     for actor in @actors2
  105.       if actor.hp > 0
  106.         return false
  107.       end
  108.     end
  109.     for actor in @actors
  110.       if actor.hp > 0
  111.         return false
  112.       end
  113.     end
  114.     # 全灭
  115.     return true
  116.   end
  117.   # 其他角色
  118.   def other_actors
  119.     actors = []
  120.     @actors2.each{|actor|actors.push(actor) if !@actors.include?(actor)}
  121.     return actors
  122.   end
  123.   # 角色位置互换
  124.   def change_actor_pos(id1,id2)
  125.     actor_id = []
  126.     @actors.each do |actor|
  127.       actor_id.push(actor.id)
  128.     end
  129.     return if !actor_id.include?(id1) and !actor_id.include?(id2)
  130.     id1_index = id2_index = -1
  131.     (0...actor_id.size).each do |i|
  132.       if actor_id[i] == id1
  133.         id1_index = i
  134.       elsif actor_id[i] == id2
  135.         id2_index = i
  136.       end
  137.     end
  138.     temp_actor = @actors[id1_index]
  139.     @actors[id1_index] = @actors[id2_index]
  140.     @actors[id2_index] = temp_actor
  141.   end
  142. end
  143.  
  144. class Window_Actor < Window_Selectable
  145.   # 初始化
  146.   def initialize
  147.     super(0,64,640,256)
  148.     self.back_opacity = 160
  149.     refresh
  150.     self.index = -1
  151.     self.active = false
  152.   end
  153.   # 刷新
  154.   def refresh
  155.     @item_max = $game_party.actors2.size
  156.     @data = []
  157.     $game_party.actors.each do |actor|
  158.       @data.push(actor)
  159.     end
  160.     $game_party.actors2.each do |actor|
  161.       @data.push(actor) if !@data.include?(actor)
  162.     end
  163.     if self.contents != nil
  164.       self.contents.clear
  165.       self.contents = nil
  166.     end
  167.     self.contents = Bitmap.new(608,@data.size*32)
  168.     x = 4
  169.     y = 0
  170.     @data.each do |actor|
  171.       bitmap = RPG::Cache.character(actor.character_name,actor.character_hue)
  172.       rect = Rect.new(0,0,bitmap.width/4,31)
  173.       self.contents.blt(x+16-bitmap.width/8,y,bitmap,rect)
  174.       draw_actor_name(actor,x+36,y)
  175.       draw_actor_state(actor,156,y)
  176.       draw_actor_hp(actor,x+256,y,96)
  177.       draw_actor_sp(actor,x+376,y,96)
  178.       if $game_party.actors.include?(actor)
  179.         self.contents.font.color = text_color(6)
  180.         cword = "出战"
  181.       else
  182.         self.contents.font.color = text_color(0)
  183.         cword = "待战"
  184.       end
  185.       self.contents.draw_text(x+496,y,60,32,cword)
  186.       y += 32
  187.     end
  188.   end
  189.   # 获取当前角色编号
  190.   def actor_id
  191.     return @data[self.index].id
  192.   end
  193.   # 刷新帮助
  194.   def update_help
  195.     @help_window.set_text(@data[self.index] == nil ?\
  196.                           "" : @data[self.index].name)
  197.   end
  198. end
  199.  
  200. class Scene_Battle
  201.   include LimBattlePlug
  202.   # 初始化
  203.   def initialize
  204.     $game_party.set_actor_to_battle
  205.   end
  206.   # 主处理
  207.   def main
  208.     # 初始化战斗用的各种暂时数据
  209.     $game_temp.in_battle = true
  210.     $game_temp.battle_turn = 0
  211.     $game_temp.battle_event_flags.clear
  212.     $game_temp.battle_abort = false
  213.     $game_temp.battle_main_phase = false
  214.     $game_temp.battleback_name = $game_map.battleback_name
  215.     $game_temp.forcing_battler = nil
  216.     # 初始化战斗用事件解释器
  217.     $game_system.battle_interpreter.setup(nil, 0)
  218.     # 准备队伍
  219.     @troop_id = $game_temp.battle_troop_id
  220.     $game_troop.setup(@troop_id)
  221.     # 生成角色命令窗口
  222.     s1 = $data_system.words.attack
  223.     s2 = $data_system.words.skill
  224.     s3 = $data_system.words.guard
  225.     s4 = $data_system.words.item
  226.     s5 = WordChangeBattler
  227.     @actor_command_window = Window_Command.new(160, [s2, s3, s4,s5])
  228.     @actor_command_window.y = 128+32
  229.     @actor_command_window.back_opacity = 160
  230.     @actor_command_window.active = false
  231.     @actor_command_window.visible = false
  232.     # 生成其它窗口
  233.     @party_command_window = Window_PartyCommand.new
  234.     @help_window = Window_Help.new
  235.     @help_window.back_opacity = 160
  236.     @help_window.visible = false
  237.     @status_window = Window_BattleStatus.new
  238.     @message_window = Window_Message.new
  239.     # 生成活动块
  240.     @spriteset = Spriteset_Battle.new
  241.     # 初始化等待计数
  242.     @wait_count = 0
  243.     # 执行过渡
  244.     if $data_system.battle_transition == ""
  245.       Graphics.transition(20)
  246.     else
  247.       Graphics.transition(40, "Graphics/Transitions/" +
  248.         $data_system.battle_transition)
  249.     end
  250.     # 开始自由战斗回合
  251.     start_phase1
  252.     # 主循环
  253.     loop do
  254.       # 刷新游戏画面
  255.       Graphics.update
  256.       # 刷新输入信息
  257.       Input.update
  258.       # 刷新画面
  259.       update
  260.       # 如果画面切换的话就中断循环
  261.       if $scene != self
  262.         break
  263.       end
  264.     end
  265.     # 刷新地图
  266.     $game_map.refresh
  267.     # 准备过渡
  268.     Graphics.freeze
  269.     # 释放窗口
  270.     @actor_command_window.dispose
  271.     @party_command_window.dispose
  272.     @help_window.dispose
  273.     @status_window.dispose
  274.     @message_window.dispose
  275.     if @skill_window != nil
  276.       @skill_window.dispose
  277.     end
  278.     if @item_window != nil
  279.       @item_window.dispose
  280.     end
  281.     if @actor_window != nil
  282.       @actor_window.dispose
  283.     end
  284.     if @result_window != nil
  285.       @result_window.dispose
  286.     end
  287.     # 释放活动块
  288.     @spriteset.dispose
  289.     # 标题画面切换中的情况
  290.     if $scene.is_a?(Scene_Title)
  291.       # 淡入淡出画面
  292.       Graphics.transition
  293.       Graphics.freeze
  294.     end
  295.     # 战斗测试或者游戏结束以外的画面切换中的情况
  296.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  297.       $scene = nil
  298.     end
  299.   end
  300.   # 战斗结束
  301.   alias lpb_battle_end battle_end
  302.   def battle_end(n)
  303.     lpb_battle_end(n)
  304.     $game_party.set_actor_to_normal
  305.   end
  306.   # 开始回合3
  307.   alias lbp_start_phase3 start_phase3
  308.   def start_phase3
  309.     @changed_battler_id = []
  310.     lbp_start_phase3
  311.   end
  312.   # 刷新角色命令回合画面
  313.   def update_phase3
  314.     # 敌人光标有效的情况下
  315.     if @enemy_arrow != nil
  316.       update_phase3_enemy_select
  317.     # 角色光标有效的情况下
  318.     elsif @actor_arrow != nil
  319.       update_phase3_actor_select
  320.     # 特技窗口有效的情况下
  321.     elsif @skill_window != nil
  322.       update_phase3_skill_select
  323.     # 物品窗口有效的情况下
  324.     elsif @item_window != nil
  325.       update_phase3_item_select
  326.     elsif @actor_window != nil
  327.       update_phase3_battler_select
  328.     # 角色指令窗口有效的情况下
  329.     elsif @actor_command_window.active
  330.       update_phase3_basic_command
  331.     end
  332.   end
  333.   # 角色基本命令
  334.   def update_phase3_basic_command
  335.     # 按下 B 键的情况下
  336.     if Input.trigger?(Input::B)
  337.       # 演奏取消 SE
  338.       $game_system.se_play($data_system.cancel_se)
  339.       # 转向前一个角色的指令输入
  340.       phase3_prior_actor
  341.       return
  342.     end
  343.     # 按下 C 键的情况下
  344.     if Input.trigger?(Input::C)
  345.       # 角色指令窗口光标位置分之
  346.       case @actor_command_window.index
  347.       #when 0  # 攻击
  348.       #  # 演奏确定 SE
  349.       #  $game_system.se_play($data_system.decision_se)
  350.       #  # 设置行动
  351.       #  @active_battler.current_action.kind = 0
  352.       #  @active_battler.current_action.basic = 0
  353.       #  # 开始选择敌人
  354.       #  start_enemy_select
  355.       when 0  # 特技
  356.         # 演奏确定 SE
  357.         $game_system.se_play($data_system.decision_se)
  358.         # 设置行动
  359.         @active_battler.current_action.kind = 1
  360.         # 开始选择特技
  361.         start_skill_select
  362.       when 1  # 防御
  363.         # 演奏确定 SE
  364.         $game_system.se_play($data_system.decision_se)
  365.         # 设置行动
  366.         @active_battler.current_action.kind = 0
  367.         @active_battler.current_action.basic = 1
  368.         # 转向下一位角色的指令输入
  369.         phase3_next_actor
  370.       when 2  # 物品
  371.         # 演奏确定 SE
  372.         $game_system.se_play($data_system.decision_se)
  373.         # 设置行动
  374.         @active_battler.current_action.kind = 2
  375.         # 开始选择物品
  376.         start_item_select
  377.       when 3 # 换人
  378.         $game_system.se_play($data_system.decision_se)
  379.         @active_battler.current_action.set_change_battler
  380.         start_battler_select
  381.       end
  382.       return
  383.     end
  384.   end
  385.   # 开始角色选择
  386.   def start_battler_select
  387.     @actor_window = Window_Actor.new
  388.     @actor_window.active = true
  389.     @actor_window.index = 0
  390.     @actor_window.help_window = @help_window
  391.     @actor_command_window.active = false
  392.     @actor_command_window.visible = false
  393.   end
  394.   # 结束角色选择
  395.   def end_battler_select
  396.     @actor_window.dispose
  397.     @actor_window = nil
  398.     @help_window.visible = false
  399.     @actor_command_window.active = true
  400.     @actor_command_window.visible = true
  401.   end
  402.   # 刷新角色选择
  403.   def update_phase3_battler_select
  404.     @actor_window.visible = true
  405.     @actor_window.update
  406.     if Input.trigger?(Input::B)
  407.       $game_system.se_play($data_system.cancel_se)
  408.       end_battler_select
  409.       return
  410.     end
  411.     if Input.trigger?(Input::C)
  412.       actor_id = @actor_window.actor_id
  413.       if $game_party.get_actors_id.include?(actor_id) or
  414.          $game_actors[actor_id].dead? or
  415.          @changed_battler_id.include?(actor_id)
  416.         $game_system.se_play($data_system.buzzer_se)
  417.         return
  418.       end
  419.       $game_system.se_play($data_system.decision_se)
  420.       @active_battler.current_action.change_to_battler = actor_id
  421.       @changed_battler_id.push(actor_id)
  422.       end_battler_select
  423.       phase3_next_actor
  424.       return
  425.     end
  426.   end
  427.   # 行动方动画
  428.   def update_phase4_step3
  429.     if @active_battler.current_action.is_change_battler?
  430.       @animation1_id = AnimationChangeBattler
  431.       @target_battlers = []
  432.     end
  433.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  434.     if @animation1_id == 0
  435.       @active_battler.white_flash = true
  436.     else
  437.       @active_battler.animation_id = @animation1_id
  438.       @active_battler.animation_hit = true
  439.     end
  440.     # 移至步骤 4
  441.     @phase4_step = 4
  442.   end
  443.   def update_phase4_step1
  444.     # 隐藏帮助窗口
  445.     @help_window.visible = false
  446.     # 判定胜败
  447.     if judge
  448.       # 胜利或者失败的情况下 : 过程结束
  449.       return
  450.     end
  451.     # 强制行动的战斗者不存在的情况下
  452.     if $game_temp.forcing_battler == nil
  453.       # 设置战斗事件
  454.       setup_battle_event
  455.       # 执行战斗事件中的情况下
  456.       if $game_system.battle_interpreter.running?
  457.         return
  458.       end
  459.     end
  460.     # 强制行动的战斗者存在的情况下
  461.     if $game_temp.forcing_battler != nil
  462.       # 在头部添加后移动
  463.       @action_battlers.delete($game_temp.forcing_battler)
  464.       @action_battlers.unshift($game_temp.forcing_battler)
  465.     end
  466.     # 未行动的战斗者不存在的情况下 (全员已经行动)
  467.     if @action_battlers.size == 0
  468.       # 开始同伴命令回合
  469.       start_phase2
  470.       return
  471.     end
  472.     # 初始化动画 ID 和公共事件 ID
  473.     @animation1_id = 0
  474.     @animation2_id = 0
  475.     @common_event_id = 0
  476.     # 未行动的战斗者移动到序列的头部
  477.     @active_battler = @action_battlers.shift
  478.     # 如果已经在战斗之外的情况下
  479.     if @active_battler.index == nil
  480.       return
  481.     end
  482.     # 连续伤害
  483.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  484.       @active_battler.slip_damage_effect
  485.       @active_battler.damage_pop = true
  486.       update_phase4_step5
  487.       update_phase4_step6
  488.     end
  489.     # 自然解除状态
  490.     @active_battler.remove_states_auto
  491.     # 刷新状态窗口
  492.     @status_window.refresh
  493.     # 移至步骤 2
  494.     @phase4_step = 2
  495.   end
  496.   # 对象方动画
  497.   def update_phase4_step4
  498.     if @active_battler.current_action.is_change_battler?
  499.       actor1_id = @active_battler.current_action.change_to_battler
  500.       actor2_id = @active_battler.id
  501.       (0...$game_party.actors.size).each do |i|
  502.         if $game_party.actors[i].id == actor2_id
  503.           $game_party.change_actor(i,actor1_id)
  504.           @active_battler = $game_actors[actor1_id]
  505.           @status_window.refresh
  506.         end
  507.       end
  508.     end
  509.     # 对像方动画
  510.     for target in @target_battlers
  511.       target.animation_id = @animation2_id
  512.       target.animation_hit = (target.damage != "Miss")
  513.     end
  514.     # 限制动画长度、最低 8 帧
  515.     @wait_count = 8
  516.     # 移至步骤 5
  517.     @phase4_step = 5
  518.   end
  519.   # 公共事件
  520.   def update_phase4_step6
  521.     @target_battlers.each do |target|
  522.       if target.is_a?(Game_Actor) and target.dead? and
  523.          !$game_party.other_actors.all?{|actor|actor.dead?}
  524.         @actor_window = Window_Actor.new
  525.         @actor_window.index = 0
  526.         @actor_window.active = true
  527.         @actor_window.help_window = @help_window
  528.         actor_id = -1
  529.         loop do
  530.           Graphics.update
  531.           Input.update
  532.           @actor_window.update
  533.           if Input.trigger?(Input::C)
  534.             actor = $game_actors[@actor_window.actor_id]
  535.             if actor.dead? or
  536.                (@changed_battler_id.include?(actor.id) and
  537.                 target.current_action.change_to_battler != actor.id) or
  538.                $game_party.actors.include?(actor)
  539.               $game_system.se_play($data_system.buzzer_se)
  540.             else
  541.               actor_id = actor.id
  542.             end
  543.           end
  544.           break if actor_id >= 0
  545.         end
  546.         @actor_window.visible = false
  547.         @actor_window.dispose
  548.         @actor_window = nil
  549.         @help_window.visible = false
  550.         (0...$game_party.actors.size).each do |i|
  551.           if $game_party.actors[i].id == target.id
  552.             $game_party.change_actor(i,actor_id)
  553.             @status_window.refresh
  554.           end
  555.         end
  556.       end
  557.     end
  558.     # 清除强制行动对像的战斗者
  559.     $game_temp.forcing_battler = nil
  560.     # 公共事件 ID 有效的情况下
  561.     if @common_event_id > 0
  562.       # 设置事件
  563.       common_event = $data_common_events[@common_event_id]
  564.       $game_system.battle_interpreter.setup(common_event.list, 0)
  565.     end
  566.     # 移至步骤 1
  567.     @phase4_step = 1
  568.   end
  569. end
  570.  
  571. class Window_MenuStatus
  572.   def refresh
  573.     self.contents.clear
  574.     @item_max = $game_party.actors.size
  575.     for i in 0...$game_party.actors.size
  576.       x = 4
  577.       y = i * 32
  578.       actor = $game_party.actors[i]
  579.       bitmap = RPG::Cache.character(actor.character_name,actor.character_hue)
  580.       rect = Rect.new(0,0,bitmap.width/4,31)
  581.       self.contents.blt(x+16-bitmap.width/8,y,bitmap,rect)
  582.       draw_actor_name(actor, x+36, y)
  583.       draw_actor_state(actor, x + 136,y)
  584.       draw_actor_hp(actor, x + 236, y,96)
  585.       draw_actor_sp(actor, x + 336, y,96)
  586.     end
  587.   end
  588.   def update_cursor_rect
  589.     super
  590.   end
  591. end




地图作为战斗背景脚本
RUBY 代码复制
  1. #===============================================================
  2. # 本脚本来自[url]www.66rpg.com[/url]
  3. # 功能:对于没有设置战斗背景的地图,直接用地图做战斗背景
  4. #===============================================================
  5. #==============================================================================
  6. # ■ Spriteset_Map
  7. #------------------------------------------------------------------------------
  8. #  处理地图画面活动块和元件的类。本类在
  9. # Scene_Map 类的内部使用。
  10. #==============================================================================
  11. class Spriteset_Map
  12. #--------------------------------------------------------------------------
  13. # ● 初始化对像
  14. #--------------------------------------------------------------------------
  15. def initialize(flag = false)
  16.    # 生成显示端口
  17.    @viewport1 = Viewport.new(0, 0, 1024, 704)
  18.    @viewport2 = Viewport.new(0, 0, 1024, 704)
  19.    @viewport3 = Viewport.new(0, 0, 1024, 704)
  20.    @viewport2.z = 200
  21.    @viewport3.z = 5000
  22.    # 生成元件地图
  23.    @tilemap = Tilemap.new(@viewport1)
  24.    @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
  25.    for i in 0..6
  26.      autotile_name = $game_map.autotile_names[i]
  27.      @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
  28.    end
  29.    @tilemap.map_data = $game_map.data
  30.    @tilemap.priorities = $game_map.priorities
  31.    # 生成远景平面
  32.    @panorama = Plane.new(@viewport1)
  33.    @panorama.z = -1000
  34.    # 生成雾平面
  35.    @fog = Plane.new(@viewport1)
  36.    @fog.z = 3000
  37.    unless flag
  38.      # 生成角色活动块
  39.      @character_sprites = []
  40.      for i in $game_map.events.keys.sort
  41.        sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
  42.        @character_sprites.push(sprite)
  43.      end
  44.      @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  45.    end
  46.    # 生成天气
  47.    @weather = RPG::Weather.new(@viewport1)
  48.    # 生成图片
  49.    @picture_sprites = [48]
  50.    for i in 1..50
  51.      @picture_sprites.push(Sprite_Picture.new(@viewport2,
  52.        $game_screen.pictures[i]))
  53.    end
  54.    # 生成计时器块
  55.    @timer_sprite = Sprite_Timer.new
  56.    # 刷新画面
  57.    update
  58. end
  59. #--------------------------------------------------------------------------
  60. # ● 释放
  61. #--------------------------------------------------------------------------
  62. def dispose(flag = false)
  63.    # 释放元件地图
  64.    @tilemap.tileset.dispose
  65.    for i in 0..6
  66.      @tilemap.autotiles[i].dispose
  67.    end
  68.    @tilemap.dispose
  69.    # 释放远景平面
  70.    @panorama.dispose
  71.    # 释放雾平面
  72.    @fog.dispose
  73.    unless flag
  74.      # 释放角色活动块
  75.      for sprite in @character_sprites
  76.        sprite.dispose
  77.      end
  78.    end
  79.    # 释放天候
  80.    @weather.dispose
  81.    # 释放图片
  82.    for sprite in @picture_sprites
  83.      sprite.dispose
  84.    end
  85.    # 释放计时器块
  86.    @timer_sprite.dispose
  87.    # 释放显示端口
  88.    @viewport1.dispose
  89.    @viewport2.dispose
  90.    @viewport3.dispose
  91. end
  92. #--------------------------------------------------------------------------
  93. # ● 刷新画面
  94. #--------------------------------------------------------------------------
  95. def update
  96.    # 远景与现在的情况有差异发情况下
  97.    if @panorama_name != $game_map.panorama_name or
  98.       @panorama_hue != $game_map.panorama_hue
  99.      @panorama_name = $game_map.panorama_name
  100.      @panorama_hue = $game_map.panorama_hue
  101.      if @panorama.bitmap != nil
  102.        @panorama.bitmap.dispose
  103.        @panorama.bitmap = nil
  104.      end
  105.      if @panorama_name != ""
  106.        @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
  107.      end
  108.      Graphics.frame_reset
  109.    end
  110.    # 雾与现在的情况有差异的情况下
  111.    if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
  112.      @fog_name = $game_map.fog_name
  113.      @fog_hue = $game_map.fog_hue
  114.      if @fog.bitmap != nil
  115.        @fog.bitmap.dispose
  116.        @fog.bitmap = nil
  117.      end
  118.      if @fog_name != ""
  119.        @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
  120.      end
  121.      Graphics.frame_reset
  122.    end
  123.    # 刷新元件地图
  124.    @tilemap.ox = $game_map.display_x / 4
  125.    @tilemap.oy = $game_map.display_y / 4
  126.    @tilemap.update
  127.    # 刷新远景平面
  128.    @panorama.ox = $game_map.display_x / 8
  129.    @panorama.oy = $game_map.display_y / 8
  130.    # 刷新雾平面
  131.    @fog.zoom_x = $game_map.fog_zoom / 100.0
  132.    @fog.zoom_y = $game_map.fog_zoom / 100.0
  133.    @fog.opacity = $game_map.fog_opacity
  134.    @fog.blend_type = $game_map.fog_blend_type
  135.    @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
  136.    @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
  137.    @fog.tone = $game_map.fog_tone
  138.    if @character_sprites != nil
  139.      # 刷新角色活动块
  140.      for sprite in @character_sprites
  141.        sprite.update
  142.      end
  143.    end
  144.    # 刷新天候图形
  145.    @weather.type = $game_screen.weather_type
  146.    @weather.max = $game_screen.weather_max
  147.    @weather.ox = $game_map.display_x / 4
  148.    @weather.oy = $game_map.display_y / 4
  149.    @weather.update
  150.    # 刷新图片
  151.    for sprite in @picture_sprites
  152.      sprite.update
  153.    end
  154.    # 刷新计时器块
  155.    @timer_sprite.update
  156.    # 设置画面的色调与震动位置
  157.    @viewport1.tone = $game_screen.tone
  158.    @viewport1.ox = $game_screen.shake
  159.    # 设置画面的闪烁色
  160.    @viewport3.color = $game_screen.flash_color
  161.    # 刷新显示端口
  162.    @viewport1.update
  163.    @viewport3.update
  164. end
  165. end
  166. #===============================================================
  167. class Scene_Battle
  168. alias battleback_map_main main
  169. def main
  170. @battleback_sprite = Spriteset_Map.new(true)
  171. battleback_map_main
  172. @battleback_sprite.dispose(true)
  173. end
  174. end
  175. #===============================================================
  176. # 申请者:张永;脚本作者:bluefool 改进人:亿万星辰  完美化:IKKI
  177. #===============================================================

Lv1.梦旅人

梦石
0
星屑
76
在线时间
1379 小时
注册时间
2012-7-5
帖子
1698

开拓者

2
发表于 2015-9-29 09:56:47 | 只看该作者
把换人脚本放到地图背景脚本上面试试

点评

0.0成功了……谢谢!  发表于 2015-9-29 11:40

评分

参与人数 1星屑 +150 收起 理由
RyanBern + 150 认可答案

查看全部评分


  -fk: -azogi:
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-19 09:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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