lunariafantasia/Scripts/_.28.rb
2024-01-12 03:12:38 -06:00

32 lines
No EOL
1.4 KiB
Ruby
Raw 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.

#==============================================================================
# ■ Game_Interpreter
#------------------------------------------------------------------------------
#  イベントコマンドを実行するインタプリタです。このクラスは Game_Map クラス、
# Game_Troop クラス、Game_Event クラスの内部で使用されます。
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# マップの手動スクロール dir 2=>下、4=>左、6=>右、8=>上
# a 開始点  b 終着点  speed 速度  hor 横移動か?
#--------------------------------------------------------------------------
#def self_scroll(dir, dis, speed)
def self_scroll(a, b, speed, hor = true)
return if $game_party.in_battle
Fiber.yield while $game_map.scrolling?
dis = a - b
return if dis == 0
if hor
dir = dis > 0 ? 4 : 6
else
dir = dis > 0 ? 8 : 2
end
$game_map.start_scroll(dir, dis.abs, speed)
end
#--------------------------------------------------------------------------
# スクロールが終了するまで待機
#--------------------------------------------------------------------------
def stay_scroll
Fiber.yield while $game_map.scrolling?
end
end