Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # [RGSS 2] Continue Map BGM & BGS when Battle
- # Version : 1.0
- # Author : LowlingLife
- #==============================================================================
- # Tetap nge-play BGM & BGS dari map saat battle mulai.
- #==============================================================================
- module ContinueBG
- # Set ke true jika ingin tetap mem-play map BGM saat battle mulai.
- CONTINUE_BGM = true
- # Set ke true jika ingin tetap mem-play map BGS saat battle mulai.
- CONTINUE_BGS = true
- # Set ke true jika ingin mem-play suara Start Battle.
- PLAY_BATTLE_START = true
- end
- class Scene_Map < Scene_Base
- include ContinueBG
- #--------------------------------------------------------------------------
- # * Switch to Battle Screen
- #--------------------------------------------------------------------------
- def call_battle
- @spriteset.update
- Graphics.update
- $game_player.make_encounter_count
- $game_player.straighten
- $game_temp.map_bgm = RPG::BGM.last
- $game_temp.map_bgs = RPG::BGS.last
- RPG::BGM.stop unless CONTINUE_BGM
- RPG::BGS.stop unless CONTINUE_BGS
- Sound.play_battle_start if PLAY_BATTLE_START
- $game_system.battle_bgm.play unless CONTINUE_BGM
- $game_temp.next_scene = nil
- $scene = Scene_Battle.new
- end
- end
- class Scene_Battle < Scene_Base
- include ContinueBG
- #--------------------------------------------------------------------------
- # * End Battle
- # result : Results (0: win, 1: escape, 2:lose)
- #--------------------------------------------------------------------------
- def battle_end(result)
- 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
- unless $BTEST
- $game_temp.map_bgm.play unless CONTINUE_BGM
- $game_temp.map_bgs.play unless CONTINUE_BGS
- end
- $scene = Scene_Map.new
- @message_window.clear
- Graphics.fadeout(30)
- end
- $game_temp.in_battle = false
- end
- #--------------------------------------------------------------------------
- # * Victory Processing
- #--------------------------------------------------------------------------
- def process_victory
- @info_viewport.visible = false
- @message_window.visible = true
- RPG::BGM.stop unless CONTINUE_BGM
- $game_system.battle_end_me.play
- unless $BTEST
- $game_temp.map_bgm.play unless CONTINUE_BGM
- $game_temp.map_bgs.play unless CONTINUE_BGS
- end
- display_exp_and_gold
- display_drop_items
- display_level_up
- battle_end(0)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment