Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # COMMAND_BGM
- # Author Molegato
- # Version 1.0
- #------------------------------------------------------------------------------
- # Just different musics for command selection and the turn itself
- #------------------------------------------------------------------------------
- # INSTRUCTIONS
- #
- # You need to set a default command and action bgm
- # You can set 'preconfs', wich are couples of command and action bgms
- # You can use the next script calls for selecting your battle bgm:
- # $game_system.set_command_bgm *this one for using the default value*
- # $game_system.set_command_bgm(file name)
- # $game_system.set_action_bgm *this one for using the default value*
- # $game_system.set_action_bgm(file name)
- # $game_system.set_battle_music_preconf(preconf name)
- # The normal battle music selected from the database will play until the
- # party command window appears, so you can select an introduction bgm there,
- # or select 'none'
- #==============================================================================
- $imported = {} if $imported.nil?
- $imported['Molegato-Command_bgm'] = true
- #==============================================================================
- # CONFIGURATION, YOU CAN TOUCH THIS
- #==============================================================================
- module COMMAND_BGM
- DEFAULT_COMMAND_BGM = "reflection_tension"
- DEFAULT_ACTION_BGM = "reflection_rage"
- PRECONFS = {}
- PRECONFS["Normal"]=["battle_command_1","battle_action_1"]
- PRECONFS["Boss"]=["Battle4","Battle8"]
- end
- #==============================================================================
- # END OF CONFIGURATION. EVERYTHING UNDER HERE IS A HELLISH MESS OF DEFICIENT
- # AMATEUR SCRIPTING. BE AWARE THAT MESSING WITH IT CAN RESULT IN DISASTER
- #==============================================================================
- #==============================================================================
- # ■ Game_System
- #==============================================================================
- class Game_System
- def set_command_bgm(bgm=COMMAND_BGM::DEFAULT_COMMAND_BGM)
- @command_bgm=bgm
- return @command_bgm
- end
- def set_action_bgm(bgm=COMMAND_BGM::DEFAULT_ACTION_BGM)
- @action_bgm=bgm
- return @action_bgm
- end
- def set_battle_music_preconf(name)
- set_command_bgm(COMMAND_BGM::PRECONFS[name][0])
- set_action_bgm(COMMAND_BGM::PRECONFS[name][1])
- end
- def play_command_bgm
- RPG:: BGM.new( command_bgm ).play
- end
- def play_action_bgm
- RPG:: BGM.new( action_bgm ).play
- end
- def command_bgm
- if @command_bgm
- return @command_bgm
- else
- return set_command_bgm()
- end
- end
- def action_bgm
- if @action_bgm
- return @action_bgm
- else
- return set_action_bgm()
- end
- end
- end
- #==============================================================================
- # ■ Scene_Map
- #==============================================================================
- class Scene_Map < Scene_Base
- def pre_battle_scene
- Graphics.update
- Graphics.freeze
- @spriteset.dispose_characters
- BattleManager.save_bgm_and_bgs
- BattleManager.play_battle_bgm
- Sound.play_battle_start
- end
- end
- #==============================================================================
- # ■ Scene_Battle
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # ● start_party_command_selection
- #--------------------------------------------------------------------------
- alias commandbgm_start_party_command_selection start_party_command_selection
- def start_party_command_selection
- commandbgm_start_party_command_selection
- $game_system.play_command_bgm
- end
- #--------------------------------------------------------------------------
- # ● turn_start
- #--------------------------------------------------------------------------
- alias commandbgm_turn_start turn_start
- def turn_start
- commandbgm_turn_start
- $game_system.play_action_bgm
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment