Project1
标题: 求助合成武器得到随机属性该如何修改脚本 [打印本页]
作者: lsmteslplg 时间: 2014-7-2 12:40
标题: 求助合成武器得到随机属性该如何修改脚本
使用了合成脚本来进行武器防具合成,合成以后无法得到随机属性,想问问该怎么修改脚本
合成脚本
#==============================================================================
# ■ RGSS3 アイテム合成 ver 1.02
#------------------------------------------------------------------------------
# 配布元:
# 白の魔 [url]http://izumiwhite.web.fc2.com/[/url]
#
# 利用規約:
# RPGツクールVX Aceの正規の登録者のみご利用になれます。
# 利用報告・著作権表示とかは必要ありません。
# 改造もご自由にどうぞ。
# 何か問題が発生しても責任は持ちません。
#==============================================================================
#--------------------------------------------------------------------------
# ★ 初期設定。
# 合成レシピ等の設定
#--------------------------------------------------------------------------
module WD_itemsynthesis_ini
Cost_view = true #費用(G)の表示(合成の費用が全て0Gの場合はfalseを推奨)
Category_i = true #カテゴリウィンドウに「アイテム」の項目を表示
Category_w = true #カテゴリウィンドウに「武器」の項目を表示
Category_a = true #カテゴリウィンドウに「防具」の項目を表示
Category_k = true #カテゴリウィンドウに「大事なもの」の項目を表示
I_recipe = [] #この行は削除しないこと
W_recipe = [] #この行は削除しないこと
A_recipe = [] #この行は削除しないこと
K_recipe = [] #この行は削除しないこと
#以下、合成レシピ。
#例: I_recipe[3] = [0, ["I",1,1], ["W",2,1], ["A",2,2], ["A",3,1]]
#と記載した場合、ID3のアイテムの合成必要は、100G。
#必要な素材は、ID1のアイテム1個、ID2の武器1個、ID2の防具2個、ID3の防具1個
#となる。
#アイテムの合成レシピ
I_recipe[1] = [0, ["I",55,2]]
I_recipe[70] = [0, ["I",55,2], ["I",56,1]]
I_recipe[71] = [0, ["I",55,3], ["I",56,2], ["I",57,1]]
I_recipe[2] = [0, ["I",55,4], ["I",56,3], ["I",57,2], ["I",58,1]]
I_recipe[3] = [0, ["I",55,5], ["I",56,5], ["I",57,5], ["I",58,5], ["I",59,5]]
I_recipe[4] = [0, ["I",55,2], ["I",56,1]]
I_recipe[72] = [0, ["I",55,3], ["I",56,2], ["I",57,1]]
I_recipe[73] = [0, ["I",55,4], ["I",56,3], ["I",57,2], ["I",58,1]]
I_recipe[5] = [0, ["I",59,10], ["I",60,10], ["I",61,10]]
I_recipe[6] = [0, ["I",55,2], ["I",56,2], ]
I_recipe[7] = [0, ["I",55,5], ["I",56,5], ["I",57,5], ["I",58,5], ["I",59,5]]
I_recipe[8] = [0, ["I",59,20], ["I",60,20], ["I",61,20]]
I_recipe[76] = [500, ["I",86,1],["I",96,5]]
I_recipe[77] = [500, ["I",87,1],["I",96,5]]
I_recipe[78] = [500, ["I",88,1],["I",96,5]]
I_recipe[79] = [500, ["I",89,1],["I",96,5]]
I_recipe[80] = [500, ["I",90,1],["I",96,5]]
I_recipe[81] = [500, ["I",91,1],["I",96,5]]
I_recipe[82] = [500, ["I",92,1],["I",96,5]]
I_recipe[83] = [500, ["I",93,1],["I",96,5]]
I_recipe[84] = [500, ["I",94,1],["I",96,5]]
I_recipe[85] = [500, ["I",95,1],["I",96,5]]
I_recipe[98] = [1000, ["I",99,5]]
#武器の合成レシピ
W_recipe[14] = [0, ["I",27,5]]
W_recipe[20] = [0, ["I",27,5]]
W_recipe[8] = [0, ["I",27,5]]
W_recipe[86] = [0, ["I",27,5]]
W_recipe[15] = [0, ["I",27,5], ["I",29,5]]
W_recipe[21] = [0, ["I",27,5], ["I",29,5]]
W_recipe[78] = [0, ["I",27,5], ["I",29,5]]
W_recipe[51] = [0, ["I",27,5], ["I",29,5]]
W_recipe[67] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[70] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[9] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[50] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[68] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[71] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[79] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[87] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[16] = [0, ["I",27,5], ["I",28,5], ["I",30,5]]
W_recipe[22] = [0, ["I",27,5], ["I",28,5], ["I",30,5]]
W_recipe[10] = [0, ["I",27,5], ["I",28,5], ["I",30,5]]
W_recipe[52] = [0, ["I",27,5], ["I",28,5], ["I",30,5]]
W_recipe[17] = [0, ["I",28,5], ["I",30,5], ["I",31,5]]
W_recipe[23] = [0, ["I",28,5], ["I",30,5], ["I",31,5]]
W_recipe[11] = [0, ["I",28,5], ["I",30,5], ["I",31,5]]
W_recipe[53] = [0, ["I",28,5], ["I",30,5], ["I",31,5]]
W_recipe[18] = [0, ["I",30,5], ["I",31,5], ["I",32,5]]
W_recipe[24] = [0, ["I",30,5], ["I",31,5], ["I",32,5]]
W_recipe[12] = [0, ["I",30,5], ["I",31,5], ["I",32,5]]
W_recipe[54] = [0, ["I",30,5], ["I",31,5], ["I",32,5]]
W_recipe[69] = [0, ["I",30,5], ["I",31,5], ["I",33,5]]
W_recipe[72] = [0, ["I",30,5], ["I",31,5], ["I",33,5]]
W_recipe[80] = [0, ["I",30,5], ["I",31,5], ["I",33,5]]
W_recipe[88] = [0, ["I",30,5], ["I",31,5], ["I",33,5]]
W_recipe[62] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
W_recipe[73] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
W_recipe[81] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
W_recipe[89] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
W_recipe[63] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]
W_recipe[74] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]
W_recipe[82] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]
W_recipe[90] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]
W_recipe[94] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]
W_recipe[98] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]
W_recipe[102] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]
W_recipe[106] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]
W_recipe[95] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]
W_recipe[99] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]
W_recipe[103] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]
W_recipe[107] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]
W_recipe[96] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]
W_recipe[0] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]
W_recipe[104] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]
W_recipe[108] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]
W_recipe[97] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]
W_recipe[101] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]
W_recipe[105] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]
W_recipe[109] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]
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]]
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]]
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]]
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]]
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]]
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]]
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]]
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]]
W_recipe[66] = [0, ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
W_recipe[77] = [0, ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
W_recipe[85] = [0, ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
W_recipe[93] = [0, ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
W_recipe[61] = [0, ["I",30,10],["I",31,10], ["I",33,10], ["I",68,10], ["I",69,10]]
#防具の合成レシピ
A_recipe[61] = [0, ["I",34,5]]
A_recipe[11] = [0, ["I",34,5],["I",35,5]]
A_recipe[12] = [0, ["I",35,5],["I",36,5]]
A_recipe[62] = [0, ["I",35,5],["I",36,5],["I",37,5]]
A_recipe[63] = [0, ["I",36,5],["I",37,5],["I",38,5]]
A_recipe[64] = [0, ["I",38,5],["I",39,5]]
A_recipe[65] = [0, ["I",38,5],["I",39,5],["I",40,5]]
A_recipe[66] = [0, ["I",38,5],["I",39,5],["I",40,5]]
A_recipe[13] = [0, ["I",37,5],["I",38,5],["I",39,5],["I",40,5]]
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]]
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]]
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]]
A_recipe[16] = [0, ["I",34,5]]
A_recipe[17] = [0, ["I",34,5],["I",35,5]]
A_recipe[18] = [0, ["I",35,5],["I",36,5]]
A_recipe[19] = [0, ["I",35,5],["I",36,5],["I",37,5]]
A_recipe[20] = [0, ["I",36,5],["I",37,5],["I",38,5]]
A_recipe[68] = [0, ["I",38,5],["I",39,5]]
A_recipe[69] = [0, ["I",38,5],["I",39,5],["I",40,5]]
A_recipe[70] = [0, ["I",38,5],["I",39,5],["I",40,5]]
A_recipe[71] = [0, ["I",37,5],["I",38,5],["I",39,5],["I",40,5]]
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]]
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]]
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]]
A_recipe[26] = [0, ["I",41,3]]
A_recipe[27] = [0, ["I",41,3],["I",42,2]]
A_recipe[28] = [0, ["I",42,5],["I",43,5]]
A_recipe[29] = [0, ["I",42,5],["I",43,5],["I",44,5]]
A_recipe[30] = [0, ["I",43,5],["I",44,5],["I",45,5]]
A_recipe[75] = [0, ["I",45,5],["I",46,5]]
A_recipe[76] = [0, ["I",45,5],["I",46,5],["I",47,5]]
A_recipe[77] = [0, ["I",45,5],["I",46,5],["I",47,5]]
A_recipe[78] = [0, ["I",44,5],["I",45,5],["I",46,5],["I",47,5]]
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]]
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]]
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]]
A_recipe[21] = [0, ["I",41,5]]
A_recipe[22] = [0, ["I",41,5],["I",42,5]]
A_recipe[23] = [0, ["I",42,5],["I",43,5]]
A_recipe[24] = [0, ["I",42,5],["I",43,5],["I",44,5]]
A_recipe[25] = [0, ["I",43,5],["I",44,5],["I",45,5]]
A_recipe[82] = [0, ["I",45,5],["I",46,5]]
A_recipe[83] = [0, ["I",45,5],["I",46,5],["I",47,5]]
A_recipe[84] = [0, ["I",45,5],["I",46,5],["I",47,5]]
A_recipe[85] = [0, ["I",44,5],["I",45,5],["I",46,5],["I",47,5]]
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]]
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]]
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]]
A_recipe[36] = [0, ["I",27,3]]
A_recipe[37] = [0, ["I",27,3],["I",29,2]]
A_recipe[38] = [0, ["I",28,5],["I",29,5]]
A_recipe[39] = [0, ["I",28,5],["I",29,5],["I",30,5]]
A_recipe[40] = [0, ["I",29,5],["I",30,5],["I",31,5]]
A_recipe[89] = [0, ["I",31,5],["I",32,5]]
A_recipe[90] = [0, ["I",31,5],["I",32,5],["I",33,5]]
A_recipe[91] = [0, ["I",31,5],["I",32,5],["I",33,5]]
A_recipe[92] = [0, ["I",30,5],["I",31,5],["I",32,5],["I",33,5]]
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]]
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]]
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]]
A_recipe[31] = [0, ["I",27,5]]
A_recipe[32] = [0, ["I",27,5],["I",29,5]]
A_recipe[33] = [0, ["I",28,5],["I",29,5]]
A_recipe[34] = [0, ["I",28,5],["I",29,5],["I",30,5]]
A_recipe[35] = [0, ["I",29,5],["I",30,5],["I",31,5]]
A_recipe[96] = [0, ["I",31,5],["I",32,5]]
A_recipe[97] = [0, ["I",31,5],["I",32,5],["I",33,5]]
A_recipe[98] = [0, ["I",31,5],["I",32,5],["I",33,5]]
A_recipe[99] = [0, ["I",30,5],["I",31,5],["I",32,5],["I",40,5]]
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]]
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]]
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]]
#大事なもの合成レシピ
#K_recipe[76] = [0, ["I",86,1],["I",96,10]]
#K_recipe[77] = [0, ["I",87,1],["I",96,10]]
#K_recipe[78] = [0, ["I",88,1],["I",96,10]]
#K_recipe[79] = [0, ["I",89,1],["I",96,10]]
#K_recipe[80] = [0, ["I",90,1],["I",96,10]]
#K_recipe[81] = [0, ["I",91,1],["I",96,10]]
#K_recipe[82] = [0, ["I",92,1],["I",96,10]]
#K_recipe[83] = [0, ["I",93,1],["I",96,10]]
#K_recipe[84] = [0, ["I",94,1],["I",96,10]]
#K_recipe[85] = [0, ["I",95,1],["I",96,10]]
end
#==============================================================================
# ■ WD_itemsynthesis
#------------------------------------------------------------------------------
# アイテム合成用の共通メソッドです。
#==============================================================================
module WD_itemsynthesis
def i_recipe_switch_on(id)
$game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
$game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
$game_system.i_rcp_sw[id] = true
end
def i_recipe_switch_off(id)
$game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
$game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
$game_system.i_rcp_sw[id] = false
end
def i_recipe_switch_on?(id)
$game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
$game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
return $game_system.i_rcp_sw[id]
end
def i_recipe_all_switch_on
for i in 1..$data_items.size
i_recipe_switch_on(i)
end
end
def i_recipe_all_switch_off
for i in 1..$data_items.size
i_recipe_switch_off(i)
end
end
def w_recipe_switch_on(id)
$game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
$game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
$game_system.w_rcp_sw[id] = true
end
def w_recipe_switch_off(id)
$game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
$game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
$game_system.w_rcp_sw[id] = false
end
def w_recipe_switch_on?(id)
$game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
$game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
return $game_system.w_rcp_sw[id]
end
def w_recipe_all_switch_on
for i in 1..$data_weapons.size
w_recipe_switch_on(i)
end
end
def w_recipe_all_switch_off
for i in 1..$data_weapons.size
w_recipe_switch_off(i)
end
end
def a_recipe_switch_on(id)
$game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
$game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
$game_system.a_rcp_sw[id] = true
end
def a_recipe_switch_off(id)
$game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
$game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
$game_system.a_rcp_sw[id] = false
end
def a_recipe_switch_on?(id)
$game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
$game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
return $game_system.a_rcp_sw[id]
end
def a_recipe_all_switch_on
for i in 1..$data_armors.size
a_recipe_switch_on(i)
end
end
def a_recipe_all_switch_off
for i in 1..$data_armors.size
a_recipe_switch_off(i)
end
end
def recipe_all_switch_on
i_recipe_all_switch_on
w_recipe_all_switch_on
a_recipe_all_switch_on
end
def recipe_all_switch_off
i_recipe_all_switch_off
w_recipe_all_switch_off
a_recipe_all_switch_off
end
end
class Game_Interpreter
include WD_itemsynthesis
end
class Game_System
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :i_rcp_sw
attr_accessor :w_rcp_sw
attr_accessor :a_rcp_sw
attr_accessor :K_rcp_sw
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias wd_orig_initialize004 initialize
def initialize
wd_orig_initialize004
@i_rcp_sw = []
@w_rcp_sw = []
@a_rcp_sw = []
@K_rcp_sw = []
end
end
#==============================================================================
# ■ Scene_ItemSynthesis
#------------------------------------------------------------------------------
# 合成画面の処理を行うクラスです。
#==============================================================================
class Scene_ItemSynthesis < Scene_MenuBase
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
create_help_window
create_dummy_window
create_number_window
create_status_window
create_material_window
create_list_window
create_category_window
create_gold_window
create_change_window
end
#--------------------------------------------------------------------------
# ● ゴールドウィンドウの作成
#--------------------------------------------------------------------------
def create_gold_window
@gold_window = Window_Gold.new
@gold_window.viewport = @viewport
@gold_window.x = Graphics.width - @gold_window.width
@gold_window.y = @help_window.height
@gold_window.hide
end
#--------------------------------------------------------------------------
# ● 切り替え表示ウィンドウの作成
#--------------------------------------------------------------------------
def create_change_window
wx = 0
wy = @gold_window.y
ww = Graphics.width - @gold_window.width
wh = @gold_window.height
@change_window = Window_ItemSynthesisChange.new(wx, wy, ww, wh)
@change_window.viewport = @viewport
@change_window.hide
end
#--------------------------------------------------------------------------
# ● ダミーウィンドウの作成
#--------------------------------------------------------------------------
def create_dummy_window
wy = @help_window.y + @help_window.height + 48
wh = Graphics.height - wy
@dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
@dummy_window.viewport = @viewport
end
#--------------------------------------------------------------------------
# ● 個数入力ウィンドウの作成
#--------------------------------------------------------------------------
def create_number_window
wy = @dummy_window.y
wh = @dummy_window.height
@number_window = Window_ItemSynthesisNumber.new(0, wy, wh)
@number_window.viewport = @viewport
@number_window.hide
@number_window.set_handler(:ok, method(:on_number_ok))
@number_window.set_handler(:cancel, method(:on_number_cancel))
end
#--------------------------------------------------------------------------
# ● ステータスウィンドウの作成
#--------------------------------------------------------------------------
def create_status_window
wx = @number_window.width
wy = @dummy_window.y
ww = Graphics.width - wx
wh = @dummy_window.height
@status_window = Window_ShopStatus.new(wx, wy, ww, wh)
@status_window.viewport = @viewport
@status_window.hide
end
#--------------------------------------------------------------------------
# ● 素材ウィンドウの作成
#--------------------------------------------------------------------------
def create_material_window
wx = @number_window.width
wy = @dummy_window.y
ww = Graphics.width - wx
wh = @dummy_window.height
@material_window = Window_ItemSynthesisMaterial.new(wx, wy, ww, wh)
@material_window.viewport = @viewport
@material_window.hide
@number_window.material_window = @material_window
end
#--------------------------------------------------------------------------
# ● 合成アイテムリストウィンドウの作成
#--------------------------------------------------------------------------
def create_list_window
wy = @dummy_window.y
wh = @dummy_window.height
@list_window = Window_ItemSynthesisList.new(0, wy, wh)
@list_window.viewport = @viewport
@list_window.help_window = @help_window
@list_window.status_window = @status_window
@list_window.material_window = @material_window
@list_window.hide
@list_window.set_handler(:ok, method(:on_list_ok))
@list_window.set_handler(:cancel, method(:on_list_cancel))
@list_window.set_handler(:change_window, method(:on_change_window))
end
#--------------------------------------------------------------------------
# ● カテゴリウィンドウの作成
#--------------------------------------------------------------------------
def create_category_window
@category_window = Window_ItemSynthesisCategory.new
@category_window.viewport = @viewport
@category_window.help_window = @help_window
@category_window.y = @help_window.height
@category_window.activate
@category_window.item_window = @list_window
@category_window.set_handler(:ok, method(:on_category_ok))
@category_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# ● 合成アイテムリストウィンドウのアクティブ化
#--------------------------------------------------------------------------
def activate_list_window
@list_window.money = money
@list_window.show.activate
end
#--------------------------------------------------------------------------
# ● 合成[決定]
#--------------------------------------------------------------------------
def on_list_ok
@item = @list_window.item
@list_window.hide
@number_window.set(@item, max_buy, buying_price, currency_unit)
@number_window.show.activate
end
#--------------------------------------------------------------------------
# ● 合成[キャンセル]
#--------------------------------------------------------------------------
def on_list_cancel
@category_window.activate
@category_window.show
@dummy_window.show
@list_window.hide
@status_window.hide
@status_window.item = nil
@material_window.hide
@material_window.set(nil, nil)
@gold_window.hide
@change_window.hide
@help_window.clear
end
#--------------------------------------------------------------------------
# ● 表示切替
#--------------------------------------------------------------------------
def on_change_window
if @status_window.visible
@status_window.hide
@material_window.show
else
@status_window.show
@material_window.hide
end
end
#--------------------------------------------------------------------------
# ● カテゴリ[決定]
#--------------------------------------------------------------------------
def on_category_ok
activate_list_window
@gold_window.show
@change_window.show
@material_window.show
@category_window.hide
@list_window.select(0)
end
#--------------------------------------------------------------------------
# ● 個数入力[決定]
#--------------------------------------------------------------------------
def on_number_ok
Sound.play_shop
do_syntetic(@number_window.number)
end_number_input
@gold_window.refresh
end
#--------------------------------------------------------------------------
# ● 個数入力[キャンセル]
#--------------------------------------------------------------------------
def on_number_cancel
Sound.play_cancel
end_number_input
end
#--------------------------------------------------------------------------
# ● 合成の実行
#--------------------------------------------------------------------------
def do_syntetic(number)
$game_party.lose_gold(number * buying_price)
$game_party.gain_item(@item, number)
[url=home.php?mod=space&uid=2564094]@recipe[/url] = @list_window.recipe(@item)
for i in [email]1...@recipe.size[/email]
kind = @recipe[i][0]
id = @recipe[i][1]
num = @recipe[i][2]
if kind == "I"
item = $data_items[id]
elsif kind == "W"
item = $data_weapons[id]
elsif kind == "A"
item = $data_armors[id]
elsif kind == "K"
item = $data_key_item[id]
end
$game_party.lose_item(item, num*number)
end
end
#--------------------------------------------------------------------------
# ● 個数入力の終了
#--------------------------------------------------------------------------
def end_number_input
@number_window.hide
activate_list_window
end
#--------------------------------------------------------------------------
# ● 最大購入可能個数の取得
#--------------------------------------------------------------------------
def max_buy
max = $game_party.max_item_number(@item) - $game_party.item_number(@item)
@recipe = @list_window.recipe(@item)
for i in [email]1...@recipe.size[/email]
kind = @recipe[i][0]
id = @recipe[i][1]
num = @recipe[i][2]
if kind == "I"
item = $data_items[id]
elsif kind == "W"
item = $data_weapons[id]
elsif kind == "A"
item = $data_armors[id]
elsif kind == "K"
item = $data_key_item[id]
end
if num > 0
max_buf = $game_party.item_number(item)/num
else
max_buf = 999
end
max = [max, max_buf].min
end
buying_price == 0 ? max : [max, money / buying_price].min
end
#--------------------------------------------------------------------------
# ● 所持金の取得
#--------------------------------------------------------------------------
def money
@gold_window.value
end
#--------------------------------------------------------------------------
# ● 通貨単位の取得
#--------------------------------------------------------------------------
def currency_unit
@gold_window.currency_unit
end
#--------------------------------------------------------------------------
# ● 合成費用の取得
#--------------------------------------------------------------------------
def buying_price
@list_window.price(@item)
end
end
#==============================================================================
# ■ Window_ItemSynthesisList
#------------------------------------------------------------------------------
# 合成画面で、合成可能なアイテムの一覧を表示するウィンドウです。
#==============================================================================
class Window_ItemSynthesisList < Window_Selectable
include WD_itemsynthesis
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :status_window # ステータスウィンドウ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, height)
super(x, y, window_width, height)
@shop_goods = []
@shop_recipes = []
for i in 1..WD_itemsynthesis_ini::I_recipe.size
recipe = WD_itemsynthesis_ini::I_recipe[i]
if recipe
good = [0, i, recipe[0]]
if i_recipe_switch_on?(i)
@shop_goods.push(good)
@shop_recipes.push(recipe)
end
end
end
for i in 1..WD_itemsynthesis_ini::W_recipe.size
recipe = WD_itemsynthesis_ini::W_recipe[i]
if recipe
good = [1, i, recipe[0]]
if w_recipe_switch_on?(i)
@shop_goods.push(good)
@shop_recipes.push(recipe)
end
end
end
for i in 1..WD_itemsynthesis_ini::A_recipe.size
recipe = WD_itemsynthesis_ini::A_recipe[i]
if recipe
good = [2, i, recipe[0]]
if a_recipe_switch_on?(i)
@shop_goods.push(good)
@shop_recipes.push(recipe)
end
end
end
for i in 1..WD_itemsynthesis_ini::K_recipe.size
recipe = WD_itemsynthesis_ini::K_recipe[i]
if recipe
good = [2, i, recipe[0]]
if a_recipe_switch_on?(i)
@shop_goods.push(good)
@shop_recipes.push(recipe)
end
end
end
[url=home.php?mod=space&uid=26101]@Money[/url] = 0
refresh
select(0)
end
#--------------------------------------------------------------------------
# ● ウィンドウ幅の取得
#--------------------------------------------------------------------------
def window_width
return 304
end
#--------------------------------------------------------------------------
# ● 項目数の取得
#--------------------------------------------------------------------------
def item_max
@data ? @data.size : 1
end
#--------------------------------------------------------------------------
# ● アイテムの取得
#--------------------------------------------------------------------------
def item
@data[index]
end
#--------------------------------------------------------------------------
# ● 所持金の設定
#--------------------------------------------------------------------------
def money=(money)
@money = money
refresh
end
#--------------------------------------------------------------------------
# ● 選択項目の有効状態を取得
#--------------------------------------------------------------------------
def current_item_enabled?
enable?(@data[index])
end
#--------------------------------------------------------------------------
# ● 合成費用を取得
#--------------------------------------------------------------------------
def price(item)
@price[item]
end
#--------------------------------------------------------------------------
# ● 合成可否を取得
#--------------------------------------------------------------------------
def enable?(item)
@makable[item]
end
#--------------------------------------------------------------------------
# ● レシピを取得
#--------------------------------------------------------------------------
def recipe(item)
@recipe[item]
end
#--------------------------------------------------------------------------
# ● アイテムを許可状態で表示するかどうか
#--------------------------------------------------------------------------
def have_mat?(recipe)
flag = true
if @money >= recipe[0]
for i in 1...recipe.size
kind = recipe[i][0]
id = recipe[i][1]
num = recipe[i][2]
if kind == "I"
item = $data_items[id]
elsif kind == "W"
item = $data_weapons[id]
elsif kind == "A"
item = $data_armors[id]
elsif kind == "K"
item = $data_key_item[id]
end
if $game_party.item_number(item) < [num, 1].max
flag = false
end
end
else
flag = false
end
return flag
end
#--------------------------------------------------------------------------
# ● カテゴリの設定
#--------------------------------------------------------------------------
def category=(category)
return if @category == category
@category = category
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
make_item_list
create_contents
draw_all_items
end
#--------------------------------------------------------------------------
# ● アイテムをリストに含めるかどうか
#--------------------------------------------------------------------------
def include?(item)
case @category
when :item
item.is_a?(RPG::Item) && !item.key_item?
when :weapon
item.is_a?(RPG::Weapon)
when :armor
item.is_a?(RPG::Armor)
when :key_item
item.is_a?(RPG::Item) && item.key_item?
else
false
end
end
#--------------------------------------------------------------------------
# ● アイテムリストの作成
#--------------------------------------------------------------------------
def make_item_list
@data = []
@price = {}
@makable = {}
@recipe = {}
for i in [email]0...@shop_goods.size[/email]
goods = @shop_goods[i]
recipe = @shop_recipes[i]
case goods[0]
when 0; item = $data_items[goods[1]]
when 1; item = $data_weapons[goods[1]]
when 2; item = $data_armors[goods[1]]
when 3; item = $data_key_item[goods[1]]
end
if item
if include?(item)
@data.push(item)
@price[item] = goods[2]
@makable[item] = have_mat?(recipe)
@recipe[item] = recipe
end
end
end
end
#--------------------------------------------------------------------------
# ● 項目の描画
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
rect = item_rect(index)
draw_item_name(item, rect.x, rect.y, enable?(item))
rect.width -= 4
draw_text(rect, price(item), 2) if WD_itemsynthesis_ini::Cost_view
end
#--------------------------------------------------------------------------
# ● ステータスウィンドウの設定
#--------------------------------------------------------------------------
def status_window=(status_window)
@status_window = status_window
call_update_help
end
#--------------------------------------------------------------------------
# ● 素材ウィンドウの設定
#--------------------------------------------------------------------------
def material_window=(material_window)
@material_window = material_window
call_update_help
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_item(item) if @help_window
@status_window.item = item if @status_window
@material_window.set(item, recipe(item)) if @material_window
end
#--------------------------------------------------------------------------
# ● ←→ ボタン(表示切替)が押されたときの処理
#--------------------------------------------------------------------------
def process_change_window
Sound.play_cursor
Input.update
call_handler(:change_window)
end
#--------------------------------------------------------------------------
# ● 決定やキャンセルなどのハンドリング処理
#--------------------------------------------------------------------------
def process_handling
super
if active
return process_change_window if handle?(:change_window) && Input.trigger?(:X)
return process_change_window if handle?(:change_window) && Input.trigger?(:Y)
end
end
end
#==============================================================================
# ■ Window_ItemSynthesisMaterial
#------------------------------------------------------------------------------
# 合成画面で、合成に必要な素材を表示するウィンドウです。
#==============================================================================
class Window_ItemSynthesisMaterial < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
@item = nil
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_possession(4, 0)
draw_material_info(0, line_height * 2)
end
#--------------------------------------------------------------------------
# ● アイテムの設定
#--------------------------------------------------------------------------
def set(item, recipe)
@item = item
@recipe = recipe
@make_number = 1
refresh
end
#--------------------------------------------------------------------------
# ● 作成個数の設定
#--------------------------------------------------------------------------
def set_num(make_number)
@make_number = make_number
refresh
end
#--------------------------------------------------------------------------
# ● 所持数の描画
#--------------------------------------------------------------------------
def draw_possession(x, y)
rect = Rect.new(x, y, contents.width - 4 - x, line_height)
change_color(system_color)
draw_text(rect, Vocab::Possession)
change_color(normal_color)
draw_text(rect, $game_party.item_number(@item), 2)
end
#--------------------------------------------------------------------------
# ● 素材情報の描画
#--------------------------------------------------------------------------
def draw_material_info(x, y)
rect = Rect.new(x, y, contents.width, line_height)
change_color(system_color)
contents.font.size = 18
draw_text(rect, "必要素材", 0)
if @recipe
for i in [email]1...@recipe.size[/email]
kind = @recipe[i][0]
id = @recipe[i][1]
num = @recipe[i][2]
if kind == "I"
item = $data_items[id]
elsif kind == "W"
item = $data_weapons[id]
elsif kind == "A"
item = $data_armors[id]
elsif kind == "K"
item = $data_key_item[id]
end
rect = Rect.new(x, y + line_height*i, contents.width, line_height)
enabled = true
enabled = false if [num*@make_number, 1].max > $game_party.item_number(item)
draw_item_name(item, rect.x, rect.y, enabled)
change_color(normal_color, enabled)
if num > 0
draw_text(rect, "#{num*@make_number}/#{$game_party.item_number(item)}", 2)
end
end
end
change_color(normal_color)
contents.font.size = 24
end
end
#==============================================================================
# ■ Window_ItemSynthesisNumber
#------------------------------------------------------------------------------
# 合成画面で、合成するアイテムの個数を入力するウィンドウです。
#==============================================================================
class Window_ItemSynthesisNumber < Window_ShopNumber
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_item_name(@item, 0, item_y)
draw_number
draw_total_price if WD_itemsynthesis_ini::Cost_view
end
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def material_window=(material_window)
@material_window = material_window
call_update_help
end
#--------------------------------------------------------------------------
# ● 作成個数の変更
#--------------------------------------------------------------------------
def change_number(amount)
@number = [[@number + amount, @max].min, 1].max
call_update_help #追加
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def call_update_help
@material_window.set_num(@number) if @material_window
end
end
#==============================================================================
# ■ Window_ItemSynthesisCategory
#------------------------------------------------------------------------------
# 合成画面で、通常アイテムや装備品の分類を選択するウィンドウです。
#==============================================================================
class Window_ItemSynthesisCategory < Window_ItemCategory
#--------------------------------------------------------------------------
# ● 桁数の取得
#--------------------------------------------------------------------------
def col_max
i = 0
i += 1 if WD_itemsynthesis_ini::Category_i
i += 1 if WD_itemsynthesis_ini::Category_w
i += 1 if WD_itemsynthesis_ini::Category_a
i += 1 if WD_itemsynthesis_ini::Category_k
return i
end
#--------------------------------------------------------------------------
# ● コマンドリストの作成
#--------------------------------------------------------------------------
def make_command_list
add_command(Vocab::item, :item) if WD_itemsynthesis_ini::Category_i
add_command(Vocab::weapon, :weapon) if WD_itemsynthesis_ini::Category_w
add_command(Vocab::armor, :armor) if WD_itemsynthesis_ini::Category_a
add_command(Vocab::key_item, :key_item) if WD_itemsynthesis_ini::Category_k
end
end
#==============================================================================
# ■ Window_ItemSynthesisNumber
#------------------------------------------------------------------------------
# 合成画面で、切替を表示するウィンドウです。
#==============================================================================
class Window_ItemSynthesisChange < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
text = "X Y:表示切り替え"
draw_text(0, 0, contents_width, line_height, text, 1)
end
end
#==============================================================================
# ■ RGSS3 アイテム合成 ver 1.02
#------------------------------------------------------------------------------
# 配布元:
# 白の魔 [url]http://izumiwhite.web.fc2.com/[/url]
#
# 利用規約:
# RPGツクールVX Aceの正規の登録者のみご利用になれます。
# 利用報告・著作権表示とかは必要ありません。
# 改造もご自由にどうぞ。
# 何か問題が発生しても責任は持ちません。
#==============================================================================
#--------------------------------------------------------------------------
# ★ 初期設定。
# 合成レシピ等の設定
#--------------------------------------------------------------------------
module WD_itemsynthesis_ini
Cost_view = true #費用(G)の表示(合成の費用が全て0Gの場合はfalseを推奨)
Category_i = true #カテゴリウィンドウに「アイテム」の項目を表示
Category_w = true #カテゴリウィンドウに「武器」の項目を表示
Category_a = true #カテゴリウィンドウに「防具」の項目を表示
Category_k = true #カテゴリウィンドウに「大事なもの」の項目を表示
I_recipe = [] #この行は削除しないこと
W_recipe = [] #この行は削除しないこと
A_recipe = [] #この行は削除しないこと
K_recipe = [] #この行は削除しないこと
#以下、合成レシピ。
#例: I_recipe[3] = [0, ["I",1,1], ["W",2,1], ["A",2,2], ["A",3,1]]
#と記載した場合、ID3のアイテムの合成必要は、100G。
#必要な素材は、ID1のアイテム1個、ID2の武器1個、ID2の防具2個、ID3の防具1個
#となる。
#アイテムの合成レシピ
I_recipe[1] = [0, ["I",55,2]]
I_recipe[70] = [0, ["I",55,2], ["I",56,1]]
I_recipe[71] = [0, ["I",55,3], ["I",56,2], ["I",57,1]]
I_recipe[2] = [0, ["I",55,4], ["I",56,3], ["I",57,2], ["I",58,1]]
I_recipe[3] = [0, ["I",55,5], ["I",56,5], ["I",57,5], ["I",58,5], ["I",59,5]]
I_recipe[4] = [0, ["I",55,2], ["I",56,1]]
I_recipe[72] = [0, ["I",55,3], ["I",56,2], ["I",57,1]]
I_recipe[73] = [0, ["I",55,4], ["I",56,3], ["I",57,2], ["I",58,1]]
I_recipe[5] = [0, ["I",59,10], ["I",60,10], ["I",61,10]]
I_recipe[6] = [0, ["I",55,2], ["I",56,2], ]
I_recipe[7] = [0, ["I",55,5], ["I",56,5], ["I",57,5], ["I",58,5], ["I",59,5]]
I_recipe[8] = [0, ["I",59,20], ["I",60,20], ["I",61,20]]
I_recipe[76] = [500, ["I",86,1],["I",96,5]]
I_recipe[77] = [500, ["I",87,1],["I",96,5]]
I_recipe[78] = [500, ["I",88,1],["I",96,5]]
I_recipe[79] = [500, ["I",89,1],["I",96,5]]
I_recipe[80] = [500, ["I",90,1],["I",96,5]]
I_recipe[81] = [500, ["I",91,1],["I",96,5]]
I_recipe[82] = [500, ["I",92,1],["I",96,5]]
I_recipe[83] = [500, ["I",93,1],["I",96,5]]
I_recipe[84] = [500, ["I",94,1],["I",96,5]]
I_recipe[85] = [500, ["I",95,1],["I",96,5]]
I_recipe[98] = [1000, ["I",99,5]]
#武器の合成レシピ
W_recipe[14] = [0, ["I",27,5]]
W_recipe[20] = [0, ["I",27,5]]
W_recipe[8] = [0, ["I",27,5]]
W_recipe[86] = [0, ["I",27,5]]
W_recipe[15] = [0, ["I",27,5], ["I",29,5]]
W_recipe[21] = [0, ["I",27,5], ["I",29,5]]
W_recipe[78] = [0, ["I",27,5], ["I",29,5]]
W_recipe[51] = [0, ["I",27,5], ["I",29,5]]
W_recipe[67] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[70] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[9] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[50] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[68] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[71] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[79] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[87] = [0, ["I",27,5], ["I",29,5], ["I",28,5]]
W_recipe[16] = [0, ["I",27,5], ["I",28,5], ["I",30,5]]
W_recipe[22] = [0, ["I",27,5], ["I",28,5], ["I",30,5]]
W_recipe[10] = [0, ["I",27,5], ["I",28,5], ["I",30,5]]
W_recipe[52] = [0, ["I",27,5], ["I",28,5], ["I",30,5]]
W_recipe[17] = [0, ["I",28,5], ["I",30,5], ["I",31,5]]
W_recipe[23] = [0, ["I",28,5], ["I",30,5], ["I",31,5]]
W_recipe[11] = [0, ["I",28,5], ["I",30,5], ["I",31,5]]
W_recipe[53] = [0, ["I",28,5], ["I",30,5], ["I",31,5]]
W_recipe[18] = [0, ["I",30,5], ["I",31,5], ["I",32,5]]
W_recipe[24] = [0, ["I",30,5], ["I",31,5], ["I",32,5]]
W_recipe[12] = [0, ["I",30,5], ["I",31,5], ["I",32,5]]
W_recipe[54] = [0, ["I",30,5], ["I",31,5], ["I",32,5]]
W_recipe[69] = [0, ["I",30,5], ["I",31,5], ["I",33,5]]
W_recipe[72] = [0, ["I",30,5], ["I",31,5], ["I",33,5]]
W_recipe[80] = [0, ["I",30,5], ["I",31,5], ["I",33,5]]
W_recipe[88] = [0, ["I",30,5], ["I",31,5], ["I",33,5]]
W_recipe[62] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
W_recipe[73] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
W_recipe[81] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
W_recipe[89] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",64,5]]
W_recipe[63] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]
W_recipe[74] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]
W_recipe[82] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]
W_recipe[90] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",63,5]]
W_recipe[94] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]
W_recipe[98] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]
W_recipe[102] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]
W_recipe[106] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",65,5]]
W_recipe[95] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]
W_recipe[99] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]
W_recipe[103] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]
W_recipe[107] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",66,5]]
W_recipe[96] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]
W_recipe[0] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]
W_recipe[104] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]
W_recipe[108] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",62,5]]
W_recipe[97] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]
W_recipe[101] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]
W_recipe[105] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]
W_recipe[109] = [0, ["I",30,10], ["I",31,10], ["I",32,10], ["I",67,5]]
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]]
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]]
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]]
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]]
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]]
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]]
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]]
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]]
W_recipe[66] = [0, ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
W_recipe[77] = [0, ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
W_recipe[85] = [0, ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
W_recipe[93] = [0, ["I",30,20],["I",31,20], ["I",33,20], ["I",68,20], ["I",69,20]]
W_recipe[61] = [0, ["I",30,10],["I",31,10], ["I",33,10], ["I",68,10], ["I",69,10]]
#防具の合成レシピ
A_recipe[61] = [0, ["I",34,5]]
A_recipe[11] = [0, ["I",34,5],["I",35,5]]
A_recipe[12] = [0, ["I",35,5],["I",36,5]]
A_recipe[62] = [0, ["I",35,5],["I",36,5],["I",37,5]]
A_recipe[63] = [0, ["I",36,5],["I",37,5],["I",38,5]]
A_recipe[64] = [0, ["I",38,5],["I",39,5]]
A_recipe[65] = [0, ["I",38,5],["I",39,5],["I",40,5]]
A_recipe[66] = [0, ["I",38,5],["I",39,5],["I",40,5]]
A_recipe[13] = [0, ["I",37,5],["I",38,5],["I",39,5],["I",40,5]]
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]]
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]]
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]]
A_recipe[16] = [0, ["I",34,5]]
A_recipe[17] = [0, ["I",34,5],["I",35,5]]
A_recipe[18] = [0, ["I",35,5],["I",36,5]]
A_recipe[19] = [0, ["I",35,5],["I",36,5],["I",37,5]]
A_recipe[20] = [0, ["I",36,5],["I",37,5],["I",38,5]]
A_recipe[68] = [0, ["I",38,5],["I",39,5]]
A_recipe[69] = [0, ["I",38,5],["I",39,5],["I",40,5]]
A_recipe[70] = [0, ["I",38,5],["I",39,5],["I",40,5]]
A_recipe[71] = [0, ["I",37,5],["I",38,5],["I",39,5],["I",40,5]]
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]]
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]]
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]]
A_recipe[26] = [0, ["I",41,3]]
A_recipe[27] = [0, ["I",41,3],["I",42,2]]
A_recipe[28] = [0, ["I",42,5],["I",43,5]]
A_recipe[29] = [0, ["I",42,5],["I",43,5],["I",44,5]]
A_recipe[30] = [0, ["I",43,5],["I",44,5],["I",45,5]]
A_recipe[75] = [0, ["I",45,5],["I",46,5]]
A_recipe[76] = [0, ["I",45,5],["I",46,5],["I",47,5]]
A_recipe[77] = [0, ["I",45,5],["I",46,5],["I",47,5]]
A_recipe[78] = [0, ["I",44,5],["I",45,5],["I",46,5],["I",47,5]]
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]]
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]]
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]]
A_recipe[21] = [0, ["I",41,5]]
A_recipe[22] = [0, ["I",41,5],["I",42,5]]
A_recipe[23] = [0, ["I",42,5],["I",43,5]]
A_recipe[24] = [0, ["I",42,5],["I",43,5],["I",44,5]]
A_recipe[25] = [0, ["I",43,5],["I",44,5],["I",45,5]]
A_recipe[82] = [0, ["I",45,5],["I",46,5]]
A_recipe[83] = [0, ["I",45,5],["I",46,5],["I",47,5]]
A_recipe[84] = [0, ["I",45,5],["I",46,5],["I",47,5]]
A_recipe[85] = [0, ["I",44,5],["I",45,5],["I",46,5],["I",47,5]]
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]]
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]]
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]]
A_recipe[36] = [0, ["I",27,3]]
A_recipe[37] = [0, ["I",27,3],["I",29,2]]
A_recipe[38] = [0, ["I",28,5],["I",29,5]]
A_recipe[39] = [0, ["I",28,5],["I",29,5],["I",30,5]]
A_recipe[40] = [0, ["I",29,5],["I",30,5],["I",31,5]]
A_recipe[89] = [0, ["I",31,5],["I",32,5]]
A_recipe[90] = [0, ["I",31,5],["I",32,5],["I",33,5]]
A_recipe[91] = [0, ["I",31,5],["I",32,5],["I",33,5]]
A_recipe[92] = [0, ["I",30,5],["I",31,5],["I",32,5],["I",33,5]]
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]]
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]]
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]]
A_recipe[31] = [0, ["I",27,5]]
A_recipe[32] = [0, ["I",27,5],["I",29,5]]
A_recipe[33] = [0, ["I",28,5],["I",29,5]]
A_recipe[34] = [0, ["I",28,5],["I",29,5],["I",30,5]]
A_recipe[35] = [0, ["I",29,5],["I",30,5],["I",31,5]]
A_recipe[96] = [0, ["I",31,5],["I",32,5]]
A_recipe[97] = [0, ["I",31,5],["I",32,5],["I",33,5]]
A_recipe[98] = [0, ["I",31,5],["I",32,5],["I",33,5]]
A_recipe[99] = [0, ["I",30,5],["I",31,5],["I",32,5],["I",40,5]]
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]]
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]]
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]]
#大事なもの合成レシピ
#K_recipe[76] = [0, ["I",86,1],["I",96,10]]
#K_recipe[77] = [0, ["I",87,1],["I",96,10]]
#K_recipe[78] = [0, ["I",88,1],["I",96,10]]
#K_recipe[79] = [0, ["I",89,1],["I",96,10]]
#K_recipe[80] = [0, ["I",90,1],["I",96,10]]
#K_recipe[81] = [0, ["I",91,1],["I",96,10]]
#K_recipe[82] = [0, ["I",92,1],["I",96,10]]
#K_recipe[83] = [0, ["I",93,1],["I",96,10]]
#K_recipe[84] = [0, ["I",94,1],["I",96,10]]
#K_recipe[85] = [0, ["I",95,1],["I",96,10]]
end
#==============================================================================
# ■ WD_itemsynthesis
#------------------------------------------------------------------------------
# アイテム合成用の共通メソッドです。
#==============================================================================
module WD_itemsynthesis
def i_recipe_switch_on(id)
$game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
$game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
$game_system.i_rcp_sw[id] = true
end
def i_recipe_switch_off(id)
$game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
$game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
$game_system.i_rcp_sw[id] = false
end
def i_recipe_switch_on?(id)
$game_system.i_rcp_sw = [] if $game_system.i_rcp_sw == nil
$game_system.i_rcp_sw[id] = false if $game_system.i_rcp_sw[id] == nil
return $game_system.i_rcp_sw[id]
end
def i_recipe_all_switch_on
for i in 1..$data_items.size
i_recipe_switch_on(i)
end
end
def i_recipe_all_switch_off
for i in 1..$data_items.size
i_recipe_switch_off(i)
end
end
def w_recipe_switch_on(id)
$game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
$game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
$game_system.w_rcp_sw[id] = true
end
def w_recipe_switch_off(id)
$game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
$game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
$game_system.w_rcp_sw[id] = false
end
def w_recipe_switch_on?(id)
$game_system.w_rcp_sw = [] if $game_system.w_rcp_sw == nil
$game_system.w_rcp_sw[id] = false if $game_system.w_rcp_sw[id] == nil
return $game_system.w_rcp_sw[id]
end
def w_recipe_all_switch_on
for i in 1..$data_weapons.size
w_recipe_switch_on(i)
end
end
def w_recipe_all_switch_off
for i in 1..$data_weapons.size
w_recipe_switch_off(i)
end
end
def a_recipe_switch_on(id)
$game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
$game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
$game_system.a_rcp_sw[id] = true
end
def a_recipe_switch_off(id)
$game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
$game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
$game_system.a_rcp_sw[id] = false
end
def a_recipe_switch_on?(id)
$game_system.a_rcp_sw = [] if $game_system.a_rcp_sw == nil
$game_system.a_rcp_sw[id] = false if $game_system.a_rcp_sw[id] == nil
return $game_system.a_rcp_sw[id]
end
def a_recipe_all_switch_on
for i in 1..$data_armors.size
a_recipe_switch_on(i)
end
end
def a_recipe_all_switch_off
for i in 1..$data_armors.size
a_recipe_switch_off(i)
end
end
def recipe_all_switch_on
i_recipe_all_switch_on
w_recipe_all_switch_on
a_recipe_all_switch_on
end
def recipe_all_switch_off
i_recipe_all_switch_off
w_recipe_all_switch_off
a_recipe_all_switch_off
end
end
class Game_Interpreter
include WD_itemsynthesis
end
class Game_System
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :i_rcp_sw
attr_accessor :w_rcp_sw
attr_accessor :a_rcp_sw
attr_accessor :K_rcp_sw
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias wd_orig_initialize004 initialize
def initialize
wd_orig_initialize004
@i_rcp_sw = []
@w_rcp_sw = []
@a_rcp_sw = []
@K_rcp_sw = []
end
end
#==============================================================================
# ■ Scene_ItemSynthesis
#------------------------------------------------------------------------------
# 合成画面の処理を行うクラスです。
#==============================================================================
class Scene_ItemSynthesis < Scene_MenuBase
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
create_help_window
create_dummy_window
create_number_window
create_status_window
create_material_window
create_list_window
create_category_window
create_gold_window
create_change_window
end
#--------------------------------------------------------------------------
# ● ゴールドウィンドウの作成
#--------------------------------------------------------------------------
def create_gold_window
@gold_window = Window_Gold.new
@gold_window.viewport = @viewport
@gold_window.x = Graphics.width - @gold_window.width
@gold_window.y = @help_window.height
@gold_window.hide
end
#--------------------------------------------------------------------------
# ● 切り替え表示ウィンドウの作成
#--------------------------------------------------------------------------
def create_change_window
wx = 0
wy = @gold_window.y
ww = Graphics.width - @gold_window.width
wh = @gold_window.height
@change_window = Window_ItemSynthesisChange.new(wx, wy, ww, wh)
@change_window.viewport = @viewport
@change_window.hide
end
#--------------------------------------------------------------------------
# ● ダミーウィンドウの作成
#--------------------------------------------------------------------------
def create_dummy_window
wy = @help_window.y + @help_window.height + 48
wh = Graphics.height - wy
@dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
@dummy_window.viewport = @viewport
end
#--------------------------------------------------------------------------
# ● 個数入力ウィンドウの作成
#--------------------------------------------------------------------------
def create_number_window
wy = @dummy_window.y
wh = @dummy_window.height
@number_window = Window_ItemSynthesisNumber.new(0, wy, wh)
@number_window.viewport = @viewport
@number_window.hide
@number_window.set_handler(:ok, method(:on_number_ok))
@number_window.set_handler(:cancel, method(:on_number_cancel))
end
#--------------------------------------------------------------------------
# ● ステータスウィンドウの作成
#--------------------------------------------------------------------------
def create_status_window
wx = @number_window.width
wy = @dummy_window.y
ww = Graphics.width - wx
wh = @dummy_window.height
@status_window = Window_ShopStatus.new(wx, wy, ww, wh)
@status_window.viewport = @viewport
@status_window.hide
end
#--------------------------------------------------------------------------
# ● 素材ウィンドウの作成
#--------------------------------------------------------------------------
def create_material_window
wx = @number_window.width
wy = @dummy_window.y
ww = Graphics.width - wx
wh = @dummy_window.height
@material_window = Window_ItemSynthesisMaterial.new(wx, wy, ww, wh)
@material_window.viewport = @viewport
@material_window.hide
@number_window.material_window = @material_window
end
#--------------------------------------------------------------------------
# ● 合成アイテムリストウィンドウの作成
#--------------------------------------------------------------------------
def create_list_window
wy = @dummy_window.y
wh = @dummy_window.height
@list_window = Window_ItemSynthesisList.new(0, wy, wh)
@list_window.viewport = @viewport
@list_window.help_window = @help_window
@list_window.status_window = @status_window
@list_window.material_window = @material_window
@list_window.hide
@list_window.set_handler(:ok, method(:on_list_ok))
@list_window.set_handler(:cancel, method(:on_list_cancel))
@list_window.set_handler(:change_window, method(:on_change_window))
end
#--------------------------------------------------------------------------
# ● カテゴリウィンドウの作成
#--------------------------------------------------------------------------
def create_category_window
@category_window = Window_ItemSynthesisCategory.new
@category_window.viewport = @viewport
@category_window.help_window = @help_window
@category_window.y = @help_window.height
@category_window.activate
@category_window.item_window = @list_window
@category_window.set_handler(:ok, method(:on_category_ok))
@category_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# ● 合成アイテムリストウィンドウのアクティブ化
#--------------------------------------------------------------------------
def activate_list_window
@list_window.money = money
@list_window.show.activate
end
#--------------------------------------------------------------------------
# ● 合成[決定]
#--------------------------------------------------------------------------
def on_list_ok
@item = @list_window.item
@list_window.hide
@number_window.set(@item, max_buy, buying_price, currency_unit)
@number_window.show.activate
end
#--------------------------------------------------------------------------
# ● 合成[キャンセル]
#--------------------------------------------------------------------------
def on_list_cancel
@category_window.activate
@category_window.show
@dummy_window.show
@list_window.hide
@status_window.hide
@status_window.item = nil
@material_window.hide
@material_window.set(nil, nil)
@gold_window.hide
@change_window.hide
@help_window.clear
end
#--------------------------------------------------------------------------
# ● 表示切替
#--------------------------------------------------------------------------
def on_change_window
if @status_window.visible
@status_window.hide
@material_window.show
else
@status_window.show
@material_window.hide
end
end
#--------------------------------------------------------------------------
# ● カテゴリ[決定]
#--------------------------------------------------------------------------
def on_category_ok
activate_list_window
@gold_window.show
@change_window.show
@material_window.show
@category_window.hide
@list_window.select(0)
end
#--------------------------------------------------------------------------
# ● 個数入力[決定]
#--------------------------------------------------------------------------
def on_number_ok
Sound.play_shop
do_syntetic(@number_window.number)
end_number_input
@gold_window.refresh
end
#--------------------------------------------------------------------------
# ● 個数入力[キャンセル]
#--------------------------------------------------------------------------
def on_number_cancel
Sound.play_cancel
end_number_input
end
#--------------------------------------------------------------------------
# ● 合成の実行
#--------------------------------------------------------------------------
def do_syntetic(number)
$game_party.lose_gold(number * buying_price)
$game_party.gain_item(@item, number)
[url=home.php?mod=space&uid=2564094]@recipe[/url] = @list_window.recipe(@item)
for i in [email]1...@recipe.size[/email]
kind = @recipe[i][0]
id = @recipe[i][1]
num = @recipe[i][2]
if kind == "I"
item = $data_items[id]
elsif kind == "W"
item = $data_weapons[id]
elsif kind == "A"
item = $data_armors[id]
elsif kind == "K"
item = $data_key_item[id]
end
$game_party.lose_item(item, num*number)
end
end
#--------------------------------------------------------------------------
# ● 個数入力の終了
#--------------------------------------------------------------------------
def end_number_input
@number_window.hide
activate_list_window
end
#--------------------------------------------------------------------------
# ● 最大購入可能個数の取得
#--------------------------------------------------------------------------
def max_buy
max = $game_party.max_item_number(@item) - $game_party.item_number(@item)
@recipe = @list_window.recipe(@item)
for i in [email]1...@recipe.size[/email]
kind = @recipe[i][0]
id = @recipe[i][1]
num = @recipe[i][2]
if kind == "I"
item = $data_items[id]
elsif kind == "W"
item = $data_weapons[id]
elsif kind == "A"
item = $data_armors[id]
elsif kind == "K"
item = $data_key_item[id]
end
if num > 0
max_buf = $game_party.item_number(item)/num
else
max_buf = 999
end
max = [max, max_buf].min
end
buying_price == 0 ? max : [max, money / buying_price].min
end
#--------------------------------------------------------------------------
# ● 所持金の取得
#--------------------------------------------------------------------------
def money
@gold_window.value
end
#--------------------------------------------------------------------------
# ● 通貨単位の取得
#--------------------------------------------------------------------------
def currency_unit
@gold_window.currency_unit
end
#--------------------------------------------------------------------------
# ● 合成費用の取得
#--------------------------------------------------------------------------
def buying_price
@list_window.price(@item)
end
end
#==============================================================================
# ■ Window_ItemSynthesisList
#------------------------------------------------------------------------------
# 合成画面で、合成可能なアイテムの一覧を表示するウィンドウです。
#==============================================================================
class Window_ItemSynthesisList < Window_Selectable
include WD_itemsynthesis
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :status_window # ステータスウィンドウ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, height)
super(x, y, window_width, height)
@shop_goods = []
@shop_recipes = []
for i in 1..WD_itemsynthesis_ini::I_recipe.size
recipe = WD_itemsynthesis_ini::I_recipe[i]
if recipe
good = [0, i, recipe[0]]
if i_recipe_switch_on?(i)
@shop_goods.push(good)
@shop_recipes.push(recipe)
end
end
end
for i in 1..WD_itemsynthesis_ini::W_recipe.size
recipe = WD_itemsynthesis_ini::W_recipe[i]
if recipe
good = [1, i, recipe[0]]
if w_recipe_switch_on?(i)
@shop_goods.push(good)
@shop_recipes.push(recipe)
end
end
end
for i in 1..WD_itemsynthesis_ini::A_recipe.size
recipe = WD_itemsynthesis_ini::A_recipe[i]
if recipe
good = [2, i, recipe[0]]
if a_recipe_switch_on?(i)
@shop_goods.push(good)
@shop_recipes.push(recipe)
end
end
end
for i in 1..WD_itemsynthesis_ini::K_recipe.size
recipe = WD_itemsynthesis_ini::K_recipe[i]
if recipe
good = [2, i, recipe[0]]
if a_recipe_switch_on?(i)
@shop_goods.push(good)
@shop_recipes.push(recipe)
end
end
end
[url=home.php?mod=space&uid=26101]@Money[/url] = 0
refresh
select(0)
end
#--------------------------------------------------------------------------
# ● ウィンドウ幅の取得
#--------------------------------------------------------------------------
def window_width
return 304
end
#--------------------------------------------------------------------------
# ● 項目数の取得
#--------------------------------------------------------------------------
def item_max
@data ? @data.size : 1
end
#--------------------------------------------------------------------------
# ● アイテムの取得
#--------------------------------------------------------------------------
def item
@data[index]
end
#--------------------------------------------------------------------------
# ● 所持金の設定
#--------------------------------------------------------------------------
def money=(money)
@money = money
refresh
end
#--------------------------------------------------------------------------
# ● 選択項目の有効状態を取得
#--------------------------------------------------------------------------
def current_item_enabled?
enable?(@data[index])
end
#--------------------------------------------------------------------------
# ● 合成費用を取得
#--------------------------------------------------------------------------
def price(item)
@price[item]
end
#--------------------------------------------------------------------------
# ● 合成可否を取得
#--------------------------------------------------------------------------
def enable?(item)
@makable[item]
end
#--------------------------------------------------------------------------
# ● レシピを取得
#--------------------------------------------------------------------------
def recipe(item)
@recipe[item]
end
#--------------------------------------------------------------------------
# ● アイテムを許可状態で表示するかどうか
#--------------------------------------------------------------------------
def have_mat?(recipe)
flag = true
if @money >= recipe[0]
for i in 1...recipe.size
kind = recipe[i][0]
id = recipe[i][1]
num = recipe[i][2]
if kind == "I"
item = $data_items[id]
elsif kind == "W"
item = $data_weapons[id]
elsif kind == "A"
item = $data_armors[id]
elsif kind == "K"
item = $data_key_item[id]
end
if $game_party.item_number(item) < [num, 1].max
flag = false
end
end
else
flag = false
end
return flag
end
#--------------------------------------------------------------------------
# ● カテゴリの設定
#--------------------------------------------------------------------------
def category=(category)
return if @category == category
@category = category
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
make_item_list
create_contents
draw_all_items
end
#--------------------------------------------------------------------------
# ● アイテムをリストに含めるかどうか
#--------------------------------------------------------------------------
def include?(item)
case @category
when :item
item.is_a?(RPG::Item) && !item.key_item?
when :weapon
item.is_a?(RPG::Weapon)
when :armor
item.is_a?(RPG::Armor)
when :key_item
item.is_a?(RPG::Item) && item.key_item?
else
false
end
end
#--------------------------------------------------------------------------
# ● アイテムリストの作成
#--------------------------------------------------------------------------
def make_item_list
@data = []
@price = {}
@makable = {}
@recipe = {}
for i in [email]0...@shop_goods.size[/email]
goods = @shop_goods[i]
recipe = @shop_recipes[i]
case goods[0]
when 0; item = $data_items[goods[1]]
when 1; item = $data_weapons[goods[1]]
when 2; item = $data_armors[goods[1]]
when 3; item = $data_key_item[goods[1]]
end
if item
if include?(item)
@data.push(item)
@price[item] = goods[2]
@makable[item] = have_mat?(recipe)
@recipe[item] = recipe
end
end
end
end
#--------------------------------------------------------------------------
# ● 項目の描画
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
rect = item_rect(index)
draw_item_name(item, rect.x, rect.y, enable?(item))
rect.width -= 4
draw_text(rect, price(item), 2) if WD_itemsynthesis_ini::Cost_view
end
#--------------------------------------------------------------------------
# ● ステータスウィンドウの設定
#--------------------------------------------------------------------------
def status_window=(status_window)
@status_window = status_window
call_update_help
end
#--------------------------------------------------------------------------
# ● 素材ウィンドウの設定
#--------------------------------------------------------------------------
def material_window=(material_window)
@material_window = material_window
call_update_help
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_item(item) if @help_window
@status_window.item = item if @status_window
@material_window.set(item, recipe(item)) if @material_window
end
#--------------------------------------------------------------------------
# ● ←→ ボタン(表示切替)が押されたときの処理
#--------------------------------------------------------------------------
def process_change_window
Sound.play_cursor
Input.update
call_handler(:change_window)
end
#--------------------------------------------------------------------------
# ● 決定やキャンセルなどのハンドリング処理
#--------------------------------------------------------------------------
def process_handling
super
if active
return process_change_window if handle?(:change_window) && Input.trigger?(:X)
return process_change_window if handle?(:change_window) && Input.trigger?(:Y)
end
end
end
#==============================================================================
# ■ Window_ItemSynthesisMaterial
#------------------------------------------------------------------------------
# 合成画面で、合成に必要な素材を表示するウィンドウです。
#==============================================================================
class Window_ItemSynthesisMaterial < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
@item = nil
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_possession(4, 0)
draw_material_info(0, line_height * 2)
end
#--------------------------------------------------------------------------
# ● アイテムの設定
#--------------------------------------------------------------------------
def set(item, recipe)
@item = item
@recipe = recipe
@make_number = 1
refresh
end
#--------------------------------------------------------------------------
# ● 作成個数の設定
#--------------------------------------------------------------------------
def set_num(make_number)
@make_number = make_number
refresh
end
#--------------------------------------------------------------------------
# ● 所持数の描画
#--------------------------------------------------------------------------
def draw_possession(x, y)
rect = Rect.new(x, y, contents.width - 4 - x, line_height)
change_color(system_color)
draw_text(rect, Vocab::Possession)
change_color(normal_color)
draw_text(rect, $game_party.item_number(@item), 2)
end
#--------------------------------------------------------------------------
# ● 素材情報の描画
#--------------------------------------------------------------------------
def draw_material_info(x, y)
rect = Rect.new(x, y, contents.width, line_height)
change_color(system_color)
contents.font.size = 18
draw_text(rect, "必要素材", 0)
if @recipe
for i in [email]1...@recipe.size[/email]
kind = @recipe[i][0]
id = @recipe[i][1]
num = @recipe[i][2]
if kind == "I"
item = $data_items[id]
elsif kind == "W"
item = $data_weapons[id]
elsif kind == "A"
item = $data_armors[id]
elsif kind == "K"
item = $data_key_item[id]
end
rect = Rect.new(x, y + line_height*i, contents.width, line_height)
enabled = true
enabled = false if [num*@make_number, 1].max > $game_party.item_number(item)
draw_item_name(item, rect.x, rect.y, enabled)
change_color(normal_color, enabled)
if num > 0
draw_text(rect, "#{num*@make_number}/#{$game_party.item_number(item)}", 2)
end
end
end
change_color(normal_color)
contents.font.size = 24
end
end
#==============================================================================
# ■ Window_ItemSynthesisNumber
#------------------------------------------------------------------------------
# 合成画面で、合成するアイテムの個数を入力するウィンドウです。
#==============================================================================
class Window_ItemSynthesisNumber < Window_ShopNumber
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_item_name(@item, 0, item_y)
draw_number
draw_total_price if WD_itemsynthesis_ini::Cost_view
end
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def material_window=(material_window)
@material_window = material_window
call_update_help
end
#--------------------------------------------------------------------------
# ● 作成個数の変更
#--------------------------------------------------------------------------
def change_number(amount)
@number = [[@number + amount, @max].min, 1].max
call_update_help #追加
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def call_update_help
@material_window.set_num(@number) if @material_window
end
end
#==============================================================================
# ■ Window_ItemSynthesisCategory
#------------------------------------------------------------------------------
# 合成画面で、通常アイテムや装備品の分類を選択するウィンドウです。
#==============================================================================
class Window_ItemSynthesisCategory < Window_ItemCategory
#--------------------------------------------------------------------------
# ● 桁数の取得
#--------------------------------------------------------------------------
def col_max
i = 0
i += 1 if WD_itemsynthesis_ini::Category_i
i += 1 if WD_itemsynthesis_ini::Category_w
i += 1 if WD_itemsynthesis_ini::Category_a
i += 1 if WD_itemsynthesis_ini::Category_k
return i
end
#--------------------------------------------------------------------------
# ● コマンドリストの作成
#--------------------------------------------------------------------------
def make_command_list
add_command(Vocab::item, :item) if WD_itemsynthesis_ini::Category_i
add_command(Vocab::weapon, :weapon) if WD_itemsynthesis_ini::Category_w
add_command(Vocab::armor, :armor) if WD_itemsynthesis_ini::Category_a
add_command(Vocab::key_item, :key_item) if WD_itemsynthesis_ini::Category_k
end
end
#==============================================================================
# ■ Window_ItemSynthesisNumber
#------------------------------------------------------------------------------
# 合成画面で、切替を表示するウィンドウです。
#==============================================================================
class Window_ItemSynthesisChange < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
text = "X Y:表示切り替え"
draw_text(0, 0, contents_width, line_height, text, 1)
end
end
属性随机脚本
#encoding:utf-8
#==============================================================================
# ■ 随机属性装备 By wyongcan
#==============================================================================
module Equipplus
#得到随机属性装备方法:gainequip(装备ID,属性数)
#~ 前缀结构:
#~ ①权重(1-100) 越大越重要
#~ ②名称(多个名称用","分开,会随机取其中一个添加到武器名前)
#~ ③属性数组 提供两种方式:
#~ 1.[属性ID,增加值] 属性ID参考说明增强脚本 增加了9号属性“极品出现率” ID为8,影响前缀的好坏 1 - 100
#~ 2.与装备特性相同[code,data_id,value] code,data_id参考说明增强脚本
@maxparamplus = 3 #最大前缀数
@moneyrate = 10 #物品价格计算公式为:原价格 + 前缀权重 * @moneyrate
@transpose = [*1..100].reverse #用于把1变成100,100变成1
@paramsplus = [ #暂时只写了三个前缀,可以自己添加,参照前缀结构
[10,"力量,凶残",[[2,10]]], #物理攻击加10
[20,"灵气",[[0,200],[1,200]]], # HP和MP各加200
[60,"战神",[[21,2,2]]] #物理攻击双倍
]
$商店随机 = true #商店买装备时出随机属性
$战斗随机 = true #战斗后获得随机属性装备
def self.getname(paramsplus)
name = ""
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(","){}}
name += @temp[rand(@temp.size)] if paramsplus.is_a?(Array) != true
name += "的"
end
def self.getluck #获得极品出现率
luck = 0
$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}}
luck
end
def self.getnewequip(xequip,params = nil) #提供两个参数 装备(RPG::Equip类下的)和附加前缀数,不填则为随机
return unless xequip.is_a?(RPG::EquipItem)
#xparamplus为前缀数
xequip.paramsplus = [] if xequip.paramsplus == nil
return if xequip.paramsplus.size >= @maxparamplus
params != nil ? xparamplus = params : xparamplus = rand(@maxparamplus * 110) / 100
xparamplus = xparamplus.to_int
return xequip if xparamplus == 0
equip = xequip.dup
paramsplus = equip.paramsplus.dup #无奈的方法,不这样改一个装备所有同父装备的装备都会变
newparams = equip.params.dup
newfeatures = equip.features.dup
aparamsplus = @paramsplus.collect{|a| [a[0] = @transpose[a[0]-1],a[1],a[2]]}.sort_by{|a| a[0]}
while paramsplus.size < xparamplus
temp = rand(aparamsplus[-1][0])
temp = [temp - getluck,0].max
x = []
for i in aparamsplus
x.push i if i[0] >= temp && paramsplus.include?(i) != true
end
if x != []
a = [(x.size-1)*100 - getluck,0].max
a = (rand(a)/100).to_int
paramsplus.push x[a]
end
end
equip.name = getname(paramsplus) + equip.name #更新名称
paramsplus.each{|a| equip.price += @transpose[a[0] - 1] * @moneyrate} #更新价格
paramsplus.select{|a| a[2].select{|a| a.size == 2}.each{|a| newparams[a[0]] += a[1]}} #更新属性
#以下为更新特性
features = []
paramsplus.each{|a| a[2].each{|a| features.push a if a.size == 3}}
while features.size > 0
i = features.pop
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]}
end
if equip.is_a?(RPG::Weapon)
equip.id = $data_weapons.size
$data_weapons.insert $data_weapons.size,equip
$data_weapons[equip.id].paramsplus = paramsplus
$data_weapons[equip.id].params = newparams
$data_weapons[equip.id].features = newfeatures
else
equip.id = $data_armors.size
$data_armors.insert $data_armors.size,equip
$data_armors[equip.id].paramsplus = paramsplus
$data_armors[equip.id].params = newparams
$data_armors[equip.id].features = newfeatures
end
equip
end
def self.gainequip(id,params = nil)
$game_party.gain_item(Equipplus.getnewequip($data_weapons[id],params),1,true)
end
end
if $商店随机 == true
class Scene_Shop < Scene_MenuBase
def do_buy(number)
$game_party.lose_gold(number * buying_price)
if @item.is_a?(RPG::EquipItem)
x = number
loop do
break if x <= 0
x -= 1
$game_party.gain_item(Equipplus.getnewequip(@item), 1)
end
else
$game_party.gain_item(@item, number)
end
end
end
end
if $战斗随机 == true
module BattleManager
def self.gain_drop_items
$game_troop.make_drop_items.each do |item|
item.is_a?(RPG::EquipItem) ? xitem = Equipplus.getnewequip(item) : xitem = item
$game_party.gain_item(xitem, 1)
$game_message.add(sprintf(Vocab::ObtainItem, xitem.name))
end
wait_for_message
end
end
end
class RPG::EquipItem < RPG::BaseItem
alias old initialize
def initialize
old
@paramsplus #前缀
end
attr_accessor :paramsplus
end
#encoding:utf-8
#==============================================================================
# ■ 随机属性装备 By wyongcan
#==============================================================================
module Equipplus
#得到随机属性装备方法:gainequip(装备ID,属性数)
#~ 前缀结构:
#~ ①权重(1-100) 越大越重要
#~ ②名称(多个名称用","分开,会随机取其中一个添加到武器名前)
#~ ③属性数组 提供两种方式:
#~ 1.[属性ID,增加值] 属性ID参考说明增强脚本 增加了9号属性“极品出现率” ID为8,影响前缀的好坏 1 - 100
#~ 2.与装备特性相同[code,data_id,value] code,data_id参考说明增强脚本
@maxparamplus = 3 #最大前缀数
@moneyrate = 10 #物品价格计算公式为:原价格 + 前缀权重 * @moneyrate
@transpose = [*1..100].reverse #用于把1变成100,100变成1
@paramsplus = [ #暂时只写了三个前缀,可以自己添加,参照前缀结构
[10,"力量,凶残",[[2,10]]], #物理攻击加10
[20,"灵气",[[0,200],[1,200]]], # HP和MP各加200
[60,"战神",[[21,2,2]]] #物理攻击双倍
]
$商店随机 = true #商店买装备时出随机属性
$战斗随机 = true #战斗后获得随机属性装备
def self.getname(paramsplus)
name = ""
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(","){}}
name += @temp[rand(@temp.size)] if paramsplus.is_a?(Array) != true
name += "的"
end
def self.getluck #获得极品出现率
luck = 0
$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}}
luck
end
def self.getnewequip(xequip,params = nil) #提供两个参数 装备(RPG::Equip类下的)和附加前缀数,不填则为随机
return unless xequip.is_a?(RPG::EquipItem)
#xparamplus为前缀数
xequip.paramsplus = [] if xequip.paramsplus == nil
return if xequip.paramsplus.size >= @maxparamplus
params != nil ? xparamplus = params : xparamplus = rand(@maxparamplus * 110) / 100
xparamplus = xparamplus.to_int
return xequip if xparamplus == 0
equip = xequip.dup
paramsplus = equip.paramsplus.dup #无奈的方法,不这样改一个装备所有同父装备的装备都会变
newparams = equip.params.dup
newfeatures = equip.features.dup
aparamsplus = @paramsplus.collect{|a| [a[0] = @transpose[a[0]-1],a[1],a[2]]}.sort_by{|a| a[0]}
while paramsplus.size < xparamplus
temp = rand(aparamsplus[-1][0])
temp = [temp - getluck,0].max
x = []
for i in aparamsplus
x.push i if i[0] >= temp && paramsplus.include?(i) != true
end
if x != []
a = [(x.size-1)*100 - getluck,0].max
a = (rand(a)/100).to_int
paramsplus.push x[a]
end
end
equip.name = getname(paramsplus) + equip.name #更新名称
paramsplus.each{|a| equip.price += @transpose[a[0] - 1] * @moneyrate} #更新价格
paramsplus.select{|a| a[2].select{|a| a.size == 2}.each{|a| newparams[a[0]] += a[1]}} #更新属性
#以下为更新特性
features = []
paramsplus.each{|a| a[2].each{|a| features.push a if a.size == 3}}
while features.size > 0
i = features.pop
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]}
end
if equip.is_a?(RPG::Weapon)
equip.id = $data_weapons.size
$data_weapons.insert $data_weapons.size,equip
$data_weapons[equip.id].paramsplus = paramsplus
$data_weapons[equip.id].params = newparams
$data_weapons[equip.id].features = newfeatures
else
equip.id = $data_armors.size
$data_armors.insert $data_armors.size,equip
$data_armors[equip.id].paramsplus = paramsplus
$data_armors[equip.id].params = newparams
$data_armors[equip.id].features = newfeatures
end
equip
end
def self.gainequip(id,params = nil)
$game_party.gain_item(Equipplus.getnewequip($data_weapons[id],params),1,true)
end
end
if $商店随机 == true
class Scene_Shop < Scene_MenuBase
def do_buy(number)
$game_party.lose_gold(number * buying_price)
if @item.is_a?(RPG::EquipItem)
x = number
loop do
break if x <= 0
x -= 1
$game_party.gain_item(Equipplus.getnewequip(@item), 1)
end
else
$game_party.gain_item(@item, number)
end
end
end
end
if $战斗随机 == true
module BattleManager
def self.gain_drop_items
$game_troop.make_drop_items.each do |item|
item.is_a?(RPG::EquipItem) ? xitem = Equipplus.getnewequip(item) : xitem = item
$game_party.gain_item(xitem, 1)
$game_message.add(sprintf(Vocab::ObtainItem, xitem.name))
end
wait_for_message
end
end
end
class RPG::EquipItem < RPG::BaseItem
alias old initialize
def initialize
old
@paramsplus #前缀
end
attr_accessor :paramsplus
end
-
-
Project1.rar
1.83 MB, 下载次数: 53
范例
作者: VIPArcher 时间: 2014-7-2 13:00
本帖最后由 VIPArcher 于 2014-7-2 14:04 编辑
@recipe
合成脚本里536行改成这样
有修改,刚刚那样会导致无法合成普通道具,
改成现在下面这样- #--------------------------------------------------------------------------
- # ● 合成の実行
- #--------------------------------------------------------------------------
- def do_syntetic(number)
- for i in [email protected]
- kind = @recipe[i][0]
- id = @recipe[i][1]
- num = @recipe[i][2]
- if kind == "I"
- item = $data_items[id]
- elsif kind == "W"
- item = $data_weapons[id]
- elsif kind == "A"
- item = $data_armors[id]
- elsif kind == "K"
- item = $data_key_item[id]
- end
- $game_party.lose_item(item, num*number)
- end
- $game_party.lose_gold(number * buying_price)
- if @item.is_a?(RPG::EquipItem)
- x = number
- loop do
- break if x <= 0
- x -= 1
- $game_party.gain_item(Equipplus.getnewequip(@item), number)
- end
- else
- $game_party.gain_item(@item, number)
- end
-
- end
复制代码
作者: lsmteslplg 时间: 2014-7-2 13:15
解决了,感谢大神帮助!
作者: djs789783 时间: 2024-2-16 15:43
2楼说的,我没看懂,不知道2楼说的要加到哪里,还是直接复制2楼的?不懂
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |