Редактирование: Шаблон:Recipe
Материал из Guild Wars 2 wiki
Внимание! Вы не авторизовались на сайте. Ваш IP-адрес будет публично видимым, если вы будете вносить любые правки. Если вы войдёте или создадите учётную запись, правки вместо этого будут связаны с вашим именем пользователя, а также у вас появятся другие преимущества.
Правка может быть отменена. Пожалуйста, просмотрите сравнение версий, чтобы убедиться, что это именно те изменения, которые вас интересуют, и нажмите «Записать страницу», чтобы изменения вступили в силу.
На этой странице невозможны семантические аннотации в тексте из-за ограничений пространства имён. Детали относительно того, как разрешить пространство имен, находятся в справочной странице конфигурации.
Текущая версия | Ваш текст | ||
Строка 1: | Строка 1: | ||
{{#if: | {{#if: | ||
{{#vardefineecho:recipecnt|{{#expr:{{#var:recipecnt|0}}+1}}}} | {{#vardefineecho:recipecnt|{{#expr:{{#var:recipecnt|0}}+1}}}} | ||
− | {{#vardefine:item_id|{{#explode: | + | {{#vardefine:item_id|{{#explode:{{#show:{{PAGENAME}}|?Has game id#|limit=1|searchlabel=}}|,}}}} |
{{#if:{{#var:item_id}}|{{#switch:{{lc:{{{source}}}}}|mystic|mystic forge={{#vardefine:mystic_forge_id|{{#var:item_id}}{{padleft:{{#var:recipecnt}}|2}}}}}} | {{#vardefine:mystic_forge_id|}} }} | {{#if:{{#var:item_id}}|{{#switch:{{lc:{{{source}}}}}|mystic|mystic forge={{#vardefine:mystic_forge_id|{{#var:item_id}}{{padleft:{{#var:recipecnt}}|2}}}}}} | {{#vardefine:mystic_forge_id|}} }} | ||
}}<div class="recipe-box" style="padding-bottom:0.4em; margin: 10px 1em 10px 0;"> | }}<div class="recipe-box" style="padding-bottom:0.4em; margin: 10px 1em 10px 0;"> | ||
{{#if: {{#ifeq:{{{debug|n}}}|y||{{NAMESPACE}}}} | <!-- no subobject if outside mainspace --> | | {{#if: {{#ifeq:{{{debug|n}}}|y||{{NAMESPACE}}}} | <!-- no subobject if outside mainspace --> | | ||
− | {{# | + | {{#ifeq: {{{historical|n}}} | y | <!-- no subobject if historical --> | |
{{#arraymap: {{{disciplines|}}} |,|@@@|[[Category:@@@ recipes]]|}}<!-- | {{#arraymap: {{{disciplines|}}} |,|@@@|[[Category:@@@ recipes]]|}}<!-- | ||
-->{{#switch: {{lc:{{{source|}}}}} | mystic | mystic forge = [[Category:Mystic Forge recipes]] }}<!-- | -->{{#switch: {{lc:{{{source|}}}}} | mystic | mystic forge = [[Category:Mystic Forge recipes]] }}<!-- | ||
-->{{#subobject:recipe{{#var:recipecnt}} | -->{{#subobject:recipe{{#var:recipecnt}} | ||
| Has context=Recipe | | Has context=Recipe | ||
− | | Has recipe id = {{{id|}}} | + | | Has recipe id = {{{id|}}} |
− | | Has canonical name = | + | | Has canonical name ={{#titleparts:{{PAGENAME}}}} |
| Has recipe source ={{#switch:{{lc:{{{source|}}}}} | | Has recipe source ={{#switch:{{lc:{{{source|}}}}} | ||
| sheet | recipe sheet = Recipe sheet | | sheet | recipe sheet = Recipe sheet | ||
Строка 24: | Строка 24: | ||
| Learned from guild upgrade = {{{guild upgrade|}}} | | Learned from guild upgrade = {{{guild upgrade|}}} | ||
| Requires rating = {{{rating|0}}} | | Requires rating = {{{rating|0}}} | ||
− | | Requires discipline = {{{disciplines|}}} | | + | | Requires discipline = {{#explode:{{{disciplines|}}}|,|0}} |
+ | | Requires discipline = {{#explode:{{{disciplines|}}}|,|1}} | ||
+ | | Requires discipline = {{#explode:{{{disciplines|}}}|,|2}} | ||
+ | | Requires discipline = {{#explode:{{{disciplines|}}}|,|3}} | ||
+ | | Requires discipline = {{#explode:{{{disciplines|}}}|,|4}} | ||
+ | | Requires discipline = {{#explode:{{{disciplines|}}}|,|5}} | ||
+ | | Requires discipline = {{#explode:{{{disciplines|}}}|,|6}} | ||
+ | | Requires discipline = {{#explode:{{{disciplines|}}}|,|7}} | ||
| Discipline count = {{#len:{{#arraymap:{{{disciplines|}}}|,|@@@|.|}}}} | | Discipline count = {{#len:{{#arraymap:{{{disciplines|}}}|,|@@@|.|}}}} | ||
− | | Is time gated = {{#ifeq:{{lc:{{{timegate|n}}}}}|y|Y}} | + | | Is time gated = {{#ifeq:{{lc:{{{timegate|n}}}}}|y|Y|N}} |
− | | Has ingredient = {{#if: {{{ingredient1|}}} | 1;{{#explode:{{{ingredient1}}}| |0}};{{#sub:{{{ingredient1}}}|{{#pos:{{{ingredient1}}}| }}}} }} | + | | Has ingredient = {{#if:{{{ingredient1|}}}|{{#iferror:{{#expr:{{{ingredient1|x}}}*1}}|<!--alpha-->1;{{#explode:{{{ingredient1}}}| |0}};{{#sub:{{{ingredient1}}}|{{#pos:{{{ingredient1}}}| }}}}|<!--numeric-->1;1;{{#ask:[[Has context::Item]][[Has game id::{{{ingredient1}}}]]|link=none}} }} }} |
− | | Has ingredient = {{#if: {{{ingredient2|}}} | 2;{{#explode:{{{ingredient2}}}| |0}};{{#sub:{{{ingredient2}}}|{{#pos:{{{ingredient2}}}| }}}} }} | + | | Has ingredient = {{#if:{{{ingredient2|}}}|{{#iferror:{{#expr:{{{ingredient2|x}}}*1}}|<!--alpha-->2;{{#explode:{{{ingredient2}}}| |0}};{{#sub:{{{ingredient2}}}|{{#pos:{{{ingredient2}}}| }}}}|<!--numeric-->2;1;{{#ask:[[Has context::Item]][[Has game id::{{{ingredient2}}}]]|link=none}} }} }} |
− | | Has ingredient = {{#if: {{{ingredient3|}}} | 3;{{#explode:{{{ingredient3}}}| |0}};{{#sub:{{{ingredient3}}}|{{#pos:{{{ingredient3}}}| }}}} }} | + | | Has ingredient = {{#if:{{{ingredient3|}}}|{{#iferror:{{#expr:{{{ingredient3|x}}}*1}}|<!--alpha-->3;{{#explode:{{{ingredient3}}}| |0}};{{#sub:{{{ingredient3}}}|{{#pos:{{{ingredient3}}}| }}}}|<!--numeric-->3;1;{{#ask:[[Has context::Item]][[Has game id::{{{ingredient3}}}]]|link=none}} }} }} |
− | | Has ingredient = {{#if: {{{ingredient4|}}} | 4;{{#explode:{{{ingredient4}}}| |0}};{{#sub:{{{ingredient4}}}|{{#pos:{{{ingredient4}}}| }}}} }} | + | | Has ingredient = {{#if:{{{ingredient4|}}}|{{#iferror:{{#expr:{{{ingredient4|x}}}*1}}|<!--alpha-->4;{{#explode:{{{ingredient4}}}| |0}};{{#sub:{{{ingredient4}}}|{{#pos:{{{ingredient4}}}| }}}}|<!--numeric-->4;1;{{#ask:[[Has context::Item]][[Has game id::{{{ingredient4}}}]]|link=none}} }} }} |
| Can be queried for base ingredients = {{ucfirst:{{{base ingredients|{{#switch: {{lc:{{{type|}}}}} | demotion | promotion = n | #default = y }}}}}}} | | Can be queried for base ingredients = {{ucfirst:{{{base ingredients|{{#switch: {{lc:{{{type|}}}}} | demotion | promotion = n | #default = y }}}}}}} | ||
| Has item data object = {{PAGENAME}} | | Has item data object = {{PAGENAME}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}} | }} | ||
}} | }} | ||
}} | }} | ||
− | <div id="recipe{{#var:recipecnt}}" class="heading">{{{name|{{ | + | <div id="recipe{{#var:recipecnt}}" class="heading">{{{name|{{PAGENAME}}}}}</div> |
<div class="wrapper"> | <div class="wrapper"> | ||
− | ; | + | ; Источник |
: {{#switch:{{lc:{{{source|}}}}} | : {{#switch:{{lc:{{{source|}}}}} | ||
− | | sheet | recipe sheet = {{#vardefine:sheet_count|0}}{{#arraymap:{{{sheet}}}|;|@@@|{{#ifexpr:{{#var:sheet_count}}=3|<div class="mw-collapsible mw-collapsed"><small>more...</small><div class="mw-collapsible-content">}} | + | | sheet | recipe sheet = {{#vardefine:sheet_count|0}}{{#arraymap:{{{sheet}}}|;|@@@|{{#ifexpr:{{#var:sheet_count}}=3|<div class="mw-collapsible mw-collapsed"><small>more...</small><div class="mw-collapsible-content">}}[[@@@]]{{#vardefine:sheet_count|{{#expr:{{#var:sheet_count|0}}+1}}}}|<br>}}{{#ifexpr:{{#var:sheet_count}}>3|</div></div>}} |
| mystic | mystic forge = [[Mystic Forge]] | | mystic | mystic forge = [[Mystic Forge]] | ||
| guild | guild upgrade = [[{{{guild upgrade}}}]] | | guild | guild upgrade = [[{{{guild upgrade}}}]] | ||
| #default = {{ucfirst:{{{source|''Unspecified''}}}}} | | #default = {{ucfirst:{{{source|''Unspecified''}}}}} | ||
}}{{#if:{{{type|}}}| | }}{{#if:{{{type|}}}| | ||
− | ; | + | ; Тип |
: {{ucfirst:{{{type}}}}} }} | : {{ucfirst:{{{type}}}}} }} | ||
− | ; | + | ; Количество |
: {{#if: {{{upper quantity|}}} | <span style="border-bottom:1px dotted silver" title="The output quantity varies between these two values for this recipe.">{{{quantity|1}}} – {{{upper quantity|}}}</span> | {{{quantity|1}}} }} | : {{#if: {{{upper quantity|}}} | <span style="border-bottom:1px dotted silver" title="The output quantity varies between these two values for this recipe.">{{{quantity|1}}} – {{{upper quantity|}}}</span> | {{{quantity|1}}} }} | ||
− | {{#if: {{{disciplines|}}} | ; | + | {{#if: {{{disciplines|}}} | ; Дисциплина |
: {{#arraymap:{{{disciplines|}}}|,|@@@|{{@@@}} [[{{ucfirst:@@@}}]]|<br>}} | : {{#arraymap:{{{disciplines|}}}|,|@@@|{{@@@}} [[{{ucfirst:@@@}}]]|<br>}} | ||
− | ; | + | ; Треб. уровень |
− | : {{{rating|0}}} {{#if:{{{timegate|}}}| | + | : {{{rating|0}}} {{#if:{{{id|}}}| |
− | ;[[Crafting#Time gated recipes| | + | <dt class="api hide">Unlocked on</dt><!-- |
− | : | + | --><dd class="api hide api-unlockedon" data-recipeid="{{{id}}}">…</dd> }} {{#if:{{{timegate|}}}| |
+ | ;[[Crafting#Time gated recipes|Огр. по времени]] | ||
+ | :Ежедневно | ||
}}{{#if: {{{id|}}} | | }}{{#if: {{{id|}}} | | ||
− | ; | + | ; Ссылка в чат |
− | : {{ | + | : {{recipe link|{{{id|}}}}} }} }} |
</div> | </div> | ||
{{clear}} | {{clear}} | ||
− | <div class="subheading"> | + | <div class="subheading">Ингредиенты</div> |
<div class="ingredients" style="padding-left:1em"> | <div class="ingredients" style="padding-left:1em"> | ||
{{#arraymap:{{{ingredient1|}}}; {{{ingredient2|}}}; {{{ingredient3|}}}; {{{ingredient4|}}}|;|@@@|{{#iferror:{{#expr:@@@*1}} | {{#arraymap:{{{ingredient1|}}}; {{{ingredient2|}}}; {{{ingredient3|}}}; {{{ingredient4|}}}|;|@@@|{{#iferror:{{#expr:@@@*1}} | ||
Строка 77: | Строка 80: | ||
}}|\n}} | }}|\n}} | ||
</div>{{#ifeq: {{{base ingredients|{{#switch: {{lc:{{{type|}}}}} | demotion | promotion = n | #default = y }}}}} | y | </div>{{#ifeq: {{{base ingredients|{{#switch: {{lc:{{{type|}}}}} | demotion | promotion = n | #default = y }}}}} | y | ||
− | | {{# | + | | {{#ifeq: {{{historical|n}}} | y |
+ | | <!-- don't display a link if historical --> | ||
+ | | {{#ifeq: {{{source|}}} | | <!-- don't display if source has not been given --> |<div class="plainlinks" style="float:right; clear:left; margin-right:1em;"><small><span class="plainlinks">[{{fullurl:Special:RunQuery/Base ingredients query|Base_ingredients%5Bitem%5D={{urlencode:{{#titleparts:{{PAGENAME}}}}|path}}&Base_ingredients%5Bid%5D={{{id|{{#var:mystic_forge_id}}}}}{{#if:{{#var:mystic_forge_id}}|&Base_ingredients%5Bdiscipline%5D={{urlencode:Mystic forge}}}}&wpRunQuery=true}} Show base ingredients]</span></small></div> }} | ||
}} | }} | ||
}} | }} | ||
Строка 83: | Строка 88: | ||
== Parameters == | == Parameters == | ||
− | ; name : The recipe name (defaults to <code> | + | ; id : The recipe ID |
+ | ; name : The recipe name (defaults to <code>PAGENAME</code>) | ||
; source | ; source | ||
: How the recipe is learned: | : How the recipe is learned: | ||
Строка 99: | Строка 105: | ||
; rating : The rating required in a discipline to use the recipe. | ; rating : The rating required in a discipline to use the recipe. | ||
; ingredient1 | ; ingredient1 | ||
− | : Required. The ingredients of the recipe. Value should be a quantity followed by an item name. | + | : Required. The ingredients of the recipe. Value should be either a quantity followed by an item name, or simply an item ID. In the latter case, the quantity is assumed to be 1. |
:* <code><quantity> <item name></code>, e.g. <code>1 Jug of Water</code> | :* <code><quantity> <item name></code>, e.g. <code>1 Jug of Water</code> | ||
+ | :* <code><item id></code>, e.g. 25079 | ||
; ingredient2 | ; ingredient2 | ||
; ingredient3 | ; ingredient3 | ||
; ingredient4 | ; ingredient4 | ||
: Optional. Same functionality as ingredient1. | : Optional. Same functionality as ingredient1. | ||
− | ; | + | ; historical |
− | + | : Optional. Set equal to <code>y</code> if the item is historical - this will prevent the recipe from storing semantic properties. | |
− | |||
− | |||
− | : Optional. Set equal to <code> | ||
; base ingredients | ; base ingredients | ||
: Optional. Only set equal to <code>n</code> if you want to hide the base ingredients query, e.g. because it links to a blank form in the case of Agony Infusion, or because its a random chance recipe. Setting this also prevents it appearing on other occurrences of {{tl|base ingredients}}. | : Optional. Only set equal to <code>n</code> if you want to hide the base ingredients query, e.g. because it links to a blank form in the case of Agony Infusion, or because its a random chance recipe. Setting this also prevents it appearing on other occurrences of {{tl|base ingredients}}. | ||
Строка 116: | Строка 120: | ||
<pre> | <pre> | ||
{{Recipe | {{Recipe | ||
+ | | id = 1234 | ||
| name = Berserker's Orichalcum Sage-Stuffed Sapphire | | name = Berserker's Orichalcum Sage-Stuffed Sapphire | ||
| source = Discovery | | source = Discovery | ||
Строка 127: | Строка 132: | ||
| ingredient3 = 250 Bowl of Sage Stuffing | | ingredient3 = 250 Bowl of Sage Stuffing | ||
| ingredient4 = 100 Berserker's Orichalcum Imbued Inscription | | ingredient4 = 100 Berserker's Orichalcum Imbued Inscription | ||
− | |||
}} | }} | ||
</pre> | </pre> | ||
{{Recipe | {{Recipe | ||
+ | | id = 1234 | ||
| name = Berserker's Orichalcum Sage-Stuffed Sapphire | | name = Berserker's Orichalcum Sage-Stuffed Sapphire | ||
| source = Discovery | | source = Discovery | ||
Строка 142: | Строка 147: | ||
| ingredient3 = 250 Bowl of Sage Stuffing | | ingredient3 = 250 Bowl of Sage Stuffing | ||
| ingredient4 = 100 Berserker's Orichalcum Imbued Inscription | | ingredient4 = 100 Berserker's Orichalcum Imbued Inscription | ||
− | |||
}} | }} | ||
[[Category:Infobox templates|Recipe]] | [[Category:Infobox templates|Recipe]] | ||
[[Category:Subobject templates]]</noinclude> | [[Category:Subobject templates]]</noinclude> |