Advertisement
Adon237

Adon Random Battle BGM

Dec 30th, 2014
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.98 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#
  2. # Random Battle BGM
  3. # Version: IN DEVELOPMENT
  4. # Author: Adon237
  5. # Website: adonkadonk.blogspot.com
  6. # Date of Creation: Sunday, June 9, 2013
  7. # Last Update Time: Sunday, June 9, 2013
  8. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#
  9. # Description:
  10. # I for one am tired of hearing the same BGM play during battles. Even the best
  11. # pieces can only hold my interest for so long, before it becomes monotonous.
  12. # This script won't rid you of that problem, but it will definitely stall the
  13. # process.
  14. # This script's function is to play a random BGM of a set of your choosing.
  15. # There is no outside influence besides the ADON237_SPECIAL_BATTLE_SWITCH that will
  16. # prevent the random BGM from playing.
  17. # Just modify the array based on the instructions and you will be good to go!
  18. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#
  19.  class Scene_Map < Scene_Base
  20.  # The switch that if ON, will stop the Random BGM from playing.
  21.  # This is particularly useful for boss battles with special BGMS.
  22.   ADON237_SPECIAL_BATTLE_SWITCH = 6
  23.  
  24.  
  25.   A_BGMS = [   # do not modify this line
  26.   # Here is where you add the bgms
  27.   # If you want to add a bgm to the set, just enter in a new line exactly how you see it here
  28. # [ "bgmfileinquoteswithoutextension", volume, pitch],
  29.   [ "99-Airy_Edge_Atelier_Lucid", 100, 100], # possible bgm 1
  30.  
  31.   [ "99-Guitar Battle",  100, 100], # possible bgm 2
  32.  
  33.   [ "99-Heroic Battle", 100, 100],  # possible bgm 3
  34.  
  35.   [ "99-Valiance", 100, 100],  # possible bgm 4
  36.  
  37. #XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
  38. # DO NOT TOUCH PAST THIS POINT DO NOT TOUCH PAST THIS POINT DO NOT TOUCH PAST TH
  39. #XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
  40. # STOP IT YOU MIGHT RUIN THE SCRIPT I DO NOT WANNA WASTE TIME HELPING YOU NOOOO
  41. #XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
  42.  ] # DO NOT TOUCH PAST THIS POINT  DO NOT TOUCH PAST THIS POINT  DO NOT TOUCH PA
  43. #XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
  44. # SERIOUSLY WHY ARE YOU NOT LISTENING TO ME?! DO NOT TOUCH NO TOUCHIE ZERO NADA
  45. #XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
  46. # HEED MY WARNING DO NOT GO PAST HERE THE BEAST IS WAITING TO KILL YOU
  47. #XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
  48.  alias adon_random_bgms pre_battle_scene
  49.    def pre_battle_scene
  50.     unless $game_switches[ADON237_SPECIAL_BATTLE_SWITCH]
  51.       Graphics.update
  52.       Graphics.freeze
  53.       @spriteset.dispose_characters
  54.       BattleManager.save_bgm_and_bgs
  55.      
  56.       # random processing
  57.       @rbgm = rand(A_BGMS.size)
  58.      
  59.       # play the bgm
  60. Audio.bgm_play("Audio/BGM/" + A_BGMS[@rbgm][0], 100, A_BGMS[@rbgm][2])
  61.       Sound.play_battle_start
  62.     else
  63.       adon_random_bgms
  64.     end
  65.   end
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement