#=========================================================================== # ◆ A1 Scripts ◆ # 話しかける時のみ向き固定(RGSS3) # # バージョン : 1.00 (2012/01/01) # 作者 : A1 # URL     : http://a1tktk.web.fc2.com/ #--------------------------------------------------------------------------- # 機能: # ・話しかける時のみ向き固定にします #--------------------------------------------------------------------------- # 更新履歴   :2012/01/01 Ver1.00 リリース #--------------------------------------------------------------------------- # 設置場所 #  特になし # # 必要スクリプト # なし #--------------------------------------------------------------------------- # 使い方 # イベントの名前に記述 # # イベント名[P(no)EDF] # no:イベントページNo # # 例:イベント名[P1EDF] # イベントページ番号1が話しかける時のみ向き固定になります # # 例:イベント名[P0EDF] # 全てのイベントページが話しかける時のみ向き固定になります #============================================================================== $imported ||= {} $imported["A1_EventDirectionFix"] = true #============================================================================== # ■ RPG::Event::Page #============================================================================== class RPG::Event::Page #-------------------------------------------------------------------------- # ○ 話しかける時のみ向き固定 #-------------------------------------------------------------------------- def event_direction_fix=(flag) @event_direction_fix = flag end #-------------------------------------------------------------------------- # ○ 話しかける時のみ向き固定 #-------------------------------------------------------------------------- def event_direction_fix @event_direction_fix ||= false return @event_direction_fix end end #============================================================================== # ■ RPG::Event #============================================================================== class RPG::Event #-------------------------------------------------------------------------- # ○ 話しかける時のみ向き固定の設定 #-------------------------------------------------------------------------- def setup_pages_edf @name.scan(/\[P(\d+)EDF\]/).each {|info| page_no = info[0].to_i return change_all_edf if page_no == 0 change_edf(@pages[page_no - 1]) } end #-------------------------------------------------------------------------- # ○ 全ての話しかける時のみ向き固定の設定を変更 #-------------------------------------------------------------------------- def change_all_edf @pages.each {|page| change_edf(page) } end #-------------------------------------------------------------------------- # ○ 話しかける時のみ向き固定の設定を変更 #-------------------------------------------------------------------------- def change_edf(page) return if page == nil page.event_direction_fix = true end end #============================================================================== # ■ Game_Event #------------------------------------------------------------------------------ #  イベントを扱うクラスです。条件判定によるイベントページ切り替えや、並列処理 # イベント実行などの機能を持っており、Game_Map クラスの内部で使用されます。 #============================================================================== class Game_Event < Game_Character #-------------------------------------------------------------------------- # ☆ オブジェクト初期化 # event : RPG::Event #-------------------------------------------------------------------------- alias a1_event_direction_fix_ge_initialize initialize def initialize(map_id, event) event.setup_pages_edf a1_event_direction_fix_ge_initialize(map_id, event) end #-------------------------------------------------------------------------- # ☆ イベントページの設定をセットアップ #-------------------------------------------------------------------------- alias a1_event_direction_fix_ge_setup_page_settings setup_page_settings def setup_page_settings a1_event_direction_fix_ge_setup_page_settings @event_direction_fix = @page.event_direction_fix end #-------------------------------------------------------------------------- # ☆ ロック(実行中のイベントが立ち止まる処理) #-------------------------------------------------------------------------- alias a1_edf_ge_lock lock def lock a1_edf_ge_lock @direction = @prelock_direction if @event_direction_fix end end