#==============================================================================
#                     「足踏み速度の独立化」(ACE) ver1.1
#   製作者:奈々(なな)
#   へぷたなすくろーる http://heptanas.mamagoto.com/
#
#   ◇使用規約
#   使用される場合はスクリプト作成者として「奈々」を明記して下さい。
#   このスクリプトを改変したり、改変したものを配布するなどは自由ですが
#   その場合も元のスクリプトの作成者として名前は載せて下さい。
#   その他、詳しい利用規約はブログを参照して下さい。
#
#------------------------------------------------------------------------------
#
#   通常、足踏み速度は移動速度に比例します。
#   これをキャラクター毎に比例しないように切り替えることが出来ます。
#   
#   イベントコマンドの「スクリプト」か移動ルートの「スクリプト」に記述
#   
#   n7_anim_sep(true)      :そのイベントの足踏み速度が独立化
#   n7_anim_sep(false)     :     〃   の独立化を解除
#   
#   n7_anim_sep(true, n)   :n番のイベントの足踏み速度が独立化
#   n7_anim_sep(false, n)  :     〃   の独立化を解除
#   nを-1にするとプレイヤー、-2〜-4で隊列メンバーに対しても設定できる
#   
#   n7_anim_sep_speed(m)      :そのイベントの足踏み速度が移動速度m相当に
#   n7_anim_sep_speed(m, n)   :n番のイベントの足踏み速度が移動速度m相当に
#   nを-1にするとプレイヤー、-2〜-4で隊列メンバーに対しても設定できる
#
#==============================================================================

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

class Game_Interpreter
  #--------------------------------------------------------------------------
  # ● アニメーション独立切り替え
  #--------------------------------------------------------------------------
  def n7_anim_sep(value, target = event_id)
    case target
    when -1
      $game_player.animation_sep = value
    when -4 .. -2
      $game_player.followers[-(target + 2)].animation_sep = value
    when true
      $game_map.events[target].animation_sep = value
    end
  end
  #--------------------------------------------------------------------------
  # ● アニメーション独立切り替え
  #--------------------------------------------------------------------------
  def n7_anim_sep_speed(value, target = event_id)
    case target
    when -1
      $game_player.animation_sep_speed = value
    when -4 .. -2
      $game_player.followers[-(target + 2)].animation_sep_speed = value
    when true
      $game_map.events[target].animation_sep_speed = value
    end
  end
end

#==============================================================================
# ■ Game_CharacterBase
#------------------------------------------------------------------------------
#  キャラクターを扱う基本のクラスです。全てのキャラクターに共通する、座標やグ
# ラフィックなどの基本的な情報を保持します。
#==============================================================================

class Game_CharacterBase
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :animation_sep            # アニメーション独立フラグ
  attr_accessor :animation_sep_speed      # アニメーション独立時速度  
  #--------------------------------------------------------------------------
  # ● 公開メンバ変数の初期化
  #--------------------------------------------------------------------------
  alias init_public_members_animsep init_public_members
  def init_public_members
    init_public_members_animsep
    @animation_sep = false
    @animation_sep_speed = 3
  end
  #--------------------------------------------------------------------------
  # ● 歩行/足踏みアニメの更新
  #--------------------------------------------------------------------------
  def update_animation
    update_anime_count
    if @anime_count > 18 - (animation_sep ? @animation_sep_speed : real_move_speed) * 2
      update_anime_pattern
      @anime_count = 0
    end
  end
end