Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # Map BGM continues into Battle
- # Version: 1.0
- # Author: DiamondandPlatinum3
- # Date: August 20, 2012
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Description:
- # This script will allow you to play your map BGM into battle. It's useful
- # for those times when you have battle bgm that needs to kick-in before a
- # battle, or perhaps changing to the battle BGM all the time is probably
- # annoying. Either way, this script does what it says it does.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #------------------------------------------------------------------------------
- # Instructions:
- #
- # - Just take a look at the editable region and modify the event switch
- # ID to suit your needs
- #
- #==============================================================================
- module MapBGMContinuesintoBattle
- #===========================================
- # Editable Region
- #===========================================
- # Activate the switch ID to turn off changing the battle BGM
- # Whatever Switch ID you set this to be, you must turn on that switch
- # before this script will work.
- #
- # For example, ID switch 10 would be event switch number 10
- BATTLE_BGM_UNCHANGE_EVENT_SWITCH_ID = 10 # You change the number
- PLAY_VICTORY_ME_AFTER_WINNING = false # ( true / false )
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- end # of editable region //// ||
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- include MapBGMContinuesintoBattle
- class Scene_Map < Scene_Base
- #--------------------------------------------------------------------------
- # * Call Battle
- #--------------------------------------------------------------------------
- alias bgmunchange_callbtl_8hf23 call_battle
- def call_battle
- if $game_switches[BATTLE_BGM_UNCHANGE_EVENT_SWITCH_ID]
- @spriteset.update
- Graphics.update
- $game_player.make_encounter_count
- $game_player.straighten
- Sound.play_battle_start
- $game_temp.next_scene = nil
- $scene = Scene_Battle.new
- else
- bgmunchange_callbtl_8hf23
- end
- end
- end
- class Scene_Battle
- #--------------------------------------------------------------------------
- # * Victory Processing
- #--------------------------------------------------------------------------
- alias bgmunchange_processvictory_8hf23 process_victory
- def process_victory
- if $game_switches[BATTLE_BGM_UNCHANGE_EVENT_SWITCH_ID]
- @info_viewport.visible = false
- @message_window.visible = true
- $game_system.battle_end_me.play if PLAY_VICTORY_ME_AFTER_WINNING
- display_exp_and_gold
- display_drop_items
- display_level_up
- battle_end(0)
- else
- bgmunchange_processvictory_8hf23
- end
- end
- #--------------------------------------------------------------------------
- # * End Battle
- # result : Results (0: win, 1: escape, 2:lose)
- #--------------------------------------------------------------------------
- alias bgmunchange_battleend_8hf23 battle_end
- def battle_end(result)
- if $game_switches[BATTLE_BGM_UNCHANGE_EVENT_SWITCH_ID]
- if result == 2 and not $game_troop.can_lose
- call_gameover
- else
- $game_party.clear_actions
- $game_party.remove_states_battle
- $game_troop.clear
- if $game_temp.battle_proc != nil
- $game_temp.battle_proc.call(result)
- $game_temp.battle_proc = nil
- end
- $scene = Scene_Map.new
- @message_window.clear
- Graphics.fadeout(30)
- end
- $game_temp.in_battle = false
- else
- bgmunchange_battleend_8hf23(result)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement