Jump to content
Sign in to follow this  
tiagoms

Victor Eng Target Arrow + Toggle Target (Request)

Recommended Posts

 

Hello

 

I wonder if someone would scripts: "Victor Eng - Toggle Target" and "Target Arrow". For in Saint Victor site, the link is faulty.

Share this post


Link to post
Share on other sites

Here's the Script for VE - Toggle Target. Unfortunately I don't have the Target Arrow at the moment. I'll see if I can find it...
 

#==============================================================================
# ** Victor Engine - Toggle Target
#------------------------------------------------------------------------------
# Author : Victor Sant
#
# Version History:
#  v 1.00 - 2013.01.24 > First relase
#  v 1.01 - 2013.02.13 > Added scope toggle on menus
#                      > Compatibility with Action Effectiveness
#------------------------------------------------------------------------------
#  This script allows to setup certain action to have a option to toggle the
# targets of the action. You can switch between single/all targers or between
# allies/opponents. You can also setup actions to deal less damage if targeting
# all or have them to have the damage divided by the number of targets.
#------------------------------------------------------------------------------
# Compatibility
#   Requires the script 'Victor Engine - Basic Module' v 1.35 or higher
#   If used with 'Victor Engine - ' place this bellow it.
#
# * Overwrite methods
#   class Game_Action
#     def item
#     def attack?
#
# * Alias methods
#   class Game_Battler < Game_BattlerBase
#     def item_value_recover_hp(user, item, effect)
#     def item_value_recover_mp(user, item, effect)
#     def item_value_gain_tp(user, item, effect)
#     def item_apply(user, item)
#     def apply_guard(damage)
#     def use_item(item)
#
#   class Scene_Battle < Scene_Base
#     def update_all_windows
#     def command_attack
#     def on_skill_ok
#     def on_item_ok
#
#------------------------------------------------------------------------------
# Instructions:
#  To instal the script, open you script editor and paste this script on
#  a new section bellow the Materials section. This script must also
#  be bellow the script 'Victor Engine - Basic'
#
#------------------------------------------------------------------------------
# Skills and Items note tags
#   Tags to be used on the Skills and Items note box in the database
#
#  <scope toggle>
#   Actions with this tag can switch between single/all targers.
#
#  <target toggle>
#   Actions with this tag can switch between allies/opponents.
#
#  <split damage>
#   Actions with this tag will have it's damage divided by the number of
#   targets.
#
#  <all rate: x%>
#   Actions with this tag will have it's damage multiplied b x% when targeting
#   all, valid only with the tag <scope toggle>
#     x : damage rate
#
#  <scope validation>
#   Valid only on actions with <scope toggle>. Actions with this tag will be
#   only allowed to be toggled if the actor have the <scope validation> trait.
#
#  <target validation>
#   Valid only on actions with <target toggle>. Actions with this tag will be
#   only allowed to be toggled if the actor have the <target validation> trait.
#
#------------------------------------------------------------------------------
# Actors, Classes, States, Weapons and Armos note tags
#   Tags to be used on the Actors, Classes, States, Weapons and Armos note
#   box in the database
#
#  <scope validation>
#   This tag add a trait that allows to toggle the scope of actions with the
#   <scope validation> tag
#
#  <target validation>
#   This tag add a trait that allows to toggle the targets of actions with the
#   <target validation> tag
#
#------------------------------------------------------------------------------
# Additional instructions:
#
#   The <split damage> can be used on any actions, even the ones without the
#   tag <scope toggle>.
#
#==============================================================================
 
#==============================================================================
# ** Victor Engine
#------------------------------------------------------------------------------
#   Setting module for the Victor Engine
#==============================================================================
 
module Victor_Engine
  #--------------------------------------------------------------------------
  # * Setup the key that must be pressed for toggling scope (One / All)
  #    :A >> keyboard Shift  :B >> keyboard X      :C >> keyboard Z
  #    :X >> keyboard A      :Y >> keyboard S      :Z >> keyboard D
  #    :L >> keyboard Q      :R >> keyboard W
  #   you can add more than one key, you can press any of them
  #--------------------------------------------------------------------------
  VE_TOGGLE_SCOPE_KEYS = [:L, :R]
  #--------------------------------------------------------------------------
  # * Setup the key that must be pressed for toggling targets (Ally / Enemy)
  #    :A >> keyboard Shift  :B >> keyboard X      :C >> keyboard Z
  #    :X >> keyboard A      :Y >> keyboard S      :Z >> keyboard D
  #    :L >> keyboard Q      :R >> keyboard W
  #   you can add more than one key, you can press any of them
  #--------------------------------------------------------------------------
  VE_TOGGLE_TARGET_KEYS  = [:X, :Y]
  #--------------------------------------------------------------------------
  # * required
  #   This method checks for the existance of the basic module and other
  #   VE scripts required for this script to work, don't edit this
  #--------------------------------------------------------------------------
  def self.required(name, req, version, type = nil)
    if !$imported[:ve_basic_module]
      msg = "The script '%s' requires the script\n"
      msg += "'VE - Basic Module' v%s or higher above it to work properly\n"
      msg += "Go to http://victorscripts.wordpress.com/ to download this script."
      msgbox(sprintf(msg, self.script_name(name), version))
      exit
    else
      self.required_script(name, req, version, type)
    end
  end
  #--------------------------------------------------------------------------
  # * script_name
  #   Get the script name base on the imported value
  #--------------------------------------------------------------------------
  def self.script_name(name, ext = "VE")
    name = name.to_s.gsub("_", " ").upcase.split
    name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
    name.join(" ")
  end
end
 
$imported ||= {}
$imported[:ve_toggle_target] = 1.01
Victor_Engine.required(:ve_toggle_target, :ve_basic_module, 1.35, :above)
 
#==============================================================================
# ** RPG::UsableItem
#------------------------------------------------------------------------------
#  This is the superclass for skills and items.
#==============================================================================
 
class RPG::UsableItem < RPG::BaseItem
  #--------------------------------------------------------------------------
  # * New method: need_selection?
  #--------------------------------------------------------------------------
  def need_selection?
    @scope > 0
  end
  #--------------------------------------------------------------------------
  # * New method: scope_validation?
  #--------------------------------------------------------------------------
  def scope_validation?
    note =~ /<SCOPE VALIDATION>/i && scope_toggle?
  end
  #--------------------------------------------------------------------------
  # * New method: target_validation?
  #--------------------------------------------------------------------------
  def target_validation?
    note =~ /<TARGET VALIDATION>/i && target_toggle?
  end
  #--------------------------------------------------------------------------
  # * New method: scope_toggle?
  #--------------------------------------------------------------------------
  def scope_toggle?
    note =~ /<SCOPE TOGGLE>/i
  end
  #--------------------------------------------------------------------------
  # * New method: target_toggle?
  #--------------------------------------------------------------------------
  def target_toggle?
    note =~ /<TARGET TOGGLE>/i
  end
  #--------------------------------------------------------------------------
  # * New method: split_damage?
  #--------------------------------------------------------------------------
  def split_damage?
    note =~ /<SPLIT DAMAGE>/i
  end
  #--------------------------------------------------------------------------
  # * New method: all_rate
  #--------------------------------------------------------------------------
  def all_rate
    return @all_rate if @all_rate
    regexp       = /<ALL RATE: *(\d+)%?>/i 
    @all_rate = note =~ regexp ? $1.to_f / 100.0 : 1.0
    @all_rate
  end
  #--------------------------------------------------------------------------
  # * New method: scope_switch
  #--------------------------------------------------------------------------
  def scope_switch
    scope = @scope
    @scope = 2  if scope == 1
    @scope = 1  if scope == 2
    @scope = 8  if scope == 7
    @scope = 7  if scope == 8
    @scope = 10 if scope == 9
    @scope = 9  if scope == 10
  end
  #--------------------------------------------------------------------------
  # * New method: target_switch
  #--------------------------------------------------------------------------
  def target_switch
    scope  = @scope
    @scope = 7 if scope == 1
    @scope = 1 if scope == 7
    @scope = 8 if scope == 8
    @scope = 2 if scope == 2
  end
end
 
#==============================================================================
# ** Game_Action
#------------------------------------------------------------------------------
#  This class handles battle actions. This class is used within the
# Game_Battler class.
#==============================================================================
 
class Game_Action
  #--------------------------------------------------------------------------
  # * Overwrite method: item
  #--------------------------------------------------------------------------
  def item
    @object = nil                if @item.is_nil?
    @object = @item.object.clone if different_object? && !@item.is_nil?
    @object
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: attack?
  #--------------------------------------------------------------------------
  def attack?
    @item.object == $data_skills[subject.attack_skill_id]
  end
  #--------------------------------------------------------------------------
  # * New method: different_object?
  #--------------------------------------------------------------------------
  def different_object?
    @object.class != @item.object.class || !@object ||
    @object.id    != @item.object.id
  end
  #--------------------------------------------------------------------------
  # * New method: setup_scope
  #--------------------------------------------------------------------------
  def setup_scope(scope)
    item.scope = scope if item
  end
  #--------------------------------------------------------------------------
  # * New method: scope_switch
  #--------------------------------------------------------------------------
  def scope_switch
    return unless item
    item.scope_switch
  end
  #--------------------------------------------------------------------------
  # * New method: target_switch
  #--------------------------------------------------------------------------
  def target_switch
    return unless item
    item.target_switch
  end
end
 
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass of the Game_Actor
# and Game_Enemy classes.
#==============================================================================
 
class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # * Alias method: item_effect_recover_hp
  #--------------------------------------------------------------------------
  alias :item_value_recover_hp_ve_toggle_target :item_value_recover_hp
  def item_value_recover_hp(user, item, effect)
    value = item_value_recover_hp_ve_toggle_target(user, item, effect)
    value *= @all_damage / [@split_damage, 1].max
  end
  #--------------------------------------------------------------------------
  # * Alias method: item_effect_recover_mp
  #--------------------------------------------------------------------------
  alias :item_value_recover_mp_ve_toggle_target :item_value_recover_mp
  def item_value_recover_mp(user, item, effect)
    value = item_value_recover_mp_ve_toggle_target(user, item, effect)
    value *= @all_damage / [@split_damage, 1].max
  end
  #--------------------------------------------------------------------------
  # * Alias method: item_effect_recover_tp
  #--------------------------------------------------------------------------
  alias :item_value_recover_tp_ve_toggle_target :item_value_recover_tp
  def item_value_recover_tp(user, item, effect)
    value = item_value_recover_tp_ve_toggle_target(user, item, effect)
    value *= @all_damage / [@split_damage, 1].max
  end
  #--------------------------------------------------------------------------
  # * Alias method: item_apply
  #--------------------------------------------------------------------------
  alias :item_apply_ve_toggle_target :item_apply
  def item_apply(user, item)
    make_damage_rate(user, item)
    item_apply_ve_toggle_target(user, item)
  end
  #--------------------------------------------------------------------------
  # * Alias method: apply_guard
  #--------------------------------------------------------------------------
  alias :apply_guard_all_ve_toggle_target :apply_guard
  def apply_guard(damage)
    damage  = apply_guard_all_ve_toggle_target(damage)
    damage *= @all_damage
    damage /= [@split_damage, 1].max
    damage
  end
  #--------------------------------------------------------------------------
  # * Alias method: use_item
  #--------------------------------------------------------------------------
  alias :use_item_all_ve_toggle_target :use_item
  def use_item(item)
    @target_size = set_target_size(item)
    use_item_all_ve_toggle_target(item)
  end
  #--------------------------------------------------------------------------
  # * New method: make_damage_all_rate
  #--------------------------------------------------------------------------
  def make_damage_rate(user, item)
    @all_damage   = user.all_damage?(item)   ? item.all_rate    : 1.0
    @split_damage = user.split_damage?(item) ? user.target_size : 1.0
  end
  #--------------------------------------------------------------------------
  # * New method: all_damage?
  #--------------------------------------------------------------------------
  def all_damage?(item)
    item.for_all? && item.scope_toggle? && target_size > 1
  end
  #--------------------------------------------------------------------------
  # * New method: split_damage?
  #--------------------------------------------------------------------------
  def split_damage?(item)
    item.for_all? && item.split_damage? && target_size > 1
  end
  #--------------------------------------------------------------------------
  # * New method: target_size
  #--------------------------------------------------------------------------
  def target_size
    @target_size ? @target_size : 1
  end
  #--------------------------------------------------------------------------
  # * New method: set_target_size
  #--------------------------------------------------------------------------
  def set_target_size(item)
    return opponents_unit.alive_members.size if item.for_opponent?
    return friends_unit.dead_members.size    if item.for_dead_friend?
    return friends_unit.alive_members.size   if item.for_friend?
    return 1
  end
  #--------------------------------------------------------------------------
  # * New method: scope_toggle?
  #--------------------------------------------------------------------------
  def scope_toggle?(item)
    !item.scope_validation? || get_all_notes =~ /<SCOPE VALIDATION>/i
  end
  #--------------------------------------------------------------------------
  # * New method: target_toggle?
  #--------------------------------------------------------------------------
  def target_toggle?(item)
    !item.target_validation? || get_all_notes =~ /<TARGET VALIDATION>/i
  end
end
 
#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
#  This window contains cursor movement and scroll functions.
#==============================================================================
 
class Window_Selectable < Window_Base
  #--------------------------------------------------------------------------
  # * New method: set_action
  #--------------------------------------------------------------------------
  def set_action(action)
    @action = action
  end
  #--------------------------------------------------------------------------
  # * New method: scope_toggle?
  #--------------------------------------------------------------------------
  def scope_toggle?(battler)
    active && VE_TOGGLE_SCOPE_KEYS.any? {|i| Input.trigger?(i) } &&
    @action && @action.scope_toggle? && battler.scope_toggle?(@action)
  end
  #--------------------------------------------------------------------------
  # * New method: target_toggle?
  #--------------------------------------------------------------------------
  def target_toggle?(battler)
    active  && VE_TOGGLE_TARGET_KEYS.any? {|i| Input.trigger?(i) } &&
    @action && @action.target_toggle? && battler.target_toggle?(@action)
  end
  #--------------------------------------------------------------------------
  # * New method: menu_toggle?
  #--------------------------------------------------------------------------
  def menu_toggle?(item)
    @action = item
    active && $game_party.alive_members.any? {|actor| scope_toggle?(actor) }
  end
end
 
#==============================================================================
# ** Scene_ItemBase
#------------------------------------------------------------------------------
#  This is the superclass for the classes that performs the item and skill
# screens.
#==============================================================================
 
class Scene_ItemBase < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Overwrite method: item
  #--------------------------------------------------------------------------
  def item
    @item ? @item : @item_window.item
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: update_all_windows
  #--------------------------------------------------------------------------
  def update_all_windows
    super
    update_actor_toggle if @actor_window.menu_toggle?(item)
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_actor_cancel
  #--------------------------------------------------------------------------
  alias :on_actor_cancel_ve_toggle_target :on_actor_cancel
  def on_actor_cancel
    on_actor_cancel_ve_toggle_target
    @item = nil
  end
  #--------------------------------------------------------------------------
  # * New method: update_actor_toggle
  #--------------------------------------------------------------------------
  def update_actor_toggle
    @item = item.clone
    @item.scope_switch
    @actor_window.select_for_item(item)
  end
end
 
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================
 
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Overwrite method: update_all_windows
  #--------------------------------------------------------------------------
  alias :update_all_ve_toggle_target :update_all_windows
  def update_all_windows
    update_target_scope_toggle
    $imported[:ve_active_time_battle] ? update_all_ve_toggle_target : super
  end
  #--------------------------------------------------------------------------
  # * Alias method: command_attack
  #--------------------------------------------------------------------------
  alias :command_attack_ve_toggle_target :command_attack
  def command_attack
    set_window_action($data_skills[BattleManager.actor.attack_skill_id])
    command_attack_ve_toggle_target
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_skill_ok
  #--------------------------------------------------------------------------
  alias :on_skill_ok_ve_toggle_target :on_skill_ok
  def on_skill_ok
    set_window_action(@skill_window.item)
    on_skill_ok_ve_toggle_target
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_item_ok
  #--------------------------------------------------------------------------
  alias :on_item_ok_ve_toggle_target :on_item_ok
  def on_item_ok
    set_window_action(@item_window.item)
    on_item_ok_ve_toggle_target
  end
  #--------------------------------------------------------------------------
  # * New method: set_window_action
  #--------------------------------------------------------------------------
  alias :set_window_action_ve_toggle_target :set_window_action if $imported[:ve_target_arrow]
  def set_window_action(item)
    if $imported[:ve_target_arrow]
      set_window_action_ve_toggle_target(item)
    else
      @enemy_window.set_action(item) if item.for_opponent?
      @actor_window.set_action(item) if item.for_friend?
      @enemy_window.cursor_all = item.for_opponent? && item.for_all?
      @actor_window.cursor_all = item.for_friend?   && item.for_all?
    end
  end
  #--------------------------------------------------------------------------
  # * New method: update_target_scope_toggle
  #--------------------------------------------------------------------------
  def update_target_scope_toggle
    update_scope_toggle
    update_target_toggle
  end
  #--------------------------------------------------------------------------
  # * New method: update_scope_toggle
  #--------------------------------------------------------------------------
  def update_scope_toggle
    actor = BattleManager.actor
    return update_enemy_scope if @enemy_window.scope_toggle?(actor)
    return update_actor_scope if @actor_window.scope_toggle?(actor)
  end
  #--------------------------------------------------------------------------
  # * New method: update_target_toggle
  #--------------------------------------------------------------------------
  def update_target_toggle
    actor = BattleManager.actor
    return update_enemy_toggle if @enemy_window.target_toggle?(actor)
    return update_actor_toggle if @actor_window.target_toggle?(actor)
  end
  #--------------------------------------------------------------------------
  # * New method: update_enemy_scope
  #--------------------------------------------------------------------------
  def update_enemy_scope
    BattleManager.actor.input.scope_switch
    set_window_action(BattleManager.actor.input.item)
    @enemy_window.update_cursor
  end
  #--------------------------------------------------------------------------
  # * New method: update_actor_scope
  #--------------------------------------------------------------------------
  def update_actor_scope
    BattleManager.actor.input.scope_switch
    set_window_action(BattleManager.actor.input.item)
    @actor_window.update_cursor
  end
  #--------------------------------------------------------------------------
  # * New method: update_enemy_toggle
  #--------------------------------------------------------------------------
  def update_enemy_toggle
    BattleManager.actor.input.target_switch
    set_window_action(BattleManager.actor.input.item)
    @enemy_window.hide.deactivate
    select_actor_selection
  end
  #--------------------------------------------------------------------------
  # * New method: update_actor_toggle
  #--------------------------------------------------------------------------
  def update_actor_toggle
    BattleManager.actor.input.target_switch
    set_window_action(BattleManager.actor.input.item)
    @actor_window.hide.deactivate
    select_enemy_selection
  end
