Difference between revisions of "Template:5e Weapon"

From Dungeons and Dragons Wiki
Jump to: navigation, search
m
(canon, case for missing value for damage due to pointer article)
Line 1: Line 1:
<includeonly>'''<big>{{{weap}}}</big>'''{{#if:{{{sorttext|}}}|{{DEFAULTSORTKEY:{{{sorttext}}} 5e}}|{{DEFAULTSORTKEY:{{PAGENAME}} 5e}} }}[[Category:5e Weapons]]
+
<includeonly>'''<big>{{{weap}}}</big>'''{{#if:{{{sorttext|}}}|{{DEFAULTSORTKEY:{{{sorttext}}} 5e}}|{{DEFAULTSORTKEY:{{PAGENAME}} 5e}} }}[[Category:5e Weapons]]{{#if: {{{canon|}}}|{{#set: Canon=true}}[[Category:5e Canon Weapons]]|}}
  
 
'''{{#switch: {{{smo}}}
 
'''{{#switch: {{{smo}}}
Line 16: Line 16:
 
!Name
 
!Name
 
!Cost
 
!Cost
!Damage
+
!{{#if: {{{damage|}}}|Damage|Damage Type|}}
 
!Weight
 
!Weight
 
!Properties
 
!Properties
Line 22: Line 22:
 
|{{{weap}}}
 
|{{{weap}}}
 
|align="right"|{{#if: {{{cost|}}} | [[Cost::{{{cost}}}]] | [[Cost::—]]}} <!-- cost -->
 
|align="right"|{{#if: {{{cost|}}} | [[Cost::{{{cost}}}]] | [[Cost::—]]}} <!-- cost -->
|{{{damage}}}{{#set:Damage={{{damage}}}}}&nbsp;{{#switch: {{{dtype}}}
+
|{{#if: {{{damage|}}}|{{{damage}}}{{#set:Damage={{{damage}}}}}&nbsp;|}}{{#switch: {{{dtype}}}
   |b = [[SRD5:Bludgeoning{{!}}Bludgeoning]]{{#set:DamageType=Bludgeoning}}
+
   |b = [[SRD5:Bludgeoning{{!}}bludgeoning]]{{#set:DamageType=Bludgeoning}}
   |p = [[SRD5:Piercing{{!}}Piercing]]{{#set:DamageType=Piercing}}
+
   |p = [[SRD5:Piercing{{!}}piercing]]{{#set:DamageType=Piercing}}
   |s = [[SRD5:Slashing{{!}}Slashing]]{{#set:DamageType=Slashing}}
+
   |s = [[SRD5:Slashing{{!}}slashing]]{{#set:DamageType=Slashing}}
 
   |none = {{#set:DamageType=—}}
 
   |none = {{#set:DamageType=—}}
 
   |#default = [[DamageType::{{{dtype}}}]]
 
   |#default = [[DamageType::{{{dtype}}}]]
Line 31: Line 31:
 
}}
 
}}
 
|align="center"|{{#if: {{{weight|}}} | [[Weight::{{{weight}}}]]&nbsp;lbs | [[Weight::—]]}}
 
|align="center"|{{#if: {{{weight|}}} | [[Weight::{{{weight}}}]]&nbsp;lbs | [[Weight::—]]}}
| {{#if: {{{ammo|}}} | [[SRD5:Ammunition{{!}}Ammunition]][[Category:5e Ammunition Weapons]] {{#set:Ammunition=true}}{{#set:Properties=Ammunition}} &nbsp;}} {{#if: {{{fine|}}} | [[SRD5:Finesse{{!}}Finesse]][[Category:5e Finesse Weapons]]{{#set:Finesse=true}}{{#set:Properties=Finesse}} &nbsp;}} {{#if: {{{heavy|}}} | [[SRD5:Heavy Weapon{{!}}Heavy]][[Category:5e Heavy Weapons]]{{#set:Heavy=true}}{{#set:Properties=Heavy}} &nbsp;}} {{#if: {{{light|}}} | [[SRD5:Light Weapon{{!}}Light]][[Category:5e Light Weapons]]{{#set:Light=true}}{{#set:Properties=Light}} &nbsp;}} {{#if: {{{load|}}} | [[SRD5:Loading{{!}}Loading]][[Category:5e Loading Weapons]]{{#set:Loading=true}}{{#set:Properties=Loading}} &nbsp;}} {{#if: {{{range|}}} | [[SRD5:Range{{!}}Range]] ({{{range}}}) {{#set:Range={{{range}}}}}{{#set:Properties=Range}}&nbsp;}} {{#if: {{{reach|}}} | [[SRD5:Reach{{!}}Reach]][[Category:5e Reach Weapons]] &nbsp;{{#set: Reach=true}}{{#set:Properties=Reach}}|}} {{#if: {{{special|}}} | [[SRD5:Special{{!}}Special]] [[Category:5e Special Weapons]] &nbsp;{{#set: Special=true}}{{#set:Properties=Special}}|}} {{#if: {{{thrown|}}} | [[SRD5:Thrown{{!}}Thrown]][[Category:5e Thrown Weapons]]{{#set:Thrown=true}}{{#set:Properties=Thrown}} &nbsp;}} {{#if: {{{twohand|}}} | [[SRD5:Two-Handed{{!}}Two-Handed]][[Category:5e Two-Handed Weapons]]{{#set:Two-Handed=true}}{{#set:Properties=Two-Handed}} &nbsp;}} {{#if: {{{vers|}}} | [[SRD5:Versatile{{!}}Versatile]] ({{{vers}}})[[Category:5e Versatile Weapons]]{{#set:Versatile=true}}{{#set:Properties=Versatile}} &nbsp;}} {{#switch: {{{otherp}}}
+
|{{#if: {{{ammo|}}}|[[SRD5:Ammunition{{!}}Ammunition]][[Category:5e Ammunition Weapons]]{{#set:Ammunition=true}}{{#set: Properties=Ammunition}}{{5e Weapon Prop Not First|fine={{{fine|}}}|heavy={{{heavy|}}}|light={{{light|}}}|load={{{load|}}}|range={{{range|}}}|reach={{{reach|}}}|special={{{special|}}}|thrown={{{thrown|}}}|twohand={{{twohand|}}}|vers={{{vers|}}}|otherp={{{otherp|}}}}}|<!--not ammo-->{{#if: {{{fine|}}}|{{SRD5|Finesse}}[[Category:5e Finesse Weapons]]{{#set:Finesse=true}}{{#set:Properties=Finesse}}{{5e Weapon Prop Not First|heavy={{{heavy|}}}|light={{{light|}}}|load={{{load|}}}|range={{{range|}}}|reach={{{reach|}}}|special={{{special|}}}|thrown={{{thrown|}}}|twohand={{{twohand|}}}|vers={{{vers|}}}|otherp={{{otherp|}}}}}|<!--Not fine-->{{#if: {{{heavy|}}}{{SRD5|Heavy}}[[Category:5e Heavy Weapons]]{{#set:Heavy=true}}{{#set:Properties=Heavy}}{{5e Weapon Prop Not First|light={{{light|}}}|load={{{load|}}}|range={{{range|}}}|reach={{{reach|}}}|special={{{special|}}}|thrown={{{thrown|}}}|twohand={{{twohand|}}}|vers={{{vers|}}}|otherp={{{otherp|}}}}}|<!--not heavy-->{{#if: {{{light|}}}|{{SRD5|Light}}[[Category:5e Light Weapons]]{{#set:Light=true}}{{#set:Properties=Light}}{{5e Weapon Prop Not First|load={{{load|}}}|range={{{range|}}}|reach={{{reach|}}}|special={{{special|}}}|thrown={{{thrown|}}}|twohand={{{twohand|}}}|vers={{{vers|}}}|otherp={{{otherp|}}}}}|<!--not Light-->{{#if: {{{load|}}}|{{SRD5|Loading}}[[Category:5e Loading Weapons]]{{#set:Loading=true}}{{#set:Properties=Loading}}{{5e Weapon Prop Not First|range={{{range|}}}|reach={{{reach|}}}|special={{{special|}}}|thrown={{{thrown|}}}|twohand={{{twohand|}}}|vers={{{vers|}}}|otherp={{{otherp|}}}}}|<!--not Load-->{{#if: {{{range|}}}|{{SRD5|Range}}&ensp;({{{range}}}){{#set:Range={{{range}}}}}{{#set:Properties=Range&ensp;({{{range}}})}}{{5e Weapon Prop Not First|reach={{{reach|}}}|special={{{special|}}}|thrown={{{thrown|}}}|twohand={{{twohand|}}}|vers={{{vers|}}}|otherp={{{otherp|}}}}}|<!--not Range-->{{#if: {{{reach|}}}|{{SRD5|Reach}}[[Category:5e Reach Weapons]]{{#set:Reach=true}}{{#set:Properties=Reach}}{{5e Weapon Prop Not First|special={{{special|}}}|thrown={{{thrown|}}}|twohand={{{twohand|}}}|vers={{{vers|}}}|otherp={{{otherp|}}}}}|<!--not Reach-->{{#if: {{{special|}}}|{{SRD5|Special}}[[Category:5e Special Weapons]]{{#set:Special=true}}{{#set:Properties=Special}}{{5e Weapon Prop Not First|thrown={{{thrown|}}}|twohand={{{twohand|}}}|vers={{{vers|}}}|otherp={{{otherp|}}}}}|<!--not Special-->{{#if: {{{thrown|}}}|{{SRD5|Thrown}}[[Category:5e Thrown Weapons]]{{#set:Thrown=true}}{{#set:Properties=Thrown}}{{5e Weapon Prop Not First|twohand={{{twohand|}}}|vers={{{vers|}}}|otherp={{{otherp|}}}}}|<!--not Thrown-->{{#if: {{{twohand|}}}|{{SRD5|Two-Handed}}[[Category:5e Two-Handed Weapons]]{{#set:Two-Handed=true}}{{#set:Properties=Two-Handed}}{{5e Weapon Prop Not First|vers={{{vers|}}}|otherp={{{otherp|}}}}}|<!--not Twohand-->{{#if: {{{vers|}}}|{{SRD5|Versatile}}[[Category:5e Versatile Weapons]]{{#set:Versatile=true}}{{#set:Properties=Versatile}}{{5e Weapon Prop Not First|otherp={{{otherp|}}}}}|<!--not Versatile-->{{#if: {{{otherp|}}}|{{5e Weapon Other Property|{{{otherp}}}}}|<!--No Properties-->}}<!end otherp-->}}<!--end versa-->|}}<!--end twohand-->|}}<!--end thrown-->|}}<!--end special-->|}}<!--end reach-->|}}<!--end range-->|}}<!--end load-->|}}<!--end light-->|}}<!--end heavy-->|}}<!--end fine-->|}}<!--end ammo-->
| Exotic = [[Exotic Weapon (5e Variant Rule)|Exotic]]{{#set:Exotic=true}}{{#set:OtherP=true}} {{#set: Properties=Exotic}}
+
|}{{#if: {{{note|}}} |<br />'''Note:''' {{{note}}} }}</includeonly><noinclude>
| {{{otherp}}} {{#set:OtherP=true}}{{#set: Properties=Other}}
 
}}
 
|}
 
&nbsp;
 
{{#if: {{{note|}}} | {{{note}}} }}  
 
 
 
 
 
</includeonly><noinclude>
 
 
{{documentation}}
 
{{documentation}}
[[Category:5e Templates]]
+
[[Category:5e Templates|Weapon Template 5e]]
 
</noinclude>
 
</noinclude>

Revision as of 19:49, 15 June 2019

Template documentation (for the above template, sometimes hidden or invisible)

Syntax

{{5e Weapon
|weap= <!--name-->
|sorttext= <!--blank, or category sort-->
|smo= <!-- s=simple m=martial value if other (ex. exotic, dwarven only) -->
|mr= <!-- m=melee r=ranged -->
|damage=
|dtype= <!--(b=bludgeoning, p=piercing, s=slashing, value if other)-->
|weight= <!-- in lbs. -->
|cost=
|ammo= <!-- y=uses Ammunition-->
|fine= <!-- y=is Finesse -->
|heavy= <!-- y=is Heavy -->
|light= <!-- y=is Light -->
|load= <!-- y=Loading -->
|range= <!-- enter value, example: 20/60) -->
|reach= <!-- y=has Reach -->
|special= <!-- y=has Special rules -->
|thrown= <!-- y=may be thrown -->
|twohand= <!-- y=is two-handed weapon -->
|vers= <!-- enter value if Versatile, example: 1d10 -->
|otherp= <!-- enter value if non-standard property, example: exotic -->
|note= <!-- add'l notes -->
}}

Add'l Entries

|canon=true <!-- for published weapons -->
|magic=true <!-- for magic weapons -->
|polearm=true <!-- if polearm -->
|polearm bonus attack=true <!-- if polearm master feat grants bonus attack -->
|polearm op attack reach=true <!-- if polearm feat givess reach to op attack -->

Examples

The example weapon below is defined in wiki-text as follows:

{{5e Weapon
|weap=Needler
|sorttext= <!--blank, or category sort-->
|smo=m <!-- s=simple m=martial value if other (ex. exotic, dwarven only) -->
|mr=r <!-- m=melee r=ranged -->
|damage=1d4
|dtype=p <!--(b=bludgeoning, p=piercing, s=slashing, value if other)-->
|weight=1 <!-- in lbs. -->
|cost=30
|ammo=y <!-- y=uses Ammunition-->
|fine= <!-- y=is Finesse -->
|heavy= <!-- y=is Heavy -->
|light=y <!-- y=is Light -->
|load=y <!-- y=Loading -->
|range=60/120 <!-- enter value, example: 20/60) -->
|reach= <!-- y=has Reach -->
|special= <!-- y=has Special rules -->
|thrown= <!-- y=may be thrown -->
|twohand= <!-- y=is two-handed weapon -->
|vers= <!-- enter value if Versatile, example: 1d10 -->
|otherp= <!-- enter value if non-standard property, example: exotic -->
|note= <!-- add'l notes -->
}}

This text becomes:

Needler

Martial Ranged Weapon

Name Cost Damage Weight Properties
Needler 30 1d4 piercing 1 lbs Ammunition, Light, Loading, Range (60/120)

Visit Template:5e Weapon/doc to edit this text! (How does this work?)