Advertisement
diamondandplatinum3

Random Battle Themes ~ RGSS2

Jul 22nd, 2012
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.44 KB | None | 0 0
  1. #==============================================================================
  2. #  Random Battle Themes
  3. #  Version: 1.1
  4. #  Author: DiamondandPlatinum3
  5. #  Date: August 3, 2012
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #  Description:
  8. #    This script allows you to play a random battle theme upon starting a
  9. #    battle, it can be turned off before a boss battle via switch so that
  10. #    the appropriate battle them still plays for them.
  11. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  12. #------------------------------------------------------------------------------
  13. #  Instructions:
  14. #  
  15. #     - Just take a look at the editable region and modify things
  16. #       appropriately.
  17. #
  18. #==============================================================================
  19. class Scene_Map < Scene_Base
  20.  
  21. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  22. #                                                        -=
  23. #                 Editable Region        ////            ==
  24. #                                                        =-
  25. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  26.  
  27.   # Turn this switch on before a boss battle so that the
  28.   # music you actually want to play will play.
  29.  
  30.   DP3_RNDBT_BOSS_BATTLE_EVENT_SWITCH_ID = 10 # Switch ID (You change this)
  31.  
  32. #-----------------------------------------------------------------
  33. # HALT YOUR EDITING
  34. #------------------------------------------------------------------
  35.   DP3_RNDBT_THEMESARRAY   = [    # Don't touch this line
  36. #------------------------------------------------------------------
  37. # RESUME YOUR EDITING
  38. #-----------------------------------------------------------------
  39. #============================================================
  40. # You can add more battle themes / change the current ones
  41. # or remove any you don't need. I'd like to think you can
  42. # figure out what to do by looking at this so I'm not going
  43. # to write lines of comment explaining it.
  44. #
  45. # Simply copy one line of code and paste it under the last,
  46. # then edit it to add more battle themes.
  47. # Otherwise simply delete one line of code to remove that
  48. # battle theme.
  49. #
  50. # Battle Theme has to be in quotation marks (" ")
  51. # And it has to be EXACT Filename.
  52. #===========================================================
  53.  
  54. # Battle Theme, Volume, Pitch
  55. [ "Battle1",    100,    100 ], # The Info for One of the Random Battle Themes
  56. [ "Battle2",    100,    100 ], # The Info for One of the Random Battle Themes
  57. [ "Battle3",    100,    100 ], # The Info for One of the Random Battle Themes
  58. [ "Battle4",    100,    100 ], # The Info for One of the Random Battle Themes
  59. [ "Battle5",    100,    100 ], # The Info for One of the Random Battle Themes
  60. [ "Battle6",    100,    100 ], # The Info for One of the Random Battle Themes
  61. [ "Battle7",    100,    100 ], # The Info for One of the Random Battle Themes
  62. [ "Battle8",    100,    100 ], # The Info for One of the Random Battle Themes
  63. [ "Battle9",    100,    100 ], # The Info for One of the Random Battle Themes
  64. [ "Town2",      100,    100 ], # The Info for One of the Random Battle Themes
  65.  
  66.  
  67. #===========================================================
  68. #                                           \/
  69. #               End of Editable Region      /\
  70. ]#                                          \/
  71. #===========================================================
  72. #---------------------------------------------------------
  73. # No touchie past here unless you know what you are
  74. # doing. Failure to heed this warning could cause your
  75. # computer to yell and scream at you.
  76. #
  77. # Edit at your own risk.
  78. #--------------------------------------------------------
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.   #--------------------------------------------------------------------------
  86.   # * Switch to Battle Screen
  87.   #--------------------------------------------------------------------------
  88.   alias rndm_battle_themes_cb_4wa2 call_battle
  89.   def call_battle
  90.    
  91.    # Call original method
  92.     rndm_battle_themes_cb_4wa2
  93.    
  94.     # Roll Random Variable
  95.     @randbttlnum = rand(DP3_RNDBT_THEMESARRAY.size)
  96.    
  97.     # Play Battle Theme
  98.     Audio.bgm_play("Audio/BGM/" + DP3_RNDBT_THEMESARRAY[@randbttlnum][0],
  99.                    DP3_RNDBT_THEMESARRAY[@randbttlnum][1],
  100.                    DP3_RNDBT_THEMESARRAY[@randbttlnum][2]
  101.                    ) unless $game_switches[DP3_RNDBT_BOSS_BATTLE_EVENT_SWITCH_ID]
  102.                    
  103.   end
  104. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement