-
Notifications
You must be signed in to change notification settings - Fork 1
/
defeat_bgm.rb
46 lines (45 loc) · 2.21 KB
/
defeat_bgm.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#==============================================================================
# ■ 戦闘敗北BGM RGSS3 v1.0 MIT License; see git.io/tic
#------------------------------------------------------------------------------
# 戦闘敗北時にBGMを演奏します。イベントコマンド「スクリプト」に
# $game_system.battle_defeat_bgm =
# RPG::BGM.new("ファイル名", ボリューム, ピッチ)
# と記述することで戦闘敗北BGMをゲーム中に変更することもできます。
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# ● 定数
#--------------------------------------------------------------------------
DEFAULT_BATTLE_DEFEAT_BGM = RPG::BGM.new("", 100, 100) # 既定の BGM
#--------------------------------------------------------------------------
# ● オブジェクト初期化【エイリアス】
#--------------------------------------------------------------------------
alias toruic2_initialize initialize
def initialize
toruic2_initialize
@battle_defeat_bgm = nil
end
#--------------------------------------------------------------------------
# ● 【新規】戦闘敗北 BGM の取得
#--------------------------------------------------------------------------
def battle_defeat_bgm
@battle_defeat_bgm || DEFAULT_BATTLE_DEFEAT_BGM
end
#--------------------------------------------------------------------------
# ● 【新規】戦闘敗北 BGM の設定
#--------------------------------------------------------------------------
def battle_defeat_bgm=(battle_defeat_bgm)
@battle_defeat_bgm = battle_defeat_bgm
end
end
#------------------------------------------------------------------------------
class << BattleManager
#--------------------------------------------------------------------------
# ● 敗北の処理【エイリアス】
#--------------------------------------------------------------------------
alias toruic_process_defeat process_defeat
def process_defeat
$game_system.battle_defeat_bgm.play if $game_system.battle_defeat_bgm
toruic_process_defeat
end
end