end

 

Edit: Yeah sorry Tiagoms, I tried finding the script for the target arrow but nothing for now. I'll see if I can ask or maybe William can come and see if he has a script for this. He also knows Victor Engine too so maybe he has the script for it. I'll see what I can do.

Edited by LadyMinerva

Share this post


Link to post
Share on other sites

I'll be waiting =)

Anyway, thank you =)

 

 

 

EDit ---------

 

 

Victor Engine - Target Arrow

 

 

 

#==============================================================================
# ** Victor Engine - Target Arrow
#------------------------------------------------------------------------------
# Author : Victor Sant
#
# Version History:
#  v 1.00 - 2012.01.15 > First release
#  v 1.01 - 2012.03.08 > Fixed self action help name display
#  v 1.02 - 2012.05.30 > Fixed bug with Loop Animation arrow
#  v 1.03 - 2012.08.02 > Compatibility with Basic Module 1.27
#  v 1.04 - 2012.11.03 > Compatibility with Direct Commands
#                      > Fixed issue with line 408 undefined method
#  v 1.05 - 2012.12.24 > Compatibility with Active Time Battle
#  v 1.06 - 2012.12.30 > Fixed issue with enemy name when cancel selection
#  v 1.07 - 2013.01.07 > Improved arrow movement
#  v 1.08 - 2013.01.24 > Compatibility with Toggle Target
#------------------------------------------------------------------------------
#  This script allows to change target selection to a arrow like selection.
# It's possible to make it animated and set different graphics for enemies
# and actors target selections.
# If using the script 'Victor Engine - Loop Animation', it's also possible
# to make the cursor an animation
#------------------------------------------------------------------------------
# Compatibility
#   Requires the script 'Victor Engine - Basic Module' v 1.27 or higher
#   If used with 'Victor Engine - Custom Basic Actions' place this bellow it.
# 
# * Overwrite methods
#   class RPG::UsableItem < RPG::BaseItem
#     def need_selection?
#
#   class Window_BattleEnemy < Window_Selectable
#     def show
#     def hide
#     def cursor_movable?
#     def cursor_down(wrap = false)
#     def cursor_up(wrap = false)
#     def cursor_right(wrap = false)
#     def cursor_left(wrap = false)
#     def update_help
#
#   class Window_BattleActor < Window_BattleStatus
#     def cursor_movable?
#     def cursor_down(wrap = false)
#     def cursor_up(wrap = false)
#     def cursor_right(wrap = false)
#     def cursor_left(wrap = false)
#     def update_help
#     def update_cursor
#
# * Alias methods
#   class Window_BattleEnemy < Window_Selectable
#     def initialize(info_viewport)
#     def update
#     def dispose
#
#   class Window_BattleActor < Window_BattleStatus
#     def initialize(info_viewport)
#     def update
#     def show
#     def hide
#     def update_cursor
#     def dispose
#
#   class Scene_Battle < Scene_Base
#     def create_actor_window
#     def create_enemy_window
#     def command_attack
#     def on_skill_ok
#     def on_item_ok
#     def on_enemy_cancel
#     def on_actor_cancel
#
#------------------------------------------------------------------------------
# Instructions:
#  To instal the script, open you script editor and paste this script on
#  a new section bellow the Materials section. This script must also
#  be bellow the scripts 'Victor Engine - Basic'
#
#------------------------------------------------------------------------------
# Skills and Items note tags:
#   Tags to be used on Skills and Items note boxes.
#
#  <target description>
#  string
#  </target description>
#   The target description text, the string is the text, to add a break line
#   use \\n.
#
#------------------------------------------------------------------------------
# Additional instructions:
#
#  The cursors graphics must be in the folder Graphics/System.
#
#  To use animations as cursors you need the script  
#  'Victor Engine - Loop Animation' v 1.02 or higher. 
#
#==============================================================================

#==============================================================================
# ** Victor Engine
#------------------------------------------------------------------------------
#   Setting module for the Victor Engine
#==============================================================================

module Victor_Engine
  #--------------------------------------------------------------------------
  # * Set the automatic text control codes
  #   when false, it's needed to add \# on the start of the text to use
  #   control codes
  #--------------------------------------------------------------------------
  VE_ARROW_DEFAULT = {
    name:   "Cursor", # Cursor graphic filename ("filename")
    frames: 4,        # Number of frames of the arrow (1 for no animation)
    speed:  10,       # Cursto animation wait time (60 frames = 1 second)
    height: true,     # Adjust arrow based on target height
    help:   true,     # Show help window when selecting target
    x:      0,        # Coordinate x adjust
    y:      0,        # Coordinate y adjust
    move:   0,        # Set move type. 0 : all directions, 1 : left and right
                      # 2 : up and down
    anim:   111,        # Animation ID displayed as arrow. Requires the script
                      # "Victor Engine - Loop Animation", this makes the
                      # arrow a looping battle animation instead of a
                      # simple bitmap graphic
  } # Don't remove
  #--------------------------------------------------------------------------
  # * Custom arrow settings
  #    Set different configuration for arrows based on the window class
  #    it is being shown. It needs to add only the changed values.
  #      type: {setting},
  #      type: actor: or enemy:
  #--------------------------------------------------------------------------
  VE_ARROW_CUSTOM = {
    actor: {name: "Green Cursor"},
    enemy: {name: "Blue Cursor"},
  } # Don't remove
  #--------------------------------------------------------------------------
  # * Hide skill window during target selection
  #    Since the window is placed above the battlers, the arrow stay behind
  #    the skill window. you can set it false if the window is placed
  #    in a different position with scripts.
  #--------------------------------------------------------------------------
  VE_HIDE_SKILL_WINDOW = true
  #--------------------------------------------------------------------------
  # * Hide item window during target selection
  #    Since the window is placed above the battlers, the arrow stay behind
  #    the item window. you can set it false if the window is placed
  #    in a different position with scripts.
  #--------------------------------------------------------------------------
  VE_HIDE_ITEM_WINDOW = true
  #--------------------------------------------------------------------------
  # * Set the use of target help window
  #--------------------------------------------------------------------------
  VE_USE_TARGET_HELP = true
  #--------------------------------------------------------------------------
  # * Settings for the target help window.
  #--------------------------------------------------------------------------
  VE_TARGET_HELP_WINDOW = {
    text_align:    1,    # Text align, 0: left, 1: center, 2: right
    target_info:   true, # If true show target info, if false show skill name
    all_enemies:   "All Enemies",   # Target info for all enemies actions
    all_actors:    "All Allies",    # Target info for all actors actions
    all_target:    "All Targets",   # Target info for all targets actions
    random_enemy:  "Random Enemy",  # Target info for random enemy actions
    random_actor:  "Random Ally",   # Target info for random actor actions
    random_target: "Random Target", # Target info for random target actions
  } # Don't remove
  #--------------------------------------------------------------------------
  # * required
  #   This method checks for the existance of the basic module and other
  #   VE scripts required for this script to work, don't edit this
  #--------------------------------------------------------------------------
  def self.required(name, req, version, type = nil)
    if !$imported[:ve_basic_module]
      msg = "The script '%s' requires the script\n"
      msg += "'VE - Basic Module' v%s or higher above it to work properly\n"
      msg += "Go to http://victorscripts.wordpress.com/ to download this script."
      msgbox(sprintf(msg, self.script_name(name), version))
      exit
    else
      self.required_script(name, req, version, type)
    end
  end
  #--------------------------------------------------------------------------
  # * script_name
  #   Get the script name base on the imported value, don't edit this
  #--------------------------------------------------------------------------
  def self.script_name(name, ext = "VE")
    name = name.to_s.gsub("_", " ").upcase.split
    name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
    name.join(" ")
  end
