幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2236|回复: 4

如何去掉脚本中战斗OR逃跑的选项?

[复制链接]

12

主题

37

帖子

409

积分

④见习

积分
409
发表于 2007-3-10 23:43:18 | 显示全部楼层 |阅读模式
这个脚本:
part1
  1. # ————————————————————————————————————
  2. # 本脚本来自[url]www.~~~~.com[/url],转载请保留此信息
  3. # ————————————————————————————————————
  4. # リアルタイム・アクティブバトル(RTAB) Ver 1.05
  5. # 配布元・サポートURL
  6. # [url]http://members.jcom.home.ne.jp/cogwheel/[/url]
  7. class Scene_Battle
  8.   #--------------------------------------------------------------------------
  9.   # ● 公開インスタンス変数
  10.   #--------------------------------------------------------------------------
  11.   attr_reader   :status_window            # ステータスウィンドウ
  12.   attr_reader   :spriteset                # バトルスプライト
  13.   attr_reader   :scroll_time              # スクリーン移動基本時間
  14.   attr_reader   :zoom_rate                # 敵バトラー基本位置
  15.   attr_reader   :drive                    # カメラ駆動
  16.   attr_accessor :force                    # アクション強制度
  17.   attr_accessor :camera                   # 現在のカメラ所持者
  18.   #--------------------------------------------------------------------------
  19.   # ● ATB基礎セットアップ
  20.   #--------------------------------------------------------------------------
  21.   def atb_setup
  22.     # ATB初期化
  23.     # speed   : バトルスピード決定。値が小さいほど早い
  24.     # @active : アクティブ度設定
  25.     #           3 : 常にアクティブ状態
  26.     #           2 : スキル・アイテム選択中のみアクティブゲージが止まる
  27.     #           1 : 2の状態に加え、ターゲット選択時もウェイトが掛かる
  28.     #           0 : 1の状態に加え、コマンド入力時にもウェイトが掛かる
  29.     # @action : 他人が行動中に自分も行動を起こすことを許すか
  30.     #           3 : 自分が行動不能でない限り限り許す
  31.     #           2 : 自分がダメージを受けていない限り許す
  32.     #           1 : 2の状態に加え、ターゲットが行動していない限り許す
  33.     #           0 : 行動を許さない。順番に行動し終えるまで待つ
  34.     # @anime_wait : trueにするとバトルアニメ・ダメージ表示中はウェイトが掛かる
  35.     # @damage_wait : ダメージ表示待ち時間(単位はフレーム)
  36.     # @enemy_speed : 敵の思考速度。1なら即時行動。
  37.     #                1フレーム毎に、1/@enemy_speedの確率で行動を起こす
  38.     # @force : 強制アクションでスキル使用時の強制具合
  39.     #          2:スキルは全て詠唱せず、必ず即時実行
  40.     #          1:単独スキルは詠唱し、連携スキルのみ即時実行
  41.     #          0:全スキル詠唱を行うだけ
  42.     # ($scene.force = x とすることにより、通常イベントのスクリプトから変更可能)
  43.     # @drive : カメラ駆動ON/OFF。trueで駆動ON、falseで駆動OFF
  44.     # @scroll_time : スクリーン移動に要する基本時間
  45.     # @zoom_rate = [i, j] : エネミーのズーム率
  46.     #                       i が画面最上部に配置した時の拡大率
  47.     #                       j が画面最下部に配置した時の拡大率
  48.     #                       1 倍としたいときも、1.0 と必ず小数で設定すること
  49.     speed = 200
  50.     @active = 1
  51.     @action = 2
  52.     @anime_wait = true
  53.     @damage_wait = 10
  54.     @enemy_speed = 40
  55.     @force = 2
  56.     @drive = true
  57.     @scroll_time = 15
  58.     @zoom_rate = [1.0, 1.0]
  59.     @help_time = 40
  60.     @escape == false
  61.     @camera = nil
  62.     @max = 0
  63.     @turn_cnt = 0
  64.     @help_wait = 0
  65.     @action_battlers = []
  66.     @synthe = []
  67.     @spell_p = {}
  68.     @spell_e = {}
  69.     @command_a = false
  70.     @command = []
  71.     @party = false
  72.     for battler in $game_party.actors + $game_troop.enemies
  73.       spell_reset(battler)
  74.       battler.at = battler.agi * rand(speed / 2)
  75.       battler.damage_pop = {}
  76.       battler.damage = {}
  77.       battler.damage_sp = {}
  78.       battler.critical = {}
  79.       battler.recover_hp = {}
  80.       battler.recover_sp = {}
  81.       battler.state_p = {}
  82.       battler.state_m = {}
  83.       battler.animation = []
  84.       if battler.is_a?(Game_Actor)
  85.         @max += battler.agi
  86.       end
  87.     end
  88.     @max *= speed
  89.     @max /= $game_party.actors.size
  90.     for battler in $game_party.actors + $game_troop.enemies
  91.       battler.atp = 100 * battler.at / @max
  92.     end
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● ATゲージMax時SE
  96.   #--------------------------------------------------------------------------
  97.   def fullat_se
  98.     Audio.se_play("Audio/SE/033-switch02", 80, 100)
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ● レベルアップSE
  102.   #--------------------------------------------------------------------------
  103.   def levelup_se
  104.     Audio.se_play("Audio/SE/056-Right02", 80, 100)
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● スキル習得SE
  108.   #--------------------------------------------------------------------------
  109.   def skill_se
  110.     Audio.se_play("Audio/SE/056-Right02", 80, 150)
  111.   end
  112. end
  113. class Window_Base < Window
  114.   #--------------------------------------------------------------------------
  115.   # ● ATG の描画
  116.   #     actor : アクター
  117.   #     x     : 描画先 X 座標
  118.   #     y     : 描画先 Y 座標
  119.   #     width : 描画先の幅
  120.   #--------------------------------------------------------------------------
  121.   def draw_actor_atg(actor, x, y, width = 144)
  122.     if @at_gauge == nil
  123.       # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
  124.       # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
  125.       # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
  126.       # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
  127.       # align3:ゲージタイプ 0:左詰め 1:右詰め
  128.       @plus_x = 0
  129.       @rate_x = 0
  130.       @plus_y = 16
  131.       @plus_width = 0
  132.       @rate_width = 100
  133.       @width = @plus_width + width * @rate_width / 100
  134.       @height = 16
  135.       @align1 = 0
  136.       @align2 = 1
  137.       @align3 = 0
  138.       # グラデーション設定 grade1:空ゲージ grade2:実ゲージ
  139.       # (0:横にグラデーション 1:縦にグラデーション 2:斜めにグラデーション)
  140.       grade1 = 1
  141.       grade2 = 0
  142.       # 色設定。color1:最外枠,color2:中枠
  143.       # color3:空枠ダークカラー,color4:空枠ライトカラー
  144.       color1 = Color.new(0, 0, 0)
  145.       color2 = Color.new(255, 255, 192)
  146.       color3 = Color.new(0, 0, 0, 192)
  147.       color4 = Color.new(0, 0, 64, 192)
  148.       # ゲージの色設定
  149.       # 通常時の色設定
  150.       color5 = Color.new(0, 64, 80)
  151.       color6 = Color.new(0, 128, 160)
  152.       # ゲージがMAXの時の色設定
  153.       color7 = Color.new(80, 0, 0)
  154.       color8 = Color.new(240, 0, 0)
  155.       # 連携スキル使用時の色設定
  156.       color9 = Color.new(80, 64, 32)
  157.       color10 = Color.new(240, 192, 96)
  158.       # スキル詠唱時の色設定
  159.       color11 = Color.new(80, 0, 64)
  160.       color12 = Color.new(240, 0, 192)
  161.       # ゲージの描画
  162.       gauge_rect_at(@width, @height, @align3, color1, color2,
  163.                   color3, color4, color5, color6, color7, color8,
  164.                   color9, color10, color11, color12, grade1, grade2)
  165.     end
  166.     # 変数atに描画するゲージの幅を代入
  167.     if actor.rtp == 0
  168.       at = (width + @plus_width) * actor.atp * @rate_width / 10000
  169.     else
  170.       at = (width + @plus_width) * actor.rt * @rate_width / actor.rtp / 100
  171.     end
  172.     if at > width
  173.       at = width
  174.     end
  175.     # ゲージの左詰・中央構え等の補正
  176.     case @align1
  177.     when 1
  178.       x += (@rect_width - width) / 2
  179.     when 2
  180.       x += @rect_width - width
  181.     end
  182.     case @align2
  183.     when 1
  184.       y -= @height / 2
  185.     when 2
  186.       y -= @height
  187.     end
  188.     self.contents.blt(x + @plus_x + width * @rate_x / 100, y + @plus_y,
  189.                       @at_gauge, Rect.new(0, 0, @width, @height))
  190.     if @align3 == 0
  191.       rect_x = 0
  192.     else
  193.       x += @width - at - 1
  194.       rect_x = @width - at - 1
  195.     end
  196.     # ゲージの色設定
  197.     if at == width
  198.         # MAX時のゲージ描画
  199.       self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
  200.                         @at_gauge, Rect.new(rect_x, @height * 2, at, @height))
  201.     else
  202.       if actor.rtp == 0
  203.         # 通常時のゲージ描画
  204.         self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
  205.                           @at_gauge, Rect.new(rect_x, @height, at, @height))
  206.       else
  207.         if actor.spell == true
  208.           # 連携スキル使用時のゲージ描画
  209.           self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
  210.                         @at_gauge, Rect.new(rect_x, @height * 3, at, @height))
  211.         else
  212.           # スキル詠唱時のゲージ描画
  213.           self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
  214.                         @at_gauge, Rect.new(rect_x, @height * 4, at, @height))
  215.         end
  216.       end
  217.     end
  218.   end
  219. end
  220. #==============================================================================
  221. # ■ Scene_Battle (分割定義 1)
  222. #------------------------------------------------------------------------------
  223. #  バトル画面の処理を行うクラスです。
  224. #==============================================================================
  225. class Scene_Battle
  226.   #--------------------------------------------------------------------------
  227.   # ● メイン処理
  228.   #--------------------------------------------------------------------------
  229.   def main
  230.     # 戦闘用の各種一時データを初期化
  231.     $game_temp.in_battle = true
  232.     $game_temp.battle_turn = 0
  233.     $game_temp.battle_event_flags.clear
  234.     $game_temp.battle_abort = false
  235.     $game_temp.battle_main_phase = false
  236.     $game_temp.battleback_name = $game_map.battleback_name
  237.     $game_temp.forcing_battler = nil
  238.     # バトルイベント用インタプリタを初期化
  239.     $game_system.battle_interpreter.setup(nil, 0)
  240.     # トループを準備
  241.     @troop_id = $game_temp.battle_troop_id
  242.     $game_troop.setup(@troop_id)
  243.     atb_setup
  244.     # アクターコマンドウィンドウを作成
  245.     s1 = $data_system.words.attack
  246.     s2 = $data_system.words.skill
  247.     s3 = $data_system.words.guard
  248.     s4 = $data_system.words.item
  249.     @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
  250.     @actor_command_window.y = 160
  251.     @actor_command_window.back_opacity = 160
  252.     @actor_command_window.active = false
  253.     @actor_command_window.visible = false
  254.     # その他のウィンドウを作成
  255.     @party_command_window = Window_PartyCommand.new
  256.     @help_window = Window_Help.new
  257.     @help_window.back_opacity = 160
  258.     @help_window.visible = false
  259.     @status_window = Window_BattleStatus.new
  260.     @message_window = Window_Message.new
  261.     # スプライトセットを作成
  262.     @spriteset = Spriteset_Battle.new
  263.     # ウェイトカウントを初期化
  264.     @wait_count = 0
  265.     # トランジション実行
  266.     if $data_system.battle_transition == ""
  267.       Graphics.transition(20)
  268.     else
  269.       Graphics.transition(40, "Graphics/Transitions/" +
  270.         $data_system.battle_transition)
  271.     end
  272.     # プレバトルフェーズ開始
  273.     start_phase1
  274.     # メインループ
  275.     loop do
  276.       # ゲーム画面を更新
  277.       Graphics.update
  278.       # 入力情報を更新
  279.       Input.update
  280.       # フレーム更新
  281.       update
  282.       # 画面が切り替わったらループを中断
  283.       if $scene != self
  284.         break
  285.       end
  286.     end
  287.     # マップをリフレッシュ
  288.     $game_map.refresh
  289.     # トランジション準備
  290.     Graphics.freeze
  291.     # ウィンドウを解放
  292.     @actor_command_window.dispose
  293.     @party_command_window.dispose
  294.     @help_window.dispose
  295.     @status_window.dispose
  296.     @message_window.dispose
  297.     if @skill_window != nil
  298.       @skill_window.dispose
  299.     end
  300.     if @item_window != nil
  301.       @item_window.dispose
  302.     end
  303.     if @result_window != nil
  304.       @result_window.dispose
  305.     end
  306.     # スプライトセットを解放
  307.     @spriteset.dispose
  308.     # タイトル画面に切り替え中の場合
  309.     if $scene.is_a?(Scene_Title)
  310.       # 画面をフェードアウト
  311.       Graphics.transition
  312.       Graphics.freeze
  313.     end
  314.     # 戦闘テストからゲームオーバー画面以外に切り替え中の場合
  315.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  316.       $scene = nil
  317.     end
  318.   end
  319.   #--------------------------------------------------------------------------
  320.   # ● 勝敗判定
  321.   #--------------------------------------------------------------------------
  322.   def judge
  323.     # 全滅判定が真、またはパーティ人数が 0 人の場合
  324.     if $game_party.all_dead? or $game_party.actors.size == 0
  325.       # 敗北可能の場合
  326.       if $game_temp.battle_can_lose
  327.         # バトル開始前の BGM に戻す
  328.         $game_system.bgm_play($game_temp.map_bgm)
  329.         # バトル終了
  330.         battle_end(2)
  331.         # true を返す
  332.         return true
  333.       end
  334.       # ゲームオーバーフラグをセット
  335.       $game_temp.gameover = true
  336.       # true を返す
  337.       return true
  338.     end
  339.     # エネミーが 1 体でも存在すれば false を返す
  340.     for enemy in $game_troop.enemies
  341.       if enemy.exist?
  342.         return false
  343.       end
  344.     end
  345.     # アフターバトルフェーズ開始 (勝利)
  346.     start_phase5
  347.     # true を返す
  348.     return true
  349.   end
  350.   #--------------------------------------------------------------------------
  351.   # ● フレーム更新
  352.   #--------------------------------------------------------------------------
  353.   def update
  354.     # バトルイベント実行中の場合
  355.     if $game_system.battle_interpreter.running?
  356.       if @command.size > 0
  357.         @command_a = false
  358.         @command = []
  359.         command_delete
  360.       end
  361.       @status_window.at_refresh
  362.       # インタプリタを更新
  363.       $game_system.battle_interpreter.update
  364.       # アクションを強制されているバトラーが存在しない場合
  365.       if $game_temp.forcing_battler == nil
  366.         # バトルイベントの実行が終わった場合
  367.         unless $game_system.battle_interpreter.running?
  368.           # バトルイベントのセットアップを再実行
  369.           @status_window.refresh
  370.           setup_battle_event
  371.         end
  372.       end
  373.     end
  374.     # システム (タイマー)、画面を更新
  375.     $game_system.update
  376.     $game_screen.update
  377.     # タイマーが 0 になった場合
  378.     if $game_system.timer_working and $game_system.timer == 0
  379.       # バトル中断
  380.       $game_temp.battle_abort = true
  381.     end
  382.     # ウィンドウを更新
  383.     @help_window.update
  384.     @party_command_window.update
  385.     @actor_command_window.update
  386.     @status_window.update
  387.     @message_window.update
  388.     # スプライトセットを更新
  389.     @spriteset.update
  390.     # トランジション処理中の場合
  391.     if $game_temp.transition_processing
  392.       # トランジション処理中フラグをクリア
  393.       $game_temp.transition_processing = false
  394.       # トランジション実行
  395.       if $game_temp.transition_name == ""
  396.         Graphics.transition(20)
  397.       else
  398.         Graphics.transition(40, "Graphics/Transitions/" +
  399.           $game_temp.transition_name)
  400.       end
  401.     end
  402.     # メッセージウィンドウ表示中の場合
  403.     if $game_temp.message_window_showing
  404.       return
  405.     end
  406.     # ゲームオーバーの場合
  407.     if $game_temp.gameover
  408.       # ゲームオーバー画面に切り替え
  409.       $scene = Scene_Gameover.new
  410.       return
  411.     end
  412.     # タイトル画面に戻す場合
  413.     if $game_temp.to_title
  414.       # タイトル画面に切り替え
  415.       $scene = Scene_Title.new
  416.       return
  417.     end
  418.     # バトル中断の場合
  419.     if $game_temp.battle_abort
  420.       # バトル開始前の BGM に戻す
  421.       $game_system.bgm_play($game_temp.map_bgm)
  422.       # バトル終了
  423.       battle_end(1)
  424.       return
  425.     end
  426.     # ヘルプウィンドウ表示中の場合
  427.     if @help_wait > 0
  428.       @help_wait -= 1
  429.       if @help_wait == 0
  430.         # ヘルプウィンドウを隠す
  431.         @help_window.visible = false
  432.       end
  433.     end
  434.     # フェーズによって分岐
  435.     case @phase
  436.     when 0  # ATゲージ更新フェーズ
  437.       if anime_wait_return
  438.         update_phase0
  439.       end
  440.     when 1  # プレバトルフェーズ
  441.       update_phase1
  442.       return
  443.     when 2  # パーティコマンドフェーズ
  444.       update_phase2
  445.       return
  446.     when 5  # アフターバトルフェーズ
  447.       update_phase5
  448.       return
  449.     end
  450.     if $scene != self
  451.       return
  452.     end
  453.     if @phase == 0
  454.       if @command.size != 0  # アクターコマンドフェーズ
  455.         if @command_a == false
  456.           start_phase3
  457.         end
  458.         update_phase3
  459.       end
  460.       # ウェイト中の場合
  461.       if @wait_count > 0
  462.         # ウェイトカウントを減らす
  463.         @wait_count -= 1
  464.         return
  465.       end
  466.       update_phase4
  467.     end
  468.   end
  469. #==============================================================================
  470. # ■ Scene_Battle (分割定義 2)
  471. #------------------------------------------------------------------------------
  472. #  バトル画面の処理を行うクラスです。
  473. #==============================================================================
  474.   #--------------------------------------------------------------------------
  475.   # ● フレーム更新 (ATゲージ更新フェーズ)
  476.   #--------------------------------------------------------------------------
  477.   def update_phase0
  478.     if $game_temp.battle_turn == 0
  479.       $game_temp.battle_turn = 1
  480.     end
  481.     # B ボタンが押された場合
  482.     if @command_a == false and @party == false
  483.       if Input.trigger?(Input::B)
  484.         # キャンセル SE を演奏
  485.         $game_system.se_play($data_system.cancel_se)
  486.         @party = true
  487.       end
  488.     end
  489.     if @party == true and
  490.         ((@action > 0 and @action_battlers.empty?) or (@action == 0 and
  491.         (@action_battlers.empty? or @action_battlers[0].phase == 1)))
  492.       # パーティコマンドフェーズへ
  493.       start_phase2
  494.       return
  495.     end
  496.     # ATゲージ増加処理
  497.     cnt = 0
  498.     for battler in $game_party.actors + $game_troop.enemies
  499.       active?(battler)
  500.       if battler.rtp == 0
  501.         if battler.at >= @max
  502.           if battler.is_a?(Game_Actor)
  503.             if battler.inputable?
  504.               unless @action_battlers.include?(battler) or
  505.                   @command.include?(battler) or @escape == true
  506.                 if battler.current_action.forcing
  507.                   fullat_se
  508.                   force_action(battler)
  509.                   action_start(battler)
  510.                 else
  511.                   fullat_se
  512.                   @command.push(battler)
  513.                 end
  514.               end
  515.             else
  516.               unless @action_battlers.include?(battler) or
  517.                       battler == @command[0]
  518.                 battler.current_action.clear
  519.                 if @command.include?(battler)
  520.                   @command.delete(battler)
  521.                 else
  522.                   if battler.movable?
  523.                     fullat_se
  524.                   end
  525.                 end
  526.                 action_start(battler)
  527.               end
  528.             end
  529.           else
  530.             unless @action_battlers.include?(battler)
  531.               if battler.current_action.forcing
  532.                 force_action(battler)
  533.                 action_start(battler)
  534.               else
  535.                 if @enemy_speed != 0
  536.                   if rand(@enemy_speed) == 0
  537.                     number = cnt - $game_party.actors.size
  538.                     enemy_action(number)
  539.                   end
  540.                 else
  541.                   number = cnt - $game_party.actors.size
  542.                   enemy_action(number)
  543.                 end
  544.               end
  545.             end
  546.           end
  547.         else
  548.           battler.at += battler.agi
  549.           if battler.guarding?
  550.             battler.at += battler.agi
  551.           end
  552.           if battler.movable?
  553.             battler.atp = 100 * battler.at / @max
  554.           end
  555.         end
  556.       else
  557.         if battler.rt >= battler.rtp
  558.           speller = synthe?(battler)
  559.           if speller != nil
  560.             battler = speller[0]
  561.           end
  562.           unless @action_battlers.include?(battler)
  563.             if battler.is_a?(Game_Actor)
  564.               fullat_se
  565.             end
  566.             battler.rt = battler.rtp
  567.             action_start(battler)
  568.           end
  569.         else
  570.           battler.rt += battler.agi
  571.           speller = synthe?(battler)
  572.           if speller != nil
  573.             for spell in speller
  574.               if spell != battler
  575.                 spell.rt += battler.agi
  576.               end
  577.             end
  578.           end
  579.         end
  580.       end
  581.       cnt += 1
  582.     end
  583.     # ATゲージをリフレッシュ
  584.     @status_window.at_refresh
  585.     # 逃走処理
  586.     if @escape == true and
  587.         ((@action > 0 and @action_battlers.empty?) or (@action == 0 and
  588.         (@action_battlers.empty? or @action_battlers[0].phase == 1)))
  589.       temp = false
  590.       for battler in $game_party.actors
  591.         if battler.inputable?
  592.           temp = true
  593.         end
  594.       end
  595.       if temp == true
  596.         for battler in $game_party.actors
  597.           if battler.at < @max and battler.inputable?
  598.             temp = false
  599.             break
  600.           end
  601.         end
  602.         if temp == true
  603.           @escape = false
  604.           for battler in $game_party.actors
  605.             battler.at %= @max
  606.           end
  607.           $game_temp.battle_main_phase = false
  608.           update_phase2_escape
  609.         end
  610.       end
  611.     end
  612.   end
  613.   #--------------------------------------------------------------------------
  614.   # ● パーティコマンドフェーズ開始
  615.   #--------------------------------------------------------------------------
  616.   def start_phase2
  617.     # フェーズ 2 に移行
  618.     @phase = 2
  619.     @party = false
  620.     # パーティコマンドウィンドウを有効化
  621.     @party_command_window.active = true
  622.     @party_command_window.visible = true
  623.     # アクターを非選択状態に設定
  624.     @actor_index = -1
  625.     # アクターコマンドウィンドウを無効化
  626.     @actor_command_window.active = false
  627.     @actor_command_window.visible = false
  628.     if @command.size != 0
  629.       # アクターの明滅エフェクト OFF
  630.       if @active_actor != nil
  631.         @active_actor.blink = false
  632.       end
  633.     end
  634.     # カメラセット
  635.     @camera == "party"
  636.     # メインフェーズフラグをクリア
  637.     $game_temp.battle_main_phase = false
  638.   end
  639.   #--------------------------------------------------------------------------
  640.   # ● フレーム更新 (パーティコマンドフェーズ)
  641.   #--------------------------------------------------------------------------
  642.   def update_phase2
  643.     # C ボタンが押された場合
  644.     if Input.trigger?(Input::C)
  645.       # パーティコマンドウィンドウのカーソル位置で分岐
  646.       case @party_command_window.index
  647.       when 0  # 戦う
  648.         # パーティコマンドウィンドウを無効化
  649.         @party_command_window.active = false
  650.         @party_command_window.visible = false
  651.         # 決定 SE を演奏
  652.         $game_system.se_play($data_system.decision_se)
  653.         @escape = false
  654.         @phase = 0
  655.         if $game_temp.battle_turn == 0
  656.           $game_temp.battle_turn = 1
  657.         end
  658.         if @command_a == true
  659.           # アクターコマンドフェーズ開始
  660.           start_phase3
  661.         else
  662.           $game_temp.battle_main_phase = true
  663.         end
  664.       when 1  # 逃げる
  665.         # 逃走可能ではない場合
  666.         if $game_temp.battle_can_escape == false
  667.           # ブザー SE を演奏
  668.           $game_system.se_play($data_system.buzzer_se)
  669.           return
  670.         end
  671.         # 決定 SE を演奏
  672.         $game_system.se_play($data_system.decision_se)
  673.         @phase = 0
  674.         # パーティコマンドウィンドウを無効化
  675.         @party_command_window.active = false
  676.         @party_command_window.visible = false
  677.         $game_temp.battle_main_phase = true
  678.         if $game_temp.battle_turn == 0
  679.           update_phase2_escape
  680.           $game_temp.battle_turn = 1
  681.           for battler in $game_party.actors
  682.             battler.at -= @max / 2
  683.           end
  684.           return
  685.         end
  686.         # 決定 SE を演奏
  687.         $game_system.se_play($data_system.decision_se)
  688.         @escape = true
  689.         for battler in $game_party.actors
  690.           @command_a = false
  691.           @command.delete(battler)
  692.           @action_battlers.delete(battler)
  693.           skill_reset(battler)
  694.         end
  695.       end
  696.       return
  697.     end
  698.   end
  699.   #--------------------------------------------------------------------------
  700.   # ● アフターバトルフェーズ開始
  701.   #--------------------------------------------------------------------------
  702.   def start_phase5
  703.     # フェーズ 5 に移行
  704.     @phase = 5
  705.     # バトル終了 ME を演奏
  706.     $game_system.me_play($game_system.battle_end_me)
  707.     # バトル開始前の BGM に戻す
  708.     $game_system.bgm_play($game_temp.map_bgm)
  709.     # EXP、ゴールド、トレジャーを初期化
  710.     exp = 0
  711.     gold = 0
  712.     treasures = []
  713.     if @active_actor != nil
  714.       @active_actor.blink = false
  715.     end
  716.     # メインフェーズフラグをセット
  717.     $game_temp.battle_main_phase = true
  718.     # パーティコマンドウィンドウを無効化
  719.     @party_command_window.active = false
  720.     @party_command_window.visible = false
  721.     # アクターコマンドウィンドウを無効化
  722.     @actor_command_window.active = false
  723.     @actor_command_window.visible = false
  724.     if @skill_window != nil
  725.       # スキルウィンドウを解放
  726.       @skill_window.dispose
  727.       @skill_window = nil
  728.     end
  729.     if @item_window != nil
  730.       # アイテムウィンドウを解放
  731.       @item_window.dispose
  732.       @item_window = nil
  733.     end
  734.     # ヘルプウィンドウを隠す
  735.     @help_window.visible = false
  736.     # ループ
  737.     for enemy in $game_troop.enemies
  738.       # エネミーが隠れ状態でない場合
  739.       unless enemy.hidden
  740.         # 獲得 EXP、ゴールドを追加
  741.         exp += enemy.exp
  742.         gold += enemy.gold
  743.         # トレジャー出現判定
  744.         if rand(100) < enemy.treasure_prob
  745.           if enemy.item_id > 0
  746.             treasures.push($data_items[enemy.item_id])
  747.           end
  748.           if enemy.weapon_id > 0
  749.             treasures.push($data_weapons[enemy.weapon_id])
  750.           end
  751.           if enemy.armor_id > 0
  752.             treasures.push($data_armors[enemy.armor_id])
  753.           end
  754.         end
  755.       end
  756.     end
  757.     # トレジャーの数を 6 個までに限定
  758.     treasures = treasures[0..5]
  759.     # EXP 獲得
  760.     for i in 0...$game_party.actors.size
  761.       actor = $game_party.actors[i]
  762.       if actor.cant_get_exp? == false
  763.         last_level = actor.level
  764.         actor.exp += exp
  765.         if actor.level > last_level
  766.           actor.hp=actor.maxhp
  767.           actor.sp=actor.maxsp
  768.           @status_window.level_up(i)
  769.           actor.damage[[actor, -1]] = "Level Up!"
  770.           actor.up_level = actor.level - last_level
  771.         end
  772.       end
  773.     end
  774.     # ゴールド獲得
  775.     $game_party.gain_gold(gold)
  776.     # トレジャー獲得
  777.     for item in treasures
  778.       case item
  779.       when RPG::Item
  780.         $game_party.gain_item(item.id, 1)
  781.       when RPG::Weapon
  782.         $game_party.gain_weapon(item.id, 1)
  783.       when RPG::Armor
  784.         $game_party.gain_armor(item.id, 1)
  785.       end
  786.     end
  787.     # バトルリザルトウィンドウを作成
  788.     @result_window = Window_BattleResult.new(exp, gold, treasures)
  789.     # ウェイトカウントを設定
  790.     @phase5_wait_count = 100
  791.   end
  792.   #--------------------------------------------------------------------------
  793.   # ● フレーム更新 (アフターバトルフェーズ)
  794.   #--------------------------------------------------------------------------
  795.   def update_phase5
  796.     # ウェイトカウントが 0 より大きい場合
  797.     if @phase5_wait_count > 0
  798.       # ウェイトカウントを減らす
  799.       @phase5_wait_count -= 1
  800.       # ウェイトカウントが 0 になった場合
  801.       if @phase5_wait_count == 0
  802.         # リザルトウィンドウを表示
  803.         @result_window.visible = true
  804.         # メインフェーズフラグをクリア
  805.         $game_temp.battle_main_phase = false
  806.         # ステータスウィンドウをリフレッシュ
  807.         @status_window.refresh
  808.         for actor in $game_party.actors
  809.           if actor.damage.include?([actor, 0])
  810.             @phase5_wait_count = 20
  811.             actor.damage_pop[[actor, 0]] = true
  812.           end
  813.           if actor.damage.include?([actor, -1])
  814.             @phase5_wait_count = 20
  815.             actor.damage_pop[[actor, -1]] = true
  816.             for level in actor.level - actor.up_level + 1..actor.level
  817.               for skill in $data_classes[actor.class_id].learnings
  818.                 if level == skill.level and not actor.skill_learn?(skill.id)
  819.                   actor.damage[[actor, 0]] = "New Skill!"
  820.                   break
  821.                 end
  822.               end
  823.             end
  824.           end
  825.         end
  826.       end
  827.       return
  828.     end
  829.     # C ボタンが押された場合
  830.     if Input.trigger?(Input::C)
  831.       # バトル終了
  832.       battle_end(0)
  833.     end
  834.   end
  835. #==============================================================================
  836. # ■ Scene_Battle (分割定義 3)
  837. #------------------------------------------------------------------------------
  838. #  バトル画面の処理を行うクラスです。
  839. #==============================================================================
  840.   #--------------------------------------------------------------------------
  841.   # ● アクターコマンドフェーズ開始
  842.   #--------------------------------------------------------------------------
  843.   def start_phase3
  844.     # メインフェーズフラグをクリア
  845.     $game_temp.battle_main_phase = false
  846.     @command_a = true
  847.     @active_actor = @command[0]
  848.     cnt = 0
  849.     for actor in $game_party.actors
  850.       if actor == @active_actor
  851.         @actor_index = cnt
  852.       end
  853.       cnt += 1
  854.     end
  855.     @active_actor.blink = true
  856.     unless @active_actor.inputable?
  857.       @active_actor.current_action.clear
  858.       phase3_next_actor
  859.       return
  860.     end
  861.     phase3_setup_command_window
  862.     # カメラの設定
  863.     @camera = "command"
  864.     plus = ($game_party.actors.size - 1) / 2.0 - @actor_index
  865.     y = [(plus.abs - 1.5) * 10 , 0].min
  866.   end
  867.   #--------------------------------------------------------------------------
  868.   # ● アクターのコマンド入力終了
  869.   #--------------------------------------------------------------------------
  870.   def phase3_next_actor
  871.     @command.shift
  872.     @command_a = false
  873.     # メインフェーズフラグをセット
  874.     $game_temp.battle_main_phase = true
  875.     # アクターコマンドウィンドウを無効化
  876.     @actor_command_window.active = false
  877.     @actor_command_window.visible = false
  878.     # アクターの明滅エフェクト OFF
  879.     if @active_actor != nil
  880.       @active_actor.blink = false
  881.     end
  882.     action_start(@active_actor)
  883.     # カメラを元に戻す
  884.     if @camera == "command"
  885.     end
  886.     return
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ● アクターコマンドウィンドウのセットアップ
  890.   #--------------------------------------------------------------------------
  891.   def phase3_setup_command_window
  892.     # パーティコマンドウィンドウを無効化
  893.     @party_command_window.active = false
  894.     @party_command_window.visible = false
  895.     # アクターコマンドウィンドウを有効化
  896.     @actor_command_window.active = true
  897.     @actor_command_window.visible = true
  898.     # アクターコマンドウィンドウの位置を設定
  899.     @actor_command_window.x = @actor_index * 160 +
  900.                               (4 - $game_party.actors.size) * 80
  901.     # インデックスを 0 に設定
  902.     @actor_command_window.index = 0
  903.   end
  904.   #--------------------------------------------------------------------------
  905.   # ● エネミーアクション作成
  906.   #--------------------------------------------------------------------------
  907.   def enemy_action(number)
  908.     enemy = $game_troop.enemies[number]
  909.     unless enemy.current_action.forcing
  910.       enemy.make_action
  911.     end
  912.     action_start(enemy)
  913.   end
  914.   #--------------------------------------------------------------------------
  915.   # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  916.   #--------------------------------------------------------------------------
  917.   def update_phase3_basic_command
  918.     unless @active_actor.inputable?
  919.       @active_actor.current_action.clear
  920.       phase3_next_actor
  921.       return
  922.     end
  923.     # B ボタンが押された場合
  924.     if Input.trigger?(Input::B) and @party == false
  925.       # キャンセル SE を演奏
  926.       $game_system.se_play($data_system.cancel_se)
  927.       @party = true
  928.     end
  929.     if @party == true and
  930.         ((@action > 0 and @action_battlers.empty?) or (@action == 0 and
  931.         (@action_battlers.empty? or @action_battlers[0].phase == 1)))
  932.       # パーティコマンドフェーズへ
  933.       start_phase2
  934.       return
  935.     end
  936.     # C ボタンが押された場合
  937.     if Input.trigger?(Input::C)
  938.       @party = false
  939.       # アクターコマンドウィンドウのカーソル位置で分岐
  940.       case @actor_command_window.index
  941.       when 0  # 攻撃
  942.         if victory?
  943.           # ブザー SE を演奏
  944.           $game_system.se_play($data_system.buzzer_se)
  945.           return
  946.         end
  947.         # 決定 SE を演奏
  948.         $game_system.se_play($data_system.decision_se)
  949.         # エネミーの選択を開始
  950.         start_enemy_select
  951.       when 1  # スキル
  952.         # 決定 SE を演奏
  953.         $game_system.se_play($data_system.decision_se)
  954.         # スキルの選択を開始
  955.         start_skill_select
  956.       when 2  # 防御
  957.         # 決定 SE を演奏
  958.         $game_system.se_play($data_system.decision_se)
  959.         # アクションを設定
  960.         @active_actor.current_action.kind = 0
  961.         @active_actor.current_action.basic = 1
  962.         # 次のアクターのコマンド入力へ
  963.         phase3_next_actor
  964.       when 3  # アイテム
  965.         # 決定 SE を演奏
  966.         $game_system.se_play($data_system.decision_se)
  967.         # アイテムの選択を開始
  968.         start_item_select
  969.       end
  970.       return
  971.     end
  972.     # R ボタンが押された場合
  973.     if Input.trigger?(Input::R)
  974.       $game_system.se_play($data_system.cursor_se)
  975.       @party = false
  976.       # アクターの明滅エフェクト OFF
  977.       if @active_actor != nil
  978.         @active_actor.blink = false
  979.       end
  980.       @command.push(@command[0])
  981.       @command.shift
  982.       @command_a = false
  983.       # メインフェーズフラグをセット
  984.       $game_temp.battle_main_phase = true
  985.       # アクターコマンドウィンドウを無効化
  986.       @actor_command_window.active = false
  987.       @actor_command_window.visible = false
  988.     end
  989.     # L ボタンが押された場合
  990.     if Input.trigger?(Input::L)
  991.       $game_system.se_play($data_system.cursor_se)
  992.       @party = false
  993.       # アクターの明滅エフェクト OFF
  994.       if @active_actor != nil
  995.         @active_actor.blink = false
  996.       end
  997.       @command.unshift(@command[@command.size - 1])
  998.       @command.delete_at(@command.size - 1)
  999.       @command_a = false
  1000.       # メインフェーズフラグをセット
  1001.       $game_temp.battle_main_phase = true
  1002.       # アクターコマンドウィンドウを無効化
  1003.       @actor_command_window.active = false
  1004.       @actor_command_window.visible = false
  1005.     end
  1006.     # 右 ボタンが押された場合
  1007.     if Input.trigger?(Input::RIGHT)
  1008.       $game_system.se_play($data_system.cursor_se)
  1009.       @party = false
  1010.       # アクターの明滅エフェクト OFF
  1011.       if @active_actor != nil
  1012.         @active_actor.blink = false
  1013.       end
  1014.       actor = $game_party.actors[@actor_index]
  1015.       while actor == @command[0] or (not @command.include?(actor))
  1016.         @actor_index += 1
  1017.         @actor_index %= $game_party.actors.size
  1018.         actor = $game_party.actors[@actor_index]
  1019.         if actor == @command[0]
  1020.           break
  1021.         end
  1022.       end
  1023.       while actor != @command[0]
  1024.         @command.push(@command.shift)
  1025.       end
  1026.       @command_a = false
  1027.       # メインフェーズフラグをセット
  1028.       $game_temp.battle_main_phase = true
  1029.       # アクターコマンドウィンドウを無効化
  1030.       @actor_command_window.active = false
  1031.       @actor_command_window.visible = false
  1032.     end
  1033.     # 左 ボタンが押された場合
  1034.     if Input.trigger?(Input::LEFT)
  1035.       $game_system.se_play($data_system.cursor_se)
  1036.       @party = false
  1037.       # アクターの明滅エフェクト OFF
  1038.       if @active_actor != nil
  1039.         @active_actor.blink = false
  1040.       end
  1041.       actor = $game_party.actors[@actor_index]
  1042.       while actor == @command[0] or (not @command.include?(actor))
  1043.         @actor_index -= 1
  1044.         @actor_index %= $game_party.actors.size
  1045.         actor = $game_party.actors[@actor_index]
  1046.         if actor == @command[0]
  1047.           break
  1048.         end
  1049.       end
  1050.       while actor != @command[0]
  1051.         @command.push(@command.shift)
  1052.       end
  1053.       @command_a = false
  1054.       # メインフェーズフラグをセット
  1055.       $game_temp.battle_main_phase = true
  1056.       # アクターコマンドウィンドウを無効化
  1057.       @actor_command_window.active = false
  1058.       @actor_command_window.visible = false
  1059.     end
  1060.   end
  1061.   #--------------------------------------------------------------------------
  1062.   # ● フレーム更新 (アクターコマンドフェーズ : スキル選択)
  1063.   #--------------------------------------------------------------------------
  1064.   def update_phase3_skill_select
  1065.     # コマンド選択中に行動不能になった場合
  1066.     unless @active_actor.inputable?
  1067.       @active_actor.current_action.clear
  1068.       command_delete
  1069.       # 次のアクターのコマンド入力へ
  1070.       phase3_next_actor
  1071.       return
  1072.     end
  1073.     # スキルウィンドウを可視状態にする
  1074.     @skill_window.visible = true
  1075.     # スキルウィンドウを更新
  1076.     @skill_window.update
  1077.     # B ボタンが押された場合
  1078.     if Input.trigger?(Input::B)
  1079.       # キャンセル SE を演奏
  1080.       $game_system.se_play($data_system.cancel_se)
  1081.       # スキルの選択を終了
  1082.       end_skill_select
  1083.       return
  1084.     end
  1085.     # C ボタンが押された場合
  1086.     if Input.trigger?(Input::C)
  1087.       # スキルウィンドウで現在選択されているデータを取得
  1088.       @skill = @skill_window.skill
  1089.       # 使用できない場合
  1090.       if @skill == nil or not @active_actor.skill_can_use?(@skill.id)
  1091.         # ブザー SE を演奏
  1092.         $game_system.se_play($data_system.buzzer_se)
  1093.         return
  1094.       end
  1095.       if @skill.scope == 1 or @skill.scope == 2
  1096.         if victory?
  1097.           # ブザー SE を演奏
  1098.           $game_system.se_play($data_system.buzzer_se)
  1099.           return
  1100.         end
  1101.       end        
  1102.       # 決定 SE を演奏
  1103.       $game_system.se_play($data_system.decision_se)
  1104.       # アクションを設定
  1105.       @active_actor.current_action.skill_id = @skill.id
  1106.       # スキルウィンドウを不可視状態にする
  1107.       @skill_window.visible = false
  1108.       # 効果範囲が敵単体の場合
  1109.       if @skill.scope == 1
  1110.         # エネミーの選択を開始
  1111.         start_enemy_select
  1112.       # 効果範囲が味方単体の場合
  1113.       elsif @skill.scope == 3 or @skill.scope == 5
  1114.         # アクターの選択を開始
  1115.         start_actor_select
  1116.       # 効果範囲が単体ではない場合
  1117.       else
  1118.         # アクションを設定
  1119.         @active_actor.current_action.kind = 1
  1120.         # スキルの選択を終了
  1121.         end_skill_select
  1122.         # 次のアクターのコマンド入力へ
  1123.         phase3_next_actor
  1124.       end
  1125.       return
  1126.     end
  1127.   end
