#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:= # Soul Force Combo System by Blizzard # Version: 1.3 # Type: Combo Enhancement for SRS # Date: 25.10.2007 # Date v1.2b: 28.1.2008 # Date v1.3: 23.3.2019 #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:= # # This work is licensed under BSD License 2.0: # # #---------------------------------------------------------------------------- # # # # Copyright (c) Boris "Blizzard" Mikić # # All rights reserved. # # # # Redistribution and use in source and binary forms, with or without # # modification, are permitted provided that the following conditions are met: # # # # 1. Redistributions of source code must retain the above copyright notice, # # this list of conditions and the following disclaimer. # # # # 2. Redistributions in binary form must reproduce the above copyright # # notice, this list of conditions and the following disclaimer in the # # documentation and/or other materials provided with the distribution. # # # # 3. Neither the name of the copyright holder nor the names of its # # contributors may be used to endorse or promote products derived from # # this software without specific prior written permission. # # # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # # POSSIBILITY OF SUCH DAMAGE. # # # #---------------------------------------------------------------------------- # # You may use this script for both non-commercial and commercial products # without limitations as long as you fulfill the conditions presented by the # above license. The "complete" way to give credit is to include the license # somewhere in your product (e.g. in the credits screen), but a "simple" way # is also acceptable. The "simple" way to give credit is as follows: # # Soul Force Combo System licensed under BSD License 2.0 # Copyright (c) Boris "Blizzard" Mikić # # Alternatively, if your font doesn't support diacritic characters, you may # use this variant: # # Soul Force Combo System licensed under BSD License 2.0 # Copyright (c) Boris "Blizzard" Mikic # # In general other similar variants are allowed as long as it is clear who # the creator is (e.g. "Soul Force Combo System created by Blizzard" is # acceptable). But if possible, prefer to use one of the two variants listed # above. # # If you fail to give credit and/or claim that this work was created by you, # this may result in legal action and/or payment of damages even though this # work is free of charge to use normally. # #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:= # # Compatibility: # # 96% compatible with SDK 1.x. 40% compatible with SDK 2.x. WILL corrupt your # old savegames. Can cause incompatibilty issues with following scripts # and/or systems: # - exotic CBS-es # - Limit Break systems # - Custom Equipment systems (i.e. 2 accessories) (can be EASILY merged) # - needs the 5.x version of the Scene_SoulRage add-on if you use one # This script requires Chaos Rage Limit System v5.3b or higher to work. SRS # can be deactivated, but doesn't have to. This system does NOT support the # Overload feature. # # # new in v1.2b: # - now able to display SR cost as well # - now you are able to create combo skills that can be used by only one # actor, by any actor without much effort # # new in v1.3: # - added new license # - added usage and crediting instructions # # # Explanation: # # This Script allows you to use a combo system derivate from Unity Force # which was originally created for Chaos Project. # # # Instructions: # # To use this system you need to set up the database below using the given # template. When the first actor uses a skill, the second one won't be able # to act at all. When the second actor uses a skill, the first one's action # will be cancelled. Both actors will lose SR upon skill use, but only the # actor who used the skill will lose SP. Keep in mind that the actor who used # the skill will be the one who performs it. # # It is recommended that both actors know the skill and that an actor who # can't perform the skill doesn't ever learn it. # # # Configuration: # # DESCRIPTION_ADD_NAME - if you set this value to true, the names of the # performing actors will be displayed in the # description of the skill # DESCRIPTION_ADD_SR - if you set this value to true, the SR cost will be # displayed in the description of the skill # # # If you find any bugs, please report them here: # http://forum.chaos-project.com #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:= #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # START Configuration #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: DESCRIPTION_ADD_NAME = true DESCRIPTION_ADD_COST = true #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # END Configuration #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: if $crls == nil || $crls == true || $crls < 5.31 raise 'Soul Force Combo System requires Chaos Rage Limit System v5.31b or higher' end #============================================================================== # RPG::Skill #============================================================================== class RPG::Skill alias description_sfc_later description def description data = BlizzCFG.sfc_database(@id) if data != nil text = @description text += " (#{data[0]}% #{BlizzCFG::SR_NAME})" if DESCRIPTION_ADD_COST if DESCRIPTION_ADD_NAME && data.size > 1 text += " (#{$game_actors[data[1]].name}" data[2, data.size-2].each {|i| text += ", #{$game_actors[i].name}"} text += ')' end return text end return @description end end #============================================================================== # module BlizzCFG #============================================================================== module BlizzCFG def self.sfc_database(id) case id #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # START Soul Force Database # # To set up the configuration correctly use following template: # # when ID then return [SR_COST, AC_ID1, AC_ID2, ...] # # ID - skill ID # SR_COST - SR consumed by each actor if used # AC_ID1 - ID of actor 1 # AC_ID2 - ID of actor 2 # ... - more actor IDs # # If you add more than 2 IDs, the skill will simply require more actors to # work out. Keep in mind that the SR cost is in %, that means that i.e. # 64 means 64%, 25 means 25%, etc. If you use only 1 actor ID, only one actor # is needed to perform the skill. # # Note: # # If you leave out the actor IDs, the skill will be usable by any actor. In # other words, you can create normal skills that can consume SR as well. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: when 1 then return [10] when 57 then return [20, 1, 2] #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # END Soul Force Database #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: end return nil end end #============================================================================== # Game_Actor #============================================================================== class Game_Actor < Game_Battler alias skill_can_use_sfc_later? skill_can_use? def skill_can_use?(id) data = BlizzCFG.sfc_database(id) return skill_can_use_sfc_later?(id) && (data == nil || data.size == 1 && data[0] * 10 <= @sr || data.size > 1 && $game_party.sfc_can_use?(id)) end alias inputable_sfc_later? inputable? def inputable? return (inputable_sfc_later? && !$game_party.sfc_block.include?(self)) end end #============================================================================== # Game_Party #============================================================================== class Game_Party attr_accessor :sfc_block alias init_sfc_later initialize def initialize init_sfc_later @sfc_block = [] end def sfc_can_use?(id) data = BlizzCFG.sfc_database(id) return data[1, data.size-1].all? {|id| $game_party.actors.include?($game_actors[id]) && !$game_actors[id].dead? && data[0] * 10 <= $game_actors[id].sr} end end #============================================================================== # Scene_Battle #============================================================================== class Scene_Battle alias start_phase2_sfc_later start_phase2 def start_phase2 $game_party.sfc_block = [] start_phase2_sfc_later end def make_sfc_action_result make_skill_action_result if @active_battler.current_action.forcing || @active_battler.skill_can_use?(@skill.id) data = BlizzCFG.sfc_database(@skill.id) if data.size == 1 @active_battler.sr -= data[0] * 10 else data[1, data.size-1].each {|id| $game_actors[id].sr -= data[0] * 10} end @status_window.refresh end end alias end_skill_select_sfc_later end_skill_select def end_skill_select end_skill_select_sfc_later data = BlizzCFG.sfc_database(@skill.id) if Input.trigger?(Input::C) && @skill != nil && @active_battler.skill_can_use?(@skill.id) && data != nil @active_battler.current_action.kind = 6 if data.size > 1 data[1, data.size-1].each {|id| $game_party.sfc_block.push($game_actors[id])} $game_party.sfc_block.delete(@active_battler) $game_party.sfc_block.each {|a| a.current_action.clear} end end end alias phase3_prior_actor_sfc_later phase3_prior_actor def phase3_prior_actor phase3_prior_actor_sfc_later if @active_battler != nil && @active_battler.current_action.kind == 6 @active_battler.current_action.clear $game_party.sfc_block = [] end end alias upd_phase4_step2_sfc_later update_phase4_step2 def update_phase4_step2 upd_phase4_step2_sfc_later make_sfc_action_result if @active_battler.current_action.kind == 6 end end