#==============================================================================
# ** Battleback_Settings
#------------------------------------------------------------------------------
# Holds all pertinent information for Battle Backgrounds.
#==============================================================================
module Battleback_Settings
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
#------------------------------------------------------------------------
# * Battleback_Dir
# The default directory to look for battlebackgrounds.
#------------------------------------------------------------------------
Battleback_Dir = './Graphics/Battlebacks/'
#------------------------------------------------------------------------
# * Battlebacks
# This hash holds the key that identifies what battleback an area
# should use.
# key : String tag to be found in an areas name to determine value.
# value : String of the battleback image to load based on key.
#------------------------------------------------------------------------
Battlebacks = {
'_oce' => 'ocean.png',
'_des' => 'desert.png',
'_for' => 'forest.png',
'_pla' => 'plains.png',
'_swa' => 'swamp.png',
'_cas' => 'castle.png',
'_tow' => 'town.png',
'_bea' => 'beach.png',
}
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles maps. It includes event starting determinants and map
# scrolling functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :area_type
#--------------------------------------------------------------------------
# * Create Group ID for Troop Encountered !OVERRIDE!
#--------------------------------------------------------------------------
def make_encounter_troop_id
encounter_list = $game_map.encounter_list.clone
for area in $data_areas.values
if in_area?(area)
encounter_list += area.encounter_list
@area_type = '_' + area.name.split('_').last
end
end
if encounter_list.empty?
make_encounter_count
return 0
end
return encounter_list[rand(encounter_list.size)]
end
end
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# This class brings together battle screen sprites. It's used within the
# Scene_Battle class.
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Create Battleback Sprite !OVERRIDE!
#--------------------------------------------------------------------------
def create_battleback
# Create the sprite.
@battleback_sprite = Sprite.new(@viewport1)
begin
# Load the battleback.
bitmap = Bitmap.new(Battleback_Settings::Battleback_Dir +
Battleback_Settings::Battlebacks[$game_player.area_type])
rescue
# Do the usual stuff if there is ever a problem.
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.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
# Set the bitmap.
@battleback_sprite.bitmap = bitmap
end
end