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

Project1

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

[已经解决] 求助合成武器得到随机属性该如何修改脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
128
在线时间
109 小时
注册时间
2013-8-10
帖子
46
跳转到指定楼层
1
发表于 2014-7-2 12:40:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
使用了合成脚本来进行武器防具合成,合成以后无法得到随机属性,想问问该怎么修改脚本
合成脚本
RUBY 代码复制
  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. #    合成レシピ等の設定
  18. #--------------------------------------------------------------------------
  19. module WD_itemsynthesis_ini
  20.  
  21.   Cost_view =  true #費用(G)の表示(合成の費用が全て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.   K_recipe = [] #この行は削除しないこと
  32.  
  33.   #以下、合成レシピ。
  34.   #例: I_recipe[3]  = [0, ["I",1,1], ["W",2,1], ["A",2,2], ["A",3,1]]
  35.   #と記載した場合、ID3のアイテムの合成必要は、100G。
  36.   #必要な素材は、ID1のアイテム1個、ID2の武器1個、ID2の防具2個、ID3の防具1個
  37.   #となる。
  38.  
  39.   #アイテムの合成レシピ
  40.   I_recipe[1]  = [0,  ["I",55,2]]
  41.   I_recipe[70] = [0, ["I",55,2], ["I",56,1]]
  42.   I_recipe[71] = [0, ["I",55,3], ["I",56,2], ["I",57,1]]
  43.   I_recipe[2] = [0, ["I",55,4], ["I",56,3], ["I",57,2], ["I",58,1]]
  44.   I_recipe[3] = [0, ["I",55,5], ["I",56,5], ["I",57,5], ["I",58,5], ["I",59,5]]
  45.   I_recipe[4] = [0, ["I",55,2], ["I",56,1]]
  46.   I_recipe[72] = [0, ["I",55,3], ["I",56,2], ["I",57,1]]
  47.   I_recipe[73] = [0, ["I",55,4], ["I",56,3], ["I",57,2], ["I",58,1]]
  48.   I_recipe[5] = [0, ["I",59,10], ["I",60,10], ["I",61,10]]
  49.   I_recipe[6] = [0, ["I",55,2], ["I",56,2], ]
  50.   I_recipe[7] = [0, ["I",55,5], ["I",56,5], ["I",57,5], ["I",58,5], ["I",59,5]]
  51.   I_recipe[8] = [0, ["I",59,20], ["I",60,20], ["I",61,20]]
  52.   I_recipe[76]  = [500,   ["I",86,1],["I",96,5]]
  53.   I_recipe[77]  = [500,   ["I",87,1],["I",96,5]]
  54.   I_recipe[78]  = [500,   ["I",88,1],["I",96,5]]
  55.   I_recipe[79]  = [500,   ["I",89,1],["I",96,5]]
  56.   I_recipe[80]  = [500,   ["I",90,1],["I",96,5]]
  57.   I_recipe[81]  = [500,   ["I",91,1],["I",96,5]]
  58.   I_recipe[82]  = [500,   ["I",92,1],["I",96,5]]
  59.   I_recipe[83]  = [500,   ["I",93,1],["I",96,5]]
  60.   I_recipe[84]  = [500,   ["I",94,1],["I",96,5]]
  61.   I_recipe[85]  = [500,   ["I",95,1],["I",96,5]]
  62.   I_recipe[98]  = [1000,   ["I",99,5]]
  63.  
  64.   #武器の合成レシピ
  65.   W_recipe[14]  = [0,   ["I",27,5]]
  66.   W_recipe[20]  = [0,   ["I",27,5]]
  67.   W_recipe[8]  = [0,   ["I",27,5]]
  68.   W_recipe[86]  = [0,   ["I",27,5]]
  69.   W_recipe[15]  = [0,   ["I",27,5], ["I",29,5]]
  70.   W_recipe[21]  = [0,   ["I",27,5], ["I",29,5]]
  71.   W_recipe[78]  = [0,   ["I",27,5], ["I",29,5]]
  72.   W_recipe[51]  = [0,   ["I",27,5], ["I",29,5]]
  73.   W_recipe[67]  = [0,   ["I",27,5], ["I",29,5], ["I",28,5]]
  74.   W_recipe[70]  = [0,   ["I",27,5], ["I",29,5], ["I",28,5]]  
  75.   W_recipe[9]  = [0,   ["I",27,5], ["I",29,5], ["I",28,5]]  
  76.   W_recipe[50]  = [0,   ["I",27,5], ["I",29,5], ["I",28,5]]
  77.   W_recipe[68]  = [0,   ["I",27,5], ["I",29,5], ["I",28,5]]
  78.   W_recipe[71]  = [0,   ["I",27,5], ["I",29,5], ["I",28,5]]
  79.   W_recipe[79]  = [0,   ["I",27,5], ["I",29,5], ["I",28,5]]
  80.   W_recipe[87]  = [0,   ["I",27,5], ["I",29,5], ["I",28,5]]
  81.   W_recipe[16]  = [0,   ["I",27,5], ["I",28,5], ["I",30,5]]
  82.   W_recipe[22]  = [0,   ["I",27,5], ["I",28,5], ["I",30,5]]
  83.   W_recipe[10]  = [0,   ["I",27,5], ["I",28,5], ["I",30,5]]
  84.   W_recipe[52]  = [0,   ["I",27,5], ["I",28,5], ["I",30,5]]
  85.   W_recipe[17]  = [0,   ["I",28,5], ["I",30,5], ["I",31,5]]
  86.   W_recipe[23]  = [0,   ["I",28,5], ["I",30,5], ["I",31,5]]
  87.   W_recipe[11]  = [0,   ["I",28,5], ["I",30,5], ["I",31,5]]  
  88.   W_recipe[53]  = [0,   ["I",28,5], ["I",30,5], ["I",31,5]]  
  89.   W_recipe[18]  = [0,   ["I",30,5], ["I",31,5], ["I",32,5]]  
  90.   W_recipe[24]  = [0,   ["I",30,5], ["I",31,5], ["I",32,5]]  
  91.   W_recipe[12]  = [0,   ["I",30,5], ["I",31,5], ["I",32,5]]
  92.   W_recipe[54]  = [0,   ["I",30,5], ["I",31,5], ["I",32,5]]
  93.   W_recipe[69]  = [0,   ["I",30,5], ["I",31,5], ["I",33,5]]
  94.   W_recipe[72]  = [0,   ["I",30,5], ["I",31,5], ["I",33,5]]
  95.   W_recipe[80]  = [0,   ["I",30,5], ["I",31,5], ["I",33,5]]
  96.   W_recipe[88]  = [0,   ["I",30,5], ["I",31,5], ["I",33,5]]
  97.   W_recipe[62]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
  98.   W_recipe[73]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
  99.   W_recipe[81]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
  100.   W_recipe[89]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
  101.   W_recipe[63]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]
  102.   W_recipe[74]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]  
  103.   W_recipe[82]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]  
  104.   W_recipe[90]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]  
  105.   W_recipe[94]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]  
  106.   W_recipe[98]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]  
  107.   W_recipe[102]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]  
  108.   W_recipe[106]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]  
  109.   W_recipe[95]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]  
  110.   W_recipe[99]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]  
  111.   W_recipe[103]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]  
  112.   W_recipe[107]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]  
  113.   W_recipe[96]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]  
  114.   W_recipe[0]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]  
  115.   W_recipe[104]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]  
  116.   W_recipe[108]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]  
  117.   W_recipe[97]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]  
  118.   W_recipe[101]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]  
  119.   W_recipe[105]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]  
  120.   W_recipe[109]  = [0,   ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]  
  121.   W_recipe[64]  = [0,   ["I",27,10], ["I",28,10], ["I",29,10], ["I",30,10],["I",31,10], ["I",32,10], ["I",33,10]]
  122.   W_recipe[75]  = [0,   ["I",27,10], ["I",28,10], ["I",29,10], ["I",30,10],["I",31,10], ["I",32,10], ["I",33,10]]
  123.   W_recipe[83]  = [0,   ["I",27,10], ["I",28,10], ["I",29,10], ["I",30,10],["I",31,10], ["I",32,10], ["I",33,10]]
  124.   W_recipe[91]  = [0,   ["I",27,10], ["I",28,10], ["I",29,10], ["I",30,10],["I",31,10], ["I",32,10], ["I",33,10]]
  125.   W_recipe[65]  = [0,   ["I",27,10], ["I",28,10], ["I",29,10], ["I",30,10],["I",31,10], ["I",32,10], ["I",33,10], ["I",68,10], ["I",69,10]]
  126.   W_recipe[76]  = [0,   ["I",27,10], ["I",28,10], ["I",29,10], ["I",30,10],["I",31,10], ["I",32,10], ["I",33,10], ["I",68,10], ["I",69,10]]
  127.   W_recipe[84]  = [0,   ["I",27,10], ["I",28,10], ["I",29,10], ["I",30,10],["I",31,10], ["I",32,10], ["I",33,10], ["I",68,10], ["I",69,10]]
  128.   W_recipe[92]  = [0,   ["I",27,10], ["I",28,10], ["I",29,10], ["I",30,10],["I",31,10], ["I",32,10], ["I",33,10], ["I",68,10], ["I",69,10]]
  129.   W_recipe[66]  = [0,   ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
  130.   W_recipe[77]  = [0,   ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
  131.   W_recipe[85]  = [0,   ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
  132.   W_recipe[93]  = [0,   ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
  133.   W_recipe[61]  = [0,   ["I",30,10],["I",31,10], ["I",33,10], ["I",68,10], ["I",69,10]]
  134.  
  135.   #防具の合成レシピ  
  136.   A_recipe[61]  = [0,   ["I",34,5]]
  137.   A_recipe[11]  = [0,   ["I",34,5],["I",35,5]]
  138.   A_recipe[12]  = [0,   ["I",35,5],["I",36,5]]
  139.   A_recipe[62]  = [0,   ["I",35,5],["I",36,5],["I",37,5]]
  140.   A_recipe[63]  = [0,   ["I",36,5],["I",37,5],["I",38,5]]
  141.   A_recipe[64]  = [0,   ["I",38,5],["I",39,5]]
  142.   A_recipe[65]  = [0,   ["I",38,5],["I",39,5],["I",40,5]]
  143.   A_recipe[66]  = [0,   ["I",38,5],["I",39,5],["I",40,5]]
  144.   A_recipe[13]  = [0,   ["I",37,5],["I",38,5],["I",39,5],["I",40,5]]
  145.   A_recipe[15]  = [0,   ["I",39,20],["I",40,20],["I",64,5],["I",65,5],["I",63,5],["I",66,5],["I",62,5],["I",67,5]]
  146.   A_recipe[14]  = [0,   ["I",39,20],["I",40,20],["I",64,10],["I",65,10],["I",63,10],["I",66,10],["I",62,10],["I",67,10]]
  147.   A_recipe[67]  = [0,   ["I",39,20],["I",40,20],["I",64,15],["I",65,15],["I",63,15],["I",66,15],["I",62,15],["I",67,15]]
  148.   A_recipe[16]  = [0,   ["I",34,5]]
  149.   A_recipe[17]  = [0,   ["I",34,5],["I",35,5]]
  150.   A_recipe[18]  = [0,   ["I",35,5],["I",36,5]]
  151.   A_recipe[19]  = [0,   ["I",35,5],["I",36,5],["I",37,5]]
  152.   A_recipe[20]  = [0,   ["I",36,5],["I",37,5],["I",38,5]]
  153.   A_recipe[68]  = [0,   ["I",38,5],["I",39,5]]
  154.   A_recipe[69]  = [0,   ["I",38,5],["I",39,5],["I",40,5]]
  155.   A_recipe[70]  = [0,   ["I",38,5],["I",39,5],["I",40,5]]
  156.   A_recipe[71]  = [0,   ["I",37,5],["I",38,5],["I",39,5],["I",40,5]]
  157.   A_recipe[72]  = [0,   ["I",39,10],["I",40,10],["I",64,5],["I",65,5],["I",63,5],["I",66,5],["I",62,5],["I",67,5]]
  158.   A_recipe[73]  = [0,   ["I",39,10],["I",40,10],["I",64,10],["I",65,10],["I",63,10],["I",66,10],["I",62,10],["I",67,10]]
  159.   A_recipe[74]  = [0,   ["I",39,10],["I",40,10],["I",64,15],["I",65,15],["I",63,15],["I",66,15],["I",62,15],["I",67,15]]
  160.   A_recipe[26]  = [0,   ["I",41,3]]
  161.   A_recipe[27]  = [0,   ["I",41,3],["I",42,2]]
  162.   A_recipe[28]  = [0,   ["I",42,5],["I",43,5]]
  163.   A_recipe[29]  = [0,   ["I",42,5],["I",43,5],["I",44,5]]
  164.   A_recipe[30]  = [0,   ["I",43,5],["I",44,5],["I",45,5]]
  165.   A_recipe[75]  = [0,   ["I",45,5],["I",46,5]]
  166.   A_recipe[76]  = [0,   ["I",45,5],["I",46,5],["I",47,5]]
  167.   A_recipe[77]  = [0,   ["I",45,5],["I",46,5],["I",47,5]]
  168.   A_recipe[78]  = [0,   ["I",44,5],["I",45,5],["I",46,5],["I",47,5]]
  169.   A_recipe[79]  = [0,   ["I",46,10],["I",47,10],["I",64,5],["I",65,5],["I",63,5],["I",66,5],["I",62,5],["I",67,5]]
  170.   A_recipe[80]  = [0,   ["I",46,10],["I",47,10],["I",64,10],["I",65,10],["I",63,10],["I",66,10],["I",62,10],["I",67,10]]
  171.   A_recipe[81]  = [0,   ["I",46,15],["I",47,15],["I",64,15],["I",65,15],["I",63,15],["I",66,15],["I",62,15],["I",67,15]]
  172.   A_recipe[21]  = [0,   ["I",41,5]]
  173.   A_recipe[22]  = [0,   ["I",41,5],["I",42,5]]
  174.   A_recipe[23]  = [0,   ["I",42,5],["I",43,5]]
  175.   A_recipe[24]  = [0,   ["I",42,5],["I",43,5],["I",44,5]]
  176.   A_recipe[25]  = [0,   ["I",43,5],["I",44,5],["I",45,5]]
  177.   A_recipe[82]  = [0,   ["I",45,5],["I",46,5]]
  178.   A_recipe[83]  = [0,   ["I",45,5],["I",46,5],["I",47,5]]
  179.   A_recipe[84]  = [0,   ["I",45,5],["I",46,5],["I",47,5]]
  180.   A_recipe[85]  = [0,   ["I",44,5],["I",45,5],["I",46,5],["I",47,5]]
  181.   A_recipe[86]  = [0,   ["I",46,20],["I",47,20],["I",64,5],["I",65,5],["I",63,5],["I",66,5],["I",62,5],["I",67,5]]
  182.   A_recipe[87]  = [0,   ["I",46,20],["I",47,20],["I",64,10],["I",65,10],["I",63,10],["I",66,10],["I",62,10],["I",67,10]]
  183.   A_recipe[88]  = [0,   ["I",46,20],["I",47,20],["I",64,15],["I",65,15],["I",63,15],["I",66,15],["I",62,15],["I",67,15]]
  184.   A_recipe[36]  = [0,   ["I",27,3]]
  185.   A_recipe[37]  = [0,   ["I",27,3],["I",29,2]]
  186.   A_recipe[38]  = [0,   ["I",28,5],["I",29,5]]
  187.   A_recipe[39]  = [0,   ["I",28,5],["I",29,5],["I",30,5]]
  188.   A_recipe[40]  = [0,   ["I",29,5],["I",30,5],["I",31,5]]
  189.   A_recipe[89]  = [0,   ["I",31,5],["I",32,5]]
  190.   A_recipe[90]  = [0,   ["I",31,5],["I",32,5],["I",33,5]]
  191.   A_recipe[91]  = [0,   ["I",31,5],["I",32,5],["I",33,5]]
  192.   A_recipe[92]  = [0,   ["I",30,5],["I",31,5],["I",32,5],["I",33,5]]
  193.   A_recipe[93]  = [0,   ["I",32,10],["I",33,10],["I",64,5],["I",65,5],["I",63,5],["I",66,5],["I",62,5],["I",67,5]]
  194.   A_recipe[94]  = [0,   ["I",32,10],["I",33,10],["I",64,10],["I",65,10],["I",63,10],["I",66,10],["I",62,10],["I",67,10]]
  195.   A_recipe[95]  = [0,   ["I",32,10],["I",33,10],["I",64,15],["I",65,15],["I",63,15],["I",66,15],["I",62,15],["I",67,15]]
  196.   A_recipe[31]  = [0,   ["I",27,5]]
  197.   A_recipe[32]  = [0,   ["I",27,5],["I",29,5]]
  198.   A_recipe[33]  = [0,   ["I",28,5],["I",29,5]]
  199.   A_recipe[34]  = [0,   ["I",28,5],["I",29,5],["I",30,5]]
  200.   A_recipe[35]  = [0,   ["I",29,5],["I",30,5],["I",31,5]]
  201.   A_recipe[96]  = [0,   ["I",31,5],["I",32,5]]
  202.   A_recipe[97]  = [0,   ["I",31,5],["I",32,5],["I",33,5]]
  203.   A_recipe[98]  = [0,   ["I",31,5],["I",32,5],["I",33,5]]
  204.   A_recipe[99]  = [0,   ["I",30,5],["I",31,5],["I",32,5],["I",40,5]]
  205.   A_recipe[100]  = [0,   ["I",32,20],["I",33,20],["I",64,5],["I",65,5],["I",63,5],["I",66,5],["I",62,5],["I",67,5]]
  206.   A_recipe[101]  = [0,   ["I",32,20],["I",33,20],["I",64,10],["I",65,10],["I",63,10],["I",66,10],["I",62,10],["I",67,10]]
  207.   A_recipe[102]  = [0,   ["I",32,20],["I",33,20],["I",64,15],["I",65,15],["I",63,15],["I",66,15],["I",62,15],["I",67,15]]
  208.  
  209.   #大事なもの合成レシピ
  210.   #K_recipe[76]  = [0,   ["I",86,1],["I",96,10]]
  211.   #K_recipe[77]  = [0,   ["I",87,1],["I",96,10]]
  212.   #K_recipe[78]  = [0,   ["I",88,1],["I",96,10]]
  213.   #K_recipe[79]  = [0,   ["I",89,1],["I",96,10]]
  214.   #K_recipe[80]  = [0,   ["I",90,1],["I",96,10]]
  215.   #K_recipe[81]  = [0,   ["I",91,1],["I",96,10]]
  216.   #K_recipe[82]  = [0,   ["I",92,1],["I",96,10]]
  217.   #K_recipe[83]  = [0,   ["I",93,1],["I",96,10]]
  218.   #K_recipe[84]  = [0,   ["I",94,1],["I",96,10]]
  219.   #K_recipe[85]  = [0,   ["I",95,1],["I",96,10]]
  220.  
  221.  
  222. end
  223.  
  224.  
  225. #==============================================================================
  226. # ■ WD_itemsynthesis
  227. #------------------------------------------------------------------------------
  228. #  アイテム合成用の共通メソッドです。
  229. #==============================================================================
  230.  
  231. module WD_itemsynthesis
  232.   def i_recipe_switch_on(id)
  233.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  234.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  235.     $game_system.i_rcp_sw[id] = true
  236.   end
  237.   def i_recipe_switch_off(id)
  238.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  239.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  240.     $game_system.i_rcp_sw[id] = false
  241.   end
  242.   def i_recipe_switch_on?(id)
  243.     $game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
  244.     $game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
  245.     return $game_system.i_rcp_sw[id]
  246.   end
  247.   def i_recipe_all_switch_on
  248.     for i in 1..$data_items.size
  249.       i_recipe_switch_on(i)
  250.     end
  251.   end
  252.   def i_recipe_all_switch_off
  253.     for i in 1..$data_items.size
  254.       i_recipe_switch_off(i)
  255.     end
  256.   end
  257.   def w_recipe_switch_on(id)
  258.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  259.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  260.     $game_system.w_rcp_sw[id] = true
  261.   end
  262.   def w_recipe_switch_off(id)
  263.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  264.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  265.     $game_system.w_rcp_sw[id] = false
  266.   end
  267.   def w_recipe_switch_on?(id)
  268.     $game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
  269.     $game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
  270.     return $game_system.w_rcp_sw[id]
  271.   end
  272.   def w_recipe_all_switch_on
  273.     for i in 1..$data_weapons.size
  274.       w_recipe_switch_on(i)
  275.     end
  276.   end
  277.   def w_recipe_all_switch_off
  278.     for i in 1..$data_weapons.size
  279.       w_recipe_switch_off(i)
  280.     end
  281.   end
  282.   def a_recipe_switch_on(id)
  283.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  284.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  285.     $game_system.a_rcp_sw[id] = true
  286.   end
  287.   def a_recipe_switch_off(id)
  288.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  289.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  290.     $game_system.a_rcp_sw[id] = false
  291.   end
  292.   def a_recipe_switch_on?(id)
  293.     $game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
  294.     $game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
  295.     return $game_system.a_rcp_sw[id]
  296.   end
  297.   def a_recipe_all_switch_on
  298.     for i in 1..$data_armors.size
  299.       a_recipe_switch_on(i)
  300.     end
  301.   end
  302.   def a_recipe_all_switch_off
  303.     for i in 1..$data_armors.size
  304.       a_recipe_switch_off(i)
  305.     end
  306.   end
  307.   def recipe_all_switch_on
  308.     i_recipe_all_switch_on
  309.     w_recipe_all_switch_on
  310.     a_recipe_all_switch_on
  311.   end
  312.   def recipe_all_switch_off
  313.     i_recipe_all_switch_off
  314.     w_recipe_all_switch_off
  315.     a_recipe_all_switch_off
  316.   end
  317.  
  318. end
  319.  
  320. class Game_Interpreter
  321.   include WD_itemsynthesis
  322. end
  323.  
  324. class Game_System
  325.   #--------------------------------------------------------------------------
  326.   # ● 公開インスタンス変数
  327.   #--------------------------------------------------------------------------
  328.   attr_accessor :i_rcp_sw
  329.   attr_accessor :w_rcp_sw
  330.   attr_accessor :a_rcp_sw
  331.   attr_accessor :K_rcp_sw
  332.   #--------------------------------------------------------------------------
  333.   # ● オブジェクト初期化
  334.   #--------------------------------------------------------------------------
  335.   alias wd_orig_initialize004 initialize
  336.   def initialize
  337.     wd_orig_initialize004
  338.     @i_rcp_sw = []
  339.     @w_rcp_sw = []
  340.     @a_rcp_sw = []
  341.     @K_rcp_sw = []
  342.   end
  343. end
  344.  
  345.  
  346. #==============================================================================
  347. # ■ Scene_ItemSynthesis
  348. #------------------------------------------------------------------------------
  349. #  合成画面の処理を行うクラスです。
  350. #==============================================================================
  351.  
  352. class Scene_ItemSynthesis < Scene_MenuBase
  353.   #--------------------------------------------------------------------------
  354.   # ● 開始処理
  355.   #--------------------------------------------------------------------------
  356.   def start
  357.     super
  358.     create_help_window
  359.     create_dummy_window
  360.     create_number_window
  361.     create_status_window
  362.     create_material_window
  363.     create_list_window
  364.     create_category_window
  365.     create_gold_window
  366.     create_change_window
  367.   end
  368.   #--------------------------------------------------------------------------
  369.   # ● ゴールドウィンドウの作成
  370.   #--------------------------------------------------------------------------
  371.   def create_gold_window
  372.     @gold_window = Window_Gold.new
  373.     @gold_window.viewport = @viewport
  374.     @gold_window.x = Graphics.width - @gold_window.width
  375.     @gold_window.y = @help_window.height
  376.     @gold_window.hide
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # ● 切り替え表示ウィンドウの作成
  380.   #--------------------------------------------------------------------------
  381.   def create_change_window
  382.     wx = 0
  383.     wy = @gold_window.y
  384.     ww = Graphics.width - @gold_window.width
  385.     wh = @gold_window.height
  386.     @change_window = Window_ItemSynthesisChange.new(wx, wy, ww, wh)
  387.     @change_window.viewport = @viewport
  388.     @change_window.hide
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # ● ダミーウィンドウの作成
  392.   #--------------------------------------------------------------------------
  393.   def create_dummy_window
  394.     wy = @help_window.y + @help_window.height + 48
  395.     wh = Graphics.height - wy
  396.     @dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
  397.     @dummy_window.viewport = @viewport
  398.   end
  399.   #--------------------------------------------------------------------------
  400.   # ● 個数入力ウィンドウの作成
  401.   #--------------------------------------------------------------------------
  402.   def create_number_window
  403.     wy = @dummy_window.y
  404.     wh = @dummy_window.height
  405.     @number_window = Window_ItemSynthesisNumber.new(0, wy, wh)
  406.     @number_window.viewport = @viewport
  407.     @number_window.hide
  408.     @number_window.set_handler(:ok,     method(:on_number_ok))
  409.     @number_window.set_handler(:cancel, method(:on_number_cancel))
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● ステータスウィンドウの作成
  413.   #--------------------------------------------------------------------------
  414.   def create_status_window
  415.     wx = @number_window.width
  416.     wy = @dummy_window.y
  417.     ww = Graphics.width - wx
  418.     wh = @dummy_window.height
  419.     @status_window = Window_ShopStatus.new(wx, wy, ww, wh)
  420.     @status_window.viewport = @viewport
  421.     @status_window.hide
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # ● 素材ウィンドウの作成
  425.   #--------------------------------------------------------------------------
  426.   def create_material_window
  427.     wx = @number_window.width
  428.     wy = @dummy_window.y
  429.     ww = Graphics.width - wx
  430.     wh = @dummy_window.height
  431.     @material_window = Window_ItemSynthesisMaterial.new(wx, wy, ww, wh)
  432.     @material_window.viewport = @viewport
  433.     @material_window.hide
  434.     @number_window.material_window = @material_window
  435.   end
  436.   #--------------------------------------------------------------------------
  437.   # ● 合成アイテムリストウィンドウの作成
  438.   #--------------------------------------------------------------------------
  439.   def create_list_window
  440.     wy = @dummy_window.y
  441.     wh = @dummy_window.height
  442.     @list_window = Window_ItemSynthesisList.new(0, wy, wh)
  443.     @list_window.viewport = @viewport
  444.     @list_window.help_window = @help_window
  445.     @list_window.status_window = @status_window
  446.     @list_window.material_window = @material_window
  447.     @list_window.hide
  448.     @list_window.set_handler(:ok,     method(:on_list_ok))
  449.     @list_window.set_handler(:cancel, method(:on_list_cancel))
  450.     @list_window.set_handler(:change_window, method(:on_change_window))   
  451.   end
  452.   #--------------------------------------------------------------------------
  453.   # ● カテゴリウィンドウの作成
  454.   #--------------------------------------------------------------------------
  455.   def create_category_window
  456.     @category_window = Window_ItemSynthesisCategory.new
  457.     @category_window.viewport = @viewport
  458.     @category_window.help_window = @help_window
  459.     @category_window.y = @help_window.height
  460.     @category_window.activate
  461.     @category_window.item_window = @list_window
  462.     @category_window.set_handler(:ok,     method(:on_category_ok))
  463.     @category_window.set_handler(:cancel, method(:return_scene))
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # ● 合成アイテムリストウィンドウのアクティブ化
  467.   #--------------------------------------------------------------------------
  468.   def activate_list_window
  469.     @list_window.money = money
  470.     @list_window.show.activate
  471.   end
  472.   #--------------------------------------------------------------------------
  473.   # ● 合成[決定]
  474.   #--------------------------------------------------------------------------
  475.   def on_list_ok
  476.     @item = @list_window.item
  477.     @list_window.hide
  478.     @number_window.set(@item, max_buy, buying_price, currency_unit)
  479.     @number_window.show.activate
  480.   end
  481.   #--------------------------------------------------------------------------
  482.   # ● 合成[キャンセル]
  483.   #--------------------------------------------------------------------------
  484.   def on_list_cancel
  485.     @category_window.activate
  486.     @category_window.show
  487.     @dummy_window.show
  488.     @list_window.hide
  489.     @status_window.hide
  490.     @status_window.item = nil
  491.     @material_window.hide
  492.     @material_window.set(nil, nil)
  493.     @gold_window.hide
  494.     @change_window.hide
  495.     @help_window.clear
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ● 表示切替
  499.   #--------------------------------------------------------------------------
  500.   def on_change_window
  501.     if @status_window.visible
  502.       @status_window.hide
  503.       @material_window.show
  504.     else
  505.       @status_window.show
  506.       @material_window.hide
  507.     end
  508.   end
  509.   #--------------------------------------------------------------------------
  510.   # ● カテゴリ[決定]
  511.   #--------------------------------------------------------------------------
  512.   def on_category_ok
  513.     activate_list_window
  514.     @gold_window.show
  515.     @change_window.show
  516.     @material_window.show
  517.     @category_window.hide
  518.     @list_window.select(0)
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # ● 個数入力[決定]
  522.   #--------------------------------------------------------------------------
  523.   def on_number_ok
  524.     Sound.play_shop
  525.     do_syntetic(@number_window.number)
  526.     end_number_input
  527.     @gold_window.refresh
  528.   end
  529.   #--------------------------------------------------------------------------
  530.   # ● 個数入力[キャンセル]
  531.   #--------------------------------------------------------------------------
  532.   def on_number_cancel
  533.     Sound.play_cancel
  534.     end_number_input
  535.   end
  536.   #--------------------------------------------------------------------------
  537.   # ● 合成の実行
  538.   #--------------------------------------------------------------------------
  539.   def do_syntetic(number)
  540.     $game_party.lose_gold(number * buying_price)
  541.     $game_party.gain_item(@item, number)
  542.  
  543.       [url=home.php?mod=space&uid=2564094]@recipe[/url] = @list_window.recipe(@item)
  544.       for i in [email]1...@recipe.size[/email]
  545.         kind = @recipe[i][0]
  546.         id   = @recipe[i][1]
  547.         num  = @recipe[i][2]
  548.         if kind == "I"
  549.           item = $data_items[id]
  550.         elsif kind == "W"
  551.           item = $data_weapons[id]
  552.         elsif kind == "A"
  553.           item = $data_armors[id]
  554.           elsif kind == "K"
  555.           item = $data_key_item[id]
  556.         end
  557.         $game_party.lose_item(item, num*number)
  558.       end
  559.   end
  560.   #--------------------------------------------------------------------------
  561.   # ● 個数入力の終了
  562.   #--------------------------------------------------------------------------
  563.   def end_number_input
  564.     @number_window.hide
  565.     activate_list_window
  566.   end
  567.   #--------------------------------------------------------------------------
  568.   # ● 最大購入可能個数の取得
  569.   #--------------------------------------------------------------------------
  570.   def max_buy
  571.     max = $game_party.max_item_number(@item) - $game_party.item_number(@item)
  572.  
  573.     @recipe = @list_window.recipe(@item)
  574.       for i in [email]1...@recipe.size[/email]
  575.         kind = @recipe[i][0]
  576.         id   = @recipe[i][1]
  577.         num  = @recipe[i][2]
  578.         if kind == "I"
  579.           item = $data_items[id]
  580.         elsif kind == "W"
  581.           item = $data_weapons[id]
  582.         elsif kind == "A"
  583.           item = $data_armors[id]
  584.            elsif kind == "K"
  585.           item = $data_key_item[id]
  586.         end
  587.         if num > 0
  588.           max_buf = $game_party.item_number(item)/num
  589.         else
  590.           max_buf = 999
  591.         end
  592.         max = [max, max_buf].min
  593.       end
  594.  
  595.     buying_price == 0 ? max : [max, money / buying_price].min
  596.  
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # ● 所持金の取得
  600.   #--------------------------------------------------------------------------
  601.   def money
  602.     @gold_window.value
  603.   end
  604.   #--------------------------------------------------------------------------
  605.   # ● 通貨単位の取得
  606.   #--------------------------------------------------------------------------
  607.   def currency_unit
  608.     @gold_window.currency_unit
  609.   end
  610.   #--------------------------------------------------------------------------
  611.   # ● 合成費用の取得
  612.   #--------------------------------------------------------------------------
  613.   def buying_price
  614.     @list_window.price(@item)
  615.   end
  616. end
  617.  
  618.  
  619. #==============================================================================
  620. # ■ Window_ItemSynthesisList
  621. #------------------------------------------------------------------------------
  622. #  合成画面で、合成可能なアイテムの一覧を表示するウィンドウです。
  623. #==============================================================================
  624.  
  625. class Window_ItemSynthesisList < Window_Selectable
  626.   include WD_itemsynthesis
  627.   #--------------------------------------------------------------------------
  628.   # ● 公開インスタンス変数
  629.   #--------------------------------------------------------------------------
  630.   attr_reader   :status_window            # ステータスウィンドウ
  631.   #--------------------------------------------------------------------------
  632.   # ● オブジェクト初期化
  633.   #--------------------------------------------------------------------------
  634.   def initialize(x, y, height)
  635.     super(x, y, window_width, height)
  636.  
  637.     @shop_goods = []
  638.     @shop_recipes = []
  639.  
  640.     for i in 1..WD_itemsynthesis_ini::I_recipe.size
  641.       recipe = WD_itemsynthesis_ini::I_recipe[i]
  642.       if recipe
  643.         good = [0, i, recipe[0]]
  644.         if i_recipe_switch_on?(i)
  645.           @shop_goods.push(good)
  646.           @shop_recipes.push(recipe)
  647.         end
  648.       end
  649.     end
  650.     for i in 1..WD_itemsynthesis_ini::W_recipe.size
  651.       recipe = WD_itemsynthesis_ini::W_recipe[i]
  652.       if recipe
  653.         good = [1, i, recipe[0]]
  654.         if w_recipe_switch_on?(i)
  655.           @shop_goods.push(good)
  656.           @shop_recipes.push(recipe)
  657.         end
  658.       end
  659.     end
  660.     for i in 1..WD_itemsynthesis_ini::A_recipe.size
  661.       recipe = WD_itemsynthesis_ini::A_recipe[i]
  662.       if recipe
  663.         good = [2, i, recipe[0]]
  664.         if a_recipe_switch_on?(i)
  665.           @shop_goods.push(good)
  666.           @shop_recipes.push(recipe)
  667.         end
  668.       end
  669.     end
  670.     for i in 1..WD_itemsynthesis_ini::K_recipe.size
  671.       recipe = WD_itemsynthesis_ini::K_recipe[i]
  672.       if recipe
  673.         good = [2, i, recipe[0]]
  674.         if a_recipe_switch_on?(i)
  675.           @shop_goods.push(good)
  676.           @shop_recipes.push(recipe)
  677.         end
  678.       end
  679.     end
  680.  
  681.     [url=home.php?mod=space&uid=26101]@Money[/url] = 0
  682.     refresh
  683.     select(0)
  684.   end
  685.   #--------------------------------------------------------------------------
  686.   # ● ウィンドウ幅の取得
  687.   #--------------------------------------------------------------------------
  688.   def window_width
  689.     return 304
  690.   end
  691.   #--------------------------------------------------------------------------
  692.   # ● 項目数の取得
  693.   #--------------------------------------------------------------------------
  694.   def item_max
  695.     @data ? @data.size : 1
  696.   end
  697.   #--------------------------------------------------------------------------
  698.   # ● アイテムの取得
  699.   #--------------------------------------------------------------------------
  700.   def item
  701.     @data[index]
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # ● 所持金の設定
  705.   #--------------------------------------------------------------------------
  706.   def money=(money)
  707.     @money = money
  708.     refresh
  709.   end
  710.   #--------------------------------------------------------------------------
  711.   # ● 選択項目の有効状態を取得
  712.   #--------------------------------------------------------------------------
  713.   def current_item_enabled?
  714.     enable?(@data[index])
  715.   end
  716.   #--------------------------------------------------------------------------
  717.   # ● 合成費用を取得
  718.   #--------------------------------------------------------------------------
  719.   def price(item)
  720.     @price[item]
  721.   end
  722.   #--------------------------------------------------------------------------
  723.   # ● 合成可否を取得
  724.   #--------------------------------------------------------------------------
  725.   def enable?(item)
  726.     @makable[item]
  727.   end
  728.   #--------------------------------------------------------------------------
  729.   # ● レシピを取得
  730.   #--------------------------------------------------------------------------
  731.   def recipe(item)
  732.     @recipe[item]
  733.   end
  734.   #--------------------------------------------------------------------------
  735.   # ● アイテムを許可状態で表示するかどうか
  736.   #--------------------------------------------------------------------------
  737.   def have_mat?(recipe)
  738.     flag = true
  739.     if @money >= recipe[0]
  740.       for i in 1...recipe.size
  741.         kind = recipe[i][0]
  742.         id   = recipe[i][1]
  743.         num  = recipe[i][2]
  744.         if kind == "I"
  745.           item = $data_items[id]
  746.         elsif kind == "W"
  747.           item = $data_weapons[id]
  748.         elsif kind == "A"
  749.           item = $data_armors[id]
  750.            elsif kind == "K"
  751.           item = $data_key_item[id]
  752.         end
  753.         if $game_party.item_number(item) < [num, 1].max
  754.           flag = false
  755.         end
  756.       end
  757.     else
  758.       flag = false
  759.     end
  760.     return flag
  761.   end
  762.   #--------------------------------------------------------------------------
  763.   # ● カテゴリの設定
  764.   #--------------------------------------------------------------------------
  765.   def category=(category)
  766.     return if @category == category
  767.     @category = category
  768.     refresh
  769.   end
  770.   #--------------------------------------------------------------------------
  771.   # ● リフレッシュ
  772.   #--------------------------------------------------------------------------
  773.   def refresh
  774.     make_item_list
  775.     create_contents
  776.     draw_all_items
  777.   end
  778.   #--------------------------------------------------------------------------
  779.   # ● アイテムをリストに含めるかどうか
  780.   #--------------------------------------------------------------------------
  781.   def include?(item)
  782.     case @category
  783.     when :item
  784.       item.is_a?(RPG::Item) && !item.key_item?
  785.     when :weapon
  786.       item.is_a?(RPG::Weapon)
  787.     when :armor
  788.       item.is_a?(RPG::Armor)
  789.     when :key_item
  790.       item.is_a?(RPG::Item) && item.key_item?
  791.     else
  792.       false
  793.     end
  794.   end
  795.   #--------------------------------------------------------------------------
  796.   # ● アイテムリストの作成
  797.   #--------------------------------------------------------------------------
  798.   def make_item_list
  799.     @data = []
  800.     @price = {}
  801.     @makable = {}
  802.     @recipe = {}
  803.     for i in [email]0...@shop_goods.size[/email]
  804.       goods = @shop_goods[i]
  805.       recipe = @shop_recipes[i]
  806.       case goods[0]
  807.       when 0;  item = $data_items[goods[1]]
  808.       when 1;  item = $data_weapons[goods[1]]
  809.       when 2;  item = $data_armors[goods[1]]
  810.       when 3;  item = $data_key_item[goods[1]]
  811.       end
  812.       if item
  813.         if include?(item)
  814.           @data.push(item)
  815.           @price[item] = goods[2]
  816.           @makable[item] = have_mat?(recipe)
  817.           @recipe[item] = recipe
  818.         end
  819.       end
  820.     end
  821.   end
  822.   #--------------------------------------------------------------------------
  823.   # ● 項目の描画
  824.   #--------------------------------------------------------------------------
  825.   def draw_item(index)
  826.     item = @data[index]
  827.     rect = item_rect(index)
  828.     draw_item_name(item, rect.x, rect.y, enable?(item))
  829.     rect.width -= 4
  830.     draw_text(rect, price(item), 2)  if WD_itemsynthesis_ini::Cost_view
  831.   end
  832.   #--------------------------------------------------------------------------
  833.   # ● ステータスウィンドウの設定
  834.   #--------------------------------------------------------------------------
  835.   def status_window=(status_window)
  836.     @status_window = status_window
  837.     call_update_help
  838.   end
  839.   #--------------------------------------------------------------------------
  840.   # ● 素材ウィンドウの設定
  841.   #--------------------------------------------------------------------------
  842.   def material_window=(material_window)
  843.     @material_window = material_window
  844.     call_update_help
  845.   end
  846.   #--------------------------------------------------------------------------
  847.   # ● ヘルプテキスト更新
  848.   #--------------------------------------------------------------------------
  849.   def update_help
  850.     @help_window.set_item(item) if @help_window
  851.     @status_window.item = item if @status_window
  852.     @material_window.set(item, recipe(item)) if @material_window
  853.   end
  854.   #--------------------------------------------------------------------------
  855.   # ● ←→ ボタン(表示切替)が押されたときの処理
  856.   #--------------------------------------------------------------------------
  857.   def process_change_window
  858.     Sound.play_cursor
  859.     Input.update
  860.     call_handler(:change_window)
  861.   end
  862.   #--------------------------------------------------------------------------
  863.   # ● 決定やキャンセルなどのハンドリング処理
  864.   #--------------------------------------------------------------------------
  865.   def process_handling
  866.     super
  867.     if active
  868.       return process_change_window if handle?(:change_window) && Input.trigger?(:X)
  869.       return process_change_window if handle?(:change_window) && Input.trigger?(:Y)
  870.     end
  871.   end
  872. end
  873.  
  874.  
  875. #==============================================================================
  876. # ■ Window_ItemSynthesisMaterial
  877. #------------------------------------------------------------------------------
  878. #  合成画面で、合成に必要な素材を表示するウィンドウです。
  879. #==============================================================================
  880.  
  881. class Window_ItemSynthesisMaterial < Window_Base
  882.   #--------------------------------------------------------------------------
  883.   # ● オブジェクト初期化
  884.   #--------------------------------------------------------------------------
  885.   def initialize(x, y, width, height)
  886.     super(x, y, width, height)
  887.     @item = nil
  888.     refresh
  889.   end
  890.   #--------------------------------------------------------------------------
  891.   # ● リフレッシュ
  892.   #--------------------------------------------------------------------------
  893.   def refresh
  894.     contents.clear
  895.     draw_possession(4, 0)
  896.     draw_material_info(0, line_height * 2)
  897.   end
  898.   #--------------------------------------------------------------------------
  899.   # ● アイテムの設定
  900.   #--------------------------------------------------------------------------
  901.   def set(item, recipe)
  902.     @item = item
  903.     @recipe = recipe
  904.     @make_number = 1
  905.     refresh
  906.   end
  907.   #--------------------------------------------------------------------------
  908.   # ● 作成個数の設定
  909.   #--------------------------------------------------------------------------
  910.   def set_num(make_number)
  911.     @make_number = make_number
  912.     refresh
  913.   end
  914.   #--------------------------------------------------------------------------
  915.   # ● 所持数の描画
  916.   #--------------------------------------------------------------------------
  917.   def draw_possession(x, y)
  918.     rect = Rect.new(x, y, contents.width - 4 - x, line_height)
  919.     change_color(system_color)
  920.     draw_text(rect, Vocab::Possession)
  921.     change_color(normal_color)
  922.     draw_text(rect, $game_party.item_number(@item), 2)
  923.   end
  924.   #--------------------------------------------------------------------------
  925.   # ● 素材情報の描画
  926.   #--------------------------------------------------------------------------
  927.   def draw_material_info(x, y)
  928.     rect = Rect.new(x, y, contents.width, line_height)
  929.     change_color(system_color)
  930.     contents.font.size = 18
  931.     draw_text(rect, "必要素材", 0)
  932.     if @recipe
  933.       for i in [email]1...@recipe.size[/email]
  934.         kind = @recipe[i][0]
  935.         id   = @recipe[i][1]
  936.         num  = @recipe[i][2]
  937.         if kind == "I"
  938.           item = $data_items[id]
  939.         elsif kind == "W"
  940.           item = $data_weapons[id]
  941.         elsif kind == "A"
  942.           item = $data_armors[id]
  943.         elsif kind == "K"
  944.           item = $data_key_item[id]
  945.         end
  946.         rect = Rect.new(x, y + line_height*i, contents.width, line_height)
  947.         enabled = true
  948.         enabled = false if [num*@make_number, 1].max  > $game_party.item_number(item)
  949.         draw_item_name(item, rect.x, rect.y, enabled)
  950.         change_color(normal_color, enabled)
  951.         if num > 0
  952.           draw_text(rect, "#{num*@make_number}/#{$game_party.item_number(item)}", 2)
  953.         end
  954.       end
  955.     end
  956.     change_color(normal_color)
  957.     contents.font.size = 24
  958.   end
  959. end
  960.  
  961.  
  962. #==============================================================================
  963. # ■ Window_ItemSynthesisNumber
  964. #------------------------------------------------------------------------------
  965. #  合成画面で、合成するアイテムの個数を入力するウィンドウです。
  966. #==============================================================================
  967.  
  968. class Window_ItemSynthesisNumber < Window_ShopNumber
  969.   #--------------------------------------------------------------------------
  970.   # ● リフレッシュ
  971.   #--------------------------------------------------------------------------
  972.   def refresh
  973.     contents.clear
  974.     draw_item_name(@item, 0, item_y)
  975.     draw_number
  976.     draw_total_price if WD_itemsynthesis_ini::Cost_view
  977.   end
  978.   #--------------------------------------------------------------------------
  979.   # ● オブジェクト初期化
  980.   #--------------------------------------------------------------------------
  981.   def material_window=(material_window)
  982.     @material_window = material_window
  983.     call_update_help
  984.   end
  985.   #--------------------------------------------------------------------------
  986.   # ● 作成個数の変更
  987.   #--------------------------------------------------------------------------
  988.   def change_number(amount)
  989.     @number = [[@number + amount, @max].min, 1].max
  990.     call_update_help #追加
  991.   end
  992.   #--------------------------------------------------------------------------
  993.   # ● ヘルプテキスト更新
  994.   #--------------------------------------------------------------------------
  995.   def call_update_help
  996.     @material_window.set_num(@number) if @material_window
  997.   end
  998. end
  999.  
  1000.  
  1001. #==============================================================================
  1002. # ■ Window_ItemSynthesisCategory
  1003. #------------------------------------------------------------------------------
  1004. #  合成画面で、通常アイテムや装備品の分類を選択するウィンドウです。
  1005. #==============================================================================
  1006.  
  1007. class Window_ItemSynthesisCategory < Window_ItemCategory
  1008.   #--------------------------------------------------------------------------
  1009.   # ● 桁数の取得
  1010.   #--------------------------------------------------------------------------
  1011.   def col_max
  1012.     i = 0
  1013.     i += 1 if WD_itemsynthesis_ini::Category_i
  1014.     i += 1 if WD_itemsynthesis_ini::Category_w
  1015.     i += 1 if WD_itemsynthesis_ini::Category_a
  1016.     i += 1 if WD_itemsynthesis_ini::Category_k
  1017.     return i
  1018.   end
  1019.   #--------------------------------------------------------------------------
  1020.   # ● コマンドリストの作成
  1021.   #--------------------------------------------------------------------------
  1022.   def make_command_list
  1023.     add_command(Vocab::item,     :item)     if WD_itemsynthesis_ini::Category_i
  1024.     add_command(Vocab::weapon,   :weapon)   if WD_itemsynthesis_ini::Category_w
  1025.     add_command(Vocab::armor,    :armor)    if WD_itemsynthesis_ini::Category_a
  1026.     add_command(Vocab::key_item, :key_item) if WD_itemsynthesis_ini::Category_k
  1027.   end
  1028. end
  1029.  
  1030.  
  1031. #==============================================================================
  1032. # ■ Window_ItemSynthesisNumber
  1033. #------------------------------------------------------------------------------
  1034. #  合成画面で、切替を表示するウィンドウです。
  1035. #==============================================================================
  1036.  
  1037. class Window_ItemSynthesisChange < Window_Base
  1038.   #--------------------------------------------------------------------------
  1039.   # ● オブジェクト初期化
  1040.   #--------------------------------------------------------------------------
  1041.   def initialize(x, y, width, height)
  1042.     super(x, y, width, height)
  1043.     refresh
  1044.   end
  1045.   #--------------------------------------------------------------------------
  1046.   # ● リフレッシュ
  1047.   #--------------------------------------------------------------------------
  1048.   def refresh
  1049.     contents.clear
  1050.     text = "X Y:表示切り替え"
  1051.     draw_text(0, 0, contents_width, line_height, text, 1)
  1052.   end
  1053. end

属性随机脚本
RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 随机属性装备 By wyongcan
  4. #==============================================================================
  5. module Equipplus
  6. #得到随机属性装备方法:gainequip(装备ID,属性数)
  7. #~ 前缀结构:
  8. #~ ①权重(1-100) 越大越重要
  9. #~ ②名称(多个名称用","分开,会随机取其中一个添加到武器名前)
  10. #~ ③属性数组  提供两种方式:
  11. #~ 1.[属性ID,增加值]    属性ID参考说明增强脚本 增加了9号属性“极品出现率” ID为8,影响前缀的好坏 1 - 100
  12. #~ 2.与装备特性相同[code,data_id,value]  code,data_id参考说明增强脚本
  13.   @maxparamplus = 3 #最大前缀数
  14.   @moneyrate = 10 #物品价格计算公式为:原价格 + 前缀权重 * @moneyrate
  15.   @transpose = [*1..100].reverse #用于把1变成100,100变成1
  16.   @paramsplus = [           #暂时只写了三个前缀,可以自己添加,参照前缀结构
  17.   [10,"力量,凶残",[[2,10]]], #物理攻击加10
  18.   [20,"灵气",[[0,200],[1,200]]], # HP和MP各加200
  19.   [60,"战神",[[21,2,2]]] #物理攻击双倍
  20.   ]
  21.   $商店随机 = true #商店买装备时出随机属性
  22.   $战斗随机 = true #战斗后获得随机属性装备
  23.   def self.getname(paramsplus)
  24.     name = ""
  25.     paramsplus.is_a?(Array) ? paramsplus.each{|a| @temp = []; a[1].scan(/^[\u4e00-\u9fa5|\w]*|,[\u4e00-\u9fa5|\w]*/){|b| @temp.push b.gsub(","){}}; name += @temp[rand(@temp.size)]} : paramsplus[1].scan(/^[\u4e00-\u9fa5|\w]*|,[\u4e00-\u9fa5|\w]*/){|b| @temp = [] if @temp == nil ;@temp.push b.gsub(","){}}
  26.     name += @temp[rand(@temp.size)] if paramsplus.is_a?(Array) != true
  27.     name += "的"
  28.   end
  29.   def self.getluck #获得极品出现率
  30.     luck = 0
  31.     $game_party.all_members.each{|a| a.weapons.each{|a| luck += a.params[8] if a.params.size == 9};a.armors.each{|a| luck += a.params[8] if a.params.size == 9}}
  32.     luck
  33.   end
  34.   def self.getnewequip(xequip,params = nil) #提供两个参数  装备(RPG::Equip类下的)和附加前缀数,不填则为随机
  35.     return unless xequip.is_a?(RPG::EquipItem)
  36.     #xparamplus为前缀数
  37.     xequip.paramsplus = [] if xequip.paramsplus == nil
  38.     return if xequip.paramsplus.size >= @maxparamplus
  39.     params != nil ? xparamplus = params :  xparamplus = rand(@maxparamplus * 110) / 100
  40.     xparamplus = xparamplus.to_int
  41.     return xequip if xparamplus == 0
  42.     equip = xequip.dup
  43.     paramsplus = equip.paramsplus.dup  #无奈的方法,不这样改一个装备所有同父装备的装备都会变
  44.     newparams = equip.params.dup
  45.     newfeatures = equip.features.dup
  46.     aparamsplus = @paramsplus.collect{|a| [a[0] = @transpose[a[0]-1],a[1],a[2]]}.sort_by{|a| a[0]}
  47.     while paramsplus.size < xparamplus
  48.       temp = rand(aparamsplus[-1][0])
  49.       temp = [temp - getluck,0].max
  50.       x = []
  51.       for i in aparamsplus
  52.         x.push i if i[0] >= temp && paramsplus.include?(i) != true
  53.       end
  54.       if x != []
  55.         a = [(x.size-1)*100 - getluck,0].max
  56.         a = (rand(a)/100).to_int
  57.         paramsplus.push x[a]
  58.       end
  59.     end
  60.     equip.name = getname(paramsplus) + equip.name #更新名称
  61.     paramsplus.each{|a| equip.price += @transpose[a[0] - 1] * @moneyrate} #更新价格
  62.     paramsplus.select{|a| a[2].select{|a| a.size == 2}.each{|a| newparams[a[0]] += a[1]}} #更新属性
  63.     #以下为更新特性
  64.     features = []
  65.     paramsplus.each{|a| a[2].each{|a| features.push a if a.size == 3}}
  66.     while features.size > 0
  67.       i = features.pop
  68.       newfeatures.select{|a| a.code == i[0] && a.data_id == i[1]}.size == 0 ? newfeatures.push(RPG::BaseItem::Feature.new(i[0],i[1],i[2])) : newfeatures.each_with_index{|a,b| newfeatures[b].value += i[2] if a.code == i[0] && a.data_id == i[1]}
  69.     end
  70.     if equip.is_a?(RPG::Weapon)
  71.       equip.id = $data_weapons.size
  72.       $data_weapons.insert $data_weapons.size,equip
  73.       $data_weapons[equip.id].paramsplus = paramsplus
  74.       $data_weapons[equip.id].params = newparams
  75.       $data_weapons[equip.id].features = newfeatures
  76.     else
  77.       equip.id = $data_armors.size
  78.       $data_armors.insert $data_armors.size,equip
  79.       $data_armors[equip.id].paramsplus = paramsplus
  80.       $data_armors[equip.id].params = newparams
  81.       $data_armors[equip.id].features = newfeatures
  82.     end
  83.     equip
  84.   end
  85.   def self.gainequip(id,params = nil)
  86.     $game_party.gain_item(Equipplus.getnewequip($data_weapons[id],params),1,true)
  87.   end
  88. end
  89. if $商店随机 == true
  90.   class Scene_Shop < Scene_MenuBase
  91.     def do_buy(number)
  92.       $game_party.lose_gold(number * buying_price)
  93.       if @item.is_a?(RPG::EquipItem)
  94.         x = number
  95.         loop do
  96.           break if x <= 0
  97.           x -= 1
  98.           $game_party.gain_item(Equipplus.getnewequip(@item), 1)
  99.         end
  100.       else
  101.         $game_party.gain_item(@item, number)
  102.       end
  103.     end
  104.   end
  105. end
  106. if $战斗随机 == true
  107.   module BattleManager
  108.     def self.gain_drop_items
  109.       $game_troop.make_drop_items.each do |item|
  110.         item.is_a?(RPG::EquipItem) ? xitem = Equipplus.getnewequip(item) : xitem = item
  111.         $game_party.gain_item(xitem, 1)
  112.         $game_message.add(sprintf(Vocab::ObtainItem, xitem.name))
  113.       end
  114.       wait_for_message
  115.     end
  116.   end
  117. end
  118. class RPG::EquipItem < RPG::BaseItem
  119.   alias old initialize
  120.   def initialize
  121.     old
  122.     @paramsplus #前缀
  123.   end
  124.   attr_accessor :paramsplus
  125. end


Project1.rar

1.83 MB, 下载次数: 53

范例

点评

整合什么的太累了,帮不上忙抱歉  发表于 2014-7-2 12:49

Lv4.逐梦者 (版主)

无限の剣制

梦石
0
星屑
10074
在线时间
5020 小时
注册时间
2013-2-28
帖子
5030

开拓者贵宾

2
发表于 2014-7-2 13:00:57 | 只看该作者
本帖最后由 VIPArcher 于 2014-7-2 14:04 编辑

@recipe

合成脚本里536行改成这样
有修改,刚刚那样会导致无法合成普通道具,
改成现在下面这样
  1.    #--------------------------------------------------------------------------
  2.   # ● 合成の実行
  3.   #--------------------------------------------------------------------------
  4.   def do_syntetic(number)

  5.       for i in [email protected]
  6.         kind = @recipe[i][0]
  7.         id   = @recipe[i][1]
  8.         num  = @recipe[i][2]
  9.         if kind == "I"
  10.           item = $data_items[id]
  11.         elsif kind == "W"
  12.           item = $data_weapons[id]
  13.         elsif kind == "A"
  14.           item = $data_armors[id]
  15.           elsif kind == "K"
  16.           item = $data_key_item[id]
  17.         end
  18.         $game_party.lose_item(item, num*number)
  19.       end
  20.     $game_party.lose_gold(number * buying_price)
  21.       if @item.is_a?(RPG::EquipItem)
  22.         x = number
  23.         loop do
  24.           break if x <= 0
  25.           x -= 1
  26.       $game_party.gain_item(Equipplus.getnewequip(@item), number)
  27.           end
  28.       else
  29.     $game_party.gain_item(@item, number)
  30.       end
  31.    
  32.   end
复制代码

点评

↓这个 你去问问随机属性脚本的作者,开个新帖问他@他  发表于 2014-7-2 15:58
现在还有个问题想请教下,就是这个前缀出现的几率都差不多,能不能设置权重约大,出现几率约小呢? .  发表于 2014-7-2 15:54
论坛又卖萌。233  发表于 2014-7-2 13:08
帮你编辑了一下帖子。我猜你懂的  发表于 2014-7-2 13:03

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
128
在线时间
109 小时
注册时间
2013-8-10
帖子
46
3
 楼主| 发表于 2014-7-2 13:15:08 | 只看该作者
解决了,感谢大神帮助!

点评

有新改动,请更新。(刚刚那样会导致重复获得装备,你没发现?)  发表于 2014-7-2 14:06
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1063
在线时间
89 小时
注册时间
2023-12-26
帖子
127
4
发表于 2024-2-16 15:43:19 | 只看该作者
2楼说的,我没看懂,不知道2楼说的要加到哪里,还是直接复制2楼的?不懂
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 12:59

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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