查看: 2294|回复: 4

[已经解决] 關於這個物品MENU腳本. 能否更改分類項目??

[复制链接]
梦石
0
星屑
562
在线时间
465 小时
注册时间
2009-10-11
回帖
322
发表于 2013-8-4 10:41:36 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 a000b1745 于 2013-8-4 15:24 编辑

小妹最近在搜尋簡單的物品分類腳本,
(Yanfly Channel的分類腳本會和 wyongcan的装备帮助增强腳本衝突...只好不考慮了)

在國外網找了個比較看似簡單的物品菜單分類的腳本,
他的分類是把裝備細項都分類出來。

小妹希望把這個細項用在"一般物品"內,
可以再分類出"食物"、"材料A"、"材料B" 。

譬如我在某幾個物品註釋框寫了  <type : 食物> 或 <type : 材料A> 或 <type : 材料A>
(沒注釋當然就歸一般物品~)

那麼擁有物品後 該物品就會顯示在對應的物品欄裡面。
不知有沒有方法能實現、懇請版上大大幫忙{:2_271:}

附上腳本↓
(原址 - http://www.crimson-castle.co.uk/ ... dItemCategories.txt )


  1. =begin
  2. ===============================================================================
  3. Expanded Item Categories (25/01/2013)
  4. -------------------------------------------------------------------------------
  5. Created By: Shadowmaster/Shadowmaster9000/Shadowpasta
  6. ([url]www.crimson-castle.co.uk[/url])

  7. ===============================================================================
  8. Information
  9. -------------------------------------------------------------------------------
  10. This script adds more categories to your item and shop menus, such as
  11. seperate armor categories, and a category for all items together. This script
  12. also allows you to change the order that the categories appear in, as well
  13. as how many appear on the screen at the same time.

  14. As a bonus, this script fixes a bug with horizontal window scrolling through
  15. commands that prevented you from viewing all items if the maximum number of
  16. items was double the amount of the maximum viewable at once.

  17. ===============================================================================
  18. How to Use
  19. -------------------------------------------------------------------------------
  20. Place this script under Materials, preferably below any item altering scripts.

  21. Further down are some options you can change to your liking.

  22. ===============================================================================
  23. Required
  24. -------------------------------------------------------------------------------
  25. Nothing.

  26. ===============================================================================
  27. Change log
  28. -------------------------------------------------------------------------------
  29. v1.0: First release. (25/01/2013)

  30. ===============================================================================
  31. Terms of Use
  32. -------------------------------------------------------------------------------
  33. * Free to use for both commercial and non-commerical projects.
  34. * Do not claim this as your own.
  35. * You're free to post this on other websites, but please credit me and keep
  36. the header intact.
  37. * Creditting me in the game's credits would be appreciated.

  38. ===============================================================================
  39. =end
  40. $imported = {} if $imported.nil?
  41. $imported["ExpandedItemCategories"] = true

  42. module Itemlist
  43.   
  44. #==============================================================================
  45. # ** List of Categories
  46. #------------------------------------------------------------------------------
  47. #  Below are the list of categories available in this script. You can change
  48. #  the order of the categories to your pleasing, as well as their names and
  49. #  even remove any categories you don't want. I will record the list of all
  50. #  available categories here if in case you forget any of them.
  51. #
  52. #  :all_item         (Displays all items)
  53. #  :item             (Displays normal items)
  54. #  :weapon           (Displays all weapons)
  55. #  :armor            (Displays all armor gear)
  56. #  :armor_shield     (Displays shields only)
  57. #  :armor_head       (Displays head gear only)
  58. #  :armor_body       (Displays body gear only)
  59. #  :armor_accessory  (Displays accessories only)
  60. #  :key_item         (Displays key items)
  61. #==============================================================================
  62.   
  63.   Categories =[ # Do not remove this.
  64.       [:all_item, "All"],
  65.       [:item, "Items"],
  66.       [:weapon, "Weapons"],  
  67.       [:armor, "Armors"],
  68.       [:armor_shield, "Shields"],
  69.       [:armor_head, "Head Gear"],
  70.       [:armor_body, "Body Gear"],
  71.       [:armor_accessory, "Accessories"],
  72.       [:key_item, "Key Items"],
  73.     ] # Do not remove this.

  74. #==============================================================================
  75. # ** Category Help Descriptions
  76. #------------------------------------------------------------------------------
  77. #  These set what text appears in the help window when you are viewing the
  78. #  item categories. If you want to leave them blank, just leave empty ""
  79. #  behind.
  80. #==============================================================================
  81.    
  82.   All_Item_Help_Info = "Viewing all items."
  83.   Item_Help_Info = "Viewing normal items."
  84.   Weapon_Help_Info = "Viewing all weapons."
  85.   Armor_Help_Info = "Viewing all armors."
  86.   Armor_Shield_Help_Info = "Viewing all shields."
  87.   Armor_Head_Help_Info = "Viewing head gear."
  88.   Armor_Body_Help_Info = "Viewing body gear."
  89.   Armor_Accessory_Help_Info = "Viewing accessories."
  90.   Key_Item_Help_Info = "Viewing important items."
  91.   
  92. #==============================================================================
  93. # ** Max Columns
  94. #------------------------------------------------------------------------------
  95. #  This sets how many item categories you can view on the screen at one time.
  96. #  If the number of item categories exceed the number of maximum columns, you
  97. #  will be able to scroll through the window to see the rest of the item
  98. #  categories.
  99. #==============================================================================

  100.   Max_Columns = 4

  101. end

  102. #==============================================================================
  103. # ** DO NOT edit anything below this unless if you know what you're doing!
  104. #==============================================================================
  105.       
  106. class RPG::Armor

  107.   def armor_shield?
  108.     @etype_id == 1
  109.   end
  110.   def armor_head?
  111.     @etype_id == 2
  112.   end
  113.   def armor_body?
  114.     @etype_id == 3
  115.   end
  116.   def armor_accessory?
  117.     @etype_id == 4
  118.   end
  119.   
  120. end

  121. #==============================================================================
  122. # ** Window_HorzCommand
  123. #------------------------------------------------------------------------------
  124. #  This is a command window for the horizontal selection format.
  125. #==============================================================================

  126. class Window_HorzCommand < Window_Command
  127.   #--------------------------------------------------------------------------
  128.   # * Set Leading Digits
  129.   #--------------------------------------------------------------------------
  130.   def top_col=(col)
  131.     col = 0 if col < 0
  132.     self.ox = col * (item_width + spacing)
  133.   end
  134. end

  135. #==============================================================================
  136. # ** Window_ItemCategory
  137. #------------------------------------------------------------------------------
  138. #  This window is for selecting a category of normal items and equipment
  139. # on the item screen or shop screen.
  140. #==============================================================================

  141. class Window_ItemCategory < Window_HorzCommand
  142.   #--------------------------------------------------------------------------
  143.   # * Get Digit Count
  144.   #--------------------------------------------------------------------------
  145.   def col_max
  146.     return Itemlist::Max_Columns
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # * Create Command List
  150.   #--------------------------------------------------------------------------
  151.   def make_command_list
  152.     Itemlist::Categories.each { |symbol, label|
  153.           add_command(label, symbol)
  154.         }
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # * Update Help Text
  158.   #--------------------------------------------------------------------------
  159.   def update_help
  160.     @help_window.clear
  161.     case current_symbol
  162.     when :all_item
  163.       @help_window.set_text(Itemlist::All_Item_Help_Info)
  164.     when :item
  165.       @help_window.set_text(Itemlist::Item_Help_Info)
  166.     when :weapon
  167.       @help_window.set_text(Itemlist::Weapon_Help_Info)
  168.     when :armor
  169.       @help_window.set_text(Itemlist::Armor_Help_Info)
  170.     when :armor_shield
  171.       @help_window.set_text(Itemlist::Armor_Shield_Help_Info)
  172.     when :armor_head
  173.       @help_window.set_text(Itemlist::Armor_Head_Help_Info)
  174.     when :armor_body
  175.       @help_window.set_text(Itemlist::Armor_Body_Help_Info)
  176.     when :armor_accessory
  177.       @help_window.set_text(Itemlist::Armor_Accessory_Help_Info)
  178.     when :key_item
  179.       @help_window.set_text(Itemlist::Key_Item_Help_Info)
  180.     else
  181.       @help_window.clear
  182.     end
  183.   end
  184. end

  185. #==============================================================================
  186. # ** Window_ItemList
  187. #------------------------------------------------------------------------------
  188. #  This window displays a list of party items on the item screen.
  189. #==============================================================================

  190. class Window_ItemList < Window_Selectable
  191.   #--------------------------------------------------------------------------
  192.   # * Include in Item List?
  193.   #--------------------------------------------------------------------------
  194.   def include?(item)
  195.     case @category
  196.     when :all_item
  197.       item.is_a?(RPG::Item) || item.is_a?(RPG::Armor) || item.is_a?(RPG::Weapon)
  198.     when :item
  199.       item.is_a?(RPG::Item) && !item.key_item?
  200.     when :weapon
  201.       item.is_a?(RPG::Weapon)
  202.     when :armor
  203.       item.is_a?(RPG::Armor)
  204.     when :armor_shield
  205.       item.is_a?(RPG::Armor) && item.armor_shield?
  206.     when :armor_head
  207.       item.is_a?(RPG::Armor) && item.armor_head?
  208.     when :armor_body
  209.       item.is_a?(RPG::Armor) && item.armor_body?
  210.     when :armor_accessory
  211.       item.is_a?(RPG::Armor) && item.armor_accessory?
  212.     when :key_item
  213.       item.is_a?(RPG::Item) && item.key_item?
  214.     else
  215.       false
  216.     end
  217.   end
  218. end

  219. #==============================================================================
  220. # ** Scene_Shop
  221. #------------------------------------------------------------------------------
  222. #  This class performs shop screen processing.
  223. #==============================================================================

  224. class Scene_Shop < Scene_MenuBase
  225.   #--------------------------------------------------------------------------
  226.   # * Start Processing
  227.   #--------------------------------------------------------------------------
  228.   alias start_itemlist start
  229.   def start
  230.     super
  231.     start_itemlist
  232.     @help_window.clear
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # * Category [Cancel]
  236.   #--------------------------------------------------------------------------
  237.   alias on_category_cancel_itemlist on_category_cancel
  238.   def on_category_cancel
  239.     on_category_cancel_itemlist
  240.     @help_window.clear
  241.   end
  242. end
复制代码
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
梦石
0
星屑
50
在线时间
36 小时
注册时间
2013-8-4
回帖
6
发表于 2013-8-4 14:43:54 | 显示全部楼层
註釋框寫  <type: 食物> 或 <type: 材料A> 或 <type: 材料B> 即可。(注意這裡用半角的冒號)
因為不知道你的具體分類,所以說明文字就沒有寫了。
  1. =begin
  2. ===============================================================================
  3. Expanded Item Categories (25/01/2013)
  4. -------------------------------------------------------------------------------
  5. Created By: Shadowmaster/Shadowmaster9000/Shadowpasta


  6. ===============================================================================
  7. Information
  8. -------------------------------------------------------------------------------
  9. This script adds more categories to your item and shop menus, such as
  10. seperate armor categories, and a category for all items together. This script
  11. also allows you to change the order that the categories appear in, as well
  12. as how many appear on the screen at the same time.

  13. As a bonus, this script fixes a bug with horizontal window scrolling through
  14. commands that prevented you from viewing all items if the maximum number of
  15. items was double the amount of the maximum viewable at once.

  16. ===============================================================================
  17. How to Use
  18. -------------------------------------------------------------------------------
  19. Place this script under Materials, preferably below any item altering scripts.

  20. Further down are some options you can change to your liking.

  21. ===============================================================================
  22. Required
  23. -------------------------------------------------------------------------------
  24. Nothing.

  25. ===============================================================================
  26. Change log
  27. -------------------------------------------------------------------------------
  28. v1.0: First release. (25/01/2013)

  29. ===============================================================================
  30. Terms of Use
  31. -------------------------------------------------------------------------------
  32. * Free to use for both commercial and non-commerical projects.
  33. * Do not claim this as your own.
  34. * You're free to post this on other websites, but please credit me and keep
  35. the header intact.
  36. * Creditting me in the game's credits would be appreciated.

  37. ===============================================================================
  38. =end
  39. $imported = {} if $imported.nil?
  40. $imported["ExpandedItemCategories"] = true

  41. module Itemlist

  42. #==============================================================================
  43. # ** List of Categories
  44. #------------------------------------------------------------------------------
  45. #  Below are the list of categories available in this script. You can change
  46. #  the order of the categories to your pleasing, as well as their names and
  47. #  even remove any categories you don't want. I will record the list of all
  48. #  available categories here if in case you forget any of them.
  49. #
  50. #  :all_item         (Displays all items)
  51. #  :item             (Displays normal items)
  52. #  :weapon           (Displays all weapons)
  53. #  :armor            (Displays all armor gear)
  54. #  :armor_shield     (Displays shields only)
  55. #  :armor_head       (Displays head gear only)
  56. #  :armor_body       (Displays body gear only)
  57. #  :armor_accessory  (Displays accessories only)
  58. #  :key_item         (Displays key items)
  59. #==============================================================================

  60.   Categories =[ # Do not remove this.
  61.       [:item, "Items"],
  62.       [:weapon, "Weapons"],  
  63.       [:armor, "Armors"],
  64.       [:armor_shield, "Shields"],
  65.       [:armor_head, "Head Gear"],
  66.       [:armor_body, "Body Gear"],
  67.       [:armor_accessory, "Accessories"],
  68.       [:key_item, "Key Items"],
  69.       [:all_item, "All"],
  70.     ] # Do not remove this.

  71. #==============================================================================
  72. # ** Category Help Descriptions
  73. #------------------------------------------------------------------------------
  74. #  These set what text appears in the help window when you are viewing the
  75. #  item categories. If you want to leave them blank, just leave empty ""
  76. #  behind.
  77. #==============================================================================

  78.   All_Item_Help_Info = "Viewing all items."
  79.   Item_Help_Info = "Viewing normal items."
  80.   Weapon_Help_Info = "Viewing all weapons."
  81.   Armor_Help_Info = "Viewing all armors."
  82.   Armor_Shield_Help_Info = "Viewing all shields."
  83.   Armor_Head_Help_Info = "Viewing head gear."
  84.   Armor_Body_Help_Info = "Viewing body gear."
  85.   Armor_Accessory_Help_Info = "Viewing accessories."
  86.   Key_Item_Help_Info = "Viewing important items."

  87. #==============================================================================
  88. # ** Max Columns
  89. #------------------------------------------------------------------------------
  90. #  This sets how many item categories you can view on the screen at one time.
  91. #  If the number of item categories exceed the number of maximum columns, you
  92. #  will be able to scroll through the window to see the rest of the item
  93. #  categories.
  94. #==============================================================================

  95.   Max_Columns = 4

  96. end

  97. #==============================================================================
  98. # ** DO NOT edit anything below this unless if you know what you're doing!
  99. #==============================================================================

  100. class RPG::Armor

  101.   def armor_shield?
  102.     @etype_id == 1
  103.   end
  104.   def armor_head?
  105.     @etype_id == 2
  106.   end
  107.   def armor_body?
  108.     @etype_id == 3
  109.   end
  110.   def armor_accessory?
  111.     @etype_id == 4
  112.   end

  113. end

  114. #==============================================================================
  115. # ** Window_HorzCommand
  116. #------------------------------------------------------------------------------
  117. #  This is a command window for the horizontal selection format.
  118. #==============================================================================

  119. class Window_HorzCommand < Window_Command
  120.   #--------------------------------------------------------------------------
  121.   # * Set Leading Digits
  122.   #--------------------------------------------------------------------------
  123.   def top_col=(col)
  124.     col = 0 if col < 0
  125.     self.ox = col * (item_width + spacing)
  126.   end
  127. end

  128. #==============================================================================
  129. # ** Window_ItemCategory
  130. #------------------------------------------------------------------------------
  131. #  This window is for selecting a category of normal items and equipment
  132. # on the item screen or shop screen.
  133. #==============================================================================

  134. class Window_ItemCategory < Window_HorzCommand
  135.   #--------------------------------------------------------------------------
  136.   # * Get Digit Count
  137.   #--------------------------------------------------------------------------
  138.   def col_max
  139.     return Itemlist::Max_Columns
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # * Create Command List
  143.   #--------------------------------------------------------------------------
  144.   def make_command_list
  145.     $game_party.all_items.each {|item|
  146.       next unless item.is_a?(RPG::Item) && !item.key_item?
  147.       setup_item_category(item)
  148.     }
  149.     Itemlist::Categories.each { |symbol, label| add_command(label, symbol)}
  150.   end
  151.   def setup_item_category(item)
  152.     if item && /<type: *(\S+)>/ =~ item.note
  153.       @list.each {|command| return if command[:name] == $1}
  154.       add_command($1, $1.to_sym)
  155.     end
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # * Update Help Text
  159.   #--------------------------------------------------------------------------
  160.   def update_help
  161.     @help_window.clear
  162.     case current_symbol
  163.     when :all_item
  164.       @help_window.set_text(Itemlist::All_Item_Help_Info)
  165.     when :item
  166.       @help_window.set_text(Itemlist::Item_Help_Info)
  167.     when :weapon
  168.       @help_window.set_text(Itemlist::Weapon_Help_Info)
  169.     when :armor
  170.       @help_window.set_text(Itemlist::Armor_Help_Info)
  171.     when :armor_shield
  172.       @help_window.set_text(Itemlist::Armor_Shield_Help_Info)
  173.     when :armor_head
  174.       @help_window.set_text(Itemlist::Armor_Head_Help_Info)
  175.     when :armor_body
  176.       @help_window.set_text(Itemlist::Armor_Body_Help_Info)
  177.     when :armor_accessory
  178.       @help_window.set_text(Itemlist::Armor_Accessory_Help_Info)
  179.     when :key_item
  180.       @help_window.set_text(Itemlist::Key_Item_Help_Info)
  181.     else
  182.       @help_window.clear
  183.     end
  184.   end
  185. end

  186. #==============================================================================
  187. # ** Window_ItemList
  188. #------------------------------------------------------------------------------
  189. #  This window displays a list of party items on the item screen.
  190. #==============================================================================

  191. class Window_ItemList < Window_Selectable
  192.   #--------------------------------------------------------------------------
  193.   # * Include in Item List?
  194.   #--------------------------------------------------------------------------
  195.   def include?(item)
  196.     case @category
  197.     when :all_item
  198.       item.is_a?(RPG::Item) || item.is_a?(RPG::Armor) || item.is_a?(RPG::Weapon)
  199.     when :item
  200.       item.is_a?(RPG::Item) && !item.key_item?
  201.     when :weapon
  202.       item.is_a?(RPG::Weapon)
  203.     when :armor
  204.       item.is_a?(RPG::Armor)
  205.     when :armor_shield
  206.       item.is_a?(RPG::Armor) && item.armor_shield?
  207.     when :armor_head
  208.       item.is_a?(RPG::Armor) && item.armor_head?
  209.     when :armor_body
  210.       item.is_a?(RPG::Armor) && item.armor_body?
  211.     when :armor_accessory
  212.       item.is_a?(RPG::Armor) && item.armor_accessory?
  213.     when :key_item
  214.       item.is_a?(RPG::Item) && item.key_item?
  215.     else
  216.       if item && /<type: *(\S+)>/ =~ item.note
  217.         @category == $1.to_sym
  218.       else
  219.         false
  220.       end
  221.     end
  222.   end
  223. end

  224. #==============================================================================
  225. # ** Scene_Shop
  226. #------------------------------------------------------------------------------
  227. #  This class performs shop screen processing.
  228. #==============================================================================

  229. class Scene_Shop < Scene_MenuBase
  230.   #--------------------------------------------------------------------------
  231.   # * Start Processing
  232.   #--------------------------------------------------------------------------
  233.   alias start_itemlist start
  234.   def start
  235.     super
  236.     start_itemlist
  237.     @help_window.clear
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # * Category [Cancel]
  241.   #--------------------------------------------------------------------------
  242.   alias on_category_cancel_itemlist on_category_cancel
  243.   def on_category_cancel
  244.     on_category_cancel_itemlist
  245.     @help_window.clear
  246.   end
  247. end
复制代码

点评

這名字和頭像很熟悉啊!! 感謝"5大"幫忙. 來去試試看^^  发表于 2013-8-4 15:15
这名字……  发表于 2013-8-4 14:45

评分

参与人数 1星屑 +7 收起 理由
a000b1745 + 7 认可答案(好實用!)

查看全部评分

回复

使用道具 举报

梦石
0
星屑
562
在线时间
465 小时
注册时间
2009-10-11
回帖
322
 楼主| 发表于 2013-8-5 02:14:44 | 显示全部楼层
可是有個很奇怪的問題...
用了物品分類的腳本後...

在原本wyongcan提供的"裝備強化系統"打開準備強化的時候...


OH NO!! 我的增加機率寶石就這麼被黑心的屏蔽了.....

(防爆防降都能正常使用,只有增加機率的寶石無法顯示也無法選擇)

請問這強化系統有規定機率寶石不能使用物品分類嗎???要怎麼讓他顯示出來呢{:2_253:}
(註釋沒加或有加<type: 寶石>  皆無法顯示出來... )

  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 装备强化系统 By wyongcan
  4. #==============================================================================
  5. module Equipplus
  6. #升到各级时装备颜色请在“颜色描绘”脚本中修改
  7. $maxlv = 4  #最高升到的级数
  8. $gailv = [60,40,20,10,1] #每级提升概率
  9. $gemlv = [[10,200],[20,201],[30,202]] #使用宝石提高的几率  [提高几率,宝石ID]
  10. $uplv = [[2,197],[3,198],[4,199]] #强化所需要的强化石 [最大强化到的等级,强化石ID]
  11. $xxlv = [10,15,20,25,10,10]   #每级强化后失败物品消失的几率
  12. $jjlv = [50,55,60,65,30,45]   #每级强化后失败物品降级的几率
  13. $tsnl = [0,0,0,40,25] #每级强化提升能力的百分比
  14. $tswp = [203,204] # 意思是:如果有31号物品则失败后物品不消失,如果有32号物品则失败后物品不降级
  15. #武器强化后的计算公式为: 原攻击 * (1 + 提升能力百分比) + (0到当前强化级数随机) * 5 + 当前强化级数
  16. $gemlv.sort!
  17. $uplv.sort!
  18. $当前使用宝石id = 0
  19. $当前使用宝石加成率 = 0
  20. $强化哈希表 = {
  21. "最高等級" => $maxlv ,
  22. "每級機率" => $gailv ,
  23. "寶石效果" => $gemlv ,
  24. "消失機率" => $xxlv  ,
  25. "降級機率" => $jjlv  ,
  26. "提升能力" => $tsnl  ,
  27. "特殊物品" => $tswp  ,
  28. "強化材料" => $uplv  }
  29. def self.idlostitem(id,amount = 1)
  30.   $game_party.lose_item(idgetitem(id),amount)
  31. end

  32. def self.idlostequip(id,weapon = true,amount = 1)
  33.   weapon == true ? $game_party.lose_item($data_weapons[id],amount,true) : $game_party.lose_item($data_armors[id],amount,true)
  34. end

  35. def self.idgainequip(id,weapon = true,amount = 1)
  36.   weapon == true ? $game_party.gain_item($data_weapons[id],amount,true) : $game_party.gain_item($data_armors[id],amount,true)
  37. end

  38. def self.idgetitem(id)
  39.   $data_items[id]
  40. end

  41. def self.equipable?(id,weapon = true)
  42.   weapon == true ? weaponupisnil(id) : armorupisnil(id)
  43.   weapon == true ? equip = $data_weapons[id].dup : equip = $data_armors[id].dup
  44.   price = equip.price
  45.   @needmoney = price * equip.up
  46.   if @needmoney == 0
  47.     @needmoney = price / 2
  48.   end
  49. #循环取出需要的强化材料
  50.   temp = false
  51.   for i in $强化哈希表["強化材料"]
  52.     if equip.up < i[0]
  53.       @lostitem = idgetitem i[1]
  54.       $game_party.has_item?(idgetitem(i[1])) ? temp = true : temp = false
  55.       break
  56.     end
  57.   end
  58.   $game_party.gold >= @needmoney && temp == true ? true : false
  59. end

  60. def self.upweapon (id)
  61.   $message = ""
  62.   success = false
  63.   weaponupisnil(id)
  64.   weapon = $data_weapons[id].dup
  65.   gl = 0
  66.   fangb = false
  67.   fangj = false
  68.   return unless weapon.up < $强化哈希表["最高等級"] && weaponupable?(id)
  69.   loststh
  70.   $message += "本次強化,共消耗:" + Vocab::currency_unit + " " + @needmoney.to_s
  71.   $message += " " + @lostitem.name + "\n "
  72.   gl = $强化哈希表["每級機率"][weapon.up]
  73.   if $usegem == true
  74.     gl += $当前使用宝石加成率
  75.     idlostitem($当前使用宝石id)
  76.     $message += idgetitem($当前使用宝石id).name + " "
  77.   end
  78.   if $fangb == true
  79.     fangb = true
  80.     idlostitem $强化哈希表["特殊物品"][0]
  81.     $message += idgetitem($强化哈希表["特殊物品"][0]).name + " "
  82.   end
  83.   if $fangj == true
  84.     fangj = true
  85.     idlostitem $强化哈希表["特殊物品"][1]
  86.     $message += idgetitem($强化哈希表["特殊物品"][1]).name + " "
  87.   end
  88.   suiji = rand (100)
  89.   if suiji <= gl
  90.     success = true
  91.   end
  92.   $message += "\n強化結果:"
  93.   if success == true
  94.     $message += "強化成功"
  95.     idlostequip id
  96.     weapon.id = $data_weapons.size
  97.     params = weapon.params.dup
  98.     params[4] *= 1
  99.     params[4] += $强化哈希表["提升能力"][weapon.up] / 20
  100.     params[4] += 1 if params[4] == weapon.params[4]
  101.     params[6] += $强化哈希表["提升能力"][weapon.up] / 40
  102.     params[2] *= 1
  103.     params[2] += $强化哈希表["提升能力"][weapon.up] / 20
  104.     params[2] += 1 if params[2] == weapon.params[2]
  105.     $message += " 裝備攻擊能力提升 "
  106.     weapon.up += 1
  107.     $data_weapons.insert $data_weapons.size,weapon
  108.     $data_weapons[$data_weapons.size-1].params = params
  109.     idgainequip weapon.id
  110.   else
  111.     $message += "強化失敗"
  112.     suiji = rand (100)
  113.     if suiji <= $强化哈希表["消失機率"][weapon.up]
  114.       if fangb != true
  115.       $message += ",武器消失。"
  116.       idlostequip id
  117.       else
  118.       $message += ",武器未消失。"
  119.       end
  120.     else
  121.       suiji = rand (100)
  122.       if suiji <= $强化哈希表["降級機率"][weapon.up]
  123.         if fangj == false && weapon.up != 0
  124.           $message += ",武器降級。"
  125.           params = weapon.params.dup
  126.           params[4] -= 1
  127.           params[2] -= 1
  128.           weapon.params = params
  129.           weapon.up -= 1
  130.           $data_weapons[id] = weapon
  131.         else
  132.           $message += ",武器未降級。"
  133.         end
  134.       end
  135.     end
  136.   end
  137.    $usegem = false
  138.    $fangb = false
  139.    $fangj = false
  140. end

  141. def self.weaponupisnil(id)
  142.    $data_weapons[id].up = 0 unless $data_weapons[id].up != nil
  143. end

  144. def self.weaponupable?(id)
  145.   equipable?(id)
  146. end

  147. def self.uparmor (id)
  148.   $message = ""
  149.   success = false
  150.   armorupisnil(id)
  151.   armor = $data_armors[id].dup
  152.   gl = 0
  153.   fangb = false
  154.   fangj = false
  155.   return unless armor.up < $强化哈希表["最高等級"] && armorupable?(id)
  156.   loststh
  157.   $message += "本次強化,共消耗:" + Vocab::currency_unit + " " + @needmoney.to_s
  158.   $message += " " + @lostitem.name + "\n "
  159.   gl = $强化哈希表["每級機率"][armor.up]
  160.   if $usegem == true
  161.     gl += $当前使用宝石加成率
  162.     idlostitem($当前使用宝石id)
  163.     $message += idgetitem($当前使用宝石id).name + " "
  164.   end
  165.   if $fangb == true
  166.     fangb = true
  167.     idlostitem $强化哈希表["特殊物品"][0]
  168.     $message += idgetitem($强化哈希表["特殊物品"][0]).name + " "
  169.   end
  170.   if $fangj == true
  171.     fangj = true
  172.     idlostitem $强化哈希表["特殊物品"][1]
  173.     $message += idgetitem($强化哈希表["特殊物品"][1]).name + " "
  174.   end
  175.   suiji = rand (100)
  176.   if suiji <= gl
  177.     success = true
  178.   end
  179.   $message += "\n強化結果:"
  180.   if success == true
  181.     $message += "強化成功"
  182.     idlostequip id,false
  183.     armor.id = $data_armors.size
  184.     params = armor.params.dup
  185.     params[3] *= 1
  186.     params[3] += 0
  187.     params[3] += 1 if params[3] == armor.params[3]
  188.     params[5] *= 1
  189.     params[5] += 0
  190.     params[5] += 1 if params[5] == armor.params[5]
  191.     params[0] += $强化哈希表["提升能力"][armor.up] / 2
  192.     params[1] += $强化哈希表["提升能力"][armor.up] / 4
  193.     $message += " 裝備防禦能力提升 "
  194.     armor.up += 1
  195.     $data_armors.insert $data_armors.size,armor
  196.     $data_armors[$data_armors.size-1].params = params
  197.     idgainequip armor.id,false
  198.   else
  199.     $message += "強化失敗"
  200.     suiji = rand (100)
  201.     if suiji <= $强化哈希表["消失機率"][armor.up]
  202.       if fangb != true
  203.       $message += ",裝備消失。"
  204.       idlostequip id,false
  205.       else
  206.       $message += ",裝備未消失。"
  207.       end
  208.     else
  209.       suiji = rand (100)
  210.       if suiji <= $强化哈希表["降級機率"][armor.up]
  211.         if fangj == false && armor.up != 0
  212.           $message += ",裝備降級。"
  213.           params = armor.params.dup
  214.           params[3] -= 1
  215.           params[5] -= 1      
  216.           armor.params = params
  217.           armor.up -= 1
  218.           $data_armors[id] = armor
  219.         else
  220.           $message += ",裝備未降級。"
  221.         end
  222.       end
  223.     end
  224.   end
  225.    $usegem = false
  226.    $fangb = false
  227.    $fangj = false
  228. end

  229. def self.armorupisnil(id)
  230.    $data_armors[id].up = 0 unless $data_armors[id].up != nil
  231. end
  232. def self.armorupable?(id)
  233.   equipable?(id,false) && ($data_armors[id].etype_id == 1 || $data_armors[id].etype_id == 2 || $data_armors[id].etype_id == 3 || $data_armors[id].etype_id == 4 || $data_armors[id].etype_id == 5)
  234. end
  235. def self.loststh()
  236.    $game_party.lose_item(@lostitem,1)
  237.    $game_party.lose_gold(@needmoney)
  238. end
  239. def self.needmoney
  240.    @needmoney
  241. end
  242. def self.lostitem
  243.    @lostitem
  244. end
  245. end
  246. #==============================================================================
  247. # ■ Scene_Qiang
  248. #------------------------------------------------------------------------------
  249. #  强化画面
  250. #==============================================================================

  251. class Scene_Qiang < Scene_MenuBase
  252.   $wufang = true
  253.   $usegem = false
  254.   $fangb = false
  255.   $fangj = false
  256.   #--------------------------------------------------------------------------
  257.   # ● 开始处理
  258.   #--------------------------------------------------------------------------
  259.   def start
  260.     super
  261.     create_help_window
  262.     @help_window.hide
  263.     create_qianghelp_window
  264.     create_command_window
  265.     create_qiangxz_window
  266.     create_wu_window
  267.     create_fang_window
  268.     create_choosegem_window
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● 生成说明窗口
  272.   #--------------------------------------------------------------------------
  273.   def create_qianghelp_window
  274.     @qianghelp_window = Window_Qianghelp.new
  275.     @qianghelp_window.y = Graphics.height - @qianghelp_window.height
  276.     @qianghelp_window.viewport = @viewport
  277.     @qianghelp_window.hide
  278.   end
  279.   #--------------------------------------------------------------------------
  280.   # ● 生成选择宝石
  281.   #--------------------------------------------------------------------------
  282.   def create_choosegem_window
  283.     @choosegem_window = Window_Choosegem.new
  284.     @choosegem_window.y = Graphics.height - @choosegem_window.height
  285.     @choosegem_window.viewport = @viewport
  286.     @choosegem_window.z = 120
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● 生成选择窗口
  290.   #--------------------------------------------------------------------------
  291.   def create_qiangxz_window
  292.     @qiangxz_window = Window_Qiangxz.new
  293.     @qiangxz_window.y = @help_window.height + fitting_height(5) /2
  294.     @qiangxz_window.z = 110
  295.     @qiangxz_window.viewport = @viewport
  296.     @qiangxz_window.set_handler(:gem,    method(:qiangxz_gem))
  297.     @qiangxz_window.set_handler(:fangb,    method(:qiangxz_fangb))
  298.     @qiangxz_window.set_handler(:fangj,    method(:qiangxz_fangj))
  299.     @qiangxz_window.set_handler(:ok, method(:qiangxz_ok))
  300.     @qiangxz_window.set_handler(:cancel, method(:qiangxz_cancel))
  301.     @qiangxz_window.hide
  302.     @qiangxz_window.deactivate
  303.   end
  304.   #--------------------------------------------------------------------------
  305.   # ● 生成指令窗口
  306.   #--------------------------------------------------------------------------
  307.   def create_command_window
  308.     @command_window = Window_QiangCommand.new
  309.     @command_window.viewport = @viewport
  310.     @command_window.y = @help_window.height + fitting_height(3) /2
  311.     @command_window.set_handler(:qiangwu,    method(:qiangwu))
  312.     @command_window.set_handler(:qiangfang,   method(:qiangfang))
  313.     @command_window.set_handler(:cancel, method(:return_scene))
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # ● 生成武器强化窗口
  317.   #--------------------------------------------------------------------------
  318.   def create_wu_window
  319.     @wu_window = Window_Qiangwu.new(@qianghelp_window,@qiangxz_window)
  320.     @wu_window.viewport = @viewport
  321.     @wu_window.y += @help_window.height
  322.     @wu_window.hide
  323.     @wu_window.help_window= @help_window
  324.     @wu_window.set_handler(:cancel, method(:qiangwu_cancel))
  325.     @wu_window.set_handler(:ok,     method(:qiangwu_ok))
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● 生成防具强化窗口
  329.   #--------------------------------------------------------------------------
  330.   def create_fang_window
  331.     @fang_window = Window_Qiangfang.new(@qianghelp_window,@qiangxz_window)
  332.     @fang_window.viewport = @viewport
  333.     @fang_window.y += @help_window.height
  334.     @fang_window.hide
  335.     @fang_window.help_window= @help_window
  336.     @fang_window.set_handler(:cancel, method(:qiangfang_cancel))
  337.     @fang_window.set_handler(:ok,     method(:qiangfang_ok))
  338.   end
  339.   #--------------------------------------------------------------------------
  340.   # ● 计算窗口显示指定行数时的应用高度
  341.   #--------------------------------------------------------------------------
  342.   def fitting_height(line_number)
  343.     line_number * 24 + 12 * 2
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 显示强化武器
  347.   #--------------------------------------------------------------------------
  348.   def qiangwu
  349.     @command_window.hide
  350.     @help_window.show
  351.     @wu_window.show
  352.     @wu_window.start
  353.     @qianghelp_window.show
  354.     @wu_window.activate
  355.     $wufang = true
  356.     @command_window.deactivate
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ● 显示强化防具
  360.   #--------------------------------------------------------------------------
  361.   def qiangfang
  362.     @command_window.hide
  363.     @help_window.show
  364.     @fang_window.show
  365.     @fang_window.start
  366.     @qianghelp_window.show
  367.     @fang_window.activate
  368.     $wufang = false
  369.     @command_window.deactivate
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # ● 取消强化武器
  373.   #--------------------------------------------------------------------------
  374.   def qiangwu_cancel
  375.     @command_window.show
  376.     @help_window.hide
  377.     @wu_window.hide
  378.     @qianghelp_window.hide
  379.     @command_window.activate
  380.     @qianghelp_window.set_text("")
  381.     @help_window.set_text("")
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # ● 取消强化防具
  385.   #--------------------------------------------------------------------------
  386.   def qiangfang_cancel
  387.     @command_window.show
  388.     @help_window.hide
  389.     @fang_window.hide
  390.     @qianghelp_window.hide
  391.     @command_window.activate
  392.     @qianghelp_window.set_text("")
  393.     @help_window.set_text("")
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # ● 确定强化武器
  397.   #--------------------------------------------------------------------------
  398.   def qiangwu_ok
  399.     @help_window.hide
  400.     @wu_window.qiangwu_ok
  401.     @qiangxz_window.show
  402.     @qiangxz_window.activate
  403.   end
  404.   #--------------------------------------------------------------------------
  405.   # ● 确定强化防具
  406.   #--------------------------------------------------------------------------
  407.   def qiangfang_ok
  408.     @help_window.hide
  409.     @fang_window.qiangfang_ok
  410.     @qiangxz_window.show
  411.     @qiangxz_window.activate
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ● 获取卖出价格
  415.   #--------------------------------------------------------------------------
  416.   def selling_price
  417.     @item.price / 2
  418.   end
  419.   
  420.   def qiangxz_gem
  421.     @choosegem_window.start
  422.     @qiangxz_window.deactivate
  423.     @choosegem_window.qiangxz= @qiangxz_window
  424.     if $wufang == true
  425.       @choosegem_window.wufangwindow= @wu_window
  426.     else
  427.       @choosegem_window.wufangwindow= @fang_window
  428.     end
  429.   end
  430.   
  431.   def qiangxz_fangb
  432.     $fangb = !$fangb
  433.     if $wufang == true
  434.       @wu_window.update_help
  435.     else
  436.       @fang_window.update_help
  437.     end
  438.     @qiangxz_window.activate
  439.   end
  440.   
  441.   def qiangxz_fangj
  442.     $fangj = !$fangj
  443.     if $wufang == true
  444.       @wu_window.update_help
  445.     else
  446.       @fang_window.update_help
  447.     end
  448.     @qiangxz_window.activate
  449.   end
  450.   
  451.   def qiangxz_ok
  452.     if $wufang == true
  453.       Equipplus.upweapon(@wu_window.itemid)
  454.       qianging
  455.       @qianghelp_window.set_text($message)
  456.       @qiangxz_window.hide
  457.       Graphics.wait(60)
  458.       @wu_window.activate
  459.       @qiangxz_window.deactivate
  460.       @help_window.hide
  461.       $当前使用宝石加成率 = 0
  462.       $usegem = false
  463.       @fang_window.update_help
  464.       @wu_window.refresh
  465.       @command_window.deactivate
  466.     else
  467.       Equipplus.uparmor(@fang_window.itemid)
  468.       qianging
  469.       @qianghelp_window.set_text($message)
  470.       @qiangxz_window.hide
  471.       Graphics.wait(60)
  472.       @fang_window.activate
  473.       @qiangxz_window.deactivate
  474.       @help_window.hide
  475.       $当前使用宝石加成率 = 0
  476.       $usegem = false
  477.       @fang_window.update_help
  478.       @fang_window.refresh
  479.       @command_window.deactivate
  480.     end
  481.   end
  482.   
  483.   def qiangxz_cancel
  484.     @help_window.refresh
  485.                 @help_window.show
  486.     @wu_window.show
  487.     @qiangxz_window.hide
  488.     @qiangxz_window.deactivate
  489.     if $wufang == true
  490.       @wu_window.activate
  491.     else
  492.       @fang_window.activate
  493.     end
  494.     $当前使用宝石加成率 = 0
  495.     $usegem = false
  496.     @command_window.deactivate
  497.   end
  498.   
  499.   def qianging
  500.     i = 0
  501.     while i < 20
  502.       i += 1
  503.       text = "\n"
  504.       text += "●" * i + "○" * (20 - i)
  505.       text = text + "\n強化中,請等待。"
  506.       @qianghelp_window.set_text(text)
  507.       Graphics.wait(6)
  508.     end
  509.   end
  510. end

  511. class RPG::EquipItem < RPG::BaseItem
  512.   alias old initialize
  513.   def initialize
  514.     old
  515.     @up = 0 #装备强化次数
  516.   end
  517.   attr_accessor :up
  518. end
  519. #==============================================================================
  520. # ■ Window_Qiangwu
  521. #------------------------------------------------------------------------------
  522. #  强化系统_武器强化窗口
  523. #==============================================================================

  524. class Window_Qiangwu < Window_ItemList
  525.   #--------------------------------------------------------------------------
  526.   # ● 初始化对象
  527.   #--------------------------------------------------------------------------
  528.   def initialize(qianghelp,xuanze)
  529.     super(0, 0, Graphics.width, fitting_height(8))
  530.     self.openness = 0
  531.     deactivate
  532.     @qianghelp = qianghelp
  533.     @xuanze = xuanze
  534.   end
  535.   #--------------------------------------------------------------------------
  536.   # ● 开始输入的处理
  537.   #--------------------------------------------------------------------------
  538.   def start
  539.     self.category = :weapon
  540.     refresh
  541.     select(0)
  542.     open
  543.     activate
  544.   end
  545.   #--------------------------------------------------------------------------
  546.   # ● 查询此物品是否可用
  547.   #--------------------------------------------------------------------------
  548.   def enable?(item)
  549.     return false unless item != nil
  550.     Equipplus.weaponupable?(item.id)
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # ● 确定强化武器
  554.   #--------------------------------------------------------------------------
  555.   def qiangwu_ok
  556.     result = item ? item.id : 0
  557.   end
  558.   #--------------------------------------------------------------------------
  559.   # ● 更新帮助内容
  560.   #--------------------------------------------------------------------------
  561.   def update_help
  562.     return unless item != nil
  563.     @help_window.set_item(item)
  564.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  565.     needmoney = 0
  566.     Equipplus.weaponupable?(item.id)
  567.     qitemname = Equipplus.lostitem.name
  568.     if item.up >= $强化哈希表["最高等級"]
  569.       qitemname = "無法繼續升級"
  570.     end
  571.     temp = []
  572.     $usegem == true ? temp.push("有●") : temp.push("無○")
  573.     temp.push($data_items[$强化哈希表["特殊物品"][0]].name)
  574.     $fangb == true ? temp.push("有●") : temp.push("無○")
  575.     temp.push($data_items[$强化哈希表["特殊物品"][1]].name)
  576.     $fangj == true ? temp.push("有●") : temp.push("無○")
  577.     cgl = ($强化哈希表["每級機率"][item.up] + $当前使用宝石加成率).to_s
  578.     if item.up == 0
  579.       min = item.params[2] + 1
  580.       max = min + 5
  581.     else
  582.       if item.up >= $强化哈希表["最高等級"]
  583.         min = item.params[2].to_int
  584.         max = min
  585.       else
  586.     min = (item.params[2] * (1 + $强化哈希表["提升能力"][item.up] / 100)).to_int + item.up
  587.     max = min + item.up * 1
  588.     end
  589.   end
  590.     text = "裝備名稱:" + item.name + "\n強化所需" + Vocab::currency_unit + ":" + Equipplus.needmoney.to_s
  591.     text += "\n當前強化等級:" + item.up.to_s + "\n強化需要:" +  qitemname
  592.     text += "\n強化寶石:" + temp [0] + " " + temp[1] + ":" + temp[2]+ " " + temp[3] + ":" + temp[4]
  593.     text += "\n成功率:" + cgl + "% (強化後請按取消鍵更新成功率) " + "\n強化成功後、武器物攻魔攻上限將會提升。失敗時、有30%機率武器消失。"
  594.     @qianghelp.set_text(text)
  595.   end
  596.   #--------------------------------------------------------------------------
  597.   # ● 获取当前武器等级
  598.   #--------------------------------------------------------------------------
  599.   def getweaponup
  600.     Equipplus.weaponupisnil(item.id)
  601.     item.up
  602.   end
  603.   
  604.   def itemid
  605.     item.id
  606.   end
  607.   #--------------------------------------------------------------------------
  608.   # ● 选择项目
  609.   #--------------------------------------------------------------------------
  610.   def select(index)
  611.     self.index = index if index
  612.     update_help
  613.   end
  614. end
  615. #==============================================================================
  616. # ■ Window_Qiangfang
  617. #------------------------------------------------------------------------------
  618. #  强化系统_防具强化窗口
  619. #==============================================================================

  620. class Window_Qiangfang < Window_ItemList
  621.   #--------------------------------------------------------------------------
  622.   # ● 初始化对象
  623.   #--------------------------------------------------------------------------
  624.   def initialize(qianghelp,xuanze)
  625.     super(0, 0, Graphics.width, fitting_height(8))
  626.     self.openness = 0
  627.     deactivate
  628.     @qianghelp = qianghelp
  629.     @xuanze = xuanze
  630.   end
  631.   #--------------------------------------------------------------------------
  632.   # ● 开始输入的处理
  633.   #--------------------------------------------------------------------------
  634.   def start
  635.     self.category = :armor
  636.     refresh
  637.     select(0)
  638.     open
  639.     activate
  640.   end
  641.   #--------------------------------------------------------------------------
  642.   # ● 查询此物品是否可用
  643.   #--------------------------------------------------------------------------
  644.   def enable?(item)
  645.     return false unless item != nil
  646.     Equipplus.armorupable?(item.id)
  647.   end
  648.   #--------------------------------------------------------------------------
  649.   # ● 确定强化防具
  650.   #--------------------------------------------------------------------------
  651.   def qiangfang_ok
  652.     result = item ? item.id : 0
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # ● 更新帮助内容
  656.   #--------------------------------------------------------------------------
  657.   def update_help
  658.     return unless item != nil
  659.     @help_window.set_item(item)
  660.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  661.     needmoney = 0
  662.     Equipplus.armorupable?(item.id)
  663.     qitemname = Equipplus.lostitem.name
  664.     if item.up >= $强化哈希表["最高等級"]
  665.       qitemname = "無法繼續升級"
  666.     end
  667.     temp = []
  668.     $usegem == true ? temp.push("有●") : temp.push("無○")
  669.     temp.push($data_items[$强化哈希表["特殊物品"][0]].name)
  670.     $fangb == true ? temp.push("有●") : temp.push("無○")
  671.     temp.push($data_items[$强化哈希表["特殊物品"][1]].name)
  672.     $fangj == true ? temp.push("有●") : temp.push("無○")
  673.     cgl = ($强化哈希表["每級機率"][item.up] + $当前使用宝石加成率).to_s
  674.     if item.up == 0
  675.       min = item.params[3] + 1
  676.       max = min + 5
  677.     else
  678.       if item.up >= $强化哈希表["最高等級"]
  679.         min = item.params[3].to_int
  680.         max = min
  681.       else
  682.     min = (item.params[3] * (1 + $强化哈希表["提升能力"][item.up] / 100)).to_int + item.up
  683.     max = min + item.up * 5
  684.     end
  685.   end
  686.     text = "裝備名稱:" + item.name + "\n強化所需" + Vocab::currency_unit + ":" + Equipplus.needmoney.to_s
  687.     text += "\n當前強化等級:" + item.up.to_s + "\n強化需要:" +  qitemname
  688.     text += "\n強化寶石:" + temp [0] + " " + temp[1] + ":" + temp[2]+ " " + temp[3] + ":" + temp[4]
  689.     text += "\n成功率:" + cgl + "% (強化後請按取消鍵更新成功率)" + "\n強化成功後、裝備物防魔防上限將會提升。失敗時、有30%機率裝備消失。"
  690.     @qianghelp.set_text(text)
  691.   end
  692.   #--------------------------------------------------------------------------
  693.   # ● 获取当前防具等级
  694.   #--------------------------------------------------------------------------
  695.   def getarmorup
  696.     Equipplus.armorupisnil(item.id)
  697.     item.up
  698.   end
  699.   
  700.   def itemid
  701.     item.id
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # ● 选择项目
  705.   #--------------------------------------------------------------------------
  706.   def select(index)
  707.     self.index = index if index
  708.     update_help
  709.   end
  710. end
  711. #==============================================================================
  712. # ■ Window_QiangCommand
  713. #------------------------------------------------------------------------------
  714. #  强化系统中,处理命令选择的窗口。
  715. #==============================================================================

  716. class Window_QiangCommand < Window_Command
  717.   #--------------------------------------------------------------------------
  718.   # ● 初始化对象
  719.   #--------------------------------------------------------------------------
  720.   def initialize
  721.     super(0, 0)
  722.     update_placement
  723.     self.openness = 0
  724.     open
  725.   end
  726.   #--------------------------------------------------------------------------
  727.   # ● 获取窗口的宽度
  728.   #--------------------------------------------------------------------------
  729.   def window_width
  730.     return 160
  731.   end
  732.   #--------------------------------------------------------------------------
  733.   # ● 更新窗口的位置
  734.   #--------------------------------------------------------------------------
  735.   def update_placement
  736.     self.x = (Graphics.width - width) / 2
  737.     self.y = (Graphics.height - height) / 2
  738.   end
  739.   #--------------------------------------------------------------------------
  740.   # ● 生成指令列表
  741.   #--------------------------------------------------------------------------
  742.   def make_command_list
  743.     add_command("強化武器",    :qiangwu)
  744.     add_command("強化防具",    :qiangfang)
  745.     add_command(Vocab::ShopCancel, :cancel)
  746.   end
  747. end
  748. #==============================================================================
  749. # ■ Window_Qianghelp
  750. #------------------------------------------------------------------------------
  751. #  显示说明
  752. #==============================================================================

  753. class Window_Qianghelp < Window_Base
  754.   #--------------------------------------------------------------------------
  755.   # ● 初始化对象
  756.   #--------------------------------------------------------------------------
  757.   def initialize
  758.     super(0, 0, window_width, fitting_height(7) + 8)
  759.     refresh
  760.   end
  761.   #--------------------------------------------------------------------------
  762.   # ● 获取窗口的宽度
  763.   #--------------------------------------------------------------------------
  764.   def window_width
  765.     return 544
  766.   end
  767.   #--------------------------------------------------------------------------
  768.   # ● 获取持有金钱
  769.   #--------------------------------------------------------------------------
  770.   def value
  771.     $game_party.gold
  772.   end
  773.   #--------------------------------------------------------------------------
  774.   # ● 获取货币单位
  775.   #--------------------------------------------------------------------------
  776.   def currency_unit
  777.     Vocab::currency_unit
  778.   end
  779.   #--------------------------------------------------------------------------
  780.   # ● 设置内容
  781.   #--------------------------------------------------------------------------
  782.   def set_text(text)
  783.     if text != @text
  784.       @text = text
  785.       refresh
  786.     end
  787.   end
  788.   #--------------------------------------------------------------------------
  789.   # ● 清除
  790.   #--------------------------------------------------------------------------
  791.   def clear
  792.     set_text("")
  793.   end
  794.   #--------------------------------------------------------------------------
  795.   # ● 刷新
  796.   #--------------------------------------------------------------------------
  797.   def refresh
  798.     contents.clear
  799.     draw_text_ex(4, 0, @text)
  800.   end
  801. end
  802. #==============================================================================
  803. # ■ Window_Qiangxz
  804. #------------------------------------------------------------------------------
  805. #  强化系统中,选择强化方式的窗口。
  806. #==============================================================================

  807. class Window_Qiangxz < Window_Command
  808.   @havegem = false
  809.   @havefangb = false
  810.   @havefangj = false
  811.   #--------------------------------------------------------------------------
  812.   # ● 初始化对象
  813.   #--------------------------------------------------------------------------
  814.   def initialize
  815.     super(0, 0)
  816.     index = 0
  817.     update_placement
  818.     self.openness = 0
  819.     open
  820.   end
  821.   #--------------------------------------------------------------------------
  822.   # ● 获取窗口的宽度
  823.   #--------------------------------------------------------------------------
  824.   def window_width
  825.     return 180
  826.   end
  827.   #--------------------------------------------------------------------------
  828.   # ● 更新窗口的位置
  829.   #--------------------------------------------------------------------------
  830.   def update_placement
  831.     self.x = (Graphics.width - width) / 2
  832.     self.y = (Graphics.height - height) / 2
  833.   end
  834.   #--------------------------------------------------------------------------
  835.   # ● 检查可用
  836.   #--------------------------------------------------------------------------
  837.   def haveitem
  838.     @havegem = false
  839.     @havefangb = false
  840.     @havefangj = false
  841.     for i in $强化哈希表["寶石效果"]
  842.         if $game_party.has_item?($data_items[i[1]])
  843.         @havegem = true
  844.       end
  845.     end
  846.     @havefangb = $game_party.has_item?($data_items[$强化哈希表["特殊物品"][0]])
  847.     @havefangj = $game_party.has_item?($data_items[$强化哈希表["特殊物品"][1]])
  848.   end
  849.   #--------------------------------------------------------------------------
  850.   # ● 生成指令列表
  851.   #--------------------------------------------------------------------------
  852.   def make_command_list
  853.     haveitem
  854.     add_command("寶石材料",     :gem, @havegem)
  855.     add_command(Equipplus.idgetitem($强化哈希表["特殊物品"][0]).name, :fangb, @havefangb)
  856.     add_command(Equipplus.idgetitem($强化哈希表["特殊物品"][1]).name, :fangj, @havefangj)
  857.     add_command("開始強化", :start)
  858.     add_command("取消強化", :cancel)
  859.   end
  860. end
  861. class Window_ItemList
  862.   #--------------------------------------------------------------------------
  863.   # ● 查询列表中是否含有此物品
  864.   #--------------------------------------------------------------------------
  865.   def include?(item)
  866.     case @category
  867.     when :item
  868.       item.is_a?(RPG::Item) && !item.key_item?
  869.     when :weapon
  870.       item.is_a?(RPG::Weapon)
  871.     when :armor
  872.       item.is_a?(RPG::Armor)
  873.     when :key_item
  874.       item.is_a?(RPG::Item) && item.key_item?
  875.     when :gem
  876.       itemid = item ? item.id : 0
  877.       itemid != 0 ? isgem(itemid) : false
  878.     else
  879.       false
  880.     end
  881.   end
  882.   
  883.   def isgem(itemid)
  884.     for i in $强化哈希表["寶石效果"]
  885.       return true if i[1] == itemid
  886.     end
  887.     false
  888.   end
  889. end
  890. #==============================================================================
  891. # ■ Window_Choosegem
  892. #------------------------------------------------------------------------------
  893. #  选择强化使用的宝石
  894. #==============================================================================

  895. class Window_Choosegem < Window_ItemList
  896.   #--------------------------------------------------------------------------
  897.   # ● 初始化对象
  898.   #--------------------------------------------------------------------------
  899.   def initialize()
  900.     super(0, 0, Graphics.width, fitting_height(2))
  901.     self.openness = 0
  902.     deactivate
  903.     @wufangwindow = nil
  904.     @qiangxz = nil
  905.     set_handler(:ok,     method(:on_ok))
  906.     set_handler(:cancel, method(:on_cancel))
  907.   end
  908.   
  909.   def wufangwindow=(wufangwindow)
  910.     @wufangwindow = wufangwindow
  911.   end
  912.   def qiangxz=(qiangxz)
  913.     @qiangxz = qiangxz
  914.   end
  915.   #--------------------------------------------------------------------------
  916.   # ● 开始输入的处理
  917.   #--------------------------------------------------------------------------
  918.   def start
  919.     self.category = :gem
  920.     self.y = (Graphics.height - height) / 2
  921.     refresh
  922.     select(0)
  923.     open
  924.     activate
  925.   end
  926.   #--------------------------------------------------------------------------
  927.   # ● 确定时的处理
  928.   #--------------------------------------------------------------------------
  929.   def on_ok
  930.     result = item ? item.id : 0
  931.     if result != 0
  932.      $usegem = true
  933.      $当前使用宝石id = result
  934.      for i in $强化哈希表["寶石效果"]
  935.        $当前使用宝石加成率 = i[0] if i[1] == $当前使用宝石id
  936.      end
  937.    else
  938.      $当前使用宝石加成率 = 0
  939.      $usegem = false
  940.     end
  941.     @wufangwindow.update_help
  942.     @qiangxz.activate
  943.     close
  944.   end
  945.   #--------------------------------------------------------------------------
  946.   # ● 查询此物品是否可用
  947.   #--------------------------------------------------------------------------
  948.   def enable?(item)
  949.     true
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ● 取消时的处理
  953.   #--------------------------------------------------------------------------
  954.   def on_cancel
  955.     $当前使用宝石加成率 = 0
  956.     $usegem = false
  957.     @wufangwindow.update_help
  958.     @qiangxz.activate
  959.     close
  960.   end
  961. end
  962. #==============================================================================
  963. # ■ 强化系统DataManager
  964. #------------------------------------------------------------------------------
  965. #  将武器和防具数据保存入存档
  966. #==============================================================================
  967. module DataManager
  968.   #--------------------------------------------------------------------------
  969.   # ● 生成存档内容
  970.   #--------------------------------------------------------------------------
  971.   def self.make_save_contents
  972.     contents = {}
  973.     contents[:system]        = $game_system
  974.     contents[:timer]         = $game_timer
  975.     contents[:message]       = $game_message
  976.     contents[:switches]      = $game_switches
  977.     contents[:variables]     = $game_variables
  978.     contents[:self_switches] = $game_self_switches
  979.     contents[:actors]        = $game_actors
  980.     contents[:party]         = $game_party
  981.     contents[:troop]         = $game_troop
  982.     contents[:map]           = $game_map
  983.     contents[:player]        = $game_player
  984.     contents[:weapons]       = $data_weapons
  985.     contents[:armors]        = $data_armors
  986.     contents
  987.   end
  988.   #--------------------------------------------------------------------------
  989.   # ● 展开存档内容
  990.   #--------------------------------------------------------------------------
  991.   def self.extract_save_contents(contents)
  992.     $game_system        = contents[:system]
  993.     $game_timer         = contents[:timer]
  994.     $game_message       = contents[:message]
  995.     $game_switches      = contents[:switches]
  996.     $game_variables     = contents[:variables]
  997.     $game_self_switches = contents[:self_switches]
  998.     $game_actors        = contents[:actors]
  999.     $game_party         = contents[:party]
  1000.     $game_troop         = contents[:troop]
  1001.     $game_map           = contents[:map]
  1002.     $game_player        = contents[:player]
  1003.     $data_weapons       = contents[:weapons]
  1004.     $data_armors        = contents[:armors]
  1005.   end
  1006. end
复制代码
BS00282.jpg
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
36 小时
注册时间
2013-8-4
回帖
6
发表于 2013-8-5 09:24:47 | 显示全部楼层
本帖最后由 5ion 于 2013-8-5 09:40 编辑

把強化腳本放到上方,然後將強化腳本里的 :gem 全部替換為 :寶石 (註釋里填<type: 寶石>的話)試試
這個強化腳本我使用會報錯,不知是不是有缺失?可以提供一個範本嗎?

评分

参与人数 1星屑 +7 收起 理由
a000b1745 + 7 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
562
在线时间
465 小时
注册时间
2009-10-11
回帖
322
 楼主| 发表于 2013-8-5 09:49:18 | 显示全部楼层
5ion 发表于 2013-8-5 09:24
把強化腳本放到上方,然後將強化腳本里的 :gem 全部替換為 :寶石 (註釋里填的話)試試
這個強化腳本我使用 ...

感謝你...照5大方法解決了問題.
我的遊戲430MB (看到什麼就加什麼的壞榜樣)...
不知道哪種網盤或免費空間比較容易上傳/下載?

点评

既然解決了就不必傳了吧 :)  发表于 2013-8-5 10:46
百度网盘速度很好!  发表于 2013-8-5 10:14
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部