Project1

标题: 解释一下合成脚本????? [打印本页]

作者: 一岁    时间: 2008-7-28 10:58
提示: 作者被禁止或删除 内容自动屏蔽
作者: redant    时间: 2008-7-28 14:05
  1. #==============================================================================  
  2. # Sample master list for crafting script
  3. # written by Deke
  4. #============================================================================================
  5. # 简介:
  6. # 这是一个很不错的合成物品系统,可以通过游戏的过程,不断学习可以合成的
  7. # 物品方法。
  8. #
  9. # 使用方法:
  10. # 1、召唤界面:使用脚本$scene = Scene_Craft.new
  11. #
  12. # 2、学习合成:$game_party.learn_recipe(合成项目)
  13. #
  14. # 3、合成定义:
  15. # 这个合成脚本可以定义两种合成物品。一种是预先定义好了的,就像下面这样,
  16. # 直接写在这里就可以,另一种是在学习之前现场定义。
  17. #
  18. # 4、举例
  19. #  4.1、学会recipe_list[1]定义的合成:$game_party.learn_recipe($game_temp.recipe_list[1])
  20. #       注意,一行如果输入不下,在(的后面或[的后面按回车换行,否则可能出错
  21. #
  22. #  4.2、在游戏中临时定义一种合成,让玩家学会。使用事件中的脚本如下,   
  23. #  脚本:
  24. #    材料 = [$game_variables[1],$game_variables[2]]  #——材料编号是变量1、2的编号
  25. #    材料种类 = [0,0]                                #——材料是物品
  26. #    材料数量 = [$game_variables[3],$game_variables[4]]  #——需要材料数量是变量3、4的编号
  27. #    成品 = $game_variables[5]                       #——获得结果编号是5
  28. #    成品种类 = 1                                    #——成品是防具类
  29. #    $game_party.learn_recipe(Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类))
  30. #===========================================================================================
  31. class Game_Temp
  32.   attr_reader :recipe_list  
  33.   alias crafting_temp_initialize initialize
  34.   def initialize
  35.     crafting_temp_initialize
  36.     @recipe_list=[]
  37.     get_recipe_list
  38.   end  
  39.   def get_recipe_list   
  40.     ##########################################################################
  41.     # 0 号合成物品设定 (物品小药水×2 + 中药水 = 大药水)
  42.     ##########################################################################
  43.     材料 = [1, 2]             # 需要材料的数据库编号
  44.     材料种类 = [0, 0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  45.     材料数量 = [2, 1]         # 需要材料的数量
  46.     成品 = 3                  # 获得物品编号
  47.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  48.     @recipe_list[1] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
  49.    
  50.     ##########################################################################
  51.     # 1 号合成物品设定 (武器铜剑、铁剑、钢剑各1 = 密切斯特剑)
  52.     ##########################################################################
  53.     材料 = [1, 2, 3]          # 需要材料的数据库编号
  54.     材料种类 = [2, 2, 2]      # 需要材料的种类,0是普通物品,1是防具,2是武器
  55.     材料数量 = [3, 2, 1]      # 需要材料的数量
  56.     成品 = 4                  # 获得物品编号
  57.     成品种类 = 2              # 获得物品种类,0是普通物品,1是防具,2是武器
  58.     @recipe_list[2] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
  59.    
  60.     ##########################################################################
  61.     # 2 号合成物品设定 (物品力量之石×2 + 防具钢盾×1 = 密切斯特盾)
  62.     ##########################################################################
  63.     材料 = [13, 3]            # 需要材料的数据库编号
  64.     材料种类 = [0, 1]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  65.     材料数量 = [2, 1]         # 需要材料的数量
  66.     成品 = 4                  # 获得物品编号
  67.     成品种类 = 1              # 获得物品种类,0是普通物品,1是防具,2是武器
  68.     @recipe_list[3] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
  69.    
  70.     ##########################################################################
  71.     # 2 号合成物品设定 (金疮药×2 + 仙狐涎×1 = 大粒丸)
  72.     ##########################################################################
  73.     材料 = [1, 2]             # 需要材料的数据库编号
  74.     材料种类 = [0, 0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  75.     材料数量 = [10, 10]       # 需要材料的数量
  76.     成品 = 3                  # 获得物品编号
  77.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  78.     @recipe_list[4] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)

  79.     ##########################################################################
  80.     # 2 号合成物品设定 (金疮药×2 + 仙狐涎×1 = 大粒丸)
  81.     ##########################################################################
  82.     材料 = [8, 2]             # 需要材料的数据库编号
  83.     材料种类 = [0, 2]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  84.     材料数量 = [1, 1]         # 需要材料的数量
  85.     成品 = 5                  # 获得物品编号
  86.     成品种类 = 2              # 获得物品种类,0是普通物品,1是防具,2是武器
  87.     @recipe_list[5] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)

  88.     ##########################################################################
  89.     # 2 号合成物品设定 (金疮药×2 + 仙狐涎×1 = 大粒丸)
  90.     ##########################################################################
  91.     材料 = [9, 5]             # 需要材料的数据库编号
  92.     材料种类 = [0, 2]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  93.     材料数量 = [1, 1]         # 需要材料的数量
  94.     成品 = 6                  # 获得物品编号
  95.     成品种类 = 2              # 获得物品种类,0是普通物品,1是防具,2是武器
  96.     @recipe_list[6] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
  97.   end # of get_recipe_list method
  98. end # of updates to Game_Temp Class

  99. #================================
  100. # CRAFTING PROGRAM
  101. #----------------------------------------------------------------
  102. #-written by Deke
  103. #-yes_no window code created by Phsylomortis
  104. #----------------------------------------------------------------
  105. #================================

  106. #updates to Game_Party class

  107. class Game_Party
  108.   
  109.   attr_accessor       :recipes
  110.   
  111.   alias crafting_party_initialize initialize
  112.   
  113.   def initialize
  114.     crafting_party_initialize
  115.     @recipes=[]
  116.   end
  117.   
  118.   #----------------------------------------------------------------------
  119.   def know?(recipe, version = 1)
  120.     unless recipe.is_a?(Game_Recipe)
  121.       recipe = get_recipe_from_master_list(recipe, version)
  122.     end
  123.     return $game_party.recipes.include?(recipe)
  124.   end
  125.   
  126. #----------------------------------------------------------------------
  127.   def learn_recipe(recipe , version = 1)
  128.     unless recipe.is_a?(Game_Recipe)
  129.       recipe = get_recipe_from_master_list(recipe, version)
  130.     end
  131.     if recipe.is_a?(Game_Recipe)
  132.       unless know?(recipe)
  133.         @recipes.push(recipe)
  134.       end
  135.     end
  136.   end
  137.   
  138. #----------------------------------------------------------------------
  139.   def forget_recipe(recipe , version = 1)
  140.     if !recipe.is_a?(Game_Recipe)
  141.       recipe = get_recipe_from_master_list(recipe, version)
  142.     end
  143.     if recipe.is_a?(Game_Recipe)
  144.       for i in [email protected]
  145.         if recipe == @recipes[i]
  146.           index = i
  147.           break
  148.         end
  149.       end
  150.       if index != nil
  151.         @recipes.delete(@recipes[index])
  152.       end
  153.     end
  154.   end
  155.   
  156. #----------------------------------------------------------------------
  157.   def get_recipe_from_master_list(item, version)
  158.     index = nil
  159.     for i in 0...$game_temp.recipe_list.size
  160.       if item[0] == $game_temp.recipe_list[i].result and item[1] ==$game_temp.recipe_list[i].result_type
  161.         version -= 1
  162.         if version == 0
  163.           index = i
  164.           break
  165.         end
  166.       end
  167.     end
  168.     if index.is_a?(Integer)
  169.       return ($game_temp.recipe_list[index])
  170.     else
  171.       return false
  172.     end
  173.   end
  174.   
  175. end # of Game_Party updates

  176. #================================
  177. class Game_Recipe

  178.   attr_reader :ingredients
  179.   attr_reader :quantities
  180.   attr_reader :result
  181.   attr_reader :result_type
  182.   attr_reader :ingredient_types
  183.   
  184. #----------------------------------------------------------------------
  185.   def initialize( ingredients, ingredient_types, quantities, result, result_type)
  186.     @ingredients = ingredients
  187.     @ingredient_types = ingredient_types
  188.     @quantities = quantities
  189.     @result = result
  190.     @result_type = result_type
  191.   end
  192.   
  193. #----------------------------------------------------------------------
  194.   def name
  195.     case @result_type
  196.       when 0
  197.         name = $data_items[@result].name
  198.       when 1
  199.         name = $data_armors[@result].name
  200.       when 2
  201.         name = $data_weapons[@result].name
  202.     end
  203.     return name
  204.   end

  205. #----------------------------------------------------------------------
  206.   def have
  207.     have_all = true
  208.     for i in [email protected]
  209.       case @ingredient_types[i]
  210.         when 0
  211.           if $game_party.item_number(@ingredients[i]) < @quantities[i]
  212.             have_all=false
  213.           end
  214.         when 1
  215.           if $game_party.armor_number(@ingredients[i]) < @quantities[i]
  216.             have_all=false
  217.           end
  218.         when 2
  219.           if $game_party.weapon_number(@ingredients[i]) < @quantities[i]
  220.             have_all=false
  221.           end
  222.       end
  223.     end
  224.     return have_all
  225.   end

  226. #----------------------------------------------------------------------
  227.   def decrement
  228.     for i in [email protected]
  229.       case @ingredient_types[i]
  230.       when 0
  231.         $game_party.lose_item(@ingredients[i], @quantities[i])
  232.       when 1
  233.         $game_party.lose_armor(@ingredients[i], @quantities[i])
  234.       when 2
  235.         $game_party.lose_weapon(@ingredients[i], @quantities[i])
  236.       end
  237.     end
  238.   end

  239. #----------------------------------------------------------------------
  240.   def make
  241.     if have
  242.       case @result_type
  243.       when 0
  244.         $game_party.gain_item(@result, 1)
  245.       when 1
  246.         $game_party.gain_armor(@result, 1)
  247.       when 2
  248.         $game_party.gain_weapon(@result, 1)
  249.       end
  250.       decrement
  251.     end
  252.   end
  253.   
  254. #----------------------------------------------------------------------
  255.   def == (recipe)
  256.     if recipe.is_a?(Game_Recipe)
  257.       equal = true
  258.       if recipe.ingredients != self.ingredients
  259.         equal = false
  260.       end
  261.       if recipe.ingredient_types != self.ingredient_types
  262.         equal = false
  263.       end
  264.       if recipe.quantities != self.quantities
  265.         equal = false
  266.       end
  267.       if recipe.result != self.result
  268.         equal=false
  269.       end
  270.       if recipe.result_type != self.result_type
  271.         equal = false
  272.       end
  273.     else
  274.       equal = false
  275.     end
  276.     return equal
  277.   end
  278.   
  279. end # of Game_Recipe class

  280. #===================================

  281. class Window_Craft < Window_Selectable

  282.   #--------------------------------------------------------------------------
  283.   def initialize
  284.     super(0, 64 - 32 + 5, 240, 416 - 32 + 16 - 15)
  285.     @column_max = 1
  286.     refresh
  287.     self.index = 0
  288.   end

  289.   #--------------------------------------------------------------------------
  290.   def recipe
  291.     return @data[self.index]
  292.   end
  293.   ############################################################################
  294.   def item
  295.     case @types[self.index]
  296.     when 0
  297.       return $data_items[@ingredients[i]]
  298.     when 1
  299.       return $data_armors[@ingredients[i]]
  300.     when 2
  301.       return $data_weapons[@ingredients[i]]
  302.     end
  303.   end
  304.   ############################################################################

  305.   #--------------------------------------------------------------------------
  306.   def refresh
  307.     if self.contents != nil
  308.       self.contents.dispose
  309.       self.contents = nil
  310.     end
  311.     @data = []
  312.     for i in 0...$game_party.recipes.size
  313.         @data.push($game_party.recipes[i])
  314.     end
  315.     @item_max = @data.size
  316.     if @item_max > 0
  317.       self.contents = Bitmap.new(width - 32, row_max * 32)
  318.       self.contents.font.name = "黑体" # = "黑体"
  319.       self.contents.font.size = 18 # = 18
  320.       for i in 0...@item_max
  321.         draw_item(i)
  322.       end
  323.     end
  324.   end

  325.   #--------------------------------------------------------------------------
  326.   def draw_item(index)
  327.     recipe = @data[index]
  328.     self.contents.font.color = recipe.have ? normal_color : disabled_color
  329.     x = 16
  330.     y = index * 32
  331.     self.contents.draw_text(x , y, self.width-32, 32, recipe.name, 0)
  332.   end

  333.   #--------------------------------------------------------------------------
  334.   def update_help
  335.     current_recipe = recipe
  336.     if current_recipe.is_a?(Game_Recipe)
  337.     case current_recipe.result_type
  338.       when 0
  339.         description = $data_items[current_recipe.result].description
  340.       when 1
  341.         description = $data_armors[current_recipe.result].description
  342.       when 2
  343.         description = $data_weapons[current_recipe.result].description
  344.       end
  345.     else
  346.       description = ""
  347.     end
  348.     @help_window.set_text(description)
  349.     @help_window.update
  350.   end
  351.   
  352. end # of Window_Craft

  353. #=======================================
  354. class Window_CraftResult < Window_Base

  355.   #--------------------------------------------------------------------------
  356.   def initialize
  357.     super(240, 64 - 32 + 5, 400, 184)
  358.     self.contents = Bitmap.new(width - 32, height - 32)
  359.     self.contents.font.name = "黑体" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  360.     self.contents.font.size = 18 # = 20
  361.     @result = nil
  362.     @type = nil
  363.   end

  364.   #--------------------------------------------------------------------------
  365.   def refresh
  366.     self.contents.clear
  367.     case @type
  368.       when 0
  369.         item = $data_items[@result]
  370.         if item.recover_hp_rate > item.recover_hp
  371.           hp_string = "HP回复率:"
  372.           hp_stat = item.recover_hp_rate
  373.         else
  374.           hp_string = "HP回复量:"
  375.           hp_stat = item.recover_hp
  376.         end
  377.         if item.recover_sp_rate > item.recover_sp
  378.           sp_string = "SP回复率:"
  379.           sp_stat = item.recover_sp_rate
  380.         else
  381.           sp_string = "SP回复量:"
  382.           sp_stat = item.recover_sp
  383.         end
  384.         @strings = [hp_string, sp_string, "物理防御:" , "仙法防御:", "命中率:", "分散度:"]
  385.         @stats = [hp_stat, sp_stat, item. pdef_f, item.mdef_f, item.hit, item.variance,
  386.                        $game_party.item_number(@result)]
  387.         @bitmap = RPG::Cache.icon(item.icon_name)
  388.       when 1
  389.         item = $data_armors[@result]
  390.         @strings = ["物理防御:", "仙法防御:", "回避修正:", "力量增加:", "灵巧增加:",
  391.                        "速度增加:", "仙攻增加:"]
  392.         @stats = [item.pdef, item.mdef, item.eva, item.str_plus, item.dex_plus,
  393.                     item.agi_plus, item.int_plus, $game_party.armor_number(@result) ]
  394.         @bitmap = RPG::Cache.icon(item.icon_name)
  395.       when 2
  396.         item = $data_weapons[@result]
  397.         @strings =["攻击力:", "物理防御:", "仙法防御:", "力量增加:", "灵巧增加:",
  398.                     "速度增加:", "仙攻增加:"]
  399.         @stats = [item.atk, item.pdef, item.mdef, item.str_plus, item.dex_plus,
  400.                     item.agi_plus, item.int_plus, $game_party.weapon_number(@result) ]
  401.         @bitmap = RPG::Cache.icon(item.icon_name)
  402.     end
  403.     for i in [email protected]
  404.       x = i%2 * 184
  405.       y = i /2 *28 +32
  406.       self.contents.font.color = normal_color
  407.       self.contents.draw_text(x,y,100, 28,@strings[i])
  408.       self.contents.font.color = system_color
  409.       self.contents.draw_text(x + 110, y, 45, 28, @stats[i].to_s)
  410.     end
  411.     self.contents.blt(0, 0, @bitmap, Rect.new(0, 0, 24, 24), 255)
  412.     self.contents.font.color= normal_color
  413.     self.contents.draw_text(40, 0, 300, 28, "待合成物品的现有数量:")
  414.     self.contents.font.color = system_color
  415.     count = @stats[@stats.size - 1].to_s
  416.     self.contents.draw_text(294, 0, 45, 28, count )
  417.   end
  418.    
  419. #----------------------------------------------------------------------
  420.   def set_result(result , type)
  421.     @result = result
  422.     @type = type
  423.     refresh
  424.   end

  425. end #of Window_CraftResult

  426. #=======================================
  427. class Window_CraftIngredients < Window_Base

  428.   #--------------------------------------------------------------------------
  429.   def initialize
  430.     super(240, 248 - 32 + 5, 400, 232 - 32 + 16 - 15)
  431.     self.contents = Bitmap.new(width - 32, height - 32)
  432.     self.contents.font.name = "黑体" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  433.     self.contents.font.size = 18 # = 20
  434.     @ingredients = []
  435.     @types = []
  436.     @quantities = []
  437.     @item = nil
  438.     @count = 0
  439.   end

  440.   #--------------------------------------------------------------------------
  441.   def refresh
  442.     self.contents.clear
  443.     for i in [email protected]
  444.       case @types[i]
  445.       when 0
  446.         @item = $data_items[@ingredients[i]]
  447.         @count = $game_party.item_number(@ingredients[i])
  448.       when 1
  449.         @item = $data_armors[@ingredients[i]]
  450.         @count = $game_party.armor_number(@ingredients[i])
  451.       when 2
  452.         @item = $data_weapons[@ingredients[i]]
  453.         @count = $game_party.weapon_number(@ingredients[i])
  454.       end
  455.       y = i *26
  456.       self.contents.blt(0, y, RPG::Cache.icon(@item.icon_name), Rect.new(0, 0, 24, 24), 255)
  457.       self.contents.font.color = @count >= @quantities[i] ? normal_color : disabled_color
  458.       self.contents.draw_text(30, y, 280, 28, @item.name)
  459.       self.contents.draw_text(300, y, 45, 28, @quantities[i].to_s)
  460.       self.contents.font.color = system_color
  461.       self.contents.draw_text(245, y, 45, 28, @count.to_s )     
  462.     end
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   def set_ingredients(ingredients , types, quantities)
  466.     @ingredients = ingredients
  467.     @types = types
  468.     @quantities = quantities
  469.     refresh
  470.   end

  471. end # of Window_CraftIngredients

  472. #======================================
  473. class Scene_Craft

  474.   #--------------------------------------------------------------------------
  475.   def initialize(craft_index=0)
  476.     @craft_index=craft_index
  477.   end
  478.   
  479.   #--------------------------------------------------------------------------
  480.   def main
  481.     @craft_window = Window_Craft.new
  482.     @craft_window.index=@craft_index
  483.     @confirm_window = Window_Base.new(120, 188, 400, 64)
  484.     @confirm_window.contents = Bitmap.new(368, 32)
  485.     @confirm_window.contents.font.name = "黑体"
  486.     @confirm_window.contents.font.size = 20
  487.     @help_window = Window_Help.new
  488.     @craft_window.help_window = @help_window
  489.     @result_window=Window_CraftResult.new
  490.     @ingredients_window=Window_CraftIngredients.new
  491.     @yes_no_window = Window_Command.new(100, ["确定", "放弃"])
  492.     @confirm_window.visible = false
  493.     @confirm_window.z = 1500
  494.     @yes_no_window.visible = false
  495.     @yes_no_window.active = false
  496.     @yes_no_window.index = 1
  497.     @yes_no_window.x = 270
  498.     @yes_no_window.y = 252
  499.     @yes_no_window.z = 1500
  500.     @label_window = Window_Base.new(450,200,190,52)
  501.     @label_window.contents=Bitmap.new(@label_window.width - 32,@label_window.height - 32)
  502.     @label_window.contents.font.size=20
  503.     @label_window.contents.font.color = @label_window.normal_color
  504.     @label_window.contents.font.name = "黑体"
  505.     @label_window.contents.draw_text(0, 0, @label_window.contents.width, 20, "  现有   需要")
  506.     Graphics.transition
  507.     loop do
  508.       Graphics.update
  509.       Input.update
  510.       update
  511.       if $scene != self
  512.         break
  513.       end
  514.     end
  515.     Graphics.freeze
  516.     @help_window.dispose
  517.     @craft_window.dispose
  518.     @result_window.dispose
  519.     @ingredients_window.dispose
  520.     @confirm_window.dispose
  521.     @yes_no_window.dispose
  522.     @label_window.dispose
  523.   end

  524.   #--------------------------------------------------------------------------
  525.   def update
  526.     @craft_window.update
  527.     @ingredients_window.update
  528.     if $game_party.recipes.size > 0
  529.       @result_window.set_result(@craft_window.recipe.result, @craft_window.recipe.result_type)
  530.       @ingredients_window.set_ingredients(@craft_window.recipe.ingredients,
  531.                                                            @craft_window.recipe.ingredient_types,
  532.                                                            @craft_window.recipe.quantities)
  533.     end
  534.     if @craft_window.active
  535.       update_craft
  536.       return
  537.     end
  538.     if @yes_no_window.active
  539.       confirm_update
  540.       return
  541.     end
  542.   end

  543.   #--------------------------------------------------------------------------
  544.   def update_craft
  545.     if Input.trigger?(Input::B)
  546.       $game_system.se_play($data_system.cancel_se)
  547.       $scene = Scene_Menu.new(3)
  548.       return
  549.     end
  550.     if Input.trigger?(Input::C) and $game_party.recipes.size != 0
  551.       @recipe = @craft_window.recipe
  552.       if @recipe.have
  553.         @yes_no_window.active = true
  554.         @craft_window.active = false
  555.       else
  556.         $game_system.se_play($data_system.buzzer_se)
  557.         return
  558.       end
  559.     end
  560.   end

  561.   #--------------------------------------------------------------------------
  562.   def confirm_update
  563.     @craft_index = @craft_window.index
  564.     @confirm_window.visible = true
  565.     @confirm_window.z = 1500
  566.     @yes_no_window.visible = true
  567.     @yes_no_window.active = true
  568.     @yes_no_window.z = 1500
  569.     @yes_no_window.update
  570.     string = "合成 " + @recipe.name + "?"
  571.     cw = @confirm_window.contents.text_size(string).width
  572.     center = @confirm_window.contents.width/2 - cw /2
  573.     unless @drawn
  574.       @confirm_window.contents.draw_text(center, 0, cw, 30, string)
  575.       @drawn = true
  576.     end
  577.     if Input.trigger?(Input::C)
  578.       if @yes_no_window.index == 0
  579.         $game_system.se_play($data_system.decision_se)
  580.         @recipe.make
  581.         $game_system.se_play($data_system.save_se)
  582.         $scene=Scene_Craft.new(@craft_index)
  583.       else
  584.         $game_system.se_play($data_system.cancel_se)
  585.         $scene=Scene_Craft.new(@craft_index)
  586.       end
  587.     end
  588.     if Input.trigger?(Input::B)
  589.       $game_system.se_play($data_system.cancel_se)
  590.       $scene=Scene_Craft.new(@craft_index)
  591.     end
  592.   end

  593. end # of Scene_Craft

  594. #==============================================================================
  595. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  596. #==============================================================================
复制代码


  1. 材料 = [1, 2]             # 需要材料的数据库编号
  2.     材料种类 = [0, 0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  3.     材料数量 = [2, 1]         # 需要材料的数量
  4.     成品 = 3                  # 获得物品编号
  5.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  6.     @recipe_list[1] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
复制代码

对照上图 明白了吧 id1的金疮药+id2的仙狐涎=id3的大粒丸
这个 材料种类 = [0, 0] 是说金疮药 和 仙狐涎 的种类

很详细了吧 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: 一岁    时间: 2008-7-28 20:06
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1