Advertisement
Adon237

[VXA]Random Battle Transitions

Jul 25th, 2015
659
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.72 KB | None | 0 0
  1. #------------------------------------------------------------------------------
  2. #                ?????ADON237 RANDOM BATTLE TRANSITIONS?????
  3. # Date Created: 7/25/2015
  4. #------------------------------------------------------------------------------
  5. # Description: Simple scriptlet that allows for pre-defined randomized
  6. # battle transitions. Also allows for a variable determining which battle
  7. # transition is used granted it is not 0.
  8. # It's basically a bunch of conditional statements.
  9. #------------------------------------------------------------------------------
  10. # Notes: Should be compatible with most any script granted that it isn't
  11. # drastically rewriting Scene_Map, specifically perform_battle_transition.
  12. # THERE MAY BE AN ISSUE WITH BATTLE_TRANSITION_5 NEVER BEING PICKED!
  13. # JUST A WARNING, BUT IT'S NOT DEFINITE EITHER.
  14. #------------------------------------------------------------------------------
  15. # CONFIGURATION
  16. # Replace in the Double Quotes (" ") what images you want loaded as transitions.
  17. # Supported up to 5 different transitions, but you can easily add more.
  18. #------------------------------------------------------------------------------
  19. module ADONRBT
  20.  BATTLE_TRANSITION_1 = "Graphics/System/BattleStart"
  21.  BATTLE_TRANSITION_2 = "Graphics/System/BattleStart2"
  22.  BATTLE_TRANSITION_3 = "Graphics/System/BattleStart3"
  23.  BATTLE_TRANSITION_4 = "Graphics/System/BattleStart4"
  24.  BATTLE_TRANSITION_5 = "Graphics/System/BattleStart5"
  25. #------------------------------------------------------------------------------
  26. # If your TRANSITION_VARIABLE has a value that is a non-zero natural number
  27. # between 1 and 5, the battle transition will be whatever is set in that battle
  28. # transition #.
  29. #------------------------------------------------------------------------------
  30. # Ex: TRANSITION_VARIABLE[96] is set to 3, the BattleStart graphic will be
  31. # BattleStart3.
  32. #------------------------------------------------------------------------------
  33. # If TRANSITION_VARIABLE has a value 0, a random choice will be made from the
  34. # predefined battlestart graphics. If it's at 6 or some other number not
  35. # between 0-5, the default BattleStart graphic will be used.
  36. #------------------------------------------------------------------------------
  37. # If you ONLY WANT your battle transitions to be randomized, please set
  38. # TRANSITION_VARIABLE to 0 in the configuration.
  39. #------------------------------------------------------------------------------
  40.  TRANSITION_VARIABLE = 96 # Set to 0 if you only want battlestarts randomized.
  41. end
  42. # End of Configuration
  43. #------------------------------------------------------------------------------
  44.  
  45. class Scene_Map < Scene_Base
  46.   include ADONRBT
  47.   #--------------------------------------------------------------------------
  48.   # ? Transition Performed Before Battle Starts
  49.   #--------------------------------------------------------------------------
  50.   def perform_battle_transition
  51.     if $game_variables[TRANSITION_VARIABLE] == 0
  52.       $game_variables[TRANSITION_VARIABLE] = rand(5)
  53.          if $game_variables[TRANSITION_VARIABLE] == 1
  54.             Graphics.transition(60, BATTLE_TRANSITION_1, 100)
  55.             Graphics.freeze
  56.          elsif $game_variables[TRANSITION_VARIABLE] == 2
  57.             Graphics.transition(60, BATTLE_TRANSITION_2, 100)
  58.             Graphics.freeze
  59.          elsif $game_variables[TRANSITION_VARIABLE] == 3
  60.             Graphics.transition(60, BATTLE_TRANSITION_3, 100)
  61.             Graphics.freeze
  62.          elsif $game_variables[TRANSITION_VARIABLE] == 4
  63.             Graphics.transition(60, BATTLE_TRANSITION_4, 100)
  64.             Graphics.freeze
  65.          elsif $game_variables[TRANSITION_VARIABLE] == 5
  66.             Graphics.transition(60, BATTLE_TRANSITION_5, 100)
  67.             Graphics.freeze
  68.          elsif $game_variables[TRANSITION_VARIABLE] == 0
  69.             Graphics.transition(60, BATTLE_TRANSITION_5, 100)
  70.             Graphics.freeze
  71.           end
  72.       $game_variables[TRANSITION_VARIABLE] = 0
  73.     elsif $game_variables[TRANSITION_VARIABLE] == 1
  74.         Graphics.transition(60, BATTLE_TRANSITION_1, 100)
  75.         Graphics.freeze
  76.     elsif $game_variables[TRANSITION_VARIABLE] == 2
  77.         Graphics.transition(60, BATTLE_TRANSITION_2, 100)
  78.         Graphics.freeze
  79.     elsif $game_variables[TRANSITION_VARIABLE] == 3
  80.         Graphics.transition(60, BATTLE_TRANSITION_3, 100)
  81.         Graphics.freeze
  82.     elsif $game_variables[TRANSITION_VARIABLE] == 4
  83.         Graphics.transition(60, BATTLE_TRANSITION_4, 100)
  84.         Graphics.freeze
  85.     elsif $game_variables[TRANSITION_VARIABLE] == 5
  86.         Graphics.transition(60, BATTLE_TRANSITION_5, 100)
  87.         Graphics.freeze
  88.     else
  89.     Graphics.transition(60, "Graphics/System/BattleStart", 100)
  90.     Graphics.freeze
  91.     end
  92.   end
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement