khanhdu

▼ Yanfly Engine Ace - Adjust Limits v1.00

Dec 11th, 2017
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 29.87 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Adjust Limits v1.00
  4. # -- Last Updated: 2011.12.03
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-AdjustLimits"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2011.12.03 - Finished Script.
  17. # 2011.12.02 - Started Script.
  18. #
  19. #==============================================================================
  20. # ▼ Introduction
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # There exists some limitations in RPG Maker VX Ace that not everybody's fond
  23. # of. With this script, you can easily adjust the limits of each limitation.
  24. # Here's the list of various limits that can be changed:
  25. #
  26. # - Gold Max  - Have more than 99,999,999 gold.
  27. # - Item Max  - Have more than 99 items. Customizable per item, too.
  28. # - Level Max - Exceed 99 levels. Parameters are automatically calculated based
  29. #               on the level 99 and level 98 stats in the class parameters.
  30. # - Stat Max  - Stats can exceed 999. Does not adjust for current formulas.
  31. #
  32. #==============================================================================
  33. # ▼ Instructions
  34. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  35. # To install this script, open up your script editor and copy/paste this script
  36. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  37. #
  38. # -----------------------------------------------------------------------------
  39. # Actor Notetags - These notetags go in the actors notebox in the database.
  40. # -----------------------------------------------------------------------------
  41. # <initial level: x>
  42. # Sets the initial level for the specific actor. Can go above level 99 as long
  43. # as the max level is higher than 99. Default initial level limit is 99.
  44. #
  45. # <max level: x>
  46. # Sets the max level for the specific actor. Can go above level 99 as long as
  47. # the higher limit is defined in the module. Default max level is level 99.
  48. #
  49. # -----------------------------------------------------------------------------
  50. # Class Notetags - These notetags go in the class notebox in the database.
  51. # -----------------------------------------------------------------------------
  52. # <learn at level: x>
  53. # This actually goes inside of the skill learning "notes" box. Replace x with
  54. # the level you wish for the class to learn the skill at. This enables classes
  55. # to learn new skills past level 99.
  56. #
  57. # -----------------------------------------------------------------------------
  58. # Item Notetags - These notetags go in the items notebox in the database.
  59. # -----------------------------------------------------------------------------
  60. # <max limit: x>
  61. # Changes the maximum number of items that can be held from whatever the
  62. # normal amount that can be held. Default amount is 99.
  63. #
  64. # <price: x>
  65. # Changes the price of the item to x. Allows you to go over the price of
  66. # 999,999 gold if your maximum gold exceeds that amount. Default maximum gold
  67. # is 99,999,999 gold.
  68. #
  69. # -----------------------------------------------------------------------------
  70. # Weapon Notetags - These notetags go in the weapons notebox in the database.
  71. # -----------------------------------------------------------------------------
  72. # <max limit: x>
  73. # Changes the maximum number of items that can be held from whatever the
  74. # normal amount that can be held. Default amount is 99.
  75. #
  76. # <price: x>
  77. # Changes the price of the item to x. Allows you to go over the price of
  78. # 999,999 gold if your maximum gold exceeds that amount. Default maximum gold
  79. # is 99,999,999 gold.
  80. #
  81. # <stat: +x>
  82. # <stat: -x>
  83. # Changes the stat bonus of the piece of equipment to yield +x or -x. Allows
  84. # bonus to go over +500 and under -500. Replace stat with one of the following:
  85. # MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, LUK
  86. #
  87. # -----------------------------------------------------------------------------
  88. # Armour Notetags - These notetags go in the armours notebox in the database.
  89. # -----------------------------------------------------------------------------
  90. # <max limit: x>
  91. # Changes the maximum number of items that can be held from whatever the
  92. # normal amount that can be held. Default amount is 99.
  93. #
  94. # <price: x>
  95. # Changes the price of the item to x. Allows you to go over the price of
  96. # 999,999 gold if your maximum gold exceeds that amount. Default maximum gold
  97. # is 99,999,999 gold.
  98. #
  99. # <stat: +x>
  100. # <stat: -x>
  101. # Changes the stat bonus of the piece of equipment to yield +x or -x. Allows
  102. # bonus to go over +500 and under -500. Replace stat with one of the following:
  103. # MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, LUK
  104. #
  105. # -----------------------------------------------------------------------------
  106. # Enemy Notetags - These notetags go in the enemy notebox in the database.
  107. # -----------------------------------------------------------------------------
  108. # <stat: x>
  109. # Changes the stat of the enemy to x value. Allows going over the database max
  110. # values. Replace stat with one of the following:
  111. # MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, LUK, EXP, GOLD
  112. #
  113. # -----------------------------------------------------------------------------
  114. # Script Calls - These commands are used with script calls.
  115. # -----------------------------------------------------------------------------
  116. # gain_gold(x)
  117. # lose_gold(x)
  118. # Causes the player to gain/lose x gold. Allows you to go over 9,999,999 gold.
  119. # Default maximum gold is 99,999,999.
  120. #
  121. # gain_item(x, y)
  122. # lose_item(x, y)
  123. # gain_weapon(x, y)
  124. # lose_weapon(x, y)
  125. # gain_armour(x, y)
  126. # lose_armour(x, y)
  127. # Causes the player to gain/lose x item in y amount. Allows you to go over 99
  128. # quantity. Default quantity is 99.
  129. #
  130. #==============================================================================
  131. # ▼ Compatibility
  132. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  133. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  134. # it will run with RPG Maker VX without adjusting.
  135. #
  136. #==============================================================================
  137.  
  138. module YEA
  139.   module LIMIT
  140.    
  141.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  142.     # - Gold Settings -
  143.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  144.     # Adjust gold settings here. You can change the maximum amount of gold to
  145.     # whatever you want. In addition to that, you can also adjust whether or
  146.     # not you wish for your gold display to show an icon instead, (and change
  147.     # the font size if needed). If there's too much gold that's to be displayed
  148.     # then you can change the text shown in place of that.
  149.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  150.     GOLD_MAX  = 999999999999999  # Maximum gold.
  151.     GOLD_ICON = 361              # Icon used for gold. Use 0 for text currency.
  152.     GOLD_FONT = 16               # Font size used to display gold.
  153.     TOO_MUCH_GOLD = "A lotta gold!"   # Text used when gold cannot fit.
  154.    
  155.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  156.     # - Item Settings -
  157.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  158.     # Adjust item settings here. You can change the maximum number of items
  159.     # held from 99 to whatever you want. In addition to that, change the prefix
  160.     # used for items when shown in the item display menu (and the font size if
  161.     # needed). Items can have individual maximums through usage of the
  162.     # <max limit: x> notetag.
  163.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  164.     ITEM_MAX  = 999     # The default maximum number of items held each.
  165.     ITEM_FONT = 16      # Font size used to display item quantity.
  166.     SHOP_FONT = 16      # Font size used for shop item costs.
  167.     ITEM_PREFIX = "×%s" # Prefix used for item quantity in item lists.
  168.    
  169.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  170.     # - Parameter Settings -
  171.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  172.     # Adjust the limits for each of the various stats (for MaxHP, MaxMP, ATK,
  173.     # DEF, MAT, and more). Adjust them as you see fit.
  174.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  175.     LEVEL_MAX = 99      # Sets max level to x for those with 99 level limit.
  176.     MAXHP_MAX = 9999999 # Sets MaxHP to something higher than 9999.
  177.     MAXMP_MAX = 9999999 # Sets MaxMP to something higher than 9999.
  178.     PARAM_MAX = 99999   # Sets stat max for something higher than 999.
  179.     EQUIP_FONT = 16     # Changes the default equip window font size.
  180.    
  181.   end # LIMIT
  182. end # YEA
  183.  
  184. #==============================================================================
  185. # ▼ Editting anything past this point may potentially result in causing
  186. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  187. # halitosis so edit at your own risk.
  188. #==============================================================================
  189.  
  190. module YEA
  191.   module REGEXP
  192.   module ACTOR
  193.    
  194.     MAX_LEVEL = /<(?:MAX_LEVEL|max level):[ ](\d+)>/i
  195.     INI_LEVEL = /<(?:INITIAL_LEVEL|initial level):[ ](\d+)>/i
  196.    
  197.   end # ACTOR
  198.   module CLASS
  199.    
  200.     LEARN_AT_LV = /<(?:LEARN_AT_LEVEL|learn at level):[ ](\d+)>/i
  201.    
  202.   end # CLASS
  203.   module BASEITEM
  204.    
  205.     PRICE     = /<(?:GOLD|price|COST):[ ](\d+)>/i
  206.     MAX_LIMIT = /<(?:MAX_LIMIT|max limit):[ ](\d+)>/i
  207.     STAT_SET  = /<(.*):[ ]*([\+\-]\d+)>/i
  208.    
  209.   end # BASEITEM
  210.   module ENEMY
  211.    
  212.     STAT_SET  = /<(.*):[ ]*(\d+)>/i
  213.    
  214.   end # ENEMY
  215.   end # REGEXP
  216. end # YEA
  217.  
  218. #==============================================================================
  219. # ■ Icon
  220. #==============================================================================
  221.  
  222. module Icon
  223.  
  224.   #--------------------------------------------------------------------------
  225.   # self.gold
  226.   #--------------------------------------------------------------------------
  227.   def self.gold; return YEA::LIMIT::GOLD_ICON; end
  228.    
  229. end # Icon
  230.  
  231. #==============================================================================
  232. # ■ Numeric
  233. #==============================================================================
  234.  
  235. class Numeric
  236.  
  237.   #--------------------------------------------------------------------------
  238.   # new method: group_digits
  239.   #--------------------------------------------------------------------------
  240.   unless $imported["YEA-CoreEngine"]
  241.   def group; return self.to_s; end
  242.   end # $imported["YEA-CoreEngine"]
  243.    
  244. end # Numeric
  245.  
  246. #==============================================================================
  247. # ■ DataManager
  248. #==============================================================================
  249.  
  250. module DataManager
  251.  
  252.   #--------------------------------------------------------------------------
  253.   # alias method: load_database
  254.   #--------------------------------------------------------------------------
  255.   class <<self; alias load_database_al load_database; end
  256.   def self.load_database
  257.     load_database_al
  258.     load_notetags_al
  259.   end
  260.  
  261.   #--------------------------------------------------------------------------
  262.   # new method: load_notetags_al
  263.   #--------------------------------------------------------------------------
  264.   def self.load_notetags_al
  265.     groups = [$data_actors, $data_items, $data_weapons, $data_armors,
  266.       $data_enemies, $data_classes]
  267.     for group in groups
  268.       for obj in group
  269.         next if obj.nil?
  270.         obj.load_notetags_al
  271.       end
  272.     end
  273.   end
  274.  
  275. end # DataManager
  276.  
  277. #==============================================================================
  278. # ■ RPG::Actor
  279. #==============================================================================
  280.  
  281. class RPG::Actor < RPG::BaseItem
  282.  
  283.   #--------------------------------------------------------------------------
  284.   # common cache: load_notetags_al
  285.   #--------------------------------------------------------------------------
  286.   def load_notetags_al
  287.     @max_level = YEA::LIMIT::LEVEL_MAX if @max_level == 99
  288.     #---
  289.     self.note.split(/[\r\n]+/).each { |line|
  290.       case line
  291.       #---
  292.       when YEA::REGEXP::ACTOR::MAX_LEVEL
  293.         @max_level = [[$1.to_i, 1].max, YEA::LIMIT::LEVEL_MAX].min
  294.         @ini_level = [@ini_level, @max_level].min
  295.       when YEA::REGEXP::ACTOR::INI_LEVEL
  296.         @ini_level = [[$1.to_i, 1].max, @max_level].min
  297.       #---
  298.       end
  299.     } # self.note.split
  300.     #---
  301.   end
  302.  
  303. end # RPG::Actor
  304.  
  305. #==============================================================================
  306. # ■ RPG::Class
  307. #==============================================================================
  308.  
  309. class RPG::Class < RPG::BaseItem
  310.  
  311.   #--------------------------------------------------------------------------
  312.   # new method: above_lv99_params
  313.   #--------------------------------------------------------------------------
  314.   def above_lv99_params(param_id, level)
  315.     return @params[param_id, level] if level <= 99
  316.     n = @params[param_id, 99]
  317.     multiplier = [level - 99, 1].max
  318.     change = (@params[param_id, 99] - @params[param_id, 98]) + 1
  319.     n += change * multiplier
  320.     return n
  321.   end
  322.  
  323.   #--------------------------------------------------------------------------
  324.   # new method: load_notetags_al
  325.   #--------------------------------------------------------------------------
  326.   def load_notetags_al
  327.     for item in @learnings; item.load_notetags_al; end
  328.   end
  329.  
  330. end # RPG::Class
  331.  
  332. #==============================================================================
  333. # ■ RPG::Class::Learning
  334. #==============================================================================
  335.  
  336. class RPG::Class::Learning
  337.  
  338.   #--------------------------------------------------------------------------
  339.   # common cache: load_notetags_al
  340.   #--------------------------------------------------------------------------
  341.   def load_notetags_al
  342.     #---
  343.     self.note.split(/[\r\n]+/).each { |line|
  344.       case line
  345.       #---
  346.       when YEA::REGEXP::CLASS::LEARN_AT_LV
  347.         @level = [[$1.to_i, 1].max, YEA::LIMIT::LEVEL_MAX].min
  348.       #---
  349.       end
  350.     } # self.note.split
  351.     #---
  352.   end
  353.  
  354. end # RPG::Class::Learning
  355.  
  356. #==============================================================================
  357. # ■ RPG::BaseItem
  358. #==============================================================================
  359.  
  360. class RPG::BaseItem
  361.  
  362.   #--------------------------------------------------------------------------
  363.   # public instance variables
  364.   #--------------------------------------------------------------------------
  365.   attr_accessor :max_limit
  366.  
  367.   #--------------------------------------------------------------------------
  368.   # common cache: load_notetags_al
  369.   #--------------------------------------------------------------------------
  370.   def load_notetags_al
  371.     @max_limit = YEA::LIMIT::ITEM_MAX
  372.     #---
  373.     self.note.split(/[\r\n]+/).each { |line|
  374.       case line
  375.       #---
  376.       when YEA::REGEXP::BASEITEM::PRICE
  377.         @price = [$1.to_i, YEA::LIMIT::GOLD_MAX].min
  378.       when YEA::REGEXP::BASEITEM::MAX_LIMIT
  379.         @max_limit = [$1.to_i, 1].max
  380.       when YEA::REGEXP::BASEITEM::STAT_SET
  381.         case $1.upcase
  382.         when "HP", "MAXHP", "MHP"
  383.           @params[0] = $2.to_i
  384.         when "MP", "MAXMP", "MMP", "SP", "MAXSP", "MSP"
  385.           @params[1] = $2.to_i
  386.         when "ATK"
  387.           @params[2] = $2.to_i
  388.         when "DEF"
  389.           @params[3] = $2.to_i
  390.         when "MAT", "INT", "SPI"
  391.           @params[4] = $2.to_i
  392.         when "MDF", "RES"
  393.           @params[5] = $2.to_i
  394.         when "AGI", "SPD"
  395.           @params[6] = $2.to_i
  396.         when "LUK", "LUCK"
  397.           @params[7] = $2.to_i
  398.         end
  399.       #---
  400.       end
  401.     } # self.note.split
  402.     #---
  403.   end
  404.  
  405.   #--------------------------------------------------------------------------
  406.   # new method: max_limit
  407.   #--------------------------------------------------------------------------
  408.   def max_limit; return @max_limit; end
  409.  
  410. end # RPG::BaseItem
  411.  
  412. #==============================================================================
  413. # ■ RPG::Enemy
  414. #==============================================================================
  415.  
  416. class RPG::Enemy < RPG::BaseItem
  417.  
  418.   #--------------------------------------------------------------------------
  419.   # common cache: load_notetags_al
  420.   #--------------------------------------------------------------------------
  421.   def load_notetags_al
  422.     #---
  423.     self.note.split(/[\r\n]+/).each { |line|
  424.       case line
  425.       #---
  426.       when YEA::REGEXP::ENEMY::STAT_SET
  427.         case $1.upcase
  428.         when "HP", "MAXHP", "MHP"
  429.           @params[0] = $2.to_i
  430.         when "MP", "MAXMP", "MMP", "SP", "MAXSP", "MSP"
  431.           @params[1] = $2.to_i
  432.         when "ATK"
  433.           @params[2] = $2.to_i
  434.         when "DEF"
  435.           @params[3] = $2.to_i
  436.         when "MAT", "INT", "SPI"
  437.           @params[4] = $2.to_i
  438.         when "MDF", "RES"
  439.           @params[5] = $2.to_i
  440.         when "AGI", "SPD"
  441.           @params[6] = $2.to_i
  442.         when "LUK", "LUCK"
  443.           @params[7] = $2.to_i
  444.         when "EXP", "XP"
  445.           @exp = $2.to_i
  446.         when "GOLD", "GP"
  447.           @gold = $2.to_i
  448.         end
  449.       #---
  450.       end
  451.     } # self.note.split
  452.     #---
  453.   end
  454.  
  455. end # RPG::Enemy
  456.  
  457. #==============================================================================
  458. # ■ Game_BattlerBase
  459. #==============================================================================
  460.  
  461. class Game_BattlerBase
  462.  
  463.   #--------------------------------------------------------------------------
  464.   # overwrite method: param_max
  465.   #--------------------------------------------------------------------------
  466.   def param_max(param_id)
  467.     return YEA::LIMIT::MAXHP_MAX if param_id == 0
  468.     return YEA::LIMIT::MAXMP_MAX if param_id == 1
  469.     return YEA::LIMIT::PARAM_MAX
  470.   end
  471.  
  472. end # Game_BattlerBase
  473.  
  474. #==============================================================================
  475. # ■ Game_Actor
  476. #==============================================================================
  477.  
  478. class Game_Actor < Game_Battler
  479.  
  480.   #--------------------------------------------------------------------------
  481.   # overwrite method: param_max
  482.   #--------------------------------------------------------------------------
  483.   def param_max(param_id)
  484.     return super
  485.   end
  486.  
  487.   #--------------------------------------------------------------------------
  488.   # overwrite method: param_base
  489.   #--------------------------------------------------------------------------
  490.   def param_base(param_id)
  491.     return self.class.params[param_id, @level] if @level <= 99
  492.     return self.class.above_lv99_params(param_id, @level)
  493.   end
  494.  
  495.   #--------------------------------------------------------------------------
  496.   # new method: check_levels
  497.   #--------------------------------------------------------------------------
  498.   def check_levels
  499.     last_level = @level
  500.     @level = [[@level, max_level].min, 1].max
  501.     return if @level == last_level
  502.     change_exp(exp_for_level(@level), false)
  503.   end
  504.  
  505. end # Game_Actor
  506.  
  507. #==============================================================================
  508. # ■ Game_Party
  509. #==============================================================================
  510.  
  511. class Game_Party < Game_Unit
  512.  
  513.   #--------------------------------------------------------------------------
  514.   # overwrite method: max_gold
  515.   #--------------------------------------------------------------------------
  516.   def max_gold; return YEA::LIMIT::GOLD_MAX; end
  517.  
  518.   #--------------------------------------------------------------------------
  519.   # overwrite method: max_item_number
  520.   #--------------------------------------------------------------------------
  521.   def max_item_number(item); return item.max_limit; end
  522.  
  523. end # Game_Party
  524.  
  525. #==============================================================================
  526. # ■ Game_Interpreter
  527. #==============================================================================
  528.  
  529. class Game_Interpreter
  530.  
  531.   #--------------------------------------------------------------------------
  532.   # new method: gain_gold
  533.   #--------------------------------------------------------------------------
  534.   def gain_gold(value); $game_party.gain_gold(value); end
  535.  
  536.   #--------------------------------------------------------------------------
  537.   # new method: lose_gold
  538.   #--------------------------------------------------------------------------
  539.   def lose_gold(value); $game_party.lose_gold(value); end
  540.  
  541.   #--------------------------------------------------------------------------
  542.   # new method: gain_item
  543.   #--------------------------------------------------------------------------
  544.   def gain_item(id, amount)
  545.     return if $data_items[id].nil?
  546.     $game_party.gain_item($data_items[id], amount)
  547.   end
  548.  
  549.   #--------------------------------------------------------------------------
  550.   # new method: lose_item
  551.   #--------------------------------------------------------------------------
  552.   def lose_item(id, amount)
  553.     return if $data_items[id].nil?
  554.     $game_party.lose_item($data_items[id], amount)
  555.   end
  556.  
  557.   #--------------------------------------------------------------------------
  558.   # new method: gain_weapon
  559.   #--------------------------------------------------------------------------
  560.   def gain_weapon(id, amount)
  561.     return if $data_weapons[id].nil?
  562.     $game_party.gain_item($data_weapons[id], amount)
  563.   end
  564.  
  565.   #--------------------------------------------------------------------------
  566.   # new method: lose_weapon
  567.   #--------------------------------------------------------------------------
  568.   def lose_weapon(id, amount)
  569.     return if $data_weapons[id].nil?
  570.     $game_party.lose_item($data_weapons[id], amount)
  571.   end
  572.  
  573.   #--------------------------------------------------------------------------
  574.   # new method: gain_armour
  575.   #--------------------------------------------------------------------------
  576.   def gain_armour(id, amount)
  577.     return if $data_armors[id].nil?
  578.     $game_party.gain_item($data_armors[id], amount)
  579.   end
  580.  
  581.   #--------------------------------------------------------------------------
  582.   # new method: lose_armour
  583.   #--------------------------------------------------------------------------
  584.   def lose_armour(id, amount)
  585.     return if $data_armors[id].nil?
  586.     $game_party.lose_item($data_armors[id], amount)
  587.   end
  588.  
  589.   #--------------------------------------------------------------------------
  590.   # new method: gain_armor
  591.   #--------------------------------------------------------------------------
  592.   def gain_armor(id, amount)
  593.     return if $data_armors[id].nil?
  594.     $game_party.gain_item($data_armors[id], amount)
  595.   end
  596.  
  597.   #--------------------------------------------------------------------------
  598.   # new method: lose_armor
  599.   #--------------------------------------------------------------------------
  600.   def lose_armor(id, amount)
  601.     return if $data_armors[id].nil?
  602.     $game_party.lose_item($data_armors[id], amount)
  603.   end
  604.  
  605. end # Game_Interpreter
  606.  
  607. #==============================================================================
  608. # ■ Window_Base
  609. #==============================================================================
  610.  
  611. class Window_Base < Window
  612.  
  613.   #--------------------------------------------------------------------------
  614.   # overwrite method: draw_actor_level
  615.   #--------------------------------------------------------------------------
  616.   def draw_actor_level(actor, dx, dy)
  617.     dw = text_size(Vocab::level_a + YEA::LIMIT::LEVEL_MAX.to_s).width
  618.     change_color(system_color)
  619.     draw_text(dx, dy, dw, line_height, Vocab::level_a)
  620.     change_color(normal_color)
  621.     cx = text_size(Vocab::level_a).width
  622.     draw_text(dx + cx, dy, dw, line_height, actor.level.group, 2)
  623.   end
  624.  
  625.   #--------------------------------------------------------------------------
  626.   # overwrite method: draw_actor_param
  627.   #--------------------------------------------------------------------------
  628.   def draw_actor_param(actor, dx, dy, param_id)
  629.     change_color(system_color)
  630.     draw_text(dx, dy, 120, line_height, Vocab::param(param_id))
  631.     change_color(normal_color)
  632.     draw_text(dx, dy, 156, line_height, actor.param(param_id).group, 2)
  633.   end
  634.  
  635.   #--------------------------------------------------------------------------
  636.   # draw_currency_value
  637.   #--------------------------------------------------------------------------
  638.   def draw_currency_value(value, unit, dx, dy, dw)
  639.     contents.font.size = YEA::LIMIT::GOLD_FONT
  640.     cx = gold_icon?(unit) ? 24 : text_size(unit).width
  641.     change_color(normal_color)
  642.     text = value.group
  643.     text = YEA::LIMIT::TOO_MUCH_GOLD if contents.text_size(text).width > dw-cx
  644.     draw_text(dx, dy, dw - cx - 2, line_height, text, 2)
  645.     change_color(system_color)
  646.     draw_icon(Icon.gold, dx+dw-24, dy) if gold_icon?(unit)
  647.     draw_text(dx, dy, dw, line_height, unit, 2) unless gold_icon?(unit)
  648.     reset_font_settings
  649.   end
  650.  
  651.   #--------------------------------------------------------------------------
  652.   # new method: gold_icon?
  653.   #--------------------------------------------------------------------------
  654.   def gold_icon?(unit)
  655.     return false if unit != Vocab.currency_unit
  656.     return YEA::LIMIT::GOLD_ICON > 0
  657.   end
  658.  
  659. end # Window_Base
  660.  
  661. #==============================================================================
  662. # ■ Window_ItemList
  663. #==============================================================================
  664.  
  665. class Window_ItemList < Window_Selectable
  666.  
  667.   #--------------------------------------------------------------------------
  668.   # overwrite method: draw_item_number
  669.   #--------------------------------------------------------------------------
  670.   def draw_item_number(rect, item)
  671.     contents.font.size = YEA::LIMIT::ITEM_FONT
  672.     quantity = $game_party.item_number(item).group
  673.     text = sprintf(YEA::LIMIT::ITEM_PREFIX, quantity)
  674.     draw_text(rect, text, 2)
  675.     reset_font_settings
  676.   end
  677.  
  678. end # Window_ItemList
  679.  
  680. #==============================================================================
  681. # ■ Window_EquipStatus
  682. #==============================================================================
  683.  
  684. class Window_EquipStatus < Window_Base
  685.  
  686.   #--------------------------------------------------------------------------
  687.   # overwrite method: draw_item
  688.   #--------------------------------------------------------------------------
  689.   def draw_item(dx, dy, param_id)
  690.     draw_param_name(dx + 4, dy, param_id)
  691.     draw_current_param(dx + 64, dy, param_id) if @actor
  692.     draw_right_arrow(dx + 110, dy)
  693.     draw_new_param(dx + 132, dy, param_id) if @temp_actor
  694.     reset_font_settings
  695.   end
  696.  
  697.   #--------------------------------------------------------------------------
  698.   # overwrite method: draw_param_name
  699.   #--------------------------------------------------------------------------
  700.   def draw_param_name(dx, dy, param_id)
  701.     contents.font.size = YEA::LIMIT::EQUIP_FONT
  702.     change_color(system_color)
  703.     draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id))
  704.   end
  705.  
  706.   #--------------------------------------------------------------------------
  707.   # overwrite method: draw_current_param
  708.   #--------------------------------------------------------------------------
  709.   def draw_current_param(dx, dy, param_id)
  710.     change_color(normal_color)
  711.     draw_text(0, dy, dx+48, line_height, @actor.param(param_id).group, 2)
  712.     reset_font_settings
  713.   end
  714.  
  715.   #--------------------------------------------------------------------------
  716.   # overwrite method: draw_new_param
  717.   #--------------------------------------------------------------------------
  718.   def draw_new_param(dx, dy, param_id)
  719.     contents.font.size = YEA::LIMIT::EQUIP_FONT
  720.     new_value = @temp_actor.param(param_id)
  721.     change_color(param_change_color(new_value - @actor.param(param_id)))
  722.     draw_text(0, dy, contents.width-4, line_height, new_value.group, 2)
  723.     reset_font_settings
  724.   end
  725.  
  726. end # Window_EquipStatus
  727.  
  728. #==============================================================================
  729. # ■ Window_ShopBuy
  730. #==============================================================================
  731.  
  732. class Window_ShopBuy < Window_Selectable
  733.  
  734.   #--------------------------------------------------------------------------
  735.   # overwrite method: draw_item
  736.   #--------------------------------------------------------------------------
  737.   def draw_item(index)
  738.     item = @data[index]
  739.     rect = item_rect(index)
  740.     draw_item_name(item, rect.x, rect.y, enable?(item))
  741.     rect.width -= 4
  742.     contents.font.size = YEA::LIMIT::SHOP_FONT
  743.     draw_text(rect, price(item).group, 2)
  744.     reset_font_settings
  745.   end
  746.  
  747. end # Window_ShopBuy
  748.  
  749. #==============================================================================
  750. # ■ Scene_Load
  751. #==============================================================================
  752.  
  753. class Scene_Load < Scene_File
  754.  
  755.   #--------------------------------------------------------------------------
  756.   # alias method: on_load_success
  757.   #--------------------------------------------------------------------------
  758.   alias on_load_success_al on_load_success
  759.   def on_load_success
  760.     on_load_success_al
  761.     perform_level_check
  762.   end
  763.  
  764.   #--------------------------------------------------------------------------
  765.   # new method: perform_level_check
  766.   #--------------------------------------------------------------------------
  767.   def perform_level_check
  768.     for i in 1..$data_actors.size
  769.       next if $game_actors[i].nil?
  770.       $game_actors[i].check_levels
  771.     end
  772.   end
  773.  
  774. end # Scene_Load
  775.  
  776. #==============================================================================
  777. #
  778. # ▼ End of File
  779. #
  780. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment