질문과 답변

Extra Form

최근 라이딩 스크립트를 얻게 되었습니다.

용을 타고 다니는 건데

시작하는 맵에서만 작동이 되더라더군요

그래서 이벤트로 스크립트를 사용하면 될줄 알았는데

이벤 트 스크립트에서는 스크립트 입력 이 안 됩니다.

그러니 점 도와주세요.....

 

혹시나 해서 라이딩은 올려 놨습니다.

 

%라이딩 스크립트가 있고

 

 

#==============================================================================
#
# ■?り物?張 □Ver. 2.81 □製作者:月紳士
# ?RPGツク?ルVX用 RGSS2スクリプト
#
#    ●…書き換えメソッド(競合注意) ◎…メソッドのエイリアス ○…新規メソッド
#
#  ※二次配布禁止!配布元には利用規約があります。必ずそちらを見てください。
#------------------------------------------------------------------------------
# 更新履?
#  Ver. 2.81  茂みによるエンカウント?加が飛行中に適用されないよう修正。
#  Ver. 2.80  ?り物ステ?トの機能を追加。
#  Ver. 2.70  エンカウントしない?り物機能が未??だった?、追加。
#  Ver. 2.63  前回の修正が不十分だったことによる不具合を再修正。
#  Ver. 2.62  イベント?り物を?り?いだ際に再度?れなくなる不具合を修正。
#  Ver. 2.61  下記更新の微調整。
#  Ver. 2.60  HARTS HORN?の「隊列?行スクリプト」?用動作の修正と
#             月紳士のスクリプト【パ?ティ?メンバ?の追?】?用時用の更新。
#  Ver. 2.51  スクリプトの見直しと細かい動作修正。
#  Ver. 2.50  ?り物に?った?態でのセ?ブ?ロ?ド時の不具合を解消。
#
#   ※これ以前の更新履?はマニュアルを?考にしてください。
#==============================================================================
=begin
 
 このスクリプトで追加されるのは以下の機能です。

  ○馬、大型飛行船、魔法の絨?というみっつの新しい?り物を追加。

  ○キャラクタ?が上に?る、騎?タイプの?り物を作成できる。

  ○イベントにプレイヤ?を?り?ませたり、騎?させたりできる。

  ○イベントにイベントを騎?させることができる。

  ○システムの?用にて、イベントを持ち上げる、運ぶ、といったことも可能に。


 ※ 詳しい?明はマニュアルをご?ください。

=end

#==============================================================================
# □ ?り物?張?モジュ?ル(カスタマイズ項目)
#==============================================================================

module Expansion_Vehicle
 
 # 馬の初期設定 # -----------------------------------------------------

  # 初期配置するマップのID/X座標/Y座標
    HORSE_MAP_ID = 0                    
    HORSE_X = 0
    HORSE_Y = 0

  # ?像ファイルの名前/?像ファイルのINDEX
    HORSE_FILE_NAME = "Animal"          
    HORSE_FILE_INDEX = 5

  # BGMファイルの名前
    HORSE_BGM_NAME = "만주의 매 (놈놈놈 OST)"             

 # 大型飛行船の初期設定 # ----------------------------------------------

  # 初期配置するマップのID/X座標/Y座標
    BIG_AIRSHIP_MAP_ID = 1
    BIG_AIRSHIP_X = 11
    BIG_AIRSHIP_Y = 10

  # ?像ファイルの名前/?像ファイルのINDEX
    BIG_AIRSHIP_FILE_NAME = "$Wivern"
    BIG_AIRSHIP_FILE_INDEX = 0

  # BGMファイルの名前
    BIG_AIRSHIP_BGM_NAME = "Scene9"    

 # 魔法の絨?の初期設定 # ----------------------------------------------

  # 初期配置するマップのID/X座標/Y座標
    MAGIC_CARPET_MAP_ID = 0
    MAGIC_CARPET_X = 0
    MAGIC_CARPET_Y = 0

  # ?像ファイルの名前/?像ファイルのINDEX
    MAGIC_CARPET_FILE_NAME = "Ride"
    MAGIC_CARPET_FILE_INDEX = 6

  # BGMファイルの名前
    MAGIC_CARPET_BGM_NAME = "Airship"    

 # その他の設定 # ------------------------------------------------------
   
  # エンカウントしない?り物のID
    NOT_ENCOUNTER_VEHICIE_ID = [0, 1, 2, 3, 4, 5]
    # ID = 0:小型船/1:大型船/2:飛行船/3:馬/4:大型飛行船/5:魔法の絨?
   
  # ?り物ステ?ト
    BOAT_STATE         = []  # 小型船
    SHIP_STATE         = []  # 大型船
    AIRSHIP_STATE      = []  # 飛行船
    HORSE_STATE        = []  # 馬
    BIG_AIRSHIP_STATE  = []  # 大型飛行船
    MAGIC_CARPET_STATE = []  # 魔法の絨?
     
end

#==============================================================================
# □ Riding_Data
#------------------------------------------------------------------------------
#  騎?時の?像?理に必要なデ?タを扱うクラスです。このクラスのインスタンスは
# $riding_data で?照されます。
#==============================================================================

class Riding_Data
  #--------------------------------------------------------------------------
  # ○ 騎?用キャラクタ??デ?タ
  #--------------------------------------------------------------------------
  #  @riding_pct_name      # 騎?時に重ねる?像のファイル名
  #                        # ※ ここを "self" にすると元?のキャラクタ??像を
  #                        #    騎?時に重ねる?像に使います。
  #  @riding_pct_index     # 騎?時に重ねる?像のインデックス
  #  @positioning_down     # 下向きの際の位置修正値
  #  @positioning_left     # 左向きの際の位置修正値
  #  @positioning_right    # 右向きの際の位置修正値(省略可?省略時は左向きの逆の値を使用)
  #  @positioning_up       # 上向きの際の位置修正値
  #  @priority_type        # 待機時のふさわしいプライオリティ(0 の時のみ設定)
  #  @object_type          # ?る側と?られる側の?理逆?(する場合のみtrueを定義)
  #                        # ※ 物を持ち上げる表現に使います。
  #--------------------------------------------------------------------------
  def make_ride_data
    # 騎馬
    @character_name = "Animal"
    @character_index = 5
    @riding_pct_name = "Ride"
    @riding_pct_index = 0
    @positioning_down = [[0, -18], [0, -17], [0, -18]]
    @positioning_left = [[4, -17], [4, -16], [4, -17]]
    @positioning_up = [[0, -15], [0, -14], [0, -15]]
    set_ride_data
   
    # オオカミ
    @character_name = "Animal"
    @character_index = 6
    @riding_pct_name = "Ride"
    @riding_pct_index = 1
    @positioning_down = [[0, -20], [0, -19], [0, -20]]
    @positioning_left = [[4, -16], [4, -15], [4, -16]]
    @positioning_up = [[0, -15], [0, -14], [0, -15]]
    set_ride_data
   
    # いかだ
    @character_name = "Ride"
    @character_index = 2
    @positioning_down = [[0, -13], [0, -12], [0, -11]]
    @positioning_left = [[0, -11], [0, -12], [0, -13]]
    @positioning_up = [[0, -15], [0, -14], [0, -13]]
    @priority_type = 0
    set_ride_data
   
    # フロ?ト
    @character_name = "Ride"
    @character_index = 5
    @positioning_down = [[0, -11], [0, -12], [0, -13]]
    @positioning_left = [[0, -11], [0, -12], [0, -13]]
    @positioning_up = [[0, -11], [0, -12], [0, -13]]
    @priority_type = 0
    set_ride_data
     
    # ペガサス
    @character_name = "Ride"
    @character_index = 3
    @riding_pct_name = "Ride"
    @riding_pct_index = 7
    @positioning_down = [[0, -19], [0, -20], [0, -21]]
    @positioning_left = [[4, -19], [4, -18], [4, -17]]
    @positioning_up = [[0, -15], [0, -14], [0, -13]]
    set_ride_data
   
    # トロッコ
    @character_name = "Vehicle"
    @character_index = 6
    @riding_pct_name = "Ride"
    @riding_pct_index = 4
    @positioning_down = [[0, -10], [0, -11], [0, -10]]
    @positioning_left = [[-2, -10], [-1, -10], [-2, -10]]
    @positioning_right = [[1, -10], [2, -10], [1, -10]]
    @positioning_up = [[0, -10], [0, -11], [0, -10]]
    set_ride_data
   
    # オブジェクト
    @character_name = "!$Object"
    @riding_pct_name = "self"
    @positioning_down = [[-1, -9], [0, -10], [1, -9]]
    @positioning_left = [[-6, -11], [-5, -10], [-4, -9]]
    @positioning_up = [[1, -11], [0, -12], [-1, -11]]
    @object_type = true
    set_ride_data
   
    # アイテム
    @character_name = "$Item"
    @riding_pct_name = "self"
    @positioning_down = [[-1, 1], [0, 0], [1, 1]]
    @positioning_left = [[-6, -1], [-5, 0], [-4, 1]]
    @positioning_up = [[1, -1], [0, -2], [-1, -1]]
    @object_type = true
    set_ride_data

    # 魔法の絨?
    @character_name = "Ride"
    @character_index = 6
    @positioning_down = [[0, -12], [0, -13], [0, -14]]
    @positioning_left = [[0, -10], [0, -11], [0, -12]]
    @positioning_up = [[0, -12], [0, -13], [0, -14]]
    @priority_type = 0
    set_ride_data
   
    # 飛?
    @character_name = "$Wivern"
    @character_index = 0
    @riding_pct_name = "$Wivern_Ride"
    @riding_pct_index = 0
    @positioning_down = [[0, -25], [0, -24], [0, -24]]
    @positioning_left = [[7, -19], [7, -19], [7, -20]]
    @positioning_up = [[0, -24], [0, -23], [0, -23]]
    set_ride_data
   
    # ランタン
    @character_name = "!Flame"
    @character_index = 1
    @riding_pct_name = "self"
    @positioning_down = [[-6, 5], [-5, 4], [-4, 5]]
    @positioning_left = [[-3, 3], [-2, 4], [-1, 5]]
    @positioning_up = [[7, 1], [8, 0], [7, -1]]
    @object_type = true
    set_ride_data
   
    # ?玉
    @character_name = "!Other1"
    @character_index = 6
    @riding_pct_name = "self"
    @positioning_down = [[-1, 12], [0, 11], [1, 12]]
    @positioning_left = [[-6, 10], [-5, 11], [-4, 12]]
    @positioning_up = [[1, 10], [0, 9], [-1, 10]]
    @object_type = true
    set_ride_data
   
    # ニワトリ
    @character_name = "Animal"
    @character_index = 2
    @riding_pct_name = "self"
    @positioning_down = [[-1, 2], [0, 1], [1, 2]]
    @positioning_left = [[-8, -1], [-7, 0], [-6, 1]]
    @positioning_up = [[1, -2], [0, -3], [-1, -2]]
    @object_type = true
    set_ride_data
  end
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス??(デ?タベ?ス項目の?明)
  #-------------------------------------------------------------------------- 
  # [character_name, character_index] をキ?としたハッシュとして
  #  他クラスより?照します。
  #--------------------------------------------------------------------------
  attr_accessor :data_riding_pct_name
  attr_accessor :data_riding_pct_index
  attr_accessor :data_positioning_down
  attr_accessor :data_positioning_left
  attr_accessor :data_positioning_right
  attr_accessor :data_positioning_up
  attr_accessor :data_priority_type
  attr_accessor :data_object_type
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    @data_riding_pct_name = {}
    @data_riding_pct_index = {}
    @data_positioning_down = {}
    @data_positioning_left = {}
    @data_positioning_right = {}
    @data_positioning_up = {}
    @data_priority_type = {}
    @data_object_type = {}
    clear
    make_ride_data
  end
  #--------------------------------------------------------------------------
  # ○ クリア
  #--------------------------------------------------------------------------
  def clear
    @character_name = ""
    @character_index = 0
    @riding_pct_name = ""
    @riding_pct_index = 0
    @positioning_down = [[0, 0], [0, 0], [0, 0]]
    @positioning_left = [[0, 0], [0, 0], [0, 0]]
    @positioning_right = nil
    @positioning_up = [[0, 0], [0, 0], [0, 0]]
    @priority_type = nil
    @object_type = false
  end
  #--------------------------------------------------------------------------
  # ○ 騎?用キャラクタ??デ?タベ?ス化
  #-------------------------------------------------------------------------- 
  def set_ride_data
    key = [@character_name, @character_index]
    @data_riding_pct_name[key] = @riding_pct_name
    @data_riding_pct_index[key] = @riding_pct_index
    @data_positioning_down[key] = @positioning_down
    @data_positioning_left[key] = @positioning_left
    if @positioning_right == nil
      @data_positioning_right[key] = [[], [], []]
      @data_positioning_right[key][0][0] = -@positioning_left[0][0]
      @data_positioning_right[key][0][1] = @positioning_left[0][1]
      @data_positioning_right[key][1][0] = -@positioning_left[1][0]
      @data_positioning_right[key][1][1] = @positioning_left[1][1]
      @data_positioning_right[key][2][0] = -@positioning_left[2][0]
      @data_positioning_right[key][2][1] = @positioning_left[2][1]
    else
      @data_positioning_right[key] = @positioning_right
    end
    @data_positioning_up[key] = @positioning_up
    @data_priority_type[key] = @priority_type
    @data_object_type[key] = @object_type
    clear
  end
end

#==============================================================================
# ■ Game_Vehicle
#------------------------------------------------------------------------------
#  ?り物を扱うクラスです。このクラスは Game_Map クラスの?部で使用されます。
# 現在のマップに?り物がないときは、マップ座標 (-1,-1) に設定されます。
#==============================================================================

class Game_Vehicle < Game_Character
  #--------------------------------------------------------------------------
  # ○ ?張の?り物のセッティング
  #      @move_speed : ?り物の速度
  #      @walk_anime : 移動時アニメ
  #      @step_anime : 停止時アニメ
  #--------------------------------------------------------------------------
  def riding_vehicle_settings
    case @type
    when 3 # 馬
      @map_id = Expansion_Vehicle::HORSE_MAP_ID
      @x = Expansion_Vehicle::HORSE_X
      @y = Expansion_Vehicle::HORSE_Y
      @character_name = Expansion_Vehicle::HORSE_FILE_NAME
      @character_index = Expansion_Vehicle::HORSE_FILE_INDEX
      @bgm = RPG::BGM.new
      @bgm.name  = Expansion_Vehicle::HORSE_BGM_NAME
     
      @move_speed = 5
      @walk_anime = true
      @step_anime = false
     
    when 4 # 大型飛行船
      @map_id = Expansion_Vehicle::BIG_AIRSHIP_MAP_ID
      @x = Expansion_Vehicle::BIG_AIRSHIP_X
      @y = Expansion_Vehicle::BIG_AIRSHIP_Y
      @character_name = Expansion_Vehicle::BIG_AIRSHIP_FILE_NAME
      @character_index = Expansion_Vehicle::BIG_AIRSHIP_FILE_INDEX
      @bgm = RPG::BGM.new
      @bgm.name = Expansion_Vehicle::BIG_AIRSHIP_BGM_NAME
     
      @move_speed = 5
      @walk_anime = true
      @step_anime = true
     
    when 5 # 魔法の絨?
      @map_id = Expansion_Vehicle::MAGIC_CARPET_MAP_ID
      @x = Expansion_Vehicle::MAGIC_CARPET_X
      @y = Expansion_Vehicle::MAGIC_CARPET_Y
      @character_name = Expansion_Vehicle::MAGIC_CARPET_FILE_NAME
      @character_index = Expansion_Vehicle::MAGIC_CARPET_FILE_INDEX
      @bgm = RPG::BGM.new
      @bgm.name = Expansion_Vehicle::MAGIC_CARPET_BGM_NAME
     
      @move_speed = 6
      @walk_anime = true
      @step_anime = true
    end
  end
  #--------------------------------------------------------------------------
  # ○ ?存の?り物のセッティング
  #      @move_speed : ?り物の速度
  #      @walk_anime : 移動時アニメ
  #      @step_anime : 停止時アニメ
  #--------------------------------------------------------------------------
  def tig_ev_vehicle_initialize
    case @type
    when 0 # 小型船
      @move_speed = 4
      @walk_anime = true
      @step_anime = true
    when 1 # 大型船
      @move_speed = 5
      @walk_anime = false
      @step_anime = true
    when 2 # 飛行船
      @move_speed = 5
      @walk_anime = true
      @step_anime = true
    end
  end
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス??
  #--------------------------------------------------------------------------
  attr_reader   :pattern                  # パタ?ン
  attr_reader   :bgm                      # ?り?み時BGM
  attr_accessor :priority_type            # プライオリティタイプ
  attr_accessor :move_speed               # 移動速度
  attr_accessor :walk_anime               # ?行アニメ
  attr_accessor :step_anime               # 足踏みアニメ
  attr_accessor :instant                  # 一時的な呼び出しフラグ
  #--------------------------------------------------------------------------
  # ◎ システム設定のロ?ド
  #--------------------------------------------------------------------------
  alias tig_ev_load_system_settings load_system_settings
  def load_system_settings
    tig_ev_load_system_settings
    tig_ev_vehicle_initialize
    riding_vehicle_settings
    @instant = false
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
                                     # 位置の調整
    if @driving
      @map_id = $game_map.map_id
      sync_with_player               
    elsif @map_id == $game_map.map_id
      moveto(@x, @y)
    end
                                     # プライオリティタイプ調整
    if [2, 4].include?(@type)         # 飛行船?大型飛行船の場合
      @priority_type = @driving ? 2 : vehicle_priority
    else                              # その他の?り物
      @priority_type = @driving ? 1 : vehicle_priority
    end
  end
  #--------------------------------------------------------------------------
  # ● フレ?ム更新
  #--------------------------------------------------------------------------
  def update
    super
   
    if [2, 4, 5].include?(@type)     # 飛行船?大型飛行船?魔法の絨?の場合
     
      case @type                     # タイプに合わせた最頂点の高さの取得
      when 2 ; height = 1
      when 4 ; height = 2
      when 5 ; height = 1
      end
     
      if @driving
        return if $game_player.follow_member_gathering == true
        if @altitude < MAX_ALTITUDE * height
          @altitude += 1             # 高度を上げる
        end
      elsif @altitude > 0
        @altitude -= 1               # 高度を下げる
        if @altitude == 0
          @priority_type = vehicle_priority   # 待機時のプライオリティに
          $game_player.ride_off_character
          $game_player.turn_down
          update_bush_depth
          turn_left
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # ◎ アニメカウントの更新
  #--------------------------------------------------------------------------
  alias tig_ev_update_animation update_animation unless $@
  def update_animation
    if riding_type? and rided_character == nil  # ?り?み最中のアニメをオフに
      @pattern = @original_pattern
      return
    end
    unless @driving or @altitude > 0           # ?り物未使用時のアニメをオフに
      @pattern = @original_pattern
      return
    end
    tig_ev_update_animation
  end
  #--------------------------------------------------------------------------
  # ◎ プレイヤ?との同期
  #--------------------------------------------------------------------------
  alias tig_ev_ve_sync_with_player sync_with_player
  def sync_with_player
    tig_ev_ve_sync_with_player
    @stop_count = $game_player.stop_count
                     # 停止時のアニメを正しくシンクロさせる?のカウント同期追加
   
  end
  #--------------------------------------------------------------------------
  # ◎ 移動可能判定
  #--------------------------------------------------------------------------
  alias tig_ev_ve_movable? movable?
  def movable?
    return false if (@type == 4 and @altitude < MAX_ALTITUDE * 2)
    return false if (@type == 5 and @altitude < MAX_ALTITUDE)
                                     # 上昇中、下降中ならば動けない(追加?り物)
    return tig_ev_ve_movable?
  end
  #--------------------------------------------------------------------------
  # ○ 待機中のプライオリティの取得
  #--------------------------------------------------------------------------
  def vehicle_priority
    key = [@character_name, @character_index]
    result = $riding_data.data_priority_type[key]
    return result == nil ? 1 : result
  end
  #--------------------------------------------------------------------------
  # ◎ ?面 Y 座標の取得
  #--------------------------------------------------------------------------
  alias tig_ev_ve_screen_y screen_y
  def screen_y
    if @type == 5
      super - altitude / 5           # 魔法の絨?を浮遊させる(高さの調節)
    else
      tig_ev_ve_screen_y
    end
  end
  #--------------------------------------------------------------------------
  # ● ?り物に?る
  #--------------------------------------------------------------------------
  def get_on
    @driving = true
    if [2, 4].include?(@type)     # 飛行船?大型飛行船の場合
      @priority_type = 2          # プライオリティを「通常キャラの上」に?更
    end
    @bgm.play if @bgm.name != ""  # BGM 開始 (設定されていなければ今の曲を??)
    add_vehicle_states
  end
  #--------------------------------------------------------------------------
  # ● ?り物から降りる
  #--------------------------------------------------------------------------
  def get_off
    @driving = false
    unless [2, 4, 5].include?(@type)     # 飛行船?大型飛行船?魔法の絨?の場合
      @priority_type = vehicle_priority   # 本?のプライオリティに?す
      $game_player.ride_off_character     # 騎??態の解除
    end
    @direction = 4
    remove_vehicle_state
  end
  #--------------------------------------------------------------------------
  # ○ ?り物ステ?トの取得
  #--------------------------------------------------------------------------
  def vehicle_states
    states = []
    case @type
    when 0 ; states = Expansion_Vehicle::BOAT_STATE
    when 1 ; states = Expansion_Vehicle::SHIP_STATE
    when 2 ; states = Expansion_Vehicle::AIRSHIP_STATE
    when 3 ; states = Expansion_Vehicle::HORSE_STATE
    when 4 ; states = Expansion_Vehicle::BIG_AIRSHIP_STATE
    when 5 ; states = Expansion_Vehicle::MAGIC_CARPET_STATE
    end
    return states
  end
  #--------------------------------------------------------------------------
  # ○ ?り物ステ?トの付加
  #--------------------------------------------------------------------------
  def add_vehicle_states
    for state in vehicle_states
      $game_party.members.each {|actor|actor.add_state(state)}
    end
  end
  #--------------------------------------------------------------------------
  # ○ ?り物ステ?トの解除
  #--------------------------------------------------------------------------
  def remove_vehicle_state
    for state in vehicle_states
      $game_party.members.each {|actor|actor.remove_state(state)}
    end
  end
  #--------------------------------------------------------------------------
  # ● 位置の?更 ※??指定を組み?み
  #       map_id : 移動先のマップID
  #            x : 移動先マップのX座標
  #            y : 移動先マップのY座標
  #    variables : ??指定するか?
  #--------------------------------------------------------------------------
  def set_location(map_id, x, y, variables = false)
   
    # ??で指定の場合
    if variables                           
      map_id = $game_variables[map_id]
      x = $game_variables[x]
      y = $game_variables[y]
    end
   
    @map_id = map_id
    @x = x
    @y = y
    refresh
  end
  #--------------------------------------------------------------------------
  # ○ ?り物を呼び出す
  #     here : true = プレ?ヤ?と同位置 false = プレ?ヤ?の目の前
  #--------------------------------------------------------------------------
  def call(test = false, here = false)
    return false if $game_player.event_vehicle_lock
   
    # ?象となる位置座標を取得                                            
    if here # この場
      x = $game_player.x
      y = $game_player.y
    else    # 目の前
      x = $game_map.x_with_direction($game_player.x, $game_player.direction)
      y = $game_map.y_with_direction($game_player.y, $game_player.direction)
    end
   
    # 飛行船進入禁止エリア(?張スクリプト設定)?で呼び出し禁止されているタイプ
    if $game_map.airship_obstacle_area != nil and
      $game_map.airship_obstacle_area.include?([x, y])            
      return false if Expansion_Vehicle::CAN_T_CALL.include?(@type)
    end
   
    # 他の?り物がそこにある?
    return false if $game_map.vehicle_pos_nt?(x, y)
   
    # タイプ別に通行判定?着陸判定
    case @type
    when 0  # 小型船
      can_call = $game_map.boat_passable?(x, y)
    when 1  # 大型船
      can_call = $game_map.ship_passable?(x, y)
    when 2  # 飛行船 
      can_call = $game_map.airship_land_ok?(x, y)
    when 3  # 馬
      can_call = $game_map.horse_passable?(x, y)
    when 4  # 大型飛行船
      can_call = $game_map.big_airship_land_ok?(x, y)
    when 5  # 魔法の絨?
      can_call = $game_map.airship_land_ok?(x, y)
    end
   
    # 判定に問題なければ?際に呼ぶ
    if can_call                                 
      set_location($game_map.map_id, x, y) unless test
      return true
    else
      return false
    end
  end
  #--------------------------------------------------------------------------
  # ○ この場に?り物を呼び出す
  #      このコマンドで呼んだ?り物は、降りた時に消えてしまう。
  #--------------------------------------------------------------------------
  def call_here
    call(false, true)
  end
  #--------------------------------------------------------------------------
  # ○ 目の前に?り物を呼び出せるかのテスト
  #--------------------------------------------------------------------------
  def call_test
    return call(true)
  end
  #--------------------------------------------------------------------------
  # ○ この場に?り物を呼び出せるかのテスト
  #--------------------------------------------------------------------------
  def call_test_here
    return call(true, true)
  end 
  #--------------------------------------------------------------------------
  # ○ 一時的に?り物を呼び出す
  #      このコマンドで呼んだ?り物は、降りた時に消えてしまう。
  #--------------------------------------------------------------------------
  def instant_call
    @instant = true
    call
  end
  #--------------------------------------------------------------------------
  # ○ この場に一時的に?り物を呼び出す
  #      このコマンドで呼んだ?り物は、降りた時に消えてしまう。
  #--------------------------------------------------------------------------
  def instant_call_here
    @instant = true
    call(false, true)
  end
