Target Any Add-On for Yanfly's Target Manager

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
826
Reaction score
346
Primarily Uses
Target Any Add-On for Yanfly's Target Manager
by Racheal
Introduction
This is a Add-On for Yanfly's Target Manager which allows you to set skills that can target friend OR foe.

Features
- Press Up/Down to switch between Ally and Enemy targeting for select skills.
- Targeting defaults to whatever the scope in the editor is set to.
- Works with Attack and Items too!

How to Use
- Insert in the materials section of the script editor.
- Insert <targets: any> in the notetag of any skill or item you want to be able to select a single ally or enemy for.
- Insert <targets: any all> in the notetag of any skill or item you want to be able to select all allies or all enemies for.
- Make sure to set the scope in the editor to set which group it defaults to selecting first!

Script
Code:
#==============================================================================# Target Any Add-On for Yanfly's Target Manager# by: Racheal# Version 1.0# Created: 22/11/2013#==============================================================================# Allows for skills that can target enemy or ally.#==============================================================================# Instructions:# * Insert in the Materials section under Target Manager## -----------------------------------------------------------------------------# Skill / Item Notetags - These notetags go in the skills notebox in the database.# -----------------------------------------------------------------------------# <targets: any># Sets the targeting scope to hit either enemy or ally## <targets: any all># Sets the targeting scope to hit either all enemies or all allies#==============================================================================# ▼ Compatibility# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that# it will run with RPG Maker VX without adjusting.## This scripts requires Yanfly Ace Battle Engine and Yanfly Target Manager.# It is highly unlikely to without both of those scripts.#==============================================================================#==============================================================================# DataManager#==============================================================================module DataManager    #--------------------------------------------------------------------------  # alias method: load_database  #--------------------------------------------------------------------------  class <<self; alias load_database_any_target load_database; end  def self.load_database    load_database_any_target    load_notetags_any_target  end    #--------------------------------------------------------------------------  # new method: load_notetags_target  #--------------------------------------------------------------------------  def self.load_notetags_any_target    groups = [$data_skills, $data_items]    for group in groups      for obj in group        next if obj.nil?        obj.load_notetags_any_target      end    end  end  end # DataManager#==============================================================================# RPG::UsableItem#==============================================================================class RPG::UsableItem < RPG::BaseItem    #--------------------------------------------------------------------------  # * Public Instance Variables  #--------------------------------------------------------------------------  attr_reader :default_for_friend  #--------------------------------------------------------------------------  # common cache: load_notetags_any_target  #--------------------------------------------------------------------------  def load_notetags_any_target    @default_for_friend = for_friend?    self.note.split(/[\r\n]+/).each { |line|      case line      when YEA::REGEXP::USABLEITEM::TARGETS        case $1        when /ANY ALL/i          @scope = :target_any_all        when /ANY/i          @scope = :target_any        end      end    } # self.note.split    #---  end    #--------------------------------------------------------------------------  # alias method: for_opponent?  #--------------------------------------------------------------------------  alias rpg_usableitem_for_opponent_target_any for_opponent?  def for_opponent?    return true if @scope == :target_any_all    return true if @scope == :target_any    return rpg_usableitem_for_opponent_target_any  end    #--------------------------------------------------------------------------  # alias method: for_friend?  #--------------------------------------------------------------------------  alias rpg_usableitem_for_friend_target_any for_friend?  def for_friend?    return true if @scope == :target_any_all    return true if @scope == :target_any    return rpg_usableitem_for_friend_target_any  end    #--------------------------------------------------------------------------  # alias method: for_all?  #--------------------------------------------------------------------------  alias rpg_usableitem_for_all_target_any for_all?  def for_all?    return true if @scope == :target_any_all    rpg_usableitem_for_all_target_any  end    #--------------------------------------------------------------------------  # alias method: need_selection?  #--------------------------------------------------------------------------  alias rpg_usableitem_need_selection_target_any need_selection?  def need_selection?    return true if @scope == :target_any    return rpg_usableitem_need_selection_target_any  end    #--------------------------------------------------------------------------  # new method: for_any_all?  #--------------------------------------------------------------------------  def for_any_all?    return @scope == :target_any_all  end    #--------------------------------------------------------------------------  # new method: for_any?  #--------------------------------------------------------------------------  def for_any?    return @scope == :target_any  endend#==============================================================================# Window_BattleHelp#==============================================================================class Window_BattleHelp < Window_Help  #--------------------------------------------------------------------------  # alias method: refresh_special_case  #--------------------------------------------------------------------------  alias window_battlehelp_refresh_special_case_target_any refresh_special_case  def refresh_special_case(battler)    if $game_temp.battle_aid.for_any_all?      if BattleManager.actor.input.ally        text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES      else        text = YEA::BATTLE::HELP_TEXT_ALL_FOES      end      return if text == @text      @text = text      contents.clear      reset_font_settings      draw_text(0, 0, contents.width, line_height*2, @text, 1)    else      window_battlehelp_refresh_special_case_target_any(battler)    end  endend#==============================================================================# Game_Action#==============================================================================class Game_Action  #--------------------------------------------------------------------------  # * Public Instance Variables  #--------------------------------------------------------------------------  attr_accessor :ally  #--------------------------------------------------------------------------  # alias method: clear  #--------------------------------------------------------------------------  alias game_action_clear_target_any clear  def clear    game_action_clear_target_any    @ally = false  end  #--------------------------------------------------------------------------  # alias method: set_skill  #--------------------------------------------------------------------------  alias game_action_set_skill_targets_any set_skill  def set_skill(skill_id)    game_action_set_skill_targets_any(skill_id)    @ally = self.item.default_for_friend    self  end  #--------------------------------------------------------------------------  # alias method: set_item  #--------------------------------------------------------------------------  alias game_action_set_item_targets_any set_item  def set_item(item_id)    game_action_set_item_targets_any(item_id)    @ally = self.item.default_for_friend    self  end  #--------------------------------------------------------------------------  # alias method: make_custom_targets  #--------------------------------------------------------------------------  alias game_action_make_custom_targets_target_any make_custom_targets  def make_custom_targets    array = game_action_make_custom_targets_target_any    if item.for_any?      if @ally        array += [friends_unit.smooth_target(@target_index)]      else        array += [opponents_unit.smooth_target(@target_index)]      end    elsif item.for_any_all?      if @ally        array |= friends_unit.alive_members      else        array |= opponents_unit.alive_members      end    end    return array  endend # Game_Action#==============================================================================# Window_BattleActor#==============================================================================class Window_BattleActor < Window_BattleStatus    #--------------------------------------------------------------------------  # overwrite method: process_handling  #--------------------------------------------------------------------------  def process_handling    return unless open? && active    return process_dir8 if Input.repeat?(:UP)    return super  end    #--------------------------------------------------------------------------  # new method: process_dir4  #--------------------------------------------------------------------------  def process_dir8    Sound.play_cursor    Input.update    deactivate    call_handler(:dir8)  end  end # Window_BattleActor#==============================================================================# Window_BattleActor#==============================================================================class Window_BattleEnemy < Window_Selectable    #--------------------------------------------------------------------------  # overwrite method: process_handling  #--------------------------------------------------------------------------  def process_handling    return unless open? && active    return process_dir2 if Input.repeat?(:DOWN)    return super  end    #--------------------------------------------------------------------------  # new method: process_dir4  #--------------------------------------------------------------------------  def process_dir2    Sound.play_cursor    Input.update    deactivate    call_handler(:dir2)  end  end # Window_BattleActor#==============================================================================# Scene_Battle#==============================================================================class Scene_Battle < Scene_Base  #--------------------------------------------------------------------------  # * alias: create_actor_window  #--------------------------------------------------------------------------  alias scene_battle_create_actor_window_target_any create_actor_window  def create_actor_window    scene_battle_create_actor_window_target_any    @actor_window.set_handler(:dir8,   method(:on_target_change))  end    #--------------------------------------------------------------------------  # * alias: create_enemy_window  #--------------------------------------------------------------------------  alias scene_battle_create_enemy_window_target_any create_enemy_window  def create_enemy_window    scene_battle_create_enemy_window_target_any    @enemy_window.set_handler(:dir2,   method(:on_target_change))  end    #--------------------------------------------------------------------------  # alias method: on_actor_cancel  #--------------------------------------------------------------------------  alias scene_battle_on_actor_cancel_target_any on_actor_cancel  def on_actor_cancel    scene_battle_on_actor_cancel_target_any    case @actor_command_window.current_symbol    when :attack      @status_window.show      @actor_command_window.activate      @help_window.hide    end  end    #--------------------------------------------------------------------------  # overwrite method: on_skill_ok  #--------------------------------------------------------------------------  def on_skill_ok    @skill = @skill_window.item    $game_temp.battle_aid = @skill    BattleManager.actor.input.set_skill(@skill.id)    BattleManager.actor.last_skill.object = @skill    if @skill.default_for_friend      select_actor_selection    elsif @skill.for_opponent?      select_enemy_selection    elsif @skill.for_friend?      select_actor_selection    else      @skill_window.hide      next_command      $game_temp.battle_aid = nil    end  end    #--------------------------------------------------------------------------  # overwrite method: on_item_ok  #--------------------------------------------------------------------------  def on_item_ok    @item = @item_window.item    $game_temp.battle_aid = @item    BattleManager.actor.input.set_item(@item.id)    if @item.default_for_friend      select_actor_selection    elsif @item.for_opponent?      select_enemy_selection    elsif @item.for_friend?      select_actor_selection    else      @item_window.hide      next_command      $game_temp.battle_aid = nil    end    $game_party.last_item.object = @item  end      #--------------------------------------------------------------------------  # new method: on_target_change  #--------------------------------------------------------------------------  def on_target_change    unless $game_temp.battle_aid.for_any? or $game_temp.battle_aid.for_any_all?       if @enemy_window.visible        @enemy_window.activate      else        @actor_window.activate      end      return    end    if @enemy_window.visible      @enemy_window.hide      select_actor_selection      BattleManager.actor.input.ally = true    else      @actor_window.hide      case @actor_command_window.current_symbol      when :attack        @status_window.show      when :skill        @skill_window.show      when :item        @item_window.show      end      select_enemy_selection      BattleManager.actor.input.ally = false    end  endend
Credit and Thanks
Racheal
Yanfly

Author's Notes
This script requires Yanfly's Ace Battle Engine and Yanfly's Target Manager. This is mostly due to how you switch between targets, at least for the battle engine part. No additional versions are planned at this time.
 
Last edited by a moderator:

Keikuina

Villager
Member
Joined
Feb 21, 2013
Messages
19
Reaction score
0
First Language
English
Primarily Uses
Hello, I've got a question about targeting enemies.

I wanted to know if it's possible to have a combination between "any" and "any all" where it lets the user choose if they want to target one or all character of either sides.

Thank you for your time.
 

Neo Soul Gamer

Veteran
Veteran
Joined
Aug 10, 2012
Messages
628
Reaction score
344
First Language
English
Primarily Uses
N/A
Great script, functions wonderfully. A slight caveat, though... Counterattacks. If a party member targets another ally, the counter attack that's triggered will target an enemy instead of the ally that inflicted the damage. Is there any way to perhaps disable counterattacking when an ally is attacked by a party member?
 

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
826
Reaction score
346
Primarily Uses
I thought Ace disallowed counterattacks on party to party attacks as it was. I'll have to look at it sometime. Unfortunately, I'm pretty busy right now and it might be a while before I can look into it. Same goes for your request, Keikuina.
 

Keikuina

Villager
Member
Joined
Feb 21, 2013
Messages
19
Reaction score
0
First Language
English
Primarily Uses
That's alright with me, take all the time you need. Thank for your reply.

I'm in no rush and I've got plenty of things to work on.
 

ArkhamVI

Villager
Member
Joined
Dec 13, 2013
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMMV
ok, question: this there a way were you can use this with switching between one/all targeting?
 

Marioman13

Imaginationer
Veteran
Joined
Jan 3, 2015
Messages
41
Reaction score
6
First Language
English
Primarily Uses
I know you might be a bit busy, but when you can.......

When targeting all allies, there is a big green box that appears around the party, signaling that the party is selected.

This seems out of place when there is one or two players in battle.

Could you change this please?
 
Joined
Jul 8, 2015
Messages
13
Reaction score
4
First Language
English
Primarily Uses
Hey! I've just installed your script and was wondering if it is possible somehow to switch between single targeting your party/enemies and multi-targeting them as well? I'm interested in making more versatile spells to keep my spell list close and I remember some of the classic Final Fantasy games having scopes like that (Healing either one party member or all of them, but also could be used on one or all undead enemies for damage, for instance)

If not, that's fine, I just want to know if it's possible. Still a great script, so thanks!
 

SithDuke

Veteran
Veteran
Joined
Jan 18, 2014
Messages
38
Reaction score
0
First Language
English
Primarily Uses
Great script, functions wonderfully. A slight caveat, though... Counterattacks. If a party member targets another ally, the counter attack that's triggered will target an enemy instead of the ally that inflicted the damage. Is there any way to perhaps disable counterattacking when an ally is attacked by a party member?
The funny thing is the same happens in Final Fantasy RK using the Retaliate spell. The meta actually abuses this by one strong attacker using it and the rest of the party buffing him. Then they proceed to hit him for a little damage, essentially giving this guy 5 hits per turn.
 

pxldrm

Famed Mimic Gogo
Member
Joined
Mar 13, 2014
Messages
17
Reaction score
1
First Language
English
Primarily Uses
I am having an issue with this script and I'm lost as to what could be causing it. This is a truly essential script and allows incredible flexibility in strategy and gameplay. I'll try to explain the issue the best I can.

Set normal attack skill to <targets: any>

Equip accessory with 'Attack Times+ weapons feature' to an actor

The attack will only occur once

I have isolated the cause to this script and have repeated the problem in a new project with the same result. The skill repeat still works fine but it seems only that 'attack times+' is affected.

*Found a solution to this problem by using Yami Battle Symphony. By setting a variable in a common event for the accessory then using the variable in <target action> tag.

<target action>if $game_variables[322] == 1icon create: user, weaponicon: user, weapon, angle, 30icon: user, weapon, cur_x 12attack animation: targetwait: 60icon create: user, arrow, hand, 578icon: user, arrow, rotate, 90, 24icon throw user: target, arrow, 16, 24, waiticon delete: user, arrowskill effect: wholeicon delete: user, weaponicon create: user, weaponicon: user, weapon, angle, 30icon: user, weapon, cur_x 12attack animation: targetwait: 60icon create: user, arrow, hand, 578icon: user, arrow, rotate, 90, 24icon throw user: target, arrow, 16, 24, waiticon delete: user, arrowskill effect: wholeicon delete: user, weaponendif $game_variables[322] == 0icon create: user, weaponicon: user, weapon, angle, 30icon: user, weapon, cur_x 12attack animation: targetwait: 60icon create: user, arrow, hand, 578icon: user, arrow, rotate, 90, 24icon throw user: target, arrow, 16, 24, waiticon delete: user, arrowskill effect: wholeicon delete: user, weaponend</target action>***Found a better solution to the problem while looking through 'Tsuki Action' script.

In 'alias method: make_custom_targets' for 'Target Any Add-On'

Change this:

def make_custom_targets    array = game_action_make_custom_targets_target_any    if item.for_any?      if @ally        array += friends_unit.smooth_target(@target_index)      else        array += opponents_unit.smooth_target(@target_index)      end    elsif item.for_any_all?      if @ally        array |= friends_unit.alive_members      else        array |= opponents_unit.alive_members      end    end    return array  endend # Game_ActionTo this:

Code:
def make_custom_targets    array = game_action_make_custom_targets_target_any    num = 1 + (attack? ? subject.atk_times_add.to_i : 0)    if item.for_any?      if @ally        array += [friends_unit.smooth_target(@target_index)] * num      else        array += [opponents_unit.smooth_target(@target_index)] * num      end    elsif item.for_any_all?      if @ally        array |= friends_unit.alive_members      else        array |= opponents_unit.alive_members      end    end    return array  endend # Game_Action
 
Last edited by a moderator:

pxldrm

Famed Mimic Gogo
Member
Joined
Mar 13, 2014
Messages
17
Reaction score
1
First Language
English
Primarily Uses
On closer inspection of the original game script, it seems 'Attack Times+' doesn't work for the 'confusion_target' method either. Same issue basically.

Remove brackets from any instance of [confusion_target] and change 'confusion_target' method to this:

Code:
  def confusion_target    num = 1 + (attack? ? subject.atk_times_add.to_i : 0)    case subject.confusion_level    when 1      [opponents_unit.random_target] * num    when 2      if rand(2) == 0        [opponents_unit.random_target] * num      else        [friends_unit.random_target] * num      end    else      [friends_unit.random_target] * num    end  end
 

VaiJack8

Villager
Member
Joined
Sep 21, 2016
Messages
7
Reaction score
4
First Language
Italian
Primarily Uses
RMVXA
Hi, sorry for necroposting. I'm having trouble configuring this script. I know little to nothing about scripting, and I'm not able to indent this script in the correct way. Why is it on a single line? Can I please get a formatted version? Sorry again and thanks.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,230
Reaction score
6,776
First Language
German
Primarily Uses
RMMV
@VaiJack8


