Template:Touch-Attack: Difference between revisions

From Epic Path
Jump to navigation Jump to search
No edit summary
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 13: Line 13:
'''Examples:'''
'''Examples:'''
* <nowiki>{{Touch-Attack|-2}}</nowiki> - outputs touch-attack to-hit value as though CR was two lower than actual.
* <nowiki>{{Touch-Attack|-2}}</nowiki> - outputs touch-attack to-hit value as though CR was two lower than actual.
* <nowiki>{{To-Hit|n = 2|op = mult}}</nowiki> - outputs double the normal touch-attack to-hit value for a monster of that CR.
* <nowiki>{{Touch-Attack|n = 2|op = mult}}</nowiki> - outputs double the normal touch-attack to-hit value for a monster of that CR.


</noinclude><includeonly>
'''Output:'''
+{{#expr:
* {{Touch-Attack|10}}
 
</noinclude><includeonly>1d20 + {{#expr:
   {{MonsterToHit|transcludesection=
   {{MonsterToHit|transcludesection=
       {{#ifexpr: ({{#var:CR}} + {{{1|0}}}) < 1 | 1 |  
       {{#ifexpr: ({{#var:To-Hit-CR}} + {{{1|0}}}) < 1 | 1 |  
         {{#ifexpr: ({{#var:CR}} + {{{1|0}}}) > 44 | 44 |  
         {{#ifexpr: ({{#var:To-Hit-CR}} + {{{1|0}}}) > 44 | 44 |  
             {{#expr: ({{#var:CR}} + {{{1|0}}})
             {{#expr: ({{#var:To-Hit-CR}} + {{{1|0}}})
             }}
             }}
         }}
         }}
       }}
       }}
   }} - 4  
   }} + 4  
   {{#ifexpr:{{{n|}}}|
   {{#ifexpr:{{{n|}}}|
       {{#switch:{{{op|}}} |mult=*|div=/|#default=+
       {{#switch:{{{op|}}} |mult=*|div=/|#default=+
       }}{{{n}}}|
       }}{{{n}}}|
   }} round 0
   }} round 0
}} vs. Touch AC
}} vs. AC (always hits on a 17+ on the die)</includeonly>
</includeonly>

Latest revision as of 16:32, 4 February 2021

Outputs the to-hit string for an attack against the target's Touch AC (e.g. "+5 vs. Touch AC"), based on the CR of the monster. Primarily used inside the Monster template. Call as follows:

{{Touch-Attack}}

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:

  • {{Touch-Attack|-2}} - outputs touch-attack to-hit value as though CR was two lower than actual.
  • {{Touch-Attack|n = 2|op = mult}} - outputs double the normal touch-attack to-hit value for a monster of that CR.

Output:

  • 1d20 + 20 vs. AC (always hits on a 17+ on the die)