end

$imported ||= {}
$imported[:ve_target_arrow] = 1.08
Victor_Engine.required(:ve_target_arrow, :ve_basic_module, 1.27, :above)
Victor_Engine.required(:ve_target_arrow, :ve_toggle_target, 1.00, :bellow)

#==============================================================================
# ** RPG::UsableItem
#------------------------------------------------------------------------------
#  This is the superclass for skills and items.
#==============================================================================

class RPG::UsableItem < RPG::BaseItem
  #--------------------------------------------------------------------------
  # * Overwrite method: need_selection?
  #--------------------------------------------------------------------------
  def need_selection?
    @scope > 0
  end
end

#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
#  This window contains cursor movement and scroll functions.
#==============================================================================

class Window_Selectable < Window_Base
  #--------------------------------------------------------------------------
  # * New method: init_arrow
  #--------------------------------------------------------------------------
  def init_arrow
    @arrows = []
    @arrows_anim = 0
    @arrows_value = VE_ARROW_CUSTOM.dup
    @arrows_value.default = VE_ARROW_DEFAULT.dup
    @arrows_value.each do |key, value|
      arrow = @arrows_value[key]
      arrow[:x]      = VE_ARROW_DEFAULT[:x]      if !value[:x]
      arrow[:y]      = VE_ARROW_DEFAULT[:y]      if !value[:y]
      arrow[:name]   = VE_ARROW_DEFAULT[:name]   if !value[:name]
      arrow[:frames] = VE_ARROW_DEFAULT[:frames] if !value[:frames]
      arrow[:rect]   = VE_ARROW_DEFAULT[:rect]   if !value[:rect]
      arrow[:speed]  = VE_ARROW_DEFAULT[:speed]  if !value[:speed]
      arrow[:anim]   = VE_ARROW_DEFAULT[:anim]   if !value[:anim]
      arrow[:move]   = VE_ARROW_DEFAULT[:move]   if !value[:move]
      arrow[:height] = VE_ARROW_DEFAULT[:height] if !value[:height]
    end
  end
  #--------------------------------------------------------------------------
  # * New method: init_arrow_sprite
  #--------------------------------------------------------------------------
  def init_arrow_sprite(forced = false)
    dispose_arrow if @arrows_index != @index || forced || item_max == 0
    return unless active
    if target_all? && item_max > 0
      item_max.times {|i| create_arrow_sprite(i) }
    elsif @index > -1 && item_max > 0
      create_arrow_sprite(0)
    end
    @arrows_index = @index
    update_arrow_sprite
  end
  #--------------------------------------------------------------------------
  # * New method: set_action
  #--------------------------------------------------------------------------
  def set_action(action)
    @action = action
  end
  #--------------------------------------------------------------------------
  # * New method: target_all?
  #--------------------------------------------------------------------------
  def target_all?
    @action && (@action.for_all? || @action.for_random?)
  end
  #--------------------------------------------------------------------------
  # * New method: target_self?
  #--------------------------------------------------------------------------
  def target_self?
    @action && @action.for_user?
  end
  #--------------------------------------------------------------------------
  # * New method: create_arrow_sprite
  #--------------------------------------------------------------------------
  def create_arrow_sprite(i)
    return if @arrows[i]
    @arrows[i] = Sprite_Base.new
    @arrows[i].bitmap = Cache.system(arrow_filename)
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_animation
  #--------------------------------------------------------------------------
  def arrow_animation?
    arrow_animation != 0 && $imported[:ve_loop_animation]
  end
  #--------------------------------------------------------------------------
  # * New method: update_arrow_sprite
  #--------------------------------------------------------------------------
  def update_arrow_sprite
    @arrows.each_index do |i|
      next unless @arrows[i] && target(i)
      @arrows[i].viewport = target(i).sprite.viewport
      arrow_animation? ? set_arrow_animation(i) : set_arrow_bitmap(i)
      update_arrow_position(i)
    end
    update_all_arrows
  end
  #--------------------------------------------------------------------------
  # * New method: set_arrow_bitmap
  #--------------------------------------------------------------------------
  def set_arrow_bitmap(i)
    bitmap = @arrows[i].bitmap
    arrow_width   = bitmap.width / arrow_frames
    current_frame = arrow_width * @arrows_anim
    @arrows[i].src_rect.set(current_frame, 0, arrow_width, bitmap.height)
  end
  #--------------------------------------------------------------------------
  # * New method: set_arrow_animation
  #--------------------------------------------------------------------------
  def set_arrow_animation(i)
    target = target(i)
    return if !target || target.sprite.loop_anim?(:arrow)
    settings = {anim: arrow_animation, type: :arrow, loop: 1}
    target.sprite.add_loop_animation(settings)
  end
  #--------------------------------------------------------------------------
  # * New method: update_arrow_position
  #--------------------------------------------------------------------------
  def update_arrow_position(i)
    adjust = arrow_height ? target(i).sprite.oy / 2 : 0
    @arrows[i].x  = position_x(i) + arrow_x
    @arrows[i].y  = position_y(i) + arrow_y - adjust
    @arrows[i].z  = self.z + 1000
    @arrows[i].ox = @arrows[i].width  / 2
    @arrows[i].oy = @arrows[i].height / 2
  end
  #--------------------------------------------------------------------------
  # * New method: position_x
  #--------------------------------------------------------------------------
  def position_x(i)
    $imported[:ve_animated_battle] ? target(i).current_x : target(i).screen_x
  end
  #--------------------------------------------------------------------------
  # * New method: position_y
  #--------------------------------------------------------------------------
  def position_y(i)
    $imported[:ve_animated_battle] ? target(i).current_y : target(i).screen_y
  end
  #--------------------------------------------------------------------------
  # * New method: update_all_arrows
  #--------------------------------------------------------------------------
  def update_all_arrows
    @arrows.each {|arrow| arrow.update }
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_frames
  #--------------------------------------------------------------------------
  def target_window_type
    instance_of?(Window_BattleEnemy) ? :enemy : :actor
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_filename
  #--------------------------------------------------------------------------
  def arrow_filename
    arrow_animation? ? "" : @arrows_value[target_window_type][:name]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_frames
  #--------------------------------------------------------------------------
  def arrow_frames
    [@arrows_value[target_window_type][:frames], 1].max
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_old_rect
  #--------------------------------------------------------------------------
  def arrow_old_rect
    @arrows_value[target_window_type][:rect]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_animspeed
  #--------------------------------------------------------------------------
  def arrow_animspeed
    [@arrows_value[target_window_type][:speed], 1].max
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_x
  #--------------------------------------------------------------------------
  def arrow_x
    @arrows_value[target_window_type][:x]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_y
  #--------------------------------------------------------------------------
  def arrow_y
    @arrows_value[target_window_type][:y]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_animation
  #--------------------------------------------------------------------------
  def arrow_animation
    @arrows_value[target_window_type][:anim]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_height
  #--------------------------------------------------------------------------
  def arrow_height
    @arrows_value[target_window_type][:height]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_move
  #--------------------------------------------------------------------------
  def arrow_move
    @arrows_value[target_window_type][:move]
  end
  #--------------------------------------------------------------------------
  # * New method: help_info
  #--------------------------------------------------------------------------
  def help_info
    VE_TARGET_HELP_WINDOW
  end
  #--------------------------------------------------------------------------
  # * New method: target_description
  #--------------------------------------------------------------------------
  def target_description
    return "" unless @action
    regexp = get_all_values("TARGET DESCRIPTION")
    text   = ""
    @action.note.scan(regexp) do
      info = $1.dup
      info.gsub!(/\r\n/) { "" }
      info.gsub!(/\\n/)  { "\r\n" }
      text += info
    end
    text
  end
  #--------------------------------------------------------------------------
  # * New method: update_target_help
  #--------------------------------------------------------------------------  
  def update_target_help
    text  = target_description
    align = help_info[:text_align]
    @help_window.visible = true
    if text != ""
      @help_window.set_info_text(text, align)
    else
      if help_info[:target_info]
        draw_tartge_info(align)
      else
        @help_window.set_item_text(@action, align)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * New method: draw_tartge_inf
  #--------------------------------------------------------------------------  
  def draw_tartge_info(align)
    if @action.for_one?
      @help_window.set_target_text(target(0), align)
    elsif @action.for_all? && @action.for_random? 
      text = help_info[:random_enemies] if @action.for_opponent? 
      text = help_info[:random_actors]  if @action.for_friend? 
      text = help_info[:random_target]  if @action.for_all_targets?
      @help_window.set_info_text(text, align)
    elsif @action.for_all? && !@action.for_random? 
      text = help_info[:all_enemies] if @action.for_opponent? 
      text = help_info[:all_actors]  if @action.for_friend? 
      text = help_info[:all_target]  if @action.for_all_targets?
      @help_window.set_info_text(text, align)
    end
  end