For the general knowledge I suggest you follow the link "how to use a script" in my signature, it explains all possible steps you might have to do depending on which script you use.


The script display is because of a forum update broke the code tag. Originally it was with the correct linebreaks.
 

VaiJack8

Villager
Member
Joined
Sep 21, 2016
Messages
7
Reaction score
4
First Language
Italian
Primarily Uses
RMVXA
@VaiJack8


For the general knowledge I suggest you follow the link "how to use a script" in my signature, it explains all possible steps you might have to do depending on which script you use.


The script display is because of a forum update broke the code tag. Originally it was with the correct linebreaks.
I knew how to install new scripts, my only concern was about formatting. So is there no ways to get a correctly linebroke version of this script?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,230
Reaction score
6,776
First Language
German
Primarily Uses
RMMV
not unless either a programmer goes through the entire code and reformats it, or someone who copied it before the forum update reposts it.


Believe me, if we could do anything we would already have repaired that...
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
1,878
Reaction score
410
First Language
English
Primarily Uses
RMVXA
Fixed script format.

Invoke spell ... mageclea greforum spenostuo un-one-liner

Code:
#==============================================================================
# Target Any Add-On for Yanfly's Target Manager
# by: Racheal
# Version 1.0
# Created: 22/11/2013
#==============================================================================
# Allows for skills that can target enemy or ally.
#==============================================================================
# Instructions:
# * Insert in the Materials section under Target Manager
#
# -----------------------------------------------------------------------------
# Skill / Item Notetags - These notetags go in the skills notebox in the database.
# -----------------------------------------------------------------------------
# <targets: any>
# Sets the targeting scope to hit either enemy or ally
#
# <targets: any all>
# Sets the targeting scope to hit either all enemies or all allies
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
# This scripts requires Yanfly Ace Battle Engine and Yanfly Target Manager.
# It is highly unlikely to without both of those scripts.
#==============================================================================
#==============================================================================
# DataManager
#==============================================================================

module DataManager   
#-------------------------------------------------------------------------- 
# alias method: load_database 
#-------------------------------------------------------------------------- 
    class <<self; alias load_database_any_target load_database; end 
    def self.load_database   
        load_database_any_target   
        load_notetags_any_target 
    end   
#-------------------------------------------------------------------------- 
# new method: load_notetags_target 
#-------------------------------------------------------------------------- 
    def self.load_notetags_any_target   
        groups = [$data_skills, $data_items]   
        for group in groups     
            for obj in group       
                next if obj.nil?       
                obj.load_notetags_any_target     
            end   
        end 
    end 
end # DataManager

#==============================================================================
# RPG::UsableItem
#==============================================================================
class RPG::UsableItem < RPG::BaseItem   
#-------------------------------------------------------------------------- 
# * Public Instance Variables 
#-------------------------------------------------------------------------- 
    attr_reader :default_for_friend 
#-------------------------------------------------------------------------- 
# common cache: load_notetags_any_target 
#-------------------------------------------------------------------------- 
    def load_notetags_any_target   
        @default_for_friend = for_friend?   
        self.note.split(/[\r\n]+/).each { |line|     
        case line     
            when YEA::REGEXP::USABLEITEM::TARGETS       
            case $1       
                when /ANY ALL/i         
                    @scope = :target_any_all       
                when /ANY/i         
                    @scope = :target_any       
            end     
        end   
        } # self.note.split   
        #---
    end   
    
#-------------------------------------------------------------------------- 
# alias method: for_opponent? 
#-------------------------------------------------------------------------- 
    alias rpg_usableitem_for_opponent_target_any for_opponent? 
    def for_opponent?   
        return true if @scope == :target_any_all   
        return true if @scope == :target_any   
        return rpg_usableitem_for_opponent_target_any 
    end   
#-------------------------------------------------------------------------- 
# alias method: for_friend? 
#-------------------------------------------------------------------------- 
    alias rpg_usableitem_for_friend_target_any for_friend? 
    def for_friend?   
        return true if @scope == :target_any_all   
        return true if @scope == :target_any   
        return rpg_usableitem_for_friend_target_any 
    end   
