Please note that some information on this wiki is still based on the demo version.
If you notice any errors, feel free to correct them.

Template:Infobox consumable: Difference between revisions

From Super Fantasy Kingdom Official Wiki
wgg>Cadaei
added storageAtStart and amountFromTiles
converted to pi
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{infobox header|name={{{name|{{PAGENAME}}}}}|image={{{image|{{PAGENAME}}.png}}}}}
<includeonly>
{{infobox section|
<infobox>
{{infobox data row|Source|{{{source|}}}}}
  <title source="title">
{{infobox data row|Gathering Time|{{{gatheringTime|}}}}}
    <default>{{PAGENAME}}</default>
{{infobox data row|Crafting Time|{{{craftingTime|}}}}}
  </title>
{{infobox data row|[[XP]] when consumed|{{{xp|}}}}}
  <image source="image" />
{{infobox data row|Naturally available|{{{naturallyAvailable|}}}}}
  <data source="caption"/>
}}{{infobox section|displayIf={{{amountAtStart|}}}{{{amountFromTiles|}}}|header=Storage at start
  <group>
| {{infobox data row|Amount at start|{{{storageAtStart|}}}}}
    <header>Resource</header>
  {{infobox data row|Amount from [[Resource tile|tiles]]|{{{amountFromTiles|}}}}}
    <data source="source">
  {{infobox data row|Total|{{#iferror:{{#expr: {{{storageAtStart|}}}+{{{amountFromTiles|}}}}}}}}}
      <label>Source</label>
}}<!--
    </data>
-->
    <data source="gatheringTime">
{{infobox section|displayIf = {{{product|}}}{{{amountToHarvest|}}}|header=Product|
      <label>Gathering Time</label>
{{infobox data row|Products per {{{name|{{PAGENAME}}}}}|{{{amountToHarvest|}}}||{{#if:{{{product|}}}| × {{ItemLink|{{{product}}}}}}}}}
    </data>
{{infobox data row|Total naturally available|{{#iferror:{{#expr: {{{naturallyAvailable|}}}*{{{amountToHarvest|}}}}}}}||{{#if:{{{product|}}}| × {{ItemLink|{{{product}}}}}}}}}
    <data source="craftingTime">
}}
      <label>Crafting Time</label>
{{infobox footer}}
    </data>
    <data source="naturallyAvailable">
      <label>Naturally Available</label>
    </data>
  </group>
  <group>
    <header>In Storage at Start</header>
    <data source="storageAtStart">
      <label>Amount at start</label>
    </data>
    <data source="amountFromTiles">
      <label>Unlockable from [[Resource tile|tiles]]</label>
    </data>
    <data source="totalAtStart">
      <label>Total</label>
      <format>{{#vardefineecho: totalAtStart | {{#iferror:{{#expr: {{{storageAtStart|}}} + {{{amountFromTiles|}}}}}}}}}</format>
    </data>
    <data source="orbInfo">
      <format>{{#if:{{#var:totalAtStart}}| The total starting amount can be further increased by investing {{ItemLink|Orb}}s }}</format>
    </data>
  </group>
  <group>
    <header>Product</header>
    <data source="product">
      <label>Products per {{{title|}}}</label>
      <format>{{#if:{{{product|}}}| {{{amountToHarvest|1}}} × {{ItemLink|{{{product}}}}}}}</format>
    </data>
    <data source="totalAvailableProducts">
      <label>Total naturally available</label>
      <format>{{#if:{{{product|}}}|{{#iferror:{{#expr: {{{naturallyAvailable|}}}*{{{amountToHarvest|1}}}}}}}|| × {{ItemLink|{{{product}}}}}}}</format>
    </data>
  </group>
  <group>
    <header>Consumable</header>
    <data source="xp">
      <label>[[XP]] when consumed</label>
    </data>
  </group>
</infobox>
[[Category:Resources]][[Category:Consumables]]</includeonly><noinclude>
[[Category:Resources]][[Category:Consumables]]</includeonly><noinclude>
This is an infobox template for consumables.
This is an infobox template for consumables.
Line 22: Line 60:
<pre>
<pre>
{{infobox consumable
{{infobox consumable
| name = Berry
| title = Berry
| image = Berry.png
| image = Berry.png
| source = {{ItemLink|Berry Bush}}
| source = {{ItemLink|Berry Bush}}
Line 34: Line 72:
</pre>
</pre>
{{infobox consumable
{{infobox consumable
| name = Berry
| title = Berry
| image = Berry.png
| image = Berry.png
| source = {{ItemLink|Berry Bush}}
| source = {{ItemLink|Berry Bush}}

Latest revision as of 23:39, 27 October 2025

This is an infobox template for consumables. Use it on consumable pages, e.g. like this

{{infobox consumable
| title = Berry
| image = Berry.png
| source = {{ItemLink|Berry Bush}}
| xp = 1
| gatheringTime = 3 s
| craftingTime = 
| naturallyAvailable = 25
| storageAtStart = 0
| amountFromTiles = 1
}}