查看: 2252|回复: 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 )


[pre lang="ruby" line="1"]=begin
===============================================================================
Expanded Item Categories (25/01/2013)
-------------------------------------------------------------------------------
Created By: Shadowmaster/Shadowmaster9000/Shadowpasta
(www.crimson-castle.co.uk)

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

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

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

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

===============================================================================
Required
-------------------------------------------------------------------------------
Nothing.

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

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

===============================================================================
=end
$imported = {} if $imported.nil?
$imported["ExpandedItemCategories"] = true

module Itemlist
  
#==============================================================================
# ** List of Categories
#------------------------------------------------------------------------------
#  Below are the list of categories available in this script. You can change
#  the order of the categories to your pleasing, as well as their names and
#  even remove any categories you don't want. I will record the list of all
#  available categories here if in case you forget any of them.
#
#  :all_item         (Displays all items)
#  :item             (Displays normal items)
#  :weapon           (Displays all weapons)
#  :armor            (Displays all armor gear)
#  :armor_shield     (Displays shields only)
#  :armor_head       (Displays head gear only)
#  :armor_body       (Displays body gear only)
#  :armor_accessory  (Displays accessories only)
#  :key_item         (Displays key items)
#==============================================================================
  
  Categories =[ # Do not remove this.
      [:all_item, "All"],
      [:item, "Items"],
      [:weapon, "Weapons"],  
      [:armor, "Armors"],
      [:armor_shield, "Shields"],
      [:armor_head, "Head Gear"],
      [:armor_body, "Body Gear"],
      [:armor_accessory, "Accessories"],
      [:key_item, "Key Items"],
    ] # Do not remove this.

#==============================================================================
# ** Category Help Descriptions
#------------------------------------------------------------------------------
#  These set what text appears in the help window when you are viewing the
#  item categories. If you want to leave them blank, just leave empty ""
#  behind.
#==============================================================================
   
  All_Item_Help_Info = "Viewing all items."
  Item_Help_Info = "Viewing normal items."
  Weapon_Help_Info = "Viewing all weapons."
  Armor_Help_Info = "Viewing all armors."
  Armor_Shield_Help_Info = "Viewing all shields."
  Armor_Head_Help_Info = "Viewing head gear."
  Armor_Body_Help_Info = "Viewing body gear."
  Armor_Accessory_Help_Info = "Viewing accessories."
  Key_Item_Help_Info = "Viewing important items."
  
#==============================================================================
# ** Max Columns
#------------------------------------------------------------------------------
#  This sets how many item categories you can view on the screen at one time.
#  If the number of item categories exceed the number of maximum columns, you
#  will be able to scroll through the window to see the rest of the item
#  categories.
#==============================================================================

  Max_Columns = 4

end

#==============================================================================
# ** DO NOT edit anything below this unless if you know what you're doing!
#==============================================================================
      
class RPG::Armor

  def armor_shield?
    @etype_id == 1
  end
  def armor_head?
    @etype_id == 2
  end
  def armor_body?
    @etype_id == 3
  end
  def armor_accessory?
    @etype_id == 4
  end
  
end

#==============================================================================
# ** Window_HorzCommand
#------------------------------------------------------------------------------
#  This is a command window for the horizontal selection format.
#==============================================================================

class Window_HorzCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Set Leading Digits
  #--------------------------------------------------------------------------
  def top_col=(col)
    col = 0 if col < 0
    self.ox = col * (item_width + spacing)
  end
end

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

class Window_ItemCategory < Window_HorzCommand
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return Itemlist::Max_Columns
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    Itemlist::Categories.each { |symbol, label|
          add_command(label, symbol)
        }
  end
  #--------------------------------------------------------------------------
  # * Update Help Text
  #--------------------------------------------------------------------------
  def update_help
    @help_window.clear
    case current_symbol
    when :all_item
      @help_window.set_text(Itemlist::All_Item_Help_Info)
    when :item
      @help_window.set_text(Itemlist::Item_Help_Info)
    when :weapon
      @help_window.set_text(Itemlist::Weapon_Help_Info)
    when :armor
      @help_window.set_text(Itemlist::Armor_Help_Info)
    when :armor_shield
      @help_window.set_text(Itemlist::Armor_Shield_Help_Info)
    when :armor_head
      @help_window.set_text(Itemlist::Armor_Head_Help_Info)
    when :armor_body
      @help_window.set_text(Itemlist::Armor_Body_Help_Info)
    when :armor_accessory
      @help_window.set_text(Itemlist::Armor_Accessory_Help_Info)
    when :key_item
      @help_window.set_text(Itemlist::Key_Item_Help_Info)
    else
      @help_window.clear
    end
  end
