vindaca510

Map Battleback v1.2

Aug 4th, 2014
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 13.37 KB | None | 0 0
  1.  
  2. ################################################################################
  3. #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓#
  4. #↓                                                                            ↓#
  5. #↓                      Game Map Battleback: Version 1.2                      ↓#
  6. #↓                                                                            ↓#
  7. #↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕#
  8. #↑                                                                            ↑#
  9. #↑                            Written By: Joe Pro                             ↑#
  10. #↑                        Last Edited: August 4, 2014                         ↑#
  11. #↑                                                                            ↑#
  12. #↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑#
  13. ################################################################################
  14.  
  15. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  16. #◙ ** Disclaimer                                                              ◙#
  17. #◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙#
  18. #◙                                                                            ◙#
  19. #◙ This script is not for commercial, if you wish to use this script in a     ◙#
  20. #◙ game please PM me. All credit is to be given to me as the author of this   ◙#
  21. #◙ script.                                                                    ◙#
  22. #◙                                                                            ◙#
  23. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  24. #◙ ** How To Use                                                              ◙#
  25. #◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙#
  26. #◙                                                                            ◙#
  27. #◙ * Cusomizable area below.                                                  ◙#
  28. #◙                                                                            ◙#
  29. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  30. #◙ ** Updates / Version Notes                                                 ◙#
  31. #◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙#
  32. #◙                                                                            ◙#
  33. #◙   v1.0                                                                     ◙#
  34. #◙ ~◄◙◙◙◙►~                                                                   ◙#
  35. #◙ * This script takes a picture of the map and uses it as a background image ◙#
  36. #◙   durring battles.                                                         ◙#
  37. #◙                                                                            ◙#
  38. #◙   v1.1                                                                     ◙#
  39. #◙ ~◄◙◙◙◙►~                                                                   ◙#
  40. #◙ * Set up a customizable area along with an option to assign a $game_switch ◙#
  41. #◙   to allow you to turn on and off the $game_map battleback.                ◙#
  42. #◙                                                                            ◙#
  43. #◙   v1.2                                                                     ◙#
  44. #◙ ~◄◙◙◙◙►~                                                                   ◙#
  45. #◙ * Fixed an error.                                                          ◙#
  46. #◙                                                                            ◙#
  47. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  48.  
  49.  
  50.  
  51. ################################################################################
  52. #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓#
  53. #↓                                                                            ↓#
  54. #↕                      Game Map Battleback: Version 1.2                      ↕#
  55. #↑                                                                            ↑#
  56. #↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑#
  57. ################################################################################
  58.  
  59.  
  60.  
  61. #===============================================================================
  62. # ** Jump SE
  63. #------------------------------------------------------------------------------
  64. #  This module manages the customizable and function modules.
  65. #===============================================================================
  66. module Game_Map_Battleback
  67.  
  68.  
  69.  
  70. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  71. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  72. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙Customizeable Area◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  73. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  74. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  75.  
  76.   #=============================================================================
  77.   # * Game Switch ID
  78.   #=============================================================================
  79.     Game_Switch = 1
  80.  
  81. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  82. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  83. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙End Customizeable Area◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  84. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  85. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  86.  
  87.  
  88.  
  89.  
  90. end
  91.  
  92.  
  93. #==============================================================================
  94. # ** Spriteset_Battle
  95. #------------------------------------------------------------------------------
  96. #  This class brings together battle screen sprites. It's used within the
  97. # Scene_Battle class.
  98. #==============================================================================
  99.  
  100. class Spriteset_Battle  
  101.  
  102.   #--------------------------------------------------------------------------
  103.   # * Public Instance Variables
  104.   #--------------------------------------------------------------------------
  105.   attr_accessor :game_map_battleback
  106.  
  107.   #--------------------------------------------------------------------------
  108.   # * Aliasing Method: Object Initialization
  109.   #--------------------------------------------------------------------------
  110.   alias :sbi0645643213201 :initialize
  111.  
  112.   #--------------------------------------------------------------------------
  113.   # * Object Initialization
  114.   #--------------------------------------------------------------------------
  115.   def initialize
  116.     sbi0645643213201()
  117.     @game_map_battleback = (Game_Map_Battleback::Game_Switch ? $game_switches[Game_Map_Battleback::Game_Switch] : nil)
  118.   end
  119.    
  120.   #--------------------------------------------------------------------------
  121.   # * Check for battleback set up
  122.   #--------------------------------------------------------------------------
  123.   if @game_map_battleback == true || @game_map_battleback == nil
  124.    
  125.     #--------------------------------------------------------------------------
  126.     # * Get Battle Background (Floor) Bitmap
  127.     #--------------------------------------------------------------------------
  128.     def battleback1_bitmap
  129.       bbattleback = (battleback1_name ? Cache.battleback1(battleback1_name) : create_map_background_bitmap)
  130.       bbattleback
  131.     end
  132.    
  133.     #--------------------------------------------------------------------------
  134.     # * Get Battle Background (Wall) Bitmap
  135.     #--------------------------------------------------------------------------
  136.     def battleback2_bitmap
  137.       Cache.battleback2(battleback2_name) if battleback2_name
  138.     end
  139.    
  140.     #--------------------------------------------------------------------------
  141.     # * Create Battle Background (Wall) Sprite
  142.     #--------------------------------------------------------------------------
  143.     def create_battleback2
  144.       if battleback2_bitmap
  145.         @back2_sprite = Sprite.new(@viewport1)
  146.         @back2_sprite.bitmap = battleback2_bitmap
  147.         @back2_sprite.z = 1
  148.         center_sprite(@back2_sprite)
  149.       end
  150.     end
  151.    
  152.     #--------------------------------------------------------------------------
  153.     # * Update Battle Background (Wall) Sprite
  154.     #--------------------------------------------------------------------------
  155.     def update_battleback2
  156.       @back2_sprite.update if @back2_sprite
  157.     end
  158.    
  159.     #--------------------------------------------------------------------------
  160.     # * Free Battle Background (Wall) Sprite
  161.     #--------------------------------------------------------------------------
  162.     def dispose_battleback2
  163.       if @back2_sprite
  164.         @back2_sprite.bitmap.dispose
  165.         @back2_sprite.dispose
  166.       end
  167.     end
  168.    
  169.     #--------------------------------------------------------------------------
  170.     # * Get Battle Background (Wall) Bitmap
  171.     #--------------------------------------------------------------------------
  172.     def create_map_background_bitmap
  173.       SceneManager.background_bitmap
  174.     end
  175.    
  176.   end
  177.  
  178. end
  179.  
  180.  
  181. #==============================================================================
  182. # ** SceneManager
  183. #------------------------------------------------------------------------------
  184. #  This module manages scene transitions. For example, it can handle
  185. # hierarchical structures such as calling the item screen from the main menu
  186. # or returning from the item screen to the main menu.
  187. #==============================================================================
  188.  
  189. module SceneManager
  190.  
  191.   #--------------------------------------------------------------------------
  192.   # * Create Snapshot to Use as Background
  193.   #--------------------------------------------------------------------------
  194.   def self.snapshot_for_background
  195.     @background_bitmap.dispose if @background_bitmap
  196.     @background_bitmap = Graphics.snap_to_bitmap
  197.   end
  198.  
  199. end
Advertisement
Add Comment
Please, Sign In to add comment