Difference between revisions of "Template:ResourceBreakdown"

From ChatWars Wiki
Jump to: navigation, search
(added stock weight info)
Line 4: Line 4:
 
-->{{#switch: {{#var: depth}} | 0 = * | 1 = ** | 2 = *** | 3 = **** | 4 = ***** | 5 = ****** | #default = ERROR: Unsupported recipe depth, add new layer in [[Template:ResourceBreakdown]] }}<!--
 
-->{{#switch: {{#var: depth}} | 0 = * | 1 = ** | 2 = *** | 3 = **** | 4 = ***** | 5 = ****** | #default = ERROR: Unsupported recipe depth, add new layer in [[Template:ResourceBreakdown]] }}<!--
 
-->{{#ifeq: {{#show: {{PageLink_to_Name|page={{{1}}} }} |?BoolCraft }} | true
 
-->{{#ifeq: {{#show: {{PageLink_to_Name|page={{{1}}} }} |?BoolCraft }} | true
   | {{#expr: {{#var: multiplier}} * {{{2}}} }}x {{{1}}}, {{#expr: {{#var: multiplier}} * {{{2}}} * {{#show: {{PageLink_to_Name|page={{{1}}} }} |?ManaCrafting }} }}{{Emoticon|emoticon=Mana}}<!--
+
   | {{#expr: {{#var: multiplier}} * {{{2}}} }}x {{{1}}}{{#if: {{#show: {{PageLink_to_Name|page={{{1}}} }} |?Weight }} | , {{#show: {{PageLink_to_Name|page={{{1}}} }} |?Weight }}{{Emoticon|emoticon=Stock}} }}, {{#expr: {{#var: multiplier}} * {{{2}}} * {{#show: {{PageLink_to_Name|page={{{1}}} }} |?ManaCrafting }} }}{{Emoticon|emoticon=Mana}}<!--
 
  -->{{#ask:
 
  -->{{#ask:
 
     [[-Has subobject::{{PageLink_to_Name|page={{{1}}} }}]] [[Crafting ingredient.ItemType::+]]
 
     [[-Has subobject::{{PageLink_to_Name|page={{{1}}} }}]] [[Crafting ingredient.ItemType::+]]
Line 17: Line 17:
 
     |?Qty
 
     |?Qty
 
     }}
 
     }}
   | {{#expr: {{#var: multiplier}} * {{{2}}} }}x {{{1}}}
+
   | {{#expr: {{#var: multiplier}} * {{{2}}} }}x {{{1}}}{{#if: {{#show: {{PageLink_to_Name|page={{{1}}} }} |?Weight }} | , {{#show: {{PageLink_to_Name|page={{{1}}} }} |?Weight }}{{Emoticon|emoticon=Stock}} }}
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
Checks if given material is most basic resource, else breaks it down into another layer of more basic ones<br>
+
Checks if given material is most basic resource, else breaks it down into another layer of more basic ones. Is called recursively (might need to up maximum recursion depth in wiki config if new, more complex recipes come around)
Unfinished
 
 
[[Category:Template]]
 
[[Category:Template]]
 
</noinclude>
 
</noinclude>

Revision as of 09:57, 9 January 2019

Checks if given material is most basic resource, else breaks it down into another layer of more basic ones. Is called recursively (might need to up maximum recursion depth in wiki config if new, more complex recipes come around)