end

#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
#  タイトル?面の?理を行うクラスです。
#==============================================================================

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # ◎ 各種ゲ?ムオブジェクトの作成
  #--------------------------------------------------------------------------
  alias tig_ev_create_game_objects create_game_objects
  def create_game_objects
    tig_ev_create_game_objects
    $riding_data = Riding_Data.new             # 騎?型キャラクタ?のデ?タ生成
  end
end

#==============================================================================
# ■ AudioFile
#------------------------------------------------------------------------------
#  BGM、BGS、ME、SE のス?パ?クラスです。
#==============================================================================

class RPG::AudioFile
  #--------------------------------------------------------------------------
  # ○ ファイル(ネ?ム)の?更
  #  名前の?更だけで曲を?更できるように
  #--------------------------------------------------------------------------
  def name=(name)
    @name = name
  end
end

#==============================================================================
# ■ Game_Map
#------------------------------------------------------------------------------
#  マップを扱うクラスです。スクロ?ルや通行可能判定などの機能を持っています。
# このクラスのインスタンスは $game_map で?照されます。
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス??
  #--------------------------------------------------------------------------
  attr_reader   :airship_obstacle_area            # 飛行船補助スクリプト連携用
  #--------------------------------------------------------------------------
  # ◎ セットアップ
  #     map_id : マップ ID
  # ※ ?り物を別マップに?り越した際の?理を追加
  #--------------------------------------------------------------------------
  alias tig_ev_setup setup
  def setup(map_id)
    tig_ev_setup(map_id)
   
    result = false
    if $game_player.vehicle_event_data != nil  # イベント?り物持ち越し時の?理
      # マップ?に?像?名前が同じイベントが存在するなら?り物を??する
      for event in @events.values
        if event.name == $game_player.vehicle_event_data[0] and
           event.character_name == $game_player.vehicle_event_data[1] and
           event.character_index == $game_player.vehicle_event_data[2]
          $game_player.vehicle_event_data[3] = event.id
          if event.riding_type?
            $game_player.ride_off_character
            $game_player.ride_on(event)
            key = [event.character_name, event.character_index]
          end
          $game_player.moveto($game_player.new_x, $game_player.new_y)
          event.sync_with_player
          result = true
          break
        end
      end
    end
    unless result
      event_vehicle_refresh     # イベント?り物の初期化(何も?っていない?態に)
    end

    interpreter.update
   
  end
  #--------------------------------------------------------------------------
  # ○ イベント?り物のリフレッシュ
  #--------------------------------------------------------------------------
  def event_vehicle_refresh
    $game_player.vehicle_event_data = nil
    $game_player.event_vehicle_lock = false
    if $game_player.vehicle_type == -1
      $game_player.ride_off_character
    end
  end
  #--------------------------------------------------------------------------
  # ◎ ?り物の作成
  #--------------------------------------------------------------------------
  alias tig_ev_create_vehicles create_vehicles
  def create_vehicles
    tig_ev_create_vehicles
    @vehicles[3] = Game_Vehicle.new(3)    # 馬
    @vehicles[4] = Game_Vehicle.new(4)    # 大型飛行船
    @vehicles[5] = Game_Vehicle.new(5)    # 魔法の絨?
  end
  #--------------------------------------------------------------------------
  # ○ 馬の取得
  #--------------------------------------------------------------------------
  def horse
    return @vehicles[3]
  end
  #--------------------------------------------------------------------------
  # ○  大型飛行船の取得
  #--------------------------------------------------------------------------
  def big_airship
    return @vehicles[4]
  end
  #--------------------------------------------------------------------------
  # ○  魔法の絨?の取得
  #--------------------------------------------------------------------------
  def magic_carpet
    return @vehicles[5]
  end
  #--------------------------------------------------------------------------
  # ○  プレイヤ?の?り物になっているイベントの取得
  #--------------------------------------------------------------------------
  def event_vehicle
    return nil if $game_player.vehicle_event_data == nil
    return @events[$game_player.vehicle_event_data[3]]
  end
  #--------------------------------------------------------------------------
  # ○ ?張?り物用の通行障害判定
  #     ※ 一部の?り物が通過することができないタイルのIDをここで指定。
  #--------------------------------------------------------------------------
  def ex_obstacle?(tile_id)
    if (2048..8191).include?(tile_id)
      tile_id -= ((tile_id - 2048) % 48)
    end
    return [157,
            160, 161, 162, 163, 164, 165, 166,
            168, 169, 170, 171, 172, 174, 175,
            184, 185, 186, 187, 188, 189, 190, 191,
            200, 201, 202, 203, 204, 205, 206, 207,
            208, 209, 210, 211, 212, 213, 214,
            216, 217, 218, 219, 220, 221, 222,
            226, 227, 228,
            232, 233, 234, 235, 236, 237, 238,
            241, 242,
            248, 249, 250, 251, 252, 253, 254, 255,
            2864, 3248, 3632, 4016,
            2912, 3296, 3680, 4064].include?(tile_id)
  end
  #--------------------------------------------------------------------------
  # ○ ?張?り物用の通行許可判定
  #   ※ 浮遊型?り物が越えることのできるタイルのIDをここで指定。
  #--------------------------------------------------------------------------
  def ex_pass?(tile_id)
    if (2048..8191).include?(tile_id)
      tile_id -= ((tile_id - 2048) % 48)
    end
    return [526, 527, 671, 679,
            2048, 2096, 2240, 2336,
            2432, 2528, 2624, 2720,
            1536,
            1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551,
            1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567,
            1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583,
            1624, 1625].include?(tile_id)
  end
  #--------------------------------------------------------------------------
  # ○ テ?ブル型オブジェクト判定
  #   ※ オブジェクト型?り物を置くことができるタイルのIDをここで指定。
  #--------------------------------------------------------------------------
  def ex_table?(tile_id)
    if (2048..8191).include?(tile_id)
      tile_id -= ((tile_id - 2048) % 48)
    end
    return [75, 131,
            350, 352, 353, 354, 355,
            680,
            3152, 3536, 3920, 4304].include?(tile_id)
  end
  #--------------------------------------------------------------------------
  # ○ 馬の通行可能判定
  #    ※ passable? メソッドを部分改造したものです。
  #--------------------------------------------------------------------------
  def horse_passable?(x, y, flag = 0x01)
    for event in events_xy(x, y)            # 座標が一致するイベントを調べる
      next if event.tile_id == 0            # グラフィックがタイルではない
      next if event.priority_type > 0       # [通常キャラの下] ではない
      next if event.through                 # すり?け?態
      pass = @passages[event.tile_id]       # 通行?性を取得
      next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
      return true if pass & flag == 0x00    # [○] : 通行可
      return false if pass & flag == flag   # [×] : 通行不可
    end
    for i in [2, 1, 0]                      # レイヤ?の上から順に調べる
      tile_id = @map.data[x, y, i]          # タイル ID を取得
      return false if tile_id == nil        # タイル ID 取得失敗 : 通行不可
      pass = @passages[tile_id]             # 通行?性を取得
      next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
     
      return false if ex_obstacle?(tile_id) ### ?張通行不可(特殊部分) ###
     
      return true if pass & flag == 0x00    # [○] : 通行可
      return false if pass & flag == flag   # [×] : 通行不可
    end
    return false                            # 通行不可
  end
  #--------------------------------------------------------------------------
  # ○ 魔法の絨?の通行可能判定
  #    ※ passable? メソッドを部分改造したものです。
  #--------------------------------------------------------------------------
  def magic_carpet_passable?(x, y, flag = 0x01)
    for event in events_xy(x, y)            # 座標が一致するイベントを調べる
      next if event.tile_id == 0            # グラフィックがタイルではない
      next if event.priority_type > 0       # [通常キャラの下] ではない
      next if event.through                 # すり?け?態
      pass = @passages[event.tile_id]       # 通行?性を取得
      next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
      return true if pass & flag == 0x00    # [○] : 通行可
      return false if pass & flag == flag   # [×] : 通行不可
    end
    for i in [2, 1, 0]                      # レイヤ?の上から順に調べる
      tile_id = @map.data[x, y, i]          # タイル ID を取得
      return false if tile_id == nil        # タイル ID 取得失敗 : 通行不可
      pass = @passages[tile_id]             # 通行?性を取得
      next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
     
      return false if ex_obstacle?(tile_id) ### ?張通行不可(特殊部分) ###
      return true if ex_pass?(tile_id)      ### ?張通行許可(特殊部分) ###
     
      return true if pass & flag == 0x00    # [○] : 通行可
      return false if pass & flag == flag   # [×] : 通行不可
    end
    return false                            # 通行不可
  end
  #--------------------------------------------------------------------------
  # ○ フロ?トの通行可能判定
  #    ※ passable? メソッドを部分改造したものです。
  #--------------------------------------------------------------------------
  def float_passable?(x, y, flag = 0x01)
#    for event in events_xy(x, y)            # 座標が一致するイベントを調べる
#      next if event.tile_id == 0            # グラフィックがタイルではない
#      next if event.priority_type > 0       # [通常キャラの下] ではない
#      next if event.through                 # すり?け?態
#      pass = @passages[event.tile_id]       # 通行?性を取得
#      next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
#      return true if pass & flag == 0x00    # [○] : 通行可
#      return false if pass & flag == flag   # [×] : 通行不可
#    end
    for i in [2, 1, 0]                      # レイヤ?の上から順に調べる
      tile_id = @map.data[x, y, i]          # タイル ID を取得
      return false if tile_id == nil        # タイル ID 取得失敗 : 通行不可
      pass = @passages[tile_id]             # 通行?性を取得
      next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
     
      return false if ex_obstacle?(tile_id) ### ?張通行不可(特殊部分) ###
      return true if ex_pass?(tile_id)      ### ?張通行許可(特殊部分) ###
     
      #return true if pass & flag == 0x00    # [○] : 通行可 # コメントアウト
      #return false if pass & flag == flag   # [×] : 通行不可 # コメントアウト
    end
    return false                            # 通行不可
  end
  #--------------------------------------------------------------------------
  # ○ オブジェクトの設置可能判定
  #    ※ passable? メソッドを部分改造したものです。
  #--------------------------------------------------------------------------
  def object_passable?(x, y, flag = 0x01)
    for event in events_xy(x, y)            # 座標が一致するイベントを調べる
      next if event.tile_id == 0            # グラフィックがタイルではない
      next if event.priority_type > 0       # [通常キャラの下] ではない
      next if event.through                 # すり?け?態
      pass = @passages[event.tile_id]       # 通行?性を取得
      next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
      return true if pass & flag == 0x00    # [○] : 通行可
      return false if pass & flag == flag   # [×] : 通行不可
    end
    for i in [2, 1, 0]                      # レイヤ?の上から順に調べる
      tile_id = @map.data[x, y, i]          # タイル ID を取得
      return false if tile_id == nil        # タイル ID 取得失敗 : 通行不可
      pass = @passages[tile_id]             # 通行?性を取得
      next if pass & 0x10 == 0x10           # [☆] : 通行に影響しない
      return true if pass & flag == 0x00    # [○] : 通行可
     
      return true if ex_table?(tile_id)     ### テ?ブル判定(特殊部分) ###

      #return true if pass & flag == 0x00    # [○] : 通行可 # コメントアウト     
      return false if pass & flag == flag   # [×] : 通行不可
    end
    return false                            # 通行不可
  end
  #--------------------------------------------------------------------------
  # ◎ 飛行船の着陸可能判定
  #     x : X 座標
  #     y : Y 座標
  #--------------------------------------------------------------------------
  alias tig_ev_airship_land_ok? airship_land_ok?
  def airship_land_ok?(x, y)
    if $game_player.now_vehicle == @vehicles[4]  # 現在の?り物が大型船ならば
      return big_airship_land_ok?(x, y)           # 大型飛行船の着陸可能判定
    else                                         # 飛行船の着陸可能判定
      return false if hide_tile?(x, y)            # 物陰には着地不可
      for i in [2, 1, 0]
        return false if ex_obstacle?(@map.data[x, y, i]) # ?張通行不可
      end
      return tig_ev_airship_land_ok?(x, y)       # 通常の着陸可能判定
    end
  end
  #--------------------------------------------------------------------------
  # ◎ 大型飛行船の着陸可能判定
  #     x : X 座標
  #     y : Y 座標
  #--------------------------------------------------------------------------
  def big_airship_land_ok?(x, y)
    return false if hide_tile?(x, y)   # 物陰には着地不可
    return passable?(x, y)             # 通常の通行判定
  end
  #--------------------------------------------------------------------------
  # ○ 物陰か?判定
  #     x : X 座標
  #     y : Y 座標
  #--------------------------------------------------------------------------
  def hide_tile?(x, y)
    tile_id = @map.data[x, y, 2]
    if tile_id != nil
      return @passages[tile_id] == 0x16
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ○ なんらかの?り物があるか?
  #     x : X 座標
  #     y : Y 座標
  #--------------------------------------------------------------------------
  def vehicle_pos_nt?(x, y)
    return true if boat.pos_nt?(x, y)
    return true if ship.pos_nt?(x, y)
    return true if airship.pos_nt?(x, y) and not airship.driving
    return true if horse.pos_nt?(x, y)
    return true if big_airship.pos_nt?(x, y) and not big_airship.driving
    return true if magic_carpet.pos_nt?(x, y)
    return false
  end
  #--------------------------------------------------------------------------
  # ◎ BGM / BGS 自動切り替え
  #    ※ ?り物を降りた際のBGM再開の?動を修正。
  #--------------------------------------------------------------------------
  alias tig_ev_autoplay autoplay
  def autoplay
    if $game_player.vehicle_type > -1            # ?り物時の自動演奏
      $game_player.now_vehicle.bgm.play
      $game_player.walking_bgm = @map.bgm
      unless @map.autoplay_bgm                   # マップBGMが未設定なら
        $game_player.walking_bgm.name = ""        # ?行再開時のBGMを無音に
      end
    else
      tig_ev_autoplay
    end
  end
end

