Project1

标题: 去掉"战斗/逃跑"后无法让战斗不能逃跑 [打印本页]

作者: 小小毓    时间: 2007-8-3 04:47
标题: 去掉"战斗/逃跑"后无法让战斗不能逃跑
去掉了上述选项后.把逃跑加入到了战斗指令中.事件里的战斗处理中没有选可以逃跑
但测试时还是能逃跑.怎么办 [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 小小毓    时间: 2007-8-3 04:47
标题: 去掉"战斗/逃跑"后无法让战斗不能逃跑
去掉了上述选项后.把逃跑加入到了战斗指令中.事件里的战斗处理中没有选可以逃跑
但测试时还是能逃跑.怎么办 [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 空城    时间: 2007-8-3 05:07
提示: 作者被禁止或删除 内容自动屏蔽
作者: K’    时间: 2007-8-3 05:13
仿照原脚本 在选择逃跑指令的时候 增加一个分歧
作者: patrick    时间: 2007-8-3 05:13
脚本要改一下
  1. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. #  将逃跑移到普通项 of sdxsdx
  3. # (简易版)
  4. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



  5. #==============================================================================
  6. # ■ Scene_Battle (分割定义 1)
  7. #------------------------------------------------------------------------------
  8. #  处理战斗画面的类。
  9. #==============================================================================

  10. class Scene_Battle
  11. #--------------------------------------------------------------------------
  12. # ● 主处理
  13. #--------------------------------------------------------------------------
  14. def main
  15.    # 初始化战斗用的各种暂时数据
  16.    $game_temp.in_battle = true
  17.    $game_temp.battle_turn = 0
  18.    $game_temp.battle_event_flags.clear
  19.    $game_temp.battle_abort = false
  20.    $game_temp.battle_main_phase = false
  21.    $game_temp.battleback_name = $game_map.battleback_name
  22.    $game_temp.forcing_battler = nil
  23.    # 初始化战斗用事件解释器
  24.    $game_system.battle_interpreter.setup(nil, 0)
  25.    # 准备队伍
  26.    @troop_id = $game_temp.battle_troop_id
  27.    $game_troop.setup(@troop_id)
  28.    # 生成角色命令窗口
  29.    s1 = $data_system.words.attack
  30.    s2 = $data_system.words.skill
  31.    s3 = $data_system.words.guard
  32.    s4 = $data_system.words.item
  33.    s5 = "逃跑"
  34.    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4,s5])
  35.    @actor_command_window.y = 130
  36.    @actor_command_window.back_opacity = 160
  37.    @actor_command_window.active = false
  38.    @actor_command_window.visible = false
  39.    # 生成其它窗口
  40.    @party_command_window = Window_PartyCommand.new
  41.    @help_window = Window_Help.new
  42.    @help_window.back_opacity = 160
  43.    @help_window.visible = false
  44.    @status_window = Window_BattleStatus.new
  45.    @message_window = Window_Message.new
  46.    # 生成活动块
  47.    @spriteset = Spriteset_Battle.new
  48.    # 初始化等待计数
  49.    @wait_count = 0
  50.    # 执行过渡
  51.    if $data_system.battle_transition == ""
  52.      Graphics.transition(20)
  53.    else
  54.      Graphics.transition(40, "Graphics/Transitions/" +
  55.        $data_system.battle_transition)
  56.    end
  57.    # 开始自由战斗回合
  58.    start_phase1
  59.    # 主循环
  60.    loop do
  61.      # 刷新游戏画面
  62.      Graphics.update
  63.      # 刷新输入信息
  64.      Input.update
  65.      # 刷新画面
  66.      update
  67.      # 如果画面切换的话就中断循环
  68.      if $scene != self
  69.        break
  70.      end
  71.    end
  72.    # 刷新地图
  73.    $game_map.refresh
  74.    # 准备过渡
  75.    Graphics.freeze
  76.    # 释放窗口
  77.    @actor_command_window.dispose
  78.    @party_command_window.dispose
  79.    @help_window.dispose
  80.    @status_window.dispose
  81.    @message_window.dispose
  82.    if @skill_window != nil
  83.      @skill_window.dispose
  84.    end
  85.    if @item_window != nil
  86.      @item_window.dispose
  87.    end
  88.    if @result_window != nil
  89.      @result_window.dispose
  90.    end
  91.    # 释放活动块
  92.    @spriteset.dispose
  93.    # 标题画面切换中的情况
  94.    if $scene.is_a?(Scene_Title)
  95.      # 淡入淡出画面
  96.      Graphics.transition
  97.      Graphics.freeze
  98.    end
  99.    # 战斗测试或者游戏结束以外的画面切换中的情况
  100.    if $BTEST and not $scene.is_a?(Scene_Gameover)
  101.      $scene = nil
  102.    end
  103. end
  104. #--------------------------------------------------------------------------
  105. # ● 胜负判定
  106. #--------------------------------------------------------------------------
  107. def judge
  108.    # 全灭判定是真、并且同伴人数为 0 的情况下
  109.    if $game_party.all_dead? or $game_party.actors.size == 0
  110.      # 允许失败的情况下
  111.      if $game_temp.battle_can_lose
  112.        # 还原为战斗开始前的 BGM
  113.        $game_system.bgm_play($game_temp.map_bgm)
  114.        # 战斗结束
  115.        battle_end(2)
  116.        # 返回 true
  117.        return true
  118.      end
  119.      # 设置游戏结束标志
  120.      $game_temp.gameover = true
  121.      # 返回 true
  122.      return true
  123.    end
  124.    # 如果存在任意 1 个敌人就返回 false
  125.    for enemy in $game_troop.enemies
  126.      if enemy.exist?
  127.        return false
  128.      end
  129.    end
  130.    # 开始结束战斗回合 (胜利)
  131.    start_phase5
  132.    # 返回 true
  133.    return true
  134. end
  135. #--------------------------------------------------------------------------
  136. # ● 战斗结束
  137. #     result : 結果 (0:胜利 1:失败 2:逃跑)
  138. #--------------------------------------------------------------------------
  139. def battle_end(result)
  140.    # 清除战斗中标志
  141.    $game_temp.in_battle = false
  142.    # 清除全体同伴的行动
  143.    $game_party.clear_actions
  144.    # 解除战斗用状态
  145.    for actor in $game_party.actors
  146.      actor.remove_states_battle
  147.    end
  148.    # 清除敌人
  149.    $game_troop.enemies.clear
  150.    # 调用战斗返回调用
  151.    if $game_temp.battle_proc != nil
  152.      $game_temp.battle_proc.call(result)
  153.      $game_temp.battle_proc = nil
  154.    end
  155.    # 切换到地图画面
  156.    $scene = Scene_Map.new
  157. end
  158. #--------------------------------------------------------------------------
  159. # ● 设置战斗事件
  160. #--------------------------------------------------------------------------
  161. def setup_battle_event
  162.    # 正在执行战斗事件的情况下
  163.    if $game_system.battle_interpreter.running?
  164.      return
  165.    end
  166.    # 搜索全部页的战斗事件
  167.    for index in 0...$data_troops[@troop_id].pages.size
  168.      # 获取事件页
  169.      page = $data_troops[@troop_id].pages[index]
  170.      # 事件条件可以参考 c
  171.      c = page.condition
  172.      # 没有指定任何条件的情况下转到下一页
  173.      unless c.turn_valid or c.enemy_valid or
  174.             c.actor_valid or c.switch_valid
  175.        next
  176.      end
  177.      # 执行完毕的情况下转到下一页
  178.      if $game_temp.battle_event_flags[index]
  179.        next
  180.      end
  181.      # 确认回合条件
  182.      if c.turn_valid
  183.        n = $game_temp.battle_turn
  184.        a = c.turn_a
  185.        b = c.turn_b
  186.        if (b == 0 and n != a) or
  187.           (b > 0 and (n < 1 or n < a or n % b != a % b))
  188.          next
  189.        end
  190.      end
  191.      # 确认敌人条件
  192.      if c.enemy_valid
  193.        enemy = $game_troop.enemies[c.enemy_index]
  194.        if enemy == nil or enemy.hp * 100.0 / enemy.maxhp > c.enemy_hp
  195.          next
  196.        end
  197.      end
  198.      # 确认角色条件
  199.      if c.actor_valid
  200.        actor = $game_actors[c.actor_id]
  201.        if actor == nil or actor.hp * 100.0 / actor.maxhp > c.actor_hp
  202.          next
  203.        end
  204.      end
  205.      # 确认开关条件
  206.      if c.switch_valid
  207.        if $game_switches[c.switch_id] == false
  208.          next
  209.        end
  210.      end
  211.      # 设置事件
  212.      $game_system.battle_interpreter.setup(page.list, 0)
  213.      # 本页的范围是 [战斗] 或 [回合] 的情况下
  214.      if page.span <= 1
  215.        # 设置执行结束标志
  216.        $game_temp.battle_event_flags[index] = true
  217.      end
  218.      return
  219.    end
  220. end
  221. #--------------------------------------------------------------------------
  222. # ● 刷新画面
  223. #--------------------------------------------------------------------------
  224. def update
  225.    # 执行战斗事件中的情况下
  226.    if $game_system.battle_interpreter.running?
  227.      # 刷新解释器
  228.      $game_system.battle_interpreter.update
  229.      # 强制行动的战斗者不存在的情况下
  230.      if $game_temp.forcing_battler == nil
  231.        # 执行战斗事件结束的情况下
  232.        unless $game_system.battle_interpreter.running?
  233.          # 继续战斗的情况下、再执行战斗事件的设置
  234.          unless judge
  235.            setup_battle_event
  236.          end
  237.        end
  238.        # 如果不是结束战斗回合的情况下
  239.        if @phase != 5
  240.          # 刷新状态窗口
  241.          @status_window.refresh
  242.        end
  243.      end
  244.    end
  245.    # 系统 (计时器)、刷新画面
  246.    $game_system.update
  247.    $game_screen.update
  248.    # 计时器为 0 的情况下
  249.    if $game_system.timer_working and $game_system.timer == 0
  250.      # 中断战斗
  251.      $game_temp.battle_abort = true
  252.    end
  253.    # 刷新窗口
  254.    @help_window.update
  255.    @party_command_window.update
  256.    @actor_command_window.update
  257.    @status_window.update
  258.    @message_window.update
  259.    # 刷新活动块
  260.    @spriteset.update
  261.    # 处理过渡中的情况下
  262.    if $game_temp.transition_processing
  263.      # 清除处理过渡中标志
  264.      $game_temp.transition_processing = false
  265.      # 执行过渡
  266.      if $game_temp.transition_name == ""
  267.        Graphics.transition(20)
  268.      else
  269.        Graphics.transition(40, "Graphics/Transitions/" +
  270.          $game_temp.transition_name)
  271.      end
  272.    end
  273.    # 显示信息窗口中的情况下
  274.    if $game_temp.message_window_showing
  275.      return
  276.    end
  277.    # 显示效果中的情况下
  278.    if @spriteset.effect?
  279.      return
  280.    end
  281.    # 游戏结束的情况下
  282.    if $game_temp.gameover
  283.      # 切换到游戏结束画面
  284.      $scene = Scene_Gameover.new
  285.      return
  286.    end
  287.    # 返回标题画面的情况下
  288.    if $game_temp.to_title
  289.      # 切换到标题画面
  290.      $scene = Scene_Title.new
  291.      return
  292.    end
  293.    # 中断战斗的情况下
  294.    if $game_temp.battle_abort
  295.      # 还原为战斗前的 BGM
  296.      $game_system.bgm_play($game_temp.map_bgm)
  297.      # 战斗结束
  298.      battle_end(1)
  299.      return
  300.    end
  301.    # 等待中的情况下
  302.    if @wait_count > 0
  303.      # 减少等待计数
  304.      @wait_count -= 1
  305.      return
  306.    end
  307.    # 强制行动的角色存在、
  308.    # 并且战斗事件正在执行的情况下
  309.    if $game_temp.forcing_battler == nil and
  310.       $game_system.battle_interpreter.running?
  311.      return
  312.    end
  313.    # 回合分支
  314.    case @phase
  315.    when 1  # 自由战斗回合
  316.      update_phase1
  317.    when 2  # 同伴命令回合
  318.      update_phase2
  319.    when 3  # 角色命令回合
  320.      update_phase3
  321.    when 4  # 主回合
  322.      update_phase4
  323.    when 5  # 战斗结束回合
  324.      update_phase5
  325.    end
  326. end
  327. end



  328. #==============================================================================
  329. # ■ Scene_Battle (分割定义 3)
  330. #------------------------------------------------------------------------------
  331. #  处理战斗画面的类。
  332. #==============================================================================

  333. class Scene_Battle
  334. #--------------------------------------------------------------------------
  335. # ● 开始角色命令回合
  336. #--------------------------------------------------------------------------
  337. def start_phase3
  338.    # 转移到回合 3
  339.    @phase = 3
  340.    # 设置觉得为非选择状态
  341.    @actor_index = -1
  342.    @active_battler = nil
  343.    # 输入下一个角色的命令
  344.    phase3_next_actor
  345. end
  346. #--------------------------------------------------------------------------
  347. # ● 转到输入下一个角色的命令
  348. #--------------------------------------------------------------------------
  349. def phase3_next_actor
  350.    # 循环
  351.    begin
  352.      # 角色的明灭效果 OFF
  353.      if @active_battler != nil
  354.        @active_battler.blink = false
  355.      end
  356.      # 最后的角色的情况
  357.      if @actor_index == $game_party.actors.size-1
  358.        # 开始主回合
  359.        start_phase4
  360.        return
  361.      end
  362.      # 推进角色索引
  363.      @actor_index += 1
  364.      @active_battler = $game_party.actors[@actor_index]
  365.      @active_battler.blink = true
  366.    # 如果角色是在无法接受指令的状态就再试
  367.    end until @active_battler.inputable?
  368.    # 设置角色的命令窗口
  369.    phase3_setup_command_window
  370. end
  371. #--------------------------------------------------------------------------
  372. # ● 转向前一个角色的命令输入
  373. #--------------------------------------------------------------------------
  374. def phase3_prior_actor
  375.    # 循环
  376.    begin
  377.      # 角色的明灭效果 OFF
  378.      if @active_battler != nil
  379.        @active_battler.blink = false
  380.      end
  381.      # 最初的角色的情况下
  382.      if @actor_index == 0
  383.        # 开始同伴指令回合
  384.        start_phase2
  385.        return
  386.      end
  387.      # 返回角色索引
  388.      @actor_index -= 1
  389.      @active_battler = $game_party.actors[@actor_index]
  390.      @active_battler.blink = true
  391.    # 如果角色是在无法接受指令的状态就再试
  392.    end until @active_battler.inputable?
  393.    # 设置角色的命令窗口
  394.    phase3_setup_command_window
  395. end
  396. #--------------------------------------------------------------------------
  397. # ● 设置角色指令窗口
  398. #--------------------------------------------------------------------------
  399. def phase3_setup_command_window
  400.    # 同伴指令窗口无效化
  401.    @party_command_window.active = false
  402.    @party_command_window.visible = false
  403.    # 角色指令窗口无效化
  404.    @actor_command_window.active = true
  405.    @actor_command_window.visible = true
  406.    # 设置角色指令窗口的位置
  407.    @actor_command_window.x = @actor_index * 160
  408.    # 设置索引为 0
  409.    @actor_command_window.index = 0
  410. end
  411. #--------------------------------------------------------------------------
  412. # ● 刷新画面 (角色命令回合)
  413. #--------------------------------------------------------------------------
  414. def update_phase3
  415.    # 敌人光标有效的情况下
  416.    if @enemy_arrow != nil
  417.      update_phase3_enemy_select
  418.    # 角色光标有效的情况下
  419.    elsif @actor_arrow != nil
  420.      update_phase3_actor_select
  421.    # 特技窗口有效的情况下
  422.    elsif @skill_window != nil
  423.      update_phase3_skill_select
  424.    # 物品窗口有效的情况下
  425.    elsif @item_window != nil
  426.      update_phase3_item_select
  427.    # 角色指令窗口有效的情况下
  428.    elsif @actor_command_window.active
  429.      update_phase3_basic_command
  430.    end
  431. end
  432. #--------------------------------------------------------------------------
  433. # ● 刷新画面 (角色命令回合 : 基本命令)
  434. #--------------------------------------------------------------------------
  435. def update_phase3_basic_command
  436.    # 按下 B 键的情况下
  437.    if Input.trigger?(Input::B)
  438.      # 演奏取消 SE
  439.      $game_system.se_play($data_system.cancel_se)
  440.      # 转向前一个角色的指令输入
  441.      phase3_prior_actor
  442.      return
  443.    end
  444.    # 按下 C 键的情况下
  445.    if Input.trigger?(Input::C)
  446.      # 角色指令窗口光标位置分之
  447.      case @actor_command_window.index
  448.      when 0  # 攻击
  449.        # 演奏确定 SE
  450.        $game_system.se_play($data_system.decision_se)
  451.        # 设置行动
  452.        @active_battler.current_action.kind = 0
  453.        @active_battler.current_action.basic = 0
  454.        # 开始选择敌人
  455.        start_enemy_select
  456.      when 1  # 特技
  457.        # 演奏确定 SE
  458.        $game_system.se_play($data_system.decision_se)
  459.        # 设置行动
  460.        @active_battler.current_action.kind = 1
  461.        # 开始选择特技
  462.        start_skill_select
  463.      when 2  # 防御
  464.        # 演奏确定 SE
  465.        $game_system.se_play($data_system.decision_se)
  466.        # 设置行动
  467.        @active_battler.current_action.kind = 0
  468.        @active_battler.current_action.basic = 1
  469.        # 转向下一位角色的指令输入
  470.        phase3_next_actor
  471.      when 3  # 物品
  472.        # 演奏确定 SE
  473.        $game_system.se_play($data_system.decision_se)
  474.        # 设置行动
  475.        @active_battler.current_action.kind = 2
  476.        # 开始选择物品
  477.        start_item_select
  478.      when 4
  479.        # 逃走处理v1================================================
  480.        if $game_temp.battle_can_escape == false
  481.          # 演奏冻结 SE
  482.          $game_system.se_play($data_system.buzzer_se)
  483.          return
  484.        end
  485.        # 逃走处理v1=================================================
  486.        enemies_agi = 0
  487.        enemies_number = 0
  488.        for enemy in $game_troop.enemies
  489.      if enemy.exist?
  490.        enemies_agi += enemy.agi
  491.        enemies_number += 1
  492.        end
  493.        end
  494.      if enemies_number > 0
  495.        enemies_agi /= enemies_number
  496.        end
  497.        # 计算角色速度的平均值
  498.        actors_agi = 0
  499.        actors_number = 0
  500.        for actor in $game_party.actors
  501.        if actor.exist?
  502.        actors_agi += actor.agi
  503.        actors_number += 1
  504.        end
  505.        end
  506.     if actors_number > 0
  507.       actors_agi /= actors_number
  508.       end
  509.        # 逃跑成功判定
  510.        success = rand(100) < 50 * actors_agi / enemies_agi
  511.        # 成功逃跑的情况下
  512.        if success
  513.        # 演奏逃跑 SE
  514.        $game_system.se_play($data_system.escape_se)
  515.        # 还原为战斗开始前的 BGM
  516.        $game_system.bgm_play($game_temp.map_bgm)
  517.        # 战斗结束
  518.        $game_temp.battle_abort = true
  519.        # 逃跑失败的情况下
  520.        else
  521.        # 清除全体同伴的行动
  522.        $game_party.clear_actions
  523.        # 开始主回合
  524.        start_phase4
  525.        end
  526.      end
  527.      return
  528.    end
  529. end
  530. #--------------------------------------------------------------------------
  531. # ● 刷新画面 (角色命令回合 : 选择特技)
  532. #--------------------------------------------------------------------------
  533. def update_phase3_skill_select
  534.    # 设置特技窗口为可视状态
  535.    @skill_window.visible = true
  536.    # 刷新特技窗口
  537.    @skill_window.update
  538.    # 按下 B 键的情况下
  539.    if Input.trigger?(Input::B)
  540.      # 演奏取消 SE
  541.      $game_system.se_play($data_system.cancel_se)
  542.      # 结束特技选择
  543.      end_skill_select
  544.      return
  545.    end
  546.    # 按下 C 键的情况下
  547.    if Input.trigger?(Input::C)
  548.      # 获取特技选择窗口现在选择的特技的数据
  549.      @skill = @skill_window.skill
  550.      # 无法使用的情况下
  551.      if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
  552.        # 演奏冻结 SE
  553.        $game_system.se_play($data_system.buzzer_se)
  554.        return
  555.      end
  556.      # 演奏确定 SE
  557.      $game_system.se_play($data_system.decision_se)
  558.      # 设置行动
  559.      @active_battler.current_action.skill_id = @skill.id
  560.      # 设置特技窗口为不可见状态
  561.      @skill_window.visible = false
  562.      # 效果范围是敌单体的情况下
  563.      if @skill.scope == 1
  564.        # 开始选择敌人
  565.        start_enemy_select
  566.      # 效果范围是我方单体的情况下
  567.      elsif @skill.scope == 3 or @skill.scope == 5
  568.        # 开始选择角色
  569.        start_actor_select
  570.      # 效果范围不是单体的情况下
  571.      else
  572.        # 选择特技结束
  573.        end_skill_select
  574.        # 转到下一位角色的指令输入
  575.        phase3_next_actor
  576.      end
  577.      return
  578.    end
  579. end
  580. #--------------------------------------------------------------------------
  581. # ● 刷新画面 (角色命令回合 : 选择物品)
  582. #--------------------------------------------------------------------------
  583. def update_phase3_item_select
  584.    # 设置物品窗口为可视状态
  585.    @item_window.visible = true
  586.    # 刷新物品窗口
  587.    @item_window.update
  588.    # 按下 B 键的情况下
  589.    if Input.trigger?(Input::B)
  590.      # 演奏取消 SE
  591.      $game_system.se_play($data_system.cancel_se)
  592.      # 选择物品结束
  593.      end_item_select
  594.      return
  595.    end
  596.    # 按下 C 键的情况下
  597.    if Input.trigger?(Input::C)
  598.      # 获取物品窗口现在选择的物品资料
  599.      @item = @item_window.item
  600.      # 无法使用的情况下
  601.      unless $game_party.item_can_use?(@item.id)
  602.        # 演奏冻结 SE
  603.        $game_system.se_play($data_system.buzzer_se)
  604.        return
  605.      end
  606.      # 演奏确定 SE
  607.      $game_system.se_play($data_system.decision_se)
  608.      # 设置行动
  609.      @active_battler.current_action.item_id = @item.id
  610.      # 设置物品窗口为不可见状态
  611.      @item_window.visible = false
  612.      # 效果范围是敌单体的情况下
  613.      if @item.scope == 1
  614.        # 开始选择敌人
  615.        start_enemy_select
  616.      # 效果范围是我方单体的情况下
  617.      elsif @item.scope == 3 or @item.scope == 5
  618.        # 开始选择角色
  619.        start_actor_select
  620.      # 效果范围不是单体的情况下
  621.      else
  622.        # 物品选择结束
  623.        end_item_select
  624.        # 转到下一位角色的指令输入
  625.        phase3_next_actor
  626.      end
  627.      return
  628.    end
  629. end
  630. #--------------------------------------------------------------------------
  631. # ● 刷新画面画面 (角色命令回合 : 选择敌人)
  632. #--------------------------------------------------------------------------
  633. def update_phase3_enemy_select
  634.    # 刷新敌人箭头
  635.    @enemy_arrow.update
  636.    # 按下 B 键的情况下
  637.    if Input.trigger?(Input::B)
  638.      # 演奏取消 SE
  639.      $game_system.se_play($data_system.cancel_se)
  640.      # 选择敌人结束
  641.      end_enemy_select
  642.      return
  643.    end
  644.    # 按下 C 键的情况下
  645.    if Input.trigger?(Input::C)
  646.      # 演奏确定 SE
  647.      $game_system.se_play($data_system.decision_se)
  648.      # 设置行动
  649.      @active_battler.current_action.target_index = @enemy_arrow.index
  650.      # 选择敌人结束
  651.      end_enemy_select
  652.      # 显示特技窗口中的情况下
  653.      if @skill_window != nil
  654.        # 结束特技选择
  655.        end_skill_select
  656.      end
  657.      # 显示物品窗口的情况下
  658.      if @item_window != nil
  659.        # 结束物品选择
  660.        end_item_select
  661.      end
  662.      # 转到下一位角色的指令输入
  663.      phase3_next_actor
  664.    end
  665. end
  666. #--------------------------------------------------------------------------
  667. # ● 画面更新 (角色指令回合 : 选择角色)
  668. #--------------------------------------------------------------------------
  669. def update_phase3_actor_select
  670.    # 刷新角色箭头
  671.    @actor_arrow.update
  672.    # 按下 B 键的情况下
  673.    if Input.trigger?(Input::B)
  674.      # 演奏取消 SE
  675.      $game_system.se_play($data_system.cancel_se)
  676.      # 选择角色结束
  677.      end_actor_select
  678.      return
  679.    end
  680.    # 按下 C 键的情况下
  681.    if Input.trigger?(Input::C)
  682.      # 演奏确定 SE
  683.      $game_system.se_play($data_system.decision_se)
  684.      # 设置行动
  685.      @active_battler.current_action.target_index = @actor_arrow.index
  686.      # 选择角色结束
  687.      end_actor_select
  688.      # 显示特技窗口中的情况下
  689.      if @skill_window != nil
  690.        # 结束特技选择
  691.        end_skill_select
  692.      end
  693.      # 显示物品窗口的情况下
  694.      if @item_window != nil
  695.        # 结束物品选择
  696.        end_item_select
  697.      end
  698.      # 转到下一位角色的指令输入
  699.      phase3_next_actor
  700.    end
  701. end
  702. #--------------------------------------------------------------------------
  703. # ● 开始选择敌人
  704. #--------------------------------------------------------------------------
  705. def start_enemy_select
  706.    # 生成敌人箭头
  707.    @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
  708.    # 关联帮助窗口
  709.    @enemy_arrow.help_window = @help_window
  710.    # 无效化角色指令窗口
  711.    @actor_command_window.active = false
  712.    @actor_command_window.visible = false
  713. end
  714. #--------------------------------------------------------------------------
  715. # ● 结束选择敌人
  716. #--------------------------------------------------------------------------
  717. def end_enemy_select
  718.    # 释放敌人箭头
  719.    @enemy_arrow.dispose
  720.    @enemy_arrow = nil
  721.    # 指令为 [战斗] 的情况下
  722.    if @actor_command_window.index == 0
  723.      # 有效化角色指令窗口
  724.      @actor_command_window.active = true
  725.      @actor_command_window.visible = true
  726.      # 隐藏帮助窗口
  727.      @help_window.visible = false
  728.    end
  729. end
  730. #--------------------------------------------------------------------------
  731. # ● 开始选择角色
  732. #--------------------------------------------------------------------------
  733. def start_actor_select
  734.    # 生成角色箭头
  735.    @actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
  736.    @actor_arrow.index = @actor_index
  737.    # 关联帮助窗口
  738.    @actor_arrow.help_window = @help_window
  739.    # 无效化角色指令窗口
  740.    @actor_command_window.active = false
  741.    @actor_command_window.visible = false
  742. end
  743. #--------------------------------------------------------------------------
  744. # ● 结束选择角色
  745. #--------------------------------------------------------------------------
  746. def end_actor_select
  747.    # 释放角色箭头
  748.    @actor_arrow.dispose
  749.    @actor_arrow = nil
  750. end
  751. #--------------------------------------------------------------------------
  752. # ● 开始选择特技
  753. #--------------------------------------------------------------------------
  754. def start_skill_select
  755.    # 生成特技窗口
  756.    @skill_window = Window_Skill.new(@active_battler)
  757.    @skill_window.z = 999999#★★★★★
  758.    # 关联帮助窗口
  759.    @skill_window.help_window = @help_window
  760.    @skill_window.help_window.z = 99999
  761.    # 无效化角色指令窗口
  762.    @actor_command_window.active = false
  763.    @actor_command_window.visible = false
  764. end
  765. #--------------------------------------------------------------------------
  766. # ● 选择特技结束
  767. #--------------------------------------------------------------------------
  768. def end_skill_select
  769.    # 释放特技窗口
  770.    @skill_window.dispose
  771.    @skill_window = nil
  772.    # 隐藏帮助窗口
  773.    @help_window.visible = false
  774.    # 有效化角色指令窗口
  775.    @actor_command_window.active = true
  776.    @actor_command_window.visible = true
  777. end
  778. #--------------------------------------------------------------------------
  779. # ● 开始选择物品
  780. #--------------------------------------------------------------------------
  781. def start_item_select
  782.    # 生成物品窗口
  783.    @item_window = Window_Item.new
  784.    @item_window.z = 9999999#★★★★★
  785.    # 关联帮助窗口
  786.    @item_window.help_window = @help_window
  787.    @item_window.help_window.z = 9999999
  788.    # 无效化角色指令窗口
  789.    @actor_command_window.active = false
  790.    @actor_command_window.visible = false
  791. end
  792. #--------------------------------------------------------------------------
  793. # ● 结束选择物品
  794. #--------------------------------------------------------------------------
  795. def end_item_select
  796.    # 释放物品窗口
  797.    @item_window.dispose
  798.    @item_window = nil
  799.    # 隐藏帮助窗口
  800.    @help_window.visible = false
  801.    # 有效化角色指令窗口
  802.    @actor_command_window.active = true
  803.    @actor_command_window.visible = true
  804. end
  805. end
复制代码
[LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1