查看: 3099|回复: 3

[已经解决] 哪位同学有物品合成系统?

[复制链接]
梦石
0
星屑
75
在线时间
27 小时
注册时间
2014-7-19
回帖
87
发表于 2015-9-1 13:35:40 | 显示全部楼层 |阅读模式

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

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

×
我需要不带负重系统的,谁有可以发给我吗?谢谢。

素材区好人

梦石
5
星屑
12712
在线时间
4359 小时
注册时间
2011-7-21
回帖
2270

超评测参与极短28参与极短27参与极短26参与极短25参与极短24参与极短23参与极短22参与极短21参与

发表于 2015-9-1 18:00:18 | 显示全部楼层
这个?
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. # 欢迎访问[url]www.66RPG.com[/url]
  4. # 梦想世界,在你手中
  5. #==============================================================================  
  6. #
  7. # Sample master list for crafting script (物品分类增强版) v1.1
  8. # written by Deke
  9. # 增强:叶子
  10. #
  11. # 12-30-2005 v1.0
  12. # 8-17-2006 v1.1
  13. # 修正了返回界面时不显示成品的BUG
  14. # 修正了材料大于8个不显示的BUG
  15. # 描绘物品美化
  16. # 自动检测能否合成
  17. #============================================================================================
  18. # 简介:
  19. # 这是一个很不错的合成物品系统,可以通过游戏的过程,不断学习可以合成的
  20. # 物品方法。
  21. # ------
  22. # 增强版补充说明:
  23. # 在这个增强版中,可以对成品进行手动分类。
  24. # 成品增加了一个分类属性。
  25. # 这个分类纯粹是按自己的意愿,没有规定第几类必须是什么。
  26. # 召唤特定分类的界面,就只会看到特定分类的成品。
  27. #
  28. # 例如:
  29. # 使用脚本$scene = Scene_Craft.new(1),
  30. # 出来的界面就只会显示成品分类为1的东西
  31. # 同样道理,使用脚本$scene = Scene_Craft.new(2),
  32. # 出来的界面就只会显示成品分类为2的东西
  33. #
  34. # 如果使用脚本$scene = Scene_Craft.new或$scene = Scene_Craft.new(0)来召唤界面
  35. # 就可以看到所有成品。
  36. #
  37. # 注意:不要弄混淆“成品种类”和“成品分类”
  38. # 成品种类是指成品是普通物品(0),防具(1)或武器(2)
  39. # 成品分类是指此物品的自定义分类
  40. #
  41. #
  42. # 使用方法:
  43. # 1、召唤界面:使用脚本$scene = Scene_Craft.new(分类的数字)
  44. # 例如:使用脚本$scene = Scene_Craft.new(1),出来分类1的界面
  45. #
  46. # 2、学习合成:$game_party.learn_recipe(合成项目)
  47. #
  48. #  2.1、其实这个脚本可以使同一成品有不同配方
  49. #
  50. #    就这样说可能解释得不清楚,先来解释一下脚本学习配方的原理:
  51. #    $game_party.learn_recipe(合成项目)的处理过程并不是直接学习这个配方,
  52. #    而是在配方库中找到和合成项目成品相同的配方。
  53. #
  54. #    如果配方库中有两个配方成品相同的话,配方版本就变得重要。
  55. #    $game_party.learn_recipe(合成项目,配方版本)
  56. #    配方版本为1的话,学到的配方就是@recipe_list[xx]中与合成项目成品相同且数字最小的配方
  57. #    配方版本为2的话,学到的配方就是数字第二小的配方
  58. #    在上面这个脚本语句中,不填配方版本的话就默认为1
  59. #
  60. #  2.2、忘记配方:$game_party.forget_recipe(合成项目)
  61. #   2.21、同样道理,这个语句也可以写配方版本
  62. #    $game_party.forget_recipe(合成项目,配方版本)
  63. #    配方版本定义见2.1
  64. #
  65. #  2.3、配方版本不能乱填!例如游戏中某一个配方的成品是唯一的,与所有其它配方的成品都不相同
  66. #   那么学习的时候就不用填配方版本。
  67. #   如果这时在配方版本填了2的话,就有可能学不到或者忘不了(-_-||)
  68. #   
  69. #
  70. # 3、合成定义:
  71. # 这个合成脚本可以定义两种合成物品。一种是预先定义好了的,就像下面这样,
  72. # 直接写在这里就可以,另一种是在学习之前现场定义。
  73. #
  74. # 4、举例
  75. #  4.1、学会recipe_list[1]定义的合成:$game_party.learn_recipe($game_temp.recipe_list[1])
  76. #       注意,一行如果输入不下,在(的后面或[的后面按回车换行,否则可能出错
  77. #
  78. #  4.2、在游戏中临时定义一种合成,让玩家学会。使用事件中的脚本如下,   
  79. #  脚本:
  80. #    材料 = [$game_variables[1],$game_variables[2]]  #——材料编号是变量1、2的编号
  81. #    材料种类 = [0,0]                                #——材料是物品
  82. #    材料数量 = [$game_variables[3],$game_variables[4]]  #——需要材料数量是变量3、4的编号
  83. #    成品 = $game_variables[5]                       #——获得结果编号是5
  84. #    成品种类 = 1                                    #——成品是防具类
  85. #    成品分类 = 1                                    #——这一项不写的话默认为0
  86. #    $game_party.learn_recipe(Game_Recipe.new(材料,材料种类,材料数量,成品,成品种类,成品分类))
  87. #    上面这条语句的成品分类这一项不写也行,这样它就默认为0了。
  88. #    (也就是此物品没有分类,不会在分类菜单中出现)
  89. #    省略成品分类的脚本语句可以像下面这样写:
  90. #    $game_party.learn_recipe(Game_Recipe.new(材料,材料种类,材料数量,成品,成品种类))
  91. #
  92. #===========================================================================================
  93. class Game_Temp
  94.   attr_reader :recipe_list  
  95.   alias crafting_temp_initialize initialize
  96.   def initialize
  97.     crafting_temp_initialize
  98.     @recipe_list=[]
  99.     get_recipe_list
  100.   end  
  101.   def get_recipe_list   
  102.     ###########################################################################
  103.     # 19 号合成物品设定 (低级矿石×3= 中级矿石) 成品分类:1
  104.     ##########################################################################
  105.     材料 = [30]             # 需要材料的数据库编号
  106.     材料种类 = [0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  107.     材料数量 = [5]         # 需要材料的数量
  108.     成品 = 31                  # 获得物品编号
  109.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  110.     成品分类 = 1              # 获得成品分类
  111.     @recipe_list[1] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  112.         
  113.   end # of get_recipe_list method
  114. end # of updates to Game_Temp Class

  115. #================================
  116. # CRAFTING PROGRAM
  117. #----------------------------------------------------------------
  118. #-written by Deke
  119. #-yes_no window code created by Phsylomortis
  120. #----------------------------------------------------------------
  121. #================================

  122. #updates to Game_Party class

  123. class Game_Party
  124.   
  125.   attr_accessor       :recipes
  126.   
  127.   alias crafting_party_initialize initialize
  128.   
  129.   def initialize
  130.     crafting_party_initialize
  131.     @recipes=[]
  132.   end
  133.   
  134.   #----------------------------------------------------------------------
  135.   def know?(recipe, version = 1)
  136.     unless recipe.is_a?(Game_Recipe)
  137.       recipe = get_recipe_from_master_list(recipe, version)
  138.     end
  139.     return $game_party.recipes.include?(recipe)
  140.   end
  141.   
  142. #----------------------------------------------------------------------
  143.   def learn_recipe(recipe , version = 1)
  144.     unless recipe.is_a?(Game_Recipe)
  145.       recipe = get_recipe_from_master_list(recipe, version)
  146.     end
  147.     if recipe.is_a?(Game_Recipe)
  148.       unless know?(recipe)
  149.         @recipes.push(recipe)
  150.       end
  151.     end
  152.   end
  153.   
  154. #----------------------------------------------------------------------
  155.   def forget_recipe(recipe , version = 1)
  156.     if !recipe.is_a?(Game_Recipe)
  157.       recipe = get_recipe_from_master_list(recipe, version)
  158.     end
  159.     if recipe.is_a?(Game_Recipe)
  160.       for i in [email]0...@recipes.size[/email]
  161.         if recipe == @recipes[i]
  162.           index = i
  163.           break
  164.         end
  165.       end
  166.       if index != nil
  167.         @recipes.delete(@recipes[index])
  168.       end
  169.     end
  170.   end
  171.   
  172. #----------------------------------------------------------------------
  173.   def get_recipe_from_master_list(item, version)
  174.     index = nil
  175.     for i in 0...$game_temp.recipe_list.size
  176.       if item[0] == $game_temp.recipe_list[i].result and item[1] ==$game_temp.recipe_list[i].result_type
  177.         version -= 1
  178.         if version == 0
  179.           index = i
  180.           break
  181.         end
  182.       end
  183.     end
  184.     if index.is_a?(Integer)
  185.       return ($game_temp.recipe_list[index])
  186.     else
  187.       return false
  188.     end
  189.   end
  190.   
  191. end # of Game_Party updates

  192. #================================
  193. class Game_Recipe

  194.   attr_reader :ingredients
  195.   attr_reader :quantities
  196.   attr_reader :result
  197.   attr_reader :result_type
  198.   attr_reader :ingredient_types
  199.   attr_reader :craft_type  #物品分类
  200.   
  201. #----------------------------------------------------------------------
  202.   def initialize( ingredients, ingredient_types, quantities, result, result_type, craft_type=0)
  203.     @ingredients = ingredients
  204.     @ingredient_types = ingredient_types
  205.     @quantities = quantities
  206.     @result = result
  207.     @result_type = result_type
  208.     @craft_type = craft_type
  209.   end
  210.   
  211. #----------------------------------------------------------------------
  212.   def name
  213.     case @result_type
  214.       when 0
  215.         name = $data_items[@result].name
  216.       when 1
  217.         name = $data_armors[@result].name
  218.       when 2
  219.         name = $data_weapons[@result].name
  220.     end
  221.     return name
  222.   end
  223.   
  224. #----------------------------------------------------------------------

  225.   def item
  226.     case @result_type
  227.       when 0
  228.         item = $data_items[@result]
  229.       when 1
  230.         item = $data_armors[@result]
  231.       when 2
  232.         item = $data_weapons[@result]
  233.     end
  234.     return item
  235.   end

  236. #----------------------------------------------------------------------
  237.   def have
  238.     have_all = true
  239.     for i in [email]0...@ingredients.size[/email]
  240.       case @ingredient_types[i]
  241.         when 0
  242.           if $game_party.item_number(@ingredients[i]) < @quantities[i]
  243.             have_all=false
  244.           end
  245.         when 1
  246.           if $game_party.armor_number(@ingredients[i]) < @quantities[i]
  247.             have_all=false
  248.           end
  249.         when 2
  250.           if $game_party.weapon_number(@ingredients[i]) < @quantities[i]
  251.             have_all=false
  252.           end
  253.       end
  254.     end
  255.     return have_all
  256.   end

  257. #----------------------------------------------------------------------
  258.   def decrement
  259.     for i in [email]0...@ingredients.size[/email]
  260.       case @ingredient_types[i]
  261.       when 0
  262.         $game_party.lose_item(@ingredients[i], @quantities[i])
  263.       when 1
  264.         $game_party.lose_armor(@ingredients[i], @quantities[i])
  265.       when 2
  266.         $game_party.lose_weapon(@ingredients[i], @quantities[i])
  267.       end
  268.     end
  269.   end

  270. #----------------------------------------------------------------------
  271.   def make
  272.     if have
  273.       case @result_type
  274.       when 0
  275.         $game_party.gain_item(@result, 1)
  276.       when 1
  277.         $game_party.gain_armor(@result, 1)
  278.       when 2
  279.         $game_party.gain_weapon(@result, 1)
  280.       end
  281.       decrement
  282.     end
  283.   end
  284.   
  285. #----------------------------------------------------------------------
  286.   def == (recipe)
  287.     if recipe.is_a?(Game_Recipe)
  288.       equal = true
  289.       if recipe.ingredients != self.ingredients
  290.         equal = false
  291.       end
  292.       if recipe.ingredient_types != self.ingredient_types
  293.         equal = false
  294.       end
  295.       if recipe.quantities != self.quantities
  296.         equal = false
  297.       end
  298.       if recipe.result != self.result
  299.         equal=false
  300.       end
  301.       if recipe.result_type != self.result_type
  302.         equal = false
  303.       end
  304.     else
  305.       equal = false
  306.     end
  307.     return equal
  308.   end
  309.   
  310. end # of Game_Recipe class

  311. #===================================

  312. class Window_Craft < Window_Selectable
  313.   attr_reader :data #声明数据
  314.   #--------------------------------------------------------------------------
  315.   def initialize(craft_type=0)
  316.     @craft_type = craft_type
  317.     super(0, 64, 240, 416)
  318.     @column_max = 1
  319.     refresh
  320.     self.index = 0
  321.   end

  322.   #--------------------------------------------------------------------------
  323.   def recipe
  324.     return @data[self.index]
  325.   end

  326.   #--------------------------------------------------------------------------
  327.   def refresh
  328.     if self.contents != nil
  329.       self.contents.dispose
  330.       self.contents = nil
  331.     end
  332.     @data = []
  333.     for i in 0...$game_party.recipes.size
  334.        #@craft_type为0时就显示全部物品
  335.        #不为0时就显示对应物品
  336.       if @craft_type == 0
  337.         @data.push($game_party.recipes[i])
  338.       elsif $game_party.recipes[i].craft_type == @craft_type
  339.         @data.push($game_party.recipes[i])
  340.       end
  341.     end
  342.     @item_max = @data.size
  343.     if @item_max > 0
  344.       self.contents = Bitmap.new(width - 32, row_max * 32)
  345.       self.contents.font.name = "黑体" # = "黑体"
  346.       self.contents.font.size = 18 # = 18
  347.       for i in 0...@item_max
  348.         x = 16
  349.         y = i * 32
  350.         able = true
  351.         for ingredient in 0...@data[i].ingredients.size
  352.           case @data[i].ingredient_types[ingredient]
  353.           when 0
  354.             count = $game_party.item_number(@data[i].ingredients[ingredient])
  355.           when 1
  356.             count = $game_party.armor_number(@data[i].ingredients[ingredient])
  357.           when 2
  358.             count = $game_party.weapon_number(@data[i].ingredients[ingredient])
  359.           end
  360.           if count < @data[i].quantities[ingredient]
  361.             able = false
  362.             break
  363.           end
  364.         end
  365.         draw_item_name(@data[i].item, x, y, able)
  366.       end
  367.     end
  368.   end

  369.   #--------------------------------------------------------------------------
  370.   #def draw_item(index)
  371.   #  recipe = @data[index]
  372.   #  self.contents.font.color = recipe.have ? normal_color : disabled_color
  373.   #  x = 16
  374.   #  y = index * 32
  375.   #  self.contents.draw_text(x , y, self.width-32, 32, recipe.name, 0)
  376.   #end
  377.   
  378.   #--------------------------------------------------------------------------
  379.   # ● 描绘物品名
  380.   #     item : 物品
  381.   #     x    : 描画目标 X 坐标
  382.   #     y    : 描画目标 Y 坐标
  383.   #--------------------------------------------------------------------------
  384.   def draw_item_name(item, x, y, able = true)
  385.     if item == nil
  386.       return
  387.     end
  388.     if !able
  389.       self.contents.font.color = disabled_color
  390.     end
  391.     bitmap = RPG::Cache.icon(item.icon_name)
  392.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  393.     self.contents.draw_text(x + 28, y, 212, 32, item.name)
  394.     self.contents.font.color = normal_color
  395.   end
  396.   
  397.   #--------------------------------------------------------------------------
  398.   def update_help
  399.     current_recipe = recipe
  400.     if current_recipe.is_a?(Game_Recipe)
  401.     case current_recipe.result_type
  402.       when 0
  403.         description = $data_items[current_recipe.result].description
  404.       when 1
  405.         description = $data_armors[current_recipe.result].description
  406.       when 2
  407.         description = $data_weapons[current_recipe.result].description
  408.       end
  409.     else
  410.       description = ""
  411.     end
  412.     @help_window.set_text(description)
  413.     @help_window.update
  414.   end
  415.   
  416. end # of Window_Craft

  417. #=======================================
  418. class Window_CraftResult < Window_Base

  419.   #--------------------------------------------------------------------------
  420.   def initialize
  421.     super(240, 64, 400, 184)
  422.     self.contents = Bitmap.new(width - 32, height - 32)
  423.     self.contents.font.name = "黑体" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  424.     self.contents.font.size = 18 # = 20
  425.     @result = nil
  426.     @type = nil
  427.   end

  428.   #--------------------------------------------------------------------------
  429.   def refresh
  430.     self.contents.clear
  431.     case @type
  432.       when 0
  433.         item = $data_items[@result]
  434.         if item.recover_hp_rate > item.recover_hp
  435.           hp_string = "HP回复率:"
  436.           hp_stat = item.recover_hp_rate
  437.         else
  438.           hp_string = "HP回复量:"
  439.           hp_stat = item.recover_hp
  440.         end
  441.         if item.recover_sp_rate > item.recover_sp
  442.           sp_string = "SP回复率:"
  443.           sp_stat = item.recover_sp_rate
  444.         else
  445.           sp_string = "SP回复量:"
  446.           sp_stat = item.recover_sp
  447.         end
  448.         @strings = [hp_string, sp_string, "物理防御:" , "魔法防御:", "命中率:", "分散度:"]
  449.         @stats = [hp_stat, sp_stat, item. pdef_f, item.mdef_f, item.hit, item.variance,
  450.                        $game_party.item_number(@result)]
  451.         @bitmap = RPG::Cache.icon(item.icon_name)
  452.       when 1
  453.         item = $data_armors[@result]
  454.         @strings = ["物理防御:", "魔法防御:", "回避修正:", "力量增加:", "灵巧增加:",
  455.                        "速度增加:", "魔力增加:"]
  456.         @stats = [item.pdef, item.mdef, item.eva, item.str_plus, item.dex_plus,
  457.                     item.agi_plus, item.int_plus, $game_party.armor_number(@result) ]
  458.         @bitmap = RPG::Cache.icon(item.icon_name)
  459.       when 2
  460.         item = $data_weapons[@result]
  461.         @strings =["攻击力:", "物理防御:", "魔法防御:", "力量增加:", "灵巧增加:",
  462.                     "速度增加:", "魔力增加:"]
  463.         @stats = [item.atk, item.pdef, item.mdef, item.str_plus, item.dex_plus,
  464.                     item.agi_plus, item.int_plus, $game_party.weapon_number(@result) ]
  465.         @bitmap = RPG::Cache.icon(item.icon_name)
  466.     end
  467.     for i in [email]0...@strings.size[/email]
  468.       x = i%2 * 184
  469.       y = i /2 *28 +32
  470.       self.contents.font.color = normal_color
  471.       self.contents.draw_text(x,y,100, 28,@strings[i])
  472.       self.contents.font.color = system_color
  473.       self.contents.draw_text(x + 110, y, 45, 28, @stats[i].to_s)
  474.     end
  475.     self.contents.blt(0, 0, @bitmap, Rect.new(0, 0, 24, 24), 255)
  476.     self.contents.font.color= normal_color
  477.     self.contents.draw_text(40, 0, 300, 28, "待合成物品的现有数量:")
  478.     self.contents.font.color = system_color
  479.     count = @stats[@stats.size - 1].to_s
  480.     self.contents.draw_text(294, 0, 45, 28, count )
  481.   end
  482.    
  483. #----------------------------------------------------------------------
  484.   def set_result(result , type)
  485.     @result = result
  486.     @type = type
  487.     refresh
  488.   end

  489. end #of Window_CraftResult

  490. #=======================================
  491. class Window_CraftIngredients < Window_Base

  492.   #--------------------------------------------------------------------------
  493.   def initialize
  494.     super(240, 248, 400, 232)
  495.     self.contents = Bitmap.new(width - 32, height - 32)
  496.     self.contents.font.name = "黑体" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  497.     self.contents.font.size = 18 # = 20
  498.     @ingredients = []
  499.     @types = []
  500.     @quantities = []
  501.     @item = nil
  502.     @count = 0
  503.     @counter = 0
  504.     @real_oy = 0
  505.   end

  506.   #--------------------------------------------------------------------------
  507.   def refresh
  508.     @counter = 0
  509.     self.contents.clear
  510.     self.contents = Bitmap.new(width - 32, @ingredients.size * 26)
  511.     for i in [email]0...@ingredients.size[/email]
  512.       case @types[i]
  513.       when 0
  514.         @item = $data_items[@ingredients[i]]
  515.         @count = $game_party.item_number(@ingredients[i])
  516.       when 1
  517.         @item = $data_armors[@ingredients[i]]
  518.         @count = $game_party.armor_number(@ingredients[i])
  519.       when 2
  520.         @item = $data_weapons[@ingredients[i]]
  521.         @count = $game_party.weapon_number(@ingredients[i])
  522.       end
  523.       y = i *26
  524.       self.contents.blt(0, y, RPG::Cache.icon(@item.icon_name), Rect.new(0, 0, 24, 24), 255)
  525.       self.contents.font.color = @count >= @quantities[i] ? normal_color : disabled_color
  526.       self.contents.draw_text(30, y, 280, 28, @item.name)
  527.       self.contents.draw_text(300, y, 45, 28, @quantities[i].to_s)
  528.       self.contents.font.color = system_color
  529.       self.contents.draw_text(245, y, 45, 28, @count.to_s )     
  530.     end
  531.   end
  532.       
  533.   #--------------------------------------------------------------------------
  534.   def set_ingredients(ingredients , types, quantities)
  535.     @ingredients = ingredients
  536.     @types = types
  537.     @quantities = quantities
  538.     refresh
  539.     if @ingredients.size > 7
  540.       self.oy = -52
  541.       @real_oy = 0
  542.     else
  543.       self.oy = 0
  544.     end
  545.   end

  546.   def update
  547.     super
  548.     @counter += 1
  549.     if @ingredients.size > 7 and @counter > 30
  550.       @real_oy = (@real_oy + 1) % ((@ingredients.size - 3) * 26)
  551.       self.oy = @real_oy - 52
  552.     end
  553.   end
  554.    
  555. end # of Window_CraftIngredients

  556. #======================================
  557. class Scene_Craft

  558.   #--------------------------------------------------------------------------
  559.   # @craft_type:物品种类,0就是全部
  560.   def initialize(craft_type=0,craft_index=0)
  561.     @craft_index=craft_index
  562.     @craft_type = craft_type
  563.   end
  564.   
  565.   #--------------------------------------------------------------------------
  566.   def main
  567.     @craft_window = Window_Craft.new(@craft_type)
  568.     @craft_window.index=@craft_index
  569.     @confirm_window = Window_Base.new(120, 188, 400, 64)
  570.     @confirm_window.contents = Bitmap.new(368, 32)
  571.     @confirm_window.contents.font.name = "黑体"
  572.     @confirm_window.contents.font.size = 20
  573.     @help_window = Window_Help.new
  574.     @craft_window.help_window = @help_window
  575.     @result_window=Window_CraftResult.new
  576.     @ingredients_window=Window_CraftIngredients.new
  577.     if @craft_window.data.size > 0 #本类窗口物品大于0的话
  578.       @result_window.set_result(@craft_window.recipe.result, @craft_window.recipe.result_type)
  579.       @ingredients_window.set_ingredients(@craft_window.recipe.ingredients,
  580.                                                           @craft_window.recipe.ingredient_types,
  581.                                                           @craft_window.recipe.quantities)
  582.     end
  583.     @yes_no_window = Window_Command.new(100, ["确定", "放弃"])
  584.     @confirm_window.visible = false
  585.     @confirm_window.z = 1500
  586.     @yes_no_window.visible = false
  587.     @yes_no_window.active = false
  588.     @yes_no_window.index = 1
  589.     @yes_no_window.x = 270
  590.     @yes_no_window.y = 252
  591.     @yes_no_window.z = 1500
  592.     @label_window = Window_Base.new(450,200,190,52)
  593.     @label_window.contents=Bitmap.new(@label_window.width - 32,@label_window.height - 32)
  594.     @label_window.contents.font.size=20
  595.     @label_window.contents.font.color = @label_window.normal_color
  596.     @label_window.contents.font.name = "黑体"
  597.     @label_window.contents.draw_text(0, 0, @label_window.contents.width, 20, "  现有   需要")
  598.     Graphics.transition
  599.     loop do
  600.       Graphics.update
  601.       Input.update
  602.       update
  603.       if $scene != self
  604.         break
  605.       end
  606.     end
  607.     Graphics.freeze
  608.     @help_window.dispose
  609.     @craft_window.dispose
  610.     @result_window.dispose
  611.     @ingredients_window.dispose
  612.     @confirm_window.dispose
  613.     @yes_no_window.dispose
  614.     @label_window.dispose
  615.   end

  616.   #--------------------------------------------------------------------------
  617.   def update
  618.     @craft_window.update
  619.     @ingredients_window.update
  620.     if @craft_window.active
  621.       update_craft
  622.       return
  623.     end
  624.     if @yes_no_window.active
  625.       confirm_update
  626.       return
  627.     end
  628.   end

  629.   #--------------------------------------------------------------------------
  630.   def update_craft
  631.     if Input.dir4 != 0
  632.       if @craft_window.data.size > 0 #本类窗口物品大于0的话
  633.         @result_window.set_result(@craft_window.recipe.result, @craft_window.recipe.result_type)
  634.         @ingredients_window.set_ingredients(@craft_window.recipe.ingredients,
  635.                                                            @craft_window.recipe.ingredient_types,
  636.                                                            @craft_window.recipe.quantities)
  637.       end
  638.     end
  639.     if Input.trigger?(Input::B)
  640.       $game_system.se_play($data_system.cancel_se)
  641.       $scene = Scene_Map.new
  642.       return
  643.     end
  644.     if Input.trigger?(Input::C) and $game_party.recipes.size != 0
  645.       @recipe = @craft_window.recipe
  646.       if @recipe != nil
  647.         if @recipe.have
  648.           @yes_no_window.active = true
  649.           @craft_window.active = false
  650.         else
  651.           $game_system.se_play($data_system.buzzer_se)
  652.           return
  653.         end
  654.       else
  655.         $game_system.se_play($data_system.buzzer_se)
  656.         return
  657.       end
  658.     end
  659.   end

  660.   #--------------------------------------------------------------------------
  661.   def confirm_update
  662.     @craft_index = @craft_window.index
  663.     @confirm_window.visible = true
  664.     @confirm_window.z = 1500
  665.     @yes_no_window.visible = true
  666.     @yes_no_window.active = true
  667.     @yes_no_window.z = 1500
  668.     @yes_no_window.update
  669.     string = "合成 " + @recipe.name + "?"
  670.     cw = @confirm_window.contents.text_size(string).width
  671.     center = @confirm_window.contents.width/2 - cw /2
  672.     unless @drawn
  673.       @confirm_window.contents.draw_text(center, 0, cw, 30, string)
  674.       @drawn = true
  675.     end
  676.     if Input.trigger?(Input::C)
  677.       if @yes_no_window.index == 0
  678.         $game_system.se_play($data_system.decision_se)
  679.         @recipe.make
  680.         $game_system.se_play($data_system.save_se)
  681.         $scene=Scene_Craft.new(@craft_type,@craft_index)
  682.       else
  683.         $game_system.se_play($data_system.cancel_se)
  684.         $scene=Scene_Craft.new(@craft_type,@craft_index)
  685.       end
  686.     end
  687.     if Input.trigger?(Input::B)
  688.       $game_system.se_play($data_system.cancel_se)
  689.       $scene=Scene_Craft.new(@craft_type,@craft_index)
  690.     end
  691.   end

  692. end # of Scene_Craft

  693. #==============================================================================
  694. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  695. # 欢迎访问[url]www.66RPG.com[/url]
  696. # 梦想世界,在你手中
  697. #==============================================================================
复制代码

评分

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

查看全部评分

回复

使用道具 举报

梦石
0
星屑
75
在线时间
27 小时
注册时间
2014-7-19
回帖
87
 楼主| 发表于 2015-9-2 06:47:03 来自手机 | 显示全部楼层
无忧谷主幻 发表于 2015-9-1 18:00
这个?
#==============================================================================
# 本脚本来自w ...

谢谢@︶ㄣ牛排ぶ 满意回答
回复

使用道具 举报

梦石
0
星屑
674
在线时间
109 小时
注册时间
2015-9-4
回帖
35
发表于 2017-7-11 12:10:47 | 显示全部楼层
无忧谷主幻 发表于 2015-9-1 18:00
这个?
#==============================================================================
# 本脚本来自w ...

有参考范烈吗 谢谢
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部