#==============================================================================
# ** Fog in Battle
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1.0
# 2008-07-26
#==============================================================================
#==============================================================================
# ** Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_battlefogs_ssbtl_init, :initialize
alias_method :seph_battlefogs_ssbtl_disp, :dispose
alias_method :seph_battlefogs_ssbtl_updt, :update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_battlefogs_ssbtl_init
# Create Fog
@fog = Plane.new(@viewport1)
@fog.z = 1
update_fog
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
# Original Initialization
seph_battlefogs_ssbtl_disp
# Dispose of fog plane
@fog.dispose
end
#--------------------------------------------------------------------------
# * Frame Update: Fog
#--------------------------------------------------------------------------
def update_fog
# If fog is different than current fog
return if @fog == nil
if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
@fog_name = $game_map.fog_name
@fog_hue = $game_map.fog_hue
if @fog.bitmap != nil
@fog.bitmap.dispose
@fog.bitmap = nil
end
if @fog_name != ""
@fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
end
Graphics.frame_reset
end
# Update fog plane
@fog.zoom_x = $game_map.fog_zoom / 100.0
@fog.zoom_y = $game_map.fog_zoom / 100.0
@fog.opacity = $game_map.fog_opacity
@fog.blend_type = $game_map.fog_blend_type
@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
@fog.tone = $game_map.fog_tone
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Original Update
seph_battlefogs_ssbtl_updt
# Update Fog
update_fog
end
end
#==============================================================================
# ** Fog in Battle
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1.0
# 2008-07-26
#==============================================================================
#==============================================================================
# ** Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_battlefogs_ssbtl_init, :initialize
alias_method :seph_battlefogs_ssbtl_disp, :dispose
alias_method :seph_battlefogs_ssbtl_updt, :update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_battlefogs_ssbtl_init
# Create Fog
@fog = Plane.new(@viewport1)
@fog.z = 1
update_fog
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
# Original Initialization
seph_battlefogs_ssbtl_disp
# Dispose of fog plane
@fog.dispose
end
#--------------------------------------------------------------------------
# * Frame Update: Fog
#--------------------------------------------------------------------------
def update_fog
# If fog is different than current fog
return if @fog == nil
if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
@fog_name = $game_map.fog_name
@fog_hue = $game_map.fog_hue
if @fog.bitmap != nil
@fog.bitmap.dispose
@fog.bitmap = nil
end
if @fog_name != ""
@fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
end
Graphics.frame_reset
end
# Update fog plane
@fog.zoom_x = $game_map.fog_zoom / 100.0
@fog.zoom_y = $game_map.fog_zoom / 100.0
@fog.opacity = $game_map.fog_opacity
@fog.blend_type = $game_map.fog_blend_type
@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
@fog.tone = $game_map.fog_tone
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Original Update
seph_battlefogs_ssbtl_updt
# Update Fog
update_fog
end
end
# If Battle testing
if $BTEST
#==============================================================================
# ** Scene_Title
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_battlefogs_scnbtl_sbtm, :setup_battle_test_members
#--------------------------------------------------------------------------
# * Battle Test
#--------------------------------------------------------------------------
def setup_battle_test_members
# Original Setup Battle Test
seph_battlefogs_scnbtl_sbtm
# Setup Game_Map
$game_map.setup(1)
end
end
end
class Game_Troop
#fog_name # fog file name
#fog_hue # fog hue
#fog_opacity # fog opacity level
#fog_blend_type # fog blending method
#fog_zoom # fog zoom rate
#fog_sx # fog sx
#fog_sy # fog sy
Specific_Fog_Effects = {}
alias_method :seph_specifictroopfogeffects_gmtroop_setup, :setup
def setup(troop_id)
if Specific_Fog_Effects.has_key?(troop_id)
Specific_Fog_Effects[troop_id].each do |key, value|
eval "$game_map.#{key} = #{value}"
end
end
seph_specifictroopfogeffects_gmtroop_setup
end
end
Specific_Fog_Effects[1] = {'fog_name' => "001-Fog01"}
Specific_Fog_Effects= {}