Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # ~ Critical modifier by TheoAllen ~
- # Version : 1.1
- # Contact : www.rpgmakerid.com
- # =============================================================================
- # Description :
- # This script allow you to configure critical damage.
- # -----------------------------------------------------------------------------
- # Instruction :
- # Insert this script above main and below Material.
- # -----------------------------------------------------------------------------
- # Terms of use :
- # You may use and edit this script both for commercial and non-commercial.
- # Credit isn't necessary. But if you wish to, you can put "TheoAllen" in your
- # credit list.
- # And also thanks to Heartbreak61, Rei_Fan49 and gabokun88 for the inspiration.
- # -----------------------------------------------------------------------------
- # Change log :
- # 1.0 -> 1.1 => Custom critical formula, Fix formula
- # =============================================================================
- # Configuration :
- # =============================================================================
- module THEOLIZED
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # There're 3 types of critical calculation
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # 0 = Default RMVXAce => (damage * 3)
- # 1 = Custom percentage => (damage * (input/100)
- # 2 = By user's luck => (damage * (user.luk + 100) / 100)
- # 3 = Custom formula => (formula)
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- CRIT_TYPE = 2
- # =============================================================================
- # This option only valid when you choose 1 in critical type
- CRIT_MOD = 100 # percentage
- # =============================================================================
- # This option only valid when you choose 3 in critical type
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Usable formulas
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # - damage => Normal damage value
- # - self => Refers to target
- # - user => Refers to user
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Examples :
- # Ex : "damage * user.luk"
- # Ex : "damage * user.agi"
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- CRIT_FORMULA = "damage * 3"
- end
- # =============================================================================
- # Do not edit unless you know what to do ~
- # =============================================================================
- class Game_Battler < Game_BattlerBase
- #--------------------------------------------------------------------------
- # ~ Redefine Calculate Damage
- #--------------------------------------------------------------------------
- def make_damage_value(user, item)
- value = item.damage.eval(user, self, $game_variables)
- value *= item_element_rate(user, item)
- value *= pdr if item.physical?
- value *= mdr if item.magical?
- value *= rec if item.damage.recover?
- value = apply_critical(value, user) if @result.critical
- value = apply_variance(value, item.damage.variance)
- value = apply_guard(value)
- @result.make_damage(value.to_i, item)
- end
- #--------------------------------------------------------------------------
- # ~ Redefine apply critical
- #--------------------------------------------------------------------------
- def apply_critical(damage, user)
- case THEOLIZED::CRIT_TYPE
- when 1
- damage * ((THEOLIZED::CRIT_MOD).abs/100)
- when 2
- damage * ((user.luk + 100)/100)
- when 3
- eval(THEOLIZED::CRIT_FORMULA) rescue 0
- else
- damage * 3
- end
- end
- end
- # =============================================================================
- # End of script
- # =============================================================================
Advertisement
Add Comment
Please, Sign In to add comment