end

#==============================================================================
# ** Window_ItemList
#------------------------------------------------------------------------------
#  This window displays a list of party items on the item screen.
#==============================================================================

class Window_ItemList < Window_Selectable
  #--------------------------------------------------------------------------
  # * Include in Item List?
  #--------------------------------------------------------------------------
  def include?(item)
    case @category
    when :all_item
      item.is_a?(RPG::Item) || item.is_a?(RPG::Armor) || item.is_a?(RPG::Weapon)
    when :item
      item.is_a?(RPG::Item) && !item.key_item?
    when :weapon
      item.is_a?(RPG::Weapon)
    when :armor
      item.is_a?(RPG::Armor)
    when :armor_shield
      item.is_a?(RPG::Armor) && item.armor_shield?
    when :armor_head
      item.is_a?(RPG::Armor) && item.armor_head?
    when :armor_body
      item.is_a?(RPG::Armor) && item.armor_body?
    when :armor_accessory
      item.is_a?(RPG::Armor) && item.armor_accessory?
    when :key_item
      item.is_a?(RPG::Item) && item.key_item?
    else
      false
    end
  end
end

#==============================================================================
# ** Scene_Shop
#------------------------------------------------------------------------------
#  This class performs shop screen processing.
#==============================================================================

class Scene_Shop < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  alias start_itemlist start
  def start
    super
    start_itemlist
    @help_window.clear
  end
  #--------------------------------------------------------------------------
  # * Category [Cancel]
  #--------------------------------------------------------------------------
  alias on_category_cancel_itemlist on_category_cancel
  def on_category_cancel
    on_category_cancel_itemlist
    @help_window.clear
  end
end[/pre]
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
梦石
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: 寶石>  皆無法顯示出來... )

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

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

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

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

def self.equipable?(id,weapon = true)
  weapon == true ? weaponupisnil(id) : armorupisnil(id)
  weapon == true ? equip = $data_weapons[id].dup : equip = $data_armors[id].dup
  price = equip.price
  @needmoney = price * equip.up
  if @needmoney == 0
    @needmoney = price / 2
  end
#循环取出需要的强化材料
  temp = false
  for i in $强化哈希表["強化材料"]
    if equip.up < i[0]
      @lostitem = idgetitem i[1]
      $game_party.has_item?(idgetitem(i[1])) ? temp = true : temp = false
      break
    end
  end
  $game_party.gold >= @needmoney && temp == true ? true : false
end

def self.upweapon (id)
  $message = ""
  success = false
  weaponupisnil(id)
  weapon = $data_weapons[id].dup
  gl = 0
  fangb = false
  fangj = false
  return unless weapon.up < $强化哈希表["最高等級"] && weaponupable?(id)
  loststh
  $message += "本次強化,共消耗:" + Vocab::currency_unit + " " + @needmoney.to_s
  $message += " " + @lostitem.name + "\n "
  gl = $强化哈希表["每級機率"][weapon.up]
  if $usegem == true
    gl += $当前使用宝石加成率
    idlostitem($当前使用宝石id)
    $message += idgetitem($当前使用宝石id).name + " "
  end
  if $fangb == true
    fangb = true
    idlostitem $强化哈希表["特殊物品"][0]
    $message += idgetitem($强化哈希表["特殊物品"][0]).name + " "
  end
  if $fangj == true
    fangj = true
    idlostitem $强化哈希表["特殊物品"][1]
    $message += idgetitem($强化哈希表["特殊物品"][1]).name + " "
  end
  suiji = rand (100)
  if suiji <= gl
    success = true
  end
  $message += "\n強化結果:"
  if success == true
    $message += "強化成功"
    idlostequip id
    weapon.id = $data_weapons.size
    params = weapon.params.dup
    params[4] *= 1
    params[4] += $强化哈希表["提升能力"][weapon.up] / 20
    params[4] += 1 if params[4] == weapon.params[4]
    params[6] += $强化哈希表["提升能力"][weapon.up] / 40
    params[2] *= 1
    params[2] += $强化哈希表["提升能力"][weapon.up] / 20
    params[2] += 1 if params[2] == weapon.params[2]
    $message += " 裝備攻擊能力提升 "
    weapon.up += 1
    $data_weapons.insert $data_weapons.size,weapon
    $data_weapons[$data_weapons.size-1].params = params
    idgainequip weapon.id
  else
    $message += "強化失敗"
    suiji = rand (100)
    if suiji <= $强化哈希表["消失機率"][weapon.up]
      if fangb != true
      $message += ",武器消失。"
      idlostequip id
      else
      $message += ",武器未消失。"
      end
    else
      suiji = rand (100)
      if suiji <= $强化哈希表["降級機率"][weapon.up]
        if fangj == false && weapon.up != 0
          $message += ",武器降級。"
          params = weapon.params.dup
          params[4] -= 1
          params[2] -= 1
          weapon.params = params
          weapon.up -= 1
          $data_weapons[id] = weapon
        else
          $message += ",武器未降級。"
        end
      end
    end
  end
   $usegem = false
   $fangb = false
   $fangj = false
