在战斗中使用地图的背景音乐
这本是一个脚本,但如果单纯地放出来,冲突就太明显了。我们来看看怎样通过修改使得战斗的时候播放地图的背景音乐:
首先,在Game_System中添加如下内容:[...]表示原有内容不用动
class Game_System
# ----------------------------------------
[...]
attr_accessor :map_bgm_in_battle
[...]
@map_bgm_in_battle = false
然后是Scene_Map
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
这个脚本经过修改后是怎么运作的呢?相信对脚本稍有了解的人都能明白了:只是将原来切换音乐的地方添加了一个if条件,如果$game_system.map_bgm_in_battle == true,则就会保留地图的BGM。这种效果非常诡异,因为一般的游戏战斗的时候都会更换音乐的,没有更换的,我所知的就一个,就是我的《黑暗圣剑传说》……
这种方法可以用来控制游戏的节奏感,有兴趣的话可以尝试一下。
这本是一个脚本,但如果单纯地放出来,冲突就太明显了。我们来看看怎样通过修改使得战斗的时候播放地图的背景音乐:
首先,在Game_System中添加如下内容:[...]表示原有内容不用动
class Game_System
# ----------------------------------------
[...]
attr_accessor :map_bgm_in_battle
[...]
@map_bgm_in_battle = false
然后是Scene_Map
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
这个脚本经过修改后是怎么运作的呢?相信对脚本稍有了解的人都能明白了:只是将原来切换音乐的地方添加了一个if条件,如果$game_system.map_bgm_in_battle == true,则就会保留地图的BGM。这种效果非常诡异,因为一般的游戏战斗的时候都会更换音乐的,没有更换的,我所知的就一个,就是我的《黑暗圣剑传说》……
这种方法可以用来控制游戏的节奏感,有兴趣的话可以尝试一下。