Difference between revisions of "Recipe"

m
m
 
(29 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
1 item could be acquired via multiple recipes, so the recipe number ensures each can be uniquely identified
 
1 item could be acquired via multiple recipes, so the recipe number ensures each can be uniquely identified
 
-->{{#vardefine:recipe count|{{#expr:{{#var:recipe count|0}}+1}}}}<!--
 
-->{{#vardefine:recipe count|{{#expr:{{#var:recipe count|0}}+1}}}}<!--
 
source
 
-->{{#vardefine:learned|{{#if:{{#pos:{{{learned from|}}}|:}}<!-- if ':' is in the text
 
-->|{{ucfirst:{{#explode:{{{learned from}}}|:|0}}}}<!-- format string before ':'
 
-->:{{sc|{{#sub:{{{learned from}}}|{{#expr:{{#pos:{{{learned from}}}|:}}+1}}}}}}<!-- format string after ':'
 
-->|{{sc|{{{learned from}}}}}}}}}<!-- else format as normal
 
  
 
quality class
 
quality class
Line 19: Line 13:
 
|epic=quality-epic
 
|epic=quality-epic
 
|legendary=quality-legendary
 
|legendary=quality-legendary
|quest items=quest-item
+
|quest&nbsp;item<!-- TODO: quality property uses &nbsp; instead of 'real space' -->
 +
|quest item=quality-quest-item
 
}}}}<!--
 
}}}}<!--
  
Line 27: Line 22:
 
professions
 
professions
 
-->{{#arraydefine:professions|{{{professions|}}}|,}}<!--
 
-->{{#arraydefine:professions|{{{professions|}}}|,}}<!--
 +
 +
mastery level
 +
-->{{#vardefine:mastery|{{#switch:{{lc:{{{mastery|}}}}}
 +
|newbie
 +
|#default=Newbie
 +
|journeyman=Journeyman
 +
|craftsman=Craftsman
 +
|expert=Expert
 +
|master=Master
 +
}}}}<!--
  
 
crafted using
 
crafted using
Line 49: Line 54:
 
--></center>
 
--></center>
 
|-
 
|-
! colspan="2" | <center>[[{{{name|{{PAGENAME}}}}}]]</center>
+
! colspan="2" class="{{#var:quality class}}<!--
|-
+
-->" | <center>[[{{{name|{{PAGENAME}}}}}]]</center>
{{#if:{{#arraysize:crafted using}}|{{!}}class="skill-infobox-row-heading"{{!}}'''Crafted Using'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{#arrayprint:crafted using|<br>|@|[[@|{{#replace:@|#|&nbsp;}}]]}}}}
 
 
|-
 
|-
{{#if:{{{learned from|}}}|{{!}}class="skill-infobox-row-heading"{{!}}'''Learned From'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{#switch:{{lc:{{{learned from|}}}}}<!-- format 'Learned From' text -->
+
{{#ifeq:{{#arraysize:crafted using}}|0||{{InfoboxRow|'''Crafted Using'''|{{#arrayprint:crafted using|<br>|@|[[@|{{#replace:@|#|&nbsp;}}]]}}}}}}
 +
{{#if:{{{learned from|}}}|{{InfoboxRow|'''Learned From'''|{{#switch:{{lc:{{{learned from|}}}}}<!-- format 'Learned From' text -->
 
|automatic=''Automatic''
 
|automatic=''Automatic''
|#default=[[{{#var:learned}}]]
+
|#default=[[{{{learned from}}}]]
}}}}
+
}}}}}}
|-
+
{{InfoboxRow|'''Ingredients'''|<!-- ingredients row
|class="skill-infobox-row-heading"|'''Ingredients'''||class="skill-infobox-row-data"|<!-- ingredients row
 
 
-->{{#arrayprint:ingredients|<br><!-- print ingredients array, separated by line breaks
 
-->{{#arrayprint:ingredients|<br><!-- print ingredients array, separated by line breaks
 
-->|@|{{#vardefine:name|{{#explode:{{#sub:@|{{#pos:@| }}}}|#|0}}}}<!-- get name
 
-->|@|{{#vardefine:name|{{#explode:{{#sub:@|{{#pos:@| }}}}|#|0}}}}<!-- get name
 +
-->{{#explode:@| |0}} <!-- ingredient quantity
 
-->{{item<!-- create an item  
 
-->{{item<!-- create an item  
 
-->|{{#var:name}}<!-- ingredient name
 
-->|{{#var:name}}<!-- ingredient name
-->|{{#if:{{#explode:@|#|1}}<!-- if quality is specified
+
-->|quality={{#if:{{#explode:@|#|1}}<!-- if quality is specified
-->|{{#explode:@|#|1}}<!-- use specified quality
+
-->|{{#explode:@|#|1}}}}}}}}}}<!-- use specified quality -->
-->|{{#show:{{#var:name}}|?Has quality}}}}}}<!-- else get item quality property
+
{{InfoboxRow|'''Output qty.'''|{{#var:quantity}}}}
--> x{{#explode:@| |0}}}}<!-- ingredient quantity -->
+
{{#if:{{{professions|}}}|{{InfoboxRow|'''Profession(s)'''|{{#arrayprint:professions|<br>|@|[[{{sc|@}}]]}}}}}}
|-
+
{{InfoboxRow|'''Mastery Level'''|{{#var:mastery}}}}
|class="skill-infobox-row-heading"|'''Output qty.'''||class="skill-infobox-row-data"|{{#var:quantity}}
 
|-
 
{{#if:{{{professions|}}}|{{!}}class="skill-infobox-row-heading"{{!}}'''Professions'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{#arrayprint:professions|<br>|@|[[{{sc|@}}]]}}}}
 
|-
 
 
|}
 
|}
 
<!--
 
<!--
 
SET PROPERTIES
 
SET PROPERTIES
-->{{#if:{{{name|}}}|<!-- if there is a name parameter don't set any properties
+
-->{{#if:{{{name|}}}{{NAMESPACE}}|<!-- if there is a name parameter or namespace don't set any properties
 
-->|{{#subobject:Recipe{{#var:recipe count}}<!-- create object for specific recipe (one item may have multiple recipes)
 
-->|{{#subobject:Recipe{{#var:recipe count}}<!-- create object for specific recipe (one item may have multiple recipes)
-->|Has learned from={{#var:learned}}<!-- set 'Has learned from' property
+
-->|{{#if:{{{learned from|}}}|Has learned from={{{learned from}}}}}<!-- set 'Has learned from' property
-->|Has output quantity={{#var:quantity}}}}<!-- set 'Has output quantity' property
+
-->|Has output quantity={{#var:quantity}}<!-- set 'Has output quantity' property
 +
-->|Has mastery level={{#var:mastery}}<!-- set 'Has mastery level' property
 +
-->|Has output quality={{sc|<!-- set 'Has output quality' property
 +
-->{{#replace:<!--
 +
-->{{#sub:{{#var:quality class}}|{{#expr:{{#pos:{{#var:quality class}}|-}}+1}}}}<!-- remove 'quality-' from the string
 +
-->|-|&nbsp;}}<!-- replace '-' with ' '
 +
-->|&nbsp;}}}}<!--
  
 
Has ingredient
 
Has ingredient

Latest revision as of 19:10, 13 February 2024

Description[edit]

Creates a table defining a recipe or refinery. Used in the 'Acquisition' section of most items. The 'Used In' section of items will be filled in automatically by {{used in}}.

Usage[edit]

{{Recipe|<name=name>|<icon=icon>|<crafted using=crafted using>|<learned from=learned from>|<ingredients=ingredients>|<quantity=quantity>|<quality=quality>|<professions=professions>}}

Parameters[edit]

Arrow.pngicon: The item's icon.
Optional. Defaults to '{{PAGENAME}}.png'.
Notes: Only use if the icon name differs from the name of the page.
Arrow.pngname: The name of the item created.
Optional. Defaults to '{{PAGENAME}}'.
Notes: Only use if the item name differs from the name of the page.
Arrow.pngcrafted using: The comma-separated list of objects that the player must interact with to use the recipe.
Optional. Defaults to '[profession1]#Workbench, [profession2]#Workbench, etc'.
Notes: e.g. 'Alchemy#Workbench'.
Arrow.pnglearned from: The source that the recipe is learned from.
Optional.
Notes: Set to 'Automatic' if learnt by default.
Arrow.pngingredients: A comma-separated list of recipe ingredients and their respective quantities and qualities.
Optional.
Notes: Only specify item quality if it differs from its default quality. e.g. '[quantity1] [ingredient1]#[quality1], [quantity2] [ingredient2]#[quality2], etc'.
Arrow.pngquantity: The output quantity of the recipe.
Optional. Defaults to '1'.
Arrow.pngquality: The output quality of the recipe
Optional.
Arrow.pngprofessions: The comma-separated professions required to craft the recipe.
Optional.
Arrow.pngmastery: The mastery level required to craft the recipe.
Optional. Defaults to 'Newbie'.