Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Ambush BGMs (1.0)
- # 23/02/2012
- # By Pacman (inspired by modern algebra)
- # This script allows you to assign special BGMs for when the party is surprised
- # by an enemy troop or preemptively attacks an enemy troop. You can also change
- # the assigned BGM through a script call.
- # Use the script calls:
- # $game_system.preemptive_bbgm = "Name"
- # $game_system.surprise_bbgm = "Name"
- # To change, respectively, the preemptive or surprise BGMs to the music file
- # (in the BGM folder) "Name". You may set the initial BGMs in the configuration
- # below.
- #
- #===============================================================================
- #
- # START CONFIGURATION
- module AMB_BGM # Don't touch this.
- PREEMPTIVE = "Battle2" # Preemptive battle music.
- SURPRISE = "Battle3" # Surprise battle music.
- end # Don't touch this.
- #
- # END CONFIGURATION
- #
- #===============================================================================
- #==============================================================================
- # ■ BattleManager
- #------------------------------------------------------------------------------
- # 戦闘の進行を管理するモジュールです。
- #==============================================================================
- module BattleManager
- class << self
- alias ambush_bgms init_members
- attr_reader :preemptive
- attr_reader :surprise
- end
- end
- #==============================================================================
- # ■ Game_System
- #------------------------------------------------------------------------------
- # システム周りのデータを扱うクラスです。セーブやメニューの禁止状態などを保存
- # します。このクラスのインスタンスは $game_system で参照されます。
- #==============================================================================
- class Game_System
- attr_accessor :preemptive_bbgm
- attr_accessor :surprise_bbgm
- alias ambush_bgms_init initialize
- def initialize(*a)
- @preemptive_bbgm = AMB_BGM::PREEMPTIVE
- @surprise_bbgm = AMB_BGM::SURPRISE
- ambush_bgms_init(*a)
- end
- alias ambush_bgms_bbgm battle_bgm
- def battle_bgm(*a)
- if BattleManager.preemptive
- RPG::BGM.new(@preemptive_bbgm)
- elsif BattleManager.surprise
- RPG::BGM.new(@surprise_bbgm)
- else
- ambush_bgms_bbgm(*a)
- end
- end
- end
- $imported ||= {}
- $imported[:pac_ambush_bgms]
- #===============================================================================
- #
- # END OF SCRIPT
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement