Редактирование: Шаблон: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:{{{output item id|{{#show:{{BASEPAGENAME}}|?Has game id#|limit=1|searchlabel=}}}}}|,|0}}}}
+
{{#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 --> |
   {{#switch: {{lc:{{{status|current}}}}} | discontinued | current = <!-- no subobject if historical -->
+
   {{#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|}}}|+sep=,
+
       | Has recipe id = {{{id|}}}
       | Has canonical name = {{{name|{{#titleparts:{{BASEPAGENAME}}}}}}}
+
       | 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|}}} |+sep=,
+
       | 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}}
<!-- Properties exposed for usage via the wiki API -->
 
      | Has ingredient with id = {{#if: {{{ingredient1|}}} | 1;{{#explode:{{{ingredient1}}}| |0}};{{#sub:{{{ingredient1}}}|{{#pos:{{{ingredient1}}}| }}}};{{#explode:{{#show: {{#sub:{{{ingredient1}}}|{{#pos:{{{ingredient1}}}| }}}} | ?Has game id# | limit = 1 | searchlabel= }}|,|0}} }}
 
      | Has ingredient with id = {{#if: {{{ingredient2|}}} | 2;{{#explode:{{{ingredient2}}}| |0}};{{#sub:{{{ingredient2}}}|{{#pos:{{{ingredient2}}}| }}}};{{#explode:{{#show: {{#sub:{{{ingredient2}}}|{{#pos:{{{ingredient2}}}| }}}} | ?Has game id# | limit = 1 | searchlabel= }}|,|0}} }}
 
      | Has ingredient with id = {{#if: {{{ingredient3|}}} | 3;{{#explode:{{{ingredient3}}}| |0}};{{#sub:{{{ingredient3}}}|{{#pos:{{{ingredient3}}}| }}}};{{#explode:{{#show: {{#sub:{{{ingredient3}}}|{{#pos:{{{ingredient3}}}| }}}} | ?Has game id# | limit = 1 | searchlabel= }}|,|0}} }}
 
      | Has ingredient with id = {{#if: {{{ingredient4|}}} | 4;{{#explode:{{{ingredient4}}}| |0}};{{#sub:{{{ingredient4}}}|{{#pos:{{{ingredient4}}}| }}}};{{#explode:{{#show: {{#sub:{{{ingredient4}}}|{{#pos:{{{ingredient4}}}| }}}} | ?Has game id# | limit = 1 | searchlabel= }}|,|0}} }}
 
      | Has output game id = {{#var:item_id}}
 
 
     }}
 
     }}
 
   }}
 
   }}
 
}}
 
}}
<div id="recipe{{#var:recipecnt}}" class="heading">{{{name|{{BASEPAGENAME}}}}}</div>
+
<div id="recipe{{#var:recipecnt}}" class="heading">{{{name|{{PAGENAME}}}}}</div>
 
<div class="wrapper">
 
<div class="wrapper">
; Source
+
; Источник
 
: {{#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">}}{{cname|@@@}}{{#vardefine:sheet_count|{{#expr:{{#var:sheet_count|0}}+1}}}}|<br>}}{{#ifexpr:{{#var:sheet_count}}>3|</div></div>}}
+
| 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|}}}|
; Type
+
; Тип
 
: {{ucfirst:{{{type}}}}} }}
 
: {{ucfirst:{{{type}}}}} }}
; Output qty.
+
; Количество
 
: {{#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|}}} | ; Discipline
+
{{#if: {{{disciplines|}}} | ; Дисциплина
 
: {{#arraymap:{{{disciplines|}}}|,|@@@|{{@@@}} [[{{ucfirst:@@@}}]]|<br>}}
 
: {{#arraymap:{{{disciplines|}}}|,|@@@|{{@@@}} [[{{ucfirst:@@@}}]]|<br>}}
; Req. rating
+
; Треб.&nbsp;уровень
: {{{rating|0}}} {{#if:{{{timegate|}}}|
+
: {{{rating|0}}} {{#if:{{{id|}}}|
;[[Crafting#Time gated recipes|Time gate]]
+
<dt class="api hide">Unlocked&nbsp;on</dt><!--
:Daily
+
--><dd class="api hide api-unlockedon" data-recipeid="{{{id}}}">…</dd> }} {{#if:{{{timegate|}}}|
 +
;[[Crafting#Time gated recipes|Огр. по времени]]
 +
:Ежедневно
 
}}{{#if: {{{id|}}} |  
 
}}{{#if: {{{id|}}} |  
; Chat link
+
; Ссылка в чат
: {{#arraymap:{{{id}}}|,|@@@|{{recipe link|@@@}}|<br>}} }} }}
+
: {{recipe link|{{{id|}}}}} }} }}
 
</div>
 
</div>
 
{{clear}}
 
{{clear}}
<div class="subheading">Ingredients</div>
+
<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
  | {{#switch: {{lc:{{{status|current}}}}} | discontinued | current = <!-- 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={{#explode:{{{id|{{#var:mystic_forge_id}}}}}|,|0}}{{#if:{{#var:mystic_forge_id}}|&Base_ingredients%5Bdiscipline%5D={{urlencode:Mystic forge}}}}&Base_ingredients%5Bquantity%5D={{{quantity|1}}}&wpRunQuery=true}} Show base ingredients]</span></small></div> }}
+
  | {{#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>BASEPAGENAME</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>&lt;quantity> &lt;item name></code>, e.g. <code>1 Jug of Water</code>
 
:* <code>&lt;quantity> &lt;item name></code>, e.g. <code>1 Jug of Water</code>
 +
:* <code>&lt;item id></code>, e.g. 25079
 
; ingredient2
 
; ingredient2
 
; ingredient3
 
; ingredient3
 
; ingredient4
 
; ingredient4
 
: Optional. Same functionality as ingredient1.
 
: Optional. Same functionality as ingredient1.
; output item id
+
; historical
: Optional. Defaults to the first item id declared on the page.
+
: Optional. Set equal to <code>y</code> if the item is historical - this will prevent the recipe from storing semantic properties.
; id : The recipe ID
 
; status
 
: Optional. Set equal to <code>historical</code> if the item is historical - this will prevent the recipe from storing semantic properties.
 
 
; 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
| id = 1234
 
 
}}
 
}}
 
</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
| id = 1234
 
 
}}
 
}}
  
 
[[Category:Infobox templates|Recipe]]
 
[[Category:Infobox templates|Recipe]]
 
[[Category:Subobject templates]]</noinclude>
 
[[Category:Subobject templates]]</noinclude>

Пожалуйста, учтите, что любой ваш вклад в проект «Guild Wars 2 wiki» может быть отредактирован или удалён другими участниками. Если вы не хотите, чтобы кто-либо изменял ваши тексты, не помещайте их сюда.
Вы также подтверждаете, что являетесь автором вносимых дополнений, или скопировали их из источника, допускающего свободное распространение и изменение своего содержимого (см. Guild Wars 2 wiki:Авторские права). НЕ РАЗМЕЩАЙТЕ БЕЗ РАЗРЕШЕНИЯ ОХРАНЯЕМЫЕ АВТОРСКИМ ПРАВОМ МАТЕРИАЛЫ!

Чтобы изменить эту страницу, пожалуйста, ответьте на приведённый ниже вопрос (подробнее):

Отменить | Справка по редактированию (в новом окне)