Difference between revisions of "Template:Weapon Display"

From Dungeon Defenders 2 Wiki
Jump to: navigation, search
(Undo revision 19568 by Hywell (talk))
(Reverting changes)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
 
{{#tag: gallery |
 
{{#tag: gallery |
{{#ifexist: File:{{{name}}}.png
+
{{#if: {{{image|}}}
 +
  | {{{image}}}
 
   | File:{{{name}}}.png
 
   | File:{{{name}}}.png
  | {{{image|UNKNOWN IMAGE PLACEHOLDER}}}
 
 
}}|heights = 200px | style = transform: rotate({{{rotation|0}}}deg)
 
}}|heights = 200px | style = transform: rotate({{{rotation|0}}}deg)
 
}}
 
}}
{{#ifexist: File:{{{name}}} Icon.png
+
{{#if: {{{icon|}}}
 +
  | [[{{{icon}}}|35px]]
 
   | [[File:{{{name}}} Icon.png|35px]]
 
   | [[File:{{{name}}} Icon.png|35px]]
  | [[{{{icon|File:Miscellaneous Enemy Icon.png}}}|35px]]
 
 
}} '''{{{name|Weapon Name?}}}'''<br>
 
}} '''{{{name|Weapon Name?}}}'''<br>
 +
{{#if: {{{note|}}}
 +
  | <sub>''{{{note}}}''</sub><br>
 +
}}
 
{{#if: {{{shot_types|}}}
 
{{#if: {{{shot_types|}}}
   | <sub>'''''Shot type:''' {{{shot_types}}}''</sub><br>
+
   | <sub>'''''Shot types:''' {{{shot_types}}}''</sub><br>
 
}}
 
}}
<sub>'''''Acquired From:'''<br>{{{acquisition|Acquisition?}}}''</sub><!--
+
<sub class="currency-included">'''''Acquired From:'''<br>{{{acquisition|Standard Loot Drops}}}''</sub><!--
 
--></includeonly><noinclude>
 
--></includeonly><noinclude>
 
* '''This Template may not produce the desired output if not placed in a table with text align set to center. Refer to weapons pages such as [[Polearms]] for examples.'''<br>
 
* '''This Template may not produce the desired output if not placed in a table with text align set to center. Refer to weapons pages such as [[Polearms]] for examples.'''<br>
 
* If '''image''' and '''icon''' are not provided, they will be inferred from the '''name'''.
 
* If '''image''' and '''icon''' are not provided, they will be inferred from the '''name'''.
 +
** '''The automatic detection for image and icon will stop working after 50 uses of this template on a single page, due to limitations with the #ifexist function that this template uses.'''
  
 
===Parameters===
 
===Parameters===
{| border="1"
+
{| border="1" class="wikitable TemplateDocumentation"
 +
|-
 +
! Parameter !! Required !! Description !! Default
 
|-
 
|-
! Parameter !! Required !! Description
+
| name || {{yes}} || The name of the weapon. || Weapon Name?
 
|-
 
|-
| name || {{yes}} || The name of the weapon.
+
| image || {{no}} || The image for the weapon. || File:{{{name}}}.png
 
|-
 
|-
| image || {{no}} || The image for the weapon.
+
| rotation || {{no}} || How many degrees to rotate the weapon image display by. || 0
 
|-
 
|-
| rotation || {{no}} || How many degrees to rotate the weapon image display by.
+
| icon || {{no}} || The icon for the weapon. || File:{{{name}}} Icon.png
 
|-
 
|-
| icon || {{no}} || The icon for the weapon.
+
| note || {{no}} || Additional notes about the weapon. || Nothing
 
|-
 
|-
| shot_types || {{no}} || Valid shot types for the weapon.
+
| shot_types || {{no}} || Valid shot types for the weapon. || Nothing
 
|-
 
|-
| acquisition || {{yes}} || Acquisition for the weapon.
+
| acquisition || {{no}} || Acquisition for the weapon. || "Standard Loot Drops"
 
|}
 
|}
  
Line 49: Line 55:
 
       |
 
       |
 
       {{Weapon Display
 
       {{Weapon Display
       | name = Earth Guardian's Spear
+
       | name = Protean Staff
      | image = File:Earth Guardian's Spear.png
 
 
       | rotation = 40
 
       | rotation = 40
       | icon = File:Earth Guardian's Spear Icon.jpg   
+
       | note = Comes with Shrinkinator Unique Enemy Kill Animation
       | acquisition = Crystal Mine Chaos 8+
+
      | shot_types = Burst Shot
 +
       | acquisition = The Emporium for 250 gems
 
       }}
 
       }}
 
       |}
 
       |}
Line 66: Line 72:
 
|
 
|
 
{{Weapon Display
 
{{Weapon Display
| name = Earth Guardian's Spear
+
| name = Protean Staff
| image = File:Earth Guardian's Spear.png
 
 
| rotation = 40
 
| rotation = 40
| icon = File:Earth Guardian's Spear Icon.jpg
+
| note = Comes with Shrinkinator Unique Enemy Kill Animation
| acquisition = Crystal Mine Chaos 8+
+
| shot_types = Burst Shot
 +
| acquisition = The Emporium for 250 gems
 
}}
 
}}
 
|}
 
|}

Latest revision as of 13:31, 17 December 2023

  • This Template may not produce the desired output if not placed in a table with text align set to center. Refer to weapons pages such as Polearms for examples.
  • If image and icon are not provided, they will be inferred from the name.
    • The automatic detection for image and icon will stop working after 50 uses of this template on a single page, due to limitations with the #ifexist function that this template uses.

Parameters

Parameter Required Description Default
name TickGreen.png The name of the weapon. Weapon Name?
image CrossWhite.png The image for the weapon. File:{{{name}}}.png
rotation CrossWhite.png How many degrees to rotate the weapon image display by. 0
icon CrossWhite.png The icon for the weapon. File:{{{name}}} Icon.png
note CrossWhite.png Additional notes about the weapon. Nothing
shot_types CrossWhite.png Valid shot types for the weapon. Nothing
acquisition CrossWhite.png Acquisition for the weapon. "Standard Loot Drops"

Example

Wiki Text Result
{| style="text-align:center;" |- | {{Weapon Display | name = Protean Staff | rotation = 40 | note = Comes with Shrinkinator Unique Enemy Kill Animation | shot_types = Burst Shot | acquisition = The Emporium for 250 gems }} |}

Protean Staff Icon.png Protean Staff
Comes with Shrinkinator Unique Enemy Kill Animation
Shot types: Burst Shot
Acquired From:
The Emporium for 250 gems