I already have the damage modifier and the "staterate" aspect of that (which is a modifier which is multiplied to the chance of adding or removing a state), I just don't have the certain state exclusion aspect.
Because armor and battler attributes can reduce damage and bleeding but for tough skin or armor to also reduce the chance of breaking someone's magic guard doesn't make sense (although how I'm doing the Guard Break aspect is irrelevant to this topic)
Here is my customized-for-personal-use version of Victor's Action Effectiveness, removing and adding some features it had, although viewing it isn't very important
Spoiler
#==============================================================================# ** Victor Engine - Action Effectiveness#------------------------------------------------------------------------------# Author : Victor Sant## Version History:# v 1.00 - 2012.01.16 > First release# v 1.01 - 2012.07.12 > Action restrictions moved to another script# > Compatibility with Element States# v 1.02 - 2012.07.13 > Compatibility with Action Restriction# v 1.03 - 2013.01.24 > Fixed issue with skill use and item use rate# v 1.04 - 2013.02.13 > Compatibility with Toggle Target#------------------------------------------------------------------------------# This script allows to set the rate of effectivess of actions based on# the user or target.#------------------------------------------------------------------------------# Compatibility# Requires the script 'Victor Engine - Basic Module' v 1.35 or higher## * Overwrite methods# class Game_Battler < Game_BattlerBase# def item_effect_add_state_attack(user, item, effect)# def item_effect_add_state_normal(user, item, effect)# def item_effect_remove_state(user, item, effect)# def item_effect_add_debuff(user, item, effect)## class Scene_ItemBase < Scene_MenuBase# def user## * Alias methods# class Game_Battler < Game_BattlerBase# def item_value_recover_hp(user, item, effect)# def item_value_recover_mp(user, item, effect)# def item_value_gain_tp(user, item, effect)# def item_hit(user, item)# def make_damage_value(user, item)##------------------------------------------------------------------------------# Instructions:# To instal the script, open you script editor and paste this script on# a new section bellow the Materials section. This script must also# be bellow the script 'Victor Engine - Basic'##------------------------------------------------------------------------------# Actors, Classes, Enemies, States, Weapons and Armors note tags:# Tags to be used on the Actors, Classes, Enemies, States, Weapons and Armors # note box in the database## <skill use effectiveness x: y%> <item use effectiveness x: y%> # The actions will have it's effectiveness (damage or sucess chance) changed# by y% when used by a battler with this attribute# x = item or skill ID# y = effectiveness rate## <skill effect effectiveness x: y%> <item effect effectiveness x: y%> # The actions will have it's effectiveness (damage or sucess chance) changed# by y% when targeting a battler with this attribute# x = item or skill ID# y = effectiveness rate## <skill use staterate x: y%> <item use staterate x: y%> # The actions will have its staterate )chance of receiving states or having them # removed) changed by y% when used by a battler with this attribute# x = item or skill ID# y = effectiveness rate## <skill effect staterate x: y%> <item effect staterate x: y%> # The actions will have its staterate (chance of receiving states or having them # removed) changed by y% when targeting a battler with this attribute# x = item or skill ID# y = effectiveness rate##==============================================================================#==============================================================================# ** Victor Engine#------------------------------------------------------------------------------# Setting module for the Victor Engine#==============================================================================module Victor_Engine #-------------------------------------------------------------------------- # * required # This method checks for the existance of the basic module and other # VE scripts required for this script to work, don't edit this #-------------------------------------------------------------------------- def self.required(name, req, version, type = nil) if !$imported[:ve_basic_module] msg = "The script '%s' requires the script\n" msg += "'VE - Basic Module' v%s or higher above it to work properly\n" msg += "Go to http://victorscripts.wordpress.com/ to download this script." msgbox(sprintf(msg, self.script_name(name), version)) exit else self.required_script(name, req, version, type) end end #-------------------------------------------------------------------------- # * script_name # Get the script name base on the imported value, don't edit this #-------------------------------------------------------------------------- def self.script_name(name, ext = "VE") name = name.to_s.gsub("_", " ").upcase.split name.collect! {|char| char == ext ? "#{char} -" : char.capitalize } name.join(" ") endend$imported ||= {}$imported[:ve_action_effectiveness] = 1.04Victor_Engine.required:)ve_action_effectiveness, :ve_basic_module, 1.35, :above)Victor_Engine.required:)ve_action_effectiveness, :ve_element_states, 1.00, :bellow)Victor_Engine.required:)ve_action_effectiveness, :ve_action_restriction, 1.00, :bellow)#==============================================================================# ** Game_Battler#------------------------------------------------------------------------------# This class deals with battlers. It's used as a superclass of the Game_Actor# and Game_Enemy classes.#==============================================================================class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * New method: effectiveness #-------------------------------------------------------------------------- def effectiveness(user, item) value = 1.0 value *= user.get_effectiveness(item, "USE") value *= self.get_effectiveness(item, "EFFECT") value end #-------------------------------------------------------------------------- # * New method: get_effectiveness #-------------------------------------------------------------------------- def get_effectiveness(item, type) action = item.skill? ? "SKILL" : "ITEM" regexp = /<#{action} #{type} EFFECTIVENESS #{item.id}: *(\d+)%?>/i get_all_notes.scan(regexp).inject(1.0) {|r, i| r *= i.first.to_f / 100.0 } end #-------------------------------------------------------------------------- # * New method: staterate #-------------------------------------------------------------------------- def staterate(user, item) value = 1.0 value *= user.get_staterate(item, "USE") value *= self.get_staterate(item, "EFFECT") value end #-------------------------------------------------------------------------- # * New method: get_staterate #-------------------------------------------------------------------------- def get_staterate(item, type) action = item.skill? ? "SKILL" : "ITEM" regexp = /<#{action} #{type} STATERATE #{item.id}: *(\d+)%?>/i get_all_notes.scan(regexp).inject(1.0) {|r, i| r *= i.first.to_f / 100.0 } end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_recover_hp #-------------------------------------------------------------------------- alias :item_value_recover_hp_ve_action_effectiveness :item_value_recover_hp def item_value_recover_hp(user, item, effect) value = item_value_recover_hp_ve_action_effectiveness(user, item, effect) value * effectiveness(user, item) end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_recover_mp #-------------------------------------------------------------------------- alias :item_value_recover_mp_ve_action_effectiveness :item_value_recover_mp def item_value_recover_mp(user, item, effect) value = item_value_recover_mp_ve_action_effectiveness(user, item, effect) value * effectiveness(user, item) end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_recover_tp #-------------------------------------------------------------------------- alias :item_value_recover_tp_ve_action_effectiveness :item_value_recover_tp def item_value_recover_tp(user, item, effect) value = item_value_recover_tp_ve_action_effectiveness(user, item, effect) value * effectiveness(user, item) end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_add_state_normal #-------------------------------------------------------------------------- def item_effect_add_state_normal(user, item, effect) chance = effect.value1 chance *= staterate(user, item) chance *= state_rate(effect.data_id) if opposite?(user) chance *= luk_effect_rate(user) if opposite?(user) if rand < chance add_state(effect.data_id) @result.success = true end end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_remove_state #-------------------------------------------------------------------------- def item_effect_remove_state(user, item, effect) chance = effect.value1 chance *= staterate(user, item) if rand < chance remove_state(effect.data_id) @result.success = true end end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_add_debuff #-------------------------------------------------------------------------- def item_effect_add_debuff(user, item, effect) chance = debuff_rate(effect.data_id) * luk_effect_rate(user) chance *= staterate(user, item) if rand < chance add_debuff(effect.data_id, effect.value1) @result.success = true end end #(#-ed out because chest armor doesn't make make high attacks miss, but reduces#damage from them)# #--------------------------------------------------------------------------# # * Alias method: item_hit# #--------------------------------------------------------------------------# alias :item_hit_ve_action_effectiveness :item_hit# def item_hit(user, item)# rate = item_hit_ve_action_effectiveness(user, item)# rate *= effectiveness(user, item)# rate# end #-------------------------------------------------------------------------- # * Alias method: make_damage_value #-------------------------------------------------------------------------- alias :make_damage_value_ve_action_effectiveness :make_damage_value def make_damage_value(user, item) @effectivess_rate = effectiveness(user, item) make_damage_value_ve_action_effectiveness(user, item) end #-------------------------------------------------------------------------- # * Alias method: apply_guard #-------------------------------------------------------------------------- alias :apply_guard_all_ve_action_effectiveness :apply_guard def apply_guard(damage) damage = apply_guard_all_ve_action_effectiveness(damage) damage *= @effectivess_rate damage endend #==============================================================================# ** Scene_ItemBase#------------------------------------------------------------------------------# This is the superclass for the classes that performs the item and skill# screens.#==============================================================================class Scene_ItemBase < Scene_MenuBase# #removed because I was having problems with it# #--------------------------------------------------------------------------# # * Overwrite method: user# #--------------------------------------------------------------------------# def user# users = $game_party.movable_members.select {|member| member.usable?(item)}# users.max_by {|member| item_modifier(member, item) }# end #-------------------------------------------------------------------------- # * New method: item_modifier #-------------------------------------------------------------------------- def item_modifier(member, item) value = member.pha value *= member.effectivess(member, item)# #I know that it says "Effectivess" and not "Effectiveness but I was having#trouble when it did, and I think either I or Victor made the typo value endend
For the part of my modification that is
class Game_Battler < Game_BattlerBase def item_effect_add_state_normal(user, item, effect) chance = effect.value1 chance *= staterate(user, item) chance *= state_rate(effect.data_id) if opposite?(user) chance *= luk_effect_rate(user) if opposite?(user) if rand < chance add_state(effect.data_id) @result.success = true end endendI don't know how to make it so that this process will occur unless the given state that the game is processing whether or not to apply is, say, states 51, 52, or 55.
So that means that the chance will not be multiplied by
staterate(user, item)
if 'effect' is add state 51, 52, or 55.
So I'm thinking something like
def item_effect_add_state_normal(user, item, effect) chance = effect.value1 if 'effect' != "add_state(51)" and 'effect' != "add_state(51)" and 'effect' != "add_state(51)" then chance *= staterate(user, item) else end chance *= state_rate(effect.data_id) if opposite?(user) chance *= luk_effect_rate(user) if opposite?(user) if rand < chance add_state(effect.data_id) @result.success = true end endbut I know that's obviously not how it works lol
or something to do with
effect.data_idI'm not for sure