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

56 lines
No EOL
1.8 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.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#==============================================================================
# ■ RGSS3 多方向シェイク Ver1.00 by 星潟
#------------------------------------------------------------------------------
# 通常の画面のシェイクを、特定のイベントコマンドを記入する事で
# 多方向シェイクへと変化させます。
#
# イベントコマンドでshake_type(n)と記入して下さい。
# nを0とすると通常のシェイクになります。
# nを1とすると多方向シェイクになります。
#==============================================================================
module SHAKE_Y
#多方向シェイクをマップ画面で有効にするかtrue 有効/false 無効)
MAP = true
#多方向シェイクを戦闘画面で有効にするかtrue 有効/false 無効)
#trueの場合、パーティー内キャラクターがダメージを受けた際のシェイクも多方向化されます。
BATTLE = true
end
class Spriteset_Map
alias update_viewports_y_shake update_viewports
def update_viewports
shake_y if SHAKE_Y::MAP && $game_party.shake_y != 0
update_viewports_y_shake
end
def shake_y
@viewport1.oy = rand(2) > 0 ? - $game_map.screen.shake : $game_map.screen.shake if rand(3) > 0
end
end
class Spriteset_Battle
alias update_viewports_y_shake update_viewports
def update_viewports
shake_y if SHAKE_Y::BATTLE && $game_party.shake_y != 0
update_viewports_y_shake
end
def shake_y
@viewport1.oy = rand(2) > 0 ? - $game_troop.screen.shake : $game_troop.screen.shake if rand(3) > 0
end
end
class Game_Interpreter
def shake_type(n)
$game_party.shake_y = n
end
end
class Game_Party < Game_Unit
attr_accessor :shake_y
def shake_y
if @shake_y == nil
@shake_y = 0
end
return @shake_y
end
end