Difference between revisions of "Template:Building Stats Table"
(starting to implement quality.) |
|||
Line 1: | Line 1: | ||
− | <includeonly>{{# | + | <includeonly><!-- |
− | -->{{#vardefine: | + | --><!-- VARIABLES --><!-- |
− | -->{{#vardefine: | + | -->{{#vardefine:name | {{{1| {{PAGENAME}} }}} }}<!-- |
− | -->{{#vardefine: | + | -->{{#vardefine:beauty | {{formatnum:{{Q|{{#var:name}}|Beauty Base|0}}|R}} }}<!-- |
− | -->{{#vardefine:HP|{{formatnum:{{Q|{{#var:name}}|Max Hit Points Base}}|R}}}}<!-- | + | -->{{#vardefine:comfort | {{Q|{{#var:name}}|Comfort Base}} }}<!-- |
− | -->{{#vardefine: | + | -->{{#vardefine:flammability | {{formatnum:{{Q|{{#var:name}}|Flammability Base}}|R}} }}<!-- |
− | -->{{#vardefine:value|{{formatnum:{{Q|{{#var:name}}|Market Value Base}}|R}}}}<!-- | + | -->{{#vardefine:hasQuality | {{#ifeq: {{Q|{{#var:name}}|Has Quality}} | true | true}} }}<!-- True if the building has quality |
− | -->{{#vardefine: | + | -->{{#vardefine:HP | {{formatnum:{{Q|{{#var:name}}|Max Hit Points Base}}|R}} }}<!-- |
− | -->{{#if:{{{3|}}} | + | -->{{#vardefine:stuffAmount | {{Q|{{#var:name}}|Resource 1 Amount}} }}<!-- |
− | -->{{#if:{{Q|{{#var:name}}|Production Facility 1}} | + | -->{{#vardefine:stufftags | {{lc:{{Q|{{#var:name}}|Stuff Tags}} }} }}<!-- |
− | -->{{# | + | -->{{#vardefine:value | {{formatnum:{{Q|{{#var:name}}|Market Value Base}}|R}} }}<!-- |
+ | -->{{#vardefine:work | {{formatnum:{{Q|{{#var:name}}|Work To Make}}|R}} }}<!-- | ||
+ | -->{{#vardefine:useTerrainAffordance | {{#if: {{{3|}}} | 1}} }}<!-- | ||
+ | -->{{#vardefine:useWorkToMake | {{#if: {{Q|{{#var:name}}|Production Facility 1}} | 1}} }}<!-- | ||
+ | --><!-- | ||
+ | --><!-- HEADER and CONTROL PANEL --><!-- | ||
+ | -->{{#if: {{{2|}}}||== Material table ==}}<!-- | ||
+ | --><!-- | ||
+ | --><!-- MAIN TABLE --> | ||
<div><li style="display: inline-table;"> | <div><li style="display: inline-table;"> | ||
{| {{STDT|sortable c_01 text-right}} | {| {{STDT|sortable c_01 text-right}} | ||
− | ! | + | ! colspan="{{#if:{{#var:hasQuality}}|2|1}}" | {{Icon Small|{{#var:name}}|32}} {{#var:name}} |
− | + | ! rowspan="2" data-sort-type="number" | Beauty<!-- | |
− | ! data-sort-type="number" | Beauty<!-- | + | -->{{#if: {{#var:comfort}} | |
− | -->{{#if: {{# | + | !! rowspan="2" data-sort-type="number" {{!}} Comfort}} |
− | !! data-sort-type="number" {{!}} Comfort}} | + | ! rowspan="2" data-sort-type="number" | Work to Build |
− | ! data-sort-type="number" | Work to Build | + | ! rowspan="2" data-sort-type="number" | HP |
− | ! data-sort-type="number" | HP | + | ! rowspan="2" data-sort-type="number" | Flamma­bility<!-- |
− | ! data-sort-type="number" | Flamma­bility<!-- | ||
-->{{#switch: {{#var:name}} | -->{{#switch: {{#var:name}} | ||
− | | Door | Autodoor | Fence gate | Animal flap = !! Door Speed | + | | Door | Autodoor | Fence gate | Animal flap = !! rowspan="2" {{!}} Door Speed |
− | | Spike trap = !! Total Damage !! Attack Damage !! Armor Penetration | + | | Spike trap = !! rowspan="2" {{!}} Total Damage !! rowspan="2" {{!}} Attack Damage !! rowspan="2" {{!}} Armor Penetration |
}}<!-- | }}<!-- | ||
− | -->{{#if: {{#var:useTerrainAffordance}} | !! Terrain Affordance}} | + | -->{{#if: {{#var:useTerrainAffordance}} | !! rowspan="2" {{!}} Terrain Affordance}} |
− | ! data-sort-type="number" | Market Value | + | ! rowspan="2" 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. --> | + | |- |
+ | {{#if: {{#var:hasQuality}} |<th style="background-color:#72c1d9; border:#5b9aae 1px; border-style: none none solid solid;"> Quality </th>}}<!-- | ||
+ | -->{{#if: {{#var:stufftags}} |<th style="background-color:#72c1d9; border:#5b9aae 1px; border-style: none none solid {{#if:{{#var:hasQuality}}|none|solid}};"> Material </th>}}<!-- | ||
+ | --><!-- #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]] | {{#ask: [[Stuff Category::Leathery]] |
Revision as of 16:15, 7 November 2023
This page is suggested to be moved. Destination: Template:Building Stats Table. Reason: Standardization with Template: Weapon Stats Table. |
This article is suggested to be merged with See talk page. Reason: When quality is implemented, overlaps with other templates. See talk page. |
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
Billiards table | Beauty | Work to Build | HP | Flammability | Market Value | |
---|---|---|---|---|---|---|
Quality | Material | |||||
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
Bed | Beauty | Comfort | Work to Build | HP | Flammability | Market Value | |
---|---|---|---|---|---|---|---|
Quality | Material | ||||||
Wood | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (9.33 secs) | 56091 | 100% | 56 | |
Granite blocks | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (1.37 mins) | 4,940238 | 0% | 58 | |
Limestone blocks | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (1.37 mins) | 4,940217 | 0% | 58 | |
Marble blocks | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (1.26 mins) | 4,540168 | 0% | 57 | |
Sandstone blocks | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (1.15 mins) | 4,140196 | 0% | 55 | |
Slate blocks | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (1.37 mins) | 4,940182 | 0% | 58 | |
Jade | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (1.11 mins) | 4,00070 | 0% | 240 | |
Bioferrite | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (33.33 secs) | 2,000280 | 75% | 41 | |
Gold | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (12 secs) | 72084 | 40% | 4,505 | |
Plasteel | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (29.33 secs) | 1,760392 | 0% | 410 | |
Silver | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (13.33 secs) | 80098 | 40% | 455 | |
Steel | Expression error: Unexpected < operator. | Expression error: Unexpected round operator. | ticks (13.33 secs) | 800140 | 40% | 88 | |
Uranium | Expression error: Unexpected < operator. | Expression error: Unexpected round 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
Autodoor | Beauty | Work to Build | HP | Flammability | Door Speed | Market Value |
---|---|---|---|---|---|---|
Material | ||||||
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
Spike trap | Beauty | Work to Build | HP | Flammability | Total Damage | Attack Damage | Armor Penetration | Market Value |
---|---|---|---|---|---|---|---|---|
Material | ||||||||
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. |