设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 4238|回复: 2
打印 上一主题 下一主题

[已经解决] 如何修改物品最大持有数

[复制链接]

Lv1.梦旅人

梦石
0
星屑
64
在线时间
294 小时
注册时间
2011-7-31
帖子
687
跳转到指定楼层
1
发表于 2012-4-8 17:40:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
如何修改物品最大持有数


另外,请问事件触发条件中的玩家接触和事件接触有什么区别……
如果繁华被摧毁,让我好好地睡.....

Lv2.观梦者

梦石
0
星屑
723
在线时间
530 小时
注册时间
2010-6-9
帖子
840
2
发表于 2012-4-8 18:17:19 | 只看该作者
本帖最后由 负零 于 2012-4-8 18:20 编辑

全部的话
Game_Party这里   
#--------------------------------------------------------------------------
  # ● 获取物品的最大持有数
  #--------------------------------------------------------------------------
  def max_item_number(item)
    return 99
  end
单个的话这个
  1. # ▼ Yanfly Engine Ace - Adjust Limits v1.00
  2. # -- Last Updated: 2011.12.03
  3. # -- Level: Normal
  4. # -- Requires: n/a
  5. #
  6. #==============================================================================

  7. $imported = {} if $imported.nil?
  8. $imported["YEA-AdjustLimits"] = true

  9. #==============================================================================
  10. # ▼ Updates
  11. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  12. # 2011.12.03 - Finished Script.
  13. # 2011.12.02 - Started Script.
  14. #
  15. #==============================================================================
  16. # ▼ Introduction
  17. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  18. # There exists some limitations in RPG Maker VX Ace that not everybody's fond
  19. # of. With this script, you can easily adjust the limits of each limitation.
  20. # Here's the list of various limits that can be changed:
  21. #
  22. # - Gold Max  - Have more than 99,999,999 gold.
  23. # - Item Max  - Have more than 99 items. Customizable per item, too.
  24. # - Level Max - Exceed 99 levels. Parameters are automatically calculated based
  25. #               on the level 99 and level 98 stats in the class parameters.
  26. # - Stat Max  - Stats can exceed 999. Does not adjust for current formulas.
  27. #
  28. #==============================================================================
  29. # ▼ Instructions
  30. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  31. # To install this script, open up your script editor and copy/paste this script
  32. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  33. #
  34. # -----------------------------------------------------------------------------
  35. # 角色备注栏 - These notetags go in the actors notebox in the database.
  36. # -----------------------------------------------------------------------------
  37. # <initial level: x>   设置角色的初始等级,可超过99.

  38. # <max level: x>       设置角色的最高等级,可超过99.

  39. # -----------------------------------------------------------------------------
  40. # 职业备注栏 - These notetags go in the class notebox in the database.
  41. # -----------------------------------------------------------------------------
  42. # <learn at level: x>  在职业的技能备注栏里设置,等级可超过99.

  43. # -----------------------------------------------------------------------------
  44. # 物品备注栏 - These notetags go in the items notebox in the database.
  45. # -----------------------------------------------------------------------------
  46. # <max limit: x>       设置该物品的可持有上限,比如50.

  47. # <price: x>           设置物品的价格,可打破数据库限制的999999。

  48. # -----------------------------------------------------------------------------
  49. # 武器备注栏 - These notetags go in the weapons notebox in the database.
  50. # -----------------------------------------------------------------------------
  51. # <max limit: x>       设置该物品的可持有上限,比如50.

  52. # <price: x>           设置物品的价格,可打破数据库限制的999999。

  53. # <stat: +x>           设置武器的能力值变化量,例:<ATK: +500>
  54. # <stat: -x>

  55. # -----------------------------------------------------------------------------
  56. # 防具备注栏 - These notetags go in the armours notebox in the database.
  57. # -----------------------------------------------------------------------------
  58. # <max limit: x>       同上
  59. #
  60. # <price: x>

  61. # <stat: +x>
  62. # <stat: -x>
  63. #
  64. # -----------------------------------------------------------------------------
  65. # 敌人备注栏 - These notetags go in the enemy notebox in the database.
  66. # -----------------------------------------------------------------------------
  67. # <stat: x>            设置敌人属性值,可破限。例:<EXP: 6666666>
  68. # MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, LUK, EXP, GOLD

  69. # -----------------------------------------------------------------------------
  70. # 脚本呼出语句 - These commands are used with script calls.
  71. # -----------------------------------------------------------------------------
  72. # gain_gold(x)         设置增减金币,可破限。
  73. # lose_gold(x)
  74. #
  75. # gain_item(x, y)      设置增减X物品Y数目,可破限。
  76. # lose_item(x, y)
  77. # gain_weapon(x, y)
  78. # lose_weapon(x, y)
  79. # gain_armour(x, y)
  80. # lose_armour(x, y)

  81. #==============================================================================
  82. # ▼ Compatibility
  83. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  84. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  85. # it will run with RPG Maker VX without adjusting.
  86. #
  87. #==============================================================================

  88. module YEA
  89.   module LIMIT

  90.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  91.     # - Gold Settings -
  92.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  93.     # Adjust gold settings here. You can change the maximum amount of gold to
  94.     # whatever you want. In addition to that, you can also adjust whether or
  95.     # not you wish for your gold display to show an icon instead, (and change
  96.     # the font size if needed). If there's too much gold that's to be displayed
  97.     # then you can change the text shown in place of that.
  98.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  99.     GOLD_MAX  = 999999999999999  # Maximum gold.
  100.     GOLD_ICON = 361              # Icon used for gold. Use 0 for text currency.
  101.     GOLD_FONT = 20               # Font size used to display gold.
  102.     TOO_MUCH_GOLD = "A lotta gold!"   # Text used when gold cannot fit.

  103.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  104.     # - Item Settings -
  105.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  106.     # Adjust item settings here. You can change the maximum number of items
  107.     # held from 99 to whatever you want. In addition to that, change the prefix
  108.     # used for items when shown in the item display menu (and the font size if
  109.     # needed). Items can have individual maximums through usage of the
  110.     # <max limit: x> notetag.
  111.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  112.     ITEM_MAX  = 9999999  # The default maximum number of items held each.
  113.     ITEM_FONT = 20       # Font size used to display item quantity.
  114.     SHOP_FONT = 20       # Font size used for shop item costs.
  115.     ITEM_PREFIX = "×%s" # Prefix used for item quantity in item lists.

  116.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  117.     # - Parameter Settings -
  118.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  119.     # Adjust the limits for each of the various stats (for MaxHP, MaxMP, ATK,
  120.     # DEF, MAT, and more). Adjust them as you see fit.
  121.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  122.     LEVEL_MAX = 9999 # Sets max level to x for those with 99 level limit.
  123.     MAXHP_MAX = 9999999 # Sets MaxHP to something higher than 9999.
  124.     MAXMP_MAX = 9999999 # Sets MaxMP to something higher than 9999.
  125.     PARAM_MAX = 9999999 # Sets stat max for something higher than 999.
  126.     EQUIP_FONT = 20     # Changes the default equip window font size.

  127.   end # LIMIT
  128. end # YEA

  129. #==============================================================================
  130. # ▼ Editting anything past this point may potentially result in causing
  131. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  132. # halitosis so edit at your own risk.
  133. #==============================================================================

  134. module YEA
  135.   module REGEXP
  136.   module ACTOR

  137.     MAX_LEVEL = /<(?:MAX_LEVEL|max level):[ ](\d+)>/i
  138.     INI_LEVEL = /<(?:INITIAL_LEVEL|initial level):[ ](\d+)>/i

  139.   end # ACTOR
  140.   module CLASS

  141.     LEARN_AT_LV = /<(?:LEARN_AT_LEVEL|learn at level):[ ](\d+)>/i

  142.   end # CLASS
  143.   module BASEITEM

  144.     PRICE     = /<(?:GOLD|price|COST):[ ](\d+)>/i
  145.     MAX_LIMIT = /<(?:MAX_LIMIT|max limit):[ ](\d+)>/i
  146.     STAT_SET  = /<(.*):[ ]*([\+\-]\d+)>/i

  147.   end # BASEITEM
  148.   module ENEMY

  149.     STAT_SET  = /<(.*):[ ]*(\d+)>/i

  150.   end # ENEMY
  151.   end # REGEXP
  152. end # YEA

  153. #==============================================================================
  154. # ■ Icon
  155. #==============================================================================

  156. module Icon

  157.   #--------------------------------------------------------------------------
  158.   # self.gold
  159.   #--------------------------------------------------------------------------
  160.   def self.gold; return YEA::LIMIT::GOLD_ICON; end

  161. end # Icon

  162. #==============================================================================
  163. # ■ Numeric
  164. #==============================================================================

  165. class Numeric

  166.   #--------------------------------------------------------------------------
  167.   # new method: group_digits
  168.   #--------------------------------------------------------------------------
  169.   unless $imported["YEA-CoreEngine"]
  170.   def group; return self.to_s; end
  171.   end # $imported["YEA-CoreEngine"]

  172. end # Numeric

  173. #==============================================================================
  174. # ■ DataManager
  175. #==============================================================================

  176. module DataManager

  177.   #--------------------------------------------------------------------------
  178.   # alias method: load_database
  179.   #--------------------------------------------------------------------------
  180.   class <<self; alias load_database_al load_database; end
  181.   def self.load_database
  182.     load_database_al
  183.     load_notetags_al
  184.   end

  185.   #--------------------------------------------------------------------------
  186.   # new method: load_notetags_al
  187.   #--------------------------------------------------------------------------
  188.   def self.load_notetags_al
  189.     groups = [$data_actors, $data_items, $data_weapons, $data_armors,
  190.       $data_enemies, $data_classes]
  191.     for group in groups
  192.       for obj in group
  193.         next if obj.nil?
  194.         obj.load_notetags_al
  195.       end
  196.     end
  197.   end
  198.   
  199. end # DataManager

  200. #==============================================================================
  201. # ■ RPG::Actor
  202. #==============================================================================

  203. class RPG::Actor < RPG::BaseItem

  204.   #--------------------------------------------------------------------------
  205.   # common cache: load_notetags_al
  206.   #--------------------------------------------------------------------------
  207.   def load_notetags_al
  208.     @max_level = YEA::LIMIT::LEVEL_MAX if @max_level == 99
  209.     #---
  210.     self.note.split(/[\r\n]+/).each { |line|
  211.       case line
  212.       #---
  213.       when YEA::REGEXP::ACTOR::MAX_LEVEL
  214.         @max_level = [[$1.to_i, 1].max, YEA::LIMIT::LEVEL_MAX].min
  215.         @ini_level = [@ini_level, @max_level].min
  216.       when YEA::REGEXP::ACTOR::INI_LEVEL
  217.         @ini_level = [[$1.to_i, 1].max, @max_level].min
  218.       #---
  219.       end
  220.     } # self.note.split
  221.     #---
  222.   end

  223. end # RPG::Actor

  224. #==============================================================================
  225. # ■ RPG::Class
  226. #==============================================================================

  227. class RPG::Class < RPG::BaseItem

  228.   #--------------------------------------------------------------------------
  229.   # new method: above_lv99_params
  230.   #--------------------------------------------------------------------------
  231.   def above_lv99_params(param_id, level)
  232.     return @params[param_id, level] if level <= 99
  233.     n = @params[param_id, 99]
  234.     multiplier = [level - 99, 1].max
  235.     change = (@params[param_id, 99] - @params[param_id, 98]) + 1
  236.     n += change * multiplier
  237.     return n
  238.   end

  239.   #--------------------------------------------------------------------------
  240.   # new method: load_notetags_al
  241.   #--------------------------------------------------------------------------
  242.   def load_notetags_al
  243.     for item in @learnings; item.load_notetags_al; end
  244.   end
  245.   
  246. end # RPG::Class

  247. #==============================================================================
  248. # ■ RPG::Class::Learning
  249. #==============================================================================

  250. class RPG::Class::Learning

  251.   #--------------------------------------------------------------------------
  252.   # common cache: load_notetags_al
  253.   #--------------------------------------------------------------------------
  254.   def load_notetags_al
  255.     #---
  256.     self.note.split(/[\r\n]+/).each { |line|
  257.       case line
  258.       #---
  259.       when YEA::REGEXP::CLASS::LEARN_AT_LV
  260.         @level = [[$1.to_i, 1].max, YEA::LIMIT::LEVEL_MAX].min
  261.       #---
  262.       end
  263.     } # self.note.split
  264.     #---
  265.   end

  266. end # RPG::Class::Learning

  267. #==============================================================================
  268. # ■ RPG::BaseItem
  269. #==============================================================================

  270. class RPG::BaseItem

  271.   #--------------------------------------------------------------------------
  272.   # public instance variables
  273.   #--------------------------------------------------------------------------
  274.   attr_accessor :max_limit

  275.   #--------------------------------------------------------------------------
  276.   # common cache: load_notetags_al
  277.   #--------------------------------------------------------------------------
  278.   def load_notetags_al
  279.     @max_limit = YEA::LIMIT::ITEM_MAX
  280.     #---
  281.     self.note.split(/[\r\n]+/).each { |line|
  282.       case line
  283.       #---
  284.       when YEA::REGEXP::BASEITEM::PRICE
  285.         @price = [$1.to_i, YEA::LIMIT::GOLD_MAX].min
  286.       when YEA::REGEXP::BASEITEM::MAX_LIMIT
  287.         @max_limit = [$1.to_i, 1].max
  288.       when YEA::REGEXP::BASEITEM::STAT_SET
  289.         case $1.upcase
  290.         when "HP", "MAXHP", "MHP"
  291.           @params[0] = $2.to_i
  292.         when "MP", "MAXMP", "MMP", "SP", "MAXSP", "MSP"
  293.           @params[1] = $2.to_i
  294.         when "ATK"
  295.           @params[2] = $2.to_i
  296.         when "DEF"
  297.           @params[3] = $2.to_i
  298.         when "MAT", "INT", "SPI"
  299.           @params[4] = $2.to_i
  300.         when "MDF", "RES"
  301.           @params[5] = $2.to_i
  302.         when "AGI", "SPD"
  303.           @params[6] = $2.to_i
  304.         when "LUK", "LUCK"
  305.           @params[7] = $2.to_i
  306.         end
  307.       #---
  308.       end
  309.     } # self.note.split
  310.     #---
  311.   end

  312.   #--------------------------------------------------------------------------
  313.   # new method: max_limit
  314.   #--------------------------------------------------------------------------
  315.   def max_limit; return @max_limit; end

  316. end # RPG::BaseItem

  317. #==============================================================================
  318. # ■ RPG::Enemy
  319. #==============================================================================

  320. class RPG::Enemy < RPG::BaseItem

  321.   #--------------------------------------------------------------------------
  322.   # common cache: load_notetags_al
  323.   #--------------------------------------------------------------------------
  324.   def load_notetags_al
  325.     #---
  326.     self.note.split(/[\r\n]+/).each { |line|
  327.       case line
  328.       #---
  329.       when YEA::REGEXP::ENEMY::STAT_SET
  330.         case $1.upcase
  331.         when "HP", "MAXHP", "MHP"
  332.           @params[0] = $2.to_i
  333.         when "MP", "MAXMP", "MMP", "SP", "MAXSP", "MSP"
  334.           @params[1] = $2.to_i
  335.         when "ATK"
  336.           @params[2] = $2.to_i
  337.         when "DEF"
  338.           @params[3] = $2.to_i
  339.         when "MAT", "INT", "SPI"
  340.           @params[4] = $2.to_i
  341.         when "MDF", "RES"
  342.           @params[5] = $2.to_i
  343.         when "AGI", "SPD"
  344.           @params[6] = $2.to_i
  345.         when "LUK", "LUCK"
  346.           @params[7] = $2.to_i
  347.         when "EXP", "XP"
  348.           @exp = $2.to_i
  349.         when "GOLD", "GP"
  350.           @gold = $2.to_i
  351.         end
  352.       #---
  353.       end
  354.     } # self.note.split
  355.     #---
  356.   end

  357. end # RPG::Enemy

  358. #==============================================================================
  359. # ■ Game_BattlerBase
  360. #==============================================================================

  361. class Game_BattlerBase

  362.   #--------------------------------------------------------------------------
  363.   # overwrite method: param_max
  364.   #--------------------------------------------------------------------------
  365.   def param_max(param_id)
  366.     return YEA::LIMIT::MAXHP_MAX if param_id == 0
  367.     return YEA::LIMIT::MAXMP_MAX if param_id == 1
  368.     return YEA::LIMIT::PARAM_MAX
  369.   end

  370. end # Game_BattlerBase

  371. #==============================================================================
  372. # ■ Game_Actor
  373. #==============================================================================

  374. class Game_Actor < Game_Battler

  375.   #--------------------------------------------------------------------------
  376.   # overwrite method: param_max
  377.   #--------------------------------------------------------------------------
  378.   def param_max(param_id)
  379.     return super
  380.   end

  381.   #--------------------------------------------------------------------------
  382.   # overwrite method: param_base
  383.   #--------------------------------------------------------------------------
  384.   def param_base(param_id)
  385.     return self.class.params[param_id, @level] if @level <= 99
  386.     return self.class.above_lv99_params(param_id, @level)
  387.   end

  388.   #--------------------------------------------------------------------------
  389.   # new method: check_levels
  390.   #--------------------------------------------------------------------------
  391.   def check_levels
  392.     last_level = @level
  393.     @level = [[@level, max_level].min, 1].max
  394.     return if @level == last_level
  395.     change_exp(exp_for_level(@level), false)
  396.   end

  397. end # Game_Actor

  398. #==============================================================================
  399. # ■ Game_Party
  400. #==============================================================================

  401. class Game_Party < Game_Unit

  402.   #--------------------------------------------------------------------------
  403.   # overwrite method: max_gold
  404.   #--------------------------------------------------------------------------
  405.   def max_gold; return YEA::LIMIT::GOLD_MAX; end

  406.   #--------------------------------------------------------------------------
  407.   # overwrite method: max_item_number
  408.   #--------------------------------------------------------------------------
  409.   def max_item_number(item); return item.max_limit; end

  410. end # Game_Party

  411. #==============================================================================
  412. # ■ Game_Interpreter
  413. #==============================================================================

  414. class Game_Interpreter

  415.   #--------------------------------------------------------------------------
  416.   # new method: gain_gold
  417.   #--------------------------------------------------------------------------
  418.   def gain_gold(value); $game_party.gain_gold(value); end

  419.   #--------------------------------------------------------------------------
  420.   # new method: lose_gold
  421.   #--------------------------------------------------------------------------
  422.   def lose_gold(value); $game_party.lose_gold(value); end

  423.   #--------------------------------------------------------------------------
  424.   # new method: gain_item
  425.   #--------------------------------------------------------------------------
  426.   def gain_item(id, amount)
  427.     return if $data_items[id].nil?
  428.     $game_party.gain_item($data_items[id], amount)
  429.   end

  430.   #--------------------------------------------------------------------------
  431.   # new method: lose_item
  432.   #--------------------------------------------------------------------------
  433.   def lose_item(id, amount)
  434.     return if $data_items[id].nil?
  435.     $game_party.lose_item($data_items[id], amount)
  436.   end

  437.   #--------------------------------------------------------------------------
  438.   # new method: gain_weapon
  439.   #--------------------------------------------------------------------------
  440.   def gain_weapon(id, amount)
  441.     return if $data_weapons[id].nil?
  442.     $game_party.gain_item($data_weapons[id], amount)
  443.   end

  444.   #--------------------------------------------------------------------------
  445.   # new method: lose_weapon
  446.   #--------------------------------------------------------------------------
  447.   def lose_weapon(id, amount)
  448.     return if $data_weapons[id].nil?
  449.     $game_party.lose_item($data_weapons[id], amount)
  450.   end

  451.   #--------------------------------------------------------------------------
  452.   # new method: gain_armour
  453.   #--------------------------------------------------------------------------
  454.   def gain_armour(id, amount)
  455.     return if $data_armors[id].nil?
  456.     $game_party.gain_item($data_armors[id], amount)
  457.   end

  458.   #--------------------------------------------------------------------------
  459.   # new method: lose_armour
  460.   #--------------------------------------------------------------------------
  461.   def lose_armour(id, amount)
  462.     return if $data_armors[id].nil?
  463.     $game_party.lose_item($data_armors[id], amount)
  464.   end

  465.   #--------------------------------------------------------------------------
  466.   # new method: gain_armor
  467.   #--------------------------------------------------------------------------
  468.   def gain_armor(id, amount)
  469.     return if $data_armors[id].nil?
  470.     $game_party.gain_item($data_armors[id], amount)
  471.   end

  472.   #--------------------------------------------------------------------------
  473.   # new method: lose_armor
  474.   #--------------------------------------------------------------------------
  475.   def lose_armor(id, amount)
  476.     return if $data_armors[id].nil?
  477.     $game_party.lose_item($data_armors[id], amount)
  478.   end

  479. end # Game_Interpreter

  480. #==============================================================================
  481. # ■ Window_Base
  482. #==============================================================================

  483. class Window_Base < Window

  484.   #--------------------------------------------------------------------------
  485.   # overwrite method: draw_actor_level
  486.   #--------------------------------------------------------------------------
  487.   def draw_actor_level(actor, dx, dy)
  488.     dw = text_size(Vocab::level_a + YEA::LIMIT::LEVEL_MAX.to_s).width
  489.     change_color(system_color)
  490.     draw_text(dx, dy, dw, line_height, Vocab::level_a)
  491.     change_color(normal_color)
  492.     cx = text_size(Vocab::level_a).width
  493.     draw_text(dx + cx, dy, dw, line_height, actor.level.group, 2)
  494.   end

  495.   #--------------------------------------------------------------------------
  496.   # overwrite method: draw_actor_param
  497.   #--------------------------------------------------------------------------
  498.   def draw_actor_param(actor, dx, dy, param_id)
  499.     change_color(system_color)
  500.     draw_text(dx, dy, 120, line_height, Vocab::param(param_id))
  501.     change_color(normal_color)
  502.     draw_text(dx, dy, 156, line_height, actor.param(param_id).group, 2)
  503.   end

  504.   #--------------------------------------------------------------------------
  505.   # draw_currency_value
  506.   #--------------------------------------------------------------------------
  507.   def draw_currency_value(value, unit, dx, dy, dw)
  508.     contents.font.size = YEA::LIMIT::GOLD_FONT
  509.     cx = gold_icon?(unit) ? 24 : text_size(unit).width
  510.     change_color(normal_color)
  511.     text = value.group
  512.     text = YEA::LIMIT::TOO_MUCH_GOLD if contents.text_size(text).width > dw-cx
  513.     draw_text(dx, dy, dw - cx - 2, line_height, text, 2)
  514.     change_color(system_color)
  515.     draw_icon(Icon.gold, dx+dw-24, dy) if gold_icon?(unit)
  516.     draw_text(dx, dy, dw, line_height, unit, 2) unless gold_icon?(unit)
  517.     reset_font_settings
  518.   end

  519.   #--------------------------------------------------------------------------
  520.   # new method: gold_icon?
  521.   #--------------------------------------------------------------------------
  522.   def gold_icon?(unit)
  523.     return false if unit != Vocab.currency_unit
  524.     return YEA::LIMIT::GOLD_ICON > 0
  525.   end

  526. end # Window_Base

  527. #==============================================================================
  528. # ■ Window_ItemList
  529. #==============================================================================

  530. class Window_ItemList < Window_Selectable

  531.   #--------------------------------------------------------------------------
  532.   # overwrite method: draw_item_number
  533.   #--------------------------------------------------------------------------
  534.   def draw_item_number(rect, item)
  535.     contents.font.size = YEA::LIMIT::ITEM_FONT
  536.     quantity = $game_party.item_number(item).group
  537.     text = sprintf(YEA::LIMIT::ITEM_PREFIX, quantity)
  538.     draw_text(rect, text, 2)
  539.     reset_font_settings
  540.   end

  541. end # Window_ItemList

  542. #==============================================================================
  543. # ■ Window_EquipStatus
  544. #==============================================================================

  545. class Window_EquipStatus < Window_Base

  546.   #--------------------------------------------------------------------------
  547.   # overwrite method: draw_item
  548.   #--------------------------------------------------------------------------
  549.   def draw_item(dx, dy, param_id)
  550.     draw_param_name(dx + 4, dy, param_id)
  551.     draw_current_param(dx + 64, dy, param_id) if @actor
  552.     draw_right_arrow(dx + 110, dy)
  553.     draw_new_param(dx + 132, dy, param_id) if @temp_actor
  554.     reset_font_settings
  555.   end

  556.   #--------------------------------------------------------------------------
  557.   # overwrite method: draw_param_name
  558.   #--------------------------------------------------------------------------
  559.   def draw_param_name(dx, dy, param_id)
  560.     contents.font.size = YEA::LIMIT::EQUIP_FONT
  561.     change_color(system_color)
  562.     draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id))
  563.   end

  564.   #--------------------------------------------------------------------------
  565.   # overwrite method: draw_current_param
  566.   #--------------------------------------------------------------------------
  567.   def draw_current_param(dx, dy, param_id)
  568.     change_color(normal_color)
  569.     draw_text(0, dy, dx+48, line_height, @actor.param(param_id).group, 2)
  570.     reset_font_settings
  571.   end

  572.   #--------------------------------------------------------------------------
  573.   # overwrite method: draw_new_param
  574.   #--------------------------------------------------------------------------
  575.   def draw_new_param(dx, dy, param_id)
  576.     contents.font.size = YEA::LIMIT::EQUIP_FONT
  577.     new_value = @temp_actor.param(param_id)
  578.     change_color(param_change_color(new_value - @actor.param(param_id)))
  579.     draw_text(0, dy, contents.width-4, line_height, new_value.group, 2)
  580.     reset_font_settings
  581.   end

  582. end # Window_EquipStatus

  583. #==============================================================================
  584. # ■ Window_ShopBuy
  585. #==============================================================================

  586. class Window_ShopBuy < Window_Selectable

  587.   #--------------------------------------------------------------------------
  588.   # overwrite method: draw_item
  589.   #--------------------------------------------------------------------------
  590.   def draw_item(index)
  591.     item = @data[index]
  592.     rect = item_rect(index)
  593.     draw_item_name(item, rect.x, rect.y, enable?(item))
  594.     rect.width -= 4
  595.     contents.font.size = YEA::LIMIT::SHOP_FONT
  596.     draw_text(rect, price(item).group, 2)
  597.     reset_font_settings
  598.   end

  599. end # Window_ShopBuy

  600. #==============================================================================
  601. # ■ Scene_Load
  602. #==============================================================================

  603. class Scene_Load < Scene_File

  604.   #--------------------------------------------------------------------------
  605.   # alias method: on_load_success
  606.   #--------------------------------------------------------------------------
  607.   alias on_load_success_al on_load_success
  608.   def on_load_success
  609.     on_load_success_al
  610.     perform_level_check
  611.   end

  612.   #--------------------------------------------------------------------------
  613.   # new method: perform_level_check
  614.   #--------------------------------------------------------------------------
  615.   def perform_level_check
  616.     for i in 1..$data_actors.size
  617.       next if $game_actors[i].nil?
  618.       $game_actors[i].check_levels
  619.     end
  620.   end
  621.   
  622. end # Scene_Load

  623. #==============================================================================
  624. #
  625. # ▼ End of File
  626. #
  627. #==============================================================================

复制代码
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
69 小时
注册时间
2012-3-3
帖子
79
3
发表于 2012-4-9 17:50:54 | 只看该作者
事件触发条件中的玩家接触:一般事件固定不动(比如宝箱,城门)玩家控制角色走到事件所在格子时触发
事件触发条件中的事件接触:一般事件可以移动(比如NPC)无论是玩家主动碰到事件对象,还是事件对象主动碰到玩家,都会触发
内事不决问@度娘,外事不决问@谷哥。
有此二人辅佐,何愁天下不定乎!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-22 21:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表