查看: 4773|回复: 8

[已经解决] 求一个能在地图上烟漫弥漫(天气)的脚本

[复制链接]
梦石
0
星屑
208
在线时间
420 小时
注册时间
2020-1-11
回帖
175
发表于 2020-10-9 23:09:12 | 显示全部楼层 |阅读模式
悬赏100星屑已解决
要 VxAce 上可以用的哟!

最佳答案

查看完整内容

本末倒置了...看你研究了那么久的默认脚本, 原来连脚本在那找都不知道? 外站五大神: Galv, Yanfly, MOG, Theo, Hime 事件脚本调用 weather(2, 5, "Fog_01A") [pre lang="ruby"]#============================================================================== # +++ MOG - Weather EX (v2.3) +++ #============================================================================== # By Moghunter # http://www.atelier-rgss ...
梦石
0
星屑
29901
在线时间
5734 小时
注册时间
2016-3-8
回帖
1653
发表于 2020-10-9 23:09:13 | 显示全部楼层
本帖最后由 alexncf125 于 2020-10-9 23:41 编辑

本末倒置了...看你研究了那么久的默认脚本, 原来连脚本在那找都不知道?
外站五大神: Galv, Yanfly, MOG, Theo, Hime
Weather.rar (121.06 KB, 下载次数: 128)
事件脚本调用 weather(2, 5, "Fog_01A")
[pre lang="ruby"]#==============================================================================
# +++ MOG - Weather EX (v2.3) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# Sistema de clima com efeitos animados.
#==============================================================================
# As imagens usadas pelo sistema do clima devem ser gravadas na pasta
#
# GRAPHICS/WEATHER/
#
#==============================================================================
# UTILIZAÇÃO
#
# Use o comando abaixo através da função chamar script.*(Evento)
#
# weather(TYPE, POWER, IMAGE_FILE)
#
# TYPE - Tipo de clima. (de 0 a 6)
# POWER - Quantidade de partículas na tela. (de 1 a 10)
# IMAGE_FILE - Nome da imagem.
#
# Exemplo (Eg)
#
# weather(0, 5, "Leaf")
#
#==============================================================================
# Tipos de Clima.
#
# O sistema vem com 7 climas pré-configurados, que podem ser testados na demo
# que vem com esse script.
#
# 0 - (Rain)  
# 1 - (Wind)
# 2 - (Fog)  
# 3 - (Light)
# 4 - (Snow)
# 5 - (Spark)
# 6 - (Random)
#
#==============================================================================
# NOTA
#
# Evite de usar imagens muito pesadas ou de tamanho grande, caso for usar
# diminua o poder do clima para evitar lag.
#
#==============================================================================
#==============================================================================
# Para parar o clima use o comando abaixo.
#
# weather_stop
#==============================================================================
# Para parar o clima após a batalha use o código abaixo.
#
# weather_stop_b
#
#==============================================================================
# Para parar reativar o clima com as caracteríticas préviamente usadas use o
# comando abaixo.
#
# weather_restore
#==============================================================================
# Se você precisar ativar um novo clima mas deseja gravar as caracteríticas
# do clima atual para ser reativado depois use os códigos abaixo.
#
# weather_store
# weather_restore_store
#
#==============================================================================

#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 2.3 - Compatibilidade com MOG Battle Camera.
# v 2.2 - Adicionado o comando parar o clima após a batalha.
# v 2.1 - Melhoria na posição das partículas durante as transições
#         de scenes.
# v 2.0 - Correção do bug do Crash aleatório.
#==============================================================================
module MOG_WEATHER_EX
  #Prioridade do clima na tela.
  WEATHER_SCREEN_Z = 50##########
  #Definição da eficiência do poder do clima.
  #NOTA -  Um valor muito alto pode causar lag, dependendo do tipo de clima e
  #        imagem usada.
  WEATHER_POWER_EFIC = 5
  #Ativar o clima no sistema de batalha.
  WEATHER_BATTLE = true
end

$imported = {} if $imported.nil?
$imported[:mog_weather_ex] = true

#==============================================================================
# ■ Cache
#==============================================================================
module Cache
  
  #--------------------------------------------------------------------------
  # ● Weather
  #--------------------------------------------------------------------------
  def self.weather(filename)
      load_bitmap("Graphics/Weather/", filename)
  end
  
end

#==============================================================================
# ■ Game System
#==============================================================================
class Game_System
  
  attr_accessor :weather
  attr_accessor :weather_restore
  attr_accessor :weather_record_set
  attr_accessor :weather_temp
  
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------  
  alias weather_ex_initialize initialize  
  def initialize
      @weather = [-1,0,""]
      @weather_restore = [-1,0,""]
      @weather_temp = [-1,0,""]
      @weather_record_set = [-1,0,""]
      weather_ex_initialize
  end  
  
end  

#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp

  attr_accessor :weather_ex_set
  attr_accessor :weather_fade
  attr_accessor :weather_rf_time
  attr_accessor :weather_fstop
  
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------  
  alias mog_weather_ex_temp_initialize initialize
  def initialize
      @weather_ex_set = []
      @weather_fade = false
      @weather_rf_time = 0
      @weather_fstop = false
      mog_weather_ex_temp_initialize
  end  
  
end

#==============================================================================
# ■ Game Interpreter
#==============================================================================
class Game_Interpreter
  
  #--------------------------------------------------------------------------
  # ● Weather
  #--------------------------------------------------------------------------   
  def weather(type = -1, power = 0, image = "")
      $game_temp.weather_fade = false
      $game_temp.weather_rf_time = 0
      $game_system.weather.clear
      $game_system.weather = [type,power,image]
  end
  
  #--------------------------------------------------------------------------
  # ● Weather Stop
  #--------------------------------------------------------------------------     
  def weather_stop
      $game_temp.weather_fade = false
      $game_system.weather.clear
      $game_system.weather = [-1,0,""]
      $game_system.weather_restore  = [-1,0,""]
      $game_system.weather_temp = [-1,0,""]      
  end
  
  #--------------------------------------------------------------------------
  # ● Weather Restore
  #--------------------------------------------------------------------------      
  def weather_restore
      $game_temp.weather_fade = false
      if $game_system.weather[0] != -1
         w = $game_system.weather
         $game_system.weather_restore = [w[0],w[1],w[2]]
         $game_system.weather.clear
         $game_system.weather = [-1,0,""]
         return
      end
      w = $game_system.weather_restore
      weather(w[0],w[1],w[2])
  end
  
  #--------------------------------------------------------------------------
  # ● Weather Fade
  #--------------------------------------------------------------------------         
  def weather_fade(value)
      $game_temp.weather_fade = value
  end
  
  #--------------------------------------------------------------------------
  # ● Weather Store
  #--------------------------------------------------------------------------           
  def weather_store
      w = $game_system.weather
      $game_system.weather_record_set = [w[0],w[1],w[2]]
  end  
  
  #--------------------------------------------------------------------------
  # ● Weather Restore Store
  #--------------------------------------------------------------------------           
  def weather_restore_store
      w = $game_system.weather_record_set
      weather(w[0],w[1],w[2])      
  end   
  
  #--------------------------------------------------------------------------
  # ● Weather Stop B
  #--------------------------------------------------------------------------           
  def weather_stop_b
      $game_temp.weather_fstop = true
  end
  
end  

#==============================================================================
# ** Spriteset_Map
#==============================================================================
class Spriteset_Map
  
  #--------------------------------------------------------------------------
  # * Create Viewport
  #--------------------------------------------------------------------------
  alias mog_weather_ex_create_viewports create_viewports
  def create_viewports
      create_viewport_weather
      mog_weather_ex_create_viewports      
  end
   
  #--------------------------------------------------------------------------
  # * Create Viewport Weather
  #--------------------------------------------------------------------------
  def create_viewport_weather
      return if @viewport_weather != nil
      @viewport_weather = Viewport.new
      @viewport_weather.z = MOG_WEATHER_EX::WEATHER_SCREEN_Z
      @viewport_weather.ox = ($game_map.display_x * 32)
      @viewport_weather.oy = ($game_map.display_y * 32)
  end
      
  #--------------------------------------------------------------------------
  # * Dispose Viewports
  #--------------------------------------------------------------------------
  alias mog_weather_ex_dispose_viewports dispose_viewports
  def dispose_viewports      
      mog_weather_ex_dispose_viewports
      dispose_viewport_weather
  end
  
  #--------------------------------------------------------------------------
  # * Dispose Viewport Weather
  #--------------------------------------------------------------------------
  def dispose_viewport_weather
      return if @viewport_weather == nil
      @viewport_weather.dispose   
  end
   
  #--------------------------------------------------------------------------
  # * Update Viewports
  #--------------------------------------------------------------------------
  alias mog_weather_ex_update_viewports update_viewports
  def update_viewports
      mog_weather_ex_update_viewports
      update_viewport_weather
  end
  
  #--------------------------------------------------------------------------
  # * Update Viewports Weather
  #--------------------------------------------------------------------------
  def update_viewport_weather
      return if @viewport_weather == nil
      @viewport_weather.ox = ($game_map.display_x * 32)
      @viewport_weather.oy = ($game_map.display_y * 32)
  end     
  
