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
converted to DRUID
converted to pi
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#invoke:Infobox|main
<includeonly>
|image = {{#if:{{{image|}}}|[[File:{{{image}}}{{!}}128px]]}}
<infobox>
|sections = resource, storageAtStartSection, productSection, consumableSection
  <title source="title">
|resource_label = Resource
    <default>{{PAGENAME}}</default>
|resource = source, gatheringTime, craftingTime, naturallyAvailable
  </title>
|source_label = Source
  <image source="image" />
|gatheringTime_label = Gathering Time
  <data source="caption"/>
|craftingTime_label = Crafting Time
  <group>
|naturallyAvailable_label = Naturally Available
    <header>Resource</header>
 
    <data source="source">
|storageAtStartSection_label = In Storage at Start
      <label>Source</label>
|storageAtStartSection = storageAtStart, amountFromTiles, totalAtStart, orbInfo
    </data>
|storageAtStart_label = Amount at start
    <data source="gatheringTime">
|amountFromTiles_label = Unlockable from [[Resource tile|tiles]]
      <label>Gathering Time</label>
|totalAtStart_label = Total
    </data>
|totalAtStart = {{#iferror:{{#expr: {{{storageAtStart|}}} + {{{amountFromTiles|}}}}}}}
    <data source="craftingTime">
|orbInfo_nolabel = yes
      <label>Crafting Time</label>
|orbInfo = The total starting amount can be further increased by investing {{ItemLink|Orb}}s
    </data>
 
    <data source="naturallyAvailable">
|productSection_label = Product
      <label>Naturally Available</label>
|productSection = product, totalAvailableProducts
    </data>
|product_label = Products per {{{title|}}}
  </group>
|product = {{#if:{{{product|}}}| {{{amountToHarvest|1}}} × {{ItemLink|{{{product}}}}}}}
  <group>
|totalAvailableProducts_label = Total naturally available
    <header>In Storage at Start</header>
|totalAvailableProducts = {{#if:{{{product|}}}|{{#iferror:{{#expr: {{{naturallyAvailable|}}}*{{{amountToHarvest|1}}}}}}}|| × {{ItemLink|{{{product}}}}}}}
    <data source="storageAtStart">
 
      <label>Amount at start</label>
|consumableSection_label = Consumable
    </data>
|consumableSection = xp
    <data source="amountFromTiles">
|xp_label = [[XP]] when consumed
      <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.

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
}}