Template:Primary-Dmg: Difference between revisions

From Epic Path
Jump to navigation Jump to search
No edit summary
No edit summary
Line 35: Line 35:
             }}
             }}
         }}
         }}
       }}) *  
       }}) * {{#ifeq:
      {{#ifeq:
         {{#var:MeleeOrNatural|Natural
         {{#var:MeleeOrNatural|Natural
         }}|Natural|0.6666|0.5
         }}|Natural|0.6666|0.5
       }} *  
       }} * {{#switch:  
      {{#switch:  
         {{#if:{{#var:Role|}}|
         {{#if:{{#var:Role|}}|
             {{Monster Role|transcludesection={{#var:Role}}DmgMult
             {{Monster Role|transcludesection={{#var:Role}}DmgMult
Line 53: Line 51:
         }} {{{2}}} round 0 |
         }} {{{2}}} round 0 |
       }}
       }}
   }} -  
   }} - {{#expr: ceil
  {{#expr: ceil
       {{#switch:  
       {{#switch:  
         {{#ifexpr: ({{#var:CR}}  
         {{#ifexpr: ({{#var:CR}}  
Line 68: Line 65:
             }}
             }}
         }} |1|2|3|4|5 = 1|6|7|8|9|10 = 2|11|12|13|14|15 = 3|16|17|18|19|20 = 4|21|22|23|24|25 = 5|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44 = 6|#default = 1
         }} |1|2|3|4|5 = 1|6|7|8|9|10 = 2|11|12|13|14|15 = 3|16|17|18|19|20 = 4|21|22|23|24|25 = 5|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44 = 6|#default = 1
       }} *  
       }} * {{#if: {{{4|}}}|
      {{#if: {{{4|}}}|
         {{#switch: {{{4|}}}|d4 = 2.5|d6 = 3.5|d8 = 4.5|d10 = 5.5|d12 = 6.5|#default = 4.5
         {{#switch: {{{4|}}}|d4 = 2.5|d6 = 3.5|d8 = 4.5|d10 = 5.5|d12 = 6.5|#default = 4.5
         }}|
         }}|
Line 114: Line 110:
             }}
             }}
         }}
         }}
       }}) *  
       }}) * {{#ifeq:
      {{#ifeq:
         {{#var:MeleeOrNatural|Natural
         {{#var:MeleeOrNatural|Natural
         }}|Natural|0.6666|0.5
         }}|Natural|0.6666|0.5
       }} *  
       }} * {{#switch:  
      {{#switch:  
         {{#if:{{#var:Role|}}|
         {{#if:{{#var:Role|}}|
             {{Monster Role|transcludesection={{#var:Role}}DmgMult
             {{Monster Role|transcludesection={{#var:Role}}DmgMult
Line 132: Line 126:
         }} {{{2}}} round 0 |
         }} {{{2}}} round 0 |
       }}
       }}
   }} -  
   }} - {{#expr: ceil
  {{#expr: ceil
       {{#switch:  
       {{#switch:  
         {{#ifexpr: ({{#var:CR}}  
         {{#ifexpr: ({{#var:CR}}  
Line 147: Line 140:
             }}
             }}
         }} |1|2|3|4|5 = 1|6|7|8|9|10 = 2|11|12|13|14|15 = 3|16|17|18|19|20 = 4|21|22|23|24|25 = 5|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44 = 6|#default = 1
         }} |1|2|3|4|5 = 1|6|7|8|9|10 = 2|11|12|13|14|15 = 3|16|17|18|19|20 = 4|21|22|23|24|25 = 5|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44 = 6|#default = 1
       }} *  
       }} * {{#if: {{{4|}}}|
      {{#if: {{{4|}}}|
         {{#switch: {{{4|}}}|d4 = 2.5|d6 = 3.5|d8 = 4.5|d10 = 5.5|d12 = 6.5|#default = 4.5
         {{#switch: {{{4|}}}|d4 = 2.5|d6 = 3.5|d8 = 4.5|d10 = 5.5|d12 = 6.5|#default = 4.5
         }}|
         }}|
Line 179: Line 171:
             }}
             }}
         }}
         }}
       }}) *  
       }}) * {{#ifeq:
      {{#ifeq:
         {{#var:MeleeOrNatural|Natural
         {{#var:MeleeOrNatural|Natural
         }}|Natural|0.6666|0.5
         }}|Natural|0.6666|0.5
       }} *  
       }} * {{#switch:  
      {{#switch:  
         {{#if:{{#var:Role|}}|
         {{#if:{{#var:Role|}}|
             {{Monster Role|transcludesection={{#var:Role}}DmgMult
             {{Monster Role|transcludesection={{#var:Role}}DmgMult
Line 233: Line 223:
             }}
             }}
         }}
         }}
       }}) *  
       }}) * {{#ifeq:
      {{#ifeq:
         {{#var:MeleeOrNatural|Natural
         {{#var:MeleeOrNatural|Natural
         }}|Natural|0.6666|0.5
         }}|Natural|0.6666|0.5
       }} *  
       }} * {{#switch:  
      {{#switch:  
         {{#if:{{#var:Role|}}|
         {{#if:{{#var:Role|}}|
             {{Monster Role|transcludesection={{#var:Role}}DmgMult
             {{Monster Role|transcludesection={{#var:Role}}DmgMult
Line 251: Line 239:
         }} {{{2}}} round 0 |
         }} {{{2}}} round 0 |
       }}
       }}
   }} -  
   }} - {{#expr: ceil
  {{#expr: ceil
       {{#switch:  
       {{#switch:  
         {{#ifexpr: ({{#var:CR}}  
         {{#ifexpr: ({{#var:CR}}  
Line 266: Line 253:
             }}
             }}
         }} |1|2|3|4|5 = 1|6|7|8|9|10 = 2|11|12|13|14|15 = 3|16|17|18|19|20 = 4|21|22|23|24|25 = 5|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44 = 6|#default = 1
         }} |1|2|3|4|5 = 1|6|7|8|9|10 = 2|11|12|13|14|15 = 3|16|17|18|19|20 = 4|21|22|23|24|25 = 5|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44 = 6|#default = 1
       }} *  
       }} * {{#if: {{{4|}}}|
      {{#if: {{{4|}}}|
         {{#switch: {{{4|}}}|d4 = 2.5|d6 = 3.5|d8 = 4.5|d10 = 5.5|d12 = 6.5|#default = 4.5
         {{#switch: {{{4|}}}|d4 = 2.5|d6 = 3.5|d8 = 4.5|d10 = 5.5|d12 = 6.5|#default = 4.5
         }}|
         }}|

Revision as of 19:38, 12 December 2017

Outputs the damage string of a primary melee or bite attack (e.g. 3d6+2) when called, based on the CR of the monster. Primarily used inside the Monster template. Call as follows:

{{Primary-Dmg}}

Parameters (all are optional):
1: modify CR with a positive or negative number. -2 lowers CR by two before outputting damage value.
2: modify numeric value with a positive or negative number. -2 lowers damage value by 2 before outputting the damage value.
3: modify the operand. Addition is used by default (with negative numbers subtracting). Values are "mult" and "div", allowing parameters 1 and 2 to multiply or divide their values.
4: modify the die size. Primary damage, if melee, uses a d8 by default. Primary damage, if natural, uses a d10 by default. Values are: d4, d6, d8, d10, d12.

Examples:

{{Primary-Dmg|-2}} - outputs damage as though CR was two lower than actual.
{{Primary-Dmg||2|mult|d10}} - outputs damage double normal value, expressed as using d10's.