报错的是这一段的红字部分
def have_mat?(recipe)
flag = true
if @money >= recipe[0]
for i in 1...recipe.size
kind = recipe[0]
id = recipe[1]
num = recipe[2]
if kind == "I"
item = $data_items[id]
elsif kind == "W"
item = $data_weapons[id]
elsif kind == "A"
item = $data_armors[id]
end
if $game_party.item_number(item) < [num, 1].max
flag = false
end
end
else
flag = false
end
return flag
end