end

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

def self.weaponupable?(id)
  equipable?(id)
end

def self.uparmor (id)
  $message = ""
  success = false
  armorupisnil(id)
  armor = $data_armors[id].dup
  gl = 0
  fangb = false
  fangj = false
  return unless armor.up < $强化哈希表["最高等級"] && armorupable?(id)
  loststh
  $message += "本次強化,共消耗:" + Vocab::currency_unit + " " + @needmoney.to_s
  $message += " " + @lostitem.name + "\n "
  gl = $强化哈希表["每級機率"][armor.up]
  if $usegem == true
    gl += $当前使用宝石加成率
    idlostitem($当前使用宝石id)
    $message += idgetitem($当前使用宝石id).name + " "
  end
  if $fangb == true
    fangb = true
    idlostitem $强化哈希表["特殊物品"][0]
    $message += idgetitem($强化哈希表["特殊物品"][0]).name + " "
  end
  if $fangj == true
    fangj = true
    idlostitem $强化哈希表["特殊物品"][1]
    $message += idgetitem($强化哈希表["特殊物品"][1]).name + " "
  end
  suiji = rand (100)
  if suiji <= gl
    success = true
  end
  $message += "\n強化結果:"
  if success == true
    $message += "強化成功"
    idlostequip id,false
    armor.id = $data_armors.size
    params = armor.params.dup
    params[3] *= 1
    params[3] += 0
    params[3] += 1 if params[3] == armor.params[3]
    params[5] *= 1
    params[5] += 0
    params[5] += 1 if params[5] == armor.params[5]
    params[0] += $强化哈希表["提升能力"][armor.up] / 2
    params[1] += $强化哈希表["提升能力"][armor.up] / 4
    $message += " 裝備防禦能力提升 "
    armor.up += 1
    $data_armors.insert $data_armors.size,armor
    $data_armors[$data_armors.size-1].params = params
    idgainequip armor.id,false
  else
    $message += "強化失敗"
    suiji = rand (100)
    if suiji <= $强化哈希表["消失機率"][armor.up]
      if fangb != true
      $message += ",裝備消失。"
      idlostequip id,false
      else
      $message += ",裝備未消失。"
      end
    else
      suiji = rand (100)
      if suiji <= $强化哈希表["降級機率"][armor.up]
        if fangj == false && armor.up != 0
          $message += ",裝備降級。"
          params = armor.params.dup
          params[3] -= 1
          params[5] -= 1      
          armor.params = params
          armor.up -= 1
          $data_armors[id] = armor
        else
          $message += ",裝備未降級。"
        end
      end
    end
  end
   $usegem = false
   $fangb = false
   $fangj = false
end

def self.armorupisnil(id)
   $data_armors[id].up = 0 unless $data_armors[id].up != nil
end
def self.armorupable?(id)
  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)
end
def self.loststh()
   $game_party.lose_item(@lostitem,1)
   $game_party.lose_gold(@needmoney)
end
def self.needmoney
   @needmoney
end
def self.lostitem
   @lostitem
end
end
#==============================================================================
# ■ Scene_Qiang
#------------------------------------------------------------------------------
#  强化画面
#==============================================================================

class Scene_Qiang < Scene_MenuBase
  $wufang = true
  $usegem = false
  $fangb = false
  $fangj = false
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    create_help_window
    @help_window.hide
    create_qianghelp_window
    create_command_window
    create_qiangxz_window
    create_wu_window
    create_fang_window
    create_choosegem_window
  end
  #--------------------------------------------------------------------------
  # ● 生成说明窗口
  #--------------------------------------------------------------------------
  def create_qianghelp_window
    @qianghelp_window = Window_Qianghelp.new
    @qianghelp_window.y = Graphics.height - @qianghelp_window.height
    @qianghelp_window.viewport = @viewport
    @qianghelp_window.hide
  end
  #--------------------------------------------------------------------------
  # ● 生成选择宝石
  #--------------------------------------------------------------------------
  def create_choosegem_window
    @choosegem_window = Window_Choosegem.new
    @choosegem_window.y = Graphics.height - @choosegem_window.height
    @choosegem_window.viewport = @viewport
    @choosegem_window.z = 120
  end
  #--------------------------------------------------------------------------
  # ● 生成选择窗口
  #--------------------------------------------------------------------------
  def create_qiangxz_window
    @qiangxz_window = Window_Qiangxz.new
    @qiangxz_window.y = @help_window.height + fitting_height(5) /2
    @qiangxz_window.z = 110
    @qiangxz_window.viewport = @viewport
    @qiangxz_window.set_handler(:gem,    method(:qiangxz_gem))
    @qiangxz_window.set_handler(:fangb,    method(:qiangxz_fangb))
    @qiangxz_window.set_handler(:fangj,    method(:qiangxz_fangj))
    @qiangxz_window.set_handler(:ok, method(:qiangxz_ok))
    @qiangxz_window.set_handler(:cancel, method(:qiangxz_cancel))
    @qiangxz_window.hide
    @qiangxz_window.deactivate
  end
  #--------------------------------------------------------------------------
  # ● 生成指令窗口
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_QiangCommand.new
    @command_window.viewport = @viewport
    @command_window.y = @help_window.height + fitting_height(3) /2
    @command_window.set_handler(:qiangwu,    method(:qiangwu))
    @command_window.set_handler(:qiangfang,   method(:qiangfang))
    @command_window.set_handler(:cancel, method(:return_scene))
  end
  #--------------------------------------------------------------------------
  # ● 生成武器强化窗口
  #--------------------------------------------------------------------------
  def create_wu_window
    @wu_window = Window_Qiangwu.new(@qianghelp_window,@qiangxz_window)
    @wu_window.viewport = @viewport
    @wu_window.y += @help_window.height
    @wu_window.hide
    @wu_window.help_window= @help_window
    @wu_window.set_handler(:cancel, method(:qiangwu_cancel))
    @wu_window.set_handler(:ok,     method(:qiangwu_ok))
  end
  #--------------------------------------------------------------------------
  # ● 生成防具强化窗口
  #--------------------------------------------------------------------------
  def create_fang_window
    @fang_window = Window_Qiangfang.new(@qianghelp_window,@qiangxz_window)
    @fang_window.viewport = @viewport
    @fang_window.y += @help_window.height
    @fang_window.hide
    @fang_window.help_window= @help_window
    @fang_window.set_handler(:cancel, method(:qiangfang_cancel))
    @fang_window.set_handler(:ok,     method(:qiangfang_ok))
  end
  #--------------------------------------------------------------------------
  # ● 计算窗口显示指定行数时的应用高度
  #--------------------------------------------------------------------------
  def fitting_height(line_number)
    line_number * 24 + 12 * 2
  end
  #--------------------------------------------------------------------------
  # ● 显示强化武器
  #--------------------------------------------------------------------------
  def qiangwu
    @command_window.hide
    @help_window.show
    @wu_window.show
    @wu_window.start
    @qianghelp_window.show
    @wu_window.activate
    $wufang = true
    @command_window.deactivate
  end
  #--------------------------------------------------------------------------
  # ● 显示强化防具
  #--------------------------------------------------------------------------
  def qiangfang
    @command_window.hide
    @help_window.show
    @fang_window.show
    @fang_window.start
    @qianghelp_window.show
    @fang_window.activate
    $wufang = false
    @command_window.deactivate
  end
  #--------------------------------------------------------------------------
  # ● 取消强化武器
  #--------------------------------------------------------------------------
  def qiangwu_cancel
    @command_window.show
    @help_window.hide
    @wu_window.hide
    @qianghelp_window.hide
    @command_window.activate
    @qianghelp_window.set_text("")
    @help_window.set_text("")
  end
  #--------------------------------------------------------------------------
  # ● 取消强化防具
  #--------------------------------------------------------------------------
  def qiangfang_cancel
    @command_window.show
    @help_window.hide
    @fang_window.hide
    @qianghelp_window.hide
    @command_window.activate
    @qianghelp_window.set_text("")
    @help_window.set_text("")
  end
  #--------------------------------------------------------------------------
  # ● 确定强化武器
  #--------------------------------------------------------------------------
  def qiangwu_ok
    @help_window.hide
    @wu_window.qiangwu_ok
    @qiangxz_window.show
    @qiangxz_window.activate
  end
  #--------------------------------------------------------------------------
  # ● 确定强化防具
  #--------------------------------------------------------------------------
  def qiangfang_ok
    @help_window.hide
    @fang_window.qiangfang_ok
    @qiangxz_window.show
    @qiangxz_window.activate
  end
  #--------------------------------------------------------------------------
  # ● 获取卖出价格
  #--------------------------------------------------------------------------
  def selling_price
    @item.price / 2
  end
  
  def qiangxz_gem
    @choosegem_window.start
    @qiangxz_window.deactivate
    @choosegem_window.qiangxz= @qiangxz_window
    if $wufang == true
      @choosegem_window.wufangwindow= @wu_window
    else
      @choosegem_window.wufangwindow= @fang_window
    end
  end
  
  def qiangxz_fangb
    $fangb = !$fangb
    if $wufang == true
      @wu_window.update_help
    else
      @fang_window.update_help
    end
    @qiangxz_window.activate
  end
  
  def qiangxz_fangj
    $fangj = !$fangj
    if $wufang == true
      @wu_window.update_help
    else
      @fang_window.update_help
    end
    @qiangxz_window.activate
  end
  
  def qiangxz_ok
    if $wufang == true
      Equipplus.upweapon(@wu_window.itemid)
      qianging
      @qianghelp_window.set_text($message)
      @qiangxz_window.hide
      Graphics.wait(60)
      @wu_window.activate
      @qiangxz_window.deactivate
      @help_window.hide
      $当前使用宝石加成率 = 0
      $usegem = false
      @fang_window.update_help
      @wu_window.refresh
      @command_window.deactivate
    else
      Equipplus.uparmor(@fang_window.itemid)
      qianging
      @qianghelp_window.set_text($message)
      @qiangxz_window.hide
      Graphics.wait(60)
      @fang_window.activate
      @qiangxz_window.deactivate
      @help_window.hide
      $当前使用宝石加成率 = 0
      $usegem = false
      @fang_window.update_help
      @fang_window.refresh
      @command_window.deactivate
    end
  end
  
  def qiangxz_cancel
    @help_window.refresh
                @help_window.show
    @wu_window.show
    @qiangxz_window.hide
    @qiangxz_window.deactivate
    if $wufang == true
      @wu_window.activate
    else
      @fang_window.activate
    end
    $当前使用宝石加成率 = 0
    $usegem = false
    @command_window.deactivate
  end
  
  def qianging
    i = 0
    while i < 20
      i += 1
      text = "\n"
      text += "●" * i + "○" * (20 - i)
      text = text + "\n強化中,請等待。"
      @qianghelp_window.set_text(text)
      Graphics.wait(6)
    end
  end