复制代码
回复

使用道具 举报

88

主题

5419

帖子

214748万

积分

版主

S素世上最伟大最华丽

Rank: 7Rank: 7Rank: 7

积分
2147483647
QQ
发表于 2007-3-10 23:48:36 | 显示全部楼层
http://bbs.rpgchina.com/read-htm ... d-%C8%A5%B5%F4.html

参见此帖...里面说的方法同样适用于这个脚本哦~~
回复 支持 反对

使用道具 举报

12

主题

37

帖子

409

积分

④见习

积分
409
 楼主| 发表于 2007-3-10 23:49:41 | 显示全部楼层
......不好意思,太长了.......
改一改地址
ftp://dlnew@ftp2.不良语言.com/web3/200701/rtabinhengban.rar
回复 支持 反对

使用道具 举报

88

主题

5419

帖子

214748万

积分

版主

S素世上最伟大最华丽

Rank: 7Rank: 7Rank: 7

积分
2147483647
QQ
发表于 2007-3-11 00:21:00 | 显示全部楼层
这...这叫太...太...太长了...
S一般只给提示,给您造成的不便表示抱歉先~
回复 支持 反对

使用道具 举报

12

主题

37

帖子

409

积分

④见习

积分
409
 楼主| 发表于 2007-3-11 12:22:07 | 显示全部楼层
自己解决了..... [s:4]
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-24 15:25 , Processed in 0.013678 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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