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

Project1

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

[已经解决] 简易合成脚本怎么添加合成成功几率

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-5-7
帖子
9
跳转到指定楼层
1
发表于 2014-7-27 11:42:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
脚本是Sample master list for crafting script,我已在公共事件内编写完成功率的调控,该怎么插入到脚本中?插在哪里?
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================  

  4. # Sample master list for crafting script
  5. # written by Deke
  6. #============================================================================================
  7. # 简介:
  8. # 这是一个很不错的合成物品系统,可以通过游戏的过程,不断学习可以合成的
  9. # 物品方法。
  10. #
  11. # 使用方法:
  12. # 1、召唤界面:使用脚本$scene = Scene_Craft.new
  13. #
  14. # 2、学习合成:$game_party.learn_recipe(合成项目)
  15. #
  16. # 3、合成定义:
  17. # 这个合成脚本可以定义两种合成物品。一种是预先定义好了的,就像下面这样,
  18. # 直接写在这里就可以,另一种是在学习之前现场定义。
  19. #
  20. # 4、举例
  21. #  4.1、学会recipe_list[1]定义的合成:$game_party.learn_recipe($game_temp.recipe_list[1])
  22. #       注意,一行如果输入不下,在(的后面或[的后面按回车换行,否则可能出错
  23. #
  24. #  4.2、在游戏中临时定义一种合成,让玩家学会。使用事件中的脚本如下,   
  25. #  脚本:
  26. #    材料 = [$game_variables[1],$game_variables[2]]  #——材料编号是变量1、2的编号
  27. #    材料种类 = [0,0]                                #——材料是物品
  28. #    材料数量 = [$game_variables[3],$game_variables[4]]  #——需要材料数量是变量3、4的编号
  29. #    成品 = $game_variables[5]                       #——获得结果编号是5
  30. #    成品种类 = 1                                    #——成品是防具类
  31. #    $game_party.learn_recipe(Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类))
  32. #===========================================================================================
  33. class Game_Temp
  34.   attr_reader :recipe_list  
  35.   alias crafting_temp_initialize initialize
  36.   def initialize
  37.     crafting_temp_initialize
  38.     @recipe_list=[]
  39.     get_recipe_list
  40.   end  
  41.   def get_recipe_list   
  42.     ##########################################################################
  43.     # 0 号合成物品设定 (物品小药水×2 + 中药水 = 大药水)
  44.     ##########################################################################
  45.     材料 = [1, 2]             # 需要材料的数据库编号
  46.     材料种类 = [0, 0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  47.     材料数量 = [2, 1]         # 需要材料的数量
  48.     成品 = 3                  # 获得物品编号
  49.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  50.     @recipe_list[1] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
  51.    
  52.     ##########################################################################
  53.     # 1 号合成物品设定 (武器铜剑、铁剑、钢剑各1 = 密切斯特剑)
  54.     ##########################################################################
  55.     材料 = [1, 2, 3]          # 需要材料的数据库编号
  56.     材料种类 = [2, 2, 2]      # 需要材料的种类,0是普通物品,1是防具,2是武器
  57.     材料数量 = [3, 2, 1]      # 需要材料的数量
  58.     成品 = 4                  # 获得物品编号
  59.     成品种类 = 2              # 获得物品种类,0是普通物品,1是防具,2是武器
  60.     @recipe_list[2] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
  61.    
  62.     ##########################################################################
  63.     # 2 号合成物品设定 (物品力量之石×2 + 防具钢盾×1 = 密切斯特盾)
  64.     ##########################################################################
  65.     材料 = [13, 3]            # 需要材料的数据库编号
  66.     材料种类 = [0, 1]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  67.     材料数量 = [2, 1]         # 需要材料的数量
  68.     成品 = 4                  # 获得物品编号
  69.     成品种类 = 1              # 获得物品种类,0是普通物品,1是防具,2是武器
  70.     @recipe_list[3] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
  71.    
  72.     ##########################################################################
  73.     # 3 号合成物品设定 (厚·巫毒卡片×10 + 防具钢盾×1 = 巫毒卡片盾)
  74.     ##########################################################################
  75.     材料 = [33, 34]            # 需要材料的数据库编号
  76.     材料种类 = [0, 1]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  77.     材料数量 = [10, 1]         # 需要材料的数量
  78.     成品 = 34                  # 获得物品编号
  79.     成品种类 = 1              # 获得物品种类,0是普通物品,1是防具,2是武器
  80.     @recipe_list[4] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
  81.    
  82.     ##########################################################################
  83.     # 4 号合成物品设定 (伪·氢氧化钠 aq×3 + 真·氢氧化钠 aq×1 = 极氢氧化钠aq)
  84.     ##########################################################################
  85.     材料 = [1, 2]            # 需要材料的数据库编号
  86.     材料种类 = [0, 0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  87.     材料数量 = [3, 1]         # 需要材料的数量
  88.     成品 = 3                  # 获得物品编号
  89.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  90.     @recipe_list[5] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
  91.     ##########################################################################
  92.     # 5 号合成物品设定 (伪·氢氧化钠 aq×3 + 真·氢氧化钠 aq×1 = 极氢氧化钠aq)
  93.     ##########################################################################
  94.     材料 = [4, 5]            # 需要材料的数据库编号
  95.     材料种类 = [0, 0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  96.     材料数量 = [3, 1]         # 需要材料的数量
  97.     成品 = 6                  # 获得物品编号
  98.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  99.     @recipe_list[6] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
  100.   end # of get_recipe_list method
  101. end # of updates to Game_Temp Class

  102. #================================
  103. # CRAFTING PROGRAM
  104. #----------------------------------------------------------------
  105. #-written by Deke
  106. #-yes_no window code created by Phsylomortis
  107. #----------------------------------------------------------------
  108. #================================

  109. #updates to Game_Party class

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

  179. #================================
  180. class Game_Recipe

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

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

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

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

  283. #===================================

  284. class Window_Craft < Window_Selectable

  285.   #--------------------------------------------------------------------------
  286.   def initialize
  287.     super(0, 64, 240, 416)
  288.     @column_max = 1
  289.     refresh
  290.     self.index = 0
  291.   end

  292.   #--------------------------------------------------------------------------
  293.   def recipe
  294.     return @data[self.index]
  295.   end

  296.   #--------------------------------------------------------------------------
  297.   def refresh
  298.     if self.contents != nil
  299.       self.contents.dispose
  300.       self.contents = nil
  301.     end
  302.     @data = []
  303.     for i in 0...$game_party.recipes.size
  304.         @data.push($game_party.recipes[i])
  305.     end
  306.     @item_max = @data.size
  307.     if @item_max > 0
  308.       self.contents = Bitmap.new(width - 32, row_max * 32)
  309.       self.contents.font.name = "黑体" # = "黑体"
  310.       self.contents.font.size = 18 # = 18
  311.       for i in 0...@item_max
  312.         draw_item(i)
  313.       end
  314.     end
  315.   end

  316.   #--------------------------------------------------------------------------
  317.   def draw_item(index)
  318.     recipe = @data[index]
  319.     self.contents.font.color = recipe.have ? normal_color : disabled_color
  320.     x = 16
  321.     y = index * 32
  322.     self.contents.draw_text(x , y, self.width-32, 32, recipe.name, 0)
  323.   end

  324.   #--------------------------------------------------------------------------
  325.   def update_help
  326.     current_recipe = recipe
  327.     if current_recipe.is_a?(Game_Recipe)
  328.     case current_recipe.result_type
  329.       when 0
  330.         description = $data_items[current_recipe.result].description
  331.       when 1
  332.         description = $data_armors[current_recipe.result].description
  333.       when 2
  334.         description = $data_weapons[current_recipe.result].description
  335.       end
  336.     else
  337.       description = ""
  338.     end
  339.     @help_window.set_text(description)
  340.     @help_window.update
  341.   end
  342.   
  343. end # of Window_Craft

  344. #=======================================
  345. class Window_CraftResult < Window_Base

  346.   #--------------------------------------------------------------------------
  347.   def initialize
  348.     super(240, 64, 400, 184)
  349.     self.contents = Bitmap.new(width - 32, height - 32)
  350.     self.contents.font.name = "黑体" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  351.     self.contents.font.size = 18 # = 20
  352.     @result = nil
  353.     @type = nil
  354.   end

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

  416. end #of Window_CraftResult

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

  419.   #--------------------------------------------------------------------------
  420.   def initialize
  421.     super(240, 248, 400, 232)
  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.     @ingredients = []
  426.     @types = []
  427.     @quantities = []
  428.     @item = nil
  429.     @count = 0
  430.   end

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

  463. end # of Window_CraftIngredients

  464. #======================================
  465. class Scene_Craft

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

  516.   #--------------------------------------------------------------------------
  517.   def update
  518.     @craft_window.update
  519.     @ingredients_window.update
  520.     if $game_party.recipes.size > 0
  521.       @result_window.set_result(@craft_window.recipe.result, @craft_window.recipe.result_type)
  522.       @ingredients_window.set_ingredients(@craft_window.recipe.ingredients,
  523.                                                            @craft_window.recipe.ingredient_types,
  524.                                                            @craft_window.recipe.quantities)
  525.     end
  526.     if @craft_window.active
  527.       update_craft
  528.       return
  529.     end
  530.     if @yes_no_window.active
  531.       confirm_update
  532.       return
  533.     end
  534.   end

  535.   #--------------------------------------------------------------------------
  536.   def update_craft
  537.     if Input.trigger?(Input::B)
  538.       $game_system.se_play($data_system.cancel_se)
  539.       $scene = Scene_Map.new
  540.       return
  541.     end
  542.     if Input.trigger?(Input::C) and $game_party.recipes.size != 0
  543.       [url=home.php?mod=space&uid=2564094]@recipe[/url] = @craft_window.recipe
  544.       if @recipe.have
  545.         @yes_no_window.active = true
  546.         @craft_window.active = false
  547.       else
  548.         $game_system.se_play($data_system.buzzer_se)
  549.         return
  550.       end
  551.     end
  552.   end

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

  585. end # of Scene_Craft

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

Lv3.寻梦者

梦石
0
星屑
1743
在线时间
485 小时
注册时间
2006-1-7
帖子
1073
2
发表于 2014-7-27 18:15:00 | 只看该作者
1.在 238 行之前 插入:
  1. #byakki
  2.   def defeat
  3.       decrement
  4.     end
  5.   end
  6. #byakki
复制代码
2.把601行完全替换:
  1.         #byakki
  2.         if rand(100) > $game_variables[X]   #X号变量,控制合成率,手动改数,不大于100
  3.           @recipe.defeat
  4.         else
  5.           @recipe.make
  6.         end
  7.         #byakki
复制代码
【理论上】已经可以了,需要手动更改X为,你控制合成率的变量。如果要按照类别划分的话,
那么还要再case @result_type,when1是物品;when2是防具;when3是武器
最好用不同变量来控制

【缺陷】没有对界面更改,在合成界面无法显示当前合成率。因为你的脚本在发布的时候,
有url代码被主动识别了,我们看到的不完整。如有需要,建议你把工程发来。

点评

针对Ryanbern的建议,可以配合 物品得失 脚本。另外失败的时候再弄个窗口来提示一下吧。我懒了……  发表于 2014-8-3 17:21

评分

参与人数 1星屑 +100 收起 理由
RyanBern + 100 认可答案,不过成功失败都不提示啊.

查看全部评分

初从文,三年不中;后习武,校场发一矢,中鼓吏,逐之出;遂学医,有所成。自撰一良方,服之,卒。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-10-1 03:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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