Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Shanghai Simple Script - Break Max Stats
- # Last Date Updated: 2010.06.18
- # Level: Normal
- #
- # By default, there's maximum HP and MP of 9999 and for regular stats, a growth
- # of 999. This kinda sucks for big, long games that extend their HP and MP
- # growth past 9999 and their regular stats past 999. You can set what you want
- # with them. This script looks through all of an actor's equipment and sees if
- # they have any stat limit breaking properties.
- #===============================================================================
- # 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.
- #
- # <break maxhp: x>
- # <break maxmp: x>
- # <break param: x>
- # Place these note tags into the noteboxes of your equipment to make them have
- # the stat limit breaking properties. x is the new max limit. If multiple equips
- # are worn with stat limit breaking properties, then the one with the highest
- # max limit will be used.
- #
- # To ensure better compatibility between this script with others, place this
- # script above most of your scripts, but under anything like KGC's Limit Breaker
- # or Yanfly's Core Fixes and Upgrades.
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["BreakMaxStats"] = true
- module SSS
- # These set the default limits for each of the following stats.
- DEFAULT_MAXHP_LIMIT = 9999
- DEFAULT_MAXMP_LIMIT = 9999
- DEFAULT_PARAM_LIMIT = 999
- end
- #==============================================================================
- # RPG::BaseItem
- #==============================================================================
- class RPG::BaseItem
- #--------------------------------------------------------------------------
- # break_limits
- #--------------------------------------------------------------------------
- def break_limits
- return @break_limits if @break_limits != nil
- @break_limits = {
- :maxhp => SSS::DEFAULT_MAXHP_LIMIT,
- :maxmp => SSS::DEFAULT_MAXMP_LIMIT,
- :param => SSS::DEFAULT_PARAM_LIMIT,
- }
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:BREAK|break)[ ](.*):[ ](\d+)>/i
- case $1.upcase
- when "HP", "MAXHP"
- @break_limits[:maxhp] = $2.to_i
- when "MP", "MAXMP"
- @break_limits[:maxmp] = $2.to_i
- when "STATS", "PARAMETERS", "STAT", "PARAM"
- @break_limits[:param] = $2.to_i
- end
- end
- }
- return @break_limits
- end
- end
- #==============================================================================
- # ** Game_Temp
- #==============================================================================
- class Game_Temp
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :calcd_limits
- end
- #==============================================================================
- # ** Game_Battler
- #==============================================================================
- class Game_Battler
- #--------------------------------------------------------------------------
- # * Get Maximum MP
- #--------------------------------------------------------------------------
- unless method_defined?(:maxmp_limit)
- def maxmp
- return [[base_maxmp + @maxmp_plus, 0].max, maxmp_limit].min
- end
- end
- #--------------------------------------------------------------------------
- # * Get Maximum STATS
- #--------------------------------------------------------------------------
- unless method_defined?(:parameter_limit)
- def atk
- n = [[base_atk + @atk_plus, 1].max, parameter_limit].min
- for state in states do n *= state.atk_rate / 100.0 end
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- def def
- n = [[base_def + @def_plus, 1].max, parameter_limit].min
- for state in states do n *= state.def_rate / 100.0 end
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- def spi
- n = [[base_spi + @spi_plus, 1].max, parameter_limit].min
- for state in states do n *= state.spi_rate / 100.0 end
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- def agi
- n = [[base_agi + @agi_plus, 1].max, parameter_limit].min
- for state in states do n *= state.agi_rate / 100.0 end
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- end
- #--------------------------------------------------------------------------
- # * Get Maximum MP Limit
- #--------------------------------------------------------------------------
- def maxmp_limit
- return SSS::DEFAULT_MAXMP_LIMIT
- end
- #--------------------------------------------------------------------------
- # * Get Maximum Parameter Limit
- #--------------------------------------------------------------------------
- def parameter_limit
- return SSS::DEFAULT_PARAM_LIMIT
- end
- end
- #==============================================================================
- # ** Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # * Get Maximum HP Limit
- #--------------------------------------------------------------------------
- def maxhp_limit
- return @new_maxhp_limit unless @new_maxhp_limit.nil?
- return SSS::DEFAULT_MAXHP_LIMIT
- end
- #--------------------------------------------------------------------------
- # * Get Maximum MP Limit
- #--------------------------------------------------------------------------
- def maxmp_limit
- return @new_maxmp_limit unless @new_maxmp_limit.nil?
- return SSS::DEFAULT_MAXMP_LIMIT
- end
- #--------------------------------------------------------------------------
- # * Get Maximum Parameter Limit
- #--------------------------------------------------------------------------
- def parameter_limit
- return @new_param_limit unless @new_param_limit.nil?
- return SSS::DEFAULT_PARAM_LIMIT
- end
- #--------------------------------------------------------------------------
- # * Calculate New Limits
- #--------------------------------------------------------------------------
- def calculate_new_limits
- @new_maxhp_limit = SSS::DEFAULT_MAXHP_LIMIT
- @new_maxmp_limit = SSS::DEFAULT_MAXMP_LIMIT
- @new_param_limit = SSS::DEFAULT_PARAM_LIMIT
- for equip in equips.compact
- @new_maxhp_limit = [@new_maxhp_limit, equip.break_limits[:maxhp]].max
- @new_maxmp_limit = [@new_maxmp_limit, equip.break_limits[:maxmp]].max
- @new_param_limit = [@new_param_limit, equip.break_limits[:param]].max
- end
- clear_battle_cache if $imported["BattleEngineMelody"]
- end
- #--------------------------------------------------------------------------
- # * Change Equipment (designate object)
- #--------------------------------------------------------------------------
- alias change_equip_sss_break_max_stats change_equip unless $@
- def change_equip(equip_type, item, test = false)
- change_equip_sss_break_max_stats(equip_type, item, test)
- calculate_new_limits
- end
- end
- #==============================================================================
- # ** Scene_Map
- #==============================================================================
- class Scene_Map < Scene_Base
- #--------------------------------------------------------------------------
- # * Start processing
- #--------------------------------------------------------------------------
- alias start_sss_break_max_stats start unless $@
- def start
- start_sss_break_max_stats
- return if $game_temp.calcd_limits
- $game_temp.calcd_limits = true
- for i in 0..$data_actors.size
- actor = $game_actors[i]
- next if actor.nil?
- actor.calculate_new_limits
- end
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment