#==============================================================================
#                   「行為者アニメ」(ACE) Ver.1.0
#   製作者:奈々(なな)
#   へぷたなすくろーる http://heptanas.mamagoto.com/
#
#   ◇使用規約
#   使用される場合はスクリプト作成者として「奈々」を明記して下さい。
#   このスクリプトを改変したり、改変したものを配布するなどは自由ですが
#   その場合も元のスクリプトの作成者として名前は載せて下さい。
#   その他、詳しい利用規約はブログを参照して下さい。
#
#------------------------------------------------------------------------------
#
#   通常のアニメーションの前に、スキル使用者に対してアニメを表示します。
#   これにより詠唱や発動などを表現することが可能です。
#   
#   スキル・アイテムのメモ欄に
#   <行為者アニメ n>
#   と書くと、n番のアニメーションを表示します。
#
#==============================================================================

#==============================================================================
# ■ RPG::UsableItem
#------------------------------------------------------------------------------
#  スキルとアイテムのスーパークラス。
#==============================================================================

class RPG::UsableItem < RPG::BaseItem
  #--------------------------------------------------------------------------
  # ● 行為者アニメーション番号
  #--------------------------------------------------------------------------
  def pre_animation_id
    return @note[/<行為者アニメ\s*(\d+)>/] ? $1.to_i : 0
  end
end

#==============================================================================
# ◆ アニメーション処理の併用化措置
#------------------------------------------------------------------------------
unless (N7combiner::SB_UI rescue false) # 同系スクリプトの検出
module N7combiner
  SB_UI = true
end
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ● スキル/アイテムの使用
  #--------------------------------------------------------------------------
  def use_item
    item = @subject.current_action.item
    @log_window.display_use_item(@subject, item)
    @subject.use_item(item)
    refresh_status
    targets = @subject.current_action.make_targets.compact
    n7com_show_animation(item, targets)
    targets.each {|target| item.repeats.times { invoke_item(target, item) } }
  end
  #--------------------------------------------------------------------------
  # ○ アニメーション表示
  #--------------------------------------------------------------------------
  def n7com_show_animation(item, targets)
    show_animation(targets, item.animation_id)
  end
end
end
#------------------------------------------------------------------------------
# ↑ ここまで
#==============================================================================

#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
#  バトル画面の処理を行うクラスです。
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ○ アニメーション表示
  #--------------------------------------------------------------------------
  alias n7com_show_animation_pre n7com_show_animation
  def n7com_show_animation(item, targets)
    show_animation([@subject], item.pre_animation_id) if item.pre_animation_id > 0
    n7com_show_animation_pre(item, targets)
  end
end