class Game_Screen
  attr_accessor   :mpeffEx_type
  attr_accessor   :mpeffEx_power_target
  attr_accessor   :mpeffEx_duration
  attr_accessor   :mpeffEx_power  
  
  
  def change_map_effectEx(type, power, duration)
    @mpeffEx_type = type if type != :none || duration == 0
    @mpeffEx_power_target = type == :none ? 0.0 : power.to_f
    @mpeffEx_duration = duration
    @mpeffEx_power = @mpeffEx_power_target if duration == 0

  end 
  
  #--------------------------------------------------------------------------
  # ● クリア
  #--------------------------------------------------------------------------
  alias tako43dddclear clear
  def clear
    tako43dddclear
    clear_map_effectEx
  end  
  
  #--------------------------------------------------------------------------
  # ● 特殊マップエフェクトのクリア
  #--------------------------------------------------------------------------
  def clear_map_effectEx
    @mpeffEx_type = :none
    @mpeffEx_power = 0
    @mpeffEx_power_target = 0
    @mpeffEx_duration = 0
  end  
  #--------------------------------------------------------------------------
  # ● 特殊マップエフェクトの更新
  #--------------------------------------------------------------------------
  alias tako4343update_weather update_weather
  def update_weather
    tako4343update_weather
    update_map_effectEx
  end  
  
  #--------------------------------------------------------------------------
  # ● 特殊マップエフェクトの更新
  #--------------------------------------------------------------------------
  def update_map_effectEx
    if @mpeffEx_duration > 0
      d = @mpeffEx_duration
      @mpeffEx_power = (@mpeffEx_power * (d - 1) + @mpeffEx_power_target) / d
      @mpeffEx_duration -= 1
      if @mpeffEx_duration == 0 && @mpeffEx_power_target == 0
        @mpeffEx_type = :none
      end
    end
  end
end  