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

Project1

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

[讨论] 白魔的物品合成

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1293
在线时间
995 小时
注册时间
2014-12-14
帖子
3016

开拓者

跳转到指定楼层
1
发表于 2015-12-10 01:10:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 Vortur 于 2016-2-13 19:48 编辑

在下身为RM的小白,希望得到一些比较好理解的脚本范例,以及希望知道RM中大家已经耳熟能详的脚本范例都有哪些.
但是主站的【教程】面板中所有华为的链接都失效了。(话说在下本来就讨厌华为)
在下也在“授权素材”面板找过一些脚本素材,虽然全,但是却不是汉化的.
所以在此求它们的分享链接,希望好心人深处援助之手。



另外在注意解到,现在已经没人发布 商业游戏中的素材了。应该是在避免版权问题吧!?
这个脚本是白魔的物品合成,可以在不同地方进行不同种类的合成处理。原网站估计需要反强;如果想要勉强,也可以在浏览器输入其主页,然后不停刷新和输入其主页,最后不停在新的页面打开该脚本的下载链接。这样可以得到一份乱码版的脚本http://izumiwhite.web.fc2.com/rgss3/rgss3_004_main_ver104.txt
RUBY 代码复制
  1. #==============================================================================
  2. # 仭 RGSS3 傾僀僥儉崌惉 ver 1.04
  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. #    崌惉儗僔僺摍偺愝掕
  18. #--------------------------------------------------------------------------
  19. module WD_itemsynthesis_ini
  20.  
  21.   Cost_view =  true #旓梡(俧)偺昞帵(崌惉偺旓梡偑慡偰0G偺応崌偼false傪悇彠)
  22.  
  23.   Category_i = true #僇僥僑儕僂傿儞僪僂偵乽傾僀僥儉乿偺崁栚傪昞帵
  24.   Category_w = true #僇僥僑儕僂傿儞僪僂偵乽晲婍乿偺崁栚傪昞帵
  25.   Category_a = true #僇僥僑儕僂傿儞僪僂偵乽杊嬶乿偺崁栚傪昞帵
  26.   Category_k = true #僇僥僑儕僂傿儞僪僂偵乽戝帠側傕偺乿偺崁栚傪昞帵
  27.  
  28.   I_recipe = [] #偙偺峴偼嶍彍偟側偄偙偲
  29.   W_recipe = [] #偙偺峴偼嶍彍偟側偄偙偲
  30.   A_recipe = [] #偙偺峴偼嶍彍偟側偄偙偲
  31.  
  32.   #埲壓丄崌惉儗僔僺丅
  33.   #椺: I_recipe[3]  = [100, ["I",1,1], ["W",2,1], ["A",2,2], ["A",3,1]]
  34.   #偲婰嵹偟偨応崌丄ID3偺傾僀僥儉偺崌惉昁梫偼丄100俧丅
  35.   #昁梫側慺嵽偼丄ID1偺傾僀僥儉1屄丄ID2偺晲婍1屄丄ID2偺杊嬶2屄丄ID3偺杊嬶1屄
  36.   #偲側傞丅
  37.  
  38.   #傾僀僥儉偺崌惉儗僔僺
  39.   I_recipe[2]  = [10,  ["I",1,2]]
  40.   I_recipe[3]  = [100, ["I",1,1], ["I",2,1]]
  41.   I_recipe[17] = [500, ["I",1,10]]
  42.  
  43.   #晲婍偺崌惉儗僔僺
  44.   W_recipe[3]  = [50,   ["W",1,1], ["W",2,1]]
  45.   W_recipe[6]  = [600,  ["W",3,1], ["I",17,0]]
  46.  
  47.   #杊嬶偺崌惉儗僔僺  
  48.   A_recipe[2]  = [40,   ["A",1,2]]
  49.   A_recipe[5]  = [400,  ["A",2,1], ["W",2,2], ["I",17,0]]
  50.  
  51. end
  52.  
  53.  
  54. #==============================================================================
  55. # 仭 WD_itemsynthesis
  56. #------------------------------------------------------------------------------
  57. # 丂傾僀僥儉崌惉梡偺嫟捠儊僜僢僪偱偡丅
  58. #==============================================================================
  59.  
  60. module WD_itemsynthesis
  61.   def i_recipe_switch_on(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] = true
  65.   end
  66.   def i_recipe_switch_off(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.     $game_system.i_rcp_sw[id] = false
  70.   end
  71.   def i_recipe_switch_on?(id)
  72.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  73.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  74.     return $game_system.i_rcp_sw[id]
  75.   end
  76.   def i_recipe_all_switch_on
  77.     for i in 1..$data_items.size
  78.       i_recipe_switch_on(i)
  79.     end
  80.   end
  81.   def i_recipe_all_switch_off
  82.     for i in 1..$data_items.size
  83.       i_recipe_switch_off(i)
  84.     end
  85.   end
  86.   def w_recipe_switch_on(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] = true
  90.   end
  91.   def w_recipe_switch_off(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.     $game_system.w_rcp_sw[id] = false
  95.   end
  96.   def w_recipe_switch_on?(id)
  97.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  98.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  99.     return $game_system.w_rcp_sw[id]
  100.   end
  101.   def w_recipe_all_switch_on
  102.     for i in 1..$data_weapons.size
  103.       w_recipe_switch_on(i)
  104.     end
  105.   end
  106.   def w_recipe_all_switch_off
  107.     for i in 1..$data_weapons.size
  108.       w_recipe_switch_off(i)
  109.     end
  110.   end
  111.   def a_recipe_switch_on(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] = true
  115.   end
  116.   def a_recipe_switch_off(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.     $game_system.a_rcp_sw[id] = false
  120.   end
  121.   def a_recipe_switch_on?(id)
  122.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  123.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  124.     return $game_system.a_rcp_sw[id]
  125.   end
  126.   def a_recipe_all_switch_on
  127.     for i in 1..$data_armors.size
  128.       a_recipe_switch_on(i)
  129.     end
  130.   end
  131.   def a_recipe_all_switch_off
  132.     for i in 1..$data_armors.size
  133.       a_recipe_switch_off(i)
  134.     end
  135.   end
  136.   def recipe_all_switch_on
  137.     i_recipe_all_switch_on
  138.     w_recipe_all_switch_on
  139.     a_recipe_all_switch_on
  140.   end
  141.   def recipe_all_switch_off
  142.     i_recipe_all_switch_off
  143.     w_recipe_all_switch_off
  144.     a_recipe_all_switch_off
  145.   end
  146.  
  147. end
  148.  
  149. class Game_Interpreter
  150.   include WD_itemsynthesis
  151. end
  152.  
  153. class Game_System
  154.   #--------------------------------------------------------------------------
  155.   # 仠 岞奐僀儞僗僞儞僗曄悢
  156.   #--------------------------------------------------------------------------
  157.   attr_accessor :i_rcp_sw
  158.   attr_accessor :w_rcp_sw
  159.   attr_accessor :a_rcp_sw
  160.   #--------------------------------------------------------------------------
  161.   # 仠 僆僽僕僃僋僩弶婜壔
  162.   #--------------------------------------------------------------------------
  163.   alias wd_orig_initialize004 initialize
  164.   def initialize
  165.     wd_orig_initialize004
  166.     @i_rcp_sw = []
  167.     @w_rcp_sw = []
  168.     @a_rcp_sw = []
  169.   end
  170. end
  171.  
  172.  
  173. #==============================================================================
  174. # 仭 Scene_ItemSynthesis
  175. #------------------------------------------------------------------------------
  176. # 丂崌惉夋柺偺張棟傪峴偆僋儔僗偱偡丅
  177. #==============================================================================
  178.  
  179. class Scene_ItemSynthesis < Scene_MenuBase
  180.   #--------------------------------------------------------------------------
  181.   # 仠 奐巒張棟
  182.   #--------------------------------------------------------------------------
  183.   def start
  184.     super
  185.     create_help_window
  186.     create_dummy_window
  187.     create_number_window
  188.     create_status_window
  189.     create_material_window
  190.     create_list_window
  191.     create_category_window
  192.     create_gold_window
  193.     create_change_window
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # 仠 僑乕儖僪僂傿儞僪僂偺嶌惉
  197.   #--------------------------------------------------------------------------
  198.   def create_gold_window
  199.     @gold_window = Window_Gold.new
  200.     @gold_window.viewport = @viewport
  201.     @gold_window.x = Graphics.width - @gold_window.width
  202.     @gold_window.y = @help_window.height
  203.     @gold_window.hide
  204.   end
  205.   #--------------------------------------------------------------------------
  206.   # 仠 愗傝懼偊昞帵僂傿儞僪僂偺嶌惉
  207.   #--------------------------------------------------------------------------
  208.   def create_change_window
  209.     wx = 0
  210.     wy = @gold_window.y
  211.     ww = Graphics.width - @gold_window.width
  212.     wh = @gold_window.height
  213.     @change_window = Window_ItemSynthesisChange.new(wx, wy, ww, wh)
  214.     @change_window.viewport = @viewport
  215.     @change_window.hide
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # 仠 僟儈乕僂傿儞僪僂偺嶌惉
  219.   #--------------------------------------------------------------------------
  220.   def create_dummy_window
  221.     wy = @help_window.y + @help_window.height + 48
  222.     wh = Graphics.height - wy
  223.     @dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
  224.     @dummy_window.viewport = @viewport
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # 仠 屄悢擖椡僂傿儞僪僂偺嶌惉
  228.   #--------------------------------------------------------------------------
  229.   def create_number_window
  230.     wy = @dummy_window.y
  231.     wh = @dummy_window.height
  232.     @number_window = Window_ItemSynthesisNumber.new(0, wy, wh)
  233.     @number_window.viewport = @viewport
  234.     @number_window.hide
  235.     @number_window.set_handler(:ok,     method(:on_number_ok))
  236.     @number_window.set_handler(:cancel, method(:on_number_cancel))
  237.     @number_window.set_handler(:change_window, method(:on_change_window))   
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # 仠 僗僥乕僞僗僂傿儞僪僂偺嶌惉
  241.   #--------------------------------------------------------------------------
  242.   def create_status_window
  243.     wx = @number_window.width
  244.     wy = @dummy_window.y
  245.     ww = Graphics.width - wx
  246.     wh = @dummy_window.height
  247.     @status_window = Window_ShopStatus.new(wx, wy, ww, wh)
  248.     @status_window.viewport = @viewport
  249.     @status_window.hide
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # 仠 慺嵽僂傿儞僪僂偺嶌惉
  253.   #--------------------------------------------------------------------------
  254.   def create_material_window
  255.     wx = @number_window.width
  256.     wy = @dummy_window.y
  257.     ww = Graphics.width - wx
  258.     wh = @dummy_window.height
  259.     @material_window = Window_ItemSynthesisMaterial.new(wx, wy, ww, wh)
  260.     @material_window.viewport = @viewport
  261.     @material_window.hide
  262.     @number_window.material_window = @material_window
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # 仠 崌惉傾僀僥儉儕僗僩僂傿儞僪僂偺嶌惉
  266.   #--------------------------------------------------------------------------
  267.   def create_list_window
  268.     wy = @dummy_window.y
  269.     wh = @dummy_window.height
  270.     @list_window = Window_ItemSynthesisList.new(0, wy, wh)
  271.     @list_window.viewport = @viewport
  272.     @list_window.help_window = @help_window
  273.     @list_window.status_window = @status_window
  274.     @list_window.material_window = @material_window
  275.     @list_window.hide
  276.     @list_window.set_handler(:ok,     method(:on_list_ok))
  277.     @list_window.set_handler(:cancel, method(:on_list_cancel))
  278.     @list_window.set_handler(:change_window, method(:on_change_window))   
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # 仠 僇僥僑儕僂傿儞僪僂偺嶌惉
  282.   #--------------------------------------------------------------------------
  283.   def create_category_window
  284.     @category_window = Window_ItemSynthesisCategory.new
  285.     @category_window.viewport = @viewport
  286.     @category_window.help_window = @help_window
  287.     @category_window.y = @help_window.height
  288.     @category_window.activate
  289.     @category_window.item_window = @list_window
  290.     @category_window.set_handler(:ok,     method(:on_category_ok))
  291.     @category_window.set_handler(:cancel, method(:return_scene))
  292.   end
  293.   #--------------------------------------------------------------------------
  294.   # 仠 崌惉傾僀僥儉儕僗僩僂傿儞僪僂偺傾僋僥傿僽壔
  295.   #--------------------------------------------------------------------------
  296.   def activate_list_window
  297.     @list_window.money = money
  298.     @list_window.show.activate
  299.   end
  300.   #--------------------------------------------------------------------------
  301.   # 仠 崌惉乵寛掕乶
  302.   #--------------------------------------------------------------------------
  303.   def on_list_ok
  304.     @item = @list_window.item
  305.     @list_window.hide
  306.     @number_window.set(@item, max_buy, buying_price, currency_unit)
  307.     @number_window.show.activate
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # 仠 崌惉乵僉儍儞僙儖乶
  311.   #--------------------------------------------------------------------------
  312.   def on_list_cancel
  313.     @category_window.activate
  314.     @category_window.show
  315.     @dummy_window.show
  316.     @list_window.hide
  317.     @status_window.hide
  318.     @status_window.item = nil
  319.     @material_window.hide
  320.     @material_window.set(nil, nil)
  321.     @gold_window.hide
  322.     @change_window.hide
  323.     @help_window.clear
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # 仠 昞帵愗懼
  327.   #--------------------------------------------------------------------------
  328.   def on_change_window
  329.     if @status_window.visible
  330.       @status_window.hide
  331.       @material_window.show
  332.     else
  333.       @status_window.show
  334.       @material_window.hide
  335.     end
  336.   end
  337.   #--------------------------------------------------------------------------
  338.   # 仠 僇僥僑儕乵寛掕乶
  339.   #--------------------------------------------------------------------------
  340.   def on_category_ok
  341.     activate_list_window
  342.     @gold_window.show
  343.     @change_window.show
  344.     @material_window.show
  345.     @category_window.hide
  346.     @list_window.select(0)
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # 仠 屄悢擖椡乵寛掕乶
  350.   #--------------------------------------------------------------------------
  351.   def on_number_ok
  352.     Sound.play_shop
  353.     do_syntetic(@number_window.number)
  354.     end_number_input
  355.     @gold_window.refresh
  356.   end
  357.   #--------------------------------------------------------------------------
  358.   # 仠 屄悢擖椡乵僉儍儞僙儖乶
  359.   #--------------------------------------------------------------------------
  360.   def on_number_cancel
  361.     Sound.play_cancel
  362.     end_number_input
  363.   end
  364.   #--------------------------------------------------------------------------
  365.   # 仠 崌惉偺幚峴
  366.   #--------------------------------------------------------------------------
  367.   def do_syntetic(number)
  368.     $game_party.lose_gold(number * buying_price)
  369.     $game_party.gain_item(@item, number)
  370.  
  371.       @recipe = @list_window.recipe(@item)
  372.       for i in [email]1...@recipe.size[/email]
  373.         kind = @recipe[i][0]
  374.         id   = @recipe[i][1]
  375.         num  = @recipe[i][2]
  376.         if kind == "I"
  377.           item = $data_items[id]
  378.         elsif kind == "W"
  379.           item = $data_weapons[id]
  380.         elsif kind == "A"
  381.           item = $data_armors[id]
  382.         end
  383.         $game_party.lose_item(item, num*number)
  384.       end
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # 仠 屄悢擖椡偺廔椆
  388.   #--------------------------------------------------------------------------
  389.   def end_number_input
  390.     @number_window.hide
  391.     activate_list_window
  392.   end
  393.   #--------------------------------------------------------------------------
  394.   # 仠 嵟戝峸擖壜擻屄悢偺庢摼
  395.   #--------------------------------------------------------------------------
  396.   def max_buy
  397.     max = $game_party.max_item_number(@item) - $game_party.item_number(@item)
  398.  
  399.     @recipe = @list_window.recipe(@item)
  400.       for i in [email]1...@recipe.size[/email]
  401.         kind = @recipe[i][0]
  402.         id   = @recipe[i][1]
  403.         num  = @recipe[i][2]
  404.         if kind == "I"
  405.           item = $data_items[id]
  406.         elsif kind == "W"
  407.           item = $data_weapons[id]
  408.         elsif kind == "A"
  409.           item = $data_armors[id]
  410.         end
  411.         if num > 0
  412.           max_buf = $game_party.item_number(item)/num
  413.         else
  414.           max_buf = 999
  415.         end
  416.         max = [max, max_buf].min
  417.       end
  418.  
  419.     buying_price == 0 ? max : [max, money / buying_price].min
  420.  
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # 仠 強帩嬥偺庢摼
  424.   #--------------------------------------------------------------------------
  425.   def money
  426.     @gold_window.value
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # 仠 捠壿扨埵偺庢摼
  430.   #--------------------------------------------------------------------------
  431.   def currency_unit
  432.     @gold_window.currency_unit
  433.   end
  434.   #--------------------------------------------------------------------------
  435.   # 仠 崌惉旓梡偺庢摼
  436.   #--------------------------------------------------------------------------
  437.   def buying_price
  438.     @list_window.price(@item)
  439.   end
  440. end
  441.  
  442.  
  443. #==============================================================================
  444. # 仭 Window_ItemSynthesisList
  445. #------------------------------------------------------------------------------
  446. # 丂崌惉夋柺偱丄崌惉壜擻側傾僀僥儉偺堦棗傪昞帵偡傞僂傿儞僪僂偱偡丅
  447. #==============================================================================
  448.  
  449. class Window_ItemSynthesisList < Window_Selectable
  450.   include WD_itemsynthesis
  451.   #--------------------------------------------------------------------------
  452.   # 仠 岞奐僀儞僗僞儞僗曄悢
  453.   #--------------------------------------------------------------------------
  454.   attr_reader   :status_window            # 僗僥乕僞僗僂傿儞僪僂
  455.   #--------------------------------------------------------------------------
  456.   # 仠 僆僽僕僃僋僩弶婜壔
  457.   #--------------------------------------------------------------------------
  458.   def initialize(x, y, height)
  459.     super(x, y, window_width, height)
  460.  
  461.     @shop_goods = []
  462.     @shop_recipes = []
  463.  
  464.     for i in 1..WD_itemsynthesis_ini::I_recipe.size
  465.       recipe = WD_itemsynthesis_ini::I_recipe[i]
  466.       if recipe
  467.         good = [0, i, recipe[0]]
  468.         if i_recipe_switch_on?(i)
  469.           @shop_goods.push(good)
  470.           @shop_recipes.push(recipe)
  471.         end
  472.       end
  473.     end
  474.     for i in 1..WD_itemsynthesis_ini::W_recipe.size
  475.       recipe = WD_itemsynthesis_ini::W_recipe[i]
  476.       if recipe
  477.         good = [1, i, recipe[0]]
  478.         if w_recipe_switch_on?(i)
  479.           @shop_goods.push(good)
  480.           @shop_recipes.push(recipe)
  481.         end
  482.       end
  483.     end
  484.     for i in 1..WD_itemsynthesis_ini::A_recipe.size
  485.       recipe = WD_itemsynthesis_ini::A_recipe[i]
  486.       if recipe
  487.         good = [2, i, recipe[0]]
  488.         if a_recipe_switch_on?(i)
  489.           @shop_goods.push(good)
  490.           @shop_recipes.push(recipe)
  491.         end
  492.       end
  493.     end
  494.  
  495.     @money = 0
  496.     refresh
  497.     select(0)
  498.   end
  499.   #--------------------------------------------------------------------------
  500.   # 仠 僂傿儞僪僂暆偺庢摼
  501.   #--------------------------------------------------------------------------
  502.   def window_width
  503.     return 304
  504.   end
  505.   #--------------------------------------------------------------------------
  506.   # 仠 崁栚悢偺庢摼
  507.   #--------------------------------------------------------------------------
  508.   def item_max
  509.     @data ? @data.size : 1
  510.   end
  511.   #--------------------------------------------------------------------------
  512.   # 仠 傾僀僥儉偺庢摼
  513.   #--------------------------------------------------------------------------
  514.   def item
  515.     @data[index]
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # 仠 強帩嬥偺愝掕
  519.   #--------------------------------------------------------------------------
  520.   def money=(money)
  521.     @money = money
  522.     refresh
  523.   end
  524.   #--------------------------------------------------------------------------
  525.   # 仠 慖戰崁栚偺桳岠忬懺傪庢摼
  526.   #--------------------------------------------------------------------------
  527.   def current_item_enabled?
  528.     enable?(@data[index])
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # 仠 崌惉旓梡傪庢摼
  532.   #--------------------------------------------------------------------------
  533.   def price(item)
  534.     @price[item]
  535.   end
  536.   #--------------------------------------------------------------------------
  537.   # 仠 崌惉壜斲傪庢摼
  538.   #--------------------------------------------------------------------------
  539.   def enable?(item)
  540.     @makable[item]
  541.   end
  542.   #--------------------------------------------------------------------------
  543.   # 仠 儗僔僺傪庢摼
  544.   #--------------------------------------------------------------------------
  545.   def recipe(item)
  546.     @recipe[item]
  547.   end
  548.   #--------------------------------------------------------------------------
  549.   # 仠 傾僀僥儉傪嫋壜忬懺偱昞帵偡傞偐偳偆偐
  550.   #--------------------------------------------------------------------------
  551.   def have_mat?(recipe)
  552.     flag = true
  553.     if @money >= recipe[0]
  554.       for i in 1...recipe.size
  555.         kind = recipe[i][0]
  556.         id   = recipe[i][1]
  557.         num  = recipe[i][2]
  558.         if kind == "I"
  559.           item = $data_items[id]
  560.         elsif kind == "W"
  561.           item = $data_weapons[id]
  562.         elsif kind == "A"
  563.           item = $data_armors[id]
  564.         end
  565.         if $game_party.item_number(item) < [num, 1].max
  566.           flag = false
  567.         end
  568.       end
  569.     else
  570.       flag = false
  571.     end
  572.     return flag
  573.   end
  574.   #--------------------------------------------------------------------------
  575.   # 仠 僇僥僑儕偺愝掕
  576.   #--------------------------------------------------------------------------
  577.   def category=(category)
  578.     return if @category == category
  579.     @category = category
  580.     refresh
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # 仠 儕僼儗僢僔儏
  584.   #--------------------------------------------------------------------------
  585.   def refresh
  586.     make_item_list
  587.     create_contents
  588.     draw_all_items
  589.   end
  590.   #--------------------------------------------------------------------------
  591.   # 仠 傾僀僥儉傪儕僗僩偵娷傔傞偐偳偆偐
  592.   #--------------------------------------------------------------------------
  593.   def include?(item)
  594.     case @category
  595.     when :item
  596.       item.is_a?(RPG::Item) && !item.key_item?
  597.     when :weapon
  598.       item.is_a?(RPG::Weapon)
  599.     when :armor
  600.       item.is_a?(RPG::Armor)
  601.     when :key_item
  602.       item.is_a?(RPG::Item) && item.key_item?
  603.     else
  604.       false
  605.     end
  606.   end
  607.   #--------------------------------------------------------------------------
  608.   # 仠 傾僀僥儉儕僗僩偺嶌惉
  609.   #--------------------------------------------------------------------------
  610.   def make_item_list
  611.     @data = []
  612.     @price = {}
  613.     @makable = {}
  614.     @recipe = {}
  615.     for i in [email]0...@shop_goods.size[/email]
  616.       goods = @shop_goods[i]
  617.       recipe = @shop_recipes[i]
  618.       case goods[0]
  619.       when 0;  item = $data_items[goods[1]]
  620.       when 1;  item = $data_weapons[goods[1]]
  621.       when 2;  item = $data_armors[goods[1]]
  622.       end
  623.       if item
  624.         if include?(item)
  625.           @data.push(item)
  626.           @price[item] = goods[2]
  627.           @makable[item] = have_mat?(recipe) && $game_party.item_number(item) < $game_party.max_item_number(item)
  628.           @recipe[item] = recipe
  629.         end
  630.       end
  631.     end
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # 仠 崁栚偺昤夋
  635.   #--------------------------------------------------------------------------
  636.   def draw_item(index)
  637.     item = @data[index]
  638.     rect = item_rect(index)
  639.     draw_item_name(item, rect.x, rect.y, enable?(item))
  640.     rect.width -= 4
  641.     draw_text(rect, price(item), 2)  if WD_itemsynthesis_ini::Cost_view
  642.   end
  643.   #--------------------------------------------------------------------------
  644.   # 仠 僗僥乕僞僗僂傿儞僪僂偺愝掕
  645.   #--------------------------------------------------------------------------
  646.   def status_window=(status_window)
  647.     @status_window = status_window
  648.     call_update_help
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # 仠 慺嵽僂傿儞僪僂偺愝掕
  652.   #--------------------------------------------------------------------------
  653.   def material_window=(material_window)
  654.     @material_window = material_window
  655.     call_update_help
  656.   end
  657.   #--------------------------------------------------------------------------
  658.   # 仠 僿儖僾僥僉僗僩峏怴
  659.   #--------------------------------------------------------------------------
  660.   def update_help
  661.     @help_window.set_item(item) if @help_window
  662.     @status_window.item = item if @status_window
  663.     @material_window.set(item, recipe(item)) if @material_window
  664.   end
  665.   #--------------------------------------------------------------------------
  666.   # 仠 Z 儃僞儞乮昞帵愗懼乯偑墴偝傟偨偲偒偺張棟
  667.   #--------------------------------------------------------------------------
  668.   def process_change_window
  669.     Sound.play_cursor
  670.     Input.update
  671.     call_handler(:change_window)
  672.   end
  673.   #--------------------------------------------------------------------------
  674.   # 仠 寛掕傗僉儍儞僙儖側偳偺僴儞僪儕儞僌張棟
  675.   #--------------------------------------------------------------------------
  676.   def process_handling
  677.     super
  678.     if active
  679.       return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
  680. #      return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
  681.     end
  682.   end
  683. end
  684.  
  685.  
  686. #==============================================================================
  687. # 仭 Window_ItemSynthesisMaterial
  688. #------------------------------------------------------------------------------
  689. # 丂崌惉夋柺偱丄崌惉偵昁梫側慺嵽傪昞帵偡傞僂傿儞僪僂偱偡丅
  690. #==============================================================================
  691.  
  692. class Window_ItemSynthesisMaterial < Window_Base
  693.   #--------------------------------------------------------------------------
  694.   # 仠 僆僽僕僃僋僩弶婜壔
  695.   #--------------------------------------------------------------------------
  696.   def initialize(x, y, width, height)
  697.     super(x, y, width, height)
  698.     @item = nil
  699.     refresh
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # 仠 儕僼儗僢僔儏
  703.   #--------------------------------------------------------------------------
  704.   def refresh
  705.     contents.clear
  706.     draw_possession(4, 0)
  707.     draw_material_info(0, line_height * 2)
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # 仠 傾僀僥儉偺愝掕
  711.   #--------------------------------------------------------------------------
  712.   def set(item, recipe)
  713.     @item = item
  714.     @recipe = recipe
  715.     @make_number = 1
  716.     refresh
  717.   end
  718.   #--------------------------------------------------------------------------
  719.   # 仠 嶌惉屄悢偺愝掕
  720.   #--------------------------------------------------------------------------
  721.   def set_num(make_number)
  722.     @make_number = make_number
  723.     refresh
  724.   end
  725.   #--------------------------------------------------------------------------
  726.   # 仠 強帩悢偺昤夋
  727.   #--------------------------------------------------------------------------
  728.   def draw_possession(x, y)
  729.     rect = Rect.new(x, y, contents.width - 4 - x, line_height)
  730.     change_color(system_color)
  731.     draw_text(rect, Vocab::Possession)
  732.     change_color(normal_color)
  733.     draw_text(rect, $game_party.item_number(@item), 2)
  734.   end
  735.   #--------------------------------------------------------------------------
  736.   # 仠 慺嵽忣曬偺昤夋
  737.   #--------------------------------------------------------------------------
  738.   def draw_material_info(x, y)
  739.     rect = Rect.new(x, y, contents.width, line_height)
  740.     change_color(system_color)
  741.     contents.font.size = 18
  742.     draw_text(rect, "昁梫慺嵽", 0)
  743.     if @recipe
  744.       for i in [email]1...@recipe.size[/email]
  745.         kind = @recipe[i][0]
  746.         id   = @recipe[i][1]
  747.         num  = @recipe[i][2]
  748.         if kind == "I"
  749.           item = $data_items[id]
  750.         elsif kind == "W"
  751.           item = $data_weapons[id]
  752.         elsif kind == "A"
  753.           item = $data_armors[id]
  754.         end
  755.         rect = Rect.new(x, y + line_height*i, contents.width, line_height)
  756.         enabled = true
  757.         enabled = false if [num*@make_number, 1].max  > $game_party.item_number(item)
  758.         draw_item_name(item, rect.x, rect.y, enabled)
  759.         change_color(normal_color, enabled)
  760.         if num > 0
  761.           draw_text(rect, "#{num*@make_number}/#{$game_party.item_number(item)}", 2)
  762.         end
  763.       end
  764.     end
  765.     change_color(normal_color)
  766.     contents.font.size = 24
  767.   end
  768. end
  769.  
  770.  
  771. #==============================================================================
  772. # 仭 Window_ItemSynthesisNumber
  773. #------------------------------------------------------------------------------
  774. # 丂崌惉夋柺偱丄崌惉偡傞傾僀僥儉偺屄悢傪擖椡偡傞僂傿儞僪僂偱偡丅
  775. #==============================================================================
  776.  
  777. class Window_ItemSynthesisNumber < Window_ShopNumber
  778.   #--------------------------------------------------------------------------
  779.   # 仠 儕僼儗僢僔儏
  780.   #--------------------------------------------------------------------------
  781.   def refresh
  782.     contents.clear
  783.     draw_item_name(@item, 0, item_y)
  784.     draw_number
  785.     draw_total_price if WD_itemsynthesis_ini::Cost_view
  786.   end
  787.   #--------------------------------------------------------------------------
  788.   # 仠 僆僽僕僃僋僩弶婜壔
  789.   #--------------------------------------------------------------------------
  790.   def material_window=(material_window)
  791.     @material_window = material_window
  792.     call_update_help
  793.   end
  794.   #--------------------------------------------------------------------------
  795.   # 仠 嶌惉屄悢偺曄峏
  796.   #--------------------------------------------------------------------------
  797.   def change_number(amount)
  798.     @number = [[@number + amount, @max].min, 1].max
  799.     call_update_help #捛壛
  800.   end
  801.   #--------------------------------------------------------------------------
  802.   # 仠 僿儖僾僥僉僗僩峏怴
  803.   #--------------------------------------------------------------------------
  804.   def call_update_help
  805.     @material_window.set_num(@number) if @material_window
  806.   end
  807.   #--------------------------------------------------------------------------
  808.   # 仠 Z 儃僞儞乮昞帵愗懼乯偑墴偝傟偨偲偒偺張棟
  809.   #--------------------------------------------------------------------------
  810.   def process_change_window
  811.     Sound.play_cursor
  812.     Input.update
  813.     call_handler(:change_window)
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # 仠 寛掕傗僉儍儞僙儖側偳偺僴儞僪儕儞僌張棟
  817.   #--------------------------------------------------------------------------
  818.   def process_handling
  819.     super
  820.     if active
  821.       return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
  822. #      return process_change_window if handle?(:change_window) && Input.trigger?(:Z)
  823.     end
  824.   end
  825. end
  826.  
  827.  
  828. #==============================================================================
  829. # 仭 Window_ItemSynthesisCategory
  830. #------------------------------------------------------------------------------
  831. # 丂崌惉夋柺偱丄捠忢傾僀僥儉傗憰旛昳偺暘椶傪慖戰偡傞僂傿儞僪僂偱偡丅
  832. #==============================================================================
  833.  
  834. class Window_ItemSynthesisCategory < Window_ItemCategory
  835.   #--------------------------------------------------------------------------
  836.   # 仠 寘悢偺庢摼
  837.   #--------------------------------------------------------------------------
  838.   def col_max
  839.     i = 0
  840.     i += 1 if WD_itemsynthesis_ini::Category_i
  841.     i += 1 if WD_itemsynthesis_ini::Category_w
  842.     i += 1 if WD_itemsynthesis_ini::Category_a
  843.     i += 1 if WD_itemsynthesis_ini::Category_k
  844.     return i
  845.   end
  846.   #--------------------------------------------------------------------------
  847.   # 仠 僐儅儞僪儕僗僩偺嶌惉
  848.   #--------------------------------------------------------------------------
  849.   def make_command_list
  850.     add_command(Vocab::item,     :item)     if WD_itemsynthesis_ini::Category_i
  851.     add_command(Vocab::weapon,   :weapon)   if WD_itemsynthesis_ini::Category_w
  852.     add_command(Vocab::armor,    :armor)    if WD_itemsynthesis_ini::Category_a
  853.     add_command(Vocab::key_item, :key_item) if WD_itemsynthesis_ini::Category_k
  854.   end
  855. end
  856.  
  857.  
  858. #==============================================================================
  859. # 仭 Window_ItemSynthesisNumber
  860. #------------------------------------------------------------------------------
  861. # 丂崌惉夋柺偱丄愗懼傪昞帵偡傞僂傿儞僪僂偱偡丅
  862. #==============================================================================
  863.  
  864. class Window_ItemSynthesisChange < Window_Base
  865.   #--------------------------------------------------------------------------
  866.   # 仠 僆僽僕僃僋僩弶婜壔
  867.   #--------------------------------------------------------------------------
  868.   def initialize(x, y, width, height)
  869.     super(x, y, width, height)
  870.     refresh
  871.   end
  872.   #--------------------------------------------------------------------------
  873.   # 仠 儕僼儗僢僔儏
  874.   #--------------------------------------------------------------------------
  875.   def refresh
  876.     contents.clear
  877.     text = "Z: 慺嵽 佁 僗僥乕僞僗 昞帵愗傝懼偊"
  878.     draw_text(0, 0, contents_width, line_height, text, 1)
  879.   end
  880. end
   
【RMVA教程】
---------------------
欲买桂花同载酒,终不似,少年游.

Lv1.梦旅人

梦石
0
星屑
70
在线时间
345 小时
注册时间
2011-10-13
帖子
414
2
发表于 2015-12-10 08:26:06 | 只看该作者
{:2_276:}本来RM就不是当下流行的东西……
你看广场上不是有RM技术发布区和讨论区,还有提问区么,你去那里找找看,不明白再提问题就是了

点评

谢谢!  发表于 2015-12-12 14:51
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-19 12:02

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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