king-exit/Scripts/_.78.rb
2024-08-31 14:17:23 -05:00

107 lines
No EOL
3.5 KiB
Ruby
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

=begin
RGSS3
★ 戦闘内天候持ち越し ★
天候を戦闘にも反映させます。
ver1.00
Last Update : 2011/12/17
12/17 : RGSS2からの移植
ろかん   http://kaisou-ryouiki.sakura.ne.jp/
=end
#===================================
# ●設定箇所
#===================================
module BattleWeather
# 戦闘中に天候が変更された場合、戦闘後のマップにも反映させるかどうか
BCEMW = false
end
#===================================
# ここまで
#===================================
$rsi ||= {}
$rsi["戦闘内天候持ち越し"] = true
class Game_Screen
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_writer :weather_type
attr_writer :weather_power
end
class Game_Interpreter
#--------------------------------------------------------------------------
# ● 天候の設定 ※再定義
#--------------------------------------------------------------------------
def command_236
screen.change_weather(@params[0], @params[1], @params[2])
wait(@params[2]) if @params[3]
end
end
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● インクルード BattleWeather
#--------------------------------------------------------------------------
include BattleWeather
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias battle_weather_initialize initialize
def initialize
battle_weather_initialize
create_weather
end
#--------------------------------------------------------------------------
# ● 天候の作成
#--------------------------------------------------------------------------
def create_weather
$game_troop.screen.weather_type = $game_map.screen.weather_type
$game_troop.screen.weather_power = $game_map.screen.weather_power
@weather = Spriteset_Weather.new(@viewport2)
@weather.update
Graphics.update
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
alias battle_weather_dispose dispose
def dispose
if BCEMW
$game_map.screen.weather_type = @weather.type
$game_map.screen.weather_power = @weather.power
end
dispose_weather
battle_weather_dispose
end
#--------------------------------------------------------------------------
# ● 天候の解放
#--------------------------------------------------------------------------
def dispose_weather
@weather.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias update_battle_weather update
def update
update_battle_weather
update_weather
end
#--------------------------------------------------------------------------
# ● 天候の更新
#--------------------------------------------------------------------------
def update_weather
if @weather
@weather.type = $game_troop.screen.weather_type
@weather.power = $game_troop.screen.weather_power
@weather.update
end
end
end