end

#==============================================================================
# ** Spriteset_Battle
#==============================================================================
class Spriteset_Battle
  
  #--------------------------------------------------------------------------
  # * Create Viewport
  #--------------------------------------------------------------------------
  alias mog_weather_ex_create_viewports_battle create_viewports
  def create_viewports
      mog_weather_ex_create_viewports_battle
      create_viewport_weather   
  end
   
  #--------------------------------------------------------------------------
  # * Create Viewport Weather
  #--------------------------------------------------------------------------
  def create_viewport_weather
      return if @viewport_weather != nil
      @viewport_weather = Viewport.new
      @viewport_weather.z = MOG_WEATHER_EX::WEATHER_SCREEN_Z
  end
   
  #--------------------------------------------------------------------------
  # * Dispose Viewports
  #--------------------------------------------------------------------------
  alias mog_weather_ex_dispose_viewports_battle dispose_viewports
  def dispose_viewports      
      mog_weather_ex_dispose_viewports_battle
      dispose_viewport_weather
  end
  
  #--------------------------------------------------------------------------
  # * Dispose Viewport Weather
  #--------------------------------------------------------------------------
  def dispose_viewport_weather
      return if @viewport_weather == nil
      @viewport_weather.dispose   
  end
   
  #--------------------------------------------------------------------------
  # * Update Viewports
  #--------------------------------------------------------------------------
  alias mog_weather_ex_update_viewports_battle update_viewports
  def update_viewports
      mog_weather_ex_update_viewports_battle
      update_viewport_weather        
  end  
  
  #--------------------------------------------------------------------------
  # * Update Viewports Weather
  #--------------------------------------------------------------------------
  def update_viewport_weather
      return if @viewport_weather == nil
      if $imported[:mog_battle_camera]
         @viewport_weather.ox = $game_temp.viewport_oxy[0]
         @viewport_weather.oy = $game_temp.viewport_oxy[1]
      end   
  end   
  
end

