Difference between revisions of "Template:ResourceBreakdown"

From ChatWars Wiki
Jump to: navigation, search
(updated to include multipliers in stock weight)
 
(7 intermediate revisions by the same user not shown)
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}}} }}x {{{1}}}{{#if: {{#show: {{PageLink_to_Name|page={{{1}}} }} |?Weight }} | , {{#expr: {{#show: {{PageLink_to_Name|page={{{1}}} }} |?Weight }} * {{#var: multiplier}} * {{{2}}} }}{{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 }} | , {{#expr: {{#show: {{PageLink_to_Name|page={{{1}}} }} |?Weight }} * {{#var: multiplier}} * {{{2}}} }}{{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
+
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>

Latest revision as of 08:59, 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)