#============================================================================== # # ▼ Yanfly Engine Ace - Input Combo Skills v1.01 # -- Last Updated: 2011.12.26 # -- Level: Hard # -- Requires: n/a # #============================================================================== $imported = {} if $imported.nil? $imported["YEA-InputComboSkills"] = true #============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2014.08.29 - Bug Fix: Battle doesn't end if all side is dead and you still have # to input commands. # 2011.12.26 - Bug Fix: Crash when no action is performed. # 2011.12.22 - Started Script and Finished. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script enables the usage of Input Combo Skills. When an Input Combo # Skill is activated by an actor, a list of the potential input attacks appears # on the side of the screen. The player then presses the various buttons listed # in the window and attacks will occur in a combo fashion. If a particular # attack combination is met, a special attack will occur. # #============================================================================== # ▼ Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save. # # ----------------------------------------------------------------------------- # Skill Notetags - These notetags go in the skill notebox in the database. # ----------------------------------------------------------------------------- # # # # # # Makes the skill with these notetags to become potentially comboable. Replace # x with the ID of the skill you want the button to cause the skill to combo. # The combo skill will be usable even if the user has not learned the skill. # However, if the user is unable to use the skill due to a lack of resources, # then the skill will be greyed out. The skill can be inputted, but if the user # lacks the resources, it will not perform and the skill combo will break. # # # Sets the maximum number of inputs the player can use for this skill. If this # tag is not present, it will use the default number of maximum inputs that's # pre-defined by the module. # # # If the player inputs a sequence that matches the string (any combination of # L, R, X, Y, Z), then the special skill x will be performed. If a combination # is met, then the combo chain will end prematurely even if there are more # inputs left. If the user does not know skill x, then the special combo skill # x will not be performed. # # # This makes a skill only usable in a combo and cannot be directly used from a # skill menu. This effect does not affect monsters. Combo skills will still be # unusable if the user does not meet the skill's other requirements (such as a # lack of MP or TP). # #============================================================================== # ▼ 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. # # While this script doesn't interfere with Active Chain Skills, it will most # likely be unable to used in conjunction with Active Chain Skills. I will not # provide support for any errors that may occur from this, nor will I be # responsible for any damage doing this may cause your game. # #============================================================================== module YEA module INPUT_COMBO #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Combo Skill Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These settings adjust the sound effect played when a skill is selected, # what the minimum time windows are. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This will be the sound effect played whenever an active combo skill has # been selected for comboing. INPUT_COMBO_SOUND = RPG::SE.new("Skill2", 80, 100) # This will be the sound effect played when an input combo matches and # activates a specialized combo. ACHIEVED_COMBO_SOUND = RPG::SE.new("Skill3", 90, 100) # How many frames minimum for combo allowance. Sometimes the battlelog # window will move too fast for the player to be able to combo. This sets # a minimum timer for how long the combo window will stay open. MINIMUM_TIME = 90 # This is the bonus number of frames of leeway that the player gets for # a larger input sequence. This is because the battlelog window may move # too fast for the player to be able to combo. This adds to the minimum # timer for how long the combo window will stay open. TIME_PER_INPUT = 30 # This sets the default number of inputs that a combo skill can have at # maximum. If you wish to exceed this amount or to have lower than this # amount, use a notetag to change the skill's max combo amount. DEFAULT_MAX_INPUT = 5 # This will be the "Window" colour used for a special skill in the display. SPECIAL_SKILL_COLOUR = 17 #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Combo Skill Text - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This section adjusts the text that appears for the combo skills. Adjust # the text to appear as you see fit. Note that the vocab other than the # title can use text codes. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- COMBO_TITLE = "Input Combo Attacks" TITLE_SIZE = 20 L_SKILL_ON = "\eC[17]Q\eC[0]: " L_SKILL_OFF = "\eC[7]Q: " R_SKILL_ON = "\eC[17]W\eC[0]: " R_SKILL_OFF = "\eC[7]W: " X_SKILL_ON = "\eC[17]A\eC[0]: " X_SKILL_OFF = "\eC[7]A: " Y_SKILL_ON = "\eC[17]S\eC[0]: " Y_SKILL_OFF = "\eC[7]S: " Z_SKILL_ON = "\eC[17]D\eC[0]: " Z_SKILL_OFF = "\eC[7]D: " end # INPUT_COMBO end # YEA #============================================================================== # ▼ Editting anything past this point may potentially result in causing # computer damage, incontinence, explosion of user's head, coma, death, and/or # halitosis so edit at your own risk. #============================================================================== module YEA module REGEXP module SKILL COMBO_MAX = /<(?:COMBO_MAX|combo max):[ ](\d+)>/i COMBO_ONLY = /<(?:COMBO_ONLY|combo only)>/i COMBO_SKILL = /<(?:COMBO_SKILL|combo skill)[ ]([LRXYZ]):[ ](\d+)>/i COMBO_SPECIAL = /<(?:COMBO_SPECIAL|combo special)[ ](.*):[ ](\d+)>/i end # SKILL end # REGEXP end # YEA #============================================================================== # ■ DataManager #============================================================================== module DataManager #-------------------------------------------------------------------------- # alias method: load_database #-------------------------------------------------------------------------- class <= @current_combo_skill.combo_max if Input.trigger?(:L) check_input_combo_skill(:L) elsif Input.trigger?(:R) check_input_combo_skill(:R) elsif Input.trigger?(:X) check_input_combo_skill(:X) elsif Input.trigger?(:Y) check_input_combo_skill(:Y) elsif Input.trigger?(:Z) check_input_combo_skill(:Z) end end #-------------------------------------------------------------------------- # new method: check_input_combo_skill #-------------------------------------------------------------------------- def check_input_combo_skill(button) skill_id = @current_combo_skill.combo_skill[button] return if skill_id.nil? return if $data_skills[skill_id].nil? case button when :L; @combo_skill_string += "L" when :R; @combo_skill_string += "R" when :X; @combo_skill_string += "X" when :Y; @combo_skill_string += "Y" when :Z; @combo_skill_string += "Z" end if special_input_combo? icon = $data_skills[skill_id].icon_index @combo_skill_queue.push($data_skills[skill_id]) skill_id = @current_combo_skill.combo_special[@combo_skill_string] combo_skill = $data_skills[skill_id] @input_combo_info_window.add_combo(icon, combo_skill) YEA::INPUT_COMBO::ACHIEVED_COMBO_SOUND.play @total_combo_skills = @current_combo_skill.combo_max else YEA::INPUT_COMBO::INPUT_COMBO_SOUND.play combo_skill = $data_skills[skill_id] @input_combo_info_window.add_combo(combo_skill.icon_index) @total_combo_skills += 1 end @combo_skill_queue.push(combo_skill) return unless @total_combo_skills == @current_combo_skill.combo_max @input_combo_skill_counter = 0 end #-------------------------------------------------------------------------- # new method: special_input_combo? #-------------------------------------------------------------------------- def special_input_combo? combo_hash = @current_combo_skill.combo_special return false unless combo_hash.include?(@combo_skill_string) skill = $data_skills[combo_hash[@combo_skill_string]] return @subject.skills.include?(skill) end end # Scene_Battle #============================================================================== # # ▼ End of File # #==============================================================================