#==============================================================================
# ■ Game_Character
#------------------------------------------------------------------------------
#  キャラクタ?を扱うクラスです。このクラスは Game_Player クラスと Game_Event
# クラスのス?パ?クラスとして使用されます。
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス??
  #--------------------------------------------------------------------------
  attr_reader   :altitude
  attr_reader   :stop_count
  attr_reader   :on_tile        # 壁タイル?張用ダミ?
  attr_reader   :turn_back      # 壁タイル?張用ダミ?
  attr_accessor :stop_count
  attr_accessor :riding_character_id
  attr_accessor :rided_character_id
  #--------------------------------------------------------------------------
  # ◎ オブジェクト初期化
  #--------------------------------------------------------------------------
  alias tig_ev_initialize initialize
  def initialize 
    tig_ev_initialize
    @riding_character_id = nil
    @rided_character_id = nil
    @altitude = 0
  end
  #--------------------------------------------------------------------------
  # ◎ 移動時の更新
  #    ※ 他のキャラクタ?への騎?時のアニメを停止させる。
  #--------------------------------------------------------------------------
  alias tig_ev_update_move update_move
  def update_move
    tig_ev_update_move
    if riding_character != nil           # 他のキャラクタ?へ騎?している場合
      key = [riding_character.character_name, riding_character.character_index]
      unless $riding_data.data_object_type[key]  # オブジェクトタイプでなければ
        @anime_count = 0
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ 騎?タイプの?り物か?(オブジェクトタイプ含む)
  #--------------------------------------------------------------------------
  def riding_type?
    key = [@character_name, @character_index]
    return $riding_data.data_riding_pct_name.key?(key)
  end
  #--------------------------------------------------------------------------
  # ○ オブジェクトタイプ(の?り物)か?
  #--------------------------------------------------------------------------
  def object_type?
    key = [@character_name, @character_index]
    return $riding_data.data_object_type.key?(key)
  end
  #--------------------------------------------------------------------------
  # ◎ キャラクタ?衝突判定
  #     x : X 座標
  #     y : Y 座標
  #    プレイヤ?と?り物を含め、通常キャラの衝突を?出する。
  #--------------------------------------------------------------------------
  alias tig_ev_collide_with_characters? collide_with_characters?
  def collide_with_characters?(x, y)
    if @priority_type == 1                     # 自分が通常キャラ
      if self.is_a?(Game_Player)                # プレイヤ?の場合
        if riding_character != nil              # 騎?している場合
          return true if $game_player.other_vehicle?(x, y) # その他の?り物と衝突  
        end
      else                                      # プレイヤ?以外の場合
        return true if $game_map.vehicle_pos_nt?(x, y) # ?り物と衝突
      end
    end
    return tig_ev_collide_with_characters?(x, y)
  end
  #--------------------------------------------------------------------------
  # ◎ ?面 Z 座標の取得
  #    ※ 騎?用?像追加により同位置?像が?える?、
  #       重なり順を座標に合わせて整理している。
  #--------------------------------------------------------------------------
  alias tig_ev_screen_z screen_z
  def screen_z
    if riding_character != nil
      return riding_character.screen_z + 1
    end
    return tig_ev_screen_z + (screen_y / 18) * 3  
  end   
  #--------------------------------------------------------------------------
  # ◎ 茂み深さの更新
  #    ※ 騎?したキャラクタ?に茂み?理がされるのを防ぐ。
  #--------------------------------------------------------------------------
  alias tig_ev_update_bush_depth update_bush_depth
  def update_bush_depth
    if self.is_a?(Game_Player) and $game_player.now_vehicle != nil
      return @bush_depth = 0
    elsif self.is_a?(Game_Vehicle) and @type == 5
      return @bush_depth = 0
    elsif riding_character != nil
      return @bush_depth = 0 unless riding_character.object_type?
    end
    return tig_ev_update_bush_depth
  end
  #--------------------------------------------------------------------------
  # ○ 他のキャラクタ?にのる
  #--------------------------------------------------------------------------
  def ride_on(character, test = false)
    return false if riding_character != nil         # ?に騎?中なら騎?不可
    return false if character.rided_character != nil
                                       # すでに?り手がいるキャラへは騎?不可
    return true if test                # テストならばここで true を返して終了
   
    if character.is_a?(Game_Player)
      @riding_character_id = 0
    elsif character.is_a?(Game_Vehicle)
      @riding_character_id = -1
      @riding_character_id -= character.type
    else
      @riding_character_id = character.id
    end
    if self.is_a?(Game_Player)
      character.rided_character_id = 0
    elsif self.is_a?(Game_Vehicle)
      character.rided_character_id = -1
      character.rided_character_id -= @type
    else
      character.rided_character_id = @id
    end  
    character.sync_with_rided
    return true
  end
  #--------------------------------------------------------------------------
  # ○ 自分が?り物にしているキャラクタ?
  #--------------------------------------------------------------------------
  def riding_character
    return if @riding_character_id == nil
    if @riding_character_id == 0
      return $game_player
    elsif @riding_character_id < 0
      return $game_map.vehicles[@riding_character_id.abs - 1]
    else
      return $game_map.events[@riding_character_id]
    end
  end
  #--------------------------------------------------------------------------
  # ○ 自分の?り手となっているキャラクタ?
  #--------------------------------------------------------------------------
  def rided_character
    return if @rided_character_id == nil
    if @rided_character_id == 0
      return $game_player
    elsif @rided_character_id < 0
      return $game_map.vehicles[@rided_character_id.abs - 1]
    else
      return $game_map.events[@rided_character_id]
    end
  end
  #--------------------------------------------------------------------------
  # ○ 他のキャラクタ?からおりる
  #--------------------------------------------------------------------------
  def ride_off_character(test = false)
    return false if riding_character == nil     # 騎?してなければ降りれない
    return true if test                # テストならばここで true を返して終了

    riding_character.rided_character_id = nil
    @riding_character_id = nil
    return true
  end
  #--------------------------------------------------------------------------
  # ○ 騎?キャラクタ?との同期
  #--------------------------------------------------------------------------
  def sync_with_rided
    @x = rided_character.x
    @y = rided_character.y
    @real_x = rided_character.real_x
    @real_y = rided_character.real_y
    @direction = @direction_fix ? @direction : rided_character.direction
    update_bush_depth
    @stop_count = rided_character.stop_count
  end
  #--------------------------------------------------------------------------
  # ○ 段差マップ用??張通過判定(ダミ?メソッド)
  #--------------------------------------------------------------------------
  def ex_passable(direction, test = false)
    return true
  end
end

#==============================================================================
# ■ Game_Event
#------------------------------------------------------------------------------
#  イベントを扱うクラスです。?件判定によるイベントペ?ジ切り替えや、?列?理
# イベント?行などの機能を持っており、Game_Map クラスの?部で使用されます。
#==============================================================================

class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス??
  #--------------------------------------------------------------------------
  attr_accessor :passable_type
  attr_accessor :priority_type
  #--------------------------------------------------------------------------
  # ◎ オブジェクト初期化
  #     map_id : マップ ID
  #     event  : イベント (RPG::Event)
  #--------------------------------------------------------------------------
  alias tig_ev_event_initialize initialize
  def initialize(map_id, event)
    tig_ev_event_initialize(map_id, event)
    set_passable_setting
  end
  #--------------------------------------------------------------------------
  # ○ イベントの通行判定設定
  #-------------------------------------------------------------------------- 
  def set_passable_setting
    @passable_type = -1
    @event.name = @event.name.sub(/[<<]小型船[>>]/, "")
    @passable_type = 0 if $& != nil
    @event.name = @event.name.sub(/[<<]大型船[>>]/, "")
    @passable_type = 1 if $& != nil
    @event.name = @event.name.sub(/[<<]馬[>>]/, "")
    @passable_type = 2 if $& != nil
    @event.name = @event.name.sub(/[<<]フロ?ト[>>]/, "")
    @passable_type = 3 if $& != nil
  end
  #--------------------------------------------------------------------------
  # ○ 名前の取得
  #--------------------------------------------------------------------------
  def name
    return @event.name
  end
  #--------------------------------------------------------------------------
  # ◎ フレ?ム更新
  #--------------------------------------------------------------------------
  alias tig_ev_update update
  def update
    if riding_character != nil
      riding_character.sync_with_rided
    end
    tig_ev_update
  end
  #--------------------------------------------------------------------------
  # ◎ 自律移動の更新
  #--------------------------------------------------------------------------
  alias tig_ev_update_self_movement update_self_movement unless $@
  def update_self_movement
    return if rided_character != nil
    tig_ev_update_self_movement
  end
  #--------------------------------------------------------------------------
  # ○ プレイヤ?との同期
  #--------------------------------------------------------------------------
  def sync_with_player
    @x = $game_player.x
    @y = $game_player.y
    @real_x = $game_player.real_x
    @real_y = $game_player.real_y
    @direction = @direction_fix ? @direction : $game_player.direction
    update_bush_depth
    @stop_count = $game_player.stop_count
    @on_tile = $game_player.on_tile
    @turn_back = $game_player.turn_back
  end
  #--------------------------------------------------------------------------
  # ● マップ通行可能判定
  #     x : X 座標
  #     y : Y 座標
  #--------------------------------------------------------------------------
  def map_passable?(x, y)
    case @passable_type
    when 0  # 小型船
      return $game_map.boat_passable?(x, y)
    when 1  # 大型船
      return $game_map.ship_passable?(x, y)
    when 2  # 馬
      return $game_map.horse_passable?(x, y)
    when 3  # フロ?ト
      return $game_map.float_passable?(x, y)
    else    # 徒?
      return $game_map.passable?(x, y)
    end
  end
  #--------------------------------------------------------------------------
  # ● イベント起動
  #--------------------------------------------------------------------------
  #  lock(イベント起動時に主人公の方を向く動作)をする?件を
  #  イベント?にイベントコマンド?文章を表示が含まれている場合のみに
  #  限定する改?をしています。
  #  これにより、イベントへの?り?み動作をスム?ズに見せます。
  #--------------------------------------------------------------------------
  def start
    return if @list.size <= 1                   # ?行?容が空?
    @starting = true
   
    result = false                              ### 追加部分(ここから) ###
    for i in 0...@list.size
      result = true if @list[i].code == 101
    end                                         ### 追加部分(ここまで) ###
   
    lock if @trigger < 3 and result             #### 改?部分(この行) ####
   
    unless $game_map.interpreter.running?
      $game_map.interpreter.setup_starting_event
    end
  end
end

#==============================================================================
# ■ Game_Player
#------------------------------------------------------------------------------
#  プレイヤ?を扱うクラスです。イベントの起動判定や、マップのスクロ?ルなどの
# 機能を持っています。このクラスのインスタンスは $game_player で?照されます。
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス??
  #--------------------------------------------------------------------------
  attr_reader   :new_x
  attr_reader   :new_y
  attr_accessor :walking_bgm
  attr_accessor :vehicle_event_data
  attr_accessor :not_encounter_vehicle_id
  attr_accessor :event_vehicle_lock
  attr_accessor :follow_member_gathering  #【パ?ティ?メンバ?の追?】?用時用
  #--------------------------------------------------------------------------
  # ◎ オブジェクト初期化
  #--------------------------------------------------------------------------
  alias tig_ev_pl_initialize initialize
  def initialize
    tig_ev_pl_initialize

    @not_encounter_vehicle_id = Expansion_Vehicle::NOT_ENCOUNTER_VEHICIE_ID  
                                                  # 非遭遇?り物IDの初期値設定
    @event_vehicle_lock = false
  end
  #--------------------------------------------------------------------------
  # ○ 今?っている?り物
  #--------------------------------------------------------------------------
  def now_vehicle
    if in_event_vehicle?
      return $game_map.events[@vehicle_event_data[3]] unless event_vehicle_object?
    end
    return nil if @vehicle_type == -1
    return $game_map.vehicles[@vehicle_type]
  end
  #--------------------------------------------------------------------------
  # ○ 今?っている?り物が騎?タイプか?
  #--------------------------------------------------------------------------
  def now_vehicle_riding_type?
    return false if now_vehicle == nil
    return now_vehicle.riding_type?
  end
  #--------------------------------------------------------------------------
  # ○ イベント?り物の取得
  #--------------------------------------------------------------------------
  def event_vehicle
    return nil unless in_event_vehicle?
    return $game_map.events[@vehicle_event_data[3]]
  end
  #--------------------------------------------------------------------------
  # ○ イベントに?っているか判定
  #--------------------------------------------------------------------------
  def in_event_vehicle?
    return @vehicle_event_data != nil
  end
  #--------------------------------------------------------------------------
  # ○  イベント?り物がオブジェクトタイプか?
  #--------------------------------------------------------------------------
  def event_vehicle_object?
    return false unless event_vehicle
    key = [event_vehicle.character_name, event_vehicle.character_index]
    return $riding_data.data_object_type[key]
  end
  #--------------------------------------------------------------------------
  # ○ 今?っている?り物と別の?り物がそこにあるか?
  #--------------------------------------------------------------------------
  def other_vehicle?(x = @x, y = @y)
    return false if @vehicle_type == -1
    for vehicle in $game_map.vehicles
      if vehicle.pos?(x, y)
        return true if vehicle != now_vehicle
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ◎ 飛行船(もしくは大型飛行船)に?っている?態判定
  #--------------------------------------------------------------------------
  alias tig_ev_airship? in_airship?
  def in_airship?
    return true if @vehicle_type == 4
    return tig_ev_airship?
  end
  #--------------------------------------------------------------------------
  # ◎ 移動可能判定
  #--------------------------------------------------------------------------
  alias tig_ev_pl_movable? movable?
  def movable?
    if [4, 5].include?(@vehicle_type)
      return false if moving?                     # 移動中
      return false if @move_route_forcing         # 移動ル?ト?制中
      return false if @vehicle_getting_on         # ?る動作の途中
      return false if @vehicle_getting_off        # 降りる動作の途中
      return false if $game_message.visible       # メッセ?ジ表示中
      return false unless $game_map.big_airship.movable? or
                          $game_map.magic_carpet.movable?
      return true
    else
      return tig_ev_pl_movable?
    end
  end
  #--------------------------------------------------------------------------
  # ◎ マップ通行可能判定
  #     x : X 座標
  #     y : Y 座標
  #--------------------------------------------------------------------------
  alias tig_ev_map_passable? map_passable?
  def map_passable?(x, y)
    if in_event_vehicle?
      return $game_map.event_vehicle.map_passable?(x, y)
    end
    case @vehicle_type
    when 3 
      return $game_map.horse_passable?(x, y)
    when 4
      return $game_map.big_airship_passable?(x, y)
    when 5
      return $game_map.magic_carpet_passable?(x, y)
    else   
      return tig_ev_map_passable?(x, y)
    end
  end
  #--------------------------------------------------------------------------
  # ◎ フレ?ム更新
  #--------------------------------------------------------------------------
  alias tig_ev_update update
  def update
    tig_ev_update
    update_event_vehicle
  end
  #--------------------------------------------------------------------------
  # ◎ ?り物の?降
  #--------------------------------------------------------------------------
  alias tig_ev_get_on_off_vehicle get_on_off_vehicle
  def get_on_off_vehicle
    return false unless movable?
    if in_event_vehicle?
      unless @event_vehicle_lock
        result = get_off_event_vehicle
        if result
          unless event_vehicle_object?
            @vehicle_getting_off_wait = true #【パ?ティ?メンバ?の追?】?用時用
            @vehicle_hide = false            #【パ?ティ?メンバ?の追?】?用時用
          end
          return result
        end
      else
        return false
      end
    else
      return tig_ev_get_on_off_vehicle
    end
  end
  #--------------------------------------------------------------------------
  # ● ?り物の?理
  #--------------------------------------------------------------------------
  def update_vehicle
    return unless in_vehicle?
    vehicle = $game_map.vehicles[@vehicle_type]
    if @vehicle_getting_on                    # ?る途中?
      vehicle.moveto(@x, @y)         # ?っている間に自律移動してしまうのを防ぐ
      if not moving? and not @follow_member_gathering
        if vehicle.riding_type?
          unless [2, 4].include?(@vehicle_type)
            vehicle.priority_type = 1
          end
          ride_on(vehicle)
        else
          @transparent = true                 # 透明化
        end
        @direction = vehicle.direction        # 向きを?更
        @move_speed = vehicle.speed           # 移動速度を?更
        @vehicle_getting_on = false           # ?る動作終了
      end
    elsif @vehicle_getting_off                # 降りる途中?
      if not moving? and vehicle.altitude == 0
        @vehicle_getting_off = false          # 降りる動作終了
        if vehicle.riding_type?
          vehicle.priority_type = vehicle.vehicle_priority
        else
          @transparent = false                  # 透明を解除         
        end
        if vehicle.instant
          vehicle.instant = false
          vehicle.set_location(0, 0, 0)
        end
        @vehicle_type = -1                    # ?り物タイプ消去
        update_bush_depth
      end
    else                                      # ?り物に?っている
      vehicle.sync_with_player                # プレイヤ?と同時に動かす
    end
  end
  #--------------------------------------------------------------------------
  # ◎ ?り物に?る
  #    現在?り物に?っていないことが前提。
  #--------------------------------------------------------------------------
  alias tig_ev_get_on_vehicle get_on_vehicle
  def get_on_vehicle
    if $game_map.horse.pos?(@x, @y)                 # 馬と重なっている?
      get_on_horse
      return true
    elsif $game_map.big_airship.pos?(@x, @y)        # 大型飛行船と重なっている?
      get_on_big_airship
      return true
    elsif $game_map.magic_carpet.pos?(@x, @y)       # 魔法の絨?と重なっている?
      get_on_magic_carpet
      return true
    end
    return tig_ev_get_on_vehicle
  end
  #--------------------------------------------------------------------------
  # ◎ ?り物から降りる
  #    現在?り物に?っていることが前提。
  #--------------------------------------------------------------------------
  alias tig_ev_get_off_vehicle get_off_vehicle
  def get_off_vehicle
    return false if other_vehicle?
    return false if $game_map.hide_tile?(x, y)
    if @vehicle_type < 2
      return false unless tig_ev_get_off_vehicle
    elsif @vehicle_type == 2
      return false unless tig_ev_get_off_vehicle
      @direction = 4
    else
      if @vehicle_type == 3
        return false unless $game_map.events_xy(@x, @y).empty?
        @direction = 2
      elsif @vehicle_type == 4 or @vehicle_type == 5
        return false unless airship_land_ok?(@x, @y)
        @direction = 4
      end
      now_vehicle.get_off                           # 降りる?理
      @vehicle_getting_off = true                   # 降りる動作の開始
      @move_speed = 3                               # 移動速度を?す
      @through = false                              # すり?け OFF
      @walking_bgm.play                             # ?行時の BGM 復?
      make_encounter_count                          # エンカウント初期化
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ○ 馬に?る
  #--------------------------------------------------------------------------
  def get_on_horse
    @vehicle_getting_on = true        # ?り?み中フラグ
    @vehicle_type = 3                 # ?り物タイプ設定
    @walking_bgm = RPG::BGM::last     # ?行時の BGM 記憶
    $game_map.horse.get_on            # ?り?み?理
  end
  #--------------------------------------------------------------------------
  # ○ 大型飛行船に?る
  #--------------------------------------------------------------------------
  def get_on_big_airship
    @vehicle_getting_on = true        # ?る動作の開始
    @vehicle_type = 4                 # ?り物タイプ設定
    @through = true                   # すり?け ON
    @walking_bgm = RPG::BGM::last     # ?行時の BGM 記憶
    $game_map.big_airship.get_on      # ?り?み?理
  end
  #--------------------------------------------------------------------------
  # ○ 魔法の絨?に?る
  #--------------------------------------------------------------------------
  def get_on_magic_carpet
    @vehicle_getting_on = true        # ?る動作の開始
    @vehicle_type = 5                 # ?り物タイプ設定
    @walking_bgm = RPG::BGM::last     # ?行時の BGM 記憶
    $game_map.magic_carpet.get_on     # ?り?み?理
  end
  #--------------------------------------------------------------------------
  # ○ イベントに?る
  #--------------------------------------------------------------------------
  def get_on_event(event_id, test = false)
    vehicle = $game_map.events[event_id]
    return false if in_vehicle?
    return false if in_event_vehicle?
    return false if riding_character != nil
    return false if vehicle.rided_character != nil
    return false if vehicle.moving?
    return true if test

    @vehicle_getting_on = true                  # ?り?み中フラグ
   
    @vehicle_event_data = []                    # イベント?り物デ?タ登?
    @vehicle_event_data[0] = vehicle.name
    @vehicle_event_data[1] = vehicle.character_name
    @vehicle_event_data[2] = vehicle.character_index
    @vehicle_event_data[3] = vehicle.id
    key = [vehicle.character_name, vehicle.character_index]
    if $riding_data.data_priority_type[key] == 0
      @vehicle_event_data[4] = vehicle.priority_type
      vehicle.priority_type = 0
    end
    vehicle.stop_count = -20
    front_x = $game_map.x_with_direction(@x, @direction)
    front_y = $game_map.y_with_direction(@y, @direction)
    if vehicle.x == front_x and vehicle.y == front_y
      unless $riding_data.data_object_type[key]
        if @follow_member_gathering != nil
          @follow_member_gathering = true  # 【パ?ティ?メンバ?の追?】?用時用
        end
        force_move_forward                         # 一?前進
      end
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ○ イベント?り物の?理
  #--------------------------------------------------------------------------
  def update_event_vehicle
    return unless in_event_vehicle?
    vehicle = $game_map.events[@vehicle_event_data[3]]
    key = [vehicle.character_name, vehicle.character_index]
    if @vehicle_getting_on                    # ?る途中?
      if not moving? and not @follow_member_gathering
        if @vehicle_event_data[4] != nil
          vehicle.priority_type = 1
        end
        if vehicle.riding_type?
          if $riding_data.data_object_type[key]
            vehicle.set_direction(@direction)
          end
          ride_on(vehicle)
        else
          @transparent = true                 # 透明化
        end
        @vehicle_getting_on = false           # ?る動作終了
        @through = false
      end
    elsif @vehicle_getting_off                # 降りる途中?
      if not moving?
        if @vehicle_event_data[4] != nil
          vehicle.priority_type = @vehicle_event_data[4]
        end
        @vehicle_getting_off = false          # 降りる動作終了
        key = [$game_map.map_id, @vehicle_event_data[3], "D"]
        $game_self_switches[key] = true
        $game_map.need_refresh = true
        $game_player.vehicle_event_data = nil
        update_bush_depth
      end
    else
      vehicle.sync_with_player                # イベント位置を同期
    end
  end
  #--------------------------------------------------------------------------
  # ○ イベントから降りる?理
  #--------------------------------------------------------------------------
  def get_off_event_vehicle
    vehicle = $game_map.event_vehicle
    front_x = $game_map.x_with_direction(@x, @direction)
    front_y = $game_map.y_with_direction(@y, @direction)
    key = [vehicle.character_name, vehicle.character_index]
    if [0, 1, 3].include?(vehicle.passable_type)
      return false unless tig_ev_map_passable?(front_x, front_y)   # 接岸できない
      if $riding_data.data_priority_type[key] == 0
        @vehicle_event_data[4] = vehicle.priority_type
        vehicle.priority_type = 0
      end
      force_move_forward
    elsif $riding_data.data_object_type[key] and
          vehicle.priority_type == 1
      @vehicle_getting_off_wait = false   #【パ?ティ?メンバ?の追?】?用時用
      return false if collide_with_characters?(front_x, front_y)
      return false unless $game_map.object_passable?(front_x, front_y)
      return false unless vehicle.ex_passable(@direction)
      case @direction
      when 2;  vehicle.move_down(false)
      when 4;  vehicle.move_left(false)
      when 6;  vehicle.move_right(false)
      when 8;  vehicle.move_up(false)
      end
      vehicle.moveto(front_x, front_y)
    end
    if vehicle.riding_type?
      ride_off_character
    else
      @transparent = false                       # 透明を解除
    end
    vehicle.stop_count = 0
    @vehicle_getting_off = true
    return true
  end
  #--------------------------------------------------------------------------
  # ○ イベントからの?制離?
  #--------------------------------------------------------------------------
  def compulsory_off_event_vehicle(erase = false)
    vehicle = $game_map.event_vehicle
    if vehicle and vehicle.riding_type?
      ride_off_character
    else
      @transparent = false                       # 透明を解除    
    end
    @vehicle_getting_off_wait = true      #【パ?ティ?メンバ?の追?】?用時用
    @vehicle_hide = false                 #【パ?ティ?メンバ?の追?】?用時用
    $game_player.vehicle_event_data = nil
    update_bush_depth
    vehicle.erase if erase
  end
  #--------------------------------------------------------------------------
  # ● エンカウントの更新
  #--------------------------------------------------------------------------
  def update_encounter
    return if $TEST and Input.press?(Input::CTRL)   # テストプレイ中?
    return if @not_encounter_vehicle_id.include?(@vehicle_type)    ## ?更点
    if $game_player.in_airship?              # 飛行中なら          ## 追加点
      @encounter_count -= 1                  # カウントを 1 減らす ## 追加点
    elsif $game_map.bush?(@x, @y)            # 茂みなら            ## ?更点
      @encounter_count -= 2                  # カウントを 2 減らす
    else                                     # 茂み以外なら
      @encounter_count -= 1                  # カウントを 1 減らす
    end
  end
end

#==============================================================================
# ■ Sprite_Character
#------------------------------------------------------------------------------
#  キャラクタ?表示用のスプライトです。Game_Character クラスのインスタンスを
# 監視し、スプライトの?態を自動的に?化させます。
#==============================================================================

class Sprite_Character < Sprite_Base
  #--------------------------------------------------------------------------
  # ◎ フレ?ム更新
  #--------------------------------------------------------------------------
  alias tig_ev_update update
  def update
    tig_ev_update
    riding_positioning
  end
  #--------------------------------------------------------------------------
  # ○ 騎?用?像のファイルの名前取得
  #--------------------------------------------------------------------------
  def riding_pct_name
    key = [@character.character_name, @character.character_index]
    return $riding_data.data_riding_pct_name[key]
  end
  #--------------------------------------------------------------------------
  # ○ 騎?用?像のファイルのインデックス取得
  #--------------------------------------------------------------------------
  def riding_pct_index
    key = [@character.character_name, @character.character_index]
    return $riding_data.data_riding_pct_index[key]
  end
  #--------------------------------------------------------------------------
  # ○ 騎?しているキャラクタ?の取得
  #--------------------------------------------------------------------------
  def riding_character
    return @character.riding_character
  end
  #--------------------------------------------------------------------------
  # ○ 騎?しているキャラクタ?の取得
  #--------------------------------------------------------------------------
  def rided_character
    return @character.rided_character
  end
  #--------------------------------------------------------------------------
  # ○ 騎?時のX座標修正値の取得
  #--------------------------------------------------------------------------
  def riding_positioning_x(key_character, base_character)
    key = [key_character.character_name, key_character.character_index]
    return 0 unless $riding_data.data_positioning_down.key?(key)
    pattern = base_character.pattern
    pattern = 1 if pattern == 3
    case base_character.direction
    when 2
      return $riding_data.data_positioning_down[key][pattern][0]
    when 4
      return $riding_data.data_positioning_left[key][pattern][0]
    when 6
      return $riding_data.data_positioning_right[key][pattern][0]
    when 8
      return $riding_data.data_positioning_up[key][pattern][0]
    end
  end
  #--------------------------------------------------------------------------
  # ○ 騎?時のY座標修正値の取得
  #--------------------------------------------------------------------------
  def riding_positioning_y(key_character, base_character)
    key = [key_character.character_name, key_character.character_index]
    return 0 unless $riding_data.data_positioning_down.key?(key)
    pattern = base_character.pattern
    pattern = 1 if pattern == 3
    case base_character.direction
    when 2
      return $riding_data.data_positioning_down[key][pattern][1]
    when 4
      return $riding_data.data_positioning_left[key][pattern][1]
    when 6
      return $riding_data.data_positioning_right[key][pattern][1]
    when 8
      return $riding_data.data_positioning_up[key][pattern][1]
    end
  end
  #--------------------------------------------------------------------------
  # ◎ 騎?時の位置補正
  #--------------------------------------------------------------------------
  def riding_positioning
    if riding_character != nil
      key = [riding_character.character_name, riding_character.character_index]
      unless $riding_data.data_object_type[key]
        self.x += riding_positioning_x(riding_character, riding_character)
        self.y = riding_character.screen_y
        self.y += riding_positioning_y(riding_character, riding_character)
      end
    end
    if rided_character != nil
      key = [@character.character_name, @character.character_index]
      if $riding_data.data_object_type[key]
        self.x += riding_positioning_x(@character, rided_character)
        self.y += riding_positioning_y(@character, rided_character)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ◎ ?送元ビットマップの更新
  #--------------------------------------------------------------------------
  alias tig_ev_update_bitmap update_bitmap
  def update_bitmap
    tig_ev_update_bitmap
    if @character.rided_character != nil 
      return if @back_seeing == true
      return if riding_pct_name == nil
      if @ride_sprite == nil or
         @riding_pct_name != riding_pct_name or
         @riding_pct_index != riding_pct_index
       
        @riding_pct_name = riding_pct_name
        @riding_pct_index = riding_pct_index
        @ride_sprite = ::Sprite.new(viewport)
        file_name = @riding_pct_name == "self" ? @character.character_name : @riding_pct_name
        @ride_sprite.bitmap = Cache.character(file_name)
        sign = file_name[/^[!$]./]
        if sign != nil and sign.include?('$')
          @rcw = @ride_sprite.bitmap.width / 3
          @rch = @ride_sprite.bitmap.height / 4
        else
          @rcw = @ride_sprite.bitmap.width / 12
          @rch = @ride_sprite.bitmap.height / 8
        end
        @ride_sprite.ox = @rcw / 2
        @ride_sprite.oy = @rch
      end
    else
      dispose_ride_sprite
    end
  end
  #--------------------------------------------------------------------------
  # ◎ ?送元矩形の更新
  #--------------------------------------------------------------------------
  alias tig_ev_update_src_rect update_src_rect
  def update_src_rect
    tig_ev_update_src_rect
    dispose_ride_sprite if @back_seeing == true
    return if @ride_sprite == nil
   
    index = @riding_pct_name == "self" ? @character.character_index : @riding_pct_index
    pattern = @character.pattern < 3 ? @character.pattern : 1
    sx = (index % 4 * 3 + pattern) * @rcw
    sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @rch
    @ride_sprite.src_rect.set(sx, sy, @rcw, @rch)
    @ride_sprite.x = @character.screen_x
    @ride_sprite.y = @character.screen_y
    @ride_sprite.z = @character.screen_z + 2
    @ride_sprite.viewport = viewport

    if @riding_pct_name == "self" and rided_character.direction == 8
      @ride_sprite.x = -50
    end
    key = [@character.character_name, @character.character_index]
    if $riding_data.data_object_type[key]
      @ride_sprite.x += riding_positioning_x(@character, rided_character)
      @ride_sprite.y += riding_positioning_y(@character, rided_character)
    end
  end
  #--------------------------------------------------------------------------
  # ◎ 解放
  #--------------------------------------------------------------------------
  alias tig_ev_dispose dispose
  def dispose
    tig_ev_dispose
    dispose_ride_sprite
  end
  #--------------------------------------------------------------------------
  # ◎ 騎?用スプライトの消去
  #--------------------------------------------------------------------------
  def dispose_ride_sprite
    if @ride_sprite != nil
      @ride_sprite.dispose
      @ride_sprite = nil
    end
  end
end

#==============================================================================
# ■ Spriteset_Map
#------------------------------------------------------------------------------
#  マップ?面のスプライトやタイルマップなどをまとめたクラスです。このクラスは
# Scene_Map クラスの?部で使用されます。
#==============================================================================

class Spriteset_Map
  #--------------------------------------------------------------------------
  # ◎ 飛行船の影スプライトの更新
  #--------------------------------------------------------------------------
  alias tig_ev_update_shadow update_shadow
  def update_shadow
    @shadow_sprite.z = 100
    if $game_map.big_airship.altitude > 0
      @shadow_sprite.x = $game_map.big_airship.screen_x
      @shadow_sprite.y = $game_map.big_airship.screen_y + $game_map.big_airship.altitude
      @shadow_sprite.opacity = $game_map.big_airship.altitude * 4
      @shadow_sprite.update
    elsif $game_map.magic_carpet.altitude > 0
      if $game_player.on_tile == true
        @shadow_sprite.viewport = @viewport4
      else
        @shadow_sprite.viewport = @viewport1
      end
      @shadow_sprite.x = $game_map.magic_carpet.screen_x
      @shadow_sprite.y = $game_map.magic_carpet.screen_y + $game_map.magic_carpet.altitude / 5
      @shadow_sprite.opacity = $game_map.magic_carpet.altitude * 8
      @shadow_sprite.update
    else
      tig_ev_update_shadow
    end
  end
end


#==============================================================================
# ■ Game_Interpreter
#------------------------------------------------------------------------------
#  イベントコマンドを?行するインタプリタです。このクラスは Game_Map クラス、
# Game_Troop クラス、Game_Event クラスの?部で使用されます。
#==============================================================================

class Game_Interpreter
  #--------------------------------------------------------------------------
  # ◎ ?り物の?降
  #--------------------------------------------------------------------------
  alias tig_ev_command_206 command_206
  def command_206
    @wait_count = 2       #【パ?ティ?メンバ?の追?】?用時にあったほうがよい
    return tig_ev_command_206
  end
  #--------------------------------------------------------------------------
  # ○ 小型船
  #--------------------------------------------------------------------------
  def boat
    return $game_map.boat
  end
  #--------------------------------------------------------------------------
  # ○ 大型船
  #--------------------------------------------------------------------------
  def ship
    return $game_map.ship
  end
  #--------------------------------------------------------------------------
  # ○ 飛行船
  #--------------------------------------------------------------------------
  def airship
    return $game_map.airship
  end
  #--------------------------------------------------------------------------
  # ○ 馬
  #--------------------------------------------------------------------------
  def horse
    return $game_map.horse
  end
  #--------------------------------------------------------------------------
  # ○ 大型飛行船
  #--------------------------------------------------------------------------
  def big_airship
    return $game_map.big_airship
  end
  #--------------------------------------------------------------------------
  # ○ 魔法の絨?
  #--------------------------------------------------------------------------
  def magic_carpet
    return $game_map.magic_carpet
  end
  #--------------------------------------------------------------------------
  # ○ プレ?ヤ?がイベントに?る
  # ※ ?り物にするイベントの「スクリプト」コマンドで?行する。
  #--------------------------------------------------------------------------
  def get_on_event(test = false)
    if @event_id > 0
      return false if $game_player.event_vehicle_lock
      return $game_player.get_on_event(@event_id, test)
    else 
      return false
    end
  end
  #--------------------------------------------------------------------------
  # ○ プレ?ヤ?がイベントに?れるかのテスト
  #  ※ ?り物にするイベントの「スクリプト」コマンドで?行する。
  #--------------------------------------------------------------------------
  def get_on_event_test
    return get_on_event(true)
  end
  #--------------------------------------------------------------------------
  # ○ プレイヤ?がイベント?り物に?っているかの判定
  #    word : 指定語句
  # ※ 指定語句がなければ?り物にのっているかどうかを判定
  #     あればその語句が名前に含まれている?り物にのっているかを判定
  #--------------------------------------------------------------------------
  def player_in_event_vehicle(word = nil)
    return false unless $game_player.in_event_vehicle?
    return true if word == nil
    return $game_map.event_vehicle.name.include?(word)
  end
  #--------------------------------------------------------------------------
  # ○ プレ?ヤ?のイベント?り物をロックする
  #-------------------------------------------------------------------------- 
  def event_vehicle_lock
    $game_player.event_vehicle_lock = true
  end
  #--------------------------------------------------------------------------
  # ○ プレ?ヤ?のイベント?り物をロックを解除する
  #-------------------------------------------------------------------------- 
  def event_vehicle_lock_off
    $game_player.event_vehicle_lock = false
  end
  #--------------------------------------------------------------------------
  # ○ プレ?ヤ?をイベントから?制的に降ろす
  #-------------------------------------------------------------------------- 
  def event_vehicle_compulsory_off
    $game_player.compulsory_off_event_vehicle
  end
  #--------------------------------------------------------------------------
  # ○ プレ?ヤ?のイベント?り物を消去する
  #-------------------------------------------------------------------------- 
  def event_vehicle_erase
    $game_player.compulsory_off_event_vehicle(true)
  end
  #--------------------------------------------------------------------------
  # ○ イベントをイベントに?せる
  #     event_id : ?り手になるイベントのID
  #   vehicle_id : ?り物になるイベントのID
  #--------------------------------------------------------------------------
  def event_vehicle(event_id, vehicle_id, test = false)
    if $game_map.events[event_id] != nil and $game_map.events[vehicle_id] != nil
      return $game_map.events[event_id].ride_on($game_map.events[vehicle_id], test)
    else 
      return false
    end
  end
  #--------------------------------------------------------------------------
  # ○ イベントをイベントに?せることが出?るかのテスト
  #--------------------------------------------------------------------------
  def event_vehicle_test(event_id, vehicle_id)
    return event_vehicle_test(event_id, vehicle_id, true)
  end
  #--------------------------------------------------------------------------
  # ○ イベントから降ろす
  #     event_id : イベントから降ろすイベントのID
  #--------------------------------------------------------------------------
  def get_off_event(event_id, test = false)
    if $game_map.events[event_id] != nil
      return $game_map.events[event_id].ride_off_character(test)
    else 
      return false
    end
  end
  #--------------------------------------------------------------------------
  # ○ イベントから降ろすことが出?るかのテスト
  #--------------------------------------------------------------------------
  def get_off_event_test(event_id)
    return get_off_event_test(event_id, true)
  end
  #--------------------------------------------------------------------------
  # ○ イベントをID指定してセルフスイッチを操作する
  #--------------------------------------------------------------------------
  def self_switches(event_id, switches_id, on_off)
    return if $game_map.events == nil
    return if $game_map.events[event_id] == nil
    key = [$game_map.map_id, event_id, switches_id]
    $game_self_switches[key] = on_off
    $game_map.need_refresh = true
    $game_map.need_refresh = true
  end
  #--------------------------------------------------------------------------
  # ○ ID指定したイベントのセルフスイッチをオン
  #--------------------------------------------------------------------------
  def self_switches_on(event_id, switches_id)
    self_switches(event_id, switches_id, true)
  end
  #--------------------------------------------------------------------------
  # ○ ID指定したイベントのセルフスイッチをオフ
  #--------------------------------------------------------------------------
  def self_switches_off(event_id, switches_id)
    self_switches(event_id, switches_id, false)
  end
  #--------------------------------------------------------------------------
  # ○ ID指定したイベントのセルフスイッチをクリア(すべてオフ)
  #--------------------------------------------------------------------------
  def self_switches_clear(event_id)
    self_switches(event_id, "A", false)
    self_switches(event_id, "B", false)
    self_switches(event_id, "C", false)
    self_switches(event_id, "D", false)
  end
  #--------------------------------------------------------------------------
  # ○ ID指定したイベントがオンか?
  #--------------------------------------------------------------------------
  def self_switches_on?(event_id, switches_id)
    key = [$game_map.map_id, event_id, switches_id]
    return $game_self_switches[key] == true
  end
  #--------------------------------------------------------------------------
  # ○ ID指定したイベントがオフか?
  #--------------------------------------------------------------------------
  def self_switches_off?(event_id, switches_id)
    key = [$game_map.map_id, event_id, switches_id]
    return $game_self_switches[key] == false
  end
  #--------------------------------------------------------------------------
  # ○ イベントと同位置のイベントのセルフスイッチをオン
  #--------------------------------------------------------------------------
  def self_switches_on_here(switches_id)
    self_switches_here(switches_id, true)
  end
  #--------------------------------------------------------------------------
  # ○ イベントと同位置のイベントのセルフスイッチをオフ
  #--------------------------------------------------------------------------
  def self_switches_off_here(switches_id)
    self_switches_here(switches_id, false)
  end
  #--------------------------------------------------------------------------
  # ○ イベントと同位置のイベントのセルフスイッチを操作する
  #--------------------------------------------------------------------------
  def self_switches_here(switches_id, on_off)
    return if $game_map.events == nil
    result = false
    main_event = $game_map.events[@event_id]
    for event in $game_map.events_xy(main_event.x, main_event.y)
      next if event == main_event
      key = [$game_map.map_id, event.id, switches_id]
      $game_self_switches[key] = on_off
      $game_map.need_refresh = true
      result = true
    end
    $game_map.need_refresh = true if result
  end
end


 

나머지 그림들은 Graphic / Character 폴더에 저장합니다.

$Wivern.png Ride.png Ride.png

Comment '2'
  • ?
    Alkaid 2011.11.13 12:31

    module Expansion_Vehicle

    ............

        BIG_AIRSHIP_MAP_ID = 1
        BIG_AIRSHIP_X = 11
        BIG_AIRSHIP_Y = 10

    이 부분이 대형 비행선(여기서는 용 그림을 사용)의 초기 위치를 지정하는 부분입니다.  여기에 자신이 사용할 맵ID와 X, Y 좌표를 지정하세요.  다른 탈것도 마찬가지입니다.

  • ?
    ba람이 2011.11.13 13:59

    ㄳㄳ 제가 c언어를 하나도 몰라서 ㄷㄷ

    정말로 ㄳ합니다


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12442
RMVXA 이벤트로 반짝거리는 이팩트 재생하기 5 떡좀쪄봐 2014.02.11 699
RMVX 이벤트로 변수설정이 안되서 질문남깁니다 야옹이 2011.11.11 1628
RMVX 이벤트로 술래잡기를 구현하는 방법 6 skeskin 2014.05.14 887
RMVX 이벤트로 스크립트 사용 2 file ba람이 2011.11.13 786
RMXP 이벤트로 아이템 획득후 시간이 지난후 다시 획득 가능하게 하는법... 5 도페로 2013.10.17 1102
RMVX 이벤트로 아이템창을 호출하려면 어떻게 해야하나요? 2 MMM 2015.03.14 266
이벤트 작성 RMMV 이벤트로 애니메이션을 재생하는 법이 궁금합니다 1 알만툴탐구 2023.05.11 68
RMVXA 이벤트로 엑알 만들기 질문 입니당 file 하나비애 2014.04.15 660
RMVX 이벤트로 인해 통행가능으로 설정하는 방법이 무엇인가요? 2 file 탄막병기 2014.03.06 691
RMVX 이벤트로 장소 이동 후 자동실행이 안돼요.. 4 file 하네 2013.10.02 1224
이벤트 작성 RMMV 이벤트로 재생하는 BGM을 반복시키고 싶습니다. 2 겐마 2020.09.13 105
RMVXA 이벤트로 제작한 체력바 오류 2 file 환장 2014.01.08 1062
RMMV 이벤트로 지형변경 1 쿠르스네이 2016.12.18 70
RMVXA 이벤트로 캐릭터를 만들었는데 계속해서 걷는 모션을 넣고싶어요. 2 Virtus 2013.11.25 999
RMVXA 이벤트로만 움직이게하기 (제목이 이상한거 같아;;) 7 꾸와 2014.02.16 481
RMVX 이벤트로부터 접촉은 어떻게 적용해야 하나요. 2 file Uiman 2015.05.25 175
RMVX 이벤트를 1번만 실행하게 하는 법좀 알려주세요 4 mzlaow 2016.01.09 159
RMVXA 이벤트를 1회용으로 만들고싶어요 4 JobSangIn 2015.10.20 159
RMVX 이벤트를 8방향 이동시켜주려면 어떻게 해야 하나요 1 존스노우 2016.10.04 112
RMMV 이벤트를 대상으로 아이템을 사용해서 데미지 주기 3 옥상으로따라와 2017.08.02 87
Board Pagination Prev 1 ... 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 ... 516 Next
/ 516