end

class RPG::EquipItem < RPG::BaseItem
  alias old initialize
  def initialize
    old
    @up = 0 #装备强化次数
  end
  attr_accessor :up
end
#==============================================================================
# ■ Window_Qiangwu
#------------------------------------------------------------------------------
#  强化系统_武器强化窗口
#==============================================================================

class Window_Qiangwu < Window_ItemList
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(qianghelp,xuanze)
    super(0, 0, Graphics.width, fitting_height(8))
    self.openness = 0
    deactivate
    @qianghelp = qianghelp
    @xuanze = xuanze
  end
  #--------------------------------------------------------------------------
  # ● 开始输入的处理
  #--------------------------------------------------------------------------
  def start
    self.category = :weapon
    refresh
    select(0)
    open
    activate
  end
  #--------------------------------------------------------------------------
  # ● 查询此物品是否可用
  #--------------------------------------------------------------------------
  def enable?(item)
    return false unless item != nil
    Equipplus.weaponupable?(item.id)
  end
  #--------------------------------------------------------------------------
  # ● 确定强化武器
  #--------------------------------------------------------------------------
  def qiangwu_ok
    result = item ? item.id : 0
  end
  #--------------------------------------------------------------------------
  # ● 更新帮助内容
  #--------------------------------------------------------------------------
  def update_help
    return unless item != nil
    @help_window.set_item(item)
    @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
    needmoney = 0
    Equipplus.weaponupable?(item.id)
    qitemname = Equipplus.lostitem.name
    if item.up >= $强化哈希表["最高等級"]
      qitemname = "無法繼續升級"
    end
    temp = []
    $usegem == true ? temp.push("有●") : temp.push("無○")
    temp.push($data_items[$强化哈希表["特殊物品"][0]].name)
    $fangb == true ? temp.push("有●") : temp.push("無○")
    temp.push($data_items[$强化哈希表["特殊物品"][1]].name)
    $fangj == true ? temp.push("有●") : temp.push("無○")
    cgl = ($强化哈希表["每級機率"][item.up] + $当前使用宝石加成率).to_s
    if item.up == 0
      min = item.params[2] + 1
      max = min + 5
    else
      if item.up >= $强化哈希表["最高等級"]
        min = item.params[2].to_int
        max = min
      else
    min = (item.params[2] * (1 + $强化哈希表["提升能力"][item.up] / 100)).to_int + item.up
    max = min + item.up * 1
    end
  end
    text = "裝備名稱:" + item.name + "\n強化所需" + Vocab::currency_unit + ":" + Equipplus.needmoney.to_s
    text += "\n當前強化等級:" + item.up.to_s + "\n強化需要:" +  qitemname
    text += "\n強化寶石:" + temp [0] + " " + temp[1] + ":" + temp[2]+ " " + temp[3] + ":" + temp[4]
    text += "\n成功率:" + cgl + "% (強化後請按取消鍵更新成功率) " + "\n強化成功後、武器物攻魔攻上限將會提升。失敗時、有30%機率武器消失。"
    @qianghelp.set_text(text)
  end
  #--------------------------------------------------------------------------
  # ● 获取当前武器等级
  #--------------------------------------------------------------------------
  def getweaponup
    Equipplus.weaponupisnil(item.id)
    item.up
  end
  
  def itemid
    item.id
  end
  #--------------------------------------------------------------------------
  # ● 选择项目
  #--------------------------------------------------------------------------
  def select(index)
    self.index = index if index
    update_help
  end
end
#==============================================================================
# ■ Window_Qiangfang
#------------------------------------------------------------------------------
#  强化系统_防具强化窗口
#==============================================================================

class Window_Qiangfang < Window_ItemList
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(qianghelp,xuanze)
    super(0, 0, Graphics.width, fitting_height(8))
    self.openness = 0
    deactivate
    @qianghelp = qianghelp
    @xuanze = xuanze
  end
  #--------------------------------------------------------------------------
  # ● 开始输入的处理
  #--------------------------------------------------------------------------
  def start
    self.category = :armor
    refresh
    select(0)
    open
    activate
  end
  #--------------------------------------------------------------------------
  # ● 查询此物品是否可用
  #--------------------------------------------------------------------------
  def enable?(item)
    return false unless item != nil
    Equipplus.armorupable?(item.id)
  end
  #--------------------------------------------------------------------------
  # ● 确定强化防具
  #--------------------------------------------------------------------------
  def qiangfang_ok
    result = item ? item.id : 0
  end
  #--------------------------------------------------------------------------
  # ● 更新帮助内容
  #--------------------------------------------------------------------------
  def update_help
    return unless item != nil
    @help_window.set_item(item)
    @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
    needmoney = 0
    Equipplus.armorupable?(item.id)
    qitemname = Equipplus.lostitem.name
    if item.up >= $强化哈希表["最高等級"]
      qitemname = "無法繼續升級"
    end
    temp = []
    $usegem == true ? temp.push("有●") : temp.push("無○")
    temp.push($data_items[$强化哈希表["特殊物品"][0]].name)
    $fangb == true ? temp.push("有●") : temp.push("無○")
    temp.push($data_items[$强化哈希表["特殊物品"][1]].name)
    $fangj == true ? temp.push("有●") : temp.push("無○")
    cgl = ($强化哈希表["每級機率"][item.up] + $当前使用宝石加成率).to_s
    if item.up == 0
      min = item.params[3] + 1
      max = min + 5
    else
      if item.up >= $强化哈希表["最高等級"]
        min = item.params[3].to_int
        max = min
      else
    min = (item.params[3] * (1 + $强化哈希表["提升能力"][item.up] / 100)).to_int + item.up
    max = min + item.up * 5
    end
  end
    text = "裝備名稱:" + item.name + "\n強化所需" + Vocab::currency_unit + ":" + Equipplus.needmoney.to_s
    text += "\n當前強化等級:" + item.up.to_s + "\n強化需要:" +  qitemname
    text += "\n強化寶石:" + temp [0] + " " + temp[1] + ":" + temp[2]+ " " + temp[3] + ":" + temp[4]
    text += "\n成功率:" + cgl + "% (強化後請按取消鍵更新成功率)" + "\n強化成功後、裝備物防魔防上限將會提升。失敗時、有30%機率裝備消失。"
    @qianghelp.set_text(text)
  end
  #--------------------------------------------------------------------------
  # ● 获取当前防具等级
  #--------------------------------------------------------------------------
  def getarmorup
    Equipplus.armorupisnil(item.id)
    item.up
  end
  
  def itemid
    item.id
  end
  #--------------------------------------------------------------------------
  # ● 选择项目
  #--------------------------------------------------------------------------
  def select(index)
    self.index = index if index
    update_help
  end
