Difference between revisions of "Template:Building Stats Table"
(automation) |
|||
Line 1: | Line 1: | ||
− | <includeonly>{{#if: {{{2|}}}||==Material table==}}<!-- | + | <includeonly>{{#if: {{{2|}}}||== Material table ==}}<!-- |
-->{{#vardefine:name | {{{ 1 | {{PAGENAME}}}}} }}<!-- | -->{{#vardefine:name | {{{ 1 | {{PAGENAME}}}}} }}<!-- | ||
-->{{#vardefine:beauty|{{formatnum:{{Q|{{#var:name}}|Beauty Base|0}}|R}}}}<!-- | -->{{#vardefine:beauty|{{formatnum:{{Q|{{#var:name}}|Beauty Base|0}}|R}}}}<!-- | ||
Line 11: | Line 11: | ||
<div><li style="display: inline-table;"> | <div><li style="display: inline-table;"> | ||
{| {{STDT|sortable c_01 text-center}} | {| {{STDT|sortable c_01 text-center}} | ||
− | |||
! Material | ! Material | ||
! data-sort-type="number" | [[Stuff]] cost | ! data-sort-type="number" | [[Stuff]] cost | ||
Line 23: | Line 22: | ||
-->{{#if:{{#var:useTerrainAffordance}}|<th>Terrain Affordance</th>}} | -->{{#if:{{#var:useTerrainAffordance}}|<th>Terrain Affordance</th>}} | ||
! data-sort-type="number" | Market Value | ! data-sort-type="number" | Market Value | ||
− | + | <!-- #pos returns 0 if its at the first place in the string, thus an {{#if:{{#pos:{{#var:stufftags}}|Leathery|}} fails to detect leathery if its the first vs a null response. This just tests that it doesn't return nothing essentially. --> | |
− | <!-- #pos returns 0 if its at the first place in the string, thus an {{#if:{{#pos:{{#var:stufftags}}|Leathery|}} fails to detect leathery if its the first vs a null response. This just tests that it doesn't return nothing essentially. --> | + | {{#ifeq: | {{#pos:{{#var:stufftags}}|leathery|}} || |
− | {{#ifeq: | {{#pos:{{#var:stufftags}}|leathery|}}|| | + | {{#ask: [[Stuff Category::Leathery]] |
− | {{ | + | | format = template |
− | + | | template = Building Material Table Row | |
− | + | | link = none | |
− | + | }} }}<!-- | |
− | + | -->{{#ifeq: | {{#pos:{{#var:stufftags}}|fabric|}} || | |
− | + | {{#ask: [[Stuff Category::Fabric]] | |
− | + | | format = template | |
− | + | | template = Building Material Table Row | |
− | + | | link = none | |
− | + | }} }}<!-- | |
− | + | -->{{#ifeq: | {{#pos:{{#var:stufftags}}|woody|}} || | |
− | + | {{#ask: [[Stuff Category::Woody]] | |
− | + | | format = template | |
− | + | | template = Building Material Table Row | |
− | + | | link = none | |
− | + | }} }}<!-- | |
− | + | -->{{#ifeq: | {{#pos:{{#var:stufftags}}|stony|}} || | |
− | + | {{#ask: [[Stuff Category::Stony]] | |
− | + | | format = template | |
− | + | | template = Building Material Table Row | |
− | + | | link = none | |
− | + | }} }}<!-- | |
− | {{#ifeq: | {{#pos:{{#var:stufftags}}|fabric|}}|| | + | -->{{#ifeq: | {{#pos:{{#var:stufftags}}|metallic|}} || |
− | {{ | + | {{#ask: [[Stuff Category::Metallic]] |
− | + | | format = template | |
− | + | | template = Building Material Table Row | |
− | + | | link = none | |
− | + | }} }} | |
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | |||
− | {{#ifeq: | {{#pos:{{#var:stufftags}}|woody|}}|| | ||
− | {{Building Material Table Row | | ||
− | }} | ||
− | |||
− | {{#ifeq: | {{#pos:{{#var:stufftags}}|stony|}}|| | ||
− | {{ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | |||
− | {{#ifeq: | {{#pos:{{#var:stufftags}}|metallic|}}|| | ||
− | {{ | ||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | |||
|} | |} | ||
<sup>Assuming Normal quality, for the effect of other qualities, see [[Quality]].</sup></li></div></includeonly><noinclude> | <sup>Assuming Normal quality, for the effect of other qualities, see [[Quality]].</sup></li></div></includeonly><noinclude> | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> |
Revision as of 10:06, 24 April 2022
Description
This template generates a table summarizing stats for a building, including Name, Construction Cost, Beauty, HP, Flammability, Mass, Work To Build and Market Value, for the variety of different materials available for it.
The template will automatically detect the material types applicable to the item using the Stuff Tags variable in the infobox and display them. The item must be stuffable and must have the correct Resource X/Resource X Amount parameters in addition to the Stuff Tags, and Resource 1 must be set to "Stuff".
Note that it will automatically add the appropriate heading.
This template is dependent on Template:Building Stats Table Row.
Parameters
All parameters are optional:
- First parameter: specifies which building to generate the template for. Defaults =
{{PAGENAME}}
. header
: If set tofalse
no header will be created.header level
: Defines the level of the header. Default =2
.
Example usage
Billiards table (quality, recreation, special recreation, header level)
{{Building Stats Table | header level = 4}}
on the Billiards table page would produce:
Material table
Material | Stuff cost | Beauty | Work to Build | HP | Flammability | Market Value |
---|---|---|---|---|---|---|
Wood | 0 | ticks (2.33 mins) | 8,400163 | 100% | 280 | |
Granite blocks | 0 | ticks (20.04 mins) | 72,140425 | 0% | 490 | |
Limestone blocks | 0 | ticks (20.04 mins) | 72,140388 | 0% | 490 | |
Marble blocks | Expression error: Unexpected < operator. | ticks (18.37 mins) | 66,140300 | 0% | 465 | |
Sandstone blocks | 0 | ticks (16.71 mins) | 60,140350 | 0% | 445 | |
Slate blocks | 0 | ticks (20.04 mins) | 72,140325 | 0% | 490 | |
Jade | Expression error: Unexpected < operator. | ticks (16.67 mins) | 60,000125 | 0% | 770 | |
Bioferrite | 0 | ticks (8.33 mins) | 30,000500 | 75% | 325 | |
Gold | Expression error: Unexpected < operator. | ticks (3 mins) | 10,800150 | 40% | 8,195 | |
Plasteel | 0 | ticks (7.33 mins) | 26,400700 | 0% | 970 | |
Silver | Expression error: Unexpected < operator. | ticks (3.33 mins) | 12,000175 | 40% | 1,000 | |
Steel | 0 | ticks (3.33 mins) | 12,000250 | 40% | 350 | |
Uranium | 0 | ticks (6.33 mins) | 22,800625 | 0% | 720 |
Bed (quality, comfort, no header)
{{Building Stats Table | Bed | header = false}}}
on any page would produce:
Material table
Material | Stuff cost | Beauty | Work to Build | HP | Flammability | Market Value |
---|---|---|---|---|---|---|
Wood | Expression error: Unexpected < operator. | ticks (9.33 secs) | 56091 | 100% | 56 | |
Granite blocks | Expression error: Unexpected < operator. | ticks (1.37 mins) | 4,940238 | 0% | 58 | |
Limestone blocks | Expression error: Unexpected < operator. | ticks (1.37 mins) | 4,940217 | 0% | 58 | |
Marble blocks | Expression error: Unexpected < operator. | ticks (1.26 mins) | 4,540168 | 0% | 57 | |
Sandstone blocks | Expression error: Unexpected < operator. | ticks (1.15 mins) | 4,140196 | 0% | 55 | |
Slate blocks | Expression error: Unexpected < operator. | ticks (1.37 mins) | 4,940182 | 0% | 58 | |
Jade | Expression error: Unexpected < operator. | ticks (1.11 mins) | 4,00070 | 0% | 240 | |
Bioferrite | Expression error: Unexpected < operator. | ticks (33.33 secs) | 2,000280 | 75% | 41 | |
Gold | Expression error: Unexpected < operator. | ticks (12 secs) | 72084 | 40% | 4,505 | |
Plasteel | Expression error: Unexpected < operator. | ticks (29.33 secs) | 1,760392 | 0% | 410 | |
Silver | Expression error: Unexpected < operator. | ticks (13.33 secs) | 80098 | 40% | 455 | |
Steel | Expression error: Unexpected < operator. | ticks (13.33 secs) | 800140 | 40% | 88 | |
Uranium | Expression error: Unexpected < operator. | ticks (25.33 secs) | 1,520350 | 0% | 275 |
Autodoor (no quality, terrain affordance, door opening speed, no header)
{{Building Stats Table | Autodoor | header = false}}
on any page would produce:
Material table
Material | Stuff cost | Beauty | Work to Build | HP | Flammability | Door Speed | Market Value |
---|---|---|---|---|---|---|---|
Wood | 0 | ticks (12.83 secs) | 770104 | 100% | 480% | 173 | |
Granite blocks | 0 | ticks (1.87 mins) | 6,740272 | 0% | 180% | 187 | |
Limestone blocks | 0 | ticks (1.87 mins) | 6,740248 | 0% | 180% | 187 | |
Marble blocks | Expression error: Unexpected < operator. | ticks (1.72 mins) | 6,190192 | 0% | 180% | 185 | |
Sandstone blocks | 0 | ticks (1.57 mins) | 5,640224 | 0% | 180% | 183 | |
Slate blocks | 0 | ticks (1.87 mins) | 6,740208 | 0% | 180% | 187 | |
Jade | Expression error: Unexpected < operator. | ticks (1.53 mins) | 5,50080 | 0% | 400% | 285 | |
Bioferrite | 0 | ticks (45.83 secs) | 2,750320 | 75% | 400% | 169 | |
Gold | Expression error: Unexpected < operator. | ticks (16.5 secs) | 99096 | 40% | 400% | 2,645 | |
Plasteel | 0 | ticks (40.33 secs) | 2,420448 | 0% | 400% | 375 | |
Silver | Expression error: Unexpected < operator. | ticks (18.33 secs) | 1,100112 | 40% | 400% | 395 | |
Steel | 0 | ticks (18.33 secs) | 1,100160 | 40% | 400% | 192 | |
Uranium | 0 | ticks (34.83 secs) | 2,090400 | 0% | 300% | 295 |
Spike trap (no quality, negative beauty, special properties, no header)
{{Building Stats Table | Spike trap | header = false}}
on any page would produce:
Material table
Material | Stuff cost | Beauty | Work to Build | HP | Flammability | Market Value | ||
---|---|---|---|---|---|---|---|---|
Wood | -18 | ticks (37.33 secs) | 2,24026 | 100% | 40 | 8 | 12% | 62 |
Granite blocks | -18 | ticks (5.37 mins) | 19,34068 | 0% | 65 | 13 | 19.5% | 110 |
Limestone blocks | -18 | ticks (5.37 mins) | 19,34062 | 0% | 60 | 12 | 18% | 110 |
Marble blocks | -17 | ticks (4.93 mins) | 17,74048 | 0% | 60 | 12 | 18% | 104 |
Sandstone blocks | -18 | ticks (4.48 mins) | 16,14056 | 0% | 50 | 10 | 15% | 99 |
Slate blocks | -18 | ticks (5.37 mins) | 19,34052 | 0% | 60 | 12 | 18% | 110 |
Jade | -8 | ticks (4.44 mins) | 16,00020 | 0% | 100 | 20 | 30% | 285 |
Bioferrite | -18 | ticks (2.22 mins) | 8,00080 | 75% | 130 | 26 | 39% | 63 |
Gold | Expression error: Unexpected < operator. | ticks (48 secs) | 2,88024 | 40% | 75 | 15 | 22.5% | 4,510 |
Plasteel | -18 | ticks (1.96 mins) | 7,040112 | 0% | 110 | 22 | 33% | 430 |
Silver | -12 | ticks (53.33 secs) | 3,20028 | 40% | 85 | 17 | 25.5% | 460 |
Steel | -18 | ticks (53.33 secs) | 3,20040 | 40% | 100 | 20 | 30% | 97 |
Uranium | -18 | ticks (1.69 mins) | 6,080100 | 0% | 110 | 22 | 33% | 290 |
The above documentation is transcluded from Template:Building Stats Table/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |