このモジュールは特定のカテゴリに含まれるレシピを一覧表示します。
例
{{#invoke:recipe list|type|Foodstuff}}
とすると カテゴリ:食料のレシピに含まれるレシピを一覧表示します。
名前 | 材料 | クラフトのレシピ | 説明 |
---|---|---|---|
怪しげなシチュー | 赤色のキノコ + 茶色のキノコ + ボウル + いずれかの花 |
シチューの効果は使用した花に依存する。花と効果の対応は後項を参照。なおこのレシピはレシピ本に記録されないので、プレイヤーはこのレシピを覚えておく必要がある。また背の高い花は怪しげなシチューを作るのには使えない。 | |
ウサギシチュー | 焼き兎肉 + ニンジン + ベイクドポテト + いずれかのキノコ + ボウル |
||
キノコシチュー | 赤色のキノコ + 茶色のキノコ + ボウル |
||
金のニンジン | 金塊 + ニンジン |
||
金のリンゴ | 金インゴット + リンゴ |
||
クッキー | 小麦 + カカオ豆 |
||
ケーキ | ミルク入りバケツ + 砂糖 + 卵 + 小麦 |
クラフト後には、ミルク入りバケツは空のバケツとなり、作業台の上に残る。 | |
ハチミツ入りの瓶 | ガラス瓶 + ハチミツブロック |
||
パン | 小麦 | ||
パンプキンパイ | カボチャ + 砂糖 + 卵 |
||
ビートルートスープ | ビートルート + ボウル |
[閲覧 | 編集 | 履歴 | キャッシュ破棄]上記の解説は、モジュール:Recipe list/docから参照されています。
local p = {}
function p.type( f )
local args = f.args
local text = require( [[モジュール:Text]] )
local crafting = require( [[モジュール:Crafting]] ).table
local Autolink = require( [[モジュール:Autolink]] )
local type = text.trim( args[1] )
local argList = {
'type', 'upcoming', 'name', 'ingredients', 'arggroups',
1, 2, 3, 4, 5, 6, 7, 8, 9,
'A1', 'B1', 'C1', 'A2', 'B2', 'C2', 'A3', 'B3', 'C3',
'Output', 'description', 'fixed', 'notfixed',
'A1title', 'A1link', 'B1title', 'B1link', 'C1title', 'C1link',
'A2title', 'A2link', 'B2title', 'B2link', 'C2title', 'C2link',
'A3title', 'A3link', 'B3title', 'B3link', 'C3title', 'C3link',
'Otitle', 'Olink',
}
local data = f:callParserFunction( '#dpl:', {
category = Autolink.invlink( type, 'nolink' ) .. 'のレシピ',
include = '{Crafting}:' .. table.concat( argList, ':' ),
mode = 'userformat',
secseparators = '====',
multisecseparators = '===='
} )
local out = {}
local showDesciption
local templates = {}
for template in text.gsplit( data, '====' ) do
-- If type matches
if template:find( '^%s*' .. type .. '%s*|' ) then
local tArgs = {}
local i = 0
-- Extract the arguments from the DPL query
for tArg in text.gsplit( template, '\n|' ) do
i = i + 1
if tArg ~= '' then
local key = argList[i]
tArgs[key] = tArg
end
end
if tArgs.description then
showDescription = true
end
tArgs.nocat = '1'
table.insert( templates, tArgs )
end
end
if #templates == 0 then
return
end
templates[1].head = '1'
templates[1].showname = '1'
if showDescription and args.showdesciption ~= '0' or args.showdesciption == '1' then
templates[1].showdescription = '1'
end
if not args.continue then
templates[#templates].foot = '1'
end
local out = {}
for i, v in ipairs( templates ) do
table.insert( out, crafting( v ) )
end
return table.concat( out, '\n' )
end
return p