#-------------------------------------------------------------------------- 
# alias method: for_all? 
#-------------------------------------------------------------------------- 
    alias rpg_usableitem_for_all_target_any for_all? 
    def for_all?   
        return true if @scope == :target_any_all   
        rpg_usableitem_for_all_target_any 
    end   
#-------------------------------------------------------------------------- 
# alias method: need_selection? 
#-------------------------------------------------------------------------- 
    alias rpg_usableitem_need_selection_target_any need_selection? 
    def need_selection?   
        return true if @scope == :target_any   
        return rpg_usableitem_need_selection_target_any 
    end   
#-------------------------------------------------------------------------- 
# new method: for_any_all? 
#-------------------------------------------------------------------------- 
    def for_any_all?   
        return @scope == :target_any_all 
    end   
#-------------------------------------------------------------------------- 
# new method: for_any? 
#-------------------------------------------------------------------------- 
    def for_any?   
        return @scope == :target_any 
    end
end

#==============================================================================
# Window_BattleHelp
#==============================================================================

class Window_BattleHelp < Window_Help 
#-------------------------------------------------------------------------- 
# alias method: refresh_special_case 
#-------------------------------------------------------------------------- 
    alias window_battlehelp_refresh_special_case_target_any refresh_special_case 
    def refresh_special_case(battler)   
        if $game_temp.battle_aid.for_any_all?     
            if BattleManager.actor.input.ally       
                text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES     
            else       
                text = YEA::BATTLE::HELP_TEXT_ALL_FOES     
            end     
            return if text == @text     
            @text = text     
            contents.clear     
            reset_font_settings     
            draw_text(0, 0, contents.width, line_height*2, @text, 1)   
        else     
            window_battlehelp_refresh_special_case_target_any(battler)   
        end 
    end
end

#==============================================================================
# Game_Action
#==============================================================================

class Game_Action 
#-------------------------------------------------------------------------- 
# * Public Instance Variables 
#-------------------------------------------------------------------------- 
    attr_accessor :ally 
#-------------------------------------------------------------------------- 
# alias method: clear 
#-------------------------------------------------------------------------- 
    alias game_action_clear_target_any clear 
    def clear   
        game_action_clear_target_any   
        @ally = false 
    end 
#-------------------------------------------------------------------------- 
# alias method: set_skill 
#-------------------------------------------------------------------------- 
    alias game_action_set_skill_targets_any set_skill 
    def set_skill(skill_id)   
        game_action_set_skill_targets_any(skill_id)   
        @ally = self.item.default_for_friend   
        self
    end 
#-------------------------------------------------------------------------- 
# alias method: set_item 
#-------------------------------------------------------------------------- 
    alias game_action_set_item_targets_any set_item 
    def set_item(item_id)   
        game_action_set_item_targets_any(item_id)   
        @ally = self.item.default_for_friend   
        self 
    end 
#-------------------------------------------------------------------------- 
# alias method: make_custom_targets 
#-------------------------------------------------------------------------- 
    alias game_action_make_custom_targets_target_any make_custom_targets 
    def make_custom_targets   
        array = game_action_make_custom_targets_target_any   
        if item.for_any?     
            if @ally       
                array += [friends_unit.smooth_target(@target_index)]     
            else       
                array += [opponents_unit.smooth_target(@target_index)]     
            end   
        elsif item.for_any_all?     
            if @ally       
                array |= friends_unit.alive_members     
            else       
                array |= opponents_unit.alive_members     
            end   
        end   
        return array 
    end
end # Game_Action

#==============================================================================
# Window_BattleActor
#==============================================================================

class Window_BattleActor < Window_BattleStatus   
#-------------------------------------------------------------------------- 
# overwrite method: process_handling 
#-------------------------------------------------------------------------- 
    def process_handling   
        return unless open? && active   
        return process_dir8 if Input.repeat?(:UP)   
        return super 
    end   
#-------------------------------------------------------------------------- 
# new method: process_dir4 
#-------------------------------------------------------------------------- 
    def process_dir8   
        Sound.play_cursor   
        Input.update   
        deactivate   
        call_handler(:dir8) 
    end 
end # Window_BattleActor

#==============================================================================
# Window_BattleActor
#==============================================================================

class Window_BattleEnemy < Window_Selectable   
#-------------------------------------------------------------------------- 
# overwrite method: process_handling 
#-------------------------------------------------------------------------- 
    def process_handling   
        return unless open? && active   
        return process_dir2 if Input.repeat?(:DOWN)   
        return super 
    end   
