Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #******************************************************************************
- # Display Background Based on Area *
- # Ver 1.02 by Diakonos *
- # Based on Battle Backgrounds by Synthesize *
- #******************************************************************************
- class Game_Player < Game_Character
- def which_area_in
- for area in $data_areas.values
- return area.id if in_area?(area)
- end
- return 1
- end
- def which_area_name
- for area in $data_areas.values
- return area.name if in_area?(area)
- end
- return "grasslands"
- # Setting this changes what background displays when you are not in an area
- end
- end
- module SynBattleB
- # Place your battle backgrounds in the 'Pictures' folder (Graphics/Pictures)
- # Format = {area_id => "Background File Name"}
- # You only need to fill this in if
- # If you want to add a background, don't forget to put a comma after each one
- Battle_background =
- {
- 1 => "grassland", #if Use_VX_BG is true this field will be
- #ignored and default VX BG will be used.
- 2 => "forest",
- 3 => "town forest",
- 4 => "room 4",
- 5 => "Swamp",
- 6 => "Forest"
- }
- #-----------------------------------------------------------------------------
- #You only need to fill this area in if "Use_Area_Name=true" otherwise use above.
- # Format = {area_name => "Background File Name"}
- # Using area name is really the best, because background is not based on
- # area_id but rather area_name.
- # (i.e. multiple areas_ids can share the same background)
- Battle_area_name_background =
- {
- "grassland" => "grassland",
- "forest" => "forest",
- "town forest" => "town forest",
- "room 4" => "room 4",
- "dungeon" => "dungeon",
- "fort inside" => "fort inside",
- "dungeon 3" => "dungeon 3",
- "room 7" => "room 7",
- "dungeon 2" => "dungeon 2",
- "desert" => "desert",
- "town desert" => "town desert",
- "tower outside" => "tower outside",
- "room 2" => "room 2",
- "space" => "space",
- "beach" => "beach",
- "forest deep" => "forest deep",
- "ruins" => "ruins",
- "bridge" => "bridge",
- "river" => "river",
- "castle evil" => "castle evil",
- "snow" => "snow",
- "cave" => "cave",
- "town village" => "town village",
- "town shop" => "town shop",
- "room 3" => "room 3",
- "heaven" => "heaven",
- "heaven inside" => "heaven inside",
- "mine" => "mine",
- "cave lava" => "cave lava",
- "cave ice" => "cave ice",
- "town post" => "town post",
- "throneroom" => "throneroom",
- "mountain" => "mountain",
- "port" => "port",
- "castletown" => "castletown",
- "castle evil 2" => "castle evil 2",
- "room 6" => "room 6",
- "ship" => "ship",
- "ship inside" => "ship inside"
- }
- #If true, uses area name to set background instead of id#
- #You can use either method, but using Area name is pretty cool.
- Use_Area_Name = true
- # Create the large shadow battlefloor?
- Create_battlefloor = false
- # If you want you can use the standard VX background as slot #1
- Use_VX_BG = false
- end
- #-------------------------------------------------------------------------------
- # Spriteset_Battle
- #-------------------------------------------------------------------------------
- class Spriteset_Battle
- alias syn_create_battlefloor create_battlefloor unless $@
- #-----------------------------------------------------------------------------
- # Default VX Background
- #-----------------------------------------------------------------------------
- def def_battle_back_diakonos
- source = $game_temp.background_bitmap
- bitmap = Bitmap.new(640, 480)
- bitmap.stretch_blt(bitmap.rect, source, source.rect)
- bitmap.radial_blur(90, 12)
- @battleback_sprite = Sprite.new(@viewport1)
- @battleback_sprite.bitmap = bitmap
- @battleback_sprite.ox = 320
- @battleback_sprite.oy = 240
- @battleback_sprite.x = 272
- @battleback_sprite.y = 176
- @battleback_sprite.wave_amp = 8
- @battleback_sprite.wave_length = 240
- @battleback_sprite.wave_speed = 120
- end
- #---------------------------------------------------------------------------
- # Battle Background based on either Area Name or Area ID
- #---------------------------------------------------------------------------
- def area_battle_back_diakonos
- if SynBattleB::Use_Area_Name == false then
- # Error Check, if any error don't crash, but display VX default background
- if SynBattleB::Battle_background[$game_player.which_area_in]==nil then
- def_battle_back_diakonos
- else
- image = SynBattleB::Battle_background[$game_player.which_area_in]
- @battleback_sprite = Sprite.new(@viewport1)
- @battleback_sprite.bitmap = Cache.picture(image)
- end
- else
- # Error Check, if any error don't crash, but display VX default background
- if SynBattleB::Battle_area_name_background[$game_player.which_area_name]==nil then
- def_battle_back_diakonos
- else
- image = SynBattleB::Battle_area_name_background[$game_player.which_area_name]
- @battleback_sprite = Sprite.new(@viewport1)
- @battleback_sprite.bitmap = Cache.picture(image)
- end
- end
- end
- #-----------------------------------------------------------------------------
- # Create Battleback
- #-----------------------------------------------------------------------------
- def create_battleback
- if SynBattleB::Use_VX_BG == true and $game_player.which_area_in==1 then
- #Checks if Use_VX_BG is true and if you are in area #1, if so it will
- #display the standard VX swirly background. If not, it uses a picture.
- def_battle_back_diakonos
- else
- #Run Display Picture Subroutine
- area_battle_back_diakonos
- end
- end
- def create_battlefloor
- @battlefloor_sprite = Sprite.new(@viewport1)
- syn_create_battlefloor if SynBattleB::Create_battlefloor == true
- end
- end
- #******************************************************************************
- # Display Background Based on Area *
- # Ver 1.02 by Diakonos *
- # Based on Battle Backgrounds by Synthesize *
- #******************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment