#==============================================================================
# ** Karen's Combos
#------------------------------------------------------------------------------
# by DerVVulfman
# version 2.0
# 08-24-2010
# RPGMaker XP / RGSS (Compatible with SDK v 2.3 and earlier)
#------------------------------------------------------------------------------
#
# INTRODUCTION:
# This system allows you to have battlers combine their skill effects to pro-
# duce a different skill action.
#
#------------------------------------------------------------------------------
#
# INSTALLATION:
# Paste below Scene_Debug and/or your battlesystem and addons and above Main.
#
#
#------------------------------------------------------------------------------
#
# INSTRUCTIONS:
# The system is fairly easy as there are only three configurables to handle.
# One is the list of the combos used. The second determines if enemies can
# perform combos. And the third determines if those performing a combined
# skill perform a user animation together, or if it's just the trigger man.
#
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# COMBOS:
# There is an array called COMBOS that is a list of the special Combined
# skill, and the individual skills that are combined to perform it. I don't
# know how else to really describe it.
#
# The structure for each skill combo is fairly simple:
#
# [ Result, SP Type, [ skill_id, skill_id,.... ], Switch]
#
# Result This value is the ID of the resulting 'combo skill' used.
# SP Type This sets up how the battler's SP points are used (see below)
# Combinations This is a list of skill IDs used to call the combo skill
# Switch This is the ID for the switch that turns the combo on.
#
# There is an array called COMBOS that is a list of the special Combined
# The order in which the skills are placed should be by order of preference,
# with the most desired but difficult to attain skills on the top. The easier
# to gain ones should be situated at the bottom of your list.
#
# . . . . . . . . . . . . . . .
#
# * The SP Type value determines if the battlers use the SP points from the
# skills that they are using, or if it is based on the 'combo' skill.
# If it is set to 'true', then the battlers use the SP Cost of the combo.
# The battlers must have enough 'SP' to be able to use their combo.
#
# * If there is no Switch value (ie nil), it assumes it is on from the start.
#
#------------------------------------------------------------------------------
#
# TRIGGERING THE COMBO SKILLS:
# Whether the player assigns skills for the actors, or if the game assigns
# skills to monsters, these skills are loaded into an array for use. These
# skills remain in memory until triggered. Whichever battlesystem you use
# this system on, one thing is fairly certain. The fastest team-member with
# a loaded spell for a given combo is usually the one that triggers the
# combined skill effect.
#
# I call him the trigger man.
#
# Most combo systems operate under this principle, so those who have used
# similar scripts shouldn't be surprised. Nor should they be surprised that
# the final target of the combo skill will be determined by the trigger man.
#
#
#------------------------------------------------------------------------------
#
# COMBOS WITH DIFFERENT TARGETS:
# When combos are performed, the last loaded or triggering skill determines
# the target of the combined attack. As such, if a delayed skill targeting
# a ghost and a lightning bolt skill that immediately attacks a skeleton is
# combined, the skeleton target will feel the brunt of the combined attack.
#
# The only exception to this would be if the resulting combined skill works
# on all targets.
#
#
#------------------------------------------------------------------------------
#
# LAST MAN STANDING
# It happens once and a while when a skill combo is being cast and there
# are more than enough participants for that combined skill to be created.
# The system will cycle through the current list of actors or enemies that
# can perform the combo and generate a list. If two or more participants
# are performing the same skill, one will be chosen based on their position
# within the party (Aluxes gets chosen over Basil, chosen over Gloria...).
#
# When that happens, there are two possible actions.
#
# If the trigger man is not a combo user, or if any would-be participant
# not selected to be part of the combined skill is faster than those per-
# forming the skill, their non-combo skills get performed.
#
# Example:
# * Aluxes, Basil and Gloria are selected for a shockwave attack.
# * Shockwave uses only two skills and both Aluxes and Basil have one.
# * Aluxes is chosen and is paired with Gloria.
# * Basil is faster and can go first. **** CASTING SPELL ****
# * Aluxes and Gloria cast their combo next. **** COMBO SKILL! ****
#
# But, if the would-be participant of a combined skill reacts slower than
# those performing the skill, that skill is cast last. Formerly, it would
# have been wasted. But that problem has been solved.
#
# Example:
# * Aluxes, Basil and Gloria are selected for a shockwave attack.
# * Shockwave uses only two skills and both Aluxes and Basil have one.
# * Aluxes is chosen and is paired with Gloria.
# * Aluxes and Gloria cast their combo first. **** COMBO SKILL! ****
# * Basil tries to cast, but lost his chance. **** CASTING SPELL ****
#
#
#------------------------------------------------------------------------------
#
# COMPATABILITY:
# Designed for use with RPGMakerXP.
#
# With all the aliases involved, it should work with the default battlesystem
# and versions of the SDK from versions 2.3 and earlier. It also has allowan-
# ces and edits specifially designed for Charlie Fleed's FF-like CTB.
#
#
#------------------------------------------------------------------------------
#
# SCRIPT MODULES:
# The following modules have been added or changed. Please take care when
# using with other systems that may be affected.
#
# Aliased:
# ----------------
# Game_System: initialize
# Game_Battler: initialize
# Game_Enemy: make_action
# Scene_Battle: main, end_skill_select, phase3_next_actor,
# make_skill_action_result, update_phase4_step3,
# update_phase4_step4, update_phase4_step5
#
#
# Rewritten:
# ------------
# Game_Party: actors (Array now re-defined for read and write methods)
# Game_Troop: enemies (Array now defined for read and write methods)
#
#
# New:
# ------------
# Game_Battler: combo_timer
# Scene_Battle: make_combo_action_result, combo?, combo_users_acquire,
# current_user_action, combo_sp_cost, combo_list_clear_dead,
# combo_list_clear_users, combo_list_clear, combo_scope_check
#
#
#------------------------------------------------------------------------------
#
# CREDITS & THANKS:
# Eh... kinda got inspired by Cogwheel who made one of the first Combo Skill
# systems, and Trickster for his work on his own system. Later advances for
# Karen's Combos was due in part by development with Charlie Fleed's CTB.
#
#
#------------------------------------------------------------------------------
#
# TERMS AND CONDITIONS:
#
# Free to use, even in commercial projects. Just note that I need some form
# of due credit... even a mere mention in some end titles.
#
#
#==============================================================================
# == The Configurable COMBO Array ==
#
# Result SP type, Combinations Switch
COMBOS = [ [32, true, [57,1, 7], 21],
[68, false, [57, 7],],
[9, false, [7], 1]
]
# == Whether Enemies can perform COMBOS
# (true/false)
#
ENEMY_COMBOS = true
# == Whether all performing combos perform
# synced battle animations.
# (true/false)
#
ANIM_COMBOS = true
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of
# this class.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :actor_combo_list # array for actors and skills used
attr_accessor :enemy_combo_list # array for enemies and skills used
attr_accessor :combos_cfc_detect # Charlie Fleed's CTB Detection
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias combo_initialize initialize
def initialize
# Perform the original call
combo_initialize
# Initialize the arrays
@actor_combo_list = []
@enemy_combo_list = []
@combos_cfc_detect = true if $charlie_lee_ctb
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :combo_id # Combo skill ID
attr_accessor :combo_array
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias combo_init initialize
def initialize
# Perform the original call
combo_init
@combo_id = 0 # Add the combo ID value
@combo_array = []
end
#--------------------------------------------------------------------------
# * Recalculate Timer for Combo Users
#--------------------------------------------------------------------------
def combo_timer
@next_action_time = @next_action_time + @after_cast_delay + @rest_delay
end
end
#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
# This class handles enemies. It's used within the Game_Troop class
# ($game_troop).
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# * Make Action
#--------------------------------------------------------------------------
alias combo_make_action make_action
def make_action
# Perform the original call
combo_make_action
# Push enemies & skills into array
if self.current_action.kind == 1
temp_array = []
enemy_id = self.index
skill_id = self.current_action.skill_id
temp_array = [enemy_id, skill_id]
$game_system.enemy_combo_list.push(temp_array)
end
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :actors # actors
end
#==============================================================================
# ** Game_Troop
#------------------------------------------------------------------------------
# This class deals with troops. Refer to "$game_troop" for the instance of
# this class.
#==============================================================================
class Game_Troop
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :enemies # enemies
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias skillcombo_main main
alias combo_end_skill_select end_skill_select
alias combo_p3na phase3_next_actor
alias combo_msar make_skill_action_result
alias combo_up4s3 update_phase4_step3
alias combo_up4s5 update_phase4_step5
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Reset Values
$game_system.actor_combo_list = []
$game_system.enemy_combo_list = []
@combo_scope = false
# Perform the original call
skillcombo_main
end
#--------------------------------------------------------------------------
# * End Skill Selection
#--------------------------------------------------------------------------
def end_skill_select
# Get Skill Select Data
user_id = @actor_index
skill_id = @active_battler.current_action.skill_id
# Only if a valid skill
if skill_id != 0
# Push actors & skills into array
temp_array = []
temp_array = [user_id, skill_id]
$game_system.actor_combo_list.push(temp_array)
end
# Perform the original call
combo_end_skill_select
end
#--------------------------------------------------------------------------
# * Go to Command Input for Next Actor
#--------------------------------------------------------------------------
def phase3_next_actor
# Disregard if no current battler
unless @active_battler.nil?
# If the actor has no skill
if @active_battler.current_action.kind != 1
# Check to make sure he/she is not in the combo list
temp_party_list = []
temp_party_list = $game_system.actor_combo_list
# Cycle through the combo list
for i in 0...temp_party_list.size
# If the non-skill using actor is in the list
if temp_party_list[i][0] == @active_battler.index
# Remove him/her from the list
combo_list_clear(@active_battler.index, true)
end
end
end
end
# Perform the original call
combo_p3na
end
#--------------------------------------------------------------------------
# * Make Skill Action Results
#--------------------------------------------------------------------------
def make_skill_action_result
# Get Skill
oldskill = $data_skills[@active_battler.current_action.skill_id]
# For Charlie Fleed's CTB
if $game_system.combos_cfc_detect
unless @active_battler.casting_action.nil?
unless @active_battler.casting_action.skill_id == 0
oldskill = $data_skills[@active_battler.casting_action.skill_id]
end
end
end
# Determine if actors only or enemies permitted
check_combo = false
check_combo = true if @active_battler.is_a?(Game_Actor)
check_combo = true if ENEMY_COMBOS
# Check for combo skill (skill & sp flag) & Apply
combo_skill = combo? if check_combo
# if no combo skill
if combo_skill.nil?
# Perform the original call
combo_msar
# Erase battler from list
if @active_battler.is_a?(Game_Actor)
combo_list_clear(@active_battler.index, true)
else
combo_list_clear(@active_battler.index)
end
else
# Perform combo skill
make_combo_action_result(combo_skill, oldskill)
end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 3 : animation for action performer)
#--------------------------------------------------------------------------
def update_phase4_step3
# For animations
if ANIM_COMBOS
# Set who's casting (Actor or Enemy
temp_party_list =
@active_battler.is_a?(Game_Actor) ? $game_party.actors : $game_troop.enemies
# Acquire combo skill in use
user_id = @active_battler.index
combo_id = temp_party_list[user_id].combo_id
# Go through party list
for i in 0...temp_party_list.size
# Only perform for addtl combo users
if temp_party_list[i].combo_id != 0
# Only if combo skill matches current user's
if temp_party_list[i].combo_id == combo_id
# Animation for action performer (if ID is 0, then white flash)
if @animation1_id == 0
temp_party_list[i].white_flash = true
else
temp_party_list[i].animation_id = @animation1_id
temp_party_list[i].animation_hit = true
end
end
end
end
end
# Perform the original call
combo_up4s3
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 4: animation for target)
#--------------------------------------------------------------------------
# For Charlie Fleed's CTB (wrapping the whole method used only by his CTB)
if $charlie_lee_ctb
alias combo_update_phase4_step4 update_phase4_step4
def update_phase4_step4
if @reflected_battler != nil
# Save temp data
temp1 = @reflected_battler.animation_id
temp2 = @reflected_battler.animation_hit
end
# Perform the Original call
combo_update_phase4_step4
# set animation for char on which the skill is reflected
# unless it's in reflex state too
if @reflected_battler != nil
# Target the last user if not a multi scope or combo skill
if @combo_scope
# Animation for target
for target in @target_battlers
target.animation_id = @animation2_id
target.animation_hit = (target.damage != "Miss")
end
# Reset changes in original method
@reflected_battler.animation_id = temp1
@reflected_battler.animation_hit = temp2
# Apply changes for multi-scope combo
for i in 0...@reflected_battler.combo_array.size
user = @reflected_battler.combo_array[i]
if $game_troop.enemies[user].state?($reflect_state_id)
unless REFLECT_ANIMATION_ID == nil
$game_troop.enemies[user].animation_id = REFLECT_ANIMATION_ID
end
else
$game_troop.enemies[user].animation_id = @animation2_id
$game_troop.enemies[user].animation_hit = (target.damage != "Miss")
end
end
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 5 : damage display)
#--------------------------------------------------------------------------
# For Charlie Fleed's CTB (wrapping the whole method used only by his CTB)
if $charlie_lee_ctb
alias combo_update_phase4_step5 update_phase4_step5
def update_phase4_step5
# Perform the Original call
combo_update_phase4_step5
# set animation for char on which the skill is reflected
# unless it's in reflex state too
if @reflected_battler != nil
# Target the last user if not a multi scope or combo skill
if @combo_scope
# Display damage
for target in @target_battlers
target.damage_pop = true if target.damage != nil
end
for i in 0...@reflected_battler.combo_array.size
user = @reflected_battler.combo_array[i]
if $game_troop.enemies[user].damage != nil
$game_troop.enemies[user].damage_pop = true
end
if $game_troop.enemies[user].changed_state_text != []
$game_troop.enemies[user].changed_state_pop = true
# Show changed state text
@spriteset.battler($game_troop.enemies[user]).damage("", false,
$game_troop.enemies[user].changed_state_text)
$game_troop.enemies[user].changed_state_pop = false
$game_troop.enemies[user].changed_state_text = []
end
end
end
end
# Reset combo scope flag
@combo_scope = false
end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 5 : damage display)
#--------------------------------------------------------------------------
def update_phase4_step5
# Set who's casting (Actor or Enemy
temp_party_list =
@active_battler.is_a?(Game_Actor) ? $game_party.actors : $game_troop.enemies
for i in 0...temp_party_list.size
temp_party_list[i].combo_id = 0
end
# Perform the original call
combo_up4s5
end
#--------------------------------------------------------------------------
# * Make Combo Action Results
# combo_skill : array of skill and boolean flag
# oldskill : skill
#--------------------------------------------------------------------------
def make_combo_action_result(combo_skill, oldskill)
# Set the combo skill
@skill = $data_skills[combo_skill[0]]
# Obtain SP Cost (dependant on SP type in combo)
battler_spcost = 0
battler_spcost = combo_skill[1] ? @skill.sp_cost : oldskill.sp_cost
# For Charlie Fleed's CTB
if $game_system.combos_cfc_detect
# Unless playable
unless @reacting or (@hits_count > 0)
# Use up SP
if @active_battler.sp_override_cost
sp_cost = @active_battler.sp_override_cost
@active_battler.sp_override_cost = nil
else
sp_cost = battler_spcost
end
# Use up SP (dependant on state)
if @active_battler.state?($mp1_state_id)
@active_battler.sp -= 1
elsif @active_battler.state?($half_mp_state_id)
@active_battler.sp -= sp_cost / 2
else
@active_battler.sp -= sp_cost
end
end
else
@active_battler.sp -= battler_spcost
end
# Refresh status window
@status_window.refresh
# Show skill name on help window
@help_window.set_text(@skill.name, 1)
# Set animation ID
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# Set command event ID
@common_event_id = @skill.common_event_id
# Set target battlers
set_target_battlers(@skill.scope)
# For Charlie Fleed's CTB
if $game_system.combos_cfc_detect
# Apply skill effect
for target in @target_battlers
$game_temp.skill_reflected = false
# Check if target reflects and set 'skill_reflected'
target.skill_effect(@active_battler, @skill)
# Reflect support
@reflected_battler = nil
if $game_temp.skill_reflected
if (target == @active_battler)
@reflected_battler = $game_troop.random_target_enemy
else
@reflected_battler = @active_battler
end
@reflecters.push(target)
end
end
# Reflect battler support
if @reflected_battler != nil
# Determine of combo skill is multi-targetting
@combo_scope = combo_scope_check
@combo_scope = false if @reflected_battler.combo_array == [false]
# Target the last user if not a multi scope or combo skill
unless @combo_scope
@reflected_battler.skill_effect(@active_battler, @skill)
# Otherwise a multi-scope combo
else
for i in 0...@reflected_battler.combo_array.size
user = @reflected_battler.combo_array[i]
$game_troop.enemies[user].skill_effect(@active_battler, @skill)
end
end
end
else
# Apply skill effect
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
end
#--------------------------------------------------------------------------
# * Determine Combo Skill and Apply
#--------------------------------------------------------------------------
def combo?
# reset combos lists n flags
cs_skills, cs_users, temp_combo_list, temp_party_list = [],[],[],[]
combo_skill, index, cs_sp = nil, nil, false
# What's your trigger?
trigger_skill = @active_battler.current_action.skill_id
# Set who's casting (Actor or Enemy
if @active_battler.is_a?(Game_Actor)
temp_combo_list = $game_system.actor_combo_list
temp_party_list = $game_party.actors
else
temp_combo_list = $game_system.enemy_combo_list
temp_party_list = $game_troop.enemies
end
# Clear Dead Members
temp_combo_list = combo_list_clear_dead(temp_combo_list,temp_party_list)
# Loop through combo list
for i in 0...COMBOS.size
# If exact match, acquire the combo users
combo_users = []
combo_users = combo_users_acquire(temp_combo_list, i, trigger_skill)
unless combo_users == [false]
combo_skill = COMBOS[i][0]
index = i
for j in 0...combo_users.size
temp_party_list[combo_users[j]].combo_id = combo_skill
end
break
end
end
# Assign combo party to current battler
@active_battler.combo_array = combo_users
# Return if no combo skills at all
return nil if index.nil?
# To ensure that someone not participating doesn't use the skill
unless COMBOS[index][2].include?(@active_battler.current_action.skill_id)
return nil
end
# Last unlucky no-combo user (if he's last... lost it)
return nil unless combo_users.include?(@active_battler.index)
# Reset combo & actor counter
combo_counter = 0
user_counter = []
# Make sure all battlers can cast their skills (or have enough SP for combo)
for i in combo_users
user = temp_party_list[i]
cur_action = current_user_action(user)
unless cur_action.skill_id.nil?
if COMBOS[index][2].include?(cur_action.skill_id)
if COMBOS[index][1] == true
# SP flag (for current battler)
cs_sp = true
# Only if enough sp points for combo skill
unless user.sp < $data_skills[COMBOS[index][0]].sp_cost
# Add to the counter
combo_counter += 1
# Push the actor into an array
user_counter.push(user)
else
user.combo_id = 0
end
else
# Only if can cast skill
if user.skill_can_use?(cur_action.skill_id)
# Add to the counter
combo_counter += 1
# Push the actor into an array
user_counter.push(user)
else
user.combo_id = 0
end
end
end
end
end
# Re-integrate the lists
if @active_battler.is_a?(Game_Actor)
$game_system.actor_combo_list = temp_combo_list
$game_party.actors = temp_party_list
else
$game_system.enemy_combo_list = temp_combo_list
$game_troop.enemies = temp_party_list
end
# Not enough MP for combo, perform as normal
return nil if combo_counter < COMBOS[index][2].size
# Remove SP & Remove from list
if @active_battler.is_a?(Game_Actor)
combo_list_clear_users(user_counter, index, true)
else
combo_list_clear_users(user_counter, index)
end
# return skill & flag
return combo_skill, cs_sp
end
#--------------------------------------------------------------------------
# * Check Scope of Combo Skill (returns false if none)
#--------------------------------------------------------------------------
def combo_scope_check
combo_scope = false
# Set who's casting (Actor or Enemy
temp_party_list =
@active_battler.is_a?(Game_Actor) ? $game_party.actors : $game_troop.enemies
# Acquire combo skill in use
user_id = @active_battler.index
combo_id = temp_party_list[user_id].combo_id
unless combo_id == 0
combo_scope = true if $data_skills[combo_id].scope == 2
combo_scope = true if $data_skills[combo_id].scope == 4
end
return combo_scope
end
#--------------------------------------------------------------------------
# * Combo? Return Combo Users if Found
# temp_combo_list : array of actor or enemy skills in use
# i : index identifying which COMBO ARRAY scanned
# trigger : skill that triggered the combo (last skill)
#--------------------------------------------------------------------------
def combo_users_acquire(temp_combo_list, i, trigger)
select_combo = COMBOS[i][2]
tempswtch = 0
tempswtch = COMBOS[i][3] if COMBOS[i][3] != nil
if tempswtch != 0
return [false] if $game_switches[tempswtch] != true
end
temp_combos, combos, cs_skills, cs_users = [], [], [], []
temp_combos, combos = temp_combo_list, select_combo
combo1_temp, combo2_temp, combo3_temp, sample = [], [], [], []
for j in 0...temp_combos.size
# Push into temp array if skill is in curent combo
combo1_temp.push(temp_combos[j]) if combos.include?(temp_combos[j][1])
end
# If larger, narrow them down
if combo1_temp.size > combos.size
# Sort through combo array
combo3_temp = combo1_temp
for j in 0...combos.size
# Push into temp array if combo is in curent actor skill array
for k in 0...combo3_temp.size
sample = combo3_temp[k]
if sample[1] == combos[j]
combo2_temp.push(sample)
combo3_temp.delete_at(k)
break
end
end
end
else
combo2_temp = combo1_temp
end
# Sort and get skills from current list
for list in 0...combo2_temp.size
# Get the ids
user_id = combo2_temp[list][0]
skill_id = combo2_temp[list][1]
# Push the ids
cs_skills.push(skill_id)
cs_users.push(user_id)
end
# Sort for exact matching
cs_skills.sort!
cs_users.sort!
combos.sort!
# Must include trigger
return [false] unless cs_skills.include?(trigger)
# If the exact match, return actors doing the combo
return cs_users if cs_skills == combos
# Nope
return [false]
end
#--------------------------------------------------------------------------
# * Combo? Get Current Action (whether current_action or casting_action)
# battler : actor
#--------------------------------------------------------------------------
def current_user_action(battler)
curr_action = battler.current_action
# For Charlie Fleed's CTB
if $game_system.combos_cfc_detect
# Only get overriding skill if a skill exists
unless battler.casting_action.nil?
curr_action = battler.casting_action unless battler.casting_action.skill_id == 0
end
end
return curr_action
end
#--------------------------------------------------------------------------
# * Combo? Drain SP Cost
# battler : actor
# action : current action / casting action
# index : index of Combos (which combo is used)
#--------------------------------------------------------------------------
def combo_sp_cost(battler, action, index)
# If not the 'current' battler and is using the current combo skill
unless battler.id == @active_battler.id
battler.combo_timer if $game_system.combos_cfc_detect
if COMBOS[index][2].include?(action.skill_id)
# Obtain SP Cost (dependant on SP type in combo)
if COMBOS[index][1] == true
battler_spcost = $data_skills[COMBOS[index][0]].sp_cost
else
battler_spcost = $data_skills[action.skill_id].sp_cost
end
# Use up SP (dependant on state)
if @active_battler.state?($mp1_state_id)
battler.sp -= 1
elsif @active_battler.state?($half_mp_state_id)
battler.sp -= battler_spcost / 2
else
battler.sp -= battler_spcost
end
end
end
# Reset Regardless if trigger man or skill collaborators
action.kind = -1
battler.current_action.kind = -1
# For Charlie Fleed's CTB
if $game_system.combos_cfc_detect
battler.cf_casting = false
end
end
#--------------------------------------------------------------------------
# * Clear Dead from Combo List
# temp_combo_list : array of actor or enemy skills in use
# temp_party_list : list of party or troop members
#--------------------------------------------------------------------------
def combo_list_clear_dead(temp_combo_list, temp_party_list)
# Recreate the list, eliminating dead members
temp_array1 = []
for list in 0..temp_combo_list.size-1
user_id = temp_combo_list[list][0]
skill_id = temp_combo_list[list][1]
unless temp_party_list[user_id].dead?
temp_array2 = []
temp_array2 = [user_id, skill_id]
temp_array1.push(temp_array2)
end
end
temp_combo_list = []
temp_combo_list = temp_array1
return temp_combo_list
end
#--------------------------------------------------------------------------
# * Clear Combo Users from Combo List & Apply SP costs
# user_counter : list of actors
# index : index of Combos (which combo is used)
# temp_combo_list : array of actor or enemy skills in use
#--------------------------------------------------------------------------
def combo_list_clear_users(user_counter, index, actor_flag=false)
# Remove SP & Remove from list
for user in user_counter
cur_action = current_user_action(user)
# Make sure all additional battlers use up their sp
combo_sp_cost(user, cur_action, index)
# Erase from combo list
combo_list_clear(user.index, actor_flag)
end
end
#--------------------------------------------------------------------------
# * Clear from Combo List
# value : index value of actor in system
# temp_combo_list : array of actor or enemy skills in use
#--------------------------------------------------------------------------
def combo_list_clear(value, actor_flag=false)
temp_array = []
# Set who's casting (Actor or Enemy
if actor_flag
temp_combo_list = $game_system.actor_combo_list
else
temp_combo_list = $game_system.enemy_combo_list
end
for combo in temp_combo_list
temp_array.push(combo) unless value == combo[0]
end
temp_combo_list = temp_array
if actor_flag
$game_system.actor_combo_list = temp_combo_list
else
$game_system.enemy_combo_list = temp_combo_list
end
end
end