#=========================================================================== # ◆ A1 Scripts ◆ # 向き固定時のイベント起動判定(RGSS3) # # バージョン : 1.00 (2011/12/31) # 作者 : A1 # URL     : http://a1tktk.web.fc2.com/ #--------------------------------------------------------------------------- # 機能: # ・向き固定で可動のイベント起動判定を、イベントの進行方向で判定します #--------------------------------------------------------------------------- # 更新履歴   :2011/12/31 Ver1.00 リリース #--------------------------------------------------------------------------- # 設置場所 #  特になし # # 必要スクリプト # なし #--------------------------------------------------------------------------- # 使い方 # このイベントを設置することで適用されます #--------------------------------------------------------------------------- # 補足 # トリガー「イベントから接触」のデフォルトでは # イベントが向いている方向にプレイヤーがいることが条件ですので # 向き固定のまま動くイベントでは少々不都合がありました #============================================================================== $imported ||= {} $imported["A1_EventTrigger"] = true #============================================================================== # ■ Game_CharacterBase #------------------------------------------------------------------------------ #  キャラクターを扱う基本のクラスです。全てのキャラクターに共通する、座標やグ # ラフィックなどの基本的な情報を保持します。 #============================================================================== class Game_CharacterBase #-------------------------------------------------------------------------- # ☆ 非公開メンバ変数の初期化 #-------------------------------------------------------------------------- alias a1_fix_direction_gcb_init_private_members init_private_members def init_private_members a1_fix_direction_gcb_init_private_members @fix_direction = 2 end #-------------------------------------------------------------------------- # ☆ 指定方向に向き変更 # d : 方向(2,4,6,8) #-------------------------------------------------------------------------- alias a1_fix_direction_gcb_set_direction set_direction def set_direction(d) @fix_direction = d if @direction_fix && d != 0 a1_fix_direction_gcb_set_direction(d) end #-------------------------------------------------------------------------- # ☆ 正面の接触イベントの起動判定 #-------------------------------------------------------------------------- alias a1_fix_direction_gcb_check_event_trigger_touch_front check_event_trigger_touch_front def check_event_trigger_touch_front return a1_fix_direction_gcb_check_event_trigger_touch_front if !@direction_fix x2 = $game_map.round_x_with_direction(@x, @fix_direction) y2 = $game_map.round_y_with_direction(@y, @fix_direction) check_event_trigger_touch(x2, y2) end end