Difference between revisions of "Template:Melee Hit Chance/curve"

From RimWorld Wiki
Jump to navigation Jump to search
(allow the template to take expressions)
 
Line 1: Line 1:
<includeonly>{{#switch: {{#expr: floor({{formatnum:{{{1|}}} }}/10)}}
+
<includeonly>{{#vardefine:baseScore|{{#expr:{{{1|}}} }} }}{{#switch: {{#expr: floor({{#var:baseScore}}/10)}}
| -2 = {{#expr: ({{{1|}}} + 20) * 0.005 + 0.05}}
+
| -2 = {{#expr: ({{#var:baseScore}} + 20) * 0.005 + 0.05}}
| -1 = {{#expr: ({{{1|}}} + 10) * 0.04 + 0.1}}
+
| -1 = {{#expr: ({{#var:baseScore}} + 10) * 0.04 + 0.1}}
| 0 = {{#expr: {{{1|}}} * 0.03 + 0.5}}
+
| 0 = {{#expr: {{#var:baseScore}} * 0.03 + 0.5}}
| 1 = {{#expr: ({{{1|}}} - 10) * 0.01 + 0.8}}
+
| 1 = {{#expr: ({{#var:baseScore}} - 10) * 0.01 + 0.8}}
| 2 | 3 = {{#expr: ({{{1|}}} - 20) * 0.003 + 0.9}}
+
| 2 | 3 = {{#expr: ({{#var:baseScore}} - 20) * 0.003 + 0.9}}
| 4 | 5 = {{#expr: ({{{1|}}} - 40) * 0.001 + 0.96}}
+
| 4 | 5 = {{#expr: ({{#var:baseScore}} - 40) * 0.001 + 0.96}}
| #default = {{#ifexpr: {{{1|}}} >= 60 | 0.98 | 0.05}}
+
| #default = {{#ifexpr: {{#var:baseScore}} >= 60 | 0.98 | 0.05}}
 
}}</includeonly><noinclude>{{Documentation wanted}}
 
}}</includeonly><noinclude>{{Documentation wanted}}
 
{| class="wikitable"
 
{| class="wikitable"
Line 29: Line 29:
  
 
==== Testing ====
 
==== Testing ====
 +
* 1+4: {{Melee Hit Chance/curve|1+4}}
 +
* 5: {{Melee Hit Chance/curve|5}}
 
* -23: {{Melee Hit Chance/curve|-23}}
 
* -23: {{Melee Hit Chance/curve|-23}}
 
* -20: {{Melee Hit Chance/curve|-20}}
 
* -20: {{Melee Hit Chance/curve|-20}}

Latest revision as of 11:21, 24 April 2023

Modified Melee Skill Curve Point
-20 0.05
-10 0.10
0.0 0.50
10 0.80
20 0.90
40 0.96
60 0.98

Testing[edit]

  • 1+4: 0.65
  • 5: 0.65
  • -23: 0.05
  • -20: 0.05
  • -15: 0.075
  • -3: 0.38
  • 0: 0.5
  • 8: 0.74
  • 15: 0.85
  • 25: 0.915
  • 50: 0.97
  • 59: 0.979
  • 60: 0.98
  • 99999: 0.98
  • asdf: Expression error: Unexpected < operator.