#==============================================================================
# ■ Weather_EX
#==============================================================================
class Weather_EX
  
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------  
  def initialize(viewport = nil ,type = 0, image_name = "",index = 0,nx,ny)
      @wp = Sprite.new
      @wp.bitmap = Cache.weather(image_name.to_s)
      @wp.opacity = 0
      @wp.viewport = viewport
      @cw = @wp.bitmap.width
      @cwm = (@cw / 2) + @cw
      @ch = @wp.bitmap.height
      @chm = (@ch / 2) + @ch
      @range_x = [-@cwm,Graphics.width + @cwm]
      @range_y = [-@chm,Graphics.height + @chm]
      @angle_speed = 0
      @x_speed = 0
      @y_speed = 0
      @zoom_speed = 0
      @opacity_speed = 0
      @type = type
      @index = index
      @nx = 0
      @nx_old = 0
      @ny = 0
      @ny_old = 0      
      @old_nx = nx
      @old_ny = ny
      type_setup(nx,ny)
  end
  
  #--------------------------------------------------------------------------
  # ● x
  #--------------------------------------------------------------------------      
  def x
      @wp.x
  end
  
  #--------------------------------------------------------------------------
  # ● y
  #--------------------------------------------------------------------------      
  def y
      @wp.y
  end
  
  #--------------------------------------------------------------------------
  # ● Opacity
  #--------------------------------------------------------------------------      
  def opacity
      @wp.opacity
  end
  
  #--------------------------------------------------------------------------
  # ● Angle
  #--------------------------------------------------------------------------      
  def angle
      @wp.angle
  end
  
  #--------------------------------------------------------------------------
  # ● Zoom X
  #--------------------------------------------------------------------------      
  def zoom_x
      @wp.zoom_x
  end  
  
  #--------------------------------------------------------------------------
  # ● Dispose Weather
  #--------------------------------------------------------------------------      
  def dispose_weather
      return if @wp == nil
      @wp.bitmap.dispose
      @wp.dispose
      @wp = nil
  end
  
  #--------------------------------------------------------------------------
  # ● Pre Values
  #--------------------------------------------------------------------------   
  def pre_values(index)
      return if  $game_temp.weather_ex_set[index] == nil
      @wp.x = $game_temp.weather_ex_set[index][0]
      @wp.y = $game_temp.weather_ex_set[index][1]
      @wp.opacity = 1#$game_temp.weather_ex_set[index][2]
      @wp.angle = $game_temp.weather_ex_set[index][3]
      @wp.zoom_x = $game_temp.weather_ex_set[index][4]
      @wp.zoom_y = $game_temp.weather_ex_set[index][4]
      $game_temp.weather_ex_set[index].clear
      $game_temp.weather_ex_set[index] = nil
  end  
  
  #--------------------------------------------------------------------------
  # ● Type Setup
  #--------------------------------------------------------------------------      
  def type_setup(nx = 0, ny = 0)
      @cw2 = [@range_x[1] + nx, @range_x[0] + nx]
      @ch2 = [@range_y[1] + ny, @range_y[0] + ny]
      check_weather_type
      pre_values(@index)
      @opacity_speed = -1 if $game_temp.weather_fade
  end
  
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------   
  def update_weather(nx = 0, ny = 0)
      @wp.x += @x_speed
      @wp.y += @y_speed
      @wp.opacity += @opacity_speed
      @wp.angle += @angle_speed
      @wp.zoom_x += @zoom_speed
      @wp.zoom_y += @zoom_speed
      check_loop_map(nx,ny)
      type_setup(nx,ny) if can_reset_setup?
  end  

  #--------------------------------------------------------------------------
  # ● Check Loop Map
  #--------------------------------------------------------------------------        
  def check_loop_map(nx,ny)
      if (@old_nx - nx).abs > 32
         @cw2 = [@range_x[1] + nx, @range_x[0] + nx]
         @wp.x += nx
         @wp.x -= @old_nx if nx == 0
      end   
      if (@old_ny - ny).abs > 32
         @ch2 = [@range_y[1] + ny, @range_y[0] + ny]
         @wp.y += ny
         @wp.y -= @old_ny if ny == 0
      end         
      @old_nx = nx
      @old_ny = ny   
  end  
   
  #--------------------------------------------------------------------------
  # ● Can Reset Setup
  #--------------------------------------------------------------------------      
  def can_reset_setup?
      return true if @wp.x > @cw2[0] or @wp.x <  @cw2[1]
      return true if @wp.y > @ch2[0]  or @wp.y < @ch2[1]
      return true if @wp.opacity == 0
      return true if @wp.zoom_x > 2.0 or @wp.zoom_x < 0.5
      return false
  end
  
#--------------------------------------------------------------------------
# ● Check Weather Type
#--------------------------------------------------------------------------                        
def check_weather_type
     case @type
         when 0;   rain
         when 1;   wind   
         when 2;   fog
         when 3;   light
         when 4;   snow
         when 5;   spark
         when 6;   random                  
      end
end
   
#--------------------------------------------------------------------------
# ● Snow
#--------------------------------------------------------------------------                          
def snow
     @wp.angle = rand(360)
     @wp.x = rand(@cw2[0])
     @wp.y = rand(@ch2[0])
     @wp.opacity = 1
     @wp.zoom_x = (rand(100) + 50) / 100.0
     @wp.zoom_y = @wp.zoom_x
     @y_speed = [[rand(5), 1].max, 5].min
     @opacity_speed = 5
     @angle_speed = rand(3)
end   

#--------------------------------------------------------------------------
# ● Spark
#--------------------------------------------------------------------------                           
def spark
     @wp.angle = rand(360)
     @wp.x = rand(@cw2[0])
     @wp.y = rand(@ch2[0])
     @wp.opacity = 1
     @wp.zoom_x = (rand(100) + 100) / 100.0
     @wp.zoom_y = @wp.zoom_x
     @wp.blend_type = 1     
     @opacity_speed = 10
     @zoom_speed = -0.01
end

#--------------------------------------------------------------------------
# ● Rain
#--------------------------------------------------------------------------                          
def rain
     @wp.x = rand(@cw2[0])      
     if @start == nil
        @wp.y = rand(@ch2[0])
        @start = true
     else
        @wp.y = @ch2[1]        
     end   
     @wp.opacity = 1
     @wp.zoom_y = (rand(50) + 100) / 100.0
     @wp.zoom_x = (rand(25) + 100) / 100.0
     @y_speed = [[rand(10) + 10, 10].max, 20].min
     @opacity_speed = 10
