查看: 4855|回复: 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
星屑
30103
在线时间
5741 小时
注册时间
2016-3-8
回帖
1662
发表于 2020-10-9 23:09:13 | 显示全部楼层
本帖最后由 alexncf125 于 2020-10-9 23:41 编辑

本末倒置了...看你研究了那么久的默认脚本, 原来连脚本在那找都不知道?
外站五大神: Galv, Yanfly, MOG, Theo, Hime
Weather.rar (121.06 KB, 下载次数: 129)
事件脚本调用 weather(2, 5, "Fog_01A")
  1. #==============================================================================
  2. # +++ MOG - Weather EX (v2.3) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]http://www.atelier-rgss.com/[/url]
  6. #==============================================================================
  7. # Sistema de clima com efeitos animados.
  8. #==============================================================================
  9. # As imagens usadas pelo sistema do clima devem ser gravadas na pasta
  10. #
  11. # GRAPHICS/WEATHER/
  12. #
  13. #==============================================================================
  14. # UTILIZAÇÃO
  15. #
  16. # Use o comando abaixo através da função chamar script.*(Evento)
  17. #
  18. # weather(TYPE, POWER, IMAGE_FILE)
  19. #
  20. # TYPE - Tipo de clima. (de 0 a 6)
  21. # POWER - Quantidade de partículas na tela. (de 1 a 10)
  22. # IMAGE_FILE - Nome da imagem.
  23. #
  24. # Exemplo (Eg)
  25. #
  26. # weather(0, 5, "Leaf")
  27. #
  28. #==============================================================================
  29. # Tipos de Clima.
  30. #
  31. # O sistema vem com 7 climas pré-configurados, que podem ser testados na demo
  32. # que vem com esse script.
  33. #
  34. # 0 - (Rain)  
  35. # 1 - (Wind)
  36. # 2 - (Fog)  
  37. # 3 - (Light)
  38. # 4 - (Snow)
  39. # 5 - (Spark)
  40. # 6 - (Random)
  41. #
  42. #==============================================================================
  43. # NOTA
  44. #
  45. # Evite de usar imagens muito pesadas ou de tamanho grande, caso for usar
  46. # diminua o poder do clima para evitar lag.
  47. #
  48. #==============================================================================
  49. #==============================================================================
  50. # Para parar o clima use o comando abaixo.
  51. #
  52. # weather_stop
  53. #==============================================================================
  54. # Para parar o clima após a batalha use o código abaixo.
  55. #
  56. # weather_stop_b
  57. #
  58. #==============================================================================
  59. # Para parar reativar o clima com as caracteríticas préviamente usadas use o
  60. # comando abaixo.
  61. #
  62. # weather_restore
  63. #==============================================================================
  64. # Se você precisar ativar um novo clima mas deseja gravar as caracteríticas
  65. # do clima atual para ser reativado depois use os códigos abaixo.
  66. #
  67. # weather_store
  68. # weather_restore_store
  69. #
  70. #==============================================================================

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

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

  92. #==============================================================================
  93. # ■ Cache
  94. #==============================================================================
  95. module Cache
  96.   
  97.   #--------------------------------------------------------------------------
  98.   # ● Weather
  99.   #--------------------------------------------------------------------------
  100.   def self.weather(filename)
  101.       load_bitmap("Graphics/Weather/", filename)
  102.   end
  103.   
  104. end

  105. #==============================================================================
  106. # ■ Game System
  107. #==============================================================================
  108. class Game_System
  109.   
  110.   attr_accessor :weather
  111.   attr_accessor :weather_restore
  112.   attr_accessor :weather_record_set
  113.   attr_accessor :weather_temp
  114.   
  115.   #--------------------------------------------------------------------------
  116.   # ● Initialize
  117.   #--------------------------------------------------------------------------  
  118.   alias weather_ex_initialize initialize  
  119.   def initialize
  120.       @weather = [-1,0,""]
  121.       @weather_restore = [-1,0,""]
  122.       @weather_temp = [-1,0,""]
  123.       @weather_record_set = [-1,0,""]
  124.       weather_ex_initialize
  125.   end  
  126.   
  127. end  

  128. #==============================================================================
  129. # ■ Game Temp
  130. #==============================================================================
  131. class Game_Temp

  132.   attr_accessor :weather_ex_set
  133.   attr_accessor :weather_fade
  134.   attr_accessor :weather_rf_time
  135.   attr_accessor :weather_fstop
  136.   
  137.   #--------------------------------------------------------------------------
  138.   # ● Initialize
  139.   #--------------------------------------------------------------------------  
  140.   alias mog_weather_ex_temp_initialize initialize
  141.   def initialize
  142.       @weather_ex_set = []
  143.       @weather_fade = false
  144.       @weather_rf_time = 0
  145.       @weather_fstop = false
  146.       mog_weather_ex_temp_initialize
  147.   end  
  148.   
  149. end

  150. #==============================================================================
  151. # ■ Game Interpreter
  152. #==============================================================================
  153. class Game_Interpreter
  154.   
  155.   #--------------------------------------------------------------------------
  156.   # ● Weather
  157.   #--------------------------------------------------------------------------   
  158.   def weather(type = -1, power = 0, image = "")
  159.       $game_temp.weather_fade = false
  160.       $game_temp.weather_rf_time = 0
  161.       $game_system.weather.clear
  162.       $game_system.weather = [type,power,image]
  163.   end
  164.   
  165.   #--------------------------------------------------------------------------
  166.   # ● Weather Stop
  167.   #--------------------------------------------------------------------------     
  168.   def weather_stop
  169.       $game_temp.weather_fade = false
  170.       $game_system.weather.clear
  171.       $game_system.weather = [-1,0,""]
  172.       $game_system.weather_restore  = [-1,0,""]
  173.       $game_system.weather_temp = [-1,0,""]      
  174.   end
  175.   
  176.   #--------------------------------------------------------------------------
  177.   # ● Weather Restore
  178.   #--------------------------------------------------------------------------      
  179.   def weather_restore
  180.       $game_temp.weather_fade = false
  181.       if $game_system.weather[0] != -1
  182.          w = $game_system.weather
  183.          $game_system.weather_restore = [w[0],w[1],w[2]]
  184.          $game_system.weather.clear
  185.          $game_system.weather = [-1,0,""]
  186.          return
  187.       end
  188.       w = $game_system.weather_restore
  189.       weather(w[0],w[1],w[2])
  190.   end
  191.   
  192.   #--------------------------------------------------------------------------
  193.   # ● Weather Fade
  194.   #--------------------------------------------------------------------------         
  195.   def weather_fade(value)
  196.       $game_temp.weather_fade = value
  197.   end
  198.   
  199.   #--------------------------------------------------------------------------
  200.   # ● Weather Store
  201.   #--------------------------------------------------------------------------           
  202.   def weather_store
  203.       w = $game_system.weather
  204.       $game_system.weather_record_set = [w[0],w[1],w[2]]
  205.   end  
  206.   
  207.   #--------------------------------------------------------------------------
  208.   # ● Weather Restore Store
  209.   #--------------------------------------------------------------------------           
  210.   def weather_restore_store
  211.       w = $game_system.weather_record_set
  212.       weather(w[0],w[1],w[2])      
  213.   end   
  214.   
  215.   #--------------------------------------------------------------------------
  216.   # ● Weather Stop B
  217.   #--------------------------------------------------------------------------           
  218.   def weather_stop_b
  219.       $game_temp.weather_fstop = true
  220.   end
  221.   
  222. end  

  223. #==============================================================================
  224. # ** Spriteset_Map
  225. #==============================================================================
  226. class Spriteset_Map
  227.   
  228.   #--------------------------------------------------------------------------
  229.   # * Create Viewport
  230.   #--------------------------------------------------------------------------
  231.   alias mog_weather_ex_create_viewports create_viewports
  232.   def create_viewports
  233.       create_viewport_weather
  234.       mog_weather_ex_create_viewports      
  235.   end
  236.    
  237.   #--------------------------------------------------------------------------
  238.   # * Create Viewport Weather
  239.   #--------------------------------------------------------------------------
  240.   def create_viewport_weather
  241.       return if @viewport_weather != nil
  242.       @viewport_weather = Viewport.new
  243.       @viewport_weather.z = MOG_WEATHER_EX::WEATHER_SCREEN_Z
  244.       @viewport_weather.ox = ($game_map.display_x * 32)
  245.       @viewport_weather.oy = ($game_map.display_y * 32)
  246.   end
  247.       
  248.   #--------------------------------------------------------------------------
  249.   # * Dispose Viewports
  250.   #--------------------------------------------------------------------------
  251.   alias mog_weather_ex_dispose_viewports dispose_viewports
  252.   def dispose_viewports      
  253.       mog_weather_ex_dispose_viewports
  254.       dispose_viewport_weather
  255.   end
  256.   
  257.   #--------------------------------------------------------------------------
  258.   # * Dispose Viewport Weather
  259.   #--------------------------------------------------------------------------
  260.   def dispose_viewport_weather
  261.       return if @viewport_weather == nil
  262.       @viewport_weather.dispose   
  263.   end
  264.    
  265.   #--------------------------------------------------------------------------
  266.   # * Update Viewports
  267.   #--------------------------------------------------------------------------
  268.   alias mog_weather_ex_update_viewports update_viewports
  269.   def update_viewports
  270.       mog_weather_ex_update_viewports
  271.       update_viewport_weather
  272.   end
  273.   
  274.   #--------------------------------------------------------------------------
  275.   # * Update Viewports Weather
  276.   #--------------------------------------------------------------------------
  277.   def update_viewport_weather
  278.       return if @viewport_weather == nil
  279.       @viewport_weather.ox = ($game_map.display_x * 32)
  280.       @viewport_weather.oy = ($game_map.display_y * 32)
  281.   end     
  282.   
  283. end

  284. #==============================================================================
  285. # ** Spriteset_Battle
  286. #==============================================================================
  287. class Spriteset_Battle
  288.   
  289.   #--------------------------------------------------------------------------
  290.   # * Create Viewport
  291.   #--------------------------------------------------------------------------
  292.   alias mog_weather_ex_create_viewports_battle create_viewports
  293.   def create_viewports
  294.       mog_weather_ex_create_viewports_battle
  295.       create_viewport_weather   
  296.   end
  297.    
  298.   #--------------------------------------------------------------------------
  299.   # * Create Viewport Weather
  300.   #--------------------------------------------------------------------------
  301.   def create_viewport_weather
  302.       return if @viewport_weather != nil
  303.       @viewport_weather = Viewport.new
  304.       @viewport_weather.z = MOG_WEATHER_EX::WEATHER_SCREEN_Z
  305.   end
  306.    
  307.   #--------------------------------------------------------------------------
  308.   # * Dispose Viewports
  309.   #--------------------------------------------------------------------------
  310.   alias mog_weather_ex_dispose_viewports_battle dispose_viewports
  311.   def dispose_viewports      
  312.       mog_weather_ex_dispose_viewports_battle
  313.       dispose_viewport_weather
  314.   end
  315.   
  316.   #--------------------------------------------------------------------------
  317.   # * Dispose Viewport Weather
  318.   #--------------------------------------------------------------------------
  319.   def dispose_viewport_weather
  320.       return if @viewport_weather == nil
  321.       @viewport_weather.dispose   
  322.   end
  323.    
  324.   #--------------------------------------------------------------------------
  325.   # * Update Viewports
  326.   #--------------------------------------------------------------------------
  327.   alias mog_weather_ex_update_viewports_battle update_viewports
  328.   def update_viewports
  329.       mog_weather_ex_update_viewports_battle
  330.       update_viewport_weather        
  331.   end  
  332.   
  333.   #--------------------------------------------------------------------------
  334.   # * Update Viewports Weather
  335.   #--------------------------------------------------------------------------
  336.   def update_viewport_weather
  337.       return if @viewport_weather == nil
  338.       if $imported[:mog_battle_camera]
  339.          @viewport_weather.ox = $game_temp.viewport_oxy[0]
  340.          @viewport_weather.oy = $game_temp.viewport_oxy[1]
  341.       end   
  342.   end   
  343.   
  344. end

  345. #==============================================================================
  346. # ■ Weather_EX
  347. #==============================================================================
  348. class Weather_EX
  349.   
  350.   #--------------------------------------------------------------------------
  351.   # ● Initialize
  352.   #--------------------------------------------------------------------------  
  353.   def initialize(viewport = nil ,type = 0, image_name = "",index = 0,nx,ny)
  354.       @wp = Sprite.new
  355.       @wp.bitmap = Cache.weather(image_name.to_s)
  356.       @wp.opacity = 0
  357.       @wp.viewport = viewport
  358.       @cw = @wp.bitmap.width
  359.       @cwm = (@cw / 2) + @cw
  360.       @ch = @wp.bitmap.height
  361.       @chm = (@ch / 2) + @ch
  362.       @range_x = [-@cwm,Graphics.width + @cwm]
  363.       @range_y = [-@chm,Graphics.height + @chm]
  364.       @angle_speed = 0
  365.       @x_speed = 0
  366.       @y_speed = 0
  367.       @zoom_speed = 0
  368.       @opacity_speed = 0
  369.       @type = type
  370.       @index = index
  371.       @nx = 0
  372.       @nx_old = 0
  373.       @ny = 0
  374.       @ny_old = 0      
  375.       @old_nx = nx
  376.       @old_ny = ny
  377.       type_setup(nx,ny)
  378.   end
  379.   
  380.   #--------------------------------------------------------------------------
  381.   # ● x
  382.   #--------------------------------------------------------------------------      
  383.   def x
  384.       @wp.x
  385.   end
  386.   
  387.   #--------------------------------------------------------------------------
  388.   # ● y
  389.   #--------------------------------------------------------------------------      
  390.   def y
  391.       @wp.y
  392.   end
  393.   
  394.   #--------------------------------------------------------------------------
  395.   # ● Opacity
  396.   #--------------------------------------------------------------------------      
  397.   def opacity
  398.       @wp.opacity
  399.   end
  400.   
  401.   #--------------------------------------------------------------------------
  402.   # ● Angle
  403.   #--------------------------------------------------------------------------      
  404.   def angle
  405.       @wp.angle
  406.   end
  407.   
  408.   #--------------------------------------------------------------------------
  409.   # ● Zoom X
  410.   #--------------------------------------------------------------------------      
  411.   def zoom_x
  412.       @wp.zoom_x
  413.   end  
  414.   
  415.   #--------------------------------------------------------------------------
  416.   # ● Dispose Weather
  417.   #--------------------------------------------------------------------------      
  418.   def dispose_weather
  419.       return if @wp == nil
  420.       @wp.bitmap.dispose
  421.       @wp.dispose
  422.       @wp = nil
  423.   end
  424.   
  425.   #--------------------------------------------------------------------------
  426.   # ● Pre Values
  427.   #--------------------------------------------------------------------------   
  428.   def pre_values(index)
  429.       return if  $game_temp.weather_ex_set[index] == nil
  430.       @wp.x = $game_temp.weather_ex_set[index][0]
  431.       @wp.y = $game_temp.weather_ex_set[index][1]
  432.       @wp.opacity = 1#$game_temp.weather_ex_set[index][2]
  433.       @wp.angle = $game_temp.weather_ex_set[index][3]
  434.       @wp.zoom_x = $game_temp.weather_ex_set[index][4]
  435.       @wp.zoom_y = $game_temp.weather_ex_set[index][4]
  436.       $game_temp.weather_ex_set[index].clear
  437.       $game_temp.weather_ex_set[index] = nil
  438.   end  
  439.   
  440.   #--------------------------------------------------------------------------
  441.   # ● Type Setup
  442.   #--------------------------------------------------------------------------      
  443.   def type_setup(nx = 0, ny = 0)
  444.       @cw2 = [@range_x[1] + nx, @range_x[0] + nx]
  445.       @ch2 = [@range_y[1] + ny, @range_y[0] + ny]
  446.       check_weather_type
  447.       pre_values(@index)
  448.       @opacity_speed = -1 if $game_temp.weather_fade
  449.   end
  450.   
  451.   #--------------------------------------------------------------------------
  452.   # ● Update
  453.   #--------------------------------------------------------------------------   
  454.   def update_weather(nx = 0, ny = 0)
  455.       @wp.x += @x_speed
  456.       @wp.y += @y_speed
  457.       @wp.opacity += @opacity_speed
  458.       @wp.angle += @angle_speed
  459.       @wp.zoom_x += @zoom_speed
  460.       @wp.zoom_y += @zoom_speed
  461.       check_loop_map(nx,ny)
  462.       type_setup(nx,ny) if can_reset_setup?
  463.   end  

  464.   #--------------------------------------------------------------------------
  465.   # ● Check Loop Map
  466.   #--------------------------------------------------------------------------        
  467.   def check_loop_map(nx,ny)
  468.       if (@old_nx - nx).abs > 32
  469.          @cw2 = [@range_x[1] + nx, @range_x[0] + nx]
  470.          @wp.x += nx
  471.          @wp.x -= @old_nx if nx == 0
  472.       end   
  473.       if (@old_ny - ny).abs > 32
  474.          @ch2 = [@range_y[1] + ny, @range_y[0] + ny]
  475.          @wp.y += ny
  476.          @wp.y -= @old_ny if ny == 0
  477.       end         
  478.       @old_nx = nx
  479.       @old_ny = ny   
  480.   end  
  481.    
  482.   #--------------------------------------------------------------------------
  483.   # ● Can Reset Setup
  484.   #--------------------------------------------------------------------------      
  485.   def can_reset_setup?
  486.       return true if @wp.x > @cw2[0] or @wp.x <  @cw2[1]
  487.       return true if @wp.y > @ch2[0]  or @wp.y < @ch2[1]
  488.       return true if @wp.opacity == 0
  489.       return true if @wp.zoom_x > 2.0 or @wp.zoom_x < 0.5
  490.       return false
  491.   end
  492.   
  493. #--------------------------------------------------------------------------
  494. # ● Check Weather Type
  495. #--------------------------------------------------------------------------                        
  496. def check_weather_type
  497.      case @type
  498.          when 0;   rain
  499.          when 1;   wind   
  500.          when 2;   fog
  501.          when 3;   light
  502.          when 4;   snow
  503.          when 5;   spark
  504.          when 6;   random                  
  505.       end
  506. end
  507.    
  508. #--------------------------------------------------------------------------
  509. # ● Snow
  510. #--------------------------------------------------------------------------                          
  511. def snow
  512.      @wp.angle = rand(360)
  513.      @wp.x = rand(@cw2[0])
  514.      @wp.y = rand(@ch2[0])
  515.      @wp.opacity = 1
  516.      @wp.zoom_x = (rand(100) + 50) / 100.0
  517.      @wp.zoom_y = @wp.zoom_x
  518.      @y_speed = [[rand(5), 1].max, 5].min
  519.      @opacity_speed = 5
  520.      @angle_speed = rand(3)
  521. end   

  522. #--------------------------------------------------------------------------
  523. # ● Spark
  524. #--------------------------------------------------------------------------                           
  525. def spark
  526.      @wp.angle = rand(360)
  527.      @wp.x = rand(@cw2[0])
  528.      @wp.y = rand(@ch2[0])
  529.      @wp.opacity = 1
  530.      @wp.zoom_x = (rand(100) + 100) / 100.0
  531.      @wp.zoom_y = @wp.zoom_x
  532.      @wp.blend_type = 1     
  533.      @opacity_speed = 10
  534.      @zoom_speed = -0.01
  535. end

  536. #--------------------------------------------------------------------------
  537. # ● Rain
  538. #--------------------------------------------------------------------------                          
  539. def rain
  540.      @wp.x = rand(@cw2[0])      
  541.      if @start == nil
  542.         @wp.y = rand(@ch2[0])
  543.         @start = true
  544.      else
  545.         @wp.y = @ch2[1]        
  546.      end   
  547.      @wp.opacity = 1
  548.      @wp.zoom_y = (rand(50) + 100) / 100.0
  549.      @wp.zoom_x = (rand(25) + 100) / 100.0
  550.      @y_speed = [[rand(10) + 10, 10].max, 20].min
  551.      @opacity_speed = 10
  552. end   

  553. #--------------------------------------------------------------------------
  554. # ● Fog
  555. #--------------------------------------------------------------------------                           
  556. def fog
  557.      rand_angle = rand(2)
  558.      @wp.angle = rand_angle == 1 ? 180 : 0
  559.      @wp.x = rand(@cw2[0])
  560.      @wp.y = rand(@ch2[0])
  561.      @wp.opacity = 1
  562.      @wp.zoom_x = (rand(100) + 50) / 100.0
  563.      @wp.zoom_y = @wp.zoom_x
  564.      @x_speed = [[rand(10), 1].max, 10].min
  565.      @opacity_speed = 10
  566. end

  567. #--------------------------------------------------------------------------
  568. # ● Light
  569. #--------------------------------------------------------------------------                           
  570. def light
  571.      @wp.angle = rand(360)
  572.      @wp.x = rand(@cw2[0])
  573.      @wp.y = rand(@ch2[0])
  574.      @wp.opacity = 1
  575.      @wp.zoom_x = (rand(100) + 50) / 100.0
  576.      @wp.zoom_y = @wp.zoom_x
  577.      @wp.blend_type = 1
  578.      @angle_speed = [[rand(3), 1].max, 3].min
  579.      @y_speed = -[[rand(10), 1].max, 10].min
  580.      @opacity_speed = 2
  581. end

  582. #--------------------------------------------------------------------------
  583. # ● Wind
  584. #--------------------------------------------------------------------------                          
  585. def wind
  586.      @wp.angle = rand(360)
  587.      @wp.x = rand(@cw2[0])
  588.      @wp.y = rand(@ch2[0])
  589.      @wp.opacity = 1
  590.      @wp.zoom_x = (rand(100) + 50) / 100.0
  591.      @wp.zoom_y = @wp.zoom_x
  592.      @x_speed = [[rand(10), 1].max, 10].min
  593.      @y_speed = [[rand(10), 1].max, 10].min
  594.      @opacity_speed = 10
  595. end   
  596.       
  597. #--------------------------------------------------------------------------
  598. # ● Random
  599. #--------------------------------------------------------------------------                          
  600. def random
  601.      @wp.angle = rand(360)
  602.      @wp.x = rand(@cw2[0])
  603.      @wp.y = rand(@ch2[0])
  604.      @wp.opacity = 1
  605.      @wp.zoom_x = (rand(100) + 50) / 100.0
  606.      @wp.zoom_y = @wp.zoom_x
  607.      x_s = [[rand(10), 1].max, 10].min
  608.      y_s = [[rand(10), 1].max, 10].min
  609.      rand_x = rand(2)
  610.      rand_y = rand(2)
  611.      @x_speed = rand_x == 1 ? x_s : -x_s
  612.      @y_speed = rand_y == 1 ? y_s : -y_s      
  613.      @opacity_speed = 10
  614. end   

  615. end

  616. #==============================================================================
  617. # ■ Module Weather EX
  618. #==============================================================================
  619. module Module_Weather_EX
  620.   
  621. #--------------------------------------------------------------------------
  622. # ● Create Weather EX
  623. #--------------------------------------------------------------------------                  
  624.   def create_weather_ex
  625.       dispose_weather_ex
  626.       create_weather_sprite     
  627.   end
  628.   
  629. #--------------------------------------------------------------------------
  630. # ● Dispose Wheater EX
  631. #--------------------------------------------------------------------------                     
  632.   def dispose_weather_ex
  633.       dispose_weather_ex_sprite
  634.   end

  635. #--------------------------------------------------------------------------
  636. # ● Create Weather Sprite
  637. #--------------------------------------------------------------------------                       
  638.   def create_weather_sprite
  639.       dispose_weather_ex_sprite
  640.       @old_weather = $game_system.weather
  641.       return if $game_system.weather == [] or $game_system.weather[0] == -1
  642.       @weather_ex = []
  643.       @weather_oxy = [$game_map.display_x * 32,
  644.                       $game_map.display_y * 32]      
  645.       index = 0
  646.       power_efic = MOG_WEATHER_EX::WEATHER_POWER_EFIC
  647.       power_efic = 1 if power_efic < 1
  648.       power = [[$game_system.weather[1] * power_efic, power_efic].max, 999].min
  649.       for i in 0...power
  650.           @weather_ex.push(Weather_EX.new(@viewport_weather,$game_system.weather[0],$game_system.weather[2],index, @viewport1.ox, @viewport1.oy))
  651.           index += 1
  652.       end            
  653.   end
  654.   
  655. #--------------------------------------------------------------------------
  656. # ● Dispose Weather EX
  657. #--------------------------------------------------------------------------                  
  658.   def dispose_weather_ex_sprite
  659.       return if @weather_ex == nil
  660.       index = 0
  661.       for i in @weather_ex
  662.           $game_temp.weather_ex_set[index] = [] if $game_temp.weather_ex_set[index] == nil
  663.           $game_temp.weather_ex_set[index].push(i.x,i.y,i.opacity,i.angle,i.zoom_x)
  664.           i.dispose_weather
  665.           index += 1
  666.       end
  667.       @weather_ex.each {|sprite| sprite.dispose_weather}  
  668.       @weather_ex = nil
  669.   end
  670.   
  671. #--------------------------------------------------------------------------
  672. # ● Dispose Refresh
  673. #--------------------------------------------------------------------------                    
  674.   def dispose_refresh
  675.       $game_temp.weather_ex_set.clear
  676.       return if @weather_ex == nil
  677.       @weather_ex.each {|sprite| sprite.dispose_weather}
  678.       @weather_ex = nil
  679.   end  
  680.   
  681. #--------------------------------------------------------------------------
  682. # ● Update Weather EX
  683. #--------------------------------------------------------------------------                  
  684.   def update_weather_ex
  685.       $game_temp.weather_rf_time -= 1 if $game_temp.weather_rf_time > 0
  686.       refresh_weather_ex if $game_temp.weather_rf_time == 0
  687.       return if @weather_ex == nil
  688.       @weather_ex.each {|sprite| sprite.update_weather(@viewport_weather.ox,@viewport_weather.oy)}
  689.   end
  690.   
  691. #--------------------------------------------------------------------------
  692. # ● Refresh Weather EX
  693. #--------------------------------------------------------------------------                     
  694.   def refresh_weather_ex
  695.       return if @old_weather == nil
  696.       return if @old_weather == $game_system.weather
  697.       dispose_refresh      
  698.       create_weather_sprite
  699.   end  
  700.    
  701. end  

  702. #==============================================================================
  703. # ■ Spriteset Map
  704. #==============================================================================
  705. class Spriteset_Map
  706.    include Module_Weather_EX  
  707.    
  708. #--------------------------------------------------------------------------
  709. # ● Initialize
  710. #--------------------------------------------------------------------------                  
  711.   alias mog_weather_ex_initialize initialize
  712.   def initialize
  713.       dispose_weather_ex   
  714.       mog_weather_ex_initialize
  715.       create_weather_ex
  716.   end

  717. #--------------------------------------------------------------------------
  718. # ● Dispose
  719. #--------------------------------------------------------------------------                  
  720.   alias mog_weather_ex_dispose dispose
  721.   def dispose
  722.       dispose_weather_ex   
  723.       mog_weather_ex_dispose
  724.   end  

  725. #--------------------------------------------------------------------------
  726. # ● Update
  727. #--------------------------------------------------------------------------                  
  728.   alias mog_weather_ex_update update
  729.   def update
  730.       mog_weather_ex_update
  731.       update_weather_ex
  732.   end  
  733.    
  734. end

  735. if MOG_WEATHER_EX::WEATHER_BATTLE
  736. #==============================================================================
  737. # ■ Spriteset Battle
  738. #==============================================================================
  739. class Spriteset_Battle
  740.   
  741.    include Module_Weather_EX  
  742.    
  743. #--------------------------------------------------------------------------
  744. # ● Initialize
  745. #--------------------------------------------------------------------------                  
  746.   alias mog_weather_ex_initialize initialize
  747.   def initialize
  748.       dispose_weather_ex   
  749.       mog_weather_ex_initialize
  750.       create_weather_ex
  751.   end

  752. #--------------------------------------------------------------------------
  753. # ● Dispose
  754. #--------------------------------------------------------------------------                  
  755.   alias mog_weather_ex_dispose dispose
  756.   def dispose
  757.       mog_weather_ex_dispose
  758.       dispose_weather_ex
  759.   end  

  760. #--------------------------------------------------------------------------
  761. # ● Update
  762. #--------------------------------------------------------------------------                  
  763.   alias mog_weather_ex_update update
  764.   def update
  765.       mog_weather_ex_update
  766.       update_weather_ex
  767.   end   
  768.    
  769. end

  770. end

  771. #=============================================================================
  772. # ■ Scene Base
  773. #=============================================================================
  774. class Scene_Base
  775.   
  776.   #--------------------------------------------------------------------------
  777.   # ● Weather Recover Data
  778.   #--------------------------------------------------------------------------  
  779.   def weather_recover_data
  780.       if $game_system.weather.empty? or
  781.           $game_system.weather[0] == -1
  782.           if !$game_system.weather_restore.empty? and
  783.              $game_system.weather_restore[0] != -1
  784.              v = $game_system.weather_restore
  785.              $game_system.weather = [v[0],v[1],v[2]]
  786.           end
  787.       end         
  788.   end
  789.   
  790.   #--------------------------------------------------------------------------
  791.   # ● Weather Restore
  792.   #--------------------------------------------------------------------------      
  793.   def weather_recover_scene
  794.       return if $game_system.weather_temp.empty?
  795.       return if $game_system.weather_temp[0] == -1
  796.       w = $game_system.weather_temp
  797.       $game_system.weather = [w[0],w[1],w[2]]
  798.       $game_system.weather_temp.clear
  799.       $game_system.weather_temp = [-1,0,""]
  800.   end  

  801.   #--------------------------------------------------------------------------
  802.   # ● Main
  803.   #--------------------------------------------------------------------------         
  804.   alias mog_weather_ex_main main
  805.   def main
  806.       dispose_weather_ex_base
  807.       weather_recover_scene if can_recover_weather_scene?
  808.       mog_weather_ex_main
  809.   end   
  810.   
  811.   #--------------------------------------------------------------------------
  812.   # ● Can Recover Weather Scene
  813.   #--------------------------------------------------------------------------         
  814.   def can_recover_weather_scene?
  815.       return true if SceneManager.scene_is?(Scene_Map)
  816.       return true if SceneManager.scene_is?(Scene_Battle)
  817.       return false
  818.   end  
  819.   
  820.   #--------------------------------------------------------------------------
  821.   # ● terminate
  822.   #--------------------------------------------------------------------------         
  823.   alias mog_weather_ex_terminate_base terminate
  824.   def terminate
  825.       mog_weather_ex_terminate_base
  826.       dispose_weather_ex_base      
  827.   end  

  828.   #--------------------------------------------------------------------------
  829.   # ● Dispose Weather EX Base
  830.   #--------------------------------------------------------------------------           
  831.   def dispose_weather_ex_base
  832.       return if @spriteset == nil
  833.       @spriteset.dispose_weather_ex rescue nil
  834.   end        
  835.   
  836. end

  837. #=============================================================================
  838. # ■ Sprite Battle
  839. #=============================================================================
  840. class Spriteset_Battle  

  841.   #--------------------------------------------------------------------------
  842.   # ● Dispose
  843.   #--------------------------------------------------------------------------           
  844.   alias mog_weather_ex_aft_dispose dispose
  845.   def dispose
  846.       force_stop_weather_ex_after_battle
  847.       mog_weather_ex_aft_dispose
  848.   end

  849.   #--------------------------------------------------------------------------
  850.   # ● Force Stop Weather EX After
  851.   #--------------------------------------------------------------------------           
  852.   def force_stop_weather_ex_after_battle
  853.       return if !$game_temp.weather_fstop
  854.       $game_temp.weather_fstop = false
  855.       $game_temp.weather_fade = false
  856.       $game_system.weather.clear
  857.       $game_system.weather = [-1,0,""]
  858.       $game_system.weather_restore  = [-1,0,""]
  859.       $game_system.weather_temp = [-1,0,""]      
  860.   end
  861.    
  862.   
  863. end

  864. #=============================================================================
  865. # ■ Scene Load
  866. #=============================================================================
  867. class Scene_Load < Scene_File
  868.   
  869.   #--------------------------------------------------------------------------
  870.   # ● On Load Success
  871.   #--------------------------------------------------------------------------
  872.   alias mog_weather_ex_on_load_success on_load_success
  873.   def on_load_success
  874.       mog_weather_ex_on_load_success
  875.       weather_recover_data
  876.   end
  877. end

  878. #=============================================================================
  879. # ■ Scene Manager
  880. #=============================================================================
  881. class << SceneManager
  882.   
  883.   #--------------------------------------------------------------------------
  884.   # ● Call
  885.   #--------------------------------------------------------------------------         
  886.   alias mog_weather_ex_call call
  887.   def call(scene_class)
  888.       weather_dispose
  889.       mog_weather_ex_call(scene_class)
  890.   end
  891.   
  892.   #--------------------------------------------------------------------------
  893.   # ● Weather Restore
  894.   #--------------------------------------------------------------------------      
  895.   def weather_dispose
  896.       return if $game_system.weather.empty?
  897.       return if $game_system.weather[0] == -1
  898.       w = $game_system.weather
  899.       $game_system.weather_temp = [w[0],w[1],w[2]]
  900.       $game_system.weather.clear
  901.       $game_system.weather = [-1,0,""]
  902.   end   
  903.   
  904. end
复制代码
回复

使用道具 举报

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

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部