Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * [ACE] Stat Bonus Addon for Falcao's Pearl ABS Liquid v3
- #===============================================================================
- # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
- # * Version: 1.3
- # * Updated: 12/01/2016
- # * Requires: Falcao's Pearl ABS Liquid v3
- #-------------------------------------------------------------------------------
- # * < Change Log >
- #-------------------------------------------------------------------------------
- # * Version 1.0 (14/01/2015)
- # - Initial release.
- # * Version 1.1 (26/09/2015)
- # - Added compatibility with my Toolbar Addon for Falcao's ABS.
- # * Version 1.2 (06/01/2016)
- # - Added compatibility with my ABS Stat Addon 2 for Falcao's ABS.
- # * Version 1.3 (12/01/2016)
- # - Fixed an issue with tool data readings.
- #-------------------------------------------------------------------------------
- # * < Description >
- #-------------------------------------------------------------------------------
- # * By default, the some of the default stats (like AGI) won't do much in
- # Falcao's ABS. That can be changed with this script.
- # * This script will introduce new note-tags for you which can manipulate
- # several stats from Falcao's ABS. The current list is:
- # Cooldown, Cast Time, Tool Speed, Blowpower, Guard Rate, Knockdown Rate,
- # Effect Delay.
- # These can be manipulated by the user's stats (ATK, DEF, AGI, etc).
- # As the required stat raises, the more bonuses the player gets for their
- # actions performed, thus allowing the players to actually feel the raise of
- # their stats in Falcao's ABS.
- # * Configurable limits for each manipulable stat!
- # * Bonuses can affect the performance of the enemies as well (toggle-able)!
- # * Build-in debugger. It will print out the manipulable stats of the action
- # performed, so you can see what needs to be changed and what doesn't.
- #-------------------------------------------------------------------------------
- # * < Note-tags >
- #-------------------------------------------------------------------------------
- # * The note-tags are usable on:
- # Skills, Items, Weapons and Armors.
- #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # * To assign custom bonuses for an action, you can use these note-tags:
- #
- # CD Bonus = <val stat, val stat, val stat ... > # For Cooldown Bonus.
- # CT Bonus = <val stat, val stat, val stat ... > # For Cast Time Bonus.
- # ED Bonus = <val stat, val stat, val stat ... > # For Effect Delay Bonus.
- # TS Bonus = <val stat, val stat, val stat ... > # For Tool Speed Bonus.
- # BP Bonus = <val stat, val stat, val stat ... > # For Blowpower Bonus.
- # GR Bonus = <val stat, val stat, val stat ... > # For Guard Rate Bonus.
- # KD Bonus = <val stat, val stat, val stat ... > # For Knockdown Bonus.
- #
- # val = An integer number which represents percentage values.
- # This much percentage from the assigned stat will be either added to
- # an ABS stat, or subtracted from an ABS stat.
- # In the case of Cooldown, Cast Time and Effect Delay bonuses, it will
- # be added.
- # In the case of Tool Speed, Blowpower, Guard Rate and Knockdown, it will
- # be subtracted.
- # stat = A stat assigned for the ABS stat bonus.
- # Valid values: MHP, MMP, ATK, DEF, MAT, MDF, AGI, LUK.
- # I guess, it is self-explanatory what each of them means.
- #
- # The first two letters determine the affected ABS stat!
- # The bonus data is placed between the "<" and ">" signs!
- # Each bonus data must be separated with a comma and a space (", ")!
- # You can have as many bonus data in a note-tag as you want!
- #
- # Examples:
- #
- # CD Bonus = <8 AGI, 2 STR>
- #
- # The cooldown will be shortened for the action depending on the assigned bonus.
- # The bonus value, in this example, equals:
- # Bonus = (User's AGI * 8%) + (User's STR * 2%)
- # This bonus will be subtracted from the base (default) cooldown for the action.
- # Effectively, the more AGI and STR the user has, the quicker they can perform
- # the same action over and over again.
- #
- # GR Bonus = <14 DEF, 6 AGI, 1 LUK>
- #
- # The guard rate will be higher for the action depending on the assigned bonus.
- # The bonus value, in this example, equals:
- # Bonus = (User's DEF * 14%) + (User's AGI * 6%) + (User's LUK * 1%)
- # This bonus will be added to the base (default) guard rate for the action.
- # Effectively, the more DEF, AGI and LUK the user has, the higher the chance
- # that the guard will be successful.
- #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # * To limit the value of the ABS stats affected by the bonuses, you can use
- # the following note-tags:
- #
- # CD Limit = val # For Cooldown Limit.
- # CT Limit = val # For Cast Time Limit.
- # ED Limit = val # For Effect Delay Limit.
- # TS Limit = val # For Tool Speed Limit.
- # BP Limit = val # For Blowpower Limit.
- # GR Limit = val # For Guard Rate Limit.
- # KD Limit = val # For Knockdown Limit.
- #
- # val = An integer number representing either the lowest or the highest value
- # for the assigned ABS stat.
- # Cooldown, Cast Time and Effect Delay use lowest limits.
- # Tool Speed, Blowpower, Guard Rate and Knockdown use highest limits.
- #
- # The first two letters determine the affected ABS stat!
- # These note-tags have no effect if there is no bonus assigned for the same
- # ABS stat for the action!
- # Default limits can be setup in the script's settings!
- #
- # Examples:
- #
- # CT Limit = 20
- #
- # The cast time will never be lower than 20 for the action, regardless of any
- # bonuses.
- #
- # KD Limit = 50
- #
- # The knockdown chance will never be higher than 50 for the action, regardless
- # of any bonuses.
- #-------------------------------------------------------------------------------
- # * < Installation >
- #-------------------------------------------------------------------------------
- # * Place this scipt below the last script from Falcao's Pearl ABS Liquid v3
- # script series but above Main!
- # * If you are using my Toolbar Addon for Falcao's ABS script, you must put
- # this one above that one!
- # * If you are using my ABS Features Addon for Falcao's ABS script, you must put
- # this one above that one!
- #-------------------------------------------------------------------------------
- # * < Compatibility Info >
- #-------------------------------------------------------------------------------
- # * No known incompatibilities.
- #-------------------------------------------------------------------------------
- # * < Known Issues >
- #-------------------------------------------------------------------------------
- # * No known issues.
- #-------------------------------------------------------------------------------
- # * < Terms of Use >
- #-------------------------------------------------------------------------------
- # * Free to use for whatever purposes you want.
- # * Credit me (Sixth) in your game, pretty please! :P
- # * Posting modified versions of this script is allowed as long as you notice me
- # about it with a link to it!
- #===============================================================================
- $imported = {} if $imported.nil?
- $imported["SixthABSStatAddon"] = true
- #===============================================================================
- # Settings:
- #===============================================================================
- module Sixth_Stat_Bonus # <-- No touchy-touchy!
- # If you set this to true, enemies performing an action with bonuses
- # will get the bonus too. If you set this to false, only the
- # player will get the bonuses upon performing an action, enemies will get
- # the action's base ABS stat values instead without bonuses.
- Enemy_Bonus = true
- # Set the default lowest limits for your actions here.
- # These affect several stats from Falcao's ABS such as:
- # Cooldown, Cast Time, Effect Delay.
- # Usually, the lower these stats, the better they are in this ABS.
- # These stats will never be lower than the value you set here regardless of
- # any bonuses, unless you use a note-tag to change it for an action.
- # Only use integer numbers!
- Def_Cool_Limit = 20 # Cooldown: min = 0, max = infinite.
- Def_Cast_Limit = 20 # Cast Time: min = 0, max = infinite.
- Def_EDelay_Limit = 0 # Effect Delay: min = 0, max = infinite.
- # Set the default highest limits for your actions here.
- # These affect several stats from Falcao's ABS such as:
- # Tool Speed, Blowpower, Guard Rate, Knockdown Rate.
- # Usually, the higher these stats, the better they are in this ABS.
- # These stats will never be higher than the value you set here regardless of
- # any bonuses, unless you use a note-tag to change it for an action.
- # Only use integer numbers!
- Def_TSpeed_Limit = 6 # Tool Speed: min = 1, max = 6.
- Def_BPower_Limit = 6 # Blowpower: min = 0, max = infinite.
- Def_GRate_Limit = 90 # Guard Rate: min = 1, max = 100.
- Def_KDown_Limit = 90 # Knockdown: min = 1, max = 100.
- # If you want to see your effective ABS stats and bonuses and all info about
- # them printed to the console after each action you do in the game, set this to
- # true, else set it to false.
- Debug_Print = false
- end # <-- No touchy-touchy!
- #===============================================================================
- # End of Settings! Editing anything below may lead to... you know it, right?
- #===============================================================================
- module S_CDCTBon
- def self.bonus_grabber(battler,info)
- case info[1]
- when "MHP"
- bonus = (battler.mhp*(info[0]*0.01)).to_i
- when "MMP"
- bonus = (battler.mmp*(info[0]*0.01)).to_i
- when "ATK"
- bonus = (battler.atk*(info[0]*0.01)).to_i
- when "DEF"
- bonus = (battler.def*(info[0]*0.01)).to_i
- when "MAT"
- bonus = (battler.mat*(info[0]*0.01)).to_i
- when "MDF"
- bonus = (battler.mdf*(info[0]*0.01)).to_i
- when "AGI"
- bonus = (battler.agi*(info[0]*0.01)).to_i
- when "LUK"
- bonus = (battler.luk*(info[0]*0.01)).to_i
- end
- return bonus
- end
- end
- # Making note-tags here.
- class RPG::BaseItem
- def cooldown_bonus
- ary = []
- if @note =~ /CD Bonus = <(\d+[ ].*(?:\s*,\s*\d+[ ].*)*)>/i
- $1.split(", ").each do |info|
- info =~ /(\d+) (.*)/i
- ary << [$1.to_i, $2] # [value, stat]
- end
- end
- return ary
- end
- def cast_time_bonus
- ary = []
- if @note =~ /CT Bonus = <(\d+[ ].*(?:\s*,\s*\d+[ ].*)*)>/i
- $1.split(", ").each do |info|
- info =~ /(\d+) (.*)/i
- ary << [$1.to_i, $2] # [value, stat]
- end
- end
- return ary
- end
- def tspeed_bonus
- ary = []
- if @note =~ /TS Bonus = <(\d+[ ].*(?:\s*,\s*\d+[ ].*)*)>/i
- $1.split(", ").each do |info|
- info =~ /(\d+) (.*)/i
- ary << [$1.to_i, $2] # [value, stat]
- end
- end
- return ary
- end
- def bpower_bonus
- ary = []
- if @note =~ /BP Bonus = <(\d+[ ].*(?:\s*,\s*\d+[ ].*)*)>/i
- $1.split(", ").each do |info|
- info =~ /(\d+) (.*)/i
- ary << [$1.to_i, $2] # [value, stat]
- end
- end
- return ary
- end
- def grate_bonus
- ary = []
- if @note =~ /GR Bonus = <(\d+[ ].*(?:\s*,\s*\d+[ ].*)*)>/i
- $1.split(", ").each do |info|
- info =~ /(\d+) (.*)/i
- ary << [$1.to_i, $2] # [value, stat]
- end
- end
- return ary
- end
- def tkdown_bonus
- ary = []
- if @note =~ /KD Bonus = <(\d+[ ].*(?:\s*,\s*\d+[ ].*)*)>/i
- $1.split(", ").each do |info|
- info =~ /(\d+) (.*)/i
- ary << [$1.to_i, $2] # [value, stat]
- end
- end
- return ary
- end
- def edelay_bonus
- ary = []
- if @note =~ /ED Bonus = <(\d+[ ].*(?:\s*,\s*\d+[ ].*)*)>/i
- $1.split(", ").each do |info|
- info =~ /(\d+) (.*)/i
- ary << [$1.to_i, $2] # [value, stat]
- end
- end
- return ary
- end
- def cooldown_limit
- @note =~ /CD Limit = (\d+)/i ? $1.to_i : Sixth_Stat_Bonus::Def_Cool_Limit
- end
- def cast_time_limit
- @note =~ /CT Limit = (\d+)/i ? $1.to_i : Sixth_Stat_Bonus::Def_Cast_Limit
- end
- def tspeed_limit
- @note =~ /TS Limit = (\d+)/i ? $1.to_i : Sixth_Stat_Bonus::Def_TSpeed_Limit
- end
- def bpower_limit
- @note =~ /BP Limit = (\d+)/i ? $1.to_i : Sixth_Stat_Bonus::Def_BPower_Limit
- end
- def grate_limit
- @note =~ /GR Limit = (\d+)/i ? $1.to_i : Sixth_Stat_Bonus::Def_GRate_Limit
- end
- def tkdown_limit
- @note =~ /KD Limit = (\d+)/i ? $1.to_i : Sixth_Stat_Bonus::Def_KDown_Limit
- end
- def edelay_limit
- @note =~ /ED Limit = (\d+)/i ? $1.to_i : Sixth_Stat_Bonus::Def_EDelay_Limit
- end
- end
- # Adding Cast time bonuses here.
- module PearlKernel
- def self.tool_castime(battler)
- base = @item.tool_data("Tool Cast Time = ")
- puts "" if Sixth_Stat_Bonus::Debug_Print
- puts "------------------------------------------------------" if Sixth_Stat_Bonus::Debug_Print
- puts "#{@item.name} - Cast Time" if Sixth_Stat_Bonus::Debug_Print
- puts "Notetag Data --- #{@item.cast_time_bonus}" if Sixth_Stat_Bonus::Debug_Print
- puts "Base Value ----- #{base}" if Sixth_Stat_Bonus::Debug_Print
- return base if battler.nil?
- bonus = 0
- if @item.cast_time_bonus != [] && (battler.is_a?(Game_Actor) || Sixth_Stat_Bonus::Enemy_Bonus)
- @item.cast_time_bonus.each do |info|
- bonus += S_CDCTBon.bonus_grabber(battler,info)
- end
- end
- puts "Total Bonus ---- #{bonus}" if Sixth_Stat_Bonus::Debug_Print
- final_time = base - bonus
- if @item.cast_time_bonus != [] && final_time < @item.cast_time_limit
- final_time = @item.cast_time_limit
- end
- puts "Final Value ---- #{final_time}" if Sixth_Stat_Bonus::Debug_Print
- return final_time
- end
- end
- class Game_CharacterBase
- def process_tool_action(item)
- PearlKernel.load_item(item)
- return if !battler.tool_ready?(item)
- unless PearlKernel.has_data?
- if item.is_a?(RPG::Weapon) || item.is_a?(RPG::Armor)
- msgbox('Tool data missing') if $DEBUG
- return
- end
- if item.scope.between?(1, 6)
- msgbox('Tool data missing') if $DEBUG
- return
- elsif item.scope == 0
- return
- elsif !battler.usable?(item)
- RPG::SE.new("Cursor1", 80).play if self.is_a?(Game_Player)
- return
- end
- end
- if PearlKernel.has_data? and not usable_test_passed?(item)
- RPG::SE.new("Cursor1", 80).play if self.is_a?(Game_Player)
- return
- end
- @user_casting = [PearlKernel.tool_castime(battler),item] if PearlKernel.has_data?
- if @user_casting[0] > 0
- @animation_id = 0
- @animation_id = PearlKernel.tool_castanimation
- else
- load_abs_tool(item)
- end
- end
- end
- # Adding Cooldown bonuses here.
- class Game_Battler < Game_BattlerBase
- def apply_cooldown(item, value)
- puts "" if Sixth_Stat_Bonus::Debug_Print
- puts "#{item.name} - Cooldown" if Sixth_Stat_Bonus::Debug_Print
- puts "Notetag Data --- #{item.cooldown_bonus}" if Sixth_Stat_Bonus::Debug_Print
- puts "Base Value ----- #{value}" if Sixth_Stat_Bonus::Debug_Print
- bon = get_the_bonus(item)
- final_value = value - bon
- if item.cooldown_bonus != [] && final_value < item.cooldown_limit
- final_value = item.cooldown_limit
- end
- puts "Final Value ---- #{final_value}" if Sixth_Stat_Bonus::Debug_Print
- if $imported && $imported["SixthABSToolBarAddon"]
- @msc[item.id] = final_value if item.is_a?(RPG::Skill)
- @mic[item.id] = final_value if item.is_a?(RPG::Item)
- @mwc[item.id] = final_value if item.is_a?(RPG::Weapon)
- @mac[item.id] = final_value if item.is_a?(RPG::Armor)
- end
- @skill_cooldown[item.id] = final_value if item.is_a?(RPG::Skill)
- @item_cooldown[item.id] = final_value if item.is_a?(RPG::Item)
- @weapon_cooldown[item.id] = final_value if item.is_a?(RPG::Weapon)
- @armor_cooldown[item.id] = final_value if item.is_a?(RPG::Armor)
- return final_value
- end
- def get_the_bonus(item)
- bonus = 0
- if item.cooldown_bonus != [] && (self.is_a?(Game_Actor) || Sixth_Stat_Bonus::Enemy_Bonus)
- item.cooldown_bonus.each do |info|
- bonus += S_CDCTBon.bonus_grabber(self,info)
- end
- end
- puts "Total Bonus ---- #{bonus}" if Sixth_Stat_Bonus::Debug_Print
- return bonus
- end
- end
- # Adding Effect Delay, Tool Speed, Blowpower, Guard Rate, Knockdown bonuses here.
- class Projectile < Game_Character
- alias sixth_bonus_adder1112 load_item_data
- def load_item_data
- sixth_bonus_adder1112
- @tool_effect_delay = them_bonuses(@tool_effect_delay,@user.battler,@original_item,5)
- @move_speed = them_bonuses(@move_speed,@user.battler,@original_item,1)
- @tool_blow_power = them_bonuses(@tool_blow_power,@user.battler,@original_item,2)
- @tool_guardrate = them_bonuses(@tool_guardrate,@user.battler,@original_item,3)
- @tool_knockdownrate = them_bonuses(@tool_knockdownrate,@user.battler,@original_item,4)
- puts "------------------------------------------------------" if Sixth_Stat_Bonus::Debug_Print
- end
- def them_bonuses(base,battler,item,type)
- puts "" if Sixth_Stat_Bonus::Debug_Print
- case type
- when 1
- item_bonus = item.tspeed_bonus
- item_limit = item.tspeed_limit
- t1 = "Tool Speed"; neg = false
- when 2
- item_bonus = item.bpower_bonus
- item_limit = item.bpower_limit
- t1 = "Blowpower"; neg = false
- when 3
- item_bonus = item.grate_bonus
- item_limit = item.grate_limit
- t1 = "Guard Rate"; neg = false
- when 4
- item_bonus = item.tkdown_bonus
- item_limit = item.tkdown_limit
- t1 = "Knockdown"; neg = false
- when 5
- item_bonus = item.edelay_bonus
- item_limit = item.edelay_limit
- t1 = "Effect Delay"; neg = true
- end
- puts "#{item.name} - #{t1}" if Sixth_Stat_Bonus::Debug_Print
- puts "Notetag Data --- #{item_bonus}" if Sixth_Stat_Bonus::Debug_Print
- puts "Base Value ----- #{base}" if Sixth_Stat_Bonus::Debug_Print
- bonus = 0
- if item_bonus != [] && (battler.is_a?(Game_Actor) || Sixth_Stat_Bonus::Enemy_Bonus)
- item_bonus.each do |info|
- bonus += S_CDCTBon.bonus_grabber(battler,info)
- end
- end
- puts "Total Bonus ---- #{bonus}" if Sixth_Stat_Bonus::Debug_Print
- final_value = neg == false ? (base + bonus) : (base - bonus)
- if item_bonus != [] && neg == false && final_value > item_limit
- final_value = item_limit
- elsif item_bonus != [] && neg == true && final_value < item_limit
- final_value = item_limit
- end
- puts "Final Value ---- #{final_value}" if Sixth_Stat_Bonus::Debug_Print
- return final_value
- end
- end
- #==============================================================================
- # !!END OF SCRIPT - OHH, NOES!!
- #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement