Editing Template:Stat Factors Table

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
<noinclude>{{Recode|reason=The capacity detection system (the huge switch statement) is only a proof of concept and its a cludge with a lot of needless memory usage atm. Needs to be refined but I've run out of time and can't do code on a phone -- [[User:Harakoni|Harakoni (Wiki Moderator)]] ([[User talk:Harakoni|talk]])}}</noinclude><includeonly>{{#vardefine: statName | {{{1|{{PAGENAME}}}}} }}<!--
+
<includeonly>{{#vardefine: statName | {{{1|{{PAGENAME}}}}} }}<!--
-->{{#vardefine: statMax | {{Q|{{#var: statName}}|Stat Maximum|99999999}} }}<!--
+
-->{{#vardefine: statMax |{{#expr:{{Q|{{#var: statName}}|Stat Maximum|99999999}}*100}} }}<!--
-->{{#vardefine: statMin | {{Q|{{#var: statName}}|Stat Minimum|0}} }}<!--
+
-->{{#vardefine: statMin |{{#expr:{{Q|{{#var: statName}}|Stat Minimum|0}}*100}} }}<!--
 
-->{{#vardefine: skillBase | {{Q|{{#var: statName}}|Skill Base Factor}} }}<!--
 
-->{{#vardefine: skillBase | {{Q|{{#var: statName}}|Skill Base Factor}} }}<!--
 
-->{{#vardefine: skillBonus | {{Q|{{#var: statName}}|Skill Bonus Factor}} }}<!--
 
-->{{#vardefine: skillBonus | {{Q|{{#var: statName}}|Skill Bonus Factor}} }}<!--
-->{{#vardefine: capName | {{ucfirst:{{{2|{{#switch: 1
+
-->{{#vardefine: capName | {{ucfirst:{{{2|Manipulation}}}}} }}<!--
<!-- If a cap isn't defined, is there an uncapped capacity-->
 
| {{#ifeq: {{Q|{{#var: statName}}|Manipulation Limit}} | - |1|0}}    = Manipulation
 
| {{#ifeq: {{Q|{{#var: statName}}|Sight Limit}} | - |1|0}}            = Sight
 
| {{#ifeq: {{Q|{{#var: statName}}|Moving Limit}} | - |1|0}}          = Moving
 
| {{#ifeq: {{Q|{{#var: statName}}|Talking Limit}} | - |1|0}}          = Talking
 
| {{#ifeq: {{Q|{{#var: statName}}|Hearing Limit}} | - |1|0}}          = Hearing
 
| {{#ifeq: {{Q|{{#var: statName}}|Eating Limit}} | - |1|0}}          = Eating
 
| {{#ifeq: {{Q|{{#var: statName}}|Consciousness Limit}} | - |1|0}}    = Consciousness
 
| {{#ifeq: {{Q|{{#var: statName}}|Blood Pumping Limit}} | - |1|0}}    = Blood Pumping
 
| {{#ifeq: {{Q|{{#var: statName}}|Breathing Limit}} | - |1|0}}        = Breathing
 
| {{#ifeq: {{Q|{{#var: statName}}|Metabolism Limit}} | - |1|0}}      = Metabolism
 
| {{#ifeq: {{Q|{{#var: statName}}|Blood Filtration Limit}} | - |1|0}} = Blood Filtration
 
| {{#ifeq: {{Q|{{#var: statName}}|Pain Limit}}| - |1|0}}              = Pain
 
<!-- If no, is there an a capacity with limit > 100%-->
 
| {{#ifexpr: {{Q|{{#var: statName}}|Manipulation Limit}} > 1|1|0}}    = Manipulation
 
| {{#ifexpr: {{Q|{{#var: statName}}|Sight Limit}} > 1|1|0}}            = Sight
 
| {{#ifexpr: {{Q|{{#var: statName}}|Moving Limit}} > 1|1|0}}          = Moving
 
| {{#ifexpr: {{Q|{{#var: statName}}|Talking Limit}} > 1|1|0}}          = Talking
 
| {{#ifexpr: {{Q|{{#var: statName}}|Hearing Limit}} > 1|1|0}}          = Hearing
 
| {{#ifexpr: {{Q|{{#var: statName}}|Eating Limit}} > 1|1|0}}          = Eating
 
| {{#ifexpr: {{Q|{{#var: statName}}|Consciousness Limit}} > 1|1|0}}    = Consciousness
 
| {{#ifexpr: {{Q|{{#var: statName}}|Blood Pumping Limit}} > 1|1|0}}    = Blood Pumping
 
| {{#ifexpr: {{Q|{{#var: statName}}|Breathing Limit}} > 1|1|0}}        = Breathing
 
| {{#ifexpr: {{Q|{{#var: statName}}|Metabolism Limit}} > 1|1|0}}      = Metabolism
 
| {{#ifexpr: {{Q|{{#var: statName}}|Blood Filtration Limit}} > 1|1|0}} = Blood Filtration
 
| {{#ifexpr: {{Q|{{#var: statName}}|Pain Limit}} > 1|1|0}}            = Pain
 
<!--Is there any capacity -->
 
| {{#if: {{Q|{{#var: statName}}|Manipulation Importance}}|1|0}}    = Manipulation
 
| {{#if: {{Q|{{#var: statName}}|Sight Importance}}|1|0}}            = Sight
 
| {{#if: {{Q|{{#var: statName}}|Moving Importance}}|1|0}}          = Moving
 
| {{#if: {{Q|{{#var: statName}}|Talking Importance}}|1|0}}          = Talking
 
| {{#if: {{Q|{{#var: statName}}|Hearing Importance}}|1|0}}          = Hearing
 
| {{#if: {{Q|{{#var: statName}}|Eating Importance}}|1|0}}          = Eating
 
| {{#if: {{Q|{{#var: statName}}|Consciousness Importance}}|1|0}}    = Consciousness
 
| {{#if: {{Q|{{#var: statName}}|Blood Pumping Importance}}|1|0}}    = Blood Pumping
 
| {{#if: {{Q|{{#var: statName}}|Breathing Importance}}|1|0}}        = Breathing
 
| {{#if: {{Q|{{#var: statName}}|Metabolism Importance}}|1|0}}      = Metabolism
 
| {{#if: {{Q|{{#var: statName}}|Blood Filtration Importance}}|1|0}} = Blood Filtration
 
| {{#if: {{Q|{{#var: statName}}|Pain Importance}}|1|0}}            = Pain
 
| #default = default
 
}}
 
}}}
 
}} }}{{#ifeq:{{#var:capName}}|Default|{{#vardefine: resultCols | 1 }}|<!-- If default, then no capacity is defined, only skill. Therefore, skip everything else capacity related.
 
 
-->{{#vardefine: capImportance | {{Q|{{#var: statName}}|{{#var: capName}} Importance}} }}<!--
 
-->{{#vardefine: capImportance | {{Q|{{#var: statName}}|{{#var: capName}} Importance}} }}<!--
 
-->{{#vardefine: capLimit | {{Q|{{#var: statName}} | {{#var: capName}} Limit | 99999999}} }}<!--
 
-->{{#vardefine: capLimit | {{Q|{{#var: statName}} | {{#var: capName}} Limit | 99999999}} }}<!--
 
-->{{#switch: 1
 
-->{{#switch: 1
| {{#ifeq: {{#var: capLimit}} | - | 1 | 0}} =  {{#vardefine: resultCols | 3 }} {{#vardefine: capLimit | 1.5}} <!--Defining a cap limit rather than "-" santizes input to later steps without having to introduce additional handling later. Atm this template only goes to 150% so this is not an issue, but if it is expanded this will have to be altered as will the heading names in the switch below, and the math in the Row Template - Harakoni--> {{#vardefine: column3Limit | 150% }}
+
| {{#ifeq: {{#var: capLimit}} | - | 1 | 0}} =  {{#vardefine: resultCols | 3 }}
 
| {{#expr: {{#var: capLimit}} <= 1}}        = {{#vardefine: resultCols | 1 }}
 
| {{#expr: {{#var: capLimit}} <= 1}}        = {{#vardefine: resultCols | 1 }}
| {{#expr: {{#var: capLimit}} <= 1.25 }}    = {{#vardefine: resultCols | 2 }}  
+
| {{#expr: {{#var: capLimit}} <= 1.25 }}    = {{#vardefine: resultCols | 2 }}
| {{#expr: {{#var: capLimit}} <= 1.5 }}      = {{#vardefine: resultCols | 3 }} {{#vardefine: column3Limit | {{%|{{#var: capLimit}}}}+ }}
+
| {{#expr: {{#var: capLimit}} < 1.5 }}      = {{#vardefine: resultCols | 3 }}
| {{#expr: {{#var: capLimit}} > 1.5 }}    = {{#vardefine: resultCols | 3 }} {{#vardefine: column3Limit | 150% }}
+
| {{#expr: {{#var: capLimit}} >- 1.5 }}    = {{#vardefine: resultCols | 3 }}
}}}}<!--
+
}}<!--
-->{| class = "mw-collapsible wikitable" width="180" style="text-align: center;"
+
-->{| class = "wikitable" width="180" style="text-align: center;"
 
! rowspan={{#ifeq: {{#var: resultCols}} | 1 | 1 | 2}} | {{Q|{{#var: statName}}|Skill}} Skill Level
 
! rowspan={{#ifeq: {{#var: resultCols}} | 1 | 1 | 2}} | {{Q|{{#var: statName}}|Skill}} Skill Level
 
! colspan={{#var: resultCols}} | {{#var: statName}}
 
! colspan={{#var: resultCols}} | {{#var: statName}}
Line 64: Line 21:
 
| 2 = <tr>
 
| 2 = <tr>
 
! 100% {{#var: capName}}
 
! 100% {{#var: capName}}
! {{%|{{#var: capLimit}}}}+ {{#var: capName}}</tr>
+
! 125% {{#var: capName}}
 
| 3 = <tr>
 
| 3 = <tr>
 
! 100% {{#var: capName}}
 
! 100% {{#var: capName}}
 
! 125% {{#var: capName}}
 
! 125% {{#var: capName}}
! {{#var: column3Limit}} {{#var: capName}}</tr>
+
! 150% {{#var: capName}}
 
}}
 
}}
 
|-  
 
|-  
{{Stat Factors Table Row|0|{{{l0|}}}}}
+
{{Stat Factors Table Row|0}}
{{Stat Factors Table Row|1|{{{l1|}}}}}
+
{{Stat Factors Table Row|1}}
{{Stat Factors Table Row|2|{{{l2|}}}}}
+
{{Stat Factors Table Row|2}}
{{Stat Factors Table Row|3|{{{l3|}}}}}
+
{{Stat Factors Table Row|3}}
{{Stat Factors Table Row|4|{{{l4|}}}}}
+
{{Stat Factors Table Row|4}}
{{Stat Factors Table Row|5|{{{l5|}}}}}
+
{{Stat Factors Table Row|5}}
{{Stat Factors Table Row|6|{{{l6|}}}}}
+
{{Stat Factors Table Row|6}}
{{Stat Factors Table Row|7|{{{l7|}}}}}
+
{{Stat Factors Table Row|7}}
{{Stat Factors Table Row|8|{{{l8|}}}}}
+
{{Stat Factors Table Row|8}}
{{Stat Factors Table Row|9|{{{l9|}}}}}
+
{{Stat Factors Table Row|9}}
{{Stat Factors Table Row|10|{{{l10|}}}}}
+
{{Stat Factors Table Row|10}}
{{Stat Factors Table Row|11|{{{l11|}}}}}
+
{{Stat Factors Table Row|11}}
{{Stat Factors Table Row|12|{{{l12|}}}}}
+
{{Stat Factors Table Row|12}}
{{Stat Factors Table Row|13|{{{l13|}}}}}
+
{{Stat Factors Table Row|13}}
{{Stat Factors Table Row|14|{{{l14|}}}}}
+
{{Stat Factors Table Row|14}}
{{Stat Factors Table Row|15|{{{l15|}}}}}
+
{{Stat Factors Table Row|15}}
{{Stat Factors Table Row|16|{{{l16|}}}}}
+
{{Stat Factors Table Row|16}}
{{Stat Factors Table Row|17|{{{l17|}}}}}
+
{{Stat Factors Table Row|17}}
{{Stat Factors Table Row|18|{{{l18|}}}}}
+
{{Stat Factors Table Row|18}}
{{Stat Factors Table Row|19|{{{l19|}}}}}
+
{{Stat Factors Table Row|19}}
{{Stat Factors Table Row|20|{{{l20|}}}}}
+
{{Stat Factors Table Row|20}}
 
|}</includeonly><noinclude>
 
|}</includeonly><noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Please note that all contributions to RimWorld Wiki are considered to be released under the CC BY-SA 3.0 (see RimWorld Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)