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

Project1

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

[已经过期] 商店脚本卡住了

[复制链接]

Lv2.观梦者

会吐槽的画师

梦石
0
星屑
782
在线时间
3431 小时
注册时间
2011-6-10
帖子
6535
跳转到指定楼层
1
发表于 2013-6-22 19:56:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
这是一个增强型的商店脚本,但是选择贩卖界面时会卡住:
  1. #===============================================================================
  2. #
  3. # Yanfly Engine RD - Scene Shop ReDux
  4. # Last Date Updated: 2009.06.08
  5. # Level: Normal
  6. #
  7. # The shop scene was more or less fine by itself aside from a few efficiency
  8. # issues. This script patches up those efficiency problems in and displays more
  9. # data given for buyable items. Before, we received nothing but a blank number
  10. # input window only to show us how much of the item is being bought. The script
  11. # makes use of that empty space to give a little more detail on what is being
  12. # purchased. The status window also more or less compares only one stat. This
  13. # script will increase that to the four ADSA stats. For games with more than 4
  14. # party members, you may have experienced that the status window didn't have
  15. # enough room to show. Imported from KGC is the ability to scroll that window
  16. # to allow for a more comfortable and informative shop scene.
  17. #
  18. #===============================================================================
  19. # Updates:
  20. # ----------------------------------------------------------------------------
  21. # o 2009.06.08 - Finished script.
  22. # o 2009.06.07 - Started script.
  23. #===============================================================================
  24. # Instructions
  25. #===============================================================================
  26. #
  27. # For the most part, this script is plug and play. Scroll down and change the
  28. # various settings under the module.
  29. #
  30. #===============================================================================
  31. #
  32. # Compatibility
  33. # - Works With: KGC's Equip Extension
  34. # - Works With: Yanfly's Extra Equipment Options
  35. # - Overwrites: Scene_Shop: update
  36. # - Overwrites: Window_ShopNumber: refresh
  37. # - Overwrites: Window_ShopStatus: refresh
  38. #
  39. #===============================================================================
  40. # Credits:
  41. # KGC for shop status scrolling method.
  42. #===============================================================================

  43. $imported = {} if $imported == nil
  44. $imported["SceneShopReDux"] = true

  45. module YE
  46.   module REDUX
  47.     module SHOP
  48.       
  49.       #------------------------------------------------------------------------
  50.       # STATUS WINDOW OPTIONS
  51.       #------------------------------------------------------------------------
  52.       
  53.       # This adjusts the text for the status window over on the right.
  54.       POSSESSION = "持有"       # How many items in possession of party.
  55.       EQUIPPED   = "装备中"         # Appears if actor has item equipped.
  56.       
  57.       # This button is used to scroll the status window if it is too short.
  58.       # This has been made mostly for games with more than 4 party members.
  59.       SCROLL_KEY = Input::X
  60.       
  61.       # The following adjusts the icons used for stat increases and decreases.
  62.       # Just refer them to ATK, DEF, SPI, and AGI in that order.
  63.       STAT_INCREASE = [120, 121, 122, 123]
  64.       STAT_DECREASE = [124, 125, 126, 127]
  65.       
  66.       #------------------------------------------------------------------------
  67.       # PURCHASE WINDOW OPTIONS
  68.       #------------------------------------------------------------------------
  69.       
  70.       # The following determines the text displayed at the amount selection
  71.       # screen. Change the information here accordingly.
  72.       PURCHASE = "购买数量"           # Title of purchasing information.
  73.       COST_ICN = 205                  # Icon of total cost.
  74.       COST_TXT = "价格"         # Text for total cost.
  75.       ITEMSTAT = "物品信息"          # Text for item data.
  76.       WPN_STAT = "基本加成"        # Text for weapon data.
  77.       ARM_STAT = "基本加成"        # Text for armour data.
  78.       NOEFFECT = "————"         # Text if no data is revealed.
  79.       FONTSIZE = 16                   # Font size used for data text.
  80.       
  81.       # The following adjusts extra increment increases for pressing L or R
  82.       # while the number window is open.
  83.       LR_INCREMENT = 100
  84.       
  85.       # This part defines the data used for item/equipment properties.
  86.       HP_HEAL_TEXT = "HP回复"      # Text used for HP recovery.
  87.       HP_HEAL_ICON = 128              # Icon used for HP recovery.
  88.       MP_HEAL_TEXT = "MP回复"      # Text used for MP recovery.
  89.       MP_HEAL_ICON = 202              # Icon used for MP recovery.
  90.       ERASE_STATE  = "解除状态" # Text used for removing states.
  91.       APPLY_STATE  = "附加状态" # Text used for applying states.
  92.       PARAM_BOOST  = "提升 %s"      # Text used for parameter raising.
  93.       SPELL_EFFECT = "咒語能力"   # Text used for spell effect items.
  94.       SPELL_DAMAGE = "%d 伤害"    # Text used for spell damage.
  95.       SPELL_HEAL   = "%d 治疗效果"   # Text used for spell healing.
  96.       NO_EQ_STAT   = "---"            # Text used when no equip
  97.       EQ_ELEMENT_W = "附加属性"  # Text used to represent equip elements.
  98.       EQ_ELEMENT_A = "防御属性"  # Text used to represent equip elements.
  99.       EQ_STATUS_W  = "附加状态"   # Text used to represent equip states.
  100.       EQ_STATUS_A  = "防御状态"   # Text used to represent equip states.
  101.       
  102.       # These are the general icons and text used for various aspects of new
  103.       # shop windows. Used for items and equips alike.
  104.       ICON_HP  = 99            # Icon for MAXHP
  105.       TEXT_HP  = "HP"       # Text for MAXHP
  106.       ICON_MP  = 100           # Icon for MAXMP
  107.       TEXT_MP  = "MP"       # Text for MAXMP
  108.       ICON_ATK = 2             # Icon for ATK
  109.       TEXT_ATK = "攻击"         # Text for ATK
  110.       ICON_DEF = 52            # Icon for DEF
  111.       TEXT_DEF = "防御"         # Text for DEF
  112.       ICON_SPI = 21            # Icon for SPI
  113.       TEXT_SPI = "精神"         # Text for SPI
  114.       ICON_AGI = 48            # Icon for AGI
  115.       TEXT_AGI = "敏捷"         # Text for AGI
  116.       ICON_HIT  = 135          # Icon for HIT
  117.       TEXT_HIT  = "命中"        # Text for HIT
  118.       ICON_EVA  = 158          # Icon for EVA
  119.       TEXT_EVA  = "闪避"        # Text for EVA
  120.       ICON_CRI  = 119          # Icon for CRI
  121.       TEXT_CRI  = "暴击"        # Text for CRI
  122.       SHOW_CRI  = true         # Display CRI?
  123.       ICON_ODDS = 137          # Icon for ODDS
  124.       TEXT_ODDS = "幸運"        # Text for ODDS
  125.       SHOW_ODDS = true         # Display ODDS?
  126.       ICON_BASEDMG  = 119      # Used for base damage.
  127.       ICON_BASEHEAL = 128      # Used for base healing.
  128.       
  129.       # The following determines which elements can be shown in the elements
  130.       # list. If an element is not included here, it is ignored.
  131.       # 各属性的icon設定
  132.       SHOWN_ELEMENTS ={
  133.       # ElID => IconID
  134.            2 => 26,
  135.            3 => 4,
  136.            5 => 16,
  137.            6 => 29,
  138.            7 => 21,
  139.            9 => 104,
  140.           10 => 105,
  141.           11 => 106,
  142.           12 => 107,
  143.           13 => 108,
  144.           14 => 109,
  145.           15 => 110,
  146.           16 => 111,
  147.       } # Do not remove this.
  148.       
  149.     end # SHOP
  150.   end # REDUX
  151. end # YE

  152. #===============================================================================
  153. # Editting anything past this point may potentially result in causing computer
  154. # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
  155. # Therefore, edit at your own risk.
  156. #===============================================================================

  157. #===============================================================================
  158. # Scene_Shop
  159. #===============================================================================

  160. class Scene_Shop < Scene_Base
  161.   
  162.   #--------------------------------------------------------------------------
  163.   # overwrite update
  164.   #--------------------------------------------------------------------------
  165.   def update
  166.     super
  167.     update_menu_background
  168.     if @command_window.active
  169.       @command_window.update
  170.       @dummy_window.update
  171.       update_command_selection
  172.     elsif @status_window.visible and Input.press?(YE::REDUX::SHOP::SCROLL_KEY)
  173.       update_scroll_status
  174.     elsif @buy_window.active
  175.       @gold_window.update
  176.       @help_window.update
  177.       @buy_window.update
  178.       @status_window.cursor_rect.empty
  179.       @status_window.update
  180.       update_buy_selection
  181.     elsif @sell_window.active
  182.       @gold_window.update
  183.       @help_window.update
  184.       @sell_window.update
  185.       update_sell_selection
  186.     elsif @number_window.active
  187.       @number_window.update
  188.       @status_window.cursor_rect.empty
  189.       @status_window.update
  190.       update_number_input
  191.     end
  192.   end
  193.   
  194.   #--------------------------------------------------------------------------
  195.   # update_scroll_status
  196.   #--------------------------------------------------------------------------
  197.   def update_scroll_status
  198.     @status_window.cursor_rect.width = @status_window.contents.width
  199.     @status_window.cursor_rect.height = @status_window.height - 32
  200.     @status_window.update
  201.     if Input.press?(Input::UP)
  202.       @status_window.oy = [@status_window.oy - 4, 0].max
  203.     elsif Input.press?(Input::DOWN)
  204.       max_pos = [@status_window.contents.height -
  205.         (@status_window.height - 32), 0].max
  206.       @status_window.oy = [@status_window.oy + 4, max_pos].min
  207.     end
  208.   end
  209.   
  210. end # Scene_Shop

  211. #===============================================================================
  212. # Window_ShopNumber
  213. #===============================================================================

  214. class Window_ShopNumber < Window_Base

  215.   #--------------------------------------------------------------------------
  216.   # overwrite refresh
  217.   #--------------------------------------------------------------------------
  218.   def refresh
  219.     dy = 0
  220.     sw = self.width - 32
  221.     self.contents.clear
  222.     self.contents.font.color = system_color
  223.     self.contents.font.size = Font.default_size
  224.     self.contents.draw_text(0, dy, sw, WLH, YE::REDUX::SHOP::PURCHASE, 1)
  225.     dy += WLH
  226.     self.contents.font.color = normal_color
  227.     draw_item_name(@item, 0, dy)
  228.     self.contents.draw_text(212, dy, 20, WLH, "×")
  229.     self.contents.draw_text(218, dy, 50, WLH, @number, 2)
  230.     self.cursor_rect.set(207, dy, 64, WLH)
  231.     dy += WLH
  232.     draw_icon(YE::REDUX::SHOP::COST_ICN, 0, dy)
  233.     self.contents.draw_text(24, dy, sw-24, WLH, YE::REDUX::SHOP::COST_TXT)
  234.     draw_currency_value(@price * @number, 4, dy, 264)
  235.     dy += WLH
  236.     if @item.is_a?(RPG::Item)
  237.       draw_item_stats(dy, sw)
  238.     else
  239.       draw_equip_stats(dy, sw)
  240.     end
  241.   end
  242.   
  243.   #--------------------------------------------------------------------------
  244.   # overwrite update
  245.   #--------------------------------------------------------------------------
  246.   def update
  247.     super
  248.     if self.active
  249.       last_number = @number
  250.       if Input.repeat?(Input::RIGHT) and [url=home.php?mod=space&uid=27178]@Number[/url] < @max
  251.         @number += 1
  252.       end
  253.       if Input.repeat?(Input::LEFT) and @number > 1
  254.         @number -= 1
  255.       end
  256.       if Input.repeat?(Input::UP) and @number < @max
  257.         @number = [@number + 10, @max].min
  258.       end
  259.       if Input.repeat?(Input::DOWN) and @number > 1
  260.         @number = [@number - 10, 1].max
  261.       end
  262.       if Input.repeat?(Input::L) and @number > 1
  263.         @number = [@number - YE::REDUX::SHOP::LR_INCREMENT, 1].max
  264.       end
  265.       if Input.repeat?(Input::R) and @number < @max
  266.         @number = [@number + YE::REDUX::SHOP::LR_INCREMENT, @max].min
  267.       end
  268.       if @number != last_number
  269.         Sound.play_cursor
  270.         refresh
  271.       end
  272.     end
  273.   end
  274.   
  275.   #--------------------------------------------------------------------------
  276.   # draw_item_stats
  277.   #--------------------------------------------------------------------------
  278.   def draw_item_stats(dy, sw)
  279.     start_dy = dy
  280.     self.contents.font.color = system_color
  281.     self.contents.draw_text(0, dy, sw, WLH, YE::REDUX::SHOP::ITEMSTAT, 1)
  282.     self.contents.font.size = YE::REDUX::SHOP::FONTSIZE
  283.     #-----
  284.     if @item.base_damage != 0
  285.       dy += WLH
  286.       if @item.base_damage > 0
  287.         icon = YE::REDUX::SHOP::ICON_BASEDMG
  288.         result = sprintf(YE::REDUX::SHOP::SPELL_DAMAGE, @item.base_damage)
  289.       else
  290.         icon = YE::REDUX::SHOP::ICON_BASEHEAL
  291.         result = sprintf(YE::REDUX::SHOP::SPELL_HEAL, [email protected]_damage)
  292.       end
  293.       if @item.element_set != []
  294.         for ele_id in @item.element_set
  295.           next unless YE::REDUX::SHOP::SHOWN_ELEMENTS.include?(ele_id)
  296.           icon = YE::REDUX::SHOP::SHOWN_ELEMENTS[ele_id]
  297.           break
  298.         end
  299.       end
  300.       text = YE::REDUX::SHOP::SPELL_EFFECT
  301.       draw_icon(icon, 0, dy)
  302.       self.contents.draw_text(24, dy, sw/2-24, WLH, text, 0)
  303.       self.contents.font.color = normal_color
  304.       self.contents.draw_text(sw/2, dy, sw/2, WLH, result, 2)
  305.     end
  306.     #-----
  307.     if @item.hp_recovery != 0 or @item.hp_recovery_rate != 0
  308.       self.contents.font.color = system_color
  309.       dy += WLH
  310.       draw_icon(YE::REDUX::SHOP::HP_HEAL_ICON, 0, dy)
  311.       text = YE::REDUX::SHOP::HP_HEAL_TEXT
  312.       self.contents.draw_text(24, dy, sw/2-24, WLH, text, 0)
  313.       self.contents.font.color = normal_color
  314.       if @item.hp_recovery_rate != 0 and @item.hp_recovery != 0
  315.         text = sprintf("%+d%% %s", @item.hp_recovery_rate, Vocab::hp)
  316.         self.contents.draw_text(sw/2, dy, sw/4, WLH, text, 2)
  317.         text = sprintf("%+d %s", @item.hp_recovery, Vocab::hp)
  318.         self.contents.draw_text(sw*3/4, dy, sw/4, WLH, text, 2)
  319.       elsif @item.hp_recovery_rate != 0
  320.         text = sprintf("%+d%% %s", @item.hp_recovery_rate, Vocab::hp)
  321.         self.contents.draw_text(sw*3/4, dy, sw/4, WLH, text, 2)
  322.       else
  323.         text = sprintf("%+d %s", @item.hp_recovery, Vocab::hp)
  324.         self.contents.draw_text(sw*3/4, dy, sw/4, WLH, text, 2)
  325.       end
  326.     end
  327.     #-----
  328.     if @item.mp_recovery != 0 or @item.mp_recovery_rate != 0
  329.       self.contents.font.color = system_color
  330.       dy += WLH
  331.       draw_icon(YE::REDUX::SHOP::MP_HEAL_ICON, 0, dy)
  332.       text = YE::REDUX::SHOP::MP_HEAL_TEXT
  333.       self.contents.draw_text(24, dy, sw/2-24, WLH, text, 0)
  334.       self.contents.font.color = normal_color
  335.       if @item.mp_recovery_rate != 0 and @item.mp_recovery != 0
  336.         text = sprintf("%+d%% %s", @item.mp_recovery_rate, Vocab::mp)
  337.         self.contents.draw_text(sw/2, dy, sw/4, WLH, text, 2)
  338.         text = sprintf("%+d %s", @item.mp_recovery, Vocab::mp)
  339.         self.contents.draw_text(sw*3/4, dy, sw/4, WLH, text, 2)
  340.       elsif @item.mp_recovery_rate != 0
  341.         text = sprintf("%+d%% %s", @item.mp_recovery_rate, Vocab::mp)
  342.         self.contents.draw_text(sw*3/4, dy, sw/4, WLH, text, 2)
  343.       else
  344.         text = sprintf("%+d %s", @item.mp_recovery, Vocab::mp)
  345.         self.contents.draw_text(sw*3/4, dy, sw/4, WLH, text, 2)
  346.       end
  347.     end
  348.     #-----
  349.     if @item.plus_state_set != []
  350.       self.contents.font.color = system_color
  351.       dy += WLH
  352.       self.contents.draw_text(0, dy, sw, WLH, YE::REDUX::SHOP::APPLY_STATE, 1)
  353.       dx = (sw - (@item.plus_state_set.size * 24)) / 2
  354.       dy += WLH
  355.       for state_id in @item.plus_state_set
  356.         state = $data_states[state_id]
  357.         next if state == nil
  358.         next if state.icon_index == 0
  359.         draw_icon(state.icon_index, dx, dy)
  360.         dx += 24
  361.       end
  362.     end
  363.     if @item.minus_state_set != []
  364.       self.contents.font.color = system_color
  365.       dy += WLH
  366.       self.contents.draw_text(0, dy, sw, WLH, YE::REDUX::SHOP::ERASE_STATE, 1)
  367.       dx = (sw - (@item.minus_state_set.size * 24)) / 2
  368.       dy += WLH
  369.       for state_id in @item.minus_state_set
  370.         state = $data_states[state_id]
  371.         next if state == nil
  372.         next if state.icon_index == 0
  373.         draw_icon(state.icon_index, dx, dy)
  374.         dx += 24
  375.       end
  376.     end
  377.     #-----
  378.     if @item.parameter_type != 0
  379.       self.contents.font.color = system_color
  380.       dy += WLH
  381.       case @item.parameter_type
  382.       when 1
  383.         icon = YE::REDUX::SHOP::ICON_HP
  384.         text = YE::REDUX::SHOP::TEXT_HP
  385.       when 2
  386.         icon = YE::REDUX::SHOP::ICON_MP
  387.         text = YE::REDUX::SHOP::TEXT_MP
  388.       when 3
  389.         icon = YE::REDUX::SHOP::ICON_ATK
  390.         text = YE::REDUX::SHOP::TEXT_ATK
  391.       when 4
  392.         icon = YE::REDUX::SHOP::ICON_DEF
  393.         text = YE::REDUX::SHOP::TEXT_DEF
  394.       when 5
  395.         icon = YE::REDUX::SHOP::ICON_SPI
  396.         text = YE::REDUX::SHOP::TEXT_SPI
  397.       when 6
  398.         icon = YE::REDUX::SHOP::ICON_AGI
  399.         text = YE::REDUX::SHOP::TEXT_AGI
  400.       end
  401.       draw_icon(icon, 0, dy)
  402.       boost = sprintf(YE::REDUX::SHOP::PARAM_BOOST, text)
  403.       self.contents.draw_text(24, dy, sw/2-24, WLH, boost, 0)
  404.       self.contents.font.color = normal_color
  405.       param = sprintf("%+d %s", @item.parameter_points, text)
  406.       self.contents.draw_text(sw/2, dy, sw/2, WLH, param, 2)
  407.     end
  408.     #-----
  409.     if start_dy == dy
  410.       dy += WLH
  411.       self.contents.font.color = normal_color
  412.       self.contents.draw_text(0, dy, sw, WLH, YE::REDUX::SHOP::NOEFFECT, 1)
  413.     end
  414.   end
  415.   
  416.   #--------------------------------------------------------------------------
  417.   # draw_equip_stats
  418.   #--------------------------------------------------------------------------
  419.   def draw_equip_stats(dy, sw)
  420.     self.contents.font.color = system_color
  421.     if @item.is_a?(RPG::Weapon)
  422.       self.contents.draw_text(0, dy, sw, WLH, YE::REDUX::SHOP::WPN_STAT, 1)
  423.     else
  424.       self.contents.draw_text(0, dy, sw, WLH, YE::REDUX::SHOP::ARM_STAT, 1)
  425.     end
  426.     self.contents.font.size = YE::REDUX::SHOP::FONTSIZE
  427.     dy += 24
  428.     if $imported["ExtraEquipmentOptions"]
  429.       #---MaxHP---
  430.       if @item.bonus_paramp[:maxhp] != 100
  431.         text = sprintf("%+d%%", @item.bonus_paramp[:maxhp] - 100)
  432.         enabled = true
  433.       elsif @item.bonus_param[:maxhp] != 0
  434.         text = sprintf("%+d", @item.bonus_param[:maxhp])
  435.         enabled = true
  436.       else
  437.         text = YE::REDUX::SHOP::NO_EQ_STAT
  438.         enabled = false
  439.       end
  440.       self.contents.font.color = system_color
  441.       self.contents.font.color.alpha = enabled ? 255 : 128
  442.       self.contents.draw_text(24, dy, sw/2-24, WLH, YE::REDUX::SHOP::TEXT_HP)
  443.       self.contents.font.color = normal_color
  444.       self.contents.font.color.alpha = enabled ? 255 : 128
  445.       draw_icon(YE::REDUX::SHOP::ICON_HP, 0, dy, enabled)
  446.       self.contents.draw_text(sw*1/4, dy, sw/5, WLH, text, 2)
  447.       #---MaxMP---
  448.       if @item.bonus_paramp[:maxmp] != 100
  449.         text = sprintf("%+d%%", @item.bonus_paramp[:maxmp] - 100)
  450.         enabled = true
  451.       elsif @item.bonus_param[:maxmp] != 0
  452.         text = sprintf("%+d", @item.bonus_param[:maxmp])
  453.         enabled = true
  454.       else
  455.         text = YE::REDUX::SHOP::NO_EQ_STAT
  456.         enabled = false
  457.       end
  458.       self.contents.font.color = system_color
  459.       self.contents.font.color.alpha = enabled ? 255 : 128
  460.       self.contents.draw_text(sw/2+24, dy, sw/2-24, WLH, YE::REDUX::SHOP::TEXT_MP)
  461.       self.contents.font.color = normal_color
  462.       self.contents.font.color.alpha = enabled ? 255 : 128
  463.       draw_icon(YE::REDUX::SHOP::ICON_MP, sw/2, dy, enabled)
  464.       self.contents.draw_text(sw*3/4, dy, sw/5, WLH, text, 2)
  465.       #------
  466.       dy += 24
  467.       #------
  468.     end
  469.     #---ATK---
  470.     if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:atk] != 100
  471.       text = sprintf("%+d%%", @item.bonus_paramp[:atk] - 100)
  472.       enabled = true
  473.     elsif $imported["ExtraEquipmentOptions"] and @item.bonus_param[:atk] != 0
  474.       text = sprintf("%+d", @item.bonus_param[:atk] + @item.atk)
  475.       enabled = true
  476.     elsif @item.atk != 0
  477.       text = sprintf("%+d", @item.atk)
  478.       enabled = true
  479.     else
  480.       text = YE::REDUX::SHOP::NO_EQ_STAT
  481.       enabled = false
  482.     end
  483.     self.contents.font.color = system_color
  484.     self.contents.font.color.alpha = enabled ? 255 : 128
  485.     self.contents.draw_text(24, dy, sw/2-24, WLH, YE::REDUX::SHOP::TEXT_ATK)
  486.     self.contents.font.color = normal_color
  487.     self.contents.font.color.alpha = enabled ? 255 : 128
  488.     draw_icon(YE::REDUX::SHOP::ICON_ATK, 0, dy, enabled)
  489.     self.contents.draw_text(sw*1/4, dy, sw/5, WLH, text, 2)
  490.     #---DEF---
  491.     if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:def] != 100
  492.       text = sprintf("%+d%%", @item.bonus_paramp[:def] - 100)
  493.       enabled = true
  494.     elsif $imported["ExtraEquipmentOptions"] and @item.bonus_param[:def] != 0
  495.       text = sprintf("%+d", @item.bonus_param[:def] + @item.def)
  496.       enabled = true
  497.     elsif @item.def != 0
  498.       text = sprintf("%+d", @item.def)
  499.       enabled = true
  500.     else
  501.       text = YE::REDUX::SHOP::NO_EQ_STAT
  502.       enabled = false
  503.     end
  504.     self.contents.font.color = system_color
  505.     self.contents.font.color.alpha = enabled ? 255 : 128
  506.     self.contents.draw_text(sw/2+24, dy, sw/2-24, WLH, YE::REDUX::SHOP::TEXT_DEF)
  507.     self.contents.font.color = normal_color
  508.     self.contents.font.color.alpha = enabled ? 255 : 128
  509.     draw_icon(YE::REDUX::SHOP::ICON_DEF, sw/2, dy, enabled)
  510.     self.contents.draw_text(sw*3/4, dy, sw/5, WLH, text, 2)
  511.     #------
  512.     dy += 24
  513.     #---SPI---
  514.     if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:spi] != 100
  515.       text = sprintf("%+d%%", @item.bonus_paramp[:spi] - 100)
  516.       enabled = true
  517.     elsif $imported["ExtraEquipmentOptions"] and @item.bonus_param[:spi] != 0
  518.       text = sprintf("%+d", @item.bonus_param[:spi] + @item.spi)
  519.       enabled = true
  520.     elsif @item.spi != 0
  521.       text = sprintf("%+d", @item.spi)
  522.       enabled = true
  523.     else
  524.       text = YE::REDUX::SHOP::NO_EQ_STAT
  525.       enabled = false
  526.     end
  527.     self.contents.font.color = system_color
  528.     self.contents.font.color.alpha = enabled ? 255 : 128
  529.     self.contents.draw_text(24, dy, sw/2-24, WLH, YE::REDUX::SHOP::TEXT_SPI)
  530.     self.contents.font.color = normal_color
  531.     self.contents.font.color.alpha = enabled ? 255 : 128
  532.     draw_icon(YE::REDUX::SHOP::ICON_SPI, 0, dy, enabled)
  533.     self.contents.draw_text(sw*1/4, dy, sw/5, WLH, text, 2)
  534.     #---AGI---
  535.     if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:agi] != 100
  536.       text = sprintf("%+d%%", @item.bonus_paramp[:agi] - 100)
  537.       enabled = true
  538.     elsif $imported["ExtraEquipmentOptions"] and @item.bonus_param[:agi] != 0
  539.       text = sprintf("%+d", @item.bonus_param[:agi] + @item.agi)
  540.       enabled = true
  541.     elsif @item.agi != 0
  542.       text = sprintf("%+d", @item.agi)
  543.       enabled = true
  544.     else
  545.       text = YE::REDUX::SHOP::NO_EQ_STAT
  546.       enabled = false
  547.     end
  548.     self.contents.font.color = system_color
  549.     self.contents.font.color.alpha = enabled ? 255 : 128
  550.     self.contents.draw_text(sw/2+24, dy, sw/2-24, WLH, YE::REDUX::SHOP::TEXT_AGI)
  551.     self.contents.font.color = normal_color
  552.     self.contents.font.color.alpha = enabled ? 255 : 128
  553.     draw_icon(YE::REDUX::SHOP::ICON_AGI, sw/2, dy, enabled)
  554.     self.contents.draw_text(sw*3/4, dy, sw/5, WLH, text, 2)
  555.     #------
  556.     dy += 24
  557.     #---HIT---
  558.     if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:hit] != 100
  559.       text = sprintf("%+d%%", @item.bonus_paramp[:hit] - 100)
  560.       enabled = true
  561.     elsif $imported["ExtraEquipmentOptions"] and @item.bonus_param[:hit] != 0
  562.       value = @item.bonus_param[:hit]
  563.       value += @item.hit if @item.is_a?(RPG::Weapon)
  564.       text = sprintf("%+d%%", value)
  565.       enabled = true
  566.     elsif @item.is_a?(RPG::Weapon) and @item.hit != 0
  567.       text = sprintf("%+d%%", @item.hit)
  568.       enabled = true
  569.     else
  570.       text = YE::REDUX::SHOP::NO_EQ_STAT
  571.       enabled = false
  572.     end
  573.     self.contents.font.color = system_color
  574.     self.contents.font.color.alpha = enabled ? 255 : 128
  575.     self.contents.draw_text(24, dy, sw/2-24, WLH, YE::REDUX::SHOP::TEXT_HIT)
  576.     self.contents.font.color = normal_color
  577.     self.contents.font.color.alpha = enabled ? 255 : 128
  578.     draw_icon(YE::REDUX::SHOP::ICON_HIT, 0, dy, enabled)
  579.     self.contents.draw_text(sw*1/4, dy, sw/5, WLH, text, 2)
  580.     #---EVA---
  581.     if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:eva] != 100
  582.       text = sprintf("%+d%%", @item.bonus_paramp[:eva] - 100)
  583.       enabled = true
  584.     elsif $imported["ExtraEquipmentOptions"] and @item.bonus_param[:eva] != 0
  585.       text = sprintf("%+d%%", @item.bonus_param[:eva] + @item.eva)
  586.       enabled = true
  587.     elsif @item.is_a?(RPG::Armor) and @item.eva != 0
  588.       text = sprintf("%+d%%", @item.eva)
  589.       enabled = true
  590.     else
  591.       text = YE::REDUX::SHOP::NO_EQ_STAT
  592.       enabled = false
  593.     end
  594.     self.contents.font.color = system_color
  595.     self.contents.font.color.alpha = enabled ? 255 : 128
  596.     self.contents.draw_text(sw/2+24, dy, sw/2-24, WLH, YE::REDUX::SHOP::TEXT_EVA)
  597.     self.contents.font.color = normal_color
  598.     self.contents.font.color.alpha = enabled ? 255 : 128
  599.     draw_icon(YE::REDUX::SHOP::ICON_EVA, sw/2, dy, enabled)
  600.     self.contents.draw_text(sw*3/4, dy, sw/5, WLH, text, 2)
  601.     #------
  602.     dy += 24
  603.     #------
  604.     if $imported["ExtraEquipmentOptions"] and YE::REDUX::SHOP::SHOW_CRI
  605.       #---CRI---
  606.       if @item.bonus_paramp[:cri] != 100
  607.         text = sprintf("%+d%%", @item.bonus_paramp[:cri] - 100)
  608.         enabled = true
  609.       elsif @item.bonus_param[:cri] != 0
  610.         text = sprintf("%+d%%", @item.bonus_param[:cri])
  611.         enabled = true
  612.       else
  613.         text = YE::REDUX::SHOP::NO_EQ_STAT
  614.         enabled = false
  615.       end
  616.       self.contents.font.color = system_color
  617.       self.contents.font.color.alpha = enabled ? 255 : 128
  618.       self.contents.draw_text(24, dy, sw/2-24, WLH, YE::REDUX::SHOP::TEXT_CRI)
  619.       self.contents.font.color = normal_color
  620.       self.contents.font.color.alpha = enabled ? 255 : 128
  621.       draw_icon(YE::REDUX::SHOP::ICON_CRI, 0, dy, enabled)
  622.       self.contents.draw_text(sw*1/4, dy, sw/5, WLH, text, 2)
  623.     end
  624.     if $imported["ExtraEquipmentOptions"] and YE::REDUX::SHOP::SHOW_ODDS
  625.       #---ODDS---
  626.       if @item.bonus_paramp[:odds] != 100
  627.         text = sprintf("%+d%%", @item.bonus_paramp[:odds] - 100)
  628.         enabled = true
  629.       elsif @item.bonus_param[:odds] != 0
  630.         text = sprintf("%+d", @item.bonus_param[:odds])
  631.         enabled = true
  632.       else
  633.         text = YE::REDUX::SHOP::NO_EQ_STAT
  634.         enabled = false
  635.       end
  636.       self.contents.font.color = system_color
  637.       self.contents.font.color.alpha = enabled ? 255 : 128
  638.       self.contents.draw_text(sw/2+24, dy, sw/2-24, WLH, YE::REDUX::SHOP::TEXT_ODDS)
  639.       self.contents.font.color = normal_color
  640.       self.contents.font.color.alpha = enabled ? 255 : 128
  641.       draw_icon(YE::REDUX::SHOP::ICON_ODDS, sw/2, dy, enabled)
  642.       self.contents.draw_text(sw*3/4, dy, sw/5, WLH, text, 2)
  643.       #------
  644.     end
  645.     return if (dy + 48) >= (self.height - 32)
  646.     #------ELEMENTS------
  647.     drawn_elements = []
  648.     for ele_id in YE::REDUX::SHOP::SHOWN_ELEMENTS
  649.       break if @item.element_set == []
  650.       if @item.element_set.include?(ele_id[0])
  651.         drawn_elements.push(ele_id[0])
  652.       end
  653.     end
  654.     if drawn_elements != [] # Draw Elements
  655.       drawn_elements = drawn_elements.sort!
  656.       dy += WLH
  657.       if @item.is_a?(RPG::Weapon)
  658.         text = YE::REDUX::SHOP::EQ_ELEMENT_W
  659.       else
  660.         text = YE::REDUX::SHOP::EQ_ELEMENT_A
  661.       end
  662.       self.contents.font.color = system_color
  663.       self.contents.draw_text(0, dy, sw/2, WLH, text)
  664.       dx = sw - (drawn_elements.size * 24)
  665.       for ele_id in drawn_elements
  666.         draw_icon(YE::REDUX::SHOP::SHOWN_ELEMENTS[ele_id], dx, dy)
  667.         dx += 24
  668.       end
  669.     end
  670.     return if (dy + 48) >= (self.height - 32)
  671.     #------STATUS EFFECTS------
  672.     drawn_states = []
  673.     for state_id in @item.state_set
  674.       state = $data_states[state_id]
  675.       next if state == nil
  676.       next if state.icon_index == 0
  677.       drawn_states.push(state.icon_index)
  678.     end
  679.     if drawn_states != [] # Draw Elements
  680.       dy += WLH
  681.       if @item.is_a?(RPG::Weapon)
  682.         text = YE::REDUX::SHOP::EQ_STATUS_W
  683.       else
  684.         text = YE::REDUX::SHOP::EQ_STATUS_A
  685.       end
  686.       self.contents.font.color = system_color
  687.       self.contents.draw_text(0, dy, sw/2, WLH, text)
  688.       dx = sw - (drawn_states.size * 24)
  689.       for icon in drawn_states
  690.         draw_icon(icon, dx, dy)
  691.         dx += 24
  692.       end
  693.     end
  694.   end
  695.   
  696. end # Window_ShopNumber

  697. #===============================================================================
  698. # Window_ShopStatus
  699. #===============================================================================

  700. class Window_ShopStatus < Window_Base
  701.   
  702.   #--------------------------------------------------------------------------
  703.   # overwrite refresh
  704.   #--------------------------------------------------------------------------
  705.   def refresh
  706.     self.contents.clear
  707.     self.contents.font.size = Font.default_size
  708.     return if @item == nil
  709.     number = $game_party.item_number(@item)
  710.     self.contents.font.color = system_color
  711.     self.contents.draw_text(4, 0, 200, WLH, YE::REDUX::SHOP::POSSESSION)
  712.     self.contents.font.color = normal_color
  713.     self.contents.draw_text(4, 0, 200, WLH, number, 2)
  714.     return if @item.is_a?(RPG::Item)
  715.     for actor in $game_party.members
  716.       dx = 4
  717.       dy = WLH * (2 + actor.index * 2)
  718.       draw_actor_parameter_change(actor, dx, dy)
  719.     end
  720.   end
  721.   
  722.   #--------------------------------------------------------------------------
  723.   # overwrite draw_actor_parameter_change
  724.   #--------------------------------------------------------------------------
  725.   def draw_actor_parameter_change(actor, x, y)
  726.     enabled = actor.equippable?(@item)
  727.     sw = self.width - 32
  728.     self.contents.font.color = normal_color
  729.     self.contents.font.color.alpha = enabled ? 255 : 128
  730.     self.contents.font.size = YE::REDUX::SHOP::FONTSIZE
  731.     cx = contents.text_size(YE::REDUX::SHOP::EQUIPPED).width
  732.     self.contents.font.size = Font.default_size
  733.     self.contents.draw_text(x, y, sw-cx-4, WLH, actor.name)
  734.    
  735.     self.contents.font.size = YE::REDUX::SHOP::FONTSIZE
  736.     if @item.is_a?(RPG::Weapon)
  737.       item1 = weaker_weapon(actor)
  738.     elsif actor.two_swords_style and @item.kind == 0
  739.       item1 = nil
  740.     else
  741.       if $imported["EquipExtension"]
  742.         index = actor.equip_type.index(@item.kind)
  743.         item1 = (index != nil ? actor.equips[1 + index] : nil)
  744.       else
  745.         item1 = actor.equips[1 + @item.kind]
  746.       end
  747.     end
  748.     if item1 == @item
  749.       self.contents.draw_text(x, y, sw-4, WLH, YE::REDUX::SHOP::EQUIPPED, 2)
  750.       draw_item_name(item1, x, y + WLH, enabled)
  751.       return
  752.     end
  753.     #-----
  754.     if enabled
  755.       dx = 0
  756.       dy = y + WLH
  757.       for i in 0..3
  758.         case i
  759.         when 0
  760.           atk1 = item1 == nil ? 0 : item1.atk
  761.           atk2 = @item == nil ? 0 : @item.atk
  762.           change = atk2 - atk1
  763.         when 1
  764.           def1 = item1 == nil ? 0 : item1.def
  765.           def2 = @item == nil ? 0 : @item.def
  766.           change = def2 - def1
  767.         when 2
  768.           spi1 = item1 == nil ? 0 : item1.spi
  769.           spi2 = @item == nil ? 0 : @item.spi
  770.           change = spi2 - spi1
  771.         when 3
  772.           agi1 = item1 == nil ? 0 : item1.agi
  773.           agi2 = @item == nil ? 0 : @item.agi
  774.           change = agi2 - agi1
  775.         end
  776.         if change > 0
  777.           draw_icon(YE::REDUX::SHOP::STAT_INCREASE[i], dx, dy)
  778.         elsif change < 0
  779.           draw_icon(YE::REDUX::SHOP::STAT_DECREASE[i], dx, dy)
  780.         end
  781.         if change != 0
  782.           text = sprintf("%+d", change)
  783.           self.contents.draw_text(dx+24, dy, sw/4-24, WLH, text, 0)
  784.         end
  785.         dx += sw/4
  786.       end
  787.     end
  788.     #-----
  789.   end
  790.   
  791. end # Window_ShopStatus

  792. #===============================================================================
  793. #
  794. # END OF FILE
  795. #
  796. #===============================================================================
复制代码
求帮忙看看哪里出问题了。
长名公主玩家群:372588926 攻略娱乐应有尽有
了解更多新RM游戏,游戏制作请加入RPGmaker支援群:113622890

Lv3.寻梦者 (版主)

八宝粥的基叔

梦石
0
星屑
4699
在线时间
5240 小时
注册时间
2009-4-29
帖子
14318

贵宾

2
发表于 2013-6-22 21:08:13 | 只看该作者
测试不会卡住,不信你就新建一个工程,只放这个脚本,你看卡不卡。
《逝去的回忆3:四叶草之梦》真情发布,欢迎点击图片下载试玩喵。

《逝去的回忆3》的讨论群:
一群:192885514
二群:200460747
回复 支持 反对

使用道具 举报

Lv2.观梦者

会吐槽的画师

梦石
0
星屑
782
在线时间
3431 小时
注册时间
2011-6-10
帖子
6535
3
 楼主| 发表于 2013-6-22 21:11:10 | 只看该作者
protosssonny 发表于 2013-6-22 21:08
测试不会卡住,不信你就新建一个工程,只放这个脚本,你看卡不卡。

但是我的工程里把这个脚本拿掉还原成原来的商店后也不卡……→_→
长名公主玩家群:372588926 攻略娱乐应有尽有
了解更多新RM游戏,游戏制作请加入RPGmaker支援群:113622890
回复 支持 反对

使用道具 举报

Lv2.观梦者

会吐槽的画师

梦石
0
星屑
782
在线时间
3431 小时
注册时间
2011-6-10
帖子
6535
4
 楼主| 发表于 2013-6-22 21:12:49 | 只看该作者
虽然我知道八成又是整合系统出的错(其实那个整合系统做得太敷衍了,衔接语言和传递参数都太累赘)但是没办法……实在不行就换成原来的商店好了。

点评

是和其他的脚本冲突了,没办法  发表于 2013-6-24 00:20
那你上传一个没有任何问题的脚本又能解决什么问题呢?  发表于 2013-6-22 21:13
长名公主玩家群:372588926 攻略娱乐应有尽有
了解更多新RM游戏,游戏制作请加入RPGmaker支援群:113622890
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-23 02:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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