#============================================================================== # ■ 英雄伝説空の軌跡風戦闘システム # @version 0.70 09/07/04 # @author さば缶 # バトル高速化元ソース:歯車の城様 http://members.jcom.home.ne.jp/cogwheel/ #------------------------------------------------------------------------------ # さば缶様「空の軌跡風戦闘」システムのオートバトル拡張セクションです。 # !!!!導入位置は「空の軌跡戦闘システム」の「上」でお願いします。 # でないと再定義の関係で動かない希ガス。 # なお$game_temp.auto_battle_modeでフラグ取りをしていますがどういう流れか # 把握していない為「とりあえず作ったら動いた。反省はしていない。」レベルです。 #============================================================================== module Auto #戦闘終了時にオートバトルモードを解除するか否かの判定です。trueで解除。 BATTLE_END_AUTO_FLAG = true #オートバトル時にアニメーションをカットするか否かの判定です。trueでカット。 ANIMATION_CUT = true #オート戦闘高速化倍率(2で2倍)あまり大きすぎるとザ・ワールドになります。 SPEED_RATE = 2 end #============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ #  空の軌跡っぽい戦闘シーンです。 #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 戦闘終了 # result : 結果 (0:勝利 1:逃走 2:敗北) #-------------------------------------------------------------------------- alias auto_battle_end battle_end def battle_end(result) $game_temp.auto_battle_mode = false if Auto::BATTLE_END_AUTO_FLAG == true auto_battle_end(result) end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 : 攻撃 # 仕方なく再定義 #-------------------------------------------------------------------------- def execute_action_attack text = sprintf(Vocab::DoAttack, @active_battler.name) @message_window.add_instant_text(text) targets = @active_battler.action.make_targets display_attack_animation(targets) if animation_cut? wait(20) for target in targets target.attack_effect(@active_battler) display_action_effects(target) end end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 : スキル # 仕方なく再定義 #-------------------------------------------------------------------------- def execute_action_skill skill = @active_battler.action.skill text = @active_battler.name + skill.message1 @message_window.add_instant_text(text) unless skill.message2.empty? wait(10) @message_window.add_instant_text(skill.message2) end targets = @active_battler.action.make_targets display_animation(targets, skill.animation_id) if animation_cut? @active_battler.mp -= @active_battler.calc_mp_cost(skill) $game_temp.common_event_id = skill.common_event_id for target in targets target.skill_effect(@active_battler, skill) display_action_effects(target, skill) end end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 : アイテム # 仕方なく再定義 #-------------------------------------------------------------------------- def execute_action_item item = @active_battler.action.item text = sprintf(Vocab::UseItem, @active_battler.name, item.name) @message_window.add_instant_text(text) targets = @active_battler.action.make_targets display_animation(targets, item.animation_id) if animation_cut? $game_party.consume_item(item) $game_temp.common_event_id = item.common_event_id for target in targets target.item_effect(@active_battler, item) display_action_effects(target, item) end end #-------------------------------------------------------------------------- # ● オート時のアニメーションカット判定 #-------------------------------------------------------------------------- def animation_cut? return false if $game_temp.auto_battle_mode == true && Auto::ANIMATION_CUT == true return true end end class << Graphics #-------------------------------------------------------------------------- # ● フレーム更新 # unless method_defined?("update_battle_spd") :この記述の意味がわからない。 # method_defined? :ヘルプ及び全セクション検索しても出てこない。なぜ? #-------------------------------------------------------------------------- alias :update_battle_spd :update unless method_defined?("update_battle_spd") def update # 戦闘中かつオートバトル動作中かつフレームカウントが SPEED の倍数でない時 if $game_temp.in_battle and $game_temp.auto_battle_mode and Graphics.frame_count % Auto::SPEED_RATE > 0 # グラフィックの更新をせず、カウントだけ加算する Graphics.frame_count += 1 #フレームカウントが Auto::SPEED_RATE の倍数の時 else # グラフィックの更新を行う update_battle_spd end end end