Difference between revisions of "Template:Math/Healthpack"
(Necessary for the Health kit comparison template... to be merged in to the Class Health Table.) |
|||
Line 1: | Line 1: | ||
− | <onlyinclude>{{#if:{{{1|}}}|{{#expr: | + | <onlyinclude>{{#if:{{{1|}}}|{{#expr:{{{1}}}*{{#switch:{{{2|}}}|small=.205|medium=.5|large=1|#default=error}}*{{#if:{{{backscratcher|}}}|1.5|1}} round 0}}|[[Template:Math/Healthpack|'''?''']]}}</onlyinclude> |
{{Template doc}} | {{Template doc}} | ||
[[Category:Game mechanics|Healthpack Healing]] | [[Category:Game mechanics|Healthpack Healing]] |
Latest revision as of 14:45, 13 October 2014
This template multiplies a number passed to it using an algorithm that is consistent with the way Health is calculated in-game. Use it for calculating the amount of health gained from a health pack based on a classes max health.
Contents
Usage
{{Math/Healthpack|175|small}}
This example yields 36.
Pack size
The size of the healthpack is passed as the second parameter. Valid parameters are small, medium, large
:
{{Math/Healthpack|175|medium}}
This example yields 88.
Backscratcher
The backscratcher is not coded into {{Metrics/Health}}
, since it does not affect base health. To account for this, pass the parameter backscratcher=yes
.
Errors
- This template will display ? if it is missing a max health number.
- This template will display an Expression error if it cannot interpret either the max health number or factor passed to it. Only include numeric characters (0-9).