Difference between revisions of "Template:Rest Effectiveness Quality Table"

From RimWorld Wiki
Jump to navigation Jump to search
(Fixing distortion in spacing when the optional rows aren't present.)
(make it work for non-quality things)
Line 1: Line 1:
<includeonly><div><li style="display: inline-table;">{{#vardefine:restRate|{{#expr:(((1/((150/60000)*(24/10.5)))*150)/2500)}} }}<!-- See [[Rest#Positive]] for an explanation of the formula -->
+
<includeonly><!--
 +
 
 +
VARIABLES
 +
-->{{#vardefine:name                  | {{{1| {{PAGENAME}} }}} }}<!--
 +
-->{{#vardefine:hasQuality            | {{Q|{{#var:name}}|Has Quality}} }}<!--
 +
-->{{#vardefine:stony                | {{#pos:{{Q|{{#var:name}}|Stuff Tags}}|Stony}} }}<!--
 +
-->{{#vardefine:baseresteffectiveness | {{Q|{{#var:name}}|Rest Effectiveness}} }}<!--
 +
-->{{#vardefine:restRate             | {{#expr:(((1/((150/60000)*(24/10.5)))*150)/2500)}} }}<!-- See [[Rest#Positive]] for an explanation of the formula
 +
 
 +
TABLE
 +
--><div><li style="display:inline-table;">
 
{| {{STDT| sortable c_08 text-center}}
 
{| {{STDT| sortable c_08 text-center}}
! {{#if: {{#pos:{{Q|{{#vardefineecho:name | {{{1|{{PAGENAME}} }}} }}|Stuff Tags}}|Stony}}|Material|Quality}}
+
! {{#if: {{#pos:{{Q|{{#var:name}}|Stuff Tags}}|Stony}}|Material|Quality}}
! Awful
+
{{#ifeq: {{#var:hasQuality}} | true |
! Poor
+
  ! [[Quality]]
! Normal
+
  ! Awful
! Good
+
  ! Poor
! Excellent
+
  ! Normal
! Masterwork
+
  ! Good
! Legendary
+
  ! Excellent
 +
  ! Masterwork
 +
  ! Legendary
 +
| ! colspan="2" {{!}} {{#var:name}} }}
 
|-
 
|-
! {{#if: {{#vardefineecho: stony | {{#pos:{{Q|{{#var: name}}|Stuff Tags}}|Stony}} }}|Non-Stone and Jade|[[Rest effectiveness]]}}
+
! {{#if: {{#var:stony}}|Non-Stone and Jade|[[Rest effectiveness]]}}
| {{%|{{#vardefineecho: baseresteffectiveness | {{Q|{{#var: name}}|Rest Effectiveness}} }}*0.86|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.86) round 2}}&nbsp;h)
+
{{#ifeq: {{#var:hasQuality}} | true |
| {{%|{{#var:baseresteffectiveness}}*0.92|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.92) round 2}}&nbsp;h)
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*0.86|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.86) round 2}}&nbsp;h)
| {{%|{{#var:baseresteffectiveness}}    |0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}    ) round 2}}&nbsp;h)
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*0.92|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.92) round 2}}&nbsp;h)
| {{%|{{#var:baseresteffectiveness}}*1.08|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*1.08) round 2}}&nbsp;h)
+
  {{!}} {{%|{{#var:baseresteffectiveness}}    |0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}    ) round 2}}&nbsp;h)
| {{%|{{#var:baseresteffectiveness}}*1.14|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*1.14) round 2}}&nbsp;h)
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*1.08|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*1.08) round 2}}&nbsp;h)
| {{%|{{#var:baseresteffectiveness}}*1.25|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*1.25) round 2}}&nbsp;h)
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*1.14|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*1.14) round 2}}&nbsp;h)
| {{%|{{#var:baseresteffectiveness}}*1.6 |0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*1.6 ) round 2}}&nbsp;h)
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*1.25|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*1.25) round 2}}&nbsp;h)
 +
  {{!}} {{%|{{#var:baseresteffectiveness}}*1.6 |0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*1.6 ) round 2}}&nbsp;h)
 +
| {{!}} {{%|{{#var:baseresteffectiveness}}    |0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}    ) round 2}}&nbsp;h)}}
 
{{#if: {{#pos:{{Q|{{#var: name}}|Facility}}|Sleep accelerator}}|<tr>
 
{{#if: {{#pos:{{Q|{{#var: name}}|Facility}}|Sleep accelerator}}|<tr>
 
<th> <small>{{#if: {{#var:stony}}|Non-Stone and Jade +<br/>}}[[Sleep accelerator]]{{IdeologyIcon}}</small> </th>
 
<th> <small>{{#if: {{#var:stony}}|Non-Stone and Jade +<br/>}}[[Sleep accelerator]]{{IdeologyIcon}}</small> </th>
<td> {{%|({{#var:baseresteffectiveness}}+0.35)*0.86|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*0.86) round 2}}&nbsp;h) </td>
+
{{#ifeq: {{#var:hasQuality}} | true |
<td> {{%|({{#var:baseresteffectiveness}}+0.35)*0.92|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*0.92) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|({{#var:baseresteffectiveness}}+0.35)*0.86|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*0.86) round 2}}&nbsp;h)
<td> {{%| {{#var:baseresteffectiveness}}+0.35      |0}} ({{#expr:{{#var:restRate}}/( {{#var:baseresteffectiveness}}+0.35      ) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|({{#var:baseresteffectiveness}}+0.35)*0.92|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*0.92) round 2}}&nbsp;h)
<td> {{%|({{#var:baseresteffectiveness}}+0.35)*1.08|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*1.08) round 2}}&nbsp;h) </td>
+
  {{!}} {{%| {{#var:baseresteffectiveness}}+0.35      |0}} ({{#expr:{{#var:restRate}}/( {{#var:baseresteffectiveness}}+0.35      ) round 2}}&nbsp;h)
<td> {{%|({{#var:baseresteffectiveness}}+0.35)*1.14|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*1.14) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|({{#var:baseresteffectiveness}}+0.35)*1.08|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*1.08) round 2}}&nbsp;h)
<td> {{%|({{#var:baseresteffectiveness}}+0.35)*1.25|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*1.25) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|({{#var:baseresteffectiveness}}+0.35)*1.14|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*1.14) round 2}}&nbsp;h)
<td> {{%|({{#var:baseresteffectiveness}}+0.35)*1.6 |0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*1.6 ) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|({{#var:baseresteffectiveness}}+0.35)*1.25|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*1.25) round 2}}&nbsp;h)
 +
  {{!}} {{%|({{#var:baseresteffectiveness}}+0.35)*1.6 |0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}+0.35)*1.6 ) round 2}}&nbsp;h)
 +
| {{!}} {{%| {{#var:baseresteffectiveness}}+0.35      |0}} ({{#expr:{{#var:restRate}}/( {{#var:baseresteffectiveness}}+0.35      ) round 2}}&nbsp;h)}}
 
</tr>
 
</tr>
 
}}{{#if: {{#var:stony}}|<tr>
 
}}{{#if: {{#var:stony}}|<tr>
 
<th> Stone except Jade </th>
 
<th> Stone except Jade </th>
<td> {{%|{{#var:baseresteffectiveness}}*0.9*0.86|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*0.86) round 2}}&nbsp;h) </td>
+
{{#ifeq: {{#var:hasQuality}} | true |
<td> {{%|{{#var:baseresteffectiveness}}*0.9*0.92|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*0.92) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*0.9*0.86|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*0.86) round 2}}&nbsp;h)
<td> {{%|{{#var:baseresteffectiveness}}*0.9    |0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9    ) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*0.9*0.92|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*0.92) round 2}}&nbsp;h)
<td> {{%|{{#var:baseresteffectiveness}}*0.9*1.08|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*1.08) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*0.9    |0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9    ) round 2}}&nbsp;h)
<td> {{%|{{#var:baseresteffectiveness}}*0.9*1.14|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*1.14) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*0.9*1.08|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*1.08) round 2}}&nbsp;h)
<td> {{%|{{#var:baseresteffectiveness}}*0.9*1.25|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*1.25) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*0.9*1.14|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*1.14) round 2}}&nbsp;h)
<td> {{%|{{#var:baseresteffectiveness}}*0.9*1.6 |0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*1.6 ) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|{{#var:baseresteffectiveness}}*0.9*1.25|0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*1.25) round 2}}&nbsp;h)
 +
  {{!}} {{%|{{#var:baseresteffectiveness}}*0.9*1.6 |0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9*1.6 ) round 2}}&nbsp;h)
 +
| {{!}} {{%|{{#var:baseresteffectiveness}}*0.9    |0}} ({{#expr:{{#var:restRate}}/({{#var:baseresteffectiveness}}*0.9    ) round 2}}&nbsp;h)}}
 
</tr>
 
</tr>
 
}}{{#if: {{#var:stony}}|{{#if: {{#pos:{{Q|{{#var: name}}|Facility}}|Sleep accelerator}}|<tr>
 
}}{{#if: {{#var:stony}}|{{#if: {{#pos:{{Q|{{#var: name}}|Facility}}|Sleep accelerator}}|<tr>
 
<th> <small>Stone except Jade +<br/>[[Sleep accelerator]]{{IdeologyIcon}}</small> </th>
 
<th> <small>Stone except Jade +<br/>[[Sleep accelerator]]{{IdeologyIcon}}</small> </th>
<td> {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*0.86|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*0.86) round 2}}&nbsp;h) </td>
+
{{#ifeq: {{#var:hasQuality}} | true |
<td> {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*0.92|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*0.92) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*0.86|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*0.86) round 2}}&nbsp;h)
<td> {{%| {{#var:baseresteffectiveness}}*0.9+0.35      |0}} ({{#expr:{{#var:restRate}}/( {{#var:baseresteffectiveness}}*0.9+0.35      ) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*0.92|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*0.92) round 2}}&nbsp;h)
<td> {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*1.08|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*1.08) round 2}}&nbsp;h) </td>
+
  {{!}} {{%| {{#var:baseresteffectiveness}}*0.9+0.35      |0}} ({{#expr:{{#var:restRate}}/( {{#var:baseresteffectiveness}}*0.9+0.35      ) round 2}}&nbsp;h)
<td> {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*1.14|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*1.14) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*1.08|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*1.08) round 2}}&nbsp;h)
<td> {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*1.25|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*1.25) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*1.14|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*1.14) round 2}}&nbsp;h)
<td> {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*1.6 |0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*1.6 ) round 2}}&nbsp;h) </td>
+
  {{!}} {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*1.25|0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*1.25) round 2}}&nbsp;h)
 +
  {{!}} {{%|({{#var:baseresteffectiveness}}*0.9+0.35)*1.6 |0}} ({{#expr:{{#var:restRate}}/(({{#var:baseresteffectiveness}}*0.9+0.35)*1.6 ) round 2}}&nbsp;h)
 +
| {{!}} {{%| {{#var:baseresteffectiveness}}*0.9+0.35      |0}} ({{#expr:{{#var:restRate}}/( {{#var:baseresteffectiveness}}*0.9+0.35      ) round 2}}&nbsp;h)}}
 
</tr>
 
</tr>
 
}} }}
 
}} }}

Revision as of 10:22, 16 December 2023

Documentation icon Template documentation[view] [edit] [history] [purge]

Summary

This template generates a table summarizing the rest effectiveness for each quality tier. If the object in question is has an option to use stone as a construction material, it will add a row to that effect.

Parameters

The first parameter, if present, will specify which object to generate the template for. If absent, {{PAGENAME}} will be used.

Example usage

Bed

{{Rest Effectiveness Quality Table}}

On the Bed page produces:

  • Material Quality Awful Poor Normal Good Excellent Masterwork Legendary
    Non-Stone and Jade 86% (12.21 h) 92% (11.41 h) 100% (10.5 h) 108% (9.72 h) 114% (9.21 h) 125% (8.4 h) 160% (6.56 h)
    Non-Stone and Jade +
    Sleep acceleratorContent added by the Ideology DLC
    116% (9.04 h) 124% (8.45 h) 135% (7.78 h) 146% (7.2 h) 154% (6.82 h) 169% (6.22 h) 216% (4.86 h)
    Stone except Jade 77% (13.57 h) 83% (12.68 h) 90% (11.67 h) 97% (10.8 h) 103% (10.23 h) 113% (9.33 h) 144% (7.29 h)
    Stone except Jade +
    Sleep acceleratorContent added by the Ideology DLC
    108% (9.77 h) 115% (9.13 h) 125% (8.4 h) 135% (7.78 h) 143% (7.37 h) 156% (6.72 h) 200% (5.25 h)
  • Bracketed numbers are in-game hours to refill rest to 100% from 0% at the given rest effectiveness.

    Hospital bed

    {{Rest Effectiveness Quality Table | Hospital bed}}

    Produces:

  • Quality Quality Awful Poor Normal Good Excellent Masterwork Legendary
    Rest effectiveness 86% (12.21 h) 92% (11.41 h) 100% (10.5 h) 108% (9.72 h) 114% (9.21 h) 125% (8.4 h) 160% (6.56 h)
    Sleep acceleratorContent added by the Ideology DLC 116% (9.04 h) 124% (8.45 h) 135% (7.78 h) 146% (7.2 h) 154% (6.82 h) 169% (6.22 h) 216% (4.86 h)
  • Bracketed numbers are in-game hours to refill rest to 100% from 0% at the given rest effectiveness.

    Animal bed

    {{Rest Effectiveness Quality Table | Animal bed}}

    Produces:

  • Quality Quality Awful Poor Normal Good Excellent Masterwork Legendary
    Rest effectiveness 86% (12.21 h) 92% (11.41 h) 100% (10.5 h) 108% (9.72 h) 114% (9.21 h) 125% (8.4 h) 160% (6.56 h)
  • Bracketed numbers are in-game hours to refill rest to 100% from 0% at the given rest effectiveness.

    Sleeping spot

    {{Rest Effectiveness Quality Table | Sleeping spot}}

    Produces:

  • Quality Sleeping spot
    Rest effectiveness 80% (13.13 h)
  • Bracketed numbers are in-game hours to refill rest to 100% from 0% at the given rest effectiveness.