adiktuzmiko

BattleBack Seasons v1.0

May 22nd, 2013
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.13 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # BattleBack_Seasons v1.0
  4. # by AdiktuzMiko
  5. # --- Date Created: 18/01/2013
  6. # --- Last Date Updated: 18/01/2013
  7. # --- Level: Easy
  8. # Requires: n/a
  9. #
  10. # Basically, this allows you to have different battlebacks in one map
  11. # depending on seasons. Take note that this doesn't work on Battle Test.
  12. #
  13. #==============================================================================
  14.  
  15. #==============================================================================
  16. # Aliased methods:
  17. #
  18. # battleback1_bitmap, battleback2_bitmap (both belongs to Spriteset_Battle)
  19. #==============================================================================
  20.  
  21. #==============================================================================
  22. # How To Install:
  23. #
  24. # Just put this anywhere before main and you're good to go.
  25. #==============================================================================
  26.  
  27. #==============================================================================
  28. # Compatibility:
  29. #
  30. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  31. # it will run with RPG Maker VX without adjusting.
  32. #
  33. # As for compatibility with other scripts, it's compatible with YEA scripts.
  34. # I don't know for other scripts though. Though I don't think it would be
  35. # incompatible with other scripts unless they overwrite the battleback creation
  36. # at the start too.
  37. #
  38. # I don't think that this is compatible with my BattleBack_EX script.
  39. #
  40. #==============================================================================
  41.  
  42. #==============================================================================
  43. # How To Use:
  44. #
  45. # 1)Set the game variable that sets the season
  46. # 2)Create a battleback set at the BATTLEBACKSEASON_1 Hash, format is:
  47. #   Key => [Season1,Season2 and so on...],
  48. # 3)Do the same for BATTLEBACKSEASON_2 Hash
  49. #   *BATTLEBACKSEASON_1 = the set of BattleBack1 images
  50. #   *BATTLEBACKSEASON_2 = the set of BattleBack2 images
  51. # 3)Set the battleback set to be used by maps via the SEASONMAP Hash, format is:
  52. #   MapID => Key
  53. #
  54. # So now, if the value of the variable linked to SEASON_VAR is 1, it will use
  55. # the battleback for Season1 and so on
  56. #==============================================================================
  57.  
  58. module BattleBack_Season
  59.  
  60.   SEASON_VAR = 16
  61.  
  62.   BATTLEBACKSEASON_1 = {
  63.  
  64.   "Forest" => ["ForestWinter","ForestSpring","ForestSummer","ForestFall"],
  65.   "Dirt" => ["DirtWinter","Dirt","Dirt","Dirt"],
  66.  
  67.   } #Do not remove
  68.  
  69.   BATTLEBACKSEASON_2 = {
  70.  
  71.   "Forest" => ["","","",""],
  72.   "Dirt" => ["DirtWinter","Dirt","Dirt","Dirt"],
  73.  
  74.   }
  75.  
  76.   SEASONMAP = {
  77.  
  78.   14 => "Forest",
  79.   15 => "Dirt",
  80.  
  81.   }
  82.  
  83. end #BattleBack_Season
  84.  
  85. #==============================================================================
  86. # Do not touch anything below this line unless you know what you are doing.
  87. #==============================================================================
  88.  
  89. class Spriteset_Battle
  90.  
  91.   alias battleback1_bitmap_seasons battleback1_bitmap
  92.   def battleback1_bitmap
  93.     if $BTEST #without this it bugs during battle test
  94.       battleback1_bitmap_seasons
  95.     else
  96.       season = BattleBack_Season::SEASONMAP[$game_map.map_id]
  97.       if season != nil then
  98.         Cache.battleback1(BattleBack_Season::BATTLEBACKSEASON_1[season][$game_variables[BattleBack_Season::SEASON_VAR] - 1])
  99.       elsif battleback1_name
  100.         Cache.battleback1(battleback1_name)
  101.       else
  102.         create_blurry_background_bitmap
  103.       end
  104.     end
  105.   end
  106.  
  107.   alias battleback2_bitmap_seasons battleback2_bitmap
  108.   def battleback2_bitmap
  109.     if $BTEST #without this it bugs during battle test
  110.       battleback2_bitmap_seasons
  111.     else
  112.       season = BattleBack_Season::SEASONMAP[$game_map.map_id]
  113.       if season != nil then
  114.         Cache.battleback1(BattleBack_Season::BATTLEBACKSEASON_2[season][$game_variables[BattleBack_Season::SEASON_VAR] - 1])
  115.       elsif battleback2_name
  116.         Cache.battleback2(battleback2_name)
  117.       else
  118.         create_blurry_background_bitmap
  119.       end
  120.     end
  121.   end
  122.  
  123. end #Spriteset_Battle
Advertisement
Add Comment
Please, Sign In to add comment