Difference between revisions of "Template:Recipe"

From Final Fantasy XIV Online Wiki
Jump to navigation Jump to search
m (smw-fied)
Line 1: Line 1:
<includeonly>
{{#vardefine:recipecnt|{{#expr:{{#var:recipecnt|0}}+1}}}}<div class="recipe-box" style="padding-bottom:0.4em; margin: 10px 1em 10px 0;">
<table style="border:2px solid #BDB76B;border-radius:5px;background:#292929;color:white;">
{{#if: {{#ifeq:{{{debug|n}}}|y||{{NAMESPACE}}}} | <!-- no subobject if outside mainspace --> |
<tr>
    {{#arraymap: {{{class|}}} |,|@@@|[[Category:@@@ recipes]]|}}<!--
<th colspan="3"> {{{1|{{{Class|}}}}}} - Level {{{2|{{{Level|}}}}}}{{#switch:{{{3|{{{{Stars|}}}}}} |0=|1=|2=♦♦|3=♦♦♦|4=♦♦♦♦|5=♦♦♦♦♦|default=}}</th>
-->{{#subobject:recipe{{#var:recipecnt}}
</tr>
      | Has context=Recipe
<tr>
      | Has canonical name ={{#titleparts:{{BASEPAGENAME}}}}
<th colspan="3"> Yields: {{{4|{{{Yield|1}}}}}}</th>
      | Has recipe source ={{#switch:{{lc:{{{source|}}}}}
</tr>
        | sheet | recipe sheet = Recipe sheet
<tr>
        | #default  = {{ucfirst:{{{source|}}}}} <!-- source = class -->
<th colspan="3">Difficulty: {{{5|{{{Difficulty|???}}}}}} Durability: {{{6|{{{Durability|???}}}}}} Maximum Quality: {{{7|{{{MaximumQuality|???}}}}}}</th>
      }}
</tr>
      | Has recipe type ={{ucfirst:{{{type|}}}}} <!-- meal, miscellany, etc -->
{{#if:{{{9|{{{Crystal1|}}}}}}|
      | Has output quantity = {{{quantity|1}}}
<tr>
      | Has crafting difficulty = {{{difficulty|1}}}
<td>{{{8|{{{Crystal1Number}}}}}}</td>
      | Has crafting durability = {{{durability|}}}
<td>[[File:{{lc:{{{9|{{{Crystal1}}} }}} }} icon1.png{{!}}link={{{9|{{{Crystal1}}} }}}]]</td>
      | Has maximum quality = {{{max-quality|}}}
<td>{{{9|{{{Crystal1}}} }}}</td>
      | Allows quick synthesis = {{#if:{{{quick|}}}|false|yes}}
</tr>
      | Learned from recipe sheet = {{{sheet|}}}|+sep=;
|}}
      | Requires crafting level = {{{level|1}}}
{{#if:{{{11|{{{Crystal2|}}}}}}|
      | Requires class = {{{class|}}} |+sep=,
<tr>
      | Class count = {{#vardefineecho:class-count|{{#len:{{#arraymap:{{{class|}}}|,|@@@|.|}}}}}}
<td>{{{10|{{{Crystal2Number}}}}}}</td>
      <!-- | Is time gated = {{#ifeq:{{lc:{{{timegate|n}}}}}|y|Y}} -->
<td>[[File:{{lc:{{{11|{{{Crystal2}}} }}} }} icon1.png{{!}}link={{{11|{{{Crystal2}}} }}}]]</td>
      | Has ingredient = {{#if: {{{ingredient1|}}} | 1;{{#explode:{{{ingredient1}}}| |0}};{{#sub:{{{ingredient1}}}|{{#pos:{{{ingredient1}}}| }}}} }}
<td>{{{11|{{{Crystal2}}} }}}</td>
      | Has ingredient = {{#if: {{{ingredient2|}}} | 2;{{#explode:{{{ingredient2}}}| |0}};{{#sub:{{{ingredient2}}}|{{#pos:{{{ingredient2}}}| }}}} }}
</tr>
      | Has ingredient = {{#if: {{{ingredient3|}}} | 3;{{#explode:{{{ingredient3}}}| |0}};{{#sub:{{{ingredient3}}}|{{#pos:{{{ingredient3}}}| }}}} }}
|}}
      | Has ingredient = {{#if: {{{ingredient4|}}} | 4;{{#explode:{{{ingredient4}}}| |0}};{{#sub:{{{ingredient4}}}|{{#pos:{{{ingredient4}}}| }}}} }}
</table>
      | Has crystal ingredient = {{#if: {{{crystal1|}}} | 1;{{#explode:{{{crystal1}}}| |0}};{{#sub:{{{crystal1}}}|{{#pos:{{{crystal1}}}| }}}} }}
</includeonly>
      | Has crystal ingredient = {{#if: {{{crystal2|}}} | 2;{{#explode:{{{crystal2}}}| |0}};{{#sub:{{{crystal2}}}|{{#pos:{{{crystal2}}}| }}}} }}
<noinclude>
      | Can be queried for base ingredients = {{ucfirst:{{{base ingredients|y}}}}}
      | Has item data object = {{PAGENAME}}
    }}
}}
<div id="recipe{{#var:recipecnt}}" class="heading">{{{name|{{BASEPAGENAME}}}}}</div>
<div class="wrapper">
; 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>}}
| #default  = {{ucfirst:{{{source|''Unspecified''}}}}}
}}{{#if:{{{type|}}}|
; 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: {{{class|}}} | ; Class{{#ifexpr:{{#var:class-count}} > 1|es}}
: {{#arraymap:{{{class|}}}|,|@@@|{{@@@|name=y}}|<br>}}
; Durability
: {{{durability|}}}
; Difficulty
: {{{difficulty|}}}
; Max. quality
: {{{max-quality|}}}
; Req. level
: {{{level|1}}}
; Quick synthesis
: {{#if:{{{quick|}}}|Unavailable|Available}}
}}</div>
{{clear}}
<div class="subheading">Ingredients</div>
<div class="ingredients" style="padding-left:1em">
{{#arraymap:{{{crystal1|}}}; {{{crystal2|}}}; {{{ingredient1|}}}; {{{ingredient2|}}}; {{{ingredient3|}}}; {{{ingredient4|}}}|;|@@@|{{#iferror:{{#expr:@@@*1}}
|<!-- if expr returns error, @@@ contains alpha -->
; {{#explode:@@@| |0}}
: {{item icon|{{#sub:@@@|{{#pos:@@@| }}}}}}
|<!-- if expr doesn't error, @@@ is numeric -->
; 1
: {{item icon|@@@}}
}}|\n}}
</div>
{{clear}}</div><noinclude>
 
== Parameters ==
; id : The recipe ID
; name : The recipe name (defaults to <code>BASEPAGENAME</code>)
; source
: How the recipe is learned:
:* <code>class</code> - Learned automatically by levelling a class.
:* <code>recipe sheet</code> - Learned from a [[recipe sheet]]; requires parameter <code>sheet</code> below.
; sheet : The name of the recipe sheet item that teaches the recipe; only use for <code>source = recipe sheet</code>. If learnt by multiple sources, separate sources with a semicolon ";".
; type : The recipe type, i.e. the header it appears under in the recipe list.
; quantity : The number of items produced from the recipe. Defaults to 1.
; upper quantity : Optional. Use when the number of output items varies.
; class : The classes that can use the recipe. Accepts a comma-separated list (e.g. <code>class = culinarian, alchemist</code>).
; level : The level required in a class to use the recipe.
; crystal1
; crystal2
: Optional. The crystals the recipe requires. Value should be a quantity followed by an item name.
:* <code>&lt;quantity> &lt;item name></code>, e.g. <code>1 Water Shard</code>
; ingredient1
: Required. The ingredients of the recipe. Value should be a quantity followed by an item name.
:* <code>&lt;quantity> &lt;item name></code>, e.g. <code>1 Lowland Grapes</code>
; ingredient2
; ingredient3
; ingredient4
: Optional. Same functionality as ingredient1.
 
== Example ==
<pre>
<pre>
{{Recipe|
{{Recipe
|Class = CUL
| name = Raisins
|Level = 50
| source = Class
|Stars = 1
| type = Meal
|Yield = 1
| class = Culinarian
|Difficulty = 195
| level = 3
|Durability = 80
| quantity = 3
|MaximumQuality = 2646
| difficulty = 10
|Crystal1Number = 3
| durability = 40
|Crystal1 = Fire Crystal
| max-quality = 339
|Crystal2Number = 2
| crystal1 = 1 Fire Shard
|Crystal2 = Water Crystal
| ingredient1 = 1 Lowland Grapes
|Ingredient1Number =  
|Ingredient1 =
|Ingredient2Number =
|Ingredient2 =
|Ingredient3Number =
|Ingredient3 =
|Ingredient4Number =
|Ingredient4 =
|Ingredient5Number =
|Ingredient5 =
|Ingredient6Number =
|Ingredient6 =
}}
}}
</pre>
</pre>
</noinclude>
{{Recipe
| name = Raisins
| source = Class
| type = Meal
| class = Culinarian
| level = 3
| quantity = 3
| difficulty = 10
| durability = 40
| max-quality = 339
| crystal1 = 1 Fire Shard
| ingredient1 = 1 Lowland Grapes
}}
 
[[Category:Infobox templates|Recipe]]
[[Category:Subobject templates]]</noinclude>

Revision as of 17:40, 14 July 2017

Recipe
Source
Unspecified
Output qty.
1
Ingredients

Parameters

id
The recipe ID
name
The recipe name (defaults to BASEPAGENAME)
source
How the recipe is learned:
  • class - Learned automatically by levelling a class.
  • recipe sheet - Learned from a recipe sheet; requires parameter sheet below.
sheet
The name of the recipe sheet item that teaches the recipe; only use for source = recipe sheet. If learnt by multiple sources, separate sources with a semicolon ";".
type
The recipe type, i.e. the header it appears under in the recipe list.
quantity
The number of items produced from the recipe. Defaults to 1.
upper quantity
Optional. Use when the number of output items varies.
class
The classes that can use the recipe. Accepts a comma-separated list (e.g. class = culinarian, alchemist).
level
The level required in a class to use the recipe.
crystal1
crystal2
Optional. The crystals the recipe requires. Value should be a quantity followed by an item name.
  • <quantity> <item name>, e.g. 1 Water Shard
ingredient1
Required. The ingredients of the recipe. Value should be a quantity followed by an item name.
  • <quantity> <item name>, e.g. 1 Lowland Grapes
ingredient2
ingredient3
ingredient4
Optional. Same functionality as ingredient1.

Example

{{Recipe
| name = Raisins
| source = Class
| type = Meal
| class = Culinarian
| level = 3
| quantity = 3
| difficulty = 10
| durability = 40
| max-quality = 339
| crystal1 = 1 Fire Shard
| ingredient1 = 1 Lowland Grapes
}}
Raisins
Source
Class
Type
Meal
Output qty.
3
ClassExpression error: Unexpected > operator.
Culinarian frame icon.png CUL
Durability
40
Difficulty
10
Max. quality
339
Req. level
3
Quick synthesis
Available
Ingredients