#-------------------------------------------------------------------------- 
# new method: process_dir4 
#-------------------------------------------------------------------------- 
    def process_dir2   
        Sound.play_cursor   
        Input.update   
        deactivate   
        call_handler(:dir2) 
    end 
end # Window_BattleActor

#==============================================================================
# Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base 
#-------------------------------------------------------------------------- 
# * alias: create_actor_window 
#-------------------------------------------------------------------------- 
    alias scene_battle_create_actor_window_target_any create_actor_window 
    def create_actor_window   
        scene_battle_create_actor_window_target_any   
        @actor_window.set_handler(:dir8,   method(:on_target_change)) 
    end   
#-------------------------------------------------------------------------- 
# * alias: create_enemy_window 
#-------------------------------------------------------------------------- 
    alias scene_battle_create_enemy_window_target_any create_enemy_window 
    def create_enemy_window   
        scene_battle_create_enemy_window_target_any   
        @enemy_window.set_handler(:dir2,   method(:on_target_change)) 
    end   
#-------------------------------------------------------------------------- 
# alias method: on_actor_cancel 
#-------------------------------------------------------------------------- 
    alias scene_battle_on_actor_cancel_target_any on_actor_cancel 
    def on_actor_cancel   
        scene_battle_on_actor_cancel_target_any   
        case @actor_command_window.current_symbol   
        when :attack     
            @status_window.show     
            @actor_command_window.activate     
            @help_window.hide   
        end 
    end   
#-------------------------------------------------------------------------- 
# overwrite method: on_skill_ok 
#-------------------------------------------------------------------------- 
    def on_skill_ok   
        @skill = @skill_window.item   
        $game_temp.battle_aid = @skill   
        BattleManager.actor.input.set_skill(@skill.id)   
        BattleManager.actor.last_skill.object = @skill   
        if @skill.default_for_friend     
            select_actor_selection   
        elsif @skill.for_opponent?     
            select_enemy_selection   
        elsif @skill.for_friend?     
            select_actor_selection   
        else     
            @skill_window.hide     
            next_command     
            $game_temp.battle_aid = nil   
        end 
    end   
#-------------------------------------------------------------------------- 
# overwrite method: on_item_ok 
#-------------------------------------------------------------------------- 
    def on_item_ok   
        @item = @item_window.item   
        $game_temp.battle_aid = @item   
        BattleManager.actor.input.set_item(@item.id)   
        if @item.default_for_friend     
            select_actor_selection   
        elsif @item.for_opponent?     
            select_enemy_selection   
        elsif @item.for_friend?     
            select_actor_selection   
        else     
            @item_window.hide     
            next_command     
            $game_temp.battle_aid = nil   
        end   
        $game_party.last_item.object = @item 
    end     
#-------------------------------------------------------------------------- 
# new method: on_target_change 
#-------------------------------------------------------------------------- 
    def on_target_change   
        unless $game_temp.battle_aid.for_any? or $game_temp.battle_aid.for_any_all?       
            if @enemy_window.visible       
                @enemy_window.activate     
            else       
                @actor_window.activate     
            end     
            return   
        end   
        if @enemy_window.visible     
            @enemy_window.hide     
            select_actor_selection     
            BattleManager.actor.input.ally = true   
        else     
            @actor_window.hide     
        case @actor_command_window.current_symbol     
        when :attack       
            @status_window.show     
        when :skill       
            @skill_window.show     
        when :item       
            @item_window.show     
        end     
            select_enemy_selection     
            BattleManager.actor.input.ally = false   
        end 
    end
end
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I was doing forge runs on D2 with my wife last night, and singing like a leprechaun to annoy her XD. I was calling it 'The Farge'
Is i possible too make a weapon have a chance of using a skill?
Can the Eternal Dreamers finish off the final boss? We'll see!
Fekken kill me. I unknowingly swapped out two important events's codes and saved the game to test it. I'm just doing this for fun and the fun has now been replaced with excruciating torture.
Is this how game developers feel all the time?

EDIT:
WAIT HOLY S***
MY LAST POST ASKING FOR HELP ON AN EVENT ACTUALLY SAVED IT
OH MY GOD
Coffee + Silk Coconut Milk + Splenda Zero = Not ..... awful :/ .

Forum statistics

Threads
94,448
Messages
921,010
Members
124,272
Latest member
lymeish
Top