查看: 2077|回复: 1

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

[复制链接]
梦石
0
星屑
50
在线时间
32 小时
注册时间
2014-2-4
回帖
19
发表于 2015-9-29 07:23:55 | 显示全部楼层 |阅读模式

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

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

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




以下是我的脚本:
换人脚本
  1. module LimBattlePlug

  2. # 队伍最大人数
  3. MaxPartySize = 7

  4. # 出战人数
  5. MaxBattlerSize = 1

  6. # 换人语句
  7. WordChangeBattler = "更换精灵"

  8. # 换人时播放的动画
  9. AnimationChangeBattler = 26

  10. end

  11. class Game_BattleAction
  12.   attr_accessor :change_to_battler
  13.   # 初始化
  14.   alias lbp_initialize initialize
  15.   def initialize
  16.     lbp_initialize
  17.     @change_to_battler = 0
  18.   end
  19.   # 欲更换角色编号
  20.   def set_change_battler
  21.     @kind = 3
  22.   end
  23.   # 判断行动是否为更换角色
  24.   def is_change_battler?
  25.     return (@kind == 3)
  26.   end
  27. end

  28. class Game_Party
  29.   include LimBattlePlug
  30.   attr_reader :actors2
  31.   alias lpb_initialize initialize
  32.   def initialize
  33.     lpb_initialize
  34.     @actors2 = []
  35.   end
  36.   # 角色加入
  37.   def add_actor(actor_id)
  38.     actor = $game_actors[actor_id]
  39.     if @actors.size < MaxPartySize and not @actors.include?(actor)
  40.       @actors.push(actor)
  41.       $game_player.refresh
  42.     end
  43.   end
  44.   # 设置战斗的角色
  45.   def set_actor_to_battle
  46.     @actors2 = []
  47.     @actors.each do |actor|
  48.       @actors2.push(actor)
  49.     end
  50.     @actors = []
  51.     dead_actor = []
  52.     @actors2.each do |actor|
  53.       if !actor.dead?
  54.         @actors.push(actor)
  55.       else
  56.         dead_actor.push(actor)
  57.       end
  58.       break if @actors.size == MaxBattlerSize
  59.     end
  60.     if @actors.size < MaxBattlerSize
  61.       for actor in dead_actor
  62.         @actors.push(actor)
  63.         break if @actors.size == MaxBattlerSize
  64.       end
  65.     end
  66.   end
  67.   # 还原战斗的角色
  68.   def set_actor_to_normal
  69.     @actors = []
  70.     @actors2.each do |actor|
  71.       @actors.push(actor)
  72.     end
  73.   end
  74.   # 获取角色id数组
  75.   def get_actors_id
  76.     id = []
  77.     @actors.each{|actor|id.push(actor.id)}
  78.     return id
  79.   end
  80.   # 获取角色id数组
  81.   def get_actors2_id
  82.     id = []
  83.     @actors2.each{|actor|id.push(actor.id)}
  84.     return id
  85.   end
  86.   # 兑换角色
  87.   def change_actor(index,id)
  88.     @actors[index] = $game_actors[id]
  89.   end
  90.   # 全灭判定
  91.   def all_dead?
  92.     # 同伴人数为 0 的情况下
  93.     if $game_party.actors.size == 0
  94.       return false
  95.     end
  96.     # 同伴中无人 HP 在 0 以上
  97.     for actor in @actors2
  98.       if actor.hp > 0
  99.         return false
  100.       end
  101.     end
  102.     for actor in @actors
  103.       if actor.hp > 0
  104.         return false
  105.       end
  106.     end
  107.     # 全灭
  108.     return true
  109.   end
  110.   # 其他角色
  111.   def other_actors
  112.     actors = []
  113.     @actors2.each{|actor|actors.push(actor) if !@actors.include?(actor)}
  114.     return actors
  115.   end
  116.   # 角色位置互换
  117.   def change_actor_pos(id1,id2)
  118.     actor_id = []
  119.     @actors.each do |actor|
  120.       actor_id.push(actor.id)
  121.     end
  122.     return if !actor_id.include?(id1) and !actor_id.include?(id2)
  123.     id1_index = id2_index = -1
  124.     (0...actor_id.size).each do |i|
  125.       if actor_id[i] == id1
  126.         id1_index = i
  127.       elsif actor_id[i] == id2
  128.         id2_index = i
  129.       end
  130.     end
  131.     temp_actor = @actors[id1_index]
  132.     @actors[id1_index] = @actors[id2_index]
  133.     @actors[id2_index] = temp_actor
  134.   end
  135. end

  136. class Window_Actor < Window_Selectable
  137.   # 初始化
  138.   def initialize
  139.     super(0,64,640,256)
  140.     self.back_opacity = 160
  141.     refresh
  142.     self.index = -1
  143.     self.active = false
  144.   end
  145.   # 刷新
  146.   def refresh
  147.     @item_max = $game_party.actors2.size
  148.     @data = []
  149.     $game_party.actors.each do |actor|
  150.       @data.push(actor)
  151.     end
  152.     $game_party.actors2.each do |actor|
  153.       @data.push(actor) if !@data.include?(actor)
  154.     end
  155.     if self.contents != nil
  156.       self.contents.clear
  157.       self.contents = nil
  158.     end
  159.     self.contents = Bitmap.new(608,@data.size*32)
  160.     x = 4
  161.     y = 0
  162.     @data.each do |actor|
  163.       bitmap = RPG::Cache.character(actor.character_name,actor.character_hue)
  164.       rect = Rect.new(0,0,bitmap.width/4,31)
  165.       self.contents.blt(x+16-bitmap.width/8,y,bitmap,rect)
  166.       draw_actor_name(actor,x+36,y)
  167.       draw_actor_state(actor,156,y)
  168.       draw_actor_hp(actor,x+256,y,96)
  169.       draw_actor_sp(actor,x+376,y,96)
  170.       if $game_party.actors.include?(actor)
  171.         self.contents.font.color = text_color(6)
  172.         cword = "出战"
  173.       else
  174.         self.contents.font.color = text_color(0)
  175.         cword = "待战"
  176.       end
  177.       self.contents.draw_text(x+496,y,60,32,cword)
  178.       y += 32
  179.     end
  180.   end
  181.   # 获取当前角色编号
  182.   def actor_id
  183.     return @data[self.index].id
  184.   end
  185.   # 刷新帮助
  186.   def update_help
  187.     @help_window.set_text(@data[self.index] == nil ?\
  188.                           "" : @data[self.index].name)
  189.   end
  190. end

  191. class Scene_Battle
  192.   include LimBattlePlug
  193.   # 初始化
  194.   def initialize
  195.     $game_party.set_actor_to_battle
  196.   end
  197.   # 主处理
  198.   def main
  199.     # 初始化战斗用的各种暂时数据
  200.     $game_temp.in_battle = true
  201.     $game_temp.battle_turn = 0
  202.     $game_temp.battle_event_flags.clear
  203.     $game_temp.battle_abort = false
  204.     $game_temp.battle_main_phase = false
  205.     $game_temp.battleback_name = $game_map.battleback_name
  206.     $game_temp.forcing_battler = nil
  207.     # 初始化战斗用事件解释器
  208.     $game_system.battle_interpreter.setup(nil, 0)
  209.     # 准备队伍
  210.     @troop_id = $game_temp.battle_troop_id
  211.     $game_troop.setup(@troop_id)
  212.     # 生成角色命令窗口
  213.     s1 = $data_system.words.attack
  214.     s2 = $data_system.words.skill
  215.     s3 = $data_system.words.guard
  216.     s4 = $data_system.words.item
  217.     s5 = WordChangeBattler
  218.     @actor_command_window = Window_Command.new(160, [s2, s3, s4,s5])
  219.     @actor_command_window.y = 128+32
  220.     @actor_command_window.back_opacity = 160
  221.     @actor_command_window.active = false
  222.     @actor_command_window.visible = false
  223.     # 生成其它窗口
  224.     @party_command_window = Window_PartyCommand.new
  225.     @help_window = Window_Help.new
  226.     @help_window.back_opacity = 160
  227.     @help_window.visible = false
  228.     @status_window = Window_BattleStatus.new
  229.     @message_window = Window_Message.new
  230.     # 生成活动块
  231.     @spriteset = Spriteset_Battle.new
  232.     # 初始化等待计数
  233.     @wait_count = 0
  234.     # 执行过渡
  235.     if $data_system.battle_transition == ""
  236.       Graphics.transition(20)
  237.     else
  238.       Graphics.transition(40, "Graphics/Transitions/" +
  239.         $data_system.battle_transition)
  240.     end
  241.     # 开始自由战斗回合
  242.     start_phase1
  243.     # 主循环
  244.     loop do
  245.       # 刷新游戏画面
  246.       Graphics.update
  247.       # 刷新输入信息
  248.       Input.update
  249.       # 刷新画面
  250.       update
  251.       # 如果画面切换的话就中断循环
  252.       if $scene != self
  253.         break
  254.       end
  255.     end
  256.     # 刷新地图
  257.     $game_map.refresh
  258.     # 准备过渡
  259.     Graphics.freeze
  260.     # 释放窗口
  261.     @actor_command_window.dispose
  262.     @party_command_window.dispose
  263.     @help_window.dispose
  264.     @status_window.dispose
  265.     @message_window.dispose
  266.     if @skill_window != nil
  267.       @skill_window.dispose
  268.     end
  269.     if @item_window != nil
  270.       @item_window.dispose
  271.     end
  272.     if @actor_window != nil
  273.       @actor_window.dispose
  274.     end
  275.     if @result_window != nil
  276.       @result_window.dispose
  277.     end
  278.     # 释放活动块
  279.     @spriteset.dispose
  280.     # 标题画面切换中的情况
  281.     if $scene.is_a?(Scene_Title)
  282.       # 淡入淡出画面
  283.       Graphics.transition
  284.       Graphics.freeze
  285.     end
  286.     # 战斗测试或者游戏结束以外的画面切换中的情况
  287.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  288.       $scene = nil
  289.     end
  290.   end
  291.   # 战斗结束
  292.   alias lpb_battle_end battle_end
  293.   def battle_end(n)
  294.     lpb_battle_end(n)
  295.     $game_party.set_actor_to_normal
  296.   end
  297.   # 开始回合3
  298.   alias lbp_start_phase3 start_phase3
  299.   def start_phase3
  300.     @changed_battler_id = []
  301.     lbp_start_phase3
  302.   end
  303.   # 刷新角色命令回合画面
  304.   def update_phase3
  305.     # 敌人光标有效的情况下
  306.     if @enemy_arrow != nil
  307.       update_phase3_enemy_select
  308.     # 角色光标有效的情况下
  309.     elsif @actor_arrow != nil
  310.       update_phase3_actor_select
  311.     # 特技窗口有效的情况下
  312.     elsif @skill_window != nil
  313.       update_phase3_skill_select
  314.     # 物品窗口有效的情况下
  315.     elsif @item_window != nil
  316.       update_phase3_item_select
  317.     elsif @actor_window != nil
  318.       update_phase3_battler_select
  319.     # 角色指令窗口有效的情况下
  320.     elsif @actor_command_window.active
  321.       update_phase3_basic_command
  322.     end
  323.   end
  324.   # 角色基本命令
  325.   def update_phase3_basic_command
  326.     # 按下 B 键的情况下
  327.     if Input.trigger?(Input::B)
  328.       # 演奏取消 SE
  329.       $game_system.se_play($data_system.cancel_se)
  330.       # 转向前一个角色的指令输入
  331.       phase3_prior_actor
  332.       return
  333.     end
  334.     # 按下 C 键的情况下
  335.     if Input.trigger?(Input::C)
  336.       # 角色指令窗口光标位置分之
  337.       case @actor_command_window.index
  338.       #when 0  # 攻击
  339.       #  # 演奏确定 SE
  340.       #  $game_system.se_play($data_system.decision_se)
  341.       #  # 设置行动
  342.       #  @active_battler.current_action.kind = 0
  343.       #  @active_battler.current_action.basic = 0
  344.       #  # 开始选择敌人
  345.       #  start_enemy_select
  346.       when 0  # 特技
  347.         # 演奏确定 SE
  348.         $game_system.se_play($data_system.decision_se)
  349.         # 设置行动
  350.         @active_battler.current_action.kind = 1
  351.         # 开始选择特技
  352.         start_skill_select
  353.       when 1  # 防御
  354.         # 演奏确定 SE
  355.         $game_system.se_play($data_system.decision_se)
  356.         # 设置行动
  357.         @active_battler.current_action.kind = 0
  358.         @active_battler.current_action.basic = 1
  359.         # 转向下一位角色的指令输入
  360.         phase3_next_actor
  361.       when 2  # 物品
  362.         # 演奏确定 SE
  363.         $game_system.se_play($data_system.decision_se)
  364.         # 设置行动
  365.         @active_battler.current_action.kind = 2
  366.         # 开始选择物品
  367.         start_item_select
  368.       when 3 # 换人
  369.         $game_system.se_play($data_system.decision_se)
  370.         @active_battler.current_action.set_change_battler
  371.         start_battler_select
  372.       end
  373.       return
  374.     end
  375.   end
  376.   # 开始角色选择
  377.   def start_battler_select
  378.     @actor_window = Window_Actor.new
  379.     @actor_window.active = true
  380.     @actor_window.index = 0
  381.     @actor_window.help_window = @help_window
  382.     @actor_command_window.active = false
  383.     @actor_command_window.visible = false
  384.   end
  385.   # 结束角色选择
  386.   def end_battler_select
  387.     @actor_window.dispose
  388.     @actor_window = nil
  389.     @help_window.visible = false
  390.     @actor_command_window.active = true
  391.     @actor_command_window.visible = true
  392.   end
  393.   # 刷新角色选择
  394.   def update_phase3_battler_select
  395.     @actor_window.visible = true
  396.     @actor_window.update
  397.     if Input.trigger?(Input::B)
  398.       $game_system.se_play($data_system.cancel_se)
  399.       end_battler_select
  400.       return
  401.     end
  402.     if Input.trigger?(Input::C)
  403.       actor_id = @actor_window.actor_id
  404.       if $game_party.get_actors_id.include?(actor_id) or
  405.          $game_actors[actor_id].dead? or
  406.          @changed_battler_id.include?(actor_id)
  407.         $game_system.se_play($data_system.buzzer_se)
  408.         return
  409.       end
  410.       $game_system.se_play($data_system.decision_se)
  411.       @active_battler.current_action.change_to_battler = actor_id
  412.       @changed_battler_id.push(actor_id)
  413.       end_battler_select
  414.       phase3_next_actor
  415.       return
  416.     end
  417.   end
  418.   # 行动方动画
  419.   def update_phase4_step3
  420.     if @active_battler.current_action.is_change_battler?
  421.       @animation1_id = AnimationChangeBattler
  422.       @target_battlers = []
  423.     end
  424.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  425.     if @animation1_id == 0
  426.       @active_battler.white_flash = true
  427.     else
  428.       @active_battler.animation_id = @animation1_id
  429.       @active_battler.animation_hit = true
  430.     end
  431.     # 移至步骤 4
  432.     @phase4_step = 4
  433.   end
  434.   def update_phase4_step1
  435.     # 隐藏帮助窗口
  436.     @help_window.visible = false
  437.     # 判定胜败
  438.     if judge
  439.       # 胜利或者失败的情况下 : 过程结束
  440.       return
  441.     end
  442.     # 强制行动的战斗者不存在的情况下
  443.     if $game_temp.forcing_battler == nil
  444.       # 设置战斗事件
  445.       setup_battle_event
  446.       # 执行战斗事件中的情况下
  447.       if $game_system.battle_interpreter.running?
  448.         return
  449.       end
  450.     end
  451.     # 强制行动的战斗者存在的情况下
  452.     if $game_temp.forcing_battler != nil
  453.       # 在头部添加后移动
  454.       @action_battlers.delete($game_temp.forcing_battler)
  455.       @action_battlers.unshift($game_temp.forcing_battler)
  456.     end
  457.     # 未行动的战斗者不存在的情况下 (全员已经行动)
  458.     if @action_battlers.size == 0
  459.       # 开始同伴命令回合
  460.       start_phase2
  461.       return
  462.     end
  463.     # 初始化动画 ID 和公共事件 ID
  464.     @animation1_id = 0
  465.     @animation2_id = 0
  466.     @common_event_id = 0
  467.     # 未行动的战斗者移动到序列的头部
  468.     @active_battler = @action_battlers.shift
  469.     # 如果已经在战斗之外的情况下
  470.     if @active_battler.index == nil
  471.       return
  472.     end
  473.     # 连续伤害
  474.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  475.       @active_battler.slip_damage_effect
  476.       @active_battler.damage_pop = true
  477.       update_phase4_step5
  478.       update_phase4_step6
  479.     end
  480.     # 自然解除状态
  481.     @active_battler.remove_states_auto
  482.     # 刷新状态窗口
  483.     @status_window.refresh
  484.     # 移至步骤 2
  485.     @phase4_step = 2
  486.   end
  487.   # 对象方动画
  488.   def update_phase4_step4
  489.     if @active_battler.current_action.is_change_battler?
  490.       actor1_id = @active_battler.current_action.change_to_battler
  491.       actor2_id = @active_battler.id
  492.       (0...$game_party.actors.size).each do |i|
  493.         if $game_party.actors[i].id == actor2_id
  494.           $game_party.change_actor(i,actor1_id)
  495.           @active_battler = $game_actors[actor1_id]
  496.           @status_window.refresh
  497.         end
  498.       end
  499.     end
  500.     # 对像方动画
  501.     for target in @target_battlers
  502.       target.animation_id = @animation2_id
  503.       target.animation_hit = (target.damage != "Miss")
  504.     end
  505.     # 限制动画长度、最低 8 帧
  506.     @wait_count = 8
  507.     # 移至步骤 5
  508.     @phase4_step = 5
  509.   end
  510.   # 公共事件
  511.   def update_phase4_step6
  512.     @target_battlers.each do |target|
  513.       if target.is_a?(Game_Actor) and target.dead? and
  514.          !$game_party.other_actors.all?{|actor|actor.dead?}
  515.         @actor_window = Window_Actor.new
  516.         @actor_window.index = 0
  517.         @actor_window.active = true
  518.         @actor_window.help_window = @help_window
  519.         actor_id = -1
  520.         loop do
  521.           Graphics.update
  522.           Input.update
  523.           @actor_window.update
  524.           if Input.trigger?(Input::C)
  525.             actor = $game_actors[@actor_window.actor_id]
  526.             if actor.dead? or
  527.                (@changed_battler_id.include?(actor.id) and
  528.                 target.current_action.change_to_battler != actor.id) or
  529.                $game_party.actors.include?(actor)
  530.               $game_system.se_play($data_system.buzzer_se)
  531.             else
  532.               actor_id = actor.id
  533.             end
  534.           end
  535.           break if actor_id >= 0
  536.         end
  537.         @actor_window.visible = false
  538.         @actor_window.dispose
  539.         @actor_window = nil
  540.         @help_window.visible = false
  541.         (0...$game_party.actors.size).each do |i|
  542.           if $game_party.actors[i].id == target.id
  543.             $game_party.change_actor(i,actor_id)
  544.             @status_window.refresh
  545.           end
  546.         end
  547.       end
  548.     end
  549.     # 清除强制行动对像的战斗者
  550.     $game_temp.forcing_battler = nil
  551.     # 公共事件 ID 有效的情况下
  552.     if @common_event_id > 0
  553.       # 设置事件
  554.       common_event = $data_common_events[@common_event_id]
  555.       $game_system.battle_interpreter.setup(common_event.list, 0)
  556.     end
  557.     # 移至步骤 1
  558.     @phase4_step = 1
  559.   end
  560. end

  561. class Window_MenuStatus
  562.   def refresh
  563.     self.contents.clear
  564.     @item_max = $game_party.actors.size
  565.     for i in 0...$game_party.actors.size
  566.       x = 4
  567.       y = i * 32
  568.       actor = $game_party.actors[i]
  569.       bitmap = RPG::Cache.character(actor.character_name,actor.character_hue)
  570.       rect = Rect.new(0,0,bitmap.width/4,31)
  571.       self.contents.blt(x+16-bitmap.width/8,y,bitmap,rect)
  572.       draw_actor_name(actor, x+36, y)
  573.       draw_actor_state(actor, x + 136,y)
  574.       draw_actor_hp(actor, x + 236, y,96)
  575.       draw_actor_sp(actor, x + 336, y,96)
  576.     end
  577.   end
  578.   def update_cursor_rect
  579.     super
  580.   end
  581. end
复制代码




地图作为战斗背景脚本
  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. #===============================================================
复制代码
梦石
0
星屑
76
在线时间
1379 小时
注册时间
2012-7-5
回帖
1643

开拓者

发表于 2015-9-29 09:56:47 | 显示全部楼层
把换人脚本放到地图背景脚本上面试试

点评

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

评分

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

查看全部评分


  -fk: -azogi:
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部