end   

#--------------------------------------------------------------------------
# ● Fog
#--------------------------------------------------------------------------                           
def fog
     rand_angle = rand(2)
     @wp.angle = rand_angle == 1 ? 180 : 0
     @wp.x = rand(@cw2[0])
     @wp.y = rand(@ch2[0])
     @wp.opacity = 1
     @wp.zoom_x = (rand(100) + 50) / 100.0
     @wp.zoom_y = @wp.zoom_x
     @x_speed = [[rand(10), 1].max, 10].min
     @opacity_speed = 10
end

#--------------------------------------------------------------------------
# ● Light
#--------------------------------------------------------------------------                           
def light
     @wp.angle = rand(360)
     @wp.x = rand(@cw2[0])
     @wp.y = rand(@ch2[0])
     @wp.opacity = 1
     @wp.zoom_x = (rand(100) + 50) / 100.0
     @wp.zoom_y = @wp.zoom_x
     @wp.blend_type = 1
     @angle_speed = [[rand(3), 1].max, 3].min
     @y_speed = -[[rand(10), 1].max, 10].min
     @opacity_speed = 2
end

#--------------------------------------------------------------------------
# ● Wind
#--------------------------------------------------------------------------                          
def wind
     @wp.angle = rand(360)
     @wp.x = rand(@cw2[0])
     @wp.y = rand(@ch2[0])
     @wp.opacity = 1
     @wp.zoom_x = (rand(100) + 50) / 100.0
     @wp.zoom_y = @wp.zoom_x
     @x_speed = [[rand(10), 1].max, 10].min
     @y_speed = [[rand(10), 1].max, 10].min
     @opacity_speed = 10
end   
      
#--------------------------------------------------------------------------
# ● Random
#--------------------------------------------------------------------------                          
def random
     @wp.angle = rand(360)
     @wp.x = rand(@cw2[0])
     @wp.y = rand(@ch2[0])
     @wp.opacity = 1
     @wp.zoom_x = (rand(100) + 50) / 100.0
     @wp.zoom_y = @wp.zoom_x
     x_s = [[rand(10), 1].max, 10].min
     y_s = [[rand(10), 1].max, 10].min
     rand_x = rand(2)
     rand_y = rand(2)
     @x_speed = rand_x == 1 ? x_s : -x_s
     @y_speed = rand_y == 1 ? y_s : -y_s      
     @opacity_speed = 10
end   

end

#==============================================================================
# ■ Module Weather EX
#==============================================================================
module Module_Weather_EX
  
#--------------------------------------------------------------------------
# ● Create Weather EX
#--------------------------------------------------------------------------                  
  def create_weather_ex
      dispose_weather_ex
      create_weather_sprite     
  end
  
#--------------------------------------------------------------------------
# ● Dispose Wheater EX
#--------------------------------------------------------------------------                     
  def dispose_weather_ex
      dispose_weather_ex_sprite
  end

#--------------------------------------------------------------------------
# ● Create Weather Sprite
#--------------------------------------------------------------------------                       
  def create_weather_sprite
      dispose_weather_ex_sprite
      @old_weather = $game_system.weather
      return if $game_system.weather == [] or $game_system.weather[0] == -1
      @weather_ex = []
      @weather_oxy = [$game_map.display_x * 32,
                      $game_map.display_y * 32]      
      index = 0
      power_efic = MOG_WEATHER_EX::WEATHER_POWER_EFIC
      power_efic = 1 if power_efic < 1
      power = [[$game_system.weather[1] * power_efic, power_efic].max, 999].min
      for i in 0...power
          @weather_ex.push(Weather_EX.new(@viewport_weather,$game_system.weather[0],$game_system.weather[2],index, @viewport1.ox, @viewport1.oy))
          index += 1
      end            
  end
  
#--------------------------------------------------------------------------
# ● Dispose Weather EX
#--------------------------------------------------------------------------                  
  def dispose_weather_ex_sprite
      return if @weather_ex == nil
      index = 0
      for i in @weather_ex
          $game_temp.weather_ex_set[index] = [] if $game_temp.weather_ex_set[index] == nil
          $game_temp.weather_ex_set[index].push(i.x,i.y,i.opacity,i.angle,i.zoom_x)
          i.dispose_weather
          index += 1
      end
      @weather_ex.each {|sprite| sprite.dispose_weather}  
      @weather_ex = nil
  end
  
