=begin #============================================================================== ** Feature: Gold Limit Author: Hime Date: Oct 23, 2012 ------------------------------------------------------------------------------ ** Change log Oct 23 - Gold limit is the default limit if no limit is available Oct 14, 2012 - initial release ------------------------------------------------------------------------------ ** Terms of Use * Free to use in non-commercial projects * Contact me for commercial use * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Preserve this header ------------------------------------------------------------------------------ ** Required -Feature Manager (http://himeworks.com/2012/10/13/feature-manager) ------------------------------------------------------------------------------ Set the amount of gold you can carry. If you have multiple items with this feature, then the total is the sum of all features. Or, you can choose to take the highest limit in the configuration. Tag your database objects with For some integer x #============================================================================== =end $imported = {} if $imported.nil? $imported["Feature_GoldLimit"] = true module Features module Gold_Limit # rather than take the sum of all gold limits, just take the max Use_Max = true #============================================================================== # ** Rest of the script #============================================================================== FeatureManager.register(:gold_limit, 1.2) end end module RPG class BaseItem def add_feature_gold_limit(code, data_id, args) data_id = 0 value = args[0].to_i add_feature(code, data_id, value) end end end class Game_Party < Game_Unit alias :ft_gold_limit_max_gold :max_gold def max_gold if Features::Gold_Limit::Use_Max limit = members.inject(0) {|r, actor| r += actor.features_max_with_id(:gold_limit, 0) || 0}.to_i else limit = members.inject(0) {|r, actor| r += actor.features_sum(:gold_limit, 0) || 0}.to_i end return limit > 0 ? limit : ft_gold_limit_max_gold end end