class Scene_Map
def call_battle
[...]
$game_player.make_encounter_count
if $game_system.map_bgm_in_battle == false
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
end
$game_system.se_play($data_system.battle_start_se)
if $game_system.map_bgm_in_battle == false
$game_system.bgm_play($game_system.battle_bgm)
end
$game_player.straighten
[...]
end
然后是Scene_Battle
class Scene_Battle
def judge
[...]
if $game_temp.battle_can_lose
if $game_system.map_bgm_in_battle == false
$game_system.bgm_play($game_temp.map_bgm)
end
battle_end(2)
[...]
end
# ----------------------------
def update
[...]
if $game_temp.battle_abort
if $game_system.map_bgm_in_battle == false
$game_system.bgm_play($game_temp.map_bgm)
end
battle_end(1)
[...]
end
# ----------------------------
def update_phase2_escape
[...]
if success
$game_system.se_play($data_system.escape_se)
if $game_system.map_bgm_in_battle == false
$game_system.bgm_play($game_temp.map_bgm)
end
battle_end(1)
[...]
end
# ----------------------------
def start_phase5
@phase = 5
if $game_system.map_bgm_in_battle == false
$game_system.me_play($game_system.battle_end_me)
$game_system.bgm_play($game_temp.map_bgm)
end
exp = 0
gold = 0
treasures = []
[...]
end