end

#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
#  This window shows skill and item explanations along with actor status.
#==============================================================================

class Window_Help < Window_Base
  #--------------------------------------------------------------------------
  # * Alias method: set_item
  #--------------------------------------------------------------------------
  alias :set_item_ve_arrow_arrow :set_item
  def set_item(item)
    set_item_ve_arrow_arrow(item)
    refresh
  end
  #--------------------------------------------------------------------------
  # * New method: set_target_text
  #--------------------------------------------------------------------------
  def set_target_text(target, align = 0)
    if target && (target != @target || @target.name != @text)
      @text   = ""
      @target = target
      @align  = align
      target_info
    end
  end
  #--------------------------------------------------------------------------
  # * New method: set_info_text
  #--------------------------------------------------------------------------
  def set_info_text(text, align = 0)
    if text != @text
      @text = text
      contents.clear
      adj = @text[/\r\n/i]
      draw_text(0, 0, width, line_height * (adj ? 1 : 2), @text, align)
    end
  end
  #--------------------------------------------------------------------------
  # * New method: set_item_text
  #--------------------------------------------------------------------------
  def set_item_text(item, align = 0)
    if item.name != @text
      @text = item.name
      contents.clear
      iw = item.icon_index == 0 ? 0 : 24
      text_width = text_size(@text).width
      x = align == 0 ? 0 : (contents_width - 24 - text_width) / (3 - align)
      draw_icon(item.icon_index, x, line_height / 2, true)
      draw_text(iw + 2, 0, contents_width - iw, line_height * 2, @text, align)
    end
  end
  #--------------------------------------------------------------------------
  # * New method: target_info
  #--------------------------------------------------------------------------
  def target_info
    contents.clear
    change_color(hp_color(@target))
    adj = (@target.state_icons + @target.buff_icons).size == 0
    height = line_height * (adj ? 2 : 1)
    draw_text(0, 0, contents_width, height, @target.name, @align)
    draw_target_icons
  end
  #--------------------------------------------------------------------------
  # * New method: draw_target_icons
  #--------------------------------------------------------------------------
  def draw_target_icons
    icons = (@target.state_icons + @target.buff_icons)[0, contents_width / 24]
    x = @align == 0 ? 0 : (contents_width - icons.size * 24) / (3 - @align)
    icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, line_height) }
  end
end

#==============================================================================
# ** Window_BattleEnemy
#------------------------------------------------------------------------------
#  This window display a list of enemies on the battle screen.
#==============================================================================

class Window_BattleEnemy < Window_Selectable
  #--------------------------------------------------------------------------
  # * Overwrite method: show
  #--------------------------------------------------------------------------
  def show
    result = super
    fix_selection(arrow_move == 1 ? :horz : :vert)
    select(0)
    init_arrow_sprite(true)
    self.visible = false
    result
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: hide
  #--------------------------------------------------------------------------
  def hide
    result = super
    dispose_arrow
    result
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: enemy
  #--------------------------------------------------------------------------
  def enemy
    enemy_list[@index]
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_movable?
  #--------------------------------------------------------------------------
  def cursor_movable?
    super && active && !cursor_all && !target_all? && !target_self?
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_down
  #--------------------------------------------------------------------------
  def cursor_down(wrap = false)
    fix_selection(:vert) if arrow_move != 1 && @mode == :horz
    select((index - 1 + item_max) % item_max) if arrow_move != 1
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_up
  #--------------------------------------------------------------------------
  def cursor_up(wrap = false)
    fix_selection(:vert) if arrow_move != 1 && @mode == :horz
    select((index + 1) % item_max) if arrow_move != 1
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_right
  #--------------------------------------------------------------------------
  def cursor_right(wrap = false)
    fix_selection(:horz) if arrow_move != 2 && @mode == :vert
    select((index + 1) % item_max) if arrow_move != 2
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_left
  #--------------------------------------------------------------------------
  def cursor_left(wrap = false)
    fix_selection(:horz) if arrow_move != 2 && @mode == :vert
    select((index - 1 + item_max) % item_max) if arrow_move != 2
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: update_help
  #--------------------------------------------------------------------------
  def update_help
    update_target_help
  end
  #--------------------------------------------------------------------------
  # * Alias method: initialize
  #--------------------------------------------------------------------------
  alias :initialize_ve_arrow_arrow :initialize
  def initialize(info_viewport)
    initialize_ve_arrow_arrow(info_viewport)
    init_arrow
  end
  #--------------------------------------------------------------------------
  # * Alias method: update
  #--------------------------------------------------------------------------
  alias :update_ve_arrow_arrow :update
  def update
    update_ve_arrow_arrow
    init_arrow_sprite
    update_arrow_sprite
    return if Graphics.frame_count % arrow_animspeed != 0
    @arrows_anim = (@arrows_anim + 1) % arrow_frames
  end
  #--------------------------------------------------------------------------
  # * Alias method: dispose
  #--------------------------------------------------------------------------
  alias :dispose_ve_arrow_arrow :dispose
  def dispose
    dispose_ve_arrow_arrow
    dispose_arrow
  end
  #--------------------------------------------------------------------------
  # * New method: enemies
  #--------------------------------------------------------------------------
  def enemies
    enemy_list
  end
  #--------------------------------------------------------------------------
  # * New method: enemy_list
  #--------------------------------------------------------------------------
  def enemy_list
    enemies = $game_troop.alive_members.dup
    enemies.sort! {|a, b| b.screen_y <=> a.screen_y } if @mode == :vert
    enemies.sort! {|a, b| a.screen_x <=> b.screen_x } if @mode == :horz
    enemies
  end
  #--------------------------------------------------------------------------
  # * New method: fix_selection
  #--------------------------------------------------------------------------
  def fix_selection(type)
    current = enemy
    @mode   = type
    @index  = enemy_list.index(current)
  end
  #--------------------------------------------------------------------------
  # * New method: target
  #--------------------------------------------------------------------------
  def target(i)
    target_all? ? enemies[i] : enemy
  end
  #--------------------------------------------------------------------------
  # * New method: dispose_arrow
  #--------------------------------------------------------------------------
  def dispose_arrow
    if arrow_animation?
      enemies.each do |enemy|
        enemy.sprite && enemy.sprite.end_loop_anim(:arrow)
      end
    end
    @arrows.each {|arrow| arrow.dispose }
    @arrows.clear
  end
end

#==============================================================================
# ** Window_BattleActor
#------------------------------------------------------------------------------
#  This window display a list of actors on the battle screen.
#==============================================================================

class Window_BattleActor < Window_BattleStatus
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_movable?
  #--------------------------------------------------------------------------
  def cursor_movable?
    super && active && !cursor_all && !target_all? && !target_self?
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_down
  #--------------------------------------------------------------------------
  def cursor_down(wrap = false)
    return if show_actor && arrow_move == 1
    fix_selection(:vert) if show_actor && arrow_move != 1 && @mode == :horz
    show_actor ? select((index + 1) % item_max) : super
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_up
  #--------------------------------------------------------------------------
  def cursor_up(wrap = false)
    return if show_actor && arrow_move == 1
    fix_selection(:vert) if show_actor && arrow_move != 1 && @mode == :horz
    show_actor ? select((index - 1 + item_max) % item_max) : super
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_right(
  #--------------------------------------------------------------------------
  def cursor_right(wrap = false)
    return if show_actor && arrow_move == 2
    fix_selection(:horz) if show_actor && arrow_move != 2 && @mode == :vert
    show_actor ? select((index + 1) % item_max) : super
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_left
  #--------------------------------------------------------------------------
  def cursor_left(wrap = false)
    return if show_actor && arrow_move == 2
    fix_selection(:horz) if show_actor && arrow_move != 2 && @mode == :vert
    show_actor ? select((index - 1 + item_max) % item_max) :  super
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: update_help
  #--------------------------------------------------------------------------
  def update_help
    update_target_help
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: update_cursor
  #--------------------------------------------------------------------------
  def update_cursor
    @cursor_all = cursor_all
    super
  end
  #--------------------------------------------------------------------------
  # * Alias method: initialize
  #--------------------------------------------------------------------------
  alias :initialize_ve_arrow_arrow :initialize
  def initialize(info_viewport)
    initialize_ve_arrow_arrow(info_viewport)
    init_arrow if show_actor
  end
  #--------------------------------------------------------------------------
  # * Alias method: update
  #--------------------------------------------------------------------------
  alias :update_ve_arrow_arrow :update
  def update
    update_ve_arrow_arrow
    return unless show_actor
    init_arrow_sprite
    update_arrow_sprite
    return if Graphics.frame_count % arrow_animspeed != 0
    @arrows_anim = (@arrows_anim + 1) % arrow_frames
  end
  #--------------------------------------------------------------------------
  # * Alias method: show
  #--------------------------------------------------------------------------
  alias :show_ve_arrow_arrow :show
  def show
    if show_actor
      result = super
      self.visible = false
      select(0)
      result
    else
      show_ve_arrow_arrow
    end
  end
  #--------------------------------------------------------------------------
  # * Alias method: hide
  #--------------------------------------------------------------------------
  alias :hide_ve_arrow_arrow :hide
  def hide
    result = hide_ve_arrow_arrow
    dispose_arrow if show_actor
    result
  end
  #--------------------------------------------------------------------------
  # * Alias method: dispose
  #--------------------------------------------------------------------------
  alias :update_cursor_ve_arrow_arrow :update_cursor
  def update_cursor
    show_actor ? cursor_rect.empty : update_cursor_ve_arrow_arrow
  end
  #--------------------------------------------------------------------------
  # * Alias method: dispose
  #--------------------------------------------------------------------------
  alias :dispose_ve_arrow_arrow :dispose
  def dispose
    dispose_ve_arrow_arrow
    dispose_arrow if show_actor 
  end
  #--------------------------------------------------------------------------
  # * New method: cursor_all
  #--------------------------------------------------------------------------
  def cursor_all
    @action && @action.for_all?
  end
  #--------------------------------------------------------------------------
  # * New method: actor
  #--------------------------------------------------------------------------
  def actor
    actor_list[@index]
  end
  #--------------------------------------------------------------------------
  # * New method: actors
  #--------------------------------------------------------------------------
  def actors
    actor_list
  end
  #--------------------------------------------------------------------------
  # * New method: enemy_list
  #--------------------------------------------------------------------------
  def actor_list
    actors = $game_party.battle_members.dup
    actors.sort! {|a, b| b.screen_y <=> a.screen_y } if @mode == :vert
    actors.sort! {|a, b| a.screen_x <=> b.screen_x } if @mode == :horz
    actors
  end
  #--------------------------------------------------------------------------
  # * New method: fix_selection
  #--------------------------------------------------------------------------
  def fix_selection(type)
    current = actor
    @mode   = type
    @index  = actor_list.index(current)
  end
  #--------------------------------------------------------------------------
  # * New method: target
  #--------------------------------------------------------------------------
  def target(i)
    @index = BattleManager.actor.index if @action.for_user?
    target_all? ? actors[i] : actor
  end
  #--------------------------------------------------------------------------
  # * New method: show_actor
  #--------------------------------------------------------------------------
  def show_actor
    $imported[:ve_actor_battlers]
  end
  #--------------------------------------------------------------------------
  # * New method: dispose_arrow
  #--------------------------------------------------------------------------
  def dispose_arrow
    if arrow_animation?
      actors.each {|actor| actor.sprite.end_loop_anim(:arrow) if actor.sprite }
    end
    @arrows.each {|arrow| arrow.dispose }
    @arrows.clear
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias method: create_actor_window
  #--------------------------------------------------------------------------
  alias :create_actor_window_ve_arrow_arrow :create_actor_window
  def create_actor_window
    create_actor_window_ve_arrow_arrow
    @actor_window.help_window = @help_window if VE_USE_TARGET_HELP
  end
  #--------------------------------------------------------------------------
  # * Alias method: create_enemy_window
  #--------------------------------------------------------------------------
  alias :create_enemy_window_ve_arrow_arrow :create_enemy_window
  def create_enemy_window
    create_enemy_window_ve_arrow_arrow
    @enemy_window.help_window = @help_window if VE_USE_TARGET_HELP
  end
  #--------------------------------------------------------------------------
  # * Alias method: command_attack
  #--------------------------------------------------------------------------
  alias :command_attack_ve_arrow_arrow :command_attack
  def command_attack
    set_window_action($data_skills[BattleManager.actor.attack_skill_id])
    command_attack_ve_arrow_arrow
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_skill_ok
  #--------------------------------------------------------------------------
  alias :on_skill_ok_ve_arrow_arrow :on_skill_ok
  def on_skill_ok
    set_window_action(@skill_window.item)
    on_skill_ok_ve_arrow_arrow
    @skill_window.visible = false if VE_HIDE_SKILL_WINDOW
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_item_ok
  #--------------------------------------------------------------------------
  alias :on_item_ok_ve_arrow_arrow :on_item_ok
  def on_item_ok
    set_window_action(@item_window.item)
    on_item_ok_ve_arrow_arrow
    @item_window.visible = false if VE_HIDE_ITEM_WINDOW
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_enemy_cancel
  #--------------------------------------------------------------------------
  alias :on_enemy_cancel_ve_arrow_arrow :on_enemy_cancel
  def on_enemy_cancel
    on_enemy_cancel_ve_arrow_arrow
    case @actor_command_window.current_symbol
    when :skill then @skill_window.visible = true
    when :item  then @item_window.visible  = true
    when :attack, :direct_skill, :direct_item
      @help_window.visible = false
    end
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_actor_cancel
  #--------------------------------------------------------------------------
  alias :on_actor_cancel_ve_arrow_arrow :on_actor_cancel
  def on_actor_cancel
    on_actor_cancel_ve_arrow_arrow
    case @actor_command_window.current_symbol
    when :skill then @skill_window.visible = true
    when :item  then @item_window.visible  = true
    when :attack, :direct_skill, :direct_item
      @help_window.visible = false
    end
  end
  #--------------------------------------------------------------------------
  # * New method: set_window_action
  #--------------------------------------------------------------------------
  def set_window_action(item)
    @enemy_window.set_action(item) if item.for_opponent?
    @enemy_window.update_help      if item.for_opponent?
    @actor_window.set_action(item) if item.for_friend?
    @actor_window.update_help      if item.for_friend?
  end
end

 

Edited by tiagoms

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×