- =begin 
-       ★戦闘前後BGM継続★ 
-   
-       戦闘曲にBGMではなく、BGSを使用し、 
-       バックグラウンドにマップBGMを音量0で流し続けることで、 
-       戦闘後、マップ上のBGMを途切れさせずに、再開させることができます。 
-        
-       また、指定スイッチをONにしている場合、戦闘BGMを演奏せず、 
-       マップBGMを戦闘に持ち越すことができます。 
-        
-       ● 仕様 ●========================================================== 
-       BGSの機能を使って、戦闘曲を演奏しますが、 
-       ファイルの読み込み先はBGMフォルダのままですので、 
-       ファイルの移動などは特に必要ありません。 
-       ==================================================================== 
-   
-       ● 注意 ●========================================================== 
-       このスクリプトを導入すると、 
-       戦闘BGMにMIDI形式のファイルが再生できなくなります。 
-       ==================================================================== 
-        
-       ver1.12 
-   
-       Last Update : 2010/07/02 
-       07/02 : マップBGMを持ち越した際、ゲームオーバーMEが演奏されないバグを修正 
-       01/23 : マップのBGMを戦闘に持ち越す機能の追加 
-       12/27 : 逃走時にBGMが復帰しないバグの修正 
-          : 復帰時にBGMのフェードインを行うように調整 
-       12/18 : 新規 
-        
-       ろかん   [url]http://kaisouryouiki.web.fc2.com/[/url] 
- =end 
-   
- #=================================== 
- #  ●設定箇所 
- #=================================== 
- module Rokan 
- module Battle_Audio 
-   # 戦闘にマップBGMを引き継ぐ場合の判定スイッチ番号 
-   MBATH = 0 
-   
-   # マップBGM引き継ぎ時には勝利MEを演奏しない 
-   MAWMTH = true 
- end 
- end 
- #=================================== 
- #  ここまで 
- #=================================== 
-   
- $rsi = {} if $rsi == nil 
- $rsi["战斗前后BGM继续"] = true 
-   
- class << Graphics 
-   alias update_bgm_fade_in update unless $! 
-   def update 
-     update_bgm_fade_in 
-     RPG::BGM.volume_fade_in(3) unless $scene.is_a?(Scene_Battle) 
-   end 
- end 
-   
- module RPG 
-   class BATTLE_BGS < BGS 
-     include Rokan::Battle_Audio 
-     def play 
-       return if $game_switches[MBATH] 
-       if @name.empty? 
-         Audio.bgs_stop 
-         @@last = BGS.new 
-       else 
-         Audio.bgs_play("Audio/BGM/" + @name, @volume, @pitch) 
-         @@last = self 
-       end 
-     end 
-   end 
-   
-   class BGM < AudioFile 
-     include Rokan::Battle_Audio 
-     def play 
-       if @name.empty? 
-         Audio.bgm_stop 
-         @@last = BGM.new 
-       else 
-         Audio.bgm_play("Audio/BGM/" + @name, @volume, @pitch) 
-         @@last_volume  = @@origin_volume = @volume 
-         @@last = self 
-       end 
-     end 
-   
-     def self.stop 
-       return if $game_temp.in_battle 
-       if $game_temp.next_scene == "battle" 
-         volume_off unless $game_switches[MBATH] 
-         return 
-       end 
-       Audio.bgm_stop 
-       @@last = BGM.new 
-     end 
-   
-     def self.volume_off? 
-       return false if @@last.name.empty? 
-       return (@@last_volume < @@origin_volume) 
-     end 
-     def self.volume_fade_in(plas) 
-       return unless volume_off? 
-       @@last_volume = [@@last_volume + plas, @@origin_volume].min 
-       Audio.bgm_play("Audio/BGM/" + @@last.name, @@last_volume, @@last.pitch) 
-     end 
-     def self.volume_on 
-       return if @@last.name.empty? 
-       Audio.bgm_play("Audio/BGM/" + @@last.name, @@origin_volume, @@last.pitch) 
-       @@last_volume = @@origin_volume 
-     end 
-     def self.volume_off 
-       return if @@last.name.empty? 
-       @@last_volume = 0 
-       Audio.bgm_play("Audio/BGM/" + @@last.name, @@last_volume, @@last.pitch) 
-     end 
-   end 
-   class ME < AudioFile 
-     include Rokan::Battle_Audio 
-     alias map_bgm_restart play unless $! 
-     def play 
-       if $game_switches[MBATH] && MAWMTH && $scene.is_a?(Scene_Battle) 
-         $game_system.battle_end_me_play = false 
-         return 
-       end 
-       map_bgm_restart 
-       if $game_system.battle_end_me_play 
-         $game_system.battle_end_me_play = false 
-         RPG::BGM.volume_on 
-       end 
-     end 
-   end 
- end 
-   
- class Game_Temp 
-   #-------------------------------------------------------------------------- 
-   # ● 戦闘時マップBGM記憶変数取得時に、BGSを返す 
-   #-------------------------------------------------------------------------- 
-   def map_bgm 
-     return @map_bgs 
-   end 
- end 
-   
- class Game_System 
-   #-------------------------------------------------------------------------- 
-   # ● 公開インスタンス変数 
-   #-------------------------------------------------------------------------- 
-   attr_accessor :battle_end_me_play         # バトル終了 ME 演奏済みフラグ 
-   #-------------------------------------------------------------------------- 
-   # ● オブジェクト初期化 
-   #-------------------------------------------------------------------------- 
-   alias battle_me_flag_plas initialize 
-   def initialize 
-     battle_me_flag_plas 
-     @battle_end_me_play = false 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● BGM取得 
-   #-------------------------------------------------------------------------- 
-   def battle_bgm 
-     bgm = @battle_bgm == nil ? $data_system.battle_bgm : @battle_bgm 
-     return RPG::BATTLE_BGS.new(bgm.name, bgm.volume, bgm.pitch) 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● 終了取得 
-   #-------------------------------------------------------------------------- 
-   alias map_bgm_fadein_flag battle_end_me 
-   def battle_end_me 
-     @battle_end_me_play = true 
-     map_bgm_fadein_flag 
-   end 
- end