end
#==============================================================================
# ■ Window_QiangCommand
#------------------------------------------------------------------------------
#  强化系统中,处理命令选择的窗口。
#==============================================================================

class Window_QiangCommand < Window_Command
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
    update_placement
    self.openness = 0
    open
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的宽度
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # ● 更新窗口的位置
  #--------------------------------------------------------------------------
  def update_placement
    self.x = (Graphics.width - width) / 2
    self.y = (Graphics.height - height) / 2
  end
  #--------------------------------------------------------------------------
  # ● 生成指令列表
  #--------------------------------------------------------------------------
  def make_command_list
    add_command("強化武器",    :qiangwu)
    add_command("強化防具",    :qiangfang)
    add_command(Vocab::ShopCancel, :cancel)
  end
end
#==============================================================================
# ■ Window_Qianghelp
#------------------------------------------------------------------------------
#  显示说明
#==============================================================================

class Window_Qianghelp < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, window_width, fitting_height(7) + 8)
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的宽度
  #--------------------------------------------------------------------------
  def window_width
    return 544
  end
  #--------------------------------------------------------------------------
  # ● 获取持有金钱
  #--------------------------------------------------------------------------
  def value
    $game_party.gold
  end
  #--------------------------------------------------------------------------
  # ● 获取货币单位
  #--------------------------------------------------------------------------
  def currency_unit
    Vocab::currency_unit
  end
  #--------------------------------------------------------------------------
  # ● 设置内容
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 清除
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(4, 0, @text)
  end
end
#==============================================================================
# ■ Window_Qiangxz
#------------------------------------------------------------------------------
#  强化系统中,选择强化方式的窗口。
#==============================================================================

class Window_Qiangxz < Window_Command
  @havegem = false
  @havefangb = false
  @havefangj = false
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
    index = 0
    update_placement
    self.openness = 0
    open
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的宽度
  #--------------------------------------------------------------------------
  def window_width
    return 180
  end
  #--------------------------------------------------------------------------
  # ● 更新窗口的位置
  #--------------------------------------------------------------------------
  def update_placement
    self.x = (Graphics.width - width) / 2
    self.y = (Graphics.height - height) / 2
  end
  #--------------------------------------------------------------------------
  # ● 检查可用
  #--------------------------------------------------------------------------
  def haveitem
    @havegem = false
    @havefangb = false
    @havefangj = false
    for i in $强化哈希表["寶石效果"]
        if $game_party.has_item?($data_items[i[1]])
        @havegem = true
      end
    end
    @havefangb = $game_party.has_item?($data_items[$强化哈希表["特殊物品"][0]])
    @havefangj = $game_party.has_item?($data_items[$强化哈希表["特殊物品"][1]])
  end
  #--------------------------------------------------------------------------
  # ● 生成指令列表
  #--------------------------------------------------------------------------
  def make_command_list
    haveitem
    add_command("寶石材料",     :gem, @havegem)
    add_command(Equipplus.idgetitem($强化哈希表["特殊物品"][0]).name, :fangb, @havefangb)
    add_command(Equipplus.idgetitem($强化哈希表["特殊物品"][1]).name, :fangj, @havefangj)
    add_command("開始強化", :start)
    add_command("取消強化", :cancel)
  end
