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

Project1

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

[已经解决] 合成

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
104 小时
注册时间
2012-2-18
帖子
91
跳转到指定楼层
1
 楼主| 发表于 2013-1-29 14:38:00 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
诶呀诶呀。谁能教我做一个合成系统啊
灰常感谢

Lv1.梦旅人

梦石
0
星屑
50
在线时间
201 小时
注册时间
2013-1-23
帖子
270
2
发表于 2013-1-29 17:02:00 | 只看该作者
具体的看这里:http://rpg.blue/thread-280631-2-1.html
不过我自己还没看懂……始终不明白该怎么调用,虽然有人说:使用SceneManager.call(Scene_ItemSynthesis)  可以呼出
但是……怎么用呢,这个插入到哪里,插入后在哪里用我统统没明白…………

评分

参与人数 1梦石 +1 收起 理由
迷糊的安安 + 1 认可答案 附赠66RPG提供的精美好人卡一张^^.

查看全部评分

好吧,就这样开始完成我第一个完全版的游戏吧!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
108
在线时间
1006 小时
注册时间
2008-11-9
帖子
1658
3
发表于 2013-1-29 17:36:25 | 只看该作者
love896624434 发表于 2013-1-29 17:02
具体的看这里:http://rpg.blue/thread-280631-2-1.html
不过我自己还没看懂……始终不明白该怎么调用 ...


使用事件菜单最后一页的脚本命令调用
插入位置是代码页最后的插件脚本位置,可以用Insert键添加一页,复制进去即可

至于怎么用原帖里已经有了,什么时候用这问题真坑= =,你自己做游戏难道还不知道什么时候需要合成么
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
201 小时
注册时间
2013-1-23
帖子
270
4
发表于 2013-1-29 17:39:34 | 只看该作者
  1. #==============================================================================
  2. # ■ RGSS3 合成 ver 1.01
  3. #------------------------------------------------------------------------------
  4. #  配布元:
  5. #     白の魔 http://izumiwhite.web.fc2.com/
  6. #
  7. #  利用規約:
  8. #     RPGツクールVXの正規の登録者のみご利用になれます。
  9. #     利用報告・著作権表示とかは必要ありません。
  10. #     改造もご自由にどうぞ。
  11. #     何か問題が発生しても責任は持ちません。
  12. #==============================================================================


  13. #--------------------------------------------------------------------------
  14. # ★ 初期設定。
  15. #    合成レシピ等の設定
  16. #--------------------------------------------------------------------------
  17. module WD_itemsynthesis_ini
  18.   
  19.   Cost_view =  true #費用(G)の表示(合成の費用が全て0Gの場合はfalseを推奨)
  20.   
  21.   Category_i = true #カテゴリウィンドウに「アイテム」の項目を表示
  22.   Category_w = true #カテゴリウィンドウに「武器」の項目を表示
  23.   Category_a = true #カテゴリウィンドウに「防具」の項目を表示
  24.   Category_k = true #カテゴリウィンドウに「大事なもの」の項目を表示
  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[2]  = [10,  ["I",1,2]]
  38.   I_recipe[3]  = [100, ["I",1,1], ["I",2,1]]
  39.   I_recipe[17] = [500, ["I",1,10]]

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

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

  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # ● 所持金の取得
  418.   #--------------------------------------------------------------------------
  419.   def money
  420.     @gold_window.value
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # ● 通貨単位の取得
  424.   #--------------------------------------------------------------------------
  425.   def currency_unit
  426.     @gold_window.currency_unit
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ● 合成費用の取得
  430.   #--------------------------------------------------------------------------
  431.   def buying_price
  432.     @list_window.price(@item)
  433.   end
  434. end


  435. #==============================================================================
  436. # ■ Window_ItemSynthesisList
  437. #------------------------------------------------------------------------------
  438. #  合成画面で、合成可能なアイテムの一覧を表示するウィンドウです。
  439. #==============================================================================

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


  675. #==============================================================================
  676. # ■ Window_ItemSynthesisMaterial
  677. #------------------------------------------------------------------------------
  678. #  合成画面で、合成に必要な素材を表示するウィンドウです。
  679. #==============================================================================

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


  757. #==============================================================================
  758. # ■ Window_ItemSynthesisNumber
  759. #------------------------------------------------------------------------------
  760. #  合成画面で、合成するアイテムの個数を入力するウィンドウです。
  761. #==============================================================================

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


  793. #==============================================================================
  794. # ■ Window_ItemSynthesisCategory
  795. #------------------------------------------------------------------------------
  796. #  合成画面で、通常アイテムや装備品の分類を選択するウィンドウです。
  797. #==============================================================================

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


  820. #==============================================================================
  821. # ■ Window_ItemSynthesisNumber
  822. #------------------------------------------------------------------------------
  823. #  合成画面で、切替を表示するウィンドウです。
  824. #==============================================================================

  825. class Window_ItemSynthesisChange < Window_Base
  826.   #--------------------------------------------------------------------------
  827.   # ● オブジェクト初期化
  828.   #--------------------------------------------------------------------------
  829.   def initialize(x, y, width, height)
  830.     super(x, y, width, height)
  831.     refresh
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● リフレッシュ
  835.   #--------------------------------------------------------------------------
  836.   def refresh
  837.     contents.clear
  838.     text = "← → :表示切替"
  839.     draw_text(0, 0, contents_width, line_height, text, 1)
  840.   end
  841. end
复制代码
以上是脚本。
这个我已经弄明白了。在合成NPC的事件设置选项里,第三页,右下角的高级,有个脚本,插入
recipe_all_switch_on
SceneManager.call(Scene_ItemSynthesis)
这个就是打开全部合成菜单,另外打开合成界面。
合成脚本第38行开始是合成公式,自己添加。如果看不懂日文直接去百度翻译,公式添加非常简单。

点评

補充一下 把這段腳本復制後 在va按F11 (腳本快捷健)後在 最下面的插件腳本前插處一個空白頁後 在右邊貼上  发表于 2013-1-30 10:08
好吧,就这样开始完成我第一个完全版的游戏吧!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
201 小时
注册时间
2013-1-23
帖子
270
5
发表于 2013-1-29 19:24:30 | 只看该作者
判约之轮 发表于 2013-1-29 17:36
使用事件菜单最后一页的脚本命令调用
插入位置是代码页最后的插件脚本位置,可以用Insert键添加一页,复 ...

现在已经明白了。以前没用过插入脚本,所以没明白该插入哪里,后来仔细找了找发现那个高级里的脚本选项猜明白过来。
好吧,就这样开始完成我第一个完全版的游戏吧!
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
357
在线时间
1291 小时
注册时间
2013-1-12
帖子
3590

贵宾

6
发表于 2013-1-30 10:12:17 | 只看该作者
對了  recipe_all_switch_on  是全部開放合成
可是如果要弄像是花錢學習的話就要用  X_recipe_switch_on(n)     X處就是道具就加I 武器加W 防具加A
然後N的地方就填上開放合成的武器或道具或防具的ID


--------------------------------------------------------------------------------------------------------------------------------------------------------------------
直接
i_recipe_switch_on(n)               n号道具公示追加
i_recipe_switch_off(n)              n号道具公示削除
w_recipe_switch_on(n)        n号武器公示追加
w_recipe_switch_off(n)        n号武器公示削除
a_recipe_switch_on(n)        n号防具公示追加
a_recipe_switch_off(n)        n号防具公示削除
recipe_all_switch_on        全部合成可以使用
recipe_all_switch_off        全部合成削除

点评

要記得是要在學之前 弄off 不然會有可怕的bug... 不過這樣就還是不要弄學習裝備制作的 (還是可以啦 要的話再說 不過不是確定真的需要 就別弄了  发表于 2013-4-16 06:44
什麼意思? 如果是說不同npc的話可以阿 就recipe_all_switch_off (全部合成削除) 然後再switch on 你要的物品 不過要記得每個都要弄 switch off (見下個)  发表于 2013-4-16 06:42
请问可不可以不同角色合成不同的东西  发表于 2013-4-15 23:04

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
104 小时
注册时间
2012-2-18
帖子
91
7
 楼主| 发表于 2013-2-1 09:48:13 | 只看该作者
love896624434 发表于 2013-1-29 17:39
以上是脚本。
这个我已经弄明白了。在合成NPC的事件设置选项里,第三页,右下角的高级,有个脚本,插入
rec ...

是用于RPG  VX  ACE的吗

点评

沒錯滴~  发表于 2013-2-1 13:16
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
201 小时
注册时间
2013-1-23
帖子
270
8
发表于 2013-2-1 13:34:03 | 只看该作者
624183062 发表于 2013-2-1 09:48
是用于RPG  VX  ACE的吗

是的说{:2_270:}

点评

有木有看到开头的“RGSS3”  发表于 2013-2-13 20:59
好吧,就这样开始完成我第一个完全版的游戏吧!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
104 小时
注册时间
2012-2-18
帖子
91
9
 楼主| 发表于 2013-2-1 16:45:59 | 只看该作者
love896624434 发表于 2013-1-29 17:39
以上是脚本。
这个我已经弄明白了。在合成NPC的事件设置选项里,第三页,右下角的高级,有个脚本,插入
rec ...

在合成NPC的事件设置选项里,第三页,右下角的高级,有个脚本
请问是甚么???
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
201 小时
注册时间
2013-1-23
帖子
270
10
发表于 2013-2-1 17:18:42 | 只看该作者
624183062 发表于 2013-2-1 16:45
在合成NPC的事件设置选项里,第三页,右下角的高级,有个脚本
请问是甚么??? ...

嗯,就是那个东西。
好吧,就这样开始完成我第一个完全版的游戏吧!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-16 22:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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