查看: 2981|回复: 2

[已经解决] 白の魔的物品合成脚本如何能跳过分类界面?【已解决】

[复制链接]
梦石
20
星屑
13972
在线时间
1744 小时
注册时间
2017-1-12
回帖
1666

MZ评测员开拓者

发表于 2017-8-30 12:51:57 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 火锅深处 于 2017-9-1 21:17 编辑

我想只留“物品”这一类的,在脚本设置里确实也可以把武器防具这些分类关掉。
但是分类界面还在。
如下图。只有一类还要多点选一下感觉怪怪的,怎么设置才能让它打开直接就是“物品”这一类的窗口?
物品合成.png
脚本本体
  1. #==============================================================================
  2. # ■ RGSS3 アイテム合成 ver 1.02
  3. #------------------------------------------------------------------------------
  4. #  配布元:
  5. #     白の魔 [url]http://izumiwhite.web.fc2.com/[/url]
  6. #
  7. #  利用規約:
  8. #     RPGツクールVX Aceの正規の登録者のみご利用になれます。
  9. #     利用報告・著作権表示とかは必要ありません。
  10. #     改造もご自由にどうぞ。
  11. #     何か問題が発生しても責任は持ちません。
  12. #==============================================================================


  13. #--------------------------------------------------------------------------
  14. # ★ 初期設定。
  15. #    合成レシピ等の設定
  16. #--------------------------------------------------------------------------
  17. module WD_itemsynthesis_ini
  18.   
  19.   Cost_view =  false #費用(G)の表示(合成の費用が全て0Gの場合はfalseを推奨)
  20.   
  21.   Category_i = true #カテゴリウィンドウに「アイテム」の項目を表示
  22.   Category_w = false #カテゴリウィンドウに「武器」の項目を表示
  23.   Category_a = false #カテゴリウィンドウに「防具」の項目を表示
  24.   Category_k = false #カテゴリウィンドウに「大事なもの」の項目を表示
  25.   
  26.   I_recipe = [] #この行は削除しないこと
  27.   W_recipe = [] #この行は削除しないこと
  28.   A_recipe = [] #この行は削除しないこと
  29.   
  30.   #以下、合成レシピ。
  31.   #例: I_recipe[3]  = [100, ["I",1,1], ["W",2,1], ["A",2,2], ["A",3,1]]
  32.   #と記載した場合、ID3のアイテムの合成必要は、100G。
  33.   #必要な素材は、ID1のアイテム1個、ID2の武器1個、ID2の防具2個、ID3の防具1個
  34.   #となる。
  35.   
  36.   #アイテムの合成レシピ
  37.   I_recipe[18]  = [0,  ["I",17,1],["I",202,1],["I",203,1]]
  38.   I_recipe[20]  = [0,  ["I",19,1],["I",202,1],["I",204,1]]
  39.   #I_recipe[3]  = [100, ["I",1,1], ["I",2,1]]
  40.   #I_recipe[17] = [500, ["I",1,10]]

  41.   #武器の合成レシピ
  42.   W_recipe[3]  = [50,   ["W",1,1], ["W",2,1]]
  43.   #W_recipe[6]  = [600,  ["W",3,1], ["I",17,0]]
  44.   
  45.   #防具の合成レシピ  
  46.   A_recipe[2]  = [40,   ["A",1,2]]
  47.   #A_recipe[5]  = [400,  ["A",2,1], ["W",2,2], ["I",17,0]]
  48.   
  49. end


  50. #==============================================================================
  51. # ■ WD_itemsynthesis
  52. #------------------------------------------------------------------------------
  53. #  アイテム合成用の共通メソッドです。
  54. #==============================================================================

  55. module WD_itemsynthesis
  56.   def i_recipe_switch_on(id)
  57.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  58.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  59.     $game_system.i_rcp_sw[id] = true
  60.   end
  61.   def i_recipe_switch_off(id)
  62.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  63.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  64.     $game_system.i_rcp_sw[id] = false
  65.   end
  66.   def i_recipe_switch_on?(id)
  67.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  68.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  69.     return $game_system.i_rcp_sw[id]
  70.   end
  71.   def i_recipe_all_switch_on
  72.     for i in 1..$data_items.size
  73.       i_recipe_switch_on(i)
  74.     end
  75.   end
  76.   def i_recipe_all_switch_off
  77.     for i in 1..$data_items.size
  78.       i_recipe_switch_off(i)
  79.     end
  80.   end
  81.   def w_recipe_switch_on(id)
  82.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  83.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  84.     $game_system.w_rcp_sw[id] = true
  85.   end
  86.   def w_recipe_switch_off(id)
  87.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  88.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  89.     $game_system.w_rcp_sw[id] = false
  90.   end
  91.   def w_recipe_switch_on?(id)
  92.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  93.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  94.     return $game_system.w_rcp_sw[id]
  95.   end
  96.   def w_recipe_all_switch_on
  97.     for i in 1..$data_weapons.size
  98.       w_recipe_switch_on(i)
  99.     end
  100.   end
  101.   def w_recipe_all_switch_off
  102.     for i in 1..$data_weapons.size
  103.       w_recipe_switch_off(i)
  104.     end
  105.   end
  106.   def a_recipe_switch_on(id)
  107.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  108.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  109.     $game_system.a_rcp_sw[id] = true
  110.   end
  111.   def a_recipe_switch_off(id)
  112.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  113.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  114.     $game_system.a_rcp_sw[id] = false
  115.   end
  116.   def a_recipe_switch_on?(id)
  117.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  118.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  119.     return $game_system.a_rcp_sw[id]
  120.   end
  121.   def a_recipe_all_switch_on
  122.     for i in 1..$data_armors.size
  123.       a_recipe_switch_on(i)
  124.     end
  125.   end
  126.   def a_recipe_all_switch_off
  127.     for i in 1..$data_armors.size
  128.       a_recipe_switch_off(i)
  129.     end
  130.   end
  131.   def recipe_all_switch_on
  132.     i_recipe_all_switch_on
  133.     w_recipe_all_switch_on
  134.     a_recipe_all_switch_on
  135.   end
  136.   def recipe_all_switch_off
  137.     i_recipe_all_switch_off
  138.     w_recipe_all_switch_off
  139.     a_recipe_all_switch_off
  140.   end

  141. end

  142. class Game_Interpreter
  143.   include WD_itemsynthesis
  144. end

  145. class Game_System
  146.   #--------------------------------------------------------------------------
  147.   # ● 公開インスタンス変数
  148.   #--------------------------------------------------------------------------
  149.   attr_accessor :i_rcp_sw
  150.   attr_accessor :w_rcp_sw
  151.   attr_accessor :a_rcp_sw
  152.   #--------------------------------------------------------------------------
  153.   # ● オブジェクト初期化
  154.   #--------------------------------------------------------------------------
  155.   alias wd_orig_initialize004 initialize
  156.   def initialize
  157.     wd_orig_initialize004
  158.     @i_rcp_sw = []
  159.     @w_rcp_sw = []
  160.     @a_rcp_sw = []
  161.   end
  162. end


  163. #==============================================================================
  164. # ■ Scene_ItemSynthesis
  165. #------------------------------------------------------------------------------
  166. #  合成画面の処理を行うクラスです。
  167. #==============================================================================

  168. class Scene_ItemSynthesis < Scene_MenuBase
  169.   #--------------------------------------------------------------------------
  170.   # ● 開始処理
  171.   #--------------------------------------------------------------------------
  172.   def start
  173.     super
  174.     create_help_window
  175.     create_dummy_window
  176.     create_number_window
  177.     create_status_window
  178.     create_material_window
  179.     create_list_window
  180.     create_category_window
  181.     create_gold_window
  182.     create_change_window
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● ゴールドウィンドウの作成
  186.   #--------------------------------------------------------------------------
  187.   def create_gold_window
  188.     @gold_window = Window_Gold.new
  189.     @gold_window.viewport = @viewport
  190.     @gold_window.x = Graphics.width - @gold_window.width
  191.     @gold_window.y = @help_window.height
  192.     @gold_window.hide
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ● 切り替え表示ウィンドウの作成
  196.   #--------------------------------------------------------------------------
  197.   def create_change_window
  198.     wx = 0
  199.     wy = @gold_window.y
  200.     ww = Graphics.width - @gold_window.width
  201.     wh = @gold_window.height
  202.     @change_window = Window_ItemSynthesisChange.new(wx, wy, ww, wh)
  203.     @change_window.viewport = @viewport
  204.     @change_window.hide
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # ● ダミーウィンドウの作成
  208.   #--------------------------------------------------------------------------
  209.   def create_dummy_window
  210.     wy = @help_window.y + @help_window.height + 48
  211.     wh = Graphics.height - wy
  212.     @dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
  213.     @dummy_window.viewport = @viewport
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # ● 個数入力ウィンドウの作成
  217.   #--------------------------------------------------------------------------
  218.   def create_number_window
  219.     wy = @dummy_window.y
  220.     wh = @dummy_window.height
  221.     @number_window = Window_ItemSynthesisNumber.new(0, wy, wh)
  222.     @number_window.viewport = @viewport
  223.     @number_window.hide
  224.     @number_window.set_handler(:ok,     method(:on_number_ok))
  225.     @number_window.set_handler(:cancel, method(:on_number_cancel))
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # ● ステータスウィンドウの作成
  229.   #--------------------------------------------------------------------------
  230.   def create_status_window
  231.     wx = @number_window.width
  232.     wy = @dummy_window.y
  233.     ww = Graphics.width - wx
  234.     wh = @dummy_window.height
  235.     @status_window = Window_ShopStatus.new(wx, wy, ww, wh)
  236.     @status_window.viewport = @viewport
  237.     @status_window.hide
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● 素材ウィンドウの作成
  241.   #--------------------------------------------------------------------------
  242.   def create_material_window
  243.     wx = @number_window.width
  244.     wy = @dummy_window.y
  245.     ww = Graphics.width - wx
  246.     wh = @dummy_window.height
  247.     @material_window = Window_ItemSynthesisMaterial.new(wx, wy, ww, wh)
  248.     @material_window.viewport = @viewport
  249.     @material_window.hide
  250.     @number_window.material_window = @material_window
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ● 合成アイテムリストウィンドウの作成
  254.   #--------------------------------------------------------------------------
  255.   def create_list_window
  256.     wy = @dummy_window.y
  257.     wh = @dummy_window.height
  258.     @list_window = Window_ItemSynthesisList.new(0, wy, wh)
  259.     @list_window.viewport = @viewport
  260.     @list_window.help_window = @help_window
  261.     @list_window.status_window = @status_window
  262.     @list_window.material_window = @material_window
  263.     @list_window.hide
  264.     @list_window.set_handler(:ok,     method(:on_list_ok))
  265.     @list_window.set_handler(:cancel, method(:on_list_cancel))
  266.     @list_window.set_handler(:change_window, method(:on_change_window))   
  267.   end
  268.   #--------------------------------------------------------------------------
  269.   # ● カテゴリウィンドウの作成
  270.   #--------------------------------------------------------------------------
  271.   def create_category_window
  272.     @category_window = Window_ItemSynthesisCategory.new
  273.     @category_window.viewport = @viewport
  274.     @category_window.help_window = @help_window
  275.     @category_window.y = @help_window.height
  276.     @category_window.activate
  277.     @category_window.item_window = @list_window
  278.     @category_window.set_handler(:ok,     method(:on_category_ok))
  279.     @category_window.set_handler(:cancel, method(:return_scene))
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● 合成アイテムリストウィンドウのアクティブ化
  283.   #--------------------------------------------------------------------------
  284.   def activate_list_window
  285.     @list_window.money = money
  286.     @list_window.show.activate
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● 合成[決定]
  290.   #--------------------------------------------------------------------------
  291.   def on_list_ok
  292.     @item = @list_window.item
  293.     @list_window.hide
  294.     @number_window.set(@item, max_buy, buying_price, currency_unit)
  295.     @number_window.show.activate
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ● 合成[キャンセル]
  299.   #--------------------------------------------------------------------------
  300.   def on_list_cancel
  301.     @category_window.activate
  302.     @category_window.show
  303.     @dummy_window.show
  304.     @list_window.hide
  305.     @status_window.hide
  306.     @status_window.item = nil
  307.     @material_window.hide
  308.     @material_window.set(nil, nil)
  309.     @gold_window.hide
  310.     @change_window.hide
  311.     @help_window.clear
  312.   end
  313.   #--------------------------------------------------------------------------
  314.   # ● 表示切替
  315.   #--------------------------------------------------------------------------
  316.   def on_change_window
  317.     if @status_window.visible
  318.       @status_window.hide
  319.       @material_window.show
  320.     else
  321.       @status_window.show
  322.       @material_window.hide
  323.     end
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ● カテゴリ[決定]
  327.   #--------------------------------------------------------------------------
  328.   def on_category_ok
  329.     activate_list_window
  330.     @gold_window.show
  331.     @change_window.show
  332.     @material_window.show
  333.     @category_window.hide
  334.     @list_window.select(0)
  335.   end
  336.   #--------------------------------------------------------------------------
  337.   # ● 個数入力[決定]
  338.   #--------------------------------------------------------------------------
  339.   def on_number_ok
  340.     Sound.play_shop
  341.     do_syntetic(@number_window.number)
  342.     end_number_input
  343.     @gold_window.refresh
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 個数入力[キャンセル]
  347.   #--------------------------------------------------------------------------
  348.   def on_number_cancel
  349.     Sound.play_cancel
  350.     end_number_input
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● 合成の実行
  354.   #--------------------------------------------------------------------------
  355.   def do_syntetic(number)
  356.     $game_party.lose_gold(number * buying_price)
  357.     $game_party.gain_item(@item, number)
  358.    
  359.       [url=home.php?mod=space&uid=2564094]@recipe[/url] = @list_window.recipe(@item)
  360.       for i in [email]1...@recipe.size[/email]
  361.         kind = @recipe[i][0]
  362.         id   = @recipe[i][1]
  363.         num  = @recipe[i][2]
  364.         if kind == "I"
  365.           item = $data_items[id]
  366.         elsif kind == "W"
  367.           item = $data_weapons[id]
  368.         elsif kind == "A"
  369.           item = $data_armors[id]
  370.         end
  371.         $game_party.lose_item(item, num*number)
  372.       end
  373.   end
  374.   #--------------------------------------------------------------------------
  375.   # ● 個数入力の終了
  376.   #--------------------------------------------------------------------------
  377.   def end_number_input
  378.     @number_window.hide
  379.     activate_list_window
  380.   end
  381.   #--------------------------------------------------------------------------
  382.   # ● 最大購入可能個数の取得
  383.   #--------------------------------------------------------------------------
  384.   def max_buy
  385.     max = $game_party.max_item_number(@item) - $game_party.item_number(@item)
  386.    
  387.     @recipe = @list_window.recipe(@item)
  388.       for i in [email]1...@recipe.size[/email]
  389.         kind = @recipe[i][0]
  390.         id   = @recipe[i][1]
  391.         num  = @recipe[i][2]
  392.         if kind == "I"
  393.           item = $data_items[id]
  394.         elsif kind == "W"
  395.           item = $data_weapons[id]
  396.         elsif kind == "A"
  397.           item = $data_armors[id]
  398.         end
  399.         if num > 0
  400.           max_buf = $game_party.item_number(item)/num
  401.         else
  402.           max_buf = 999
  403.         end
  404.         max = [max, max_buf].min
  405.       end
  406.       
  407.     buying_price == 0 ? max : [max, money / buying_price].min

  408.   end
  409. #--------------------------------------------------------------------------
  410.   # ● 所持金の取得
  411.   #--------------------------------------------------------------------------
  412.   def money
  413.     @gold_window.value
  414.   end
  415.   #--------------------------------------------------------------------------
  416.   # ● 通貨単位の取得
  417.   #--------------------------------------------------------------------------
  418.   def currency_unit
  419.     @gold_window.currency_unit
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   # ● 合成費用の取得
  423.   #--------------------------------------------------------------------------
  424.   def buying_price
  425.     @list_window.price(@item)
  426.   end
  427. end


  428. #==============================================================================
  429. # ■ Window_ItemSynthesisList
  430. #------------------------------------------------------------------------------
  431. #  合成画面で、合成可能なアイテムの一覧を表示するウィンドウです。
  432. #==============================================================================

  433. class Window_ItemSynthesisList < Window_Selectable
  434.   include WD_itemsynthesis
  435.   #--------------------------------------------------------------------------
  436.   # ● 公開インスタンス変数
  437.   #--------------------------------------------------------------------------
  438.   attr_reader   :status_window            # ステータスウィンドウ
  439.   #--------------------------------------------------------------------------
  440.   # ● オブジェクト初期化
  441.   #--------------------------------------------------------------------------
  442.   def initialize(x, y, height)
  443.     super(x, y, window_width, height)
  444.    
  445.     @shop_goods = []
  446.     @shop_recipes = []
  447.    
  448.     for i in 1..WD_itemsynthesis_ini::I_recipe.size
  449.       recipe = WD_itemsynthesis_ini::I_recipe[i]
  450.       if recipe
  451.         good = [0, i, recipe[0]]
  452.         if i_recipe_switch_on?(i)
  453.           @shop_goods.push(good)
  454.           @shop_recipes.push(recipe)
  455.         end
  456.       end
  457.     end
  458.     for i in 1..WD_itemsynthesis_ini::W_recipe.size
  459.       recipe = WD_itemsynthesis_ini::W_recipe[i]
  460.       if recipe
  461.         good = [1, i, recipe[0]]
  462.         if w_recipe_switch_on?(i)
  463.           @shop_goods.push(good)
  464.           @shop_recipes.push(recipe)
  465.         end
  466.       end
  467.     end
  468.     for i in 1..WD_itemsynthesis_ini::A_recipe.size
  469.       recipe = WD_itemsynthesis_ini::A_recipe[i]
  470.       if recipe
  471.         good = [2, i, recipe[0]]
  472.         if a_recipe_switch_on?(i)
  473.           @shop_goods.push(good)
  474.           @shop_recipes.push(recipe)
  475.         end
  476.       end
  477.     end
  478.    
  479.     [url=home.php?mod=space&uid=26101]@Money[/url] = 0
  480.     refresh
  481.     select(0)
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # ● ウィンドウ幅の取得
  485.   #--------------------------------------------------------------------------
  486.   def window_width
  487.     return 304
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # ● 項目数の取得
  491.   #--------------------------------------------------------------------------
  492.   def item_max
  493.     @data ? @data.size : 1
  494.   end
  495.   #--------------------------------------------------------------------------
  496.   # ● アイテムの取得
  497.   #--------------------------------------------------------------------------
  498.   def item
  499.     @data[index]
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # ● 所持金の設定
  503.   #--------------------------------------------------------------------------
  504.   def money=(money)
  505.     @money = money
  506.     refresh
  507.   end
  508.   #--------------------------------------------------------------------------
  509.   # ● 選択項目の有効状態を取得
  510.   #--------------------------------------------------------------------------
  511.   def current_item_enabled?
  512.     enable?(@data[index])
  513.   end
  514.   #--------------------------------------------------------------------------
  515.   # ● 合成費用を取得
  516.   #--------------------------------------------------------------------------
  517.   def price(item)
  518.     @price[item]
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # ● 合成可否を取得
  522.   #--------------------------------------------------------------------------
  523.   def enable?(item)
  524.     @makable[item]
  525.   end
  526.   #--------------------------------------------------------------------------
  527.   # ● レシピを取得
  528.   #--------------------------------------------------------------------------
  529.   def recipe(item)
  530.     @recipe[item]
  531.   end
  532.   #--------------------------------------------------------------------------
  533.   # ● アイテムを許可状態で表示するかどうか
  534.   #--------------------------------------------------------------------------
  535.   def have_mat?(recipe)
  536.     flag = true
  537.     if @money >= recipe[0]
  538.       for i in 1...recipe.size
  539.         kind = recipe[i][0]
  540.         id   = recipe[i][1]
  541.         num  = recipe[i][2]
  542.         if kind == "I"
  543.           item = $data_items[id]
  544.         elsif kind == "W"
  545.           item = $data_weapons[id]
  546.         elsif kind == "A"
  547.           item = $data_armors[id]
  548.         end
  549.         if $game_party.item_number(item) < [num, 1].max
  550.           flag = false
  551.         end
  552.       end
  553.     else
  554.       flag = false
  555.     end
  556.     return flag
  557.   end
  558.   #--------------------------------------------------------------------------
  559.   # ● カテゴリの設定
  560.   #--------------------------------------------------------------------------
  561.   def category=(category)
  562.     return if @category == category
  563.     @category = category
  564.     refresh
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ● リフレッシュ
  568.   #--------------------------------------------------------------------------
  569.   def refresh
  570.     make_item_list
  571.     create_contents
  572.     draw_all_items
  573.   end
  574.   #--------------------------------------------------------------------------
  575.   # ● アイテムをリストに含めるかどうか
  576.   #--------------------------------------------------------------------------
  577.   def include?(item)
  578.     case @category
  579.     when :item
  580.       item.is_a?(RPG::Item) && !item.key_item?
  581.     when :weapon
  582.       item.is_a?(RPG::Weapon)
  583.     when :armor
  584.       item.is_a?(RPG::Armor)
  585.     when :key_item
  586.       item.is_a?(RPG::Item) && item.key_item?
  587.     else
  588.       false
  589.     end
  590.   end
  591.   #--------------------------------------------------------------------------
  592.   # ● アイテムリストの作成
  593.   #--------------------------------------------------------------------------
  594.   def make_item_list
  595.     @data = []
  596.     @price = {}
  597.     @makable = {}
  598.     @recipe = {}
  599.     for i in [email]0...@shop_goods.size[/email]
  600.       goods = @shop_goods[i]
  601.       recipe = @shop_recipes[i]
  602.       case goods[0]
  603.       when 0;  item = $data_items[goods[1]]
  604.       when 1;  item = $data_weapons[goods[1]]
  605.       when 2;  item = $data_armors[goods[1]]
  606.       end
  607.       if item
  608.         if include?(item)
  609.           @data.push(item)
  610.           @price[item] = goods[2]
  611.           @makable[item] = have_mat?(recipe)
  612.           @recipe[item] = recipe
  613.         end
  614.       end
  615.     end
  616.   end
  617.   #--------------------------------------------------------------------------
  618.   # ● 項目の描画
  619.   #--------------------------------------------------------------------------
  620.   def draw_item(index)
  621.     item = @data[index]
  622.     rect = item_rect(index)
  623.     draw_item_name(item, rect.x, rect.y, enable?(item))
  624.     rect.width -= 4
  625.     draw_text(rect, price(item), 2)  if WD_itemsynthesis_ini::Cost_view
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # ● ステータスウィンドウの設定
  629.   #--------------------------------------------------------------------------
  630.   def status_window=(status_window)
  631.     @status_window = status_window
  632.     call_update_help
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # ● 素材ウィンドウの設定
  636.   #--------------------------------------------------------------------------
  637.   def material_window=(material_window)
  638.     @material_window = material_window
  639.     call_update_help
  640.   end
  641.   #--------------------------------------------------------------------------
  642.   # ● ヘルプテキスト更新
  643.   #--------------------------------------------------------------------------
  644.   def update_help
  645.     @help_window.set_item(item) if @help_window
  646.     @status_window.item = item if @status_window
  647.     @material_window.set(item, recipe(item)) if @material_window
  648.   end
  649.   #--------------------------------------------------------------------------
  650.   # ● ←→ ボタン(表示切替)が押されたときの処理
  651.   #--------------------------------------------------------------------------
  652.   def process_change_window
  653.     Sound.play_cursor
  654.     Input.update
  655.     call_handler(:change_window)
  656.   end
  657.   #--------------------------------------------------------------------------
  658.   # ● 決定やキャンセルなどのハンドリング処理
  659.   #--------------------------------------------------------------------------
  660.   def process_handling
  661.     super
  662.     if active
  663.       return process_change_window if handle?(:change_window) && Input.trigger?(:X)
  664.       return process_change_window if handle?(:change_window) && Input.trigger?(:Y)
  665.     end
  666.   end
  667. end


  668. #==============================================================================
  669. # ■ Window_ItemSynthesisMaterial
  670. #------------------------------------------------------------------------------
  671. #  合成画面で、合成に必要な素材を表示するウィンドウです。
  672. #==============================================================================

  673. class Window_ItemSynthesisMaterial < Window_Base
  674.   #--------------------------------------------------------------------------
  675.   # ● オブジェクト初期化
  676.   #--------------------------------------------------------------------------
  677.   def initialize(x, y, width, height)
  678.     super(x, y, width, height)
  679.     @item = nil
  680.     refresh
  681.   end
  682.   #--------------------------------------------------------------------------
  683.   # ● リフレッシュ
  684.   #--------------------------------------------------------------------------
  685.   def refresh
  686.     contents.clear
  687.     draw_possession(4, 0)
  688.     draw_material_info(0, line_height * 2)
  689.   end
  690.   #--------------------------------------------------------------------------
  691.   # ● アイテムの設定
  692.   #--------------------------------------------------------------------------
  693.   def set(item, recipe)
  694.     @item = item
  695.     @recipe = recipe
  696.     @make_number = 1
  697.     refresh
  698.   end
  699.   #--------------------------------------------------------------------------
  700.   # ● 作成個数の設定
  701.   #--------------------------------------------------------------------------
  702.   def set_num(make_number)
  703.     @make_number = make_number
  704.     refresh
  705.   end
  706.   #--------------------------------------------------------------------------
  707.   # ● 所持数の描画
  708.   #--------------------------------------------------------------------------
  709.   def draw_possession(x, y)
  710.     rect = Rect.new(x, y, contents.width - 4 - x, line_height)
  711.     change_color(system_color)
  712.     draw_text(rect, Vocab::Possession)
  713.     change_color(normal_color)
  714.     draw_text(rect, $game_party.item_number(@item), 2)
  715.   end
  716.   #--------------------------------------------------------------------------
  717.   # ● 素材情報の描画
  718.   #--------------------------------------------------------------------------
  719.   def draw_material_info(x, y)
  720.     rect = Rect.new(x, y, contents.width, line_height)
  721.     change_color(system_color)
  722.     contents.font.size = 18
  723.     draw_text(rect, "必要素材", 0)
  724.     if @recipe
  725.       for i in [email]1...@recipe.size[/email]
  726.         kind = @recipe[i][0]
  727.         id   = @recipe[i][1]
  728.         num  = @recipe[i][2]
  729.         if kind == "I"
  730.           item = $data_items[id]
  731.         elsif kind == "W"
  732.           item = $data_weapons[id]
  733.         elsif kind == "A"
  734.           item = $data_armors[id]
  735.         end
  736.         rect = Rect.new(x, y + line_height*i, contents.width, line_height)
  737.         enabled = true
  738.         enabled = false if [num*@make_number, 1].max  > $game_party.item_number(item)
  739.         draw_item_name(item, rect.x, rect.y, enabled)
  740.         change_color(normal_color, enabled)
  741.         if num > 0
  742.           draw_text(rect, "#{num*@make_number}/#{$game_party.item_number(item)}", 2)
  743.         end
  744.       end
  745.     end
  746.     change_color(normal_color)
  747.     contents.font.size = 24
  748.   end
  749. end


  750. #==============================================================================
  751. # ■ Window_ItemSynthesisNumber
  752. #------------------------------------------------------------------------------
  753. #  合成画面で、合成するアイテムの個数を入力するウィンドウです。
  754. #==============================================================================

  755. class Window_ItemSynthesisNumber < Window_ShopNumber
  756.   #--------------------------------------------------------------------------
  757.   # ● リフレッシュ
  758.   #--------------------------------------------------------------------------
  759.   def refresh
  760.     contents.clear
  761.     draw_item_name(@item, 0, item_y)
  762.     draw_number
  763.     draw_total_price if WD_itemsynthesis_ini::Cost_view
  764.   end
  765.   #--------------------------------------------------------------------------
  766.   # ● オブジェクト初期化
  767.   #--------------------------------------------------------------------------
  768.   def material_window=(material_window)
  769.     @material_window = material_window
  770.     call_update_help
  771.   end
  772.   #--------------------------------------------------------------------------
  773.   # ● 作成個数の変更
  774.   #--------------------------------------------------------------------------
  775.   def change_number(amount)
  776.     @number = [[@number + amount, @max].min, 1].max
  777.     call_update_help #追加
  778.   end
  779.   #--------------------------------------------------------------------------
  780.   # ● ヘルプテキスト更新
  781.   #--------------------------------------------------------------------------
  782.   def call_update_help
  783.     @material_window.set_num(@number) if @material_window
  784.   end
  785. end


  786. #==============================================================================
  787. # ■ Window_ItemSynthesisCategory
  788. #------------------------------------------------------------------------------
  789. #  合成画面で、通常アイテムや装備品の分類を選択するウィンドウです。
  790. #==============================================================================

  791. class Window_ItemSynthesisCategory < Window_ItemCategory
  792.   #--------------------------------------------------------------------------
  793.   # ● 桁数の取得
  794.   #--------------------------------------------------------------------------
  795.   def col_max
  796.     i = 0
  797.     i += 1 if WD_itemsynthesis_ini::Category_i
  798.     i += 1 if WD_itemsynthesis_ini::Category_w
  799.     i += 1 if WD_itemsynthesis_ini::Category_a
  800.     i += 1 if WD_itemsynthesis_ini::Category_k
  801.     return i
  802.   end
  803.   #--------------------------------------------------------------------------
  804.   # ● コマンドリストの作成
  805.   #--------------------------------------------------------------------------
  806.   def make_command_list
  807.     add_command(Vocab::item,     :item)     if WD_itemsynthesis_ini::Category_i
  808.     add_command(Vocab::weapon,   :weapon)   if WD_itemsynthesis_ini::Category_w
  809.     add_command(Vocab::armor,    :armor)    if WD_itemsynthesis_ini::Category_a
  810.     add_command(Vocab::key_item, :key_item) if WD_itemsynthesis_ini::Category_k
  811.   end
  812. end


  813. #==============================================================================
  814. # ■ Window_ItemSynthesisNumber
  815. #------------------------------------------------------------------------------
  816. #  合成画面で、切替を表示するウィンドウです。
  817. #==============================================================================

  818. class Window_ItemSynthesisChange < Window_Base
  819.   #--------------------------------------------------------------------------
  820.   # ● オブジェクト初期化
  821.   #--------------------------------------------------------------------------
  822.   def initialize(x, y, width, height)
  823.     super(x, y, width, height)
  824.     refresh
  825.   end
  826.   #--------------------------------------------------------------------------
  827.   # ● リフレッシュ
  828.   #--------------------------------------------------------------------------
  829.   def refresh
  830.     contents.clear
  831.     text = "X Y:表示切换"
  832.     draw_text(0, 0, contents_width, line_height, text, 1)
  833.   end
  834. end
复制代码


发脚本用的脚本框是这个<>按钮哦。—— VIPArcher友情提醒,已手动编辑
梦石
0
星屑
488
在线时间
755 小时
注册时间
2014-9-7
回帖
11

开拓者

发表于 2017-9-1 21:07:33 | 显示全部楼层
在这个白魔的合成脚本后面或者下面加入这一段试试?不知道是不是你要的效果
  1. class Scene_ItemSynthesis < Scene_MenuBase
  2.   alias vip_20170901_start start
  3.   def start
  4.     vip_20170901_start
  5.     on_category_ok
  6.   end
  7.   #--------------------------------------------------------------------------
  8.   # ● 合成[キャンセル]
  9.   #--------------------------------------------------------------------------
  10.   def on_list_cancel
  11.     return_scene
  12.   end
  13. end
复制代码

点评

可说是比较理想了,谢谢!(—V—)b  发表于 2017-9-1 21:17

评分

参与人数 1梦石 +1 收起 理由
VIPArcher + 1 认可答案

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部