end
class Window_ItemList
  #--------------------------------------------------------------------------
  # ● 查询列表中是否含有此物品
  #--------------------------------------------------------------------------
  def include?(item)
    case @category
    when :item
      item.is_a?(RPG::Item) && !item.key_item?
    when :weapon
      item.is_a?(RPG::Weapon)
    when :armor
      item.is_a?(RPG::Armor)
    when :key_item
      item.is_a?(RPG::Item) && item.key_item?
    when :gem
      itemid = item ? item.id : 0
      itemid != 0 ? isgem(itemid) : false
    else
      false
    end
  end
  
  def isgem(itemid)
    for i in $强化哈希表["寶石效果"]
      return true if i[1] == itemid
    end
    false
  end
end
#==============================================================================
# ■ Window_Choosegem
#------------------------------------------------------------------------------
#  选择强化使用的宝石
#==============================================================================

class Window_Choosegem < Window_ItemList
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize()
    super(0, 0, Graphics.width, fitting_height(2))
    self.openness = 0
    deactivate
    @wufangwindow = nil
    @qiangxz = nil
    set_handler(:ok,     method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
  end
  
  def wufangwindow=(wufangwindow)
    @wufangwindow = wufangwindow
  end
  def qiangxz=(qiangxz)
    @qiangxz = qiangxz
  end
  #--------------------------------------------------------------------------
  # ● 开始输入的处理
  #--------------------------------------------------------------------------
  def start
    self.category = :gem
    self.y = (Graphics.height - height) / 2
    refresh
    select(0)
    open
    activate
  end
  #--------------------------------------------------------------------------
  # ● 确定时的处理
  #--------------------------------------------------------------------------
  def on_ok
    result = item ? item.id : 0
    if result != 0
     $usegem = true
     $当前使用宝石id = result
     for i in $强化哈希表["寶石效果"]
       $当前使用宝石加成率 = i[0] if i[1] == $当前使用宝石id
     end
   else
     $当前使用宝石加成率 = 0
     $usegem = false
    end
    @wufangwindow.update_help
    @qiangxz.activate
    close
  end
  #--------------------------------------------------------------------------
  # ● 查询此物品是否可用
  #--------------------------------------------------------------------------
  def enable?(item)
    true
  end
  #--------------------------------------------------------------------------
  # ● 取消时的处理
  #--------------------------------------------------------------------------
  def on_cancel
    $当前使用宝石加成率 = 0
    $usegem = false
    @wufangwindow.update_help
    @qiangxz.activate
    close
  end
end
#==============================================================================
# ■ 强化系统DataManager
#------------------------------------------------------------------------------
#  将武器和防具数据保存入存档
#==============================================================================
module DataManager
  #--------------------------------------------------------------------------
  # ● 生成存档内容
  #--------------------------------------------------------------------------
  def self.make_save_contents
    contents = {}
    contents[:system]        = $game_system
    contents[:timer]         = $game_timer
    contents[:message]       = $game_message
    contents[:switches]      = $game_switches
    contents[:variables]     = $game_variables
    contents[:self_switches] = $game_self_switches
    contents[:actors]        = $game_actors
    contents[:party]         = $game_party
    contents[:troop]         = $game_troop
    contents[:map]           = $game_map
    contents[:player]        = $game_player
    contents[:weapons]       = $data_weapons
    contents[:armors]        = $data_armors
    contents
  end
  #--------------------------------------------------------------------------
  # ● 展开存档内容
  #--------------------------------------------------------------------------
  def self.extract_save_contents(contents)
    $game_system        = contents[:system]
    $game_timer         = contents[:timer]
    $game_message       = contents[:message]
    $game_switches      = contents[:switches]
    $game_variables     = contents[:variables]
    $game_self_switches = contents[:self_switches]
    $game_actors        = contents[:actors]
    $game_party         = contents[:party]
    $game_troop         = contents[:troop]
    $game_map           = contents[:map]
    $game_player        = contents[:player]
    $data_weapons       = contents[:weapons]
    $data_armors        = contents[:armors]
  end
end[/pre]
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.

在本版发帖返回顶部