Save-Point
BattleAktionFX XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: BattleAktionFX XP (/thread-13371.html)



BattleAktionFX XP - kyonides - 12-27-2025

BattleAktionFX XP

by Kyonides

Introduction

After reading lots of stuff on Discord on some Follow Up Skill script for VX ACE, I thought XP badly needed to get something like that. This is how this script came into existence! Shocked

Currently, there are 4 options available:
  • :repeat for repeating the skill cast a few moments ago.
  • :random_skill for picking a skill from your actor's or enemy's list of available skills / action.
  • Some predefined skill ID - it might fail if the battler doesn't know it.
  • nil - it means nothing in Latin.

To add a new skill to the list, follow this example here:
Code:
SKILL_FX[57] = [:repeat, :random_skill]

57 would stand for the actual skill ID.

During gameplay, the script will pick one of those options randomly, unless there's just 0 or 1 there.

And yes, Ghost Golem enemies might escape or guard or do nothing if they got no valid action to perform at that point.

The Script
Code:
# * BattleAktionFX XP * #
#  Scripter : Kyonides
#  v0.4.0 - 2025-12-27

# Let your actors or troopers get an extra action for certain skills
# IF AND ONLY IF they meet some of the predefined criteria.

# Warning: Enemies might escape if they've got no available action left!

# Available Options: :repeat, :random_skill, some skill ID, nil

module BAktionFX
  MAX_EXTRA_ACTIONS = 1
  SKILL_FX = {} # Please leave this line alone!
  SKILL_FX.default = [] # Please leave this line alone!
  # [Skill ID] = [Option1, etc.]
  SKILL_FX[57] = [:repeat, :random_skill]
  extend self
  def add(set_targets, targets)
    @set_targets = set_targets
    @targets = targets
  end

  def skip?
    MAX_EXTRA_ACTIONS == @extra_actions or @skill_hits == 0
  end

  def process_skill(battler, skill_id)
    if skip?
      clear
      return
    end
    action = battler.current_action
    fx = SKILL_FX[skill_id]
    slots = fx.size
    fx = fx[rand(slots)]
    case fx
    when nil
      clear
      return
    when :repeat
      kind, basic, fx = action.data
    when :random_skill
      kind, basic, fx = battler.find_extra_action
    end
    skill = $data_skills[fx]
    unless skill
      clear
      return
    end
    @set_targets.call(skill.scope)
    @targets = @targets.call.flatten
    if @targets.empty?
      clear
      return
    end
    @targets = []
    @extra_actions += 1
    @skill_hits = 0
    action.set(kind, basic, fx)
    true
  end

  def clear
    @skill_hits = @extra_actions = 0
  end
  attr_accessor :extra_actions, :skill_hits
end

class Game_BattleAction
  def data
    [@kind, @basic, @skill_id]
  end

  def set(akind, abasic, askill_id)
    @kind = akind
    @basic = abasic
    @skill_id = askill_id
  end
end

class Game_Battler
  alias :kyon_btl_akt_fx_gm_btlr_sk_fx :skill_effect
  def skill_effect(user, skill)
    result = kyon_btl_akt_fx_gm_btlr_sk_fx(user, skill)
    BAktionFX.skill_hits += 1 if result and @damage.is_a?(Integer)
    result
  end
end

class Game_Actor
  def find_extra_action
    skills_found = @skills.select {|sid| skill_can_use?(sid) }
    total = skills_found.size
    skill_id = skills_found[rand(total)]
    [1, 0, skill_id]
  end
end

class Game_Enemy
  def find_extra_action
    return [0, rand(3) + 1, 0] unless movable?
    found_actions = []
    for action in self.actions
      n = $game_temp.battle_turn
      a = action.condition_turn_a
      b = action.condition_turn_b
      if (b == 0 and n != a) or
        (b > 0 and (n < 1 or n < a or n % b != a % b))
        next
      end
      if self.hp * 100.0 / self.maxhp > action.condition_hp
        next
      end
      if $game_party.max_level < action.condition_level
        next
      end
      switch_id = action.condition_switch_id
      if switch_id > 0 and !$game_switches[switch_id]
        next
      end
      found_actions << action
    end
    return [] if found_actions.empty?
    total = found_actions.size
    action = found_actions[rand(total)]
    action.data
  end
end

class Scene_Battle
  alias :kyon_btl_akt_fx_scn_btl_stt_ph4 :start_phase4
  alias :kyon_btl_akt_fx_scn_btl_mk_sk_act_res :make_skill_action_result
  alias :kyon_btl_akt_fx_scn_btl_up_ph4_st6 :update_phase4_step6
  alias :kyon_btl_akt_fx_scn_btl_btl_end :battle_end
  def start_phase4
    BAktionFX.clear
    @used_skill = nil
    kyon_btl_akt_fx_scn_btl_stt_ph4
  end

  def make_skill_action_result
    kyon_btl_akt_fx_scn_btl_mk_sk_act_res
    @used_skill = @phase4_step != 1
  end

  def update_phase4_step6
    kyon_btl_akt_fx_scn_btl_up_ph4_st6
    return unless @used_skill
    @target_battlers = []
    BAktionFX.add method(:set_target_battlers), method(:target_battlers)
    result = BAktionFX.process_skill(@active_battler, @skill.id)
    @action_battlers.unshift @active_battler if result
    @target_battlers = []
    @used_skill = nil
  end

  def battle_end(result)
    BAktionFX.clear
    kyon_btl_akt_fx_scn_btl_btl_end(result)
  end
  attr_reader :target_battlers
end

Terms & Conditions

Free as in Beer beer.
Please include me in your game credits.
That's it! Tongue sticking out