Difference between revisions of "Template:Stat Factors Table Row"

From RimWorld Wiki
Jump to navigation Jump to search
(Changed row implementation to use a lua module.)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>|-
+
<includeonly>{{#invoke:Stat Factors Table|TableRow|{{#var:skillBase}}|{{#var:skillBonus}}|{{#var: statMin}}|{{#var: statMax}}|{{#var:capImportance}}|{{#var: capLimit}}|{{#var: resultCols}}|{{{1}}}|{{{2}}}}}
! {{{1}}}
+
</includeonly><noinclude>{{Documentation}}</noinclude>
{{#vardefine: tempValue | {{#expr: ({{#var: skillBase}} + {{#var: skillBonus}}*{{{1}}})*100}} }} {{#ifexpr: {{#var: tempValue}} > {{#var: statMax}} | {{#var: statMax}} | {{#ifexpr: {{#var: tempValue}} < {{#var: statMin}} | {{#var: statMin}} | {{#var: tempValue}} }} }}%<!--
 
-->{{#ifexpr: {{#var: resultCols}} >= 2 |
 
<td>  {{#vardefine: tempValue | {{#expr: ({{#var: skillBase}} + {{#var: skillBonus}}*{{{1}}})*100*(1+({{#var: capImportance}}*{{#ifexpr: {{#var: capLimit}} >= 1.25 | 0.25 | ({{#var: capLimit}} - 1) }} ))}} }} {{#ifexpr: {{#var: tempValue}} > {{#var: statMax}} | {{#var: statMax}} | {{#ifexpr: {{#var: tempValue}} < {{#var: statMin}} | {{#var: statMin}} |  {{#var: tempValue}} }} }}%
 
}}<!--
 
-->{{#ifexpr: {{#var: resultCols}} >= 3 |
 
<td>  {{#vardefine: tempValue | {{#expr: ({{#var: skillBase}} + {{#var: skillBonus}}*{{{1}}})*100*(1+({{#var: capImportance}}*{{#ifexpr: {{#var: capLimit}} >= 1.5 | 0.5 | ({{#var: capLimit}} - 1) }} ))}} }} {{#ifexpr: {{#var: tempValue}} > {{#var: statMax}} | {{#var: statMax}} | {{#ifexpr: {{#var: tempValue}} < {{#var: statMin}} | {{#var: statMin}} |  {{#var: tempValue}} }} }}%
 
}}</includeonly><noinclude>{{Documentation}}</noinclude>
 

Latest revision as of 19:45, 11 August 2024

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

This template generates the table rows for the Template: Stat Factors Table. See that page for details on template function.

Examples[edit]

As this template is not intended for use without its parent, the parent is used below.

{{Stat Factors Table}}

on the Butchery Efficiency page would produce:

Cooking Skill Level Butchery Efficiency
100% Manipulation 125% Manipulation 150% Manipulation
0 75%91.88% 108.75%
1 77.5%94.94% 112.38%
2 80%98% 116%
3 82.5%101.06% 119.62%
4 85%104.13% 123.25%
5 87.5%107.19% 126.88%
6 90%110.25% 130.5%
7 92.5%113.31% 134.13%
8 95%116.38% 137.75%
9 97.5%119.44% 141.37%
10 100%122.5% 145%
11 102.5%125.56% 148.62%
12 105%128.63% 150%
13 107.5%131.69% 150%
14 110%134.75% 150%
15 112.5%137.81% 150%
16 115%140.88% 150%
17 117.5%143.94% 150%
18 120%147% 150%
19 122.5%150% 150%
20 125%150% 150%
{{Stat Factors Table|Animal Gather Speed}}

on any page would produce:

Animals Skill Level Animal Gather Speed
100% Manipulation 125% Manipulation 150% Manipulation
0 10%10% 10%
1 16%20% 24%
2 28%35% 42%
3 40%50% 60%
4 52%65% 78%
5 64%80% 96%
6 76%95% 114%
7 88%110% 132%
8 100%125% 150%
9 112%140% 168%
10 124%155% 186%
11 136%170% 204%
12 148%185% 222%
13 160%200% 240%
14 172%215% 258%
15 184%230% 276%
16 196%245% 294%
17 208%260% 312%
18 220%275% 330%
19 232%290% 348%
20 244%305% 366%

Example when limit is 100%:

{{Stat Factors Table|Arrest Success Chance}}

it produces:

Social Skill Level Arrest Success Chance
0 60%
1 67.5%
2 75%
3 82.5%
4 90%
5 97.5%
6 100%
7 100%
8 100%
9 100%
10 100%
11 100%
12 100%
13 100%
14 100%
15 100%
16 100%
17 100%
18 100%
19 100%
20 100%

Example when limit is >100% but <125%: Note: Research Speed is not an appropriate use of the template, as it relies equally on two different capacities, however, at the time of writing no compatible example of an inter-column limit exists:

{{Stat Factors Table|Research Speed }}

on any page would produce:

Intellectual Skill Level Research Speed
100% Manipulation 110%+ Manipulation
0 8%8.4%
1 19.5%20.48%
2 31%32.55%
3 42.5%44.63%
4 54%56.7%
5 65.5%68.78%
6 77%80.85%
7 88.5%92.93%
8 100%105%
9 111.5%117.08%
10 123%129.15%
11 134.5%141.23%
12 146%153.3%
13 157.5%165.38%
14 169%177.45%
15 180.5%189.53%
16 192%201.6%
17 203.5%213.68%
18 215%225.75%
19 226.5%237.83%
20 238%249.9%

Example when skills have to be specifically defined:

{{Stat Factors Table|Plant Harvest Yield|l0=0.60|l1=0.70|l2=0.75|l3=0.80|l4=0.85|l5=0.90|l6=0.95|l7=0.98|l8=1.00|l9=1.01|l10=1.02|l11=1.03|l12=1.04|l13=1.05|l14=1.06|l15=1.07|l16=1.08|l17=1.09|l18=1.10|l19=1.12|l20=1.13}}

it produces:

Plants Skill Level Plant Harvest Yield
100% Manipulation 125% Manipulation 150% Manipulation
0 60%64.5% 69%
1 70%75.25% 80.5%
2 75%80.62% 86.25%
3 80%86% 92%
4 85%91.38% 97.75%
5 90%96.75% 103.5%
6 95%102.13% 109.25%
7 98%105.35% 112.7%
8 100%107.5% 115%
9 101%108.58% 116.15%
10 102%109.65% 117.3%
11 103%110.73% 118.45%
12 104%111.8% 119.6%
13 105%112.88% 120.75%
14 106%113.95% 121.9%
15 107%115.03% 123.05%
16 108%116.1% 124.2%
17 109%117.18% 125.35%
18 110%118.25% 126.5%
19 112%120.4% 128.8%
20 113%121.47% 129.95%