Template:To-Hit: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
</noinclude><includeonly>+{{#expr: | </noinclude><includeonly>+{{#expr: | ||
{{MonsterToHit|transcludesection= | {{MonsterToHit|transcludesection= | ||
{{#ifexpr: ({{#var:CR}} + {{{1|0}}} + {{#if:{{#var:Pattern1|}}|{{#ifexpr:{{:{{ | {{#ifexpr: ({{#var:CR}} + {{{1|0}}} + {{#if:{{#var:Pattern1|}}|{{#ifexpr:{{:{{#var:Pattern1}}|transcludesection=Hit-Points-Adj}}|{{:{{#var:Pattern1}}|transcludesection=Hit-Points-Adj}}|0}}|0}} + {{#if:{{#var:Pattern2|}}|{{#ifexpr:{{:{{#var:Pattern2}}|transcludesection=Hit-Points-Adj}}|{{:{{#var:Pattern2}}|transcludesection=Hit-Points-Adj}}|0}}|0}}) < 1 | 1 | | ||
{{#ifexpr: ({{#var:CR}} + {{{1|0}}} + {{#if:{{#var:Pattern1|}}|{{#ifexpr:{{:{{ | {{#ifexpr: ({{#var:CR}} + {{{1|0}}} + {{#if:{{#var:Pattern1|}}|{{#ifexpr:{{:{{#var:Pattern1}}|transcludesection=Hit-Points-Adj}}|{{:{{#var:Pattern1}}|transcludesection=Hit-Points-Adj}}|0}}|0}} + {{#if:{{#var:Pattern2|}}|{{#ifexpr:{{:{{#var:Pattern2}}|transcludesection=Hit-Points-Adj}}|{{:{{#var:Pattern2}}|transcludesection=Hit-Points-Adj}}|0}}|0}}) > 44 | 44 | | ||
{{#expr: ({{#var:CR}} + {{{1|0}}} + {{#if:{{#var:Pattern1|}}|{{#ifexpr:{{:{{ | {{#expr: ({{#var:CR}} + {{{1|0}}} + {{#if:{{#var:Pattern1|}}|{{#ifexpr:{{:{{#var:Pattern1}}|transcludesection=Hit-Points-Adj}}|{{:{{#var:Pattern1}}|transcludesection=Hit-Points-Adj}}|0}}|0}} + {{#if:{{#var:Pattern2|}}|{{#ifexpr:{{:{{#var:Pattern2}}|transcludesection=Hit-Points-Adj}}|{{:{{#var:Pattern2}}|transcludesection=Hit-Points-Adj}}|0}}|0}}) | ||
}} | }} | ||
}} | }} |
Revision as of 23:24, 23 January 2021
Outputs the to-hit string with a plus in front (e.g. +5), based on the CR of the monster. Primarily used inside the Monster template. Call as follows:
{{To-Hit}}
Parameters (all are optional):
- (unnamed) = modify CR with a positive or negative number. -2 lowers CR by two before outputting value.
- n = modify numeric value with a positive or negative number. "n=-2" lowers skill DC by 2 before outputting the value.
- op = modify the operand. Values are "op=mult" and "op=div", allowing you to multiply or divide by parameter n's value. Default is addition (with negative numbers subtracting).
Examples:
- {{To-Hit|-2}} - outputs to-hit value as though CR was two lower than actual.
- {{To-Hit|n = 2|op = mult}} - outputs double the normal to-hit value for a monster of that CR.