#--------------------------------------------------------------------------
# ● Dispose Refresh
#--------------------------------------------------------------------------                    
  def dispose_refresh
      $game_temp.weather_ex_set.clear
      return if @weather_ex == nil
      @weather_ex.each {|sprite| sprite.dispose_weather}
      @weather_ex = nil
  end  
  
#--------------------------------------------------------------------------
# ● Update Weather EX
#--------------------------------------------------------------------------                  
  def update_weather_ex
      $game_temp.weather_rf_time -= 1 if $game_temp.weather_rf_time > 0
      refresh_weather_ex if $game_temp.weather_rf_time == 0
      return if @weather_ex == nil
      @weather_ex.each {|sprite| sprite.update_weather(@viewport_weather.ox,@viewport_weather.oy)}
  end
  
#--------------------------------------------------------------------------
# ● Refresh Weather EX
#--------------------------------------------------------------------------                     
  def refresh_weather_ex
      return if @old_weather == nil
      return if @old_weather == $game_system.weather
      dispose_refresh      
      create_weather_sprite
  end  
   
end  

#==============================================================================
# ■ Spriteset Map
#==============================================================================
class Spriteset_Map
   include Module_Weather_EX  
   
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------                  
  alias mog_weather_ex_initialize initialize
  def initialize
      dispose_weather_ex   
      mog_weather_ex_initialize
      create_weather_ex
  end

#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------                  
  alias mog_weather_ex_dispose dispose
  def dispose
      dispose_weather_ex   
      mog_weather_ex_dispose
  end  

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------                  
  alias mog_weather_ex_update update
  def update
      mog_weather_ex_update
      update_weather_ex
  end  
   
end

if MOG_WEATHER_EX::WEATHER_BATTLE
#==============================================================================
# ■ Spriteset Battle
#==============================================================================
class Spriteset_Battle
  
   include Module_Weather_EX  
   
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------                  
  alias mog_weather_ex_initialize initialize
  def initialize
      dispose_weather_ex   
      mog_weather_ex_initialize
      create_weather_ex
  end

#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------                  
  alias mog_weather_ex_dispose dispose
  def dispose
      mog_weather_ex_dispose
      dispose_weather_ex
  end  

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------                  
  alias mog_weather_ex_update update
  def update
      mog_weather_ex_update
      update_weather_ex
  end   
   
end

end

#=============================================================================
# ■ Scene Base
#=============================================================================
class Scene_Base
  
  #--------------------------------------------------------------------------
  # ● Weather Recover Data
  #--------------------------------------------------------------------------  
  def weather_recover_data
      if $game_system.weather.empty? or
          $game_system.weather[0] == -1
          if !$game_system.weather_restore.empty? and
             $game_system.weather_restore[0] != -1
             v = $game_system.weather_restore
             $game_system.weather = [v[0],v[1],v[2]]
          end
      end         
  end
  
  #--------------------------------------------------------------------------
  # ● Weather Restore
  #--------------------------------------------------------------------------      
  def weather_recover_scene
      return if $game_system.weather_temp.empty?
      return if $game_system.weather_temp[0] == -1
      w = $game_system.weather_temp
      $game_system.weather = [w[0],w[1],w[2]]
      $game_system.weather_temp.clear
      $game_system.weather_temp = [-1,0,""]
  end  

  #--------------------------------------------------------------------------
  # ● Main
  #--------------------------------------------------------------------------         
  alias mog_weather_ex_main main
  def main
      dispose_weather_ex_base
      weather_recover_scene if can_recover_weather_scene?
      mog_weather_ex_main
  end   
  
  #--------------------------------------------------------------------------
  # ● Can Recover Weather Scene
  #--------------------------------------------------------------------------         
  def can_recover_weather_scene?
      return true if SceneManager.scene_is?(Scene_Map)
      return true if SceneManager.scene_is?(Scene_Battle)
      return false
  end  
  
  #--------------------------------------------------------------------------
  # ● terminate
  #--------------------------------------------------------------------------         
  alias mog_weather_ex_terminate_base terminate
  def terminate
      mog_weather_ex_terminate_base
      dispose_weather_ex_base      
  end  

  #--------------------------------------------------------------------------
  # ● Dispose Weather EX Base
  #--------------------------------------------------------------------------           
  def dispose_weather_ex_base
      return if @spriteset == nil
      @spriteset.dispose_weather_ex rescue nil
  end        
  
end

#=============================================================================
# ■ Sprite Battle
#=============================================================================
class Spriteset_Battle  

  #--------------------------------------------------------------------------
  # ● Dispose
  #--------------------------------------------------------------------------           
  alias mog_weather_ex_aft_dispose dispose
  def dispose
      force_stop_weather_ex_after_battle
      mog_weather_ex_aft_dispose
  end

  #--------------------------------------------------------------------------
  # ● Force Stop Weather EX After
  #--------------------------------------------------------------------------           
  def force_stop_weather_ex_after_battle
      return if !$game_temp.weather_fstop
      $game_temp.weather_fstop = false
      $game_temp.weather_fade = false
      $game_system.weather.clear
      $game_system.weather = [-1,0,""]
      $game_system.weather_restore  = [-1,0,""]
      $game_system.weather_temp = [-1,0,""]      
  end
   
  
end

#=============================================================================
# ■ Scene Load
#=============================================================================
class Scene_Load < Scene_File
  
  #--------------------------------------------------------------------------
  # ● On Load Success
  #--------------------------------------------------------------------------
  alias mog_weather_ex_on_load_success on_load_success
  def on_load_success
      mog_weather_ex_on_load_success
      weather_recover_data
  end
end

#=============================================================================
# ■ Scene Manager
#=============================================================================
class << SceneManager
  
  #--------------------------------------------------------------------------
  # ● Call
  #--------------------------------------------------------------------------         
  alias mog_weather_ex_call call
  def call(scene_class)
      weather_dispose
      mog_weather_ex_call(scene_class)
  end
  
  #--------------------------------------------------------------------------
  # ● Weather Restore
  #--------------------------------------------------------------------------      
  def weather_dispose
      return if $game_system.weather.empty?
      return if $game_system.weather[0] == -1
      w = $game_system.weather
      $game_system.weather_temp = [w[0],w[1],w[2]]
      $game_system.weather.clear
      $game_system.weather = [-1,0,""]
  end   
  
end[/pre]
回复

使用道具 举报

梦石
0
星屑
208
在线时间
420 小时
注册时间
2020-1-11
回帖
175
 楼主| 发表于 2020-10-10 12:16:25 | 显示全部楼层
哈哈,我对精灵特效的脚本 没什么 研究的动力 。有现成就用,纯属绵上添花。
我光问脚本问题就直接升到 lv3 了。得抛点 星屑 降降等级。
你的脚本我试验过了的确可用,星屑双手奉上。但是你压缩有关素材的文件我无法下载。
你就把图片素材发在这帖中,我截图下来pc处理一下。
回复

使用道具 举报

梦石
0
星屑
208
在线时间
420 小时
注册时间
2020-1-11
回帖
175
 楼主| 发表于 2020-10-10 12:29:49 | 显示全部楼层
alexncf125 发表于 2020-10-9 23:33
本末倒置了...看你研究了那么久的默认脚本, 原来连脚本在那找都不知道?
外站五大神: Galv, Yanfly, MOG, Th ...

啊!不行 。素材图片的格 式应该是 png 有透明背景的图片。贴 在 帖楼里会变黑底。

alipuut@qq.com   我的qq邮箱,请抬贵手。

点评

已发送至QQ  发表于 2020-10-10 12:35
回复

使用道具 举报

梦石
0
星屑
208
在线时间
420 小时
注册时间
2020-1-11
回帖
175
 楼主| 发表于 2020-10-10 13:00:18 | 显示全部楼层
alianlord 发表于 2020-10-10 12:29
啊!不行 。素材图片的格 式应该是 png 有透明背景的图片。贴 在 帖楼里会变黑底。

alipuut@qq.com   我 ...

非常感谢

点评

所以...星屑呢?  发表于 2020-10-10 14:15
回复

使用道具 举报

梦石
0
星屑
208
在线时间
420 小时
注册时间
2020-1-11
回帖
175
 楼主| 发表于 2020-10-10 15:21:25 | 显示全部楼层

我研究了脚本,原来要按最佳答案才能把星屑给出去啊?
回复

使用道具 举报

梦石
0
星屑
6830
在线时间
1251 小时
注册时间
2011-12-18
回帖
1127
发表于 2020-10-10 22:13:37 | 显示全部楼层
看這說法是 霧霾 吧 (X
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部