Difference between revisions of "Template:5e Weapon"

From Dungeons and Dragons Wiki
Jump to: navigation, search
m
m (refs)
 
(34 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>'''<big>{{{weap}}}</big>'''
+
<includeonly>'''<big>{{{weap}}}</big>''' {{{refs|}}}{{#if:{{{sorttext|}}}|{{DEFAULTSORTKEY:{{{sorttext}}} 5e}}|{{DEFAULTSORTKEY:{{PAGENAME}} 5e}} }}[[Category:5e Weapons]]{{#if: {{{canon|}}}|{{#set: Canon=true}}[[Category:5e Canon Weapons]]|}}
  
 
'''{{#switch: {{{smo}}}
 
'''{{#switch: {{{smo}}}
   |s = [[Proficiency::Simple]]
+
   |s = [[Proficiency::Simple]] [[Category:5e Simple Weapons]]  
   |m = [[Proficiency::Martial]]
+
   |m = [[Proficiency::Martial]] [[Category:5e Martial Weapons]]
 
   |#default = [[Proficiency::{{{smo}}}]]
 
   |#default = [[Proficiency::{{{smo}}}]]
 
   |<span style="color: red;">Enter 's'imple, 'm'artial, or value for parameter 'sme'</span>
 
   |<span style="color: red;">Enter 's'imple, 'm'artial, or value for parameter 'sme'</span>
 
}} {{#switch: {{{mr}}}
 
}} {{#switch: {{{mr}}}
   |m = [[Type::Melee]]
+
   |m = [[Type::Melee]] [[Category:5e Melee Weapons]]
   |r = [[Type::Ranged]]
+
   |r = [[Type::Ranged]][[Category:5e Ranged Weapons]]
 
   |none = {{#set:Type=—}}
 
   |none = {{#set:Type=—}}
 
   |#default = [[Type::{{{mr}}}]]
 
   |#default = [[Type::{{{mr}}}]]
 
   |<span style="color: red;">Enter 'm'=melee, 'r'=ranged, or 'none', for parameter 'mr'</span>
 
   |<span style="color: red;">Enter 'm'=melee, 'r'=ranged, or 'none', for parameter 'mr'</span>
}} '''
+
}} [[SRD5:Weapon|Weapon]]'''
{| class="zebra"
+
{| class="d20 zebra"
 
!Name
 
!Name
 
!Cost
 
!Cost
!Damage
+
!{{#if: {{{damage|}}}|Damage|Damage Type|}}
 
!Weight
 
!Weight
 
!Properties
 
!Properties
 
|-
 
|-
 
|{{{weap}}}
 
|{{{weap}}}
|align="right"|{{#if: {{{cost|}}} | [[Cost::{{{cost}}} {{#ifeq: {{{cost}}}|Varies||gp}}]] | [[Cost::—]]}} <!-- cost -->
+
|align="right"|{{#if: {{{cost|}}} | [[Cost::{{{cost}}}]] | [[Cost::—]]}} <!-- cost -->
|{{{damage}}}&nbsp;{{#switch: {{{dtype}}}
+
|{{#if: {{{damage|}}}|{{{damage}}}{{#set:Damage={{{damage}}}}}&nbsp;|}}{{#switch: {{{dtype}}}
   |b = [[SRD5:Bludgeoning{{!}}Bludgeoning]]
+
   |b = [[SRD5:Bludgeoning{{!}}bludgeoning]]{{#set:DamageType=Bludgeoning}}
   |p = [[SRD5:Piercing{{!}}Piercing]]
+
   |p = [[SRD5:Piercing{{!}}piercing]]{{#set:DamageType=Piercing}}
   |s = [[SRD5:Slashing{{!}}Slashing]]
+
   |s = [[SRD5:Slashing{{!}}slashing]]{{#set:DamageType=Slashing}}
   |none = {{#set:Type=—}}
+
   |none = {{#set:DamageType=—}}
   |#default - {{#set:DamageType={{{dtype}}} }}
+
   |#default = [[DamageType::{{{dtype}}}]]
 
   |<span style="color: red;">Enter 'b', 'p', 's', or value for parameter 'dtype'</span>
 
   |<span style="color: red;">Enter 'b', 'p', 's', or value for parameter 'dtype'</span>
 
}}
 
}}
 
|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]] &nbsp;}} {{#if: {{{fine|}}} | [[SRD5:Finesse{{!}}Finesse]] [[Category:5e Finesse Weapons]]{{#set:multiprop=y}} &nbsp;}} {{#if: {{{heavy|}}} | [[SRD5:Heavy{{!}}Heavy]] [[Category:5e Heavy Weapons]] &nbsp;}} {{#if: {{{light|}}} | [[SRD5:Light Weapon{{!}}Light]] [[Category:5e Light Weapons]] &nbsp;}} {{#if: {{{load|}}} | [[SRD5:Loading{{!}}Loading]] [[Category:5e Loading Weapons]] &nbsp;}} {{#if: {{{range|}}} | [[SRD5:Range{{!}}Range]] ({{{range}}}) &nbsp;}} {{#if: {{{reach|}}} | [[SRD5:Reach{{!}}Reach]] [[Category:5e Reach Weapons]] &nbsp;}} {{#if: {{{special|}}} | [[SRD5:Special{{!}}Special]] [[Category:5e Special Weapons]] &nbsp;}} {{#if: {{{thrown|}}} | [[SRD5:Thrown{{!}}Thrown]] [[Category:5e Thrown Weapons]] &nbsp;}} {{#if: {{{vers|}}} | [[SRD5:Versatile{{!}}Versatile]] ({{{vers}}}) &nbsp;}} {{#if: {{{otherp|}}} | {{{otherp}}} &nbsp;}}
+
|{{#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}} ({{{vers}}})[[Category:5e Versatile Weapons]]{{#set:Versatile=true}}{{#set:Properties=Versatile ({{{vers}}})}}{{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-->{{#switch: {{{magic|}}}
|}
+
| True =
&nbsp;
+
| true =
{{#if: {{{note|}}} | {{{note}}} }}  
+
| y =
 
+
| Y =
 
+
| t =
</includeonly><noinclude>{{documentation}}</noinclude>
+
| T = {{#set: Magic=true}}
 +
| False =
 +
| false =
 +
| n =
 +
| N =
 +
| f =
 +
| F = {{#set: Magic=false}}
 +
| {{#set: Magic=false}}
 +
}}{{#if: {{{polearm|}}}|[[Category:5e Polearms]]{{#set: Polearm=true}}{{#if: {{{polearm bonus attack|}}}|{{#set: Polearm Bonus Attack=true}}|}}{{#if: {{{polearm op attack reach|}}}|{{#set: Polearm Opportunity Reach Attack=true}}|}}|}}
 +
|}{{#if: {{{note|}}} |<br />'''Note:''' {{{note}}} }}</includeonly><noinclude>
 +
{{documentation}}
 +
[[Category:5e Templates|Weapon Template 5e]]
 +
</noinclude>

Latest revision as of 17:25, 31 December 2022

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

Syntax[edit]

{{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[edit]

|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[edit]

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?)