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

Project1

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

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
567
在线时间
465 小时
注册时间
2009-10-11
帖子
407
跳转到指定楼层
1
发表于 2013-8-4 10:41:36 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 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 )


RUBY 代码复制
  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. ===============================================================================
  9.  Information
  10. -------------------------------------------------------------------------------
  11.  This script adds more categories to your item and shop menus, such as
  12.  seperate armor categories, and a category for all items together. This script
  13.  also allows you to change the order that the categories appear in, as well
  14.  as how many appear on the screen at the same time.
  15.  
  16.  As a bonus, this script fixes a bug with horizontal window scrolling through
  17.  commands that prevented you from viewing all items if the maximum number of
  18.  items was double the amount of the maximum viewable at once.
  19.  
  20. ===============================================================================
  21.  How to Use
  22. -------------------------------------------------------------------------------
  23.  Place this script under Materials, preferably below any item altering scripts.
  24.  
  25.  Further down are some options you can change to your liking.
  26.  
  27. ===============================================================================
  28.  Required
  29. -------------------------------------------------------------------------------
  30.  Nothing.
  31.  
  32. ===============================================================================
  33.  Change log
  34. -------------------------------------------------------------------------------
  35.  v1.0: First release. (25/01/2013)
  36.  
  37. ===============================================================================
  38.  Terms of Use
  39. -------------------------------------------------------------------------------
  40.  * Free to use for both commercial and non-commerical projects.
  41.  * Do not claim this as your own.
  42.  * You're free to post this on other websites, but please credit me and keep
  43.  the header intact.
  44.  * Creditting me in the game's credits would be appreciated.
  45.  
  46. ===============================================================================
  47. =end
  48. $imported = {} if $imported.nil?
  49. $imported["ExpandedItemCategories"] = true
  50.  
  51. module Itemlist
  52.  
  53. #==============================================================================
  54. # ** List of Categories
  55. #------------------------------------------------------------------------------
  56. #  Below are the list of categories available in this script. You can change
  57. #  the order of the categories to your pleasing, as well as their names and
  58. #  even remove any categories you don't want. I will record the list of all
  59. #  available categories here if in case you forget any of them.
  60. #
  61. #  :all_item         (Displays all items)
  62. #  :item             (Displays normal items)
  63. #  :weapon           (Displays all weapons)
  64. #  :armor            (Displays all armor gear)
  65. #  :armor_shield     (Displays shields only)
  66. #  :armor_head       (Displays head gear only)
  67. #  :armor_body       (Displays body gear only)
  68. #  :armor_accessory  (Displays accessories only)
  69. #  :key_item         (Displays key items)
  70. #==============================================================================
  71.  
  72.   Categories =[ # Do not remove this.
  73.       [:all_item, "All"],
  74.       [:item, "Items"],
  75.       [:weapon, "Weapons"],  
  76.       [:armor, "Armors"],
  77.       [:armor_shield, "Shields"],
  78.       [:armor_head, "Head Gear"],
  79.       [:armor_body, "Body Gear"],
  80.       [:armor_accessory, "Accessories"],
  81.       [:key_item, "Key Items"],
  82.     ] # Do not remove this.
  83.  
  84. #==============================================================================
  85. # ** Category Help Descriptions
  86. #------------------------------------------------------------------------------
  87. #  These set what text appears in the help window when you are viewing the
  88. #  item categories. If you want to leave them blank, just leave empty ""
  89. #  behind.
  90. #==============================================================================
  91.  
  92.   All_Item_Help_Info = "Viewing all items."
  93.   Item_Help_Info = "Viewing normal items."
  94.   Weapon_Help_Info = "Viewing all weapons."
  95.   Armor_Help_Info = "Viewing all armors."
  96.   Armor_Shield_Help_Info = "Viewing all shields."
  97.   Armor_Head_Help_Info = "Viewing head gear."
  98.   Armor_Body_Help_Info = "Viewing body gear."
  99.   Armor_Accessory_Help_Info = "Viewing accessories."
  100.   Key_Item_Help_Info = "Viewing important items."
  101.  
  102. #==============================================================================
  103. # ** Max Columns
  104. #------------------------------------------------------------------------------
  105. #  This sets how many item categories you can view on the screen at one time.
  106. #  If the number of item categories exceed the number of maximum columns, you
  107. #  will be able to scroll through the window to see the rest of the item
  108. #  categories.
  109. #==============================================================================
  110.  
  111.   Max_Columns = 4
  112.  
  113. end
  114.  
  115. #==============================================================================
  116. # ** DO NOT edit anything below this unless if you know what you're doing!
  117. #==============================================================================
  118.  
  119. class RPG::Armor
  120.  
  121.   def armor_shield?
  122.     @etype_id == 1
  123.   end
  124.   def armor_head?
  125.     @etype_id == 2
  126.   end
  127.   def armor_body?
  128.     @etype_id == 3
  129.   end
  130.   def armor_accessory?
  131.     @etype_id == 4
  132.   end
  133.  
  134. end
  135.  
  136. #==============================================================================
  137. # ** Window_HorzCommand
  138. #------------------------------------------------------------------------------
  139. #  This is a command window for the horizontal selection format.
  140. #==============================================================================
  141.  
  142. class Window_HorzCommand < Window_Command
  143.   #--------------------------------------------------------------------------
  144.   # * Set Leading Digits
  145.   #--------------------------------------------------------------------------
  146.   def top_col=(col)
  147.     col = 0 if col < 0
  148.     self.ox = col * (item_width + spacing)
  149.   end
  150. end
  151.  
  152. #==============================================================================
  153. # ** Window_ItemCategory
  154. #------------------------------------------------------------------------------
  155. #  This window is for selecting a category of normal items and equipment
  156. # on the item screen or shop screen.
  157. #==============================================================================
  158.  
  159. class Window_ItemCategory < Window_HorzCommand
  160.   #--------------------------------------------------------------------------
  161.   # * Get Digit Count
  162.   #--------------------------------------------------------------------------
  163.   def col_max
  164.     return Itemlist::Max_Columns
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # * Create Command List
  168.   #--------------------------------------------------------------------------
  169.   def make_command_list
  170.     Itemlist::Categories.each { |symbol, label|
  171.           add_command(label, symbol)
  172.         }
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # * Update Help Text
  176.   #--------------------------------------------------------------------------
  177.   def update_help
  178.     @help_window.clear
  179.     case current_symbol
  180.     when :all_item
  181.       @help_window.set_text(Itemlist::All_Item_Help_Info)
  182.     when :item
  183.       @help_window.set_text(Itemlist::Item_Help_Info)
  184.     when :weapon
  185.       @help_window.set_text(Itemlist::Weapon_Help_Info)
  186.     when :armor
  187.       @help_window.set_text(Itemlist::Armor_Help_Info)
  188.     when :armor_shield
  189.       @help_window.set_text(Itemlist::Armor_Shield_Help_Info)
  190.     when :armor_head
  191.       @help_window.set_text(Itemlist::Armor_Head_Help_Info)
  192.     when :armor_body
  193.       @help_window.set_text(Itemlist::Armor_Body_Help_Info)
  194.     when :armor_accessory
  195.       @help_window.set_text(Itemlist::Armor_Accessory_Help_Info)
  196.     when :key_item
  197.       @help_window.set_text(Itemlist::Key_Item_Help_Info)
  198.     else
  199.       @help_window.clear
  200.     end
  201.   end
  202. end
  203.  
  204. #==============================================================================
  205. # ** Window_ItemList
  206. #------------------------------------------------------------------------------
  207. #  This window displays a list of party items on the item screen.
  208. #==============================================================================
  209.  
  210. class Window_ItemList < Window_Selectable
  211.   #--------------------------------------------------------------------------
  212.   # * Include in Item List?
  213.   #--------------------------------------------------------------------------
  214.   def include?(item)
  215.     case @category
  216.     when :all_item
  217.       item.is_a?(RPG::Item) || item.is_a?(RPG::Armor) || item.is_a?(RPG::Weapon)
  218.     when :item
  219.       item.is_a?(RPG::Item) && !item.key_item?
  220.     when :weapon
  221.       item.is_a?(RPG::Weapon)
  222.     when :armor
  223.       item.is_a?(RPG::Armor)
  224.     when :armor_shield
  225.       item.is_a?(RPG::Armor) && item.armor_shield?
  226.     when :armor_head
  227.       item.is_a?(RPG::Armor) && item.armor_head?
  228.     when :armor_body
  229.       item.is_a?(RPG::Armor) && item.armor_body?
  230.     when :armor_accessory
  231.       item.is_a?(RPG::Armor) && item.armor_accessory?
  232.     when :key_item
  233.       item.is_a?(RPG::Item) && item.key_item?
  234.     else
  235.       false
  236.     end
  237.   end
  238. end
  239.  
  240. #==============================================================================
  241. # ** Scene_Shop
  242. #------------------------------------------------------------------------------
  243. #  This class performs shop screen processing.
  244. #==============================================================================
  245.  
  246. class Scene_Shop < Scene_MenuBase
  247.   #--------------------------------------------------------------------------
  248.   # * Start Processing
  249.   #--------------------------------------------------------------------------
  250.   alias start_itemlist start
  251.   def start
  252.     super
  253.     start_itemlist
  254.     @help_window.clear
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # * Category [Cancel]
  258.   #--------------------------------------------------------------------------
  259.   alias on_category_cancel_itemlist on_category_cancel
  260.   def on_category_cancel
  261.     on_category_cancel_itemlist
  262.     @help_window.clear
  263.   end
  264. end
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。

Lv1.梦旅人

梦石
0
星屑
50
在线时间
36 小时
注册时间
2013-8-4
帖子
6
2
发表于 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 认可答案(好實用!)

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
567
在线时间
465 小时
注册时间
2009-10-11
帖子
407
3
 楼主| 发表于 2013-8-5 02:14:44 | 只看该作者
可是有個很奇怪的問題...
用了物品分類的腳本後...

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


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

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

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

RUBY 代码复制
  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.  
  33. def self.idlostequip(id,weapon = true,amount = 1)
  34.   weapon == true ? $game_party.lose_item($data_weapons[id],amount,true) : $game_party.lose_item($data_armors[id],amount,true)
  35. end
  36.  
  37. def self.idgainequip(id,weapon = true,amount = 1)
  38.   weapon == true ? $game_party.gain_item($data_weapons[id],amount,true) : $game_party.gain_item($data_armors[id],amount,true)
  39. end
  40.  
  41. def self.idgetitem(id)
  42.   $data_items[id]
  43. end
  44.  
  45. def self.equipable?(id,weapon = true)
  46.   weapon == true ? weaponupisnil(id) : armorupisnil(id)
  47.   weapon == true ? equip = $data_weapons[id].dup : equip = $data_armors[id].dup
  48.   price = equip.price
  49.   @needmoney = price * equip.up
  50.   if @needmoney == 0
  51.     @needmoney = price / 2
  52.   end
  53. #循环取出需要的强化材料
  54.   temp = false
  55.   for i in $强化哈希表["強化材料"]
  56.     if equip.up < i[0]
  57.       @lostitem = idgetitem i[1]
  58.       $game_party.has_item?(idgetitem(i[1])) ? temp = true : temp = false
  59.       break
  60.     end
  61.   end
  62.   $game_party.gold >= @needmoney && temp == true ? true : false
  63. end
  64.  
  65. def self.upweapon (id)
  66.   $message = ""
  67.   success = false
  68.   weaponupisnil(id)
  69.   weapon = $data_weapons[id].dup
  70.   gl = 0
  71.   fangb = false
  72.   fangj = false
  73.   return unless weapon.up < $强化哈希表["最高等級"] && weaponupable?(id)
  74.   loststh
  75.   $message += "本次強化,共消耗:" + Vocab::currency_unit + " " + @needmoney.to_s
  76.   $message += " " + @lostitem.name + "\n "
  77.   gl = $强化哈希表["每級機率"][weapon.up]
  78.   if $usegem == true
  79.     gl += $当前使用宝石加成率
  80.     idlostitem($当前使用宝石id)
  81.     $message += idgetitem($当前使用宝石id).name + " "
  82.   end
  83.   if $fangb == true
  84.     fangb = true
  85.     idlostitem $强化哈希表["特殊物品"][0]
  86.     $message += idgetitem($强化哈希表["特殊物品"][0]).name + " "
  87.   end
  88.   if $fangj == true
  89.     fangj = true
  90.     idlostitem $强化哈希表["特殊物品"][1]
  91.     $message += idgetitem($强化哈希表["特殊物品"][1]).name + " "
  92.   end
  93.   suiji = rand (100)
  94.   if suiji <= gl
  95.     success = true
  96.   end
  97.   $message += "\n強化結果:"
  98.   if success == true
  99.     $message += "強化成功"
  100.     idlostequip id
  101.     weapon.id = $data_weapons.size
  102.     params = weapon.params.dup
  103.     params[4] *= 1
  104.     params[4] += $强化哈希表["提升能力"][weapon.up] / 20
  105.     params[4] += 1 if params[4] == weapon.params[4]
  106.     params[6] += $强化哈希表["提升能力"][weapon.up] / 40
  107.     params[2] *= 1
  108.     params[2] += $强化哈希表["提升能力"][weapon.up] / 20
  109.     params[2] += 1 if params[2] == weapon.params[2]
  110.     $message += " 裝備攻擊能力提升 "
  111.     weapon.up += 1
  112.     $data_weapons.insert $data_weapons.size,weapon
  113.     $data_weapons[$data_weapons.size-1].params = params
  114.     idgainequip weapon.id
  115.   else
  116.     $message += "強化失敗"
  117.     suiji = rand (100)
  118.     if suiji <= $强化哈希表["消失機率"][weapon.up]
  119.       if fangb != true
  120.       $message += ",武器消失。"
  121.       idlostequip id
  122.       else
  123.       $message += ",武器未消失。"
  124.       end
  125.     else
  126.       suiji = rand (100)
  127.       if suiji <= $强化哈希表["降級機率"][weapon.up]
  128.         if fangj == false && weapon.up != 0
  129.           $message += ",武器降級。"
  130.           params = weapon.params.dup
  131.           params[4] -= 1
  132.           params[2] -= 1
  133.           weapon.params = params
  134.           weapon.up -= 1
  135.           $data_weapons[id] = weapon
  136.         else
  137.           $message += ",武器未降級。"
  138.         end
  139.       end
  140.     end
  141.   end
  142.    $usegem = false
  143.    $fangb = false
  144.    $fangj = false
  145. end
  146.  
  147. def self.weaponupisnil(id)
  148.    $data_weapons[id].up = 0 unless $data_weapons[id].up != nil
  149. end
  150.  
  151. def self.weaponupable?(id)
  152.   equipable?(id)
  153. end
  154.  
  155. def self.uparmor (id)
  156.   $message = ""
  157.   success = false
  158.   armorupisnil(id)
  159.   armor = $data_armors[id].dup
  160.   gl = 0
  161.   fangb = false
  162.   fangj = false
  163.   return unless armor.up < $强化哈希表["最高等級"] && armorupable?(id)
  164.   loststh
  165.   $message += "本次強化,共消耗:" + Vocab::currency_unit + " " + @needmoney.to_s
  166.   $message += " " + @lostitem.name + "\n "
  167.   gl = $强化哈希表["每級機率"][armor.up]
  168.   if $usegem == true
  169.     gl += $当前使用宝石加成率
  170.     idlostitem($当前使用宝石id)
  171.     $message += idgetitem($当前使用宝石id).name + " "
  172.   end
  173.   if $fangb == true
  174.     fangb = true
  175.     idlostitem $强化哈希表["特殊物品"][0]
  176.     $message += idgetitem($强化哈希表["特殊物品"][0]).name + " "
  177.   end
  178.   if $fangj == true
  179.     fangj = true
  180.     idlostitem $强化哈希表["特殊物品"][1]
  181.     $message += idgetitem($强化哈希表["特殊物品"][1]).name + " "
  182.   end
  183.   suiji = rand (100)
  184.   if suiji <= gl
  185.     success = true
  186.   end
  187.   $message += "\n強化結果:"
  188.   if success == true
  189.     $message += "強化成功"
  190.     idlostequip id,false
  191.     armor.id = $data_armors.size
  192.     params = armor.params.dup
  193.     params[3] *= 1
  194.     params[3] += 0
  195.     params[3] += 1 if params[3] == armor.params[3]
  196.     params[5] *= 1
  197.     params[5] += 0
  198.     params[5] += 1 if params[5] == armor.params[5]
  199.     params[0] += $强化哈希表["提升能力"][armor.up] / 2
  200.     params[1] += $强化哈希表["提升能力"][armor.up] / 4
  201.     $message += " 裝備防禦能力提升 "
  202.     armor.up += 1
  203.     $data_armors.insert $data_armors.size,armor
  204.     $data_armors[$data_armors.size-1].params = params
  205.     idgainequip armor.id,false
  206.   else
  207.     $message += "強化失敗"
  208.     suiji = rand (100)
  209.     if suiji <= $强化哈希表["消失機率"][armor.up]
  210.       if fangb != true
  211.       $message += ",裝備消失。"
  212.       idlostequip id,false
  213.       else
  214.       $message += ",裝備未消失。"
  215.       end
  216.     else
  217.       suiji = rand (100)
  218.       if suiji <= $强化哈希表["降級機率"][armor.up]
  219.         if fangj == false && armor.up != 0
  220.           $message += ",裝備降級。"
  221.           params = armor.params.dup
  222.           params[3] -= 1
  223.           params[5] -= 1      
  224.           armor.params = params
  225.           armor.up -= 1
  226.           $data_armors[id] = armor
  227.         else
  228.           $message += ",裝備未降級。"
  229.         end
  230.       end
  231.     end
  232.   end
  233.    $usegem = false
  234.    $fangb = false
  235.    $fangj = false
  236. end
  237.  
  238. def self.armorupisnil(id)
  239.    $data_armors[id].up = 0 unless $data_armors[id].up != nil
  240. end
  241. def self.armorupable?(id)
  242.   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)
  243. end
  244. def self.loststh()
  245.    $game_party.lose_item(@lostitem,1)
  246.    $game_party.lose_gold(@needmoney)
  247. end
  248. def self.needmoney
  249.    @needmoney
  250. end
  251. def self.lostitem
  252.    @lostitem
  253. end
  254. end
  255. #==============================================================================
  256. # ■ Scene_Qiang
  257. #------------------------------------------------------------------------------
  258. #  强化画面
  259. #==============================================================================
  260.  
  261. class Scene_Qiang < Scene_MenuBase
  262.   $wufang = true
  263.   $usegem = false
  264.   $fangb = false
  265.   $fangj = false
  266.   #--------------------------------------------------------------------------
  267.   # ● 开始处理
  268.   #--------------------------------------------------------------------------
  269.   def start
  270.     super
  271.     create_help_window
  272.     @help_window.hide
  273.     create_qianghelp_window
  274.     create_command_window
  275.     create_qiangxz_window
  276.     create_wu_window
  277.     create_fang_window
  278.     create_choosegem_window
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ● 生成说明窗口
  282.   #--------------------------------------------------------------------------
  283.   def create_qianghelp_window
  284.     @qianghelp_window = Window_Qianghelp.new
  285.     @qianghelp_window.y = Graphics.height - @qianghelp_window.height
  286.     @qianghelp_window.viewport = @viewport
  287.     @qianghelp_window.hide
  288.   end
  289.   #--------------------------------------------------------------------------
  290.   # ● 生成选择宝石
  291.   #--------------------------------------------------------------------------
  292.   def create_choosegem_window
  293.     @choosegem_window = Window_Choosegem.new
  294.     @choosegem_window.y = Graphics.height - @choosegem_window.height
  295.     @choosegem_window.viewport = @viewport
  296.     @choosegem_window.z = 120
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ● 生成选择窗口
  300.   #--------------------------------------------------------------------------
  301.   def create_qiangxz_window
  302.     @qiangxz_window = Window_Qiangxz.new
  303.     @qiangxz_window.y = @help_window.height + fitting_height(5) /2
  304.     @qiangxz_window.z = 110
  305.     @qiangxz_window.viewport = @viewport
  306.     @qiangxz_window.set_handler(:gem,    method(:qiangxz_gem))
  307.     @qiangxz_window.set_handler(:fangb,    method(:qiangxz_fangb))
  308.     @qiangxz_window.set_handler(:fangj,    method(:qiangxz_fangj))
  309.     @qiangxz_window.set_handler(:ok, method(:qiangxz_ok))
  310.     @qiangxz_window.set_handler(:cancel, method(:qiangxz_cancel))
  311.     @qiangxz_window.hide
  312.     @qiangxz_window.deactivate
  313.   end
  314.   #--------------------------------------------------------------------------
  315.   # ● 生成指令窗口
  316.   #--------------------------------------------------------------------------
  317.   def create_command_window
  318.     @command_window = Window_QiangCommand.new
  319.     @command_window.viewport = @viewport
  320.     @command_window.y = @help_window.height + fitting_height(3) /2
  321.     @command_window.set_handler(:qiangwu,    method(:qiangwu))
  322.     @command_window.set_handler(:qiangfang,   method(:qiangfang))
  323.     @command_window.set_handler(:cancel, method(:return_scene))
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ● 生成武器强化窗口
  327.   #--------------------------------------------------------------------------
  328.   def create_wu_window
  329.     @wu_window = Window_Qiangwu.new(@qianghelp_window,@qiangxz_window)
  330.     @wu_window.viewport = @viewport
  331.     @wu_window.y += @help_window.height
  332.     @wu_window.hide
  333.     @wu_window.help_window= @help_window
  334.     @wu_window.set_handler(:cancel, method(:qiangwu_cancel))
  335.     @wu_window.set_handler(:ok,     method(:qiangwu_ok))
  336.   end
  337.   #--------------------------------------------------------------------------
  338.   # ● 生成防具强化窗口
  339.   #--------------------------------------------------------------------------
  340.   def create_fang_window
  341.     @fang_window = Window_Qiangfang.new(@qianghelp_window,@qiangxz_window)
  342.     @fang_window.viewport = @viewport
  343.     @fang_window.y += @help_window.height
  344.     @fang_window.hide
  345.     @fang_window.help_window= @help_window
  346.     @fang_window.set_handler(:cancel, method(:qiangfang_cancel))
  347.     @fang_window.set_handler(:ok,     method(:qiangfang_ok))
  348.   end
  349.   #--------------------------------------------------------------------------
  350.   # ● 计算窗口显示指定行数时的应用高度
  351.   #--------------------------------------------------------------------------
  352.   def fitting_height(line_number)
  353.     line_number * 24 + 12 * 2
  354.   end
  355.   #--------------------------------------------------------------------------
  356.   # ● 显示强化武器
  357.   #--------------------------------------------------------------------------
  358.   def qiangwu
  359.     @command_window.hide
  360.     @help_window.show
  361.     @wu_window.show
  362.     @wu_window.start
  363.     @qianghelp_window.show
  364.     @wu_window.activate
  365.     $wufang = true
  366.     @command_window.deactivate
  367.   end
  368.   #--------------------------------------------------------------------------
  369.   # ● 显示强化防具
  370.   #--------------------------------------------------------------------------
  371.   def qiangfang
  372.     @command_window.hide
  373.     @help_window.show
  374.     @fang_window.show
  375.     @fang_window.start
  376.     @qianghelp_window.show
  377.     @fang_window.activate
  378.     $wufang = false
  379.     @command_window.deactivate
  380.   end
  381.   #--------------------------------------------------------------------------
  382.   # ● 取消强化武器
  383.   #--------------------------------------------------------------------------
  384.   def qiangwu_cancel
  385.     @command_window.show
  386.     @help_window.hide
  387.     @wu_window.hide
  388.     @qianghelp_window.hide
  389.     @command_window.activate
  390.     @qianghelp_window.set_text("")
  391.     @help_window.set_text("")
  392.   end
  393.   #--------------------------------------------------------------------------
  394.   # ● 取消强化防具
  395.   #--------------------------------------------------------------------------
  396.   def qiangfang_cancel
  397.     @command_window.show
  398.     @help_window.hide
  399.     @fang_window.hide
  400.     @qianghelp_window.hide
  401.     @command_window.activate
  402.     @qianghelp_window.set_text("")
  403.     @help_window.set_text("")
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● 确定强化武器
  407.   #--------------------------------------------------------------------------
  408.   def qiangwu_ok
  409.     @help_window.hide
  410.     @wu_window.qiangwu_ok
  411.     @qiangxz_window.show
  412.     @qiangxz_window.activate
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● 确定强化防具
  416.   #--------------------------------------------------------------------------
  417.   def qiangfang_ok
  418.     @help_window.hide
  419.     @fang_window.qiangfang_ok
  420.     @qiangxz_window.show
  421.     @qiangxz_window.activate
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # ● 获取卖出价格
  425.   #--------------------------------------------------------------------------
  426.   def selling_price
  427.     @item.price / 2
  428.   end
  429.  
  430.   def qiangxz_gem
  431.     @choosegem_window.start
  432.     @qiangxz_window.deactivate
  433.     @choosegem_window.qiangxz= @qiangxz_window
  434.     if $wufang == true
  435.       @choosegem_window.wufangwindow= @wu_window
  436.     else
  437.       @choosegem_window.wufangwindow= @fang_window
  438.     end
  439.   end
  440.  
  441.   def qiangxz_fangb
  442.     $fangb = !$fangb
  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_fangj
  452.     $fangj = !$fangj
  453.     if $wufang == true
  454.       @wu_window.update_help
  455.     else
  456.       @fang_window.update_help
  457.     end
  458.     @qiangxz_window.activate
  459.   end
  460.  
  461.   def qiangxz_ok
  462.     if $wufang == true
  463.       Equipplus.upweapon(@wu_window.itemid)
  464.       qianging
  465.       @qianghelp_window.set_text($message)
  466.       @qiangxz_window.hide
  467.       Graphics.wait(60)
  468.       @wu_window.activate
  469.       @qiangxz_window.deactivate
  470.       @help_window.hide
  471.       $当前使用宝石加成率 = 0
  472.       $usegem = false
  473.       @fang_window.update_help
  474.       @wu_window.refresh
  475.       @command_window.deactivate
  476.     else
  477.       Equipplus.uparmor(@fang_window.itemid)
  478.       qianging
  479.       @qianghelp_window.set_text($message)
  480.       @qiangxz_window.hide
  481.       Graphics.wait(60)
  482.       @fang_window.activate
  483.       @qiangxz_window.deactivate
  484.       @help_window.hide
  485.       $当前使用宝石加成率 = 0
  486.       $usegem = false
  487.       @fang_window.update_help
  488.       @fang_window.refresh
  489.       @command_window.deactivate
  490.     end
  491.   end
  492.  
  493.   def qiangxz_cancel
  494.     @help_window.refresh
  495.                 @help_window.show
  496.     @wu_window.show
  497.     @qiangxz_window.hide
  498.     @qiangxz_window.deactivate
  499.     if $wufang == true
  500.       @wu_window.activate
  501.     else
  502.       @fang_window.activate
  503.     end
  504.     $当前使用宝石加成率 = 0
  505.     $usegem = false
  506.     @command_window.deactivate
  507.   end
  508.  
  509.   def qianging
  510.     i = 0
  511.     while i < 20
  512.       i += 1
  513.       text = "\n"
  514.       text += "●" * i + "○" * (20 - i)
  515.       text = text + "\n強化中,請等待。"
  516.       @qianghelp_window.set_text(text)
  517.       Graphics.wait(6)
  518.     end
  519.   end
  520. end
  521.  
  522. class RPG::EquipItem < RPG::BaseItem
  523.   alias old initialize
  524.   def initialize
  525.     old
  526.     @up = 0 #装备强化次数
  527.   end
  528.   attr_accessor :up
  529. end
  530. #==============================================================================
  531. # ■ Window_Qiangwu
  532. #------------------------------------------------------------------------------
  533. #  强化系统_武器强化窗口
  534. #==============================================================================
  535.  
  536. class Window_Qiangwu < Window_ItemList
  537.   #--------------------------------------------------------------------------
  538.   # ● 初始化对象
  539.   #--------------------------------------------------------------------------
  540.   def initialize(qianghelp,xuanze)
  541.     super(0, 0, Graphics.width, fitting_height(8))
  542.     self.openness = 0
  543.     deactivate
  544.     @qianghelp = qianghelp
  545.     @xuanze = xuanze
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # ● 开始输入的处理
  549.   #--------------------------------------------------------------------------
  550.   def start
  551.     self.category = :weapon
  552.     refresh
  553.     select(0)
  554.     open
  555.     activate
  556.   end
  557.   #--------------------------------------------------------------------------
  558.   # ● 查询此物品是否可用
  559.   #--------------------------------------------------------------------------
  560.   def enable?(item)
  561.     return false unless item != nil
  562.     Equipplus.weaponupable?(item.id)
  563.   end
  564.   #--------------------------------------------------------------------------
  565.   # ● 确定强化武器
  566.   #--------------------------------------------------------------------------
  567.   def qiangwu_ok
  568.     result = item ? item.id : 0
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● 更新帮助内容
  572.   #--------------------------------------------------------------------------
  573.   def update_help
  574.     return unless item != nil
  575.     @help_window.set_item(item)
  576.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  577.     needmoney = 0
  578.     Equipplus.weaponupable?(item.id)
  579.     qitemname = Equipplus.lostitem.name
  580.     if item.up >= $强化哈希表["最高等級"]
  581.       qitemname = "無法繼續升級"
  582.     end
  583.     temp = []
  584.     $usegem == true ? temp.push("有●") : temp.push("無○")
  585.     temp.push($data_items[$强化哈希表["特殊物品"][0]].name)
  586.     $fangb == true ? temp.push("有●") : temp.push("無○")
  587.     temp.push($data_items[$强化哈希表["特殊物品"][1]].name)
  588.     $fangj == true ? temp.push("有●") : temp.push("無○")
  589.     cgl = ($强化哈希表["每級機率"][item.up] + $当前使用宝石加成率).to_s
  590.     if item.up == 0
  591.       min = item.params[2] + 1
  592.       max = min + 5
  593.     else
  594.       if item.up >= $强化哈希表["最高等級"]
  595.         min = item.params[2].to_int
  596.         max = min
  597.       else
  598.     min = (item.params[2] * (1 + $强化哈希表["提升能力"][item.up] / 100)).to_int + item.up
  599.     max = min + item.up * 1
  600.     end
  601.   end
  602.     text = "裝備名稱:" + item.name + "\n強化所需" + Vocab::currency_unit + ":" + Equipplus.needmoney.to_s
  603.     text += "\n當前強化等級:" + item.up.to_s + "\n強化需要:" +  qitemname
  604.     text += "\n強化寶石:" + temp [0] + " " + temp[1] + ":" + temp[2]+ " " + temp[3] + ":" + temp[4]
  605.     text += "\n成功率:" + cgl + "% (強化後請按取消鍵更新成功率) " + "\n強化成功後、武器物攻魔攻上限將會提升。失敗時、有30%機率武器消失。"
  606.     @qianghelp.set_text(text)
  607.   end
  608.   #--------------------------------------------------------------------------
  609.   # ● 获取当前武器等级
  610.   #--------------------------------------------------------------------------
  611.   def getweaponup
  612.     Equipplus.weaponupisnil(item.id)
  613.     item.up
  614.   end
  615.  
  616.   def itemid
  617.     item.id
  618.   end
  619.   #--------------------------------------------------------------------------
  620.   # ● 选择项目
  621.   #--------------------------------------------------------------------------
  622.   def select(index)
  623.     self.index = index if index
  624.     update_help
  625.   end
  626. end
  627. #==============================================================================
  628. # ■ Window_Qiangfang
  629. #------------------------------------------------------------------------------
  630. #  强化系统_防具强化窗口
  631. #==============================================================================
  632.  
  633. class Window_Qiangfang < Window_ItemList
  634.   #--------------------------------------------------------------------------
  635.   # ● 初始化对象
  636.   #--------------------------------------------------------------------------
  637.   def initialize(qianghelp,xuanze)
  638.     super(0, 0, Graphics.width, fitting_height(8))
  639.     self.openness = 0
  640.     deactivate
  641.     @qianghelp = qianghelp
  642.     @xuanze = xuanze
  643.   end
  644.   #--------------------------------------------------------------------------
  645.   # ● 开始输入的处理
  646.   #--------------------------------------------------------------------------
  647.   def start
  648.     self.category = :armor
  649.     refresh
  650.     select(0)
  651.     open
  652.     activate
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # ● 查询此物品是否可用
  656.   #--------------------------------------------------------------------------
  657.   def enable?(item)
  658.     return false unless item != nil
  659.     Equipplus.armorupable?(item.id)
  660.   end
  661.   #--------------------------------------------------------------------------
  662.   # ● 确定强化防具
  663.   #--------------------------------------------------------------------------
  664.   def qiangfang_ok
  665.     result = item ? item.id : 0
  666.   end
  667.   #--------------------------------------------------------------------------
  668.   # ● 更新帮助内容
  669.   #--------------------------------------------------------------------------
  670.   def update_help
  671.     return unless item != nil
  672.     @help_window.set_item(item)
  673.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  674.     needmoney = 0
  675.     Equipplus.armorupable?(item.id)
  676.     qitemname = Equipplus.lostitem.name
  677.     if item.up >= $强化哈希表["最高等級"]
  678.       qitemname = "無法繼續升級"
  679.     end
  680.     temp = []
  681.     $usegem == true ? temp.push("有●") : temp.push("無○")
  682.     temp.push($data_items[$强化哈希表["特殊物品"][0]].name)
  683.     $fangb == true ? temp.push("有●") : temp.push("無○")
  684.     temp.push($data_items[$强化哈希表["特殊物品"][1]].name)
  685.     $fangj == true ? temp.push("有●") : temp.push("無○")
  686.     cgl = ($强化哈希表["每級機率"][item.up] + $当前使用宝石加成率).to_s
  687.     if item.up == 0
  688.       min = item.params[3] + 1
  689.       max = min + 5
  690.     else
  691.       if item.up >= $强化哈希表["最高等級"]
  692.         min = item.params[3].to_int
  693.         max = min
  694.       else
  695.     min = (item.params[3] * (1 + $强化哈希表["提升能力"][item.up] / 100)).to_int + item.up
  696.     max = min + item.up * 5
  697.     end
  698.   end
  699.     text = "裝備名稱:" + item.name + "\n強化所需" + Vocab::currency_unit + ":" + Equipplus.needmoney.to_s
  700.     text += "\n當前強化等級:" + item.up.to_s + "\n強化需要:" +  qitemname
  701.     text += "\n強化寶石:" + temp [0] + " " + temp[1] + ":" + temp[2]+ " " + temp[3] + ":" + temp[4]
  702.     text += "\n成功率:" + cgl + "% (強化後請按取消鍵更新成功率)" + "\n強化成功後、裝備物防魔防上限將會提升。失敗時、有30%機率裝備消失。"
  703.     @qianghelp.set_text(text)
  704.   end
  705.   #--------------------------------------------------------------------------
  706.   # ● 获取当前防具等级
  707.   #--------------------------------------------------------------------------
  708.   def getarmorup
  709.     Equipplus.armorupisnil(item.id)
  710.     item.up
  711.   end
  712.  
  713.   def itemid
  714.     item.id
  715.   end
  716.   #--------------------------------------------------------------------------
  717.   # ● 选择项目
  718.   #--------------------------------------------------------------------------
  719.   def select(index)
  720.     self.index = index if index
  721.     update_help
  722.   end
  723. end
  724. #==============================================================================
  725. # ■ Window_QiangCommand
  726. #------------------------------------------------------------------------------
  727. #  强化系统中,处理命令选择的窗口。
  728. #==============================================================================
  729.  
  730. class Window_QiangCommand < Window_Command
  731.   #--------------------------------------------------------------------------
  732.   # ● 初始化对象
  733.   #--------------------------------------------------------------------------
  734.   def initialize
  735.     super(0, 0)
  736.     update_placement
  737.     self.openness = 0
  738.     open
  739.   end
  740.   #--------------------------------------------------------------------------
  741.   # ● 获取窗口的宽度
  742.   #--------------------------------------------------------------------------
  743.   def window_width
  744.     return 160
  745.   end
  746.   #--------------------------------------------------------------------------
  747.   # ● 更新窗口的位置
  748.   #--------------------------------------------------------------------------
  749.   def update_placement
  750.     self.x = (Graphics.width - width) / 2
  751.     self.y = (Graphics.height - height) / 2
  752.   end
  753.   #--------------------------------------------------------------------------
  754.   # ● 生成指令列表
  755.   #--------------------------------------------------------------------------
  756.   def make_command_list
  757.     add_command("強化武器",    :qiangwu)
  758.     add_command("強化防具",    :qiangfang)
  759.     add_command(Vocab::ShopCancel, :cancel)
  760.   end
  761. end
  762. #==============================================================================
  763. # ■ Window_Qianghelp
  764. #------------------------------------------------------------------------------
  765. #  显示说明
  766. #==============================================================================
  767.  
  768. class Window_Qianghelp < Window_Base
  769.   #--------------------------------------------------------------------------
  770.   # ● 初始化对象
  771.   #--------------------------------------------------------------------------
  772.   def initialize
  773.     super(0, 0, window_width, fitting_height(7) + 8)
  774.     refresh
  775.   end
  776.   #--------------------------------------------------------------------------
  777.   # ● 获取窗口的宽度
  778.   #--------------------------------------------------------------------------
  779.   def window_width
  780.     return 544
  781.   end
  782.   #--------------------------------------------------------------------------
  783.   # ● 获取持有金钱
  784.   #--------------------------------------------------------------------------
  785.   def value
  786.     $game_party.gold
  787.   end
  788.   #--------------------------------------------------------------------------
  789.   # ● 获取货币单位
  790.   #--------------------------------------------------------------------------
  791.   def currency_unit
  792.     Vocab::currency_unit
  793.   end
  794.   #--------------------------------------------------------------------------
  795.   # ● 设置内容
  796.   #--------------------------------------------------------------------------
  797.   def set_text(text)
  798.     if text != @text
  799.       @text = text
  800.       refresh
  801.     end
  802.   end
  803.   #--------------------------------------------------------------------------
  804.   # ● 清除
  805.   #--------------------------------------------------------------------------
  806.   def clear
  807.     set_text("")
  808.   end
  809.   #--------------------------------------------------------------------------
  810.   # ● 刷新
  811.   #--------------------------------------------------------------------------
  812.   def refresh
  813.     contents.clear
  814.     draw_text_ex(4, 0, @text)
  815.   end
  816. end
  817. #==============================================================================
  818. # ■ Window_Qiangxz
  819. #------------------------------------------------------------------------------
  820. #  强化系统中,选择强化方式的窗口。
  821. #==============================================================================
  822.  
  823. class Window_Qiangxz < Window_Command
  824.   @havegem = false
  825.   @havefangb = false
  826.   @havefangj = false
  827.   #--------------------------------------------------------------------------
  828.   # ● 初始化对象
  829.   #--------------------------------------------------------------------------
  830.   def initialize
  831.     super(0, 0)
  832.     index = 0
  833.     update_placement
  834.     self.openness = 0
  835.     open
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # ● 获取窗口的宽度
  839.   #--------------------------------------------------------------------------
  840.   def window_width
  841.     return 180
  842.   end
  843.   #--------------------------------------------------------------------------
  844.   # ● 更新窗口的位置
  845.   #--------------------------------------------------------------------------
  846.   def update_placement
  847.     self.x = (Graphics.width - width) / 2
  848.     self.y = (Graphics.height - height) / 2
  849.   end
  850.   #--------------------------------------------------------------------------
  851.   # ● 检查可用
  852.   #--------------------------------------------------------------------------
  853.   def haveitem
  854.     @havegem = false
  855.     @havefangb = false
  856.     @havefangj = false
  857.     for i in $强化哈希表["寶石效果"]
  858.         if $game_party.has_item?($data_items[i[1]])
  859.         @havegem = true
  860.       end
  861.     end
  862.     @havefangb = $game_party.has_item?($data_items[$强化哈希表["特殊物品"][0]])
  863.     @havefangj = $game_party.has_item?($data_items[$强化哈希表["特殊物品"][1]])
  864.   end
  865.   #--------------------------------------------------------------------------
  866.   # ● 生成指令列表
  867.   #--------------------------------------------------------------------------
  868.   def make_command_list
  869.     haveitem
  870.     add_command("寶石材料",     :gem, @havegem)
  871.     add_command(Equipplus.idgetitem($强化哈希表["特殊物品"][0]).name, :fangb, @havefangb)
  872.     add_command(Equipplus.idgetitem($强化哈希表["特殊物品"][1]).name, :fangj, @havefangj)
  873.     add_command("開始強化", :start)
  874.     add_command("取消強化", :cancel)
  875.   end
  876. end
  877. class Window_ItemList
  878.   #--------------------------------------------------------------------------
  879.   # ● 查询列表中是否含有此物品
  880.   #--------------------------------------------------------------------------
  881.   def include?(item)
  882.     case @category
  883.     when :item
  884.       item.is_a?(RPG::Item) && !item.key_item?
  885.     when :weapon
  886.       item.is_a?(RPG::Weapon)
  887.     when :armor
  888.       item.is_a?(RPG::Armor)
  889.     when :key_item
  890.       item.is_a?(RPG::Item) && item.key_item?
  891.     when :gem
  892.       itemid = item ? item.id : 0
  893.       itemid != 0 ? isgem(itemid) : false
  894.     else
  895.       false
  896.     end
  897.   end
  898.  
  899.   def isgem(itemid)
  900.     for i in $强化哈希表["寶石效果"]
  901.       return true if i[1] == itemid
  902.     end
  903.     false
  904.   end
  905. end
  906. #==============================================================================
  907. # ■ Window_Choosegem
  908. #------------------------------------------------------------------------------
  909. #  选择强化使用的宝石
  910. #==============================================================================
  911.  
  912. class Window_Choosegem < Window_ItemList
  913.   #--------------------------------------------------------------------------
  914.   # ● 初始化对象
  915.   #--------------------------------------------------------------------------
  916.   def initialize()
  917.     super(0, 0, Graphics.width, fitting_height(2))
  918.     self.openness = 0
  919.     deactivate
  920.     @wufangwindow = nil
  921.     @qiangxz = nil
  922.     set_handler(:ok,     method(:on_ok))
  923.     set_handler(:cancel, method(:on_cancel))
  924.   end
  925.  
  926.   def wufangwindow=(wufangwindow)
  927.     @wufangwindow = wufangwindow
  928.   end
  929.   def qiangxz=(qiangxz)
  930.     @qiangxz = qiangxz
  931.   end
  932.   #--------------------------------------------------------------------------
  933.   # ● 开始输入的处理
  934.   #--------------------------------------------------------------------------
  935.   def start
  936.     self.category = :gem
  937.     self.y = (Graphics.height - height) / 2
  938.     refresh
  939.     select(0)
  940.     open
  941.     activate
  942.   end
  943.   #--------------------------------------------------------------------------
  944.   # ● 确定时的处理
  945.   #--------------------------------------------------------------------------
  946.   def on_ok
  947.     result = item ? item.id : 0
  948.     if result != 0
  949.      $usegem = true
  950.      $当前使用宝石id = result
  951.      for i in $强化哈希表["寶石效果"]
  952.        $当前使用宝石加成率 = i[0] if i[1] == $当前使用宝石id
  953.      end
  954.    else
  955.      $当前使用宝石加成率 = 0
  956.      $usegem = false
  957.     end
  958.     @wufangwindow.update_help
  959.     @qiangxz.activate
  960.     close
  961.   end
  962.   #--------------------------------------------------------------------------
  963.   # ● 查询此物品是否可用
  964.   #--------------------------------------------------------------------------
  965.   def enable?(item)
  966.     true
  967.   end
  968.   #--------------------------------------------------------------------------
  969.   # ● 取消时的处理
  970.   #--------------------------------------------------------------------------
  971.   def on_cancel
  972.     $当前使用宝石加成率 = 0
  973.     $usegem = false
  974.     @wufangwindow.update_help
  975.     @qiangxz.activate
  976.     close
  977.   end
  978. end
  979. #==============================================================================
  980. # ■ 强化系统DataManager
  981. #------------------------------------------------------------------------------
  982. #  将武器和防具数据保存入存档
  983. #==============================================================================
  984. module DataManager
  985.   #--------------------------------------------------------------------------
  986.   # ● 生成存档内容
  987.   #--------------------------------------------------------------------------
  988.   def self.make_save_contents
  989.     contents = {}
  990.     contents[:system]        = $game_system
  991.     contents[:timer]         = $game_timer
  992.     contents[:message]       = $game_message
  993.     contents[:switches]      = $game_switches
  994.     contents[:variables]     = $game_variables
  995.     contents[:self_switches] = $game_self_switches
  996.     contents[:actors]        = $game_actors
  997.     contents[:party]         = $game_party
  998.     contents[:troop]         = $game_troop
  999.     contents[:map]           = $game_map
  1000.     contents[:player]        = $game_player
  1001.     contents[:weapons]       = $data_weapons
  1002.     contents[:armors]        = $data_armors
  1003.     contents
  1004.   end
  1005.   #--------------------------------------------------------------------------
  1006.   # ● 展开存档内容
  1007.   #--------------------------------------------------------------------------
  1008.   def self.extract_save_contents(contents)
  1009.     $game_system        = contents[:system]
  1010.     $game_timer         = contents[:timer]
  1011.     $game_message       = contents[:message]
  1012.     $game_switches      = contents[:switches]
  1013.     $game_variables     = contents[:variables]
  1014.     $game_self_switches = contents[:self_switches]
  1015.     $game_actors        = contents[:actors]
  1016.     $game_party         = contents[:party]
  1017.     $game_troop         = contents[:troop]
  1018.     $game_map           = contents[:map]
  1019.     $game_player        = contents[:player]
  1020.     $data_weapons       = contents[:weapons]
  1021.     $data_armors        = contents[:armors]
  1022.   end
  1023. end

BS00282.jpg (467 KB, 下载次数: 25)

BS00282.jpg
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
36 小时
注册时间
2013-8-4
帖子
6
4
发表于 2013-8-5 09:24:47 | 只看该作者
本帖最后由 5ion 于 2013-8-5 09:40 编辑

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

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
567
在线时间
465 小时
注册时间
2009-10-11
帖子
407
5
 楼主| 发表于 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
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-18 02:36

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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