Advertisement
diamondandplatinum3

Continue BGM after battle ~ RGSS2

Oct 1st, 2012
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.43 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Continue BGM after battle
  3. #             Author: DiamondandPlatinum3
  4. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. #  Description:
  6. #
  7. #    Activated via an event switch, this script will allow you to continue
  8. #    to play your battle bgm once your battle has finished. Maybe you're
  9. #    in a war zone and need to keep the Battle bgm going to continue the
  10. #    atmosphere?
  11. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  12.  
  13.  
  14.  
  15. class Scene_Battle
  16.  #////////////////////////////////////////////////////////////
  17.  
  18.  
  19.   # Event Switch ID to make the battle bgm continue into map
  20.   BATTLE_BGM_CIM_EVENT_SWITCH_ID = 11
  21.  
  22.  
  23.  #////////////////////////////////////////////////////////////
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.   #--------------------------------------------------------------------------
  34.   # * Victory Processing
  35.   #--------------------------------------------------------------------------
  36.   alias battlebgm_cim_unchange_processvictory_on4972 process_victory
  37.   def process_victory
  38.     if $game_switches[BATTLE_BGM_CIM_EVENT_SWITCH_ID]
  39.       @info_viewport.visible = false
  40.       @message_window.visible = true
  41.       $game_system.battle_end_me.play
  42.       display_exp_and_gold
  43.       display_drop_items
  44.       display_level_up
  45.       battle_end(0)
  46.     else
  47.       battlebgm_cim_unchange_processvictory_on4972
  48.     end
  49.   end
  50.  
  51.   #--------------------------------------------------------------------------
  52.   # * End Battle
  53.   #      result : Results (0: win, 1: escape, 2:lose)
  54.   #--------------------------------------------------------------------------
  55.   alias battlebgm_cim_unchange_battleend_on4972 battle_end
  56.   def battle_end(result)
  57.     if $game_switches[BATTLE_BGM_CIM_EVENT_SWITCH_ID]
  58.       if result == 2 and not $game_troop.can_lose
  59.             call_gameover
  60.       else
  61.             $game_party.clear_actions
  62.             $game_party.remove_states_battle
  63.             $game_troop.clear
  64.             if $game_temp.battle_proc != nil
  65.               $game_temp.battle_proc.call(result)
  66.               $game_temp.battle_proc = nil
  67.             end
  68.             $scene = Scene_Map.new
  69.             @message_window.clear
  70.             Graphics.fadeout(30)
  71.       end
  72.       $game_temp.in_battle = false
  73.     else
  74.       battlebgm_cim_unchange_battleend_on4972(result)
  75.     end
  76.   end
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement