Template:Save-DC: Difference between revisions

From Epic Path
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 10: Line 10:
* '''n''' = modify numeric value with a positive or negative number. "n=-2" lowers skill DC by 2 before outputting the 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).
* '''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).
* '''nohi''' = don't highlight the text.  Values: Y, or exclude variable.  By default, the text is highlighted in a pleasant orange color.


'''Examples:'''
'''Examples:'''
Line 15: Line 16:
* <nowiki>{{Save-DC|n = 2|op = mult}}</nowiki> - outputs double the normal save DC value for a monster of that CR.
* <nowiki>{{Save-DC|n = 2|op = mult}}</nowiki> - outputs double the normal save DC value for a monster of that CR.


</noinclude><includeonly>{{#expr: {{MonsterAttackSave|transcludesection={{#ifexpr: ({{#var:CR}} + {{{1|0}}}) < 1 | 1 | {{#ifexpr: ({{#var:CR}} + {{{1|0}}}) > 44 | 44 | {{#expr: ({{#var:CR}} + {{{1|0}}}) }} }} }} }}{{#ifexpr:{{{n|}}}|{{#switch:{{{op|}}}|mult=*|div=/|#default=+}}{{{n}}}|}} round 0}}</includeonly>
</noinclude><includeonly>{{#ifeq:{{{nohi|}}}|Y|<span style="padding:0px 3px 0px 3px;">|<span style="background:#f5cd05; padding:0px 3px 0px 3px;">}}{{#expr:  
  {{MonsterAttackSave|transcludesection=
      {{#ifexpr: ({{#var:Save-DC-CR}} + {{{1|0}}}) < 1 | 1 |  
        {{#ifexpr: ({{#var:Save-DC-CR}} + {{{1|0}}}) > 44 | 44 |  
            {{#expr: ({{#var:Save-DC-CR}} + {{{1|0}}})  
            }}
        }}
      }}
  }}
  {{#ifexpr:{{{n|}}}|
      {{#switch:{{{op|}}}|mult=*|div=/|#default=+
      }}{{{n}}}|
  }} round 0
}}</span></includeonly>

Latest revision as of 15:55, 30 December 2021

Outputs the save DC for a monster's special attack (e.g. 5), based on the CR of the monster. Primarily used inside the Monster template. Call as follows:

{{Save-DC}}

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).
  • nohi = don't highlight the text. Values: Y, or exclude variable. By default, the text is highlighted in a pleasant orange color.

Examples:

  • {{Save-DC|-2}} - outputs save DC as though CR was two lower than actual.
  • {{Save-DC|n = 2|op = mult}} - outputs double